@intuitionrobotics/user-account 0.45.1 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/app-backend/api/_user-account.js +2 -20
  2. package/app-backend/api/_user-account.js.map +1 -1
  3. package/app-backend/api/v1/account/_assert.d.ts +3 -2
  4. package/app-backend/api/v1/account/_assert.js +6 -24
  5. package/app-backend/api/v1/account/_assert.js.map +1 -1
  6. package/app-backend/api/v1/account/create.js +6 -24
  7. package/app-backend/api/v1/account/create.js.map +1 -1
  8. package/app-backend/api/v1/account/list.js +6 -24
  9. package/app-backend/api/v1/account/list.js.map +1 -1
  10. package/app-backend/api/v1/account/login-saml.js +4 -22
  11. package/app-backend/api/v1/account/login-saml.js.map +1 -1
  12. package/app-backend/api/v1/account/login.js +12 -24
  13. package/app-backend/api/v1/account/login.js.map +1 -1
  14. package/app-backend/api/v1/account/logout.js +9 -26
  15. package/app-backend/api/v1/account/logout.js.map +1 -1
  16. package/app-backend/api/v1/account/upsert.js +10 -9
  17. package/app-backend/api/v1/account/upsert.js.map +1 -1
  18. package/app-backend/api/v1/account/validate.js +6 -24
  19. package/app-backend/api/v1/account/validate.js.map +1 -1
  20. package/app-backend/apis/add-new-account.d.ts +3 -3
  21. package/app-backend/apis/add-new-account.js +12 -24
  22. package/app-backend/apis/add-new-account.js.map +1 -1
  23. package/app-backend/core/module-pack.d.ts +0 -2
  24. package/app-backend/core/module-pack.js +0 -30
  25. package/app-backend/core/module-pack.js.map +1 -1
  26. package/app-backend/modules/AccountModule.d.ts +10 -7
  27. package/app-backend/modules/AccountModule.js +55 -79
  28. package/app-backend/modules/AccountModule.js.map +1 -1
  29. package/app-backend/modules/JWTBuilder.d.ts +1 -1
  30. package/app-backend/modules/JWTBuilder.js +6 -5
  31. package/app-backend/modules/JWTBuilder.js.map +1 -1
  32. package/app-backend/modules/SamlModule.d.ts +3 -2
  33. package/app-backend/modules/SamlModule.js +7 -23
  34. package/app-backend/modules/SamlModule.js.map +1 -1
  35. package/app-backend/modules/SecretsModule.d.ts +4 -2
  36. package/app-backend/modules/SecretsModule.js +30 -27
  37. package/app-backend/modules/SecretsModule.js.map +1 -1
  38. package/app-backend/modules/{_imports.d.ts → types.d.ts} +1 -2
  39. package/app-backend/modules/types.js +3 -0
  40. package/app-backend/modules/types.js.map +1 -0
  41. package/app-frontend/core/module-pack.d.ts +0 -1
  42. package/app-frontend/core/module-pack.js +0 -29
  43. package/app-frontend/core/module-pack.js.map +1 -1
  44. package/app-frontend/modules/AccountModule.d.ts +3 -2
  45. package/app-frontend/modules/AccountModule.js +38 -50
  46. package/app-frontend/modules/AccountModule.js.map +1 -1
  47. package/index.d.ts +0 -2
  48. package/index.js +0 -31
  49. package/index.js.map +1 -1
  50. package/package.json +5 -6
  51. package/shared/api.d.ts +1 -1
  52. package/shared/api.js +0 -18
  53. package/shared/api.js.map +1 -1
  54. package/shared/utils/AuthenticationConsts.js.map +1 -1
  55. package/app-backend/api/v1/account/_imports.d.ts +0 -4
  56. package/app-backend/api/v1/account/_imports.js +0 -36
  57. package/app-backend/api/v1/account/_imports.js.map +0 -1
  58. package/app-backend/modules/_imports.js +0 -32
  59. package/app-backend/modules/_imports.js.map +0 -1
  60. package/app-frontend/ui/Component_Login.d.ts +0 -21
  61. package/app-frontend/ui/Component_Login.js +0 -86
  62. package/app-frontend/ui/Component_Login.js.map +0 -1
  63. package/app-frontend/ui/Component_Register.d.ts +0 -17
  64. package/app-frontend/ui/Component_Register.js +0 -92
  65. package/app-frontend/ui/Component_Register.js.map +0 -1
  66. package/backend.d.ts +0 -2
  67. package/backend.js +0 -33
  68. package/backend.js.map +0 -1
  69. package/frontend.d.ts +0 -3
  70. package/frontend.js +0 -34
  71. package/frontend.js.map +0 -1
  72. package/shared/types.d.ts +0 -0
  73. package/shared/types.js +0 -20
  74. package/shared/types.js.map +0 -1
@@ -1,41 +1,44 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SecretsModule = exports.SecretsModule_Class = exports.TokenExpiredException = void 0;
4
- const ts_common_1 = require("@intuitionrobotics/ts-common");
5
- const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
4
+ const exceptions_1 = require("@intuitionrobotics/thunderstorm/app-backend/exceptions");
5
+ const exceptions_2 = require("@intuitionrobotics/ts-common/core/exceptions");
6
+ const module_1 = require("@intuitionrobotics/ts-common/core/module");
7
+ const date_time_tools_1 = require("@intuitionrobotics/ts-common/utils/date-time-tools");
8
+ const tools_1 = require("@intuitionrobotics/ts-common/utils/tools");
6
9
  const jws = require("jws");
10
+ const AuthenticationConsts_1 = require("../../shared/utils/AuthenticationConsts");
7
11
  const JWTBuilder_1 = require("./JWTBuilder");
8
- const __1 = require("../..");
9
- class TokenExpiredException extends backend_1.ApiException {
12
+ class TokenExpiredException extends exceptions_1.ApiException {
10
13
  constructor(message, cause) {
11
14
  super(401, message, cause);
12
15
  }
13
16
  }
14
17
  exports.TokenExpiredException = TokenExpiredException;
15
- class SecretsModule_Class extends ts_common_1.Module {
18
+ class SecretsModule_Class extends module_1.Module {
16
19
  constructor() {
17
20
  super("SecretsModule");
18
21
  this.DEFAULT_ISS = "TOOLS";
19
- this.AUTHENTICATION_PREFIX = __1.AUTHENTICATION_PREFIX;
20
- this.AUTHENTICATION_KEY = __1.AUTHENTICATION_KEY;
22
+ this.AUTHENTICATION_PREFIX = AuthenticationConsts_1.AUTHENTICATION_PREFIX;
23
+ this.AUTHENTICATION_KEY = AuthenticationConsts_1.AUTHENTICATION_KEY;
21
24
  this.getAuthSecret = (kid) => {
22
25
  return this.getSecret(kid);
23
26
  };
24
27
  this.getConfig = () => {
25
28
  if (!this.config)
26
- throw new ts_common_1.BadImplementationException(`Missing config, check SecretsModule's config`);
29
+ throw new exceptions_2.BadImplementationException(`Missing config, check SecretsModule's config`);
27
30
  if (!this.config.secrets)
28
- throw new ts_common_1.BadImplementationException(`Missing 'secrets' key in config, check SecretsModule's config`);
31
+ throw new exceptions_2.BadImplementationException(`Missing 'secrets' key in config, check SecretsModule's config`);
29
32
  return this.config.secrets;
30
33
  };
31
34
  this.isExpired = (token) => {
32
- return this.getExpiration(token) < ts_common_1.currentTimeMillies();
35
+ return this.getExpiration(token) < date_time_tools_1.currentTimeMillies();
33
36
  };
34
37
  this.generateJwt = (payload, kid, algorithm = "HS256") => {
35
38
  const secret = this.getAuthSecret(kid);
36
39
  return new JWTBuilder_1.JWTBuilder(algorithm)
37
40
  // This is a default that can be overwritten by the claims
38
- .setExpiration(Math.floor((ts_common_1.currentTimeMillies() + ts_common_1.Day) / 1000))
41
+ .setExpiration(Math.floor((date_time_tools_1.currentTimeMillies() + date_time_tools_1.Day) / 1000))
39
42
  .addClaims(payload)
40
43
  .setIssuer(this.getIss())
41
44
  .setKeyID(secret.kid)
@@ -50,13 +53,13 @@ class SecretsModule_Class extends ts_common_1.Module {
50
53
  this.decodeJwt = (jwt) => {
51
54
  return jws.decode(jwt);
52
55
  };
53
- this.setDefaultConfig({ validateKeyId: "AUTH_SECRET" });
56
+ this.setConfig({ validateKeyId: "AUTH_SECRET" });
54
57
  }
55
58
  getSecret(k) {
56
59
  var _a, _b;
57
60
  const secret = ((_a = process.env) === null || _a === void 0 ? void 0 : _a[k]) || ((_b = this.getConfig()) === null || _b === void 0 ? void 0 : _b[k]);
58
61
  if (!secret)
59
- throw new ts_common_1.BadImplementationException(`Missing secret with key ${k} in SecretsModule`);
62
+ throw new exceptions_2.BadImplementationException(`Missing secret with key ${k} in SecretsModule`);
60
63
  return {
61
64
  kid: k,
62
65
  value: secret
@@ -65,7 +68,7 @@ class SecretsModule_Class extends ts_common_1.Module {
65
68
  validateRequestAndCheckExpiration(request, scopes) {
66
69
  const token = this.validateRequest(request, scopes);
67
70
  if (this.isExpired(token)) {
68
- const cause = `The JWT passed is not valid, check. With payload: ${ts_common_1.__stringify(token.payload)}. The JWT passed is expired`;
71
+ const cause = `The JWT passed is not valid, check. With payload: ${tools_1.__stringify(token.payload)}. The JWT passed is expired`;
69
72
  throw new TokenExpiredException(cause);
70
73
  }
71
74
  return token.payload;
@@ -76,18 +79,18 @@ class SecretsModule_Class extends ts_common_1.Module {
76
79
  const authToken = this.extractAuthToken(request);
77
80
  const token = this.decodeJwt(authToken);
78
81
  if (!token)
79
- throw new backend_1.ApiException(401, "Could not decode token " + authToken);
82
+ throw new exceptions_1.ApiException(401, "Could not decode token " + authToken);
80
83
  const kid = token.header.kid || this.config.validateKeyId;
81
84
  if (!kid)
82
- throw new backend_1.ApiException(401, "Could not deduce which key to use in order to verify the token, please specify a key ID");
85
+ throw new exceptions_1.ApiException(401, "Could not deduce which key to use in order to verify the token, please specify a key ID");
83
86
  const secret = this.getAuthSecret(kid);
84
87
  const verified = jws.verify(authToken, token.header.alg, secret.value);
85
- let cause = `The JWT passed is not valid, check. With payload: ${ts_common_1.__stringify(token.payload)} and header ${ts_common_1.__stringify(token.header)}.`;
88
+ let cause = `The JWT passed is not valid, check. With payload: ${tools_1.__stringify(token.payload)} and header ${tools_1.__stringify(token.header)}.`;
86
89
  if (!verified)
87
- throw new backend_1.ApiException(401, cause);
90
+ throw new exceptions_1.ApiException(401, cause);
88
91
  if (!((_a = token.payload) === null || _a === void 0 ? void 0 : _a[JWTBuilder_1.EXPIRES_AT])) {
89
92
  cause += ` The JWT is missing the expiration claim`;
90
- throw new backend_1.ApiException(401, cause);
93
+ throw new exceptions_1.ApiException(401, cause);
91
94
  }
92
95
  const scopesToValidate = (_b = token.payload) === null || _b === void 0 ? void 0 : _b.scopes;
93
96
  if (scopesToValidate)
@@ -98,36 +101,36 @@ class SecretsModule_Class extends ts_common_1.Module {
98
101
  const scopesToValidate = _scopesToValidate.split(",");
99
102
  const isValidScope = scopesToValidate.some(s => scopes.includes(s));
100
103
  if (!isValidScope)
101
- throw new backend_1.ApiException(403, `User doesn't have valid scopes. It needs ${scopes.join(",")} but it has ${_scopesToValidate}`);
104
+ throw new exceptions_1.ApiException(403, `User doesn't have valid scopes. It needs ${scopes.join(",")} but it has ${_scopesToValidate}`);
102
105
  }
103
106
  extractAuthToken(request) {
104
107
  const authHead = request.header(this.AUTHENTICATION_KEY);
105
108
  if (authHead === undefined)
106
- throw new ts_common_1.BadImplementationException("Missing Authorization header");
109
+ throw new exceptions_2.BadImplementationException("Missing Authorization header");
107
110
  if (!authHead)
108
- throw new ts_common_1.BadImplementationException('The Authorization header is empty');
111
+ throw new exceptions_2.BadImplementationException('The Authorization header is empty');
109
112
  const parts = authHead.split(" ");
110
113
  if (parts.length !== 2 || parts[0] !== this.AUTHENTICATION_PREFIX)
111
- throw new ts_common_1.BadImplementationException(`The Authorization header is malformed` + "\n"
114
+ throw new exceptions_2.BadImplementationException(`The Authorization header is malformed` + "\n"
112
115
  + `Value: ${authHead}` + "\n"
113
116
  + `Expected Value: ${this.AUTHENTICATION_PREFIX} [token]`);
114
117
  const authToken = parts[1].trim();
115
118
  if (!authToken)
116
- throw new ts_common_1.BadImplementationException(`The token provided is empty`);
119
+ throw new exceptions_2.BadImplementationException(`The token provided is empty`);
117
120
  return authToken;
118
121
  }
119
122
  getExpiration(token) {
120
123
  let exp = token.payload[JWTBuilder_1.EXPIRES_AT];
121
124
  if (!exp)
122
125
  return exp;
123
- const now = ts_common_1.currentTimeMillies();
126
+ const now = date_time_tools_1.currentTimeMillies();
124
127
  const cutOff = 1000000000000; // 3-3-1973 in milliseconds
125
128
  const isInSeconds = exp < cutOff;
126
129
  if (isInSeconds)
127
130
  exp = exp * 1000;
128
- const year = 365 * ts_common_1.Day;
131
+ const year = 365 * date_time_tools_1.Day;
129
132
  if (exp < now - year || exp > now + (year))
130
- throw new ts_common_1.BadImplementationException(`The JWT passed is not valid. Payload: ${ts_common_1.__stringify(token.payload)}.` +
133
+ throw new exceptions_2.BadImplementationException(`The JWT passed is not valid. Payload: ${tools_1.__stringify(token.payload)}.` +
131
134
  `Malformed JWT, expiry date is not valid, check the exp format, assumed to be in ${isInSeconds ? "seconds" : "milliseconds"}`);
132
135
  return exp;
133
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SecretsModule.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/SecretsModule.ts"],"names":[],"mappings":";;;AAAA,4DAOsC;AACtC,qEAAqF;AACrF,2BAA2B;AAE3B,6CAAoD;AACpD,6BAAgE;AAEhE,MAAa,qBACT,SAAQ,sBAAY;IACpB,YAAY,OAAe,EAAE,KAAa;QACtC,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;IAC9B,CAAC;CACJ;AALD,sDAKC;AAeD,MAAa,mBACT,SAAQ,kBAAc;IAMtB;QACI,KAAK,CAAC,eAAe,CAAC,CAAC;QANnB,gBAAW,GAAG,OAAO,CAAC;QAEvB,0BAAqB,GAAG,yBAAqB,CAAC;QAC9C,uBAAkB,GAAG,sBAAkB,CAAC;QAkBxC,kBAAa,GAAG,CAAC,GAAW,EAAU,EAAE;YAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC,CAAC;QAEM,cAAS,GAAG,GAAG,EAAE;YACrB,IAAI,CAAC,IAAI,CAAC,MAAM;gBACZ,MAAM,IAAI,sCAA0B,CAAC,8CAA8C,CAAC,CAAC;YAEzF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO;gBACpB,MAAM,IAAI,sCAA0B,CAAC,+DAA+D,CAAC,CAAC;YAE1G,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC;QAyEK,cAAS,GAAG,CAAC,KAAgB,EAAE,EAAE;YACpC,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,8BAAkB,EAAE,CAAC;QAC5D,CAAC,CAAC;QAoBF,gBAAW,GAAG,CAAC,OAAiB,EAAE,GAAW,EAAE,YAAuB,OAAO,EAAE,EAAE;YAC7E,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;YACt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G,aAAa,CAAC,CAAA,2BAA2B;QACxD,MAAM,WAAW,GAAG,GAAG,GAAG,MAAM,CAAC;QACjC,IAAI,WAAW;YACX,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;QAErB,MAAM,IAAI,GAAG,GAAG,GAAG,qBAAG,CAAC;QACvB,IAAI,GAAG,GAAG,GAAG,GAAG,IAAI,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC;YACtC,MAAM,IAAI,uCAA0B,CAAC,yCAAyC,mBAAW,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG;gBACvG,mFAAmF,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;QACvI,OAAO,GAAG,CAAC;IACf,CAAC;CAuBJ;AAvJD,kDAuJC;AAEY,QAAA,aAAa,GAAG,IAAI,mBAAmB,EAAE,CAAA"}
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/main/app-backend/modules/types.ts"],"names":[],"mappings":""}
@@ -1,2 +1 @@
1
1
  export declare const Frontend_ModulePack_Users: import("../modules/AccountModule").AccountModule_Class[];
2
- export * from "../modules/AccountModule";
@@ -1,37 +1,8 @@
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
31
3
  exports.Frontend_ModulePack_Users = void 0;
32
4
  const AccountModule_1 = require("../modules/AccountModule");
33
5
  exports.Frontend_ModulePack_Users = [
34
6
  AccountModule_1.AccountModule,
35
7
  ];
36
- __exportStar(require("../modules/AccountModule"), exports);
37
8
  //# 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;;;;;;;;;;;;;AAEH,4DAAuD;AAE1C,QAAA,yBAAyB,GAAG;IACxC,6BAAa;CACb,CAAC;AAEF,2DAAwC"}
1
+ {"version":3,"file":"module-pack.js","sourceRoot":"","sources":["../../../src/main/app-frontend/core/module-pack.ts"],"names":[],"mappings":";;;AACA,4DAAuD;AAE1C,QAAA,yBAAyB,GAAG;IACrC,6BAAa;CAChB,CAAC"}
@@ -1,6 +1,7 @@
1
- import { Module } from "@intuitionrobotics/ts-common";
2
- import { OnUnauthenticatedResponse, StorageKey } from "@intuitionrobotics/thunderstorm/frontend";
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 ts_common_1 = require("@intuitionrobotics/ts-common");
32
- const frontend_1 = require("@intuitionrobotics/thunderstorm/frontend");
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 thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
35
- const __1 = require("../..");
36
- exports.StorageKey_UserEmail = new frontend_1.StorageKey(`storage-${api_1.QueryParam_Email}`);
37
- exports.StorageKey_JWT = new frontend_1.StorageKey(`storage-${api_1.QueryParam_JWT}`);
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 frontend_1.ThunderDispatcher("__onAccountsLoaded");
49
- class AccountModule_Class extends ts_common_1.Module {
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
- frontend_1.XhrHttpModule
70
- .createRequest(thunderstorm_1.HttpMethod.GET, exports.RequestKey_ValidateSession)
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
- frontend_1.ToastModule.toastError("Cannot reach Server... trying in 30 sec");
76
- setTimeout(() => exports.AccountModule.validateToken(), 30 * ts_common_1.Second);
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
- frontend_1.XhrHttpModule
94
- .createRequest(thunderstorm_1.HttpMethod.GET, exports.RequestKey_ValidateSession)
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
- frontend_1.XhrHttpModule.addDefaultResponseHandler((request) => {
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 functionExecutionId = (_a = request === null || request === void 0 ? void 0 : request.getResponseHeader) === null || _a === void 0 ? void 0 : _a.call(request, thunderstorm_1.HeaderKey_FunctionExecutionId);
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
- frontend_1.XhrHttpModule.logError(`${request.key} - Failed to retrieve headers from xhr call`, e);
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
- frontend_1.XhrHttpModule.addDefaultHeader(__1.AUTHENTICATION_KEY, () => `${__1.AUTHENTICATION_PREFIX} ${exports.StorageKey_JWT.get()}`);
125
- this.dispatchUI_loginChanged = new frontend_1.ThunderDispatcher("onLoginStatusUpdated");
126
- const email = frontend_1.BaseComponent.getQueryParameter(api_1.QueryParam_Email);
127
- const jwt = frontend_1.BaseComponent.getQueryParameter(api_1.QueryParam_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
- frontend_1.BrowserHistoryModule.removeQueryParam(api_1.QueryParam_Email);
132
- frontend_1.BrowserHistoryModule.removeQueryParam(api_1.QueryParam_JWT);
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
- frontend_1.XhrHttpModule
141
- .createRequest(thunderstorm_1.HttpMethod.POST, exports.RequestKey_AccountCreate)
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
- frontend_1.ToastModule.toastSuccess(`Account successfully created with email: ${response.email}`);
135
+ ToasterModule_1.ToastModule.toastSuccess(`Account successfully created with email: ${response.email}`);
148
136
  }));
149
137
  }
150
138
  login(request) {
151
- frontend_1.XhrHttpModule
152
- .createRequest(thunderstorm_1.HttpMethod.POST, exports.RequestKey_AccountLogin)
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
- frontend_1.XhrHttpModule
168
- .createRequest(thunderstorm_1.HttpMethod.GET, exports.RequestKey_AccountLoginSAML)
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":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,4DAA4D;AAC5D,uEAQkD;AAClD,0CAe0B;AAC1B,kEAKyC;AACzC,6BAAgE;AAEnD,QAAA,oBAAoB,GAAuB,IAAI,qBAAU,CAAS,WAAW,sBAAgB,EAAE,CAAC,CAAC;AACjG,QAAA,cAAc,GAAuB,IAAI,qBAAU,CAAS,WAAW,oBAAc,EAAE,CAAC,CAAC;AAEzF,QAAA,wBAAwB,GAAG,gBAAgB,CAAC;AAC5C,QAAA,uBAAuB,GAAG,eAAe,CAAC;AAC1C,QAAA,2BAA2B,GAAG,oBAAoB,CAAC;AACnD,QAAA,0BAA0B,GAAG,kBAAkB,CAAC;AAM7D,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,2DAAU,CAAA;IACV,2DAAU,CAAA;IACV,yDAAS,CAAA;AACb,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAQD,MAAM,yBAAyB,GAAG,I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AAuB,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
@@ -1,2 +0,0 @@
1
- export * from "./shared/api";
2
- export * from "./shared/utils/AuthenticationConsts";
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":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,sEAAoD"}
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.45.1",
3
+ "version": "0.46.00",
4
4
  "description": "User Account",
5
5
  "keywords": [
6
6
  "IR",
@@ -30,16 +30,15 @@
30
30
  "build": "tsc"
31
31
  },
32
32
  "dependencies": {
33
- "@intuitionrobotics/firebase": "~0.45.0",
34
- "@intuitionrobotics/thunderstorm": "~0.45.0",
35
- "@intuitionrobotics/ts-common": "~0.45.0",
33
+ "@intuitionrobotics/firebase": "~0.46.0",
34
+ "@intuitionrobotics/thunderstorm": "~0.46.0",
35
+ "@intuitionrobotics/ts-common": "~0.46.0",
36
36
  "react": "^16.0.0",
37
37
  "jws": "^4.0.0",
38
- "moment": "^2.29.4",
39
38
  "saml2-js": "^4.0.0"
40
39
  },
41
40
  "devDependencies": {
42
- "@intuitionrobotics/testelot": "~0.45.0",
41
+ "@intuitionrobotics/testelot": "~0.46.0",
43
42
  "@types/node": "^16.0.0",
44
43
  "@types/jws": "^3.2.4",
45
44
  "@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":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAIU,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
+ {"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":";;;AACa,QAAA,qBAAqB,GAAG,QAAQ,CAAC;AACjC,QAAA,kBAAkB,GAAG,eAAe,CAAC"}
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,4 +0,0 @@
1
- export * from "../../../../shared/api";
2
- export * from "../../../modules/AccountModule";
3
- export * from "../../../modules/SamlModule";
4
- export * from "../../../modules/_imports";
@@ -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"}