@intuitionrobotics/user-account 0.43.4 → 0.44.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.
- package/app-backend/api/_user-account.js +2 -2
- package/app-backend/api/_user-account.js.map +1 -1
- package/app-backend/api/v1/account/_assert.d.ts +3 -2
- package/app-backend/api/v1/account/_assert.js +6 -24
- package/app-backend/api/v1/account/_assert.js.map +1 -1
- package/app-backend/api/v1/account/create.js +6 -24
- package/app-backend/api/v1/account/create.js.map +1 -1
- package/app-backend/api/v1/account/list.js +6 -24
- package/app-backend/api/v1/account/list.js.map +1 -1
- package/app-backend/api/v1/account/login-saml.js +4 -22
- package/app-backend/api/v1/account/login-saml.js.map +1 -1
- package/app-backend/api/v1/account/login.js +12 -24
- package/app-backend/api/v1/account/login.js.map +1 -1
- package/app-backend/api/v1/account/logout.js +9 -26
- package/app-backend/api/v1/account/logout.js.map +1 -1
- package/app-backend/api/v1/account/upsert.js +10 -9
- package/app-backend/api/v1/account/upsert.js.map +1 -1
- package/app-backend/api/v1/account/validate.js +6 -24
- package/app-backend/api/v1/account/validate.js.map +1 -1
- package/app-backend/apis/add-new-account.d.ts +3 -3
- package/app-backend/apis/add-new-account.js +12 -24
- package/app-backend/apis/add-new-account.js.map +1 -1
- package/app-backend/core/module-pack.d.ts +0 -2
- package/app-backend/core/module-pack.js +0 -30
- package/app-backend/core/module-pack.js.map +1 -1
- package/app-backend/modules/AccountModule.d.ts +7 -4
- package/app-backend/modules/AccountModule.js +54 -64
- package/app-backend/modules/AccountModule.js.map +1 -1
- package/app-backend/modules/JWTBuilder.d.ts +1 -1
- package/app-backend/modules/JWTBuilder.js +6 -5
- package/app-backend/modules/JWTBuilder.js.map +1 -1
- package/app-backend/modules/SamlModule.d.ts +3 -2
- package/app-backend/modules/SamlModule.js +7 -5
- package/app-backend/modules/SamlModule.js.map +1 -1
- package/app-backend/modules/SecretsModule.d.ts +4 -2
- package/app-backend/modules/SecretsModule.js +28 -25
- package/app-backend/modules/SecretsModule.js.map +1 -1
- package/app-backend/modules/{_imports.d.ts → types.d.ts} +1 -2
- package/app-backend/modules/types.js +3 -0
- package/app-backend/modules/types.js.map +1 -0
- package/app-frontend/core/module-pack.d.ts +0 -1
- package/app-frontend/core/module-pack.js +0 -11
- package/app-frontend/core/module-pack.js.map +1 -1
- package/app-frontend/modules/AccountModule.d.ts +3 -2
- package/app-frontend/modules/AccountModule.js +38 -50
- package/app-frontend/modules/AccountModule.js.map +1 -1
- package/index.d.ts +0 -2
- package/index.js +0 -31
- package/index.js.map +1 -1
- package/package.json +5 -5
- package/shared/api.d.ts +1 -1
- package/shared/api.js +0 -18
- package/shared/api.js.map +1 -1
- package/shared/utils/AuthenticationConsts.js.map +1 -1
- package/app-backend/api/v1/account/_imports.d.ts +0 -4
- package/app-backend/api/v1/account/_imports.js +0 -36
- package/app-backend/api/v1/account/_imports.js.map +0 -1
- package/app-backend/modules/_imports.js +0 -32
- package/app-backend/modules/_imports.js.map +0 -1
- package/app-frontend/ui/Component_Login.d.ts +0 -21
- package/app-frontend/ui/Component_Login.js +0 -86
- package/app-frontend/ui/Component_Login.js.map +0 -1
- package/app-frontend/ui/Component_Register.d.ts +0 -17
- package/app-frontend/ui/Component_Register.js +0 -92
- package/app-frontend/ui/Component_Register.js.map +0 -1
- package/backend.d.ts +0 -2
- package/backend.js +0 -33
- package/backend.js.map +0 -1
- package/frontend.d.ts +0 -3
- package/frontend.js +0 -34
- package/frontend.js.map +0 -1
- package/shared/types.d.ts +0 -0
- package/shared/types.js +0 -20
- package/shared/types.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { AuditBy, DB_Object } from "@intuitionrobotics/ts-common";
|
|
2
|
-
export * from "../../index";
|
|
1
|
+
import { AuditBy, DB_Object } from "@intuitionrobotics/ts-common/utils/types";
|
|
3
2
|
export declare type RequestBody_SamlAssertOptions = {
|
|
4
3
|
request_body: {
|
|
5
4
|
SAMLResponse: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/types.ts"],"names":[],"mappings":""}
|
|
@@ -17,21 +17,10 @@
|
|
|
17
17
|
* See the License for the specific language governing permissions and
|
|
18
18
|
* limitations under the License.
|
|
19
19
|
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
21
|
exports.Frontend_ModulePack_Users = void 0;
|
|
32
22
|
const AccountModule_1 = require("../modules/AccountModule");
|
|
33
23
|
exports.Frontend_ModulePack_Users = [
|
|
34
24
|
AccountModule_1.AccountModule,
|
|
35
25
|
];
|
|
36
|
-
__exportStar(require("../modules/AccountModule"), exports);
|
|
37
26
|
//# sourceMappingURL=module-pack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-pack.js","sourceRoot":"","sources":["../../../src/main/app-frontend/core/module-pack.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG
|
|
1
|
+
{"version":3,"file":"module-pack.js","sourceRoot":"","sources":["../../../src/main/app-frontend/core/module-pack.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,4DAAuD;AAE1C,QAAA,yBAAyB,GAAG;IACrC,6BAAa;CAChB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OnUnauthenticatedResponse
|
|
1
|
+
import { StorageKey } from "@intuitionrobotics/thunderstorm/app-frontend/modules/StorageModule";
|
|
2
|
+
import { OnUnauthenticatedResponse } from "@intuitionrobotics/thunderstorm/app-frontend/core/Thunder";
|
|
3
3
|
import { Request_CreateAccount, Request_LoginAccount, RequestParams_LoginSAML, UI_Account } from "../../shared/api";
|
|
4
|
+
import { Module } from "@intuitionrobotics/ts-common/core/module";
|
|
4
5
|
export declare const StorageKey_UserEmail: StorageKey<string>;
|
|
5
6
|
export declare const StorageKey_JWT: StorageKey<string>;
|
|
6
7
|
export declare const RequestKey_AccountCreate = "account-create";
|
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -28,13 +10,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
10
|
};
|
|
29
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
12
|
exports.AccountModule = exports.AccountModule_Class = exports.LoggedStatus = exports.RequestKey_ValidateSession = exports.RequestKey_AccountLoginSAML = exports.RequestKey_AccountLogin = exports.RequestKey_AccountCreate = exports.StorageKey_JWT = exports.StorageKey_UserEmail = void 0;
|
|
31
|
-
const
|
|
32
|
-
const
|
|
13
|
+
const StorageModule_1 = require("@intuitionrobotics/thunderstorm/app-frontend/modules/StorageModule");
|
|
14
|
+
const XhrHttpModule_1 = require("@intuitionrobotics/thunderstorm/app-frontend/modules/http/XhrHttpModule");
|
|
15
|
+
const ToasterModule_1 = require("@intuitionrobotics/thunderstorm/app-frontend/modules/toaster/ToasterModule");
|
|
16
|
+
const HistoryModule_1 = require("@intuitionrobotics/thunderstorm/app-frontend/modules/HistoryModule");
|
|
17
|
+
const thunder_dispatcher_1 = require("@intuitionrobotics/thunderstorm/app-frontend/core/thunder-dispatcher");
|
|
33
18
|
const api_1 = require("../../shared/api");
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
const AuthenticationConsts_1 = require("../../shared/utils/AuthenticationConsts");
|
|
20
|
+
const module_1 = require("@intuitionrobotics/ts-common/core/module");
|
|
21
|
+
const consts_1 = require("@intuitionrobotics/thunderstorm/shared/consts");
|
|
22
|
+
const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
|
|
23
|
+
const date_time_tools_1 = require("@intuitionrobotics/ts-common/utils/date-time-tools");
|
|
24
|
+
exports.StorageKey_UserEmail = new StorageModule_1.StorageKey(`storage-${api_1.QueryParam_Email}`);
|
|
25
|
+
exports.StorageKey_JWT = new StorageModule_1.StorageKey(`storage-${api_1.QueryParam_JWT}`);
|
|
38
26
|
exports.RequestKey_AccountCreate = "account-create";
|
|
39
27
|
exports.RequestKey_AccountLogin = "account-login";
|
|
40
28
|
exports.RequestKey_AccountLoginSAML = "account-login-saml";
|
|
@@ -45,8 +33,8 @@ var LoggedStatus;
|
|
|
45
33
|
LoggedStatus[LoggedStatus["LOGGED_OUT"] = 1] = "LOGGED_OUT";
|
|
46
34
|
LoggedStatus[LoggedStatus["LOGGED_IN"] = 2] = "LOGGED_IN";
|
|
47
35
|
})(LoggedStatus = exports.LoggedStatus || (exports.LoggedStatus = {}));
|
|
48
|
-
const dispatch_onAccountsLoaded = new
|
|
49
|
-
class AccountModule_Class extends
|
|
36
|
+
const dispatch_onAccountsLoaded = new thunder_dispatcher_1.ThunderDispatcher("__onAccountsLoaded");
|
|
37
|
+
class AccountModule_Class extends module_1.Module {
|
|
50
38
|
constructor() {
|
|
51
39
|
super("AccountModule");
|
|
52
40
|
this.status = LoggedStatus.VALIDATING;
|
|
@@ -66,14 +54,14 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
66
54
|
this.dispatchUI_loginChanged.dispatchModule([]);
|
|
67
55
|
};
|
|
68
56
|
this.validateToken = () => {
|
|
69
|
-
|
|
70
|
-
.createRequest(
|
|
57
|
+
XhrHttpModule_1.XhrHttpModule
|
|
58
|
+
.createRequest(types_1.HttpMethod.GET, exports.RequestKey_ValidateSession)
|
|
71
59
|
.setLabel(`Validate token...`)
|
|
72
60
|
.setRelativeUrl("/v1/account/validate")
|
|
73
61
|
.setOnError((request, resError) => {
|
|
74
62
|
if (request.getStatus() === 0) {
|
|
75
|
-
|
|
76
|
-
setTimeout(() => exports.AccountModule.validateToken(), 30 *
|
|
63
|
+
ToasterModule_1.ToastModule.toastError("Cannot reach Server... trying in 30 sec");
|
|
64
|
+
setTimeout(() => exports.AccountModule.validateToken(), 30 * date_time_tools_1.Second);
|
|
77
65
|
return;
|
|
78
66
|
}
|
|
79
67
|
exports.StorageKey_JWT.delete();
|
|
@@ -90,8 +78,8 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
90
78
|
this.setLoggedStatus(LoggedStatus.LOGGED_OUT);
|
|
91
79
|
};
|
|
92
80
|
this.listUsers = () => {
|
|
93
|
-
|
|
94
|
-
.createRequest(
|
|
81
|
+
XhrHttpModule_1.XhrHttpModule
|
|
82
|
+
.createRequest(types_1.HttpMethod.GET, exports.RequestKey_ValidateSession)
|
|
95
83
|
.setLabel(`Fetching users...`)
|
|
96
84
|
.setRelativeUrl("/v1/account/query")
|
|
97
85
|
.execute((res) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -99,20 +87,20 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
99
87
|
dispatch_onAccountsLoaded.dispatchUI([]);
|
|
100
88
|
}));
|
|
101
89
|
};
|
|
102
|
-
|
|
90
|
+
XhrHttpModule_1.XhrHttpModule.addDefaultResponseHandler((request) => {
|
|
103
91
|
var _a;
|
|
104
92
|
const status = request.getStatus();
|
|
105
93
|
if (status < 200 || status >= 300)
|
|
106
94
|
return false;
|
|
107
95
|
try {
|
|
108
|
-
const
|
|
109
|
-
frontend_1.XhrHttpModule.logDebug(`${request.key} Function execution id: ${functionExecutionId}`);
|
|
110
|
-
const jwt = request.getResponseHeader(thunderstorm_1.HeaderKey_JWT);
|
|
96
|
+
const jwt = request.getResponseHeader(consts_1.HeaderKey_JWT);
|
|
111
97
|
if (jwt)
|
|
112
98
|
exports.StorageKey_JWT.set(jwt);
|
|
99
|
+
const functionExecutionId = (_a = request === null || request === void 0 ? void 0 : request.getResponseHeader) === null || _a === void 0 ? void 0 : _a.call(request, consts_1.HeaderKey_FunctionExecutionId);
|
|
100
|
+
XhrHttpModule_1.XhrHttpModule.logDebug(`${request.key} Function execution id: ${functionExecutionId}`);
|
|
113
101
|
}
|
|
114
102
|
catch (e) {
|
|
115
|
-
|
|
103
|
+
XhrHttpModule_1.XhrHttpModule.logWarning(`${request.key} - Failed to retrieve headers from xhr call`, e);
|
|
116
104
|
}
|
|
117
105
|
return false;
|
|
118
106
|
});
|
|
@@ -121,15 +109,15 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
121
109
|
return this.accounts;
|
|
122
110
|
}
|
|
123
111
|
init() {
|
|
124
|
-
|
|
125
|
-
this.dispatchUI_loginChanged = new
|
|
126
|
-
const email =
|
|
127
|
-
const jwt =
|
|
112
|
+
XhrHttpModule_1.XhrHttpModule.addDefaultHeader(AuthenticationConsts_1.AUTHENTICATION_KEY, () => `${AuthenticationConsts_1.AUTHENTICATION_PREFIX} ${exports.StorageKey_JWT.get()}`);
|
|
113
|
+
this.dispatchUI_loginChanged = new thunder_dispatcher_1.ThunderDispatcher("onLoginStatusUpdated");
|
|
114
|
+
const email = HistoryModule_1.BrowserHistoryModule.getQueryParam(api_1.QueryParam_Email);
|
|
115
|
+
const jwt = HistoryModule_1.BrowserHistoryModule.getQueryParam(api_1.QueryParam_JWT);
|
|
128
116
|
if (email && jwt) {
|
|
129
117
|
exports.StorageKey_JWT.set(jwt);
|
|
130
118
|
exports.StorageKey_UserEmail.set(email);
|
|
131
|
-
|
|
132
|
-
|
|
119
|
+
HistoryModule_1.BrowserHistoryModule.removeQueryParam(api_1.QueryParam_Email);
|
|
120
|
+
HistoryModule_1.BrowserHistoryModule.removeQueryParam(api_1.QueryParam_JWT);
|
|
133
121
|
}
|
|
134
122
|
if (exports.StorageKey_JWT.get())
|
|
135
123
|
return exports.AccountModule.validateToken();
|
|
@@ -137,19 +125,19 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
137
125
|
this.setLoggedStatus(LoggedStatus.LOGGED_OUT);
|
|
138
126
|
}
|
|
139
127
|
create(request) {
|
|
140
|
-
|
|
141
|
-
.createRequest(
|
|
128
|
+
XhrHttpModule_1.XhrHttpModule
|
|
129
|
+
.createRequest(types_1.HttpMethod.POST, exports.RequestKey_AccountCreate)
|
|
142
130
|
.setRelativeUrl("/v1/account/create")
|
|
143
131
|
.setJsonBody(request)
|
|
144
132
|
.setLabel(`User register...`)
|
|
145
133
|
.setOnError("Error registering user")
|
|
146
134
|
.execute((response) => __awaiter(this, void 0, void 0, function* () {
|
|
147
|
-
|
|
135
|
+
ToasterModule_1.ToastModule.toastSuccess(`Account successfully created with email: ${response.email}`);
|
|
148
136
|
}));
|
|
149
137
|
}
|
|
150
138
|
login(request) {
|
|
151
|
-
|
|
152
|
-
.createRequest(
|
|
139
|
+
XhrHttpModule_1.XhrHttpModule
|
|
140
|
+
.createRequest(types_1.HttpMethod.POST, exports.RequestKey_AccountLogin)
|
|
153
141
|
.setRelativeUrl("/v1/account/login")
|
|
154
142
|
.setJsonBody(request)
|
|
155
143
|
.setLabel(`User login with password...`)
|
|
@@ -164,8 +152,8 @@ class AccountModule_Class extends ts_common_1.Module {
|
|
|
164
152
|
this.setLoggedStatus(LoggedStatus.LOGGED_IN);
|
|
165
153
|
}
|
|
166
154
|
loginSAML(request) {
|
|
167
|
-
|
|
168
|
-
.createRequest(
|
|
155
|
+
XhrHttpModule_1.XhrHttpModule
|
|
156
|
+
.createRequest(types_1.HttpMethod.GET, exports.RequestKey_AccountLoginSAML)
|
|
169
157
|
.setRelativeUrl("/v1/account/login-saml")
|
|
170
158
|
.setUrlParams(request)
|
|
171
159
|
.setLabel(`User login SAML...`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/modules/AccountModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccountModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/modules/AccountModule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sGAA6F;AAC7F,2GAAqG;AACrG,8GAAsG;AACtG,sGAAuG;AACvG,6GAAsG;AAEtG,0CAe0B;AAE1B,kFAAkG;AAClG,qEAAgE;AAEhE,0EAA2G;AAC3G,wEAAuE;AACvE,wFAAyE;AAE5D,QAAA,oBAAoB,GAAuB,IAAI,0BAAU,CAAS,WAAW,sBAAgB,EAAE,CAAC,CAAC;AACjG,QAAA,cAAc,GAAuB,IAAI,0BAAU,CAAS,WAAW,oBAAc,EAAE,CAAC,CAAC;AAEzF,QAAA,wBAAwB,GAAG,gBAAgB,CAAC;AA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,CAAC,CAAC;IACX,CAAC;IAEO,YAAY,CAAC,QAAuB;QACxC,sBAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QAChC,4BAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IAEM,SAAS,CAAC,OAAgC;QAC7C,6BAAa;aACR,aAAa,CAAuB,kBAAU,CAAC,GAAG,EAAE,mCAA2B,CAAC;aAChF,cAAc,CAAC,wBAAwB,CAAC;aACxC,YAAY,CAAC,OAAO,CAAC;aACrB,QAAQ,CAAC,oBAAoB,CAAC;aAC9B,UAAU,CAAC,kBAAkB,CAAC;aAC9B,OAAO,CAAC,CAAO,QAA4B,EAAE,EAAE;YAC5C,IAAI,CAAC,QAAQ,CAAC,QAAQ;gBAClB,OAAO;YAEX,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC;QAC7C,CAAC,CAAA,CAAC,CAAC;IACX,CAAC;CAyCJ;AA9JD,kDA8JC;AAEY,QAAA,aAAa,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,33 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
__exportStar(require("./shared/api"), exports);
|
|
32
|
-
__exportStar(require("./shared/utils/AuthenticationConsts"), exports);
|
|
33
2
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuitionrobotics/user-account",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.1",
|
|
4
4
|
"description": "User Account",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"IR",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"build": "tsc"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@intuitionrobotics/firebase": "~0.
|
|
34
|
-
"@intuitionrobotics/thunderstorm": "~0.
|
|
35
|
-
"@intuitionrobotics/ts-common": "~0.
|
|
33
|
+
"@intuitionrobotics/firebase": "~0.44.0",
|
|
34
|
+
"@intuitionrobotics/thunderstorm": "~0.44.0",
|
|
35
|
+
"@intuitionrobotics/ts-common": "~0.44.0",
|
|
36
36
|
"react": "^16.0.0",
|
|
37
37
|
"jws": "^4.0.0",
|
|
38
38
|
"moment": "^2.29.4",
|
|
39
39
|
"saml2-js": "^4.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@intuitionrobotics/testelot": "~0.
|
|
42
|
+
"@intuitionrobotics/testelot": "~0.44.0",
|
|
43
43
|
"@types/node": "^16.0.0",
|
|
44
44
|
"@types/jws": "^3.2.4",
|
|
45
45
|
"@types/react": "^16.8.7",
|
package/shared/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiWithBody, ApiWithQuery } from "@intuitionrobotics/thunderstorm";
|
|
1
|
+
import { ApiWithBody, ApiWithQuery } from "@intuitionrobotics/thunderstorm/shared/types";
|
|
2
2
|
export declare const HeaderKey_SessionId = "x-session-id";
|
|
3
3
|
export declare const HeaderKey_Email = "x-email";
|
|
4
4
|
export declare const QueryParam_Email = "userEmail";
|
package/shared/api.js
CHANGED
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
3
|
exports.FrontType = exports.HeaderKey_CurrentPage = exports.QueryParam_RedirectUrl = exports.QueryParam_SessionId = exports.QueryParam_JWT = exports.QueryParam_Email = exports.HeaderKey_Email = exports.HeaderKey_SessionId = void 0;
|
|
22
4
|
exports.HeaderKey_SessionId = "x-session-id";
|
package/shared/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/main/shared/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/main/shared/api.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAG,cAAc,CAAC;AACrC,QAAA,eAAe,GAAG,SAAS,CAAC;AAE5B,QAAA,gBAAgB,GAAG,WAAW,CAAC;AAC/B,QAAA,cAAc,GAAG,KAAK,CAAC;AACvB,QAAA,oBAAoB,GAAG,2BAAmB,CAAC;AAC3C,QAAA,sBAAsB,GAAG,aAAa,CAAC;AACvC,QAAA,qBAAqB,GAAG,cAAc,CAAC;AAEpD,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,wBAAW,CAAA;IACX,wBAAW,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationConsts.js","sourceRoot":"","sources":["../../../src/main/shared/utils/AuthenticationConsts.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AuthenticationConsts.js","sourceRoot":"","sources":["../../../src/main/shared/utils/AuthenticationConsts.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,QAAQ,CAAC;AACjC,QAAA,kBAAkB,GAAG,eAAe,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
__exportStar(require("../../../../shared/api"), exports);
|
|
32
|
-
__exportStar(require("../../../modules/AccountModule"), exports);
|
|
33
|
-
__exportStar(require("../../../modules/SamlModule"), exports);
|
|
34
|
-
__exportStar(require("../../../modules/_imports"), exports);
|
|
35
|
-
// export * from "../../../../shared/types";
|
|
36
|
-
//# sourceMappingURL=_imports.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_imports.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/_imports.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,yDAAuC;AACvC,iEAA+C;AAC/C,8DAA4C;AAC5C,4DAA0C;AAC1C,4CAA4C"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
__exportStar(require("../../index"), exports);
|
|
32
|
-
//# sourceMappingURL=_imports.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_imports.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/_imports.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAIH,8CAA4B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Request_LoginAccount } from "../../shared/api";
|
|
3
|
-
export declare type ValueAndError = {
|
|
4
|
-
value?: string;
|
|
5
|
-
error?: string;
|
|
6
|
-
};
|
|
7
|
-
declare type State<T> = {
|
|
8
|
-
data: Partial<T>;
|
|
9
|
-
};
|
|
10
|
-
declare type Props<T> = {
|
|
11
|
-
validate?: (data: Partial<T>) => string | undefined;
|
|
12
|
-
};
|
|
13
|
-
export declare class Component_Login extends React.Component<Props<Request_LoginAccount>, State<Request_LoginAccount>> {
|
|
14
|
-
state: {
|
|
15
|
-
data: Partial<Request_LoginAccount>;
|
|
16
|
-
};
|
|
17
|
-
render(): React.JSX.Element;
|
|
18
|
-
private onValueChanged;
|
|
19
|
-
private loginClicked;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.Component_Login = void 0;
|
|
22
|
-
const React = require("react");
|
|
23
|
-
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
24
|
-
const AccountModule_1 = require("../modules/AccountModule");
|
|
25
|
-
const frontend_1 = require("@intuitionrobotics/thunderstorm/frontend");
|
|
26
|
-
const style = {
|
|
27
|
-
"height": "38px",
|
|
28
|
-
"borderRadius": "25px",
|
|
29
|
-
"backgroundColor": "#9c9ccd",
|
|
30
|
-
"borderWidth": "0",
|
|
31
|
-
"textAlign": "left",
|
|
32
|
-
"padding": "0 15px",
|
|
33
|
-
"color": "white",
|
|
34
|
-
"marginTop": "10px"
|
|
35
|
-
};
|
|
36
|
-
const form = {
|
|
37
|
-
email: {
|
|
38
|
-
type: "text",
|
|
39
|
-
hint: "email",
|
|
40
|
-
label: "Email",
|
|
41
|
-
},
|
|
42
|
-
password: {
|
|
43
|
-
type: "password",
|
|
44
|
-
hint: "****",
|
|
45
|
-
label: "Password",
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
class Component_Login extends React.Component {
|
|
49
|
-
constructor() {
|
|
50
|
-
super(...arguments);
|
|
51
|
-
this.state = {
|
|
52
|
-
data: {},
|
|
53
|
-
};
|
|
54
|
-
this.onValueChanged = (value, id) => {
|
|
55
|
-
this.setState(state => {
|
|
56
|
-
state.data[id] = value;
|
|
57
|
-
return state;
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
this.loginClicked = () => {
|
|
61
|
-
const data = this.state.data;
|
|
62
|
-
const errors = ts_common_1._keys(form).map(key => {
|
|
63
|
-
const field = form[key];
|
|
64
|
-
return data[key] ? undefined : ` * missing ${field.label}`;
|
|
65
|
-
}).filter(error => !!error);
|
|
66
|
-
const validateError = this.props.validate && this.props.validate(data);
|
|
67
|
-
if (validateError)
|
|
68
|
-
ts_common_1.addItemToArray(errors, validateError);
|
|
69
|
-
if (errors.length > 0)
|
|
70
|
-
return frontend_1.ToastModule.toastError(`Wrong input:\n${errors.join("\n")}`);
|
|
71
|
-
AccountModule_1.AccountModule.login(this.state.data);
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
render() {
|
|
75
|
-
const data = this.state.data;
|
|
76
|
-
return React.createElement(React.Fragment, null,
|
|
77
|
-
React.createElement("div", { className: 'll_v_c', style: { justifyContent: 'space-evenly' } }, ts_common_1._keys(form).map(key => {
|
|
78
|
-
const field = form[key];
|
|
79
|
-
return React.createElement(frontend_1.TS_Input, { id: key, key: key, value: data[key], type: field.type, placeholder: field.hint, onChange: this.onValueChanged, onAccept: this.loginClicked });
|
|
80
|
-
})),
|
|
81
|
-
React.createElement("div", { className: 'll_h_c', style: { justifyContent: 'center' } },
|
|
82
|
-
React.createElement("button", { onClick: this.loginClicked, className: `clickable`, style: style }, "Login")));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
exports.Component_Login = Component_Login;
|
|
86
|
-
//# sourceMappingURL=Component_Login.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Component_Login.js","sourceRoot":"","sources":["../../../src/main/app-frontend/ui/Component_Login.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,+BAA+B;AAE/B,4DAGsC;AACtC,4DAAuD;AAEvD,uEAGkD;AAelD,MAAM,KAAK,GAAkB;IAC5B,QAAQ,EAAE,MAAM;IAChB,cAAc,EAAE,MAAM;IACtB,iBAAiB,EAAE,SAAS;IAC5B,aAAa,EAAE,GAAG;IAClB,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,OAAO;IAChB,WAA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AI,MAAM,CAAC,MAAM,GAAG,CAAC;gBACpB,OAAO,sBAAW,CAAC,UAAU,CAAC,iBAAiB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAErE,6BAAa,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAA4B,CAAC,CAAC;QAC9D,CAAC,CAAC;IACH,CAAC;IAhDA,MAAM;QACL,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAC7B,OAAO;YACN,6BAAK,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAC,cAAc,EAAE,cAAc,EAAC,IAC/D,iBAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBACL,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;gBACxB,OAAO,oBAAC,mBAAQ,IACf,EAAE,EAAE,GAAG,EACP,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,EAChB,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,WAAW,EAAE,KAAK,CAAC,IAAI,EACvB,QAAQ,EAAE,IAAI,CAAC,cAAc,EAC7B,QAAQ,EAAE,IAAI,CAAC,YAAY,GAC1B,CAAC;YACJ,CAAC,CACjB,CACI;YACN,6BAAK,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAC,cAAc,EAAE,QAAQ,EAAC;gBAC1D,gCAAQ,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,YAC/D,CACJ,CACJ,CAAC;IACL,CAAC;CAyBD;AAvDD,0CAuDC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Request_CreateAccount } from "../../shared/api";
|
|
3
|
-
declare type State<T> = {
|
|
4
|
-
data: Partial<T>;
|
|
5
|
-
};
|
|
6
|
-
declare type Props<T> = {
|
|
7
|
-
validate?: (data: Partial<T>) => string | undefined;
|
|
8
|
-
};
|
|
9
|
-
export declare class Component_Register extends React.Component<Props<Request_CreateAccount>, State<Request_CreateAccount>> {
|
|
10
|
-
state: {
|
|
11
|
-
data: Partial<Request_CreateAccount>;
|
|
12
|
-
};
|
|
13
|
-
render(): React.JSX.Element;
|
|
14
|
-
private onValueChanged;
|
|
15
|
-
private registerClicked;
|
|
16
|
-
}
|
|
17
|
-
export {};
|