@intuitionrobotics/user-account 0.45.0 → 0.45.3

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 +20 -2
  2. package/app-backend/api/_user-account.js.map +1 -1
  3. package/app-backend/api/v1/account/_assert.d.ts +2 -3
  4. package/app-backend/api/v1/account/_assert.js +24 -6
  5. package/app-backend/api/v1/account/_assert.js.map +1 -1
  6. package/app-backend/api/v1/account/_imports.d.ts +4 -0
  7. package/app-backend/api/v1/account/_imports.js +36 -0
  8. package/app-backend/api/v1/account/_imports.js.map +1 -0
  9. package/app-backend/api/v1/account/create.js +24 -6
  10. package/app-backend/api/v1/account/create.js.map +1 -1
  11. package/app-backend/api/v1/account/list.js +24 -6
  12. package/app-backend/api/v1/account/list.js.map +1 -1
  13. package/app-backend/api/v1/account/login-saml.js +22 -4
  14. package/app-backend/api/v1/account/login-saml.js.map +1 -1
  15. package/app-backend/api/v1/account/login.js +24 -12
  16. package/app-backend/api/v1/account/login.js.map +1 -1
  17. package/app-backend/api/v1/account/logout.js +26 -9
  18. package/app-backend/api/v1/account/logout.js.map +1 -1
  19. package/app-backend/api/v1/account/upsert.js +9 -10
  20. package/app-backend/api/v1/account/upsert.js.map +1 -1
  21. package/app-backend/api/v1/account/validate.js +24 -6
  22. package/app-backend/api/v1/account/validate.js.map +1 -1
  23. package/app-backend/apis/add-new-account.d.ts +3 -3
  24. package/app-backend/apis/add-new-account.js +24 -12
  25. package/app-backend/apis/add-new-account.js.map +1 -1
  26. package/app-backend/core/module-pack.d.ts +2 -0
  27. package/app-backend/core/module-pack.js +30 -0
  28. package/app-backend/core/module-pack.js.map +1 -1
  29. package/app-backend/modules/AccountModule.d.ts +12 -12
  30. package/app-backend/modules/AccountModule.js +122 -75
  31. package/app-backend/modules/AccountModule.js.map +1 -1
  32. package/app-backend/modules/JWTBuilder.d.ts +1 -1
  33. package/app-backend/modules/JWTBuilder.js +5 -6
  34. package/app-backend/modules/JWTBuilder.js.map +1 -1
  35. package/app-backend/modules/SamlModule.d.ts +2 -3
  36. package/app-backend/modules/SamlModule.js +23 -7
  37. package/app-backend/modules/SamlModule.js.map +1 -1
  38. package/app-backend/modules/SecretsModule.d.ts +6 -7
  39. package/app-backend/modules/SecretsModule.js +39 -33
  40. package/app-backend/modules/SecretsModule.js.map +1 -1
  41. package/app-backend/modules/{types.d.ts → _imports.d.ts} +2 -1
  42. package/app-backend/modules/_imports.js +32 -0
  43. package/app-backend/modules/_imports.js.map +1 -0
  44. package/app-frontend/core/module-pack.d.ts +1 -0
  45. package/app-frontend/core/module-pack.js +29 -0
  46. package/app-frontend/core/module-pack.js.map +1 -1
  47. package/app-frontend/modules/AccountModule.d.ts +2 -3
  48. package/app-frontend/modules/AccountModule.js +50 -38
  49. package/app-frontend/modules/AccountModule.js.map +1 -1
  50. package/app-frontend/ui/Component_Login.d.ts +21 -0
  51. package/app-frontend/ui/Component_Login.js +86 -0
  52. package/app-frontend/ui/Component_Login.js.map +1 -0
  53. package/app-frontend/ui/Component_Register.d.ts +17 -0
  54. package/app-frontend/ui/Component_Register.js +92 -0
  55. package/app-frontend/ui/Component_Register.js.map +1 -0
  56. package/backend.d.ts +2 -0
  57. package/backend.js +33 -0
  58. package/backend.js.map +1 -0
  59. package/frontend.d.ts +3 -0
  60. package/frontend.js +34 -0
  61. package/frontend.js.map +1 -0
  62. package/index.d.ts +2 -0
  63. package/index.js +31 -0
  64. package/index.js.map +1 -1
  65. package/package.json +2 -1
  66. package/shared/api.d.ts +1 -1
  67. package/shared/api.js +18 -0
  68. package/shared/api.js.map +1 -1
  69. package/shared/types.d.ts +0 -0
  70. package/shared/types.js +20 -0
  71. package/shared/types.js.map +1 -0
  72. package/shared/utils/AuthenticationConsts.js.map +1 -1
  73. package/app-backend/modules/types.js +0 -3
  74. package/app-backend/modules/types.js.map +0 -1
@@ -1,5 +1,23 @@
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
+ */
2
20
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const HttpServer_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/HttpServer");
4
- module.exports = new HttpServer_1.RouteResolver(require, __dirname);
21
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
22
+ module.exports = new backend_1.RouteResolver(require, __dirname);
5
23
  //# sourceMappingURL=_user-account.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_user-account.js","sourceRoot":"","sources":["../../../src/main/app-backend/api/_user-account.ts"],"names":[],"mappings":";;AACA,sGAAoG;AAEpG,MAAM,CAAC,OAAO,GAAG,IAAI,0BAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"_user-account.js","sourceRoot":"","sources":["../../../src/main/app-backend/api/_user-account.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AAEH,qEAAsE;AAEtE,MAAM,CAAC,OAAO,GAAG,IAAI,uBAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC"}
@@ -1,6 +1,5 @@
1
- import { AccountApi_AssertLoginSAML, PostAssertBody } from "../../../../shared/api";
2
- import { ApiResponse, ServerApi } from "@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api";
3
- import { ExpressRequest } from "@intuitionrobotics/thunderstorm/app-backend/utils/types";
1
+ import { ApiResponse, ExpressRequest, ServerApi } from "@intuitionrobotics/thunderstorm/backend";
2
+ import { AccountApi_AssertLoginSAML, PostAssertBody } from "./_imports";
4
3
  export declare class AssertSamlToken extends ServerApi<AccountApi_AssertLoginSAML> {
5
4
  constructor(pathPart?: string);
6
5
  protected process(request: ExpressRequest, response: ApiResponse, queryParams: {}, body: PostAssertBody): Promise<void>;
@@ -1,4 +1,22 @@
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
+ */
2
20
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
21
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
22
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10,16 +28,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
28
  };
11
29
  Object.defineProperty(exports, "__esModule", { value: true });
12
30
  exports.AssertSamlToken = void 0;
13
- const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
14
- const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
15
- const AccountModule_1 = require("../../../modules/AccountModule");
16
- class AssertSamlToken extends server_api_1.ServerApi {
31
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
32
+ const _imports_1 = require("./_imports");
33
+ const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
34
+ class AssertSamlToken extends backend_1.ServerApi {
17
35
  constructor(pathPart = "assert") {
18
- super(types_1.HttpMethod.POST, pathPart);
36
+ super(thunderstorm_1.HttpMethod.POST, pathPart);
19
37
  }
20
38
  process(request, response, queryParams, body) {
21
39
  return __awaiter(this, void 0, void 0, function* () {
22
- return yield AccountModule_1.AccountModule.assertApi(body, response);
40
+ return yield _imports_1.AccountModule.assertApi(body, response);
23
41
  });
24
42
  }
25
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"_assert.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/_assert.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sGAA6G;AAE7G,wEAAwE;AACxE,kEAA6D;AAE7D,MAAa,eACT,SAAQ,sBAAqC;IAE7C,YAAY,WAAmB,QAAQ;QACnC,KAAK,CAAC,kBAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAoB;;YACzG,OAAO,MAAM,6BAAa,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACzD,CAAC;KAAA;CACJ;AAVD,0CAUC"}
1
+ {"version":3,"file":"_assert.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/_assert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,qEAIiD;AACjD,yCAIoB;AACpB,kEAA2D;AAG3D,MAAa,eACZ,SAAQ,mBAAqC;IAE7C,YAAY,WAAmB,QAAQ;QACtC,KAAK,CAAC,yBAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAClC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAoB;;YAC5G,OAAO,MAAM,wBAAa,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC;KAAA;CACD;AAVD,0CAUC"}
@@ -0,0 +1,4 @@
1
+ export * from "../../../../shared/api";
2
+ export * from "../../../modules/AccountModule";
3
+ export * from "../../../modules/SamlModule";
4
+ export * from "../../../modules/_imports";
@@ -0,0 +1,36 @@
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
@@ -0,0 +1 @@
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,4 +1,22 @@
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
+ */
2
20
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
21
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
22
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,18 +27,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
27
  });
10
28
  };
11
29
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
13
- const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
14
- const AccountModule_1 = require("../../../modules/AccountModule");
15
- class ServerApi_Account_Create extends server_api_1.ServerApi {
30
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
31
+ const _imports_1 = require("./_imports");
32
+ const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
33
+ class ServerApi_Account_Create extends backend_1.ServerApi {
16
34
  constructor() {
17
- super(types_1.HttpMethod.POST, "create");
35
+ super(thunderstorm_1.HttpMethod.POST, "create");
18
36
  this.dontPrintResponse();
19
37
  }
20
38
  process(request, response, queryParams, body) {
21
39
  return __awaiter(this, void 0, void 0, function* () {
22
40
  this.assertProperty(body, ["password", "email"]);
23
- return AccountModule_1.AccountModule.create(body, response);
41
+ return _imports_1.AccountModule.create(body, response);
24
42
  });
25
43
  }
26
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/create.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sGAA6G;AAE7G,wEAAwE;AACxE,kEAA6D;AAE7D,MAAM,wBACF,SAAQ,sBAA4B;IAEpC;QACI,KAAK,CAAC,kBAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjC,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAA2B;;YAChH,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;YAEjD,OAAO,6BAAa,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAChD,CAAC;KAAA;CACJ;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/create.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;AAEH,qEAGiD;AAGjD,yCAIoB;AACpB,kEAA2D;AAG3D,MAAM,wBACL,SAAQ,mBAA4B;IAEpC;QACC,KAAK,CAAC,yBAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjC,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC1B,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAA2B;;YACnH,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;YAEjD,OAAO,wBAAa,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
@@ -1,4 +1,22 @@
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
+ */
2
20
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
21
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
22
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,16 +27,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
27
  });
10
28
  };
11
29
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
13
- const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
14
- const AccountModule_1 = require("../../../modules/AccountModule");
15
- class ListAccounts extends server_api_1.ServerApi {
30
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
31
+ const _imports_1 = require("./_imports");
32
+ const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
33
+ class ListAccounts extends backend_1.ServerApi {
16
34
  constructor() {
17
- super(types_1.HttpMethod.GET, "query");
35
+ super(thunderstorm_1.HttpMethod.GET, "query");
18
36
  }
19
37
  process(request, response, queryParams, body) {
20
38
  return __awaiter(this, void 0, void 0, function* () {
21
- const accounts = yield AccountModule_1.AccountModule.listUsers();
39
+ const accounts = yield _imports_1.AccountModule.listUsers();
22
40
  return { accounts };
23
41
  });
24
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/list.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sGAA6G;AAE7G,wEAAwE;AACxE,kEAA6D;AAE7D,MAAM,YACF,SAAQ,sBAAkC;IAE1C;QACI,KAAK,CAAC,kBAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAU;;YAC/F,MAAM,QAAQ,GAAiB,MAAM,6BAAa,CAAC,SAAS,EAAE,CAAC;YAC/D,OAAO,EAAC,QAAQ,EAAC,CAAA;QACrB,CAAC;KAAA;CACJ;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/list.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;AAEH,qEAIiD;AACjD,yCAIoB;AACpB,kEAA2D;AAG3D,MAAM,YACL,SAAQ,mBAAkC;IAE1C;QACC,KAAK,CAAC,yBAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAChC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAU;;YAClG,MAAM,QAAQ,GAAiB,MAAM,wBAAa,CAAC,SAAS,EAAE,CAAC;YAC/D,OAAO,EAAC,QAAQ,EAAC,CAAA;QAClB,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,YAAY,EAAE,CAAC"}
@@ -1,4 +1,22 @@
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
+ */
2
20
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
21
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
22
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,16 +27,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
27
  });
10
28
  };
11
29
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
13
- const SamlModule_1 = require("../../../modules/SamlModule");
14
- class ServerApi_Account_LoginSAML extends server_api_1.ServerApi_Get {
30
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
31
+ const _imports_1 = require("./_imports");
32
+ class ServerApi_Account_LoginSAML extends backend_1.ServerApi_Get {
15
33
  constructor() {
16
34
  super("login-saml");
17
35
  this.dontPrintResponse();
18
36
  }
19
37
  process(request, response, queryParams, body) {
20
38
  return __awaiter(this, void 0, void 0, function* () {
21
- const loginUrl = yield SamlModule_1.SamlModule.loginRequest(queryParams);
39
+ const loginUrl = yield _imports_1.SamlModule.loginRequest(queryParams);
22
40
  return { loginUrl };
23
41
  });
24
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"login-saml.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/login-saml.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sGAAiH;AAEjH,4DAAuD;AAEvD,MAAM,2BACF,SAAQ,0BAAmC;IAE3C;QACI,KAAK,CAAC,YAAY,CAAC,CAAC;QACpB,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAoC,EAAE,IAAU;;YACpH,MAAM,QAAQ,GAAG,MAAM,uBAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;YAC5D,OAAO,EAAC,QAAQ,EAAC,CAAA;QACrB,CAAC;KAAA;CACJ;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,2BAA2B,EAAE,CAAC"}
1
+ {"version":3,"file":"login-saml.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/login-saml.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;AAEH,qEAGiD;AAGjD,yCAIoB;AAGpB,MAAM,2BACL,SAAQ,uBAAmC;IAE3C;QACC,KAAK,CAAC,YAAY,CAAC,CAAC;QACpB,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC1B,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAoC,EAAE,IAAU;;YACvH,MAAM,QAAQ,GAAG,MAAM,qBAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;YAC5D,OAAO,EAAC,QAAQ,EAAC,CAAA;QAClB,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,2BAA2B,EAAE,CAAC"}
@@ -1,4 +1,22 @@
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
+ */
2
20
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
21
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
22
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,23 +27,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
27
  });
10
28
  };
11
29
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
13
- const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
14
- const AccountModule_1 = require("../../../modules/AccountModule");
15
- const validator_1 = require("@intuitionrobotics/ts-common/validator/validator");
16
- class ServerApi_Account_Login extends server_api_1.ServerApi {
30
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
31
+ const _imports_1 = require("./_imports");
32
+ const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
33
+ class ServerApi_Account_Login extends backend_1.ServerApi {
17
34
  constructor() {
18
- super(types_1.HttpMethod.POST, "login");
19
- this.setBodyValidator({
20
- email: validator_1.validateString(),
21
- password: validator_1.validateString(),
22
- frontType: undefined
23
- });
35
+ super(thunderstorm_1.HttpMethod.POST, "login");
24
36
  }
25
37
  process(request, response, queryParams, body) {
26
38
  return __awaiter(this, void 0, void 0, function* () {
27
39
  this.assertProperty(body, ["email", "password"]);
28
- return AccountModule_1.AccountModule.login(body, response);
40
+ return _imports_1.AccountModule.login(body, response);
29
41
  });
30
42
  }
31
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/login.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sGAA6G;AAE7G,wEAAwE;AACxE,kEAA6D;AAC7D,gFAAgF;AAEhF,MAAM,uBACF,SAAQ,sBAA2B;IAEnC;QACI,KAAK,CAAC,kBAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,gBAAgB,CAAC;YACd,KAAK,EAAE,0BAAc,EAAE;YACvB,QAAQ,EAAE,0BAAc,EAAE;YAC1B,SAAS,EAAE,SAAS;SACvB,CACJ,CAAA;IACL,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAA0B;;YAC/G,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;YAEjD,OAAO,6BAAa,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC;KAAA;CACJ;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/login.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;AAEH,qEAGiD;AAGjD,yCAIoB;AACpB,kEAA2D;AAG3D,MAAM,uBACL,SAAQ,mBAA2B;IAEnC;QACC,KAAK,CAAC,yBAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAA0B;;YAClH,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;YAEjD,OAAO,wBAAa,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC5C,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,uBAAuB,EAAE,CAAC"}
@@ -1,4 +1,22 @@
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
+ */
2
20
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
21
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
22
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,20 +27,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
27
  });
10
28
  };
11
29
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
13
- const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
14
- const AccountModule_1 = require("../../../modules/AccountModule");
15
- const exceptions_1 = require("@intuitionrobotics/thunderstorm/app-backend/exceptions");
16
- class ServerApi_Account_Logout extends server_api_1.ServerApi {
30
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
31
+ const _imports_1 = require("./_imports");
32
+ const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
33
+ class ServerApi_Account_Logout extends backend_1.ServerApi {
17
34
  constructor() {
18
- super(types_1.HttpMethod.POST, "logout");
35
+ super(thunderstorm_1.HttpMethod.POST, "logout");
19
36
  }
20
37
  process(request, response, queryParams, body) {
21
38
  return __awaiter(this, void 0, void 0, function* () {
22
- const sessionId = AccountModule_1.Header_SessionId.get(request);
39
+ const sessionId = _imports_1.Header_SessionId.get(request);
23
40
  if (!sessionId)
24
- throw new exceptions_1.ApiException(404, 'Missing sessionId');
25
- return AccountModule_1.AccountModule.logout(sessionId);
41
+ throw new backend_1.ApiException(404, 'Missing sessionId');
42
+ return _imports_1.AccountModule.logout(sessionId);
26
43
  });
27
44
  }
28
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/logout.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sGAA6G;AAE7G,wEAAwE;AACxE,kEAA+E;AAC/E,uFAAoF;AAEpF,MAAM,wBACF,SAAQ,sBAA4B;IAEpC;QACI,KAAK,CAAC,kBAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAQ;;YAC7F,MAAM,SAAS,GAAG,gCAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAChD,IAAI,CAAC,SAAS;gBACV,MAAM,IAAI,yBAAY,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;YAErD,OAAO,6BAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3C,CAAC;KAAA;CACJ;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/logout.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;AAEH,qEAIiD;AACjD,yCAIoB;AACpB,kEAA2D;AAG3D,MAAM,wBACL,SAAQ,mBAA4B;IAEpC;QACC,KAAK,CAAC,yBAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAClC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAQ;;YAChG,MAAM,SAAS,GAAG,2BAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAChD,IAAI,CAAC,SAAS;gBACb,MAAM,IAAI,sBAAY,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;YAElD,OAAO,wBAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACxC,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
@@ -9,21 +9,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
13
- const RemoteProxy_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/proxy/RemoteProxy");
14
- const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
15
- const AccountModule_1 = require("../../../modules/AccountModule");
16
- const validator_1 = require("@intuitionrobotics/ts-common/validator/validator");
17
- class ServerApi_Account_Upsert extends server_api_1.ServerApi {
12
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
13
+ const _imports_1 = require("./_imports");
14
+ const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
15
+ const ts_common_1 = require("@intuitionrobotics/ts-common");
16
+ class ServerApi_Account_Upsert extends backend_1.ServerApi {
18
17
  constructor() {
19
- super(types_1.HttpMethod.POST, "upsert");
20
- this.setMiddlewares(RemoteProxy_1.RemoteProxy.Middleware);
21
- this.setBodyValidator({ password: validator_1.validateExists(), email: validator_1.validateExists(), password_check: undefined });
18
+ super(thunderstorm_1.HttpMethod.POST, "upsert");
19
+ this.setMiddlewares(backend_1.RemoteProxy.Middleware);
20
+ this.setBodyValidator({ password: ts_common_1.validateExists(), email: ts_common_1.validateExists(), password_check: undefined });
22
21
  this.dontPrintResponse();
23
22
  }
24
23
  process(request, response, queryParams, body) {
25
24
  return __awaiter(this, void 0, void 0, function* () {
26
- return AccountModule_1.AccountModule.upsert(body);
25
+ return _imports_1.AccountModule.upsert(body);
27
26
  });
28
27
  }
29
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"upsert.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/upsert.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sGAA6G;AAE7G,uGAAkG;AAClG,wEAAwE;AACxE,kEAA6D;AAC7D,gFAAgF;AAEhF,MAAM,wBACF,SAAQ,sBAA4B;IAEpC;QACI,KAAK,CAAC,kBAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjC,IAAI,CAAC,cAAc,CAAC,yBAAW,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC,gBAAgB,CAAC,EAAC,QAAQ,EAAE,0BAAc,EAAE,EAAE,KAAK,EAAE,0BAAc,EAAE,EAAE,cAAc,EAAE,SAAS,EAAC,CAAC,CAAC;QACxG,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAA2B;;YAChH,OAAO,6BAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC;KAAA;CACJ;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"upsert.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/upsert.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qEAIiD;AACjD,yCAIoB;AACpB,kEAA2D;AAE3D,4DAA8D;AAE9D,MAAM,wBACL,SAAQ,mBAA4B;IAEpC;QACC,KAAK,CAAC,yBAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACjC,IAAI,CAAC,cAAc,CAAC,qBAAW,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC,gBAAgB,CAAC,EAAC,QAAQ,EAAE,0BAAc,EAAE,EAAE,KAAK,EAAE,0BAAc,EAAE,EAAE,cAAc,EAAE,SAAS,EAAC,CAAC,CAAC;QACxG,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC1B,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAA2B;;YACnH,OAAO,wBAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
@@ -1,4 +1,22 @@
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
+ */
2
20
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
21
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
22
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,16 +27,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
27
  });
10
28
  };
11
29
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
13
- const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
14
- const AccountModule_1 = require("../../../modules/AccountModule");
15
- class ValidateToken extends server_api_1.ServerApi {
30
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
31
+ const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
32
+ const _imports_1 = require("./_imports");
33
+ class ValidateToken extends backend_1.ServerApi {
16
34
  constructor() {
17
- super(types_1.HttpMethod.GET, "validate");
35
+ super(thunderstorm_1.HttpMethod.GET, "validate");
18
36
  }
19
37
  process(request, response, queryParams, body) {
20
38
  return __awaiter(this, void 0, void 0, function* () {
21
- const { email, _id } = yield AccountModule_1.AccountModule.validateSession(request, response);
39
+ const { email, _id } = yield _imports_1.AccountModule.validateSession(request, this.getScopes(), response);
22
40
  return { email, _id };
23
41
  });
24
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/validate.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sGAA6G;AAE7G,wEAAwE;AACxE,kEAA6D;AAE7D,MAAM,aACF,SAAQ,sBAAqC;IAE7C;QACI,KAAK,CAAC,kBAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACtC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAU;;YAC/F,MAAM,EAAC,KAAK,EAAE,GAAG,EAAC,GAAG,MAAM,6BAAa,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAC5E,OAAO,EAAC,KAAK,EAAE,GAAG,EAAC,CAAC;QACxB,CAAC;KAAA;CACJ;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../src/main/app-backend/api/v1/account/validate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;AAEH,qEAIiD;AAEjD,kEAA2D;AAC3D,yCAGoB;AAEpB,MAAM,aACL,SAAQ,mBAAqC;IAE7C;QACC,KAAK,CAAC,yBAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAAU;;YAClG,MAAM,EAAC,KAAK,EAAE,GAAG,EAAC,GAAG,MAAM,wBAAa,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAC;YAC9F,OAAO,EAAC,KAAK,EAAE,GAAG,EAAC,CAAC;QACrB,CAAC;KAAA;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
- import { ApiResponse, ServerApi } from "@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api";
2
- import { ExpressRequest } from "@intuitionrobotics/thunderstorm/app-backend/utils/types";
3
- import { AccountApi_AddNewAccount, Request_AddNewAccount } from "../../shared/api";
1
+ import { ApiResponse, ServerApi } from "@intuitionrobotics/thunderstorm/backend";
2
+ import { Request_AddNewAccount, AccountApi_AddNewAccount } from "../api/v1/account/_imports";
3
+ import { ExpressRequest } from "@intuitionrobotics/thunderstorm/backend";
4
4
  export declare class ServerApi_Account_AddNewAccount extends ServerApi<AccountApi_AddNewAccount> {
5
5
  constructor();
6
6
  protected process(request: ExpressRequest, response: ApiResponse, queryParams: {}, body: Request_AddNewAccount): Promise<import("../../shared/api").UI_Account>;
@@ -1,4 +1,22 @@
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
+ */
2
20
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
21
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
22
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -10,24 +28,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
28
  };
11
29
  Object.defineProperty(exports, "__esModule", { value: true });
12
30
  exports.ServerApi_Account_AddNewAccount = void 0;
13
- const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
14
- const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
15
- const validator_1 = require("@intuitionrobotics/ts-common/validator/validator");
16
- const AccountModule_1 = require("../modules/AccountModule");
17
- class ServerApi_Account_AddNewAccount extends server_api_1.ServerApi {
31
+ const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
32
+ const _imports_1 = require("../api/v1/account/_imports");
33
+ const thunderstorm_1 = require("@intuitionrobotics/thunderstorm");
34
+ class ServerApi_Account_AddNewAccount extends backend_1.ServerApi {
18
35
  constructor() {
19
- super(types_1.HttpMethod.POST, "add-new-account");
20
- this.setBodyValidator({
21
- email: validator_1.validateString(),
22
- password: validator_1.validateString(false),
23
- password_check: validator_1.validateString(false)
24
- });
36
+ super(thunderstorm_1.HttpMethod.POST, "add-new-account");
25
37
  this.dontPrintResponse();
26
38
  }
27
39
  process(request, response, queryParams, body) {
28
40
  return __awaiter(this, void 0, void 0, function* () {
29
41
  this.assertProperty(body, ["email"]);
30
- return AccountModule_1.AccountModule.addNewAccount(body.email, body.password, body.password_check);
42
+ return _imports_1.AccountModule.addNewAccount(body.email, body.password, body.password_check);
31
43
  });
32
44
  }
33
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"add-new-account.js","sourceRoot":"","sources":["../../../src/main/app-backend/apis/add-new-account.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sGAA6G;AAE7G,wEAAwE;AACxE,gFAAgF;AAEhF,4DAAuD;AAEvD,MAAa,+BACT,SAAQ,sBAAmC;IAE3C;QACI,KAAK,CAAC,kBAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAC1C,IAAI,CAAC,gBAAgB,CAAC;YAClB,KAAK,EAAE,0BAAc,EAAE;YACvB,QAAQ,EAAE,0BAAc,CAAC,KAAK,CAAC;YAC/B,cAAc,EAAE,0BAAc,CAAC,KAAK,CAAC;SACxC,CAAC,CAAA;QACF,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC7B,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAA2B;;YAChH,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;YAErC,OAAO,6BAAa,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACvF,CAAC;KAAA;CACJ;AAlBD,0EAkBC"}
1
+ {"version":3,"file":"add-new-account.js","sourceRoot":"","sources":["../../../src/main/app-backend/apis/add-new-account.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,qEAGiD;AACjD,yDAIoC;AACpC,kEAA2D;AAG3D,MAAa,+BACZ,SAAQ,mBAAmC;IAE3C;QACC,KAAK,CAAC,yBAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAC1C,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC1B,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,IAA2B;;YACnH,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;YAErC,OAAO,wBAAa,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACpF,CAAC;KAAA;CACD;AAbD,0EAaC"}
@@ -1 +1,3 @@
1
1
  export declare const Backend_ModulePack_Users: (import("../modules/SecretsModule").SecretsModule_Class | import("../modules/AccountModule").AccountsModule_Class)[];
2
+ export * from "../modules/AccountModule";
3
+ export * from "../modules/SamlModule";