datacenter-lib-common-ts 1.0.3 → 1.1.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 (37) hide show
  1. package/dist/cjs/api/routes.js +4 -0
  2. package/dist/cjs/api/routes.js.map +1 -1
  3. package/dist/cjs/apiClient/users.js +69 -0
  4. package/dist/cjs/apiClient/users.js.map +1 -1
  5. package/dist/cjs/authApp/index.js +15 -0
  6. package/dist/cjs/authApp/index.js.map +1 -0
  7. package/dist/cjs/index.js +3 -2
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/models/authorizations.js.map +1 -1
  10. package/dist/cjs/models/index.js +7 -5
  11. package/dist/cjs/models/index.js.map +1 -1
  12. package/dist/esm/api/routes.js +4 -0
  13. package/dist/esm/api/routes.js.map +1 -1
  14. package/dist/esm/apiClient/users.js +69 -1
  15. package/dist/esm/apiClient/users.js.map +1 -1
  16. package/dist/esm/authApp/index.js +12 -0
  17. package/dist/esm/authApp/index.js.map +1 -0
  18. package/dist/esm/index.js +5 -2
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/esm/models/authorizations.js.map +1 -1
  21. package/dist/esm/models/index.js +6 -4
  22. package/dist/esm/models/index.js.map +1 -1
  23. package/dist/types/api/routes.d.ts +4 -0
  24. package/dist/types/apiClient/users.d.ts +23 -2
  25. package/dist/types/authApp/index.d.ts +11 -0
  26. package/dist/types/index.d.ts +3 -2
  27. package/dist/types/models/index.d.ts +4 -5
  28. package/package.json +3 -2
  29. package/src/api/index.ts +0 -1
  30. package/src/api/routes.ts +6 -1
  31. package/src/apiClient/authentications.ts +1 -1
  32. package/src/apiClient/users.ts +97 -4
  33. package/src/authApp/index.ts +11 -0
  34. package/src/index.ts +26 -32
  35. package/src/license/index.ts +5 -0
  36. package/src/models/authorizations.ts +1 -0
  37. package/src/models/index.ts +47 -9
@@ -9,7 +9,11 @@ exports.ApiRoutesNames = {
9
9
  workgroups: '/workgroups',
10
10
  legalPersons: '/legal-persons',
11
11
  users: '/users',
12
+ usersVerify: '/users/verify/:uuid/:code',
12
13
  usersSharedData: '/users-sd',
14
+ usersRecoverPwdCode: '/users/rpwd-c',
15
+ usersRecoverPwdValidateCode: '/users/rpwd-vc',
16
+ usersRecoverPwdReset: '/users/rpwd-r',
13
17
  workgroupUnits: '/workgroup-units',
14
18
  usersGroups: '/users-groups',
15
19
  usersGroups_authorizations: 'users-groups--authorizations',
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/api/routes.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,kBAAkB;IACnC,cAAc,EAAE,iBAAiB;IACjC,mBAAmB,EAAE,wBAAwB;IAC7C,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,gBAAgB;IAC9B,KAAK,EAAE,QAAQ;IACf,eAAe,EAAE,WAAW;IAC5B,cAAc,EAAE,kBAAkB;IAClC,WAAW,EAAE,eAAe;IAC5B,0BAA0B,EAAE,8BAA8B;IAC1D,YAAY,EAAE,gBAAgB;IAC9B,mBAAmB,EAAE,wBAAwB;CAC9C,CAAA"}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/api/routes.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,kBAAkB;IACnC,cAAc,EAAE,iBAAiB;IACjC,mBAAmB,EAAE,wBAAwB;IAC7C,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,gBAAgB;IAC9B,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,2BAA2B;IACxC,eAAe,EAAE,WAAW;IAC5B,mBAAmB,EAAE,eAAe;IACpC,2BAA2B,EAAE,gBAAgB;IAC7C,oBAAoB,EAAE,eAAe;IACrC,cAAc,EAAE,kBAAkB;IAClC,WAAW,EAAE,eAAe;IAC5B,0BAA0B,EAAE,8BAA8B;IAC1D,YAAY,EAAE,gBAAgB;IAC9B,mBAAmB,EAAE,wBAAwB;CAC9C,CAAA"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UsersApiClient = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const axios_1 = tslib_1.__importDefault(require("axios"));
4
6
  const fwork_jsts_common_1 = require("fwork-jsts-common");
5
7
  const routes_1 = require("../api/routes");
6
8
  class UsersApiClient extends fwork_jsts_common_1.BaseApiClient {
@@ -9,6 +11,73 @@ class UsersApiClient extends fwork_jsts_common_1.BaseApiClient {
9
11
  apiUrl: `${args.baseApiUrl}${routes_1.ApiRoutesNames.users}`,
10
12
  axios: args.axios,
11
13
  });
14
+ this.baseApiUrl = args.baseApiUrl;
15
+ }
16
+ async verify(args) {
17
+ const result = {};
18
+ try {
19
+ const response = await (this.axios ?? axios_1.default).post(`${this.baseApiUrl}${routes_1.ApiRoutesNames.usersVerify.replace(':uuid', args.userUuid).replace(':code', args.code)}`);
20
+ if (response.status == 200) {
21
+ if (response.data)
22
+ result.data = response.data;
23
+ result.success = true;
24
+ result.msg = 'Usuário confirmado com sucesso';
25
+ }
26
+ else {
27
+ result.success = false;
28
+ result.msg = 'Usuário não pode ser confirmado';
29
+ }
30
+ }
31
+ catch (error) {
32
+ result.success = false;
33
+ result.msg = fwork_jsts_common_1.ApiClientUtils.getErrorMessage(error);
34
+ }
35
+ return result;
36
+ }
37
+ async recoverPwdCode(args) {
38
+ const result = {};
39
+ try {
40
+ const response = await (this.axios ?? axios_1.default).post(`${this.baseApiUrl}${routes_1.ApiRoutesNames.usersRecoverPwdCode}`, { email: args.email });
41
+ if (response.status == 200) {
42
+ result.data = response.data;
43
+ result.success = true;
44
+ }
45
+ }
46
+ catch (error) {
47
+ result.success = false;
48
+ result.msg = fwork_jsts_common_1.ApiClientUtils.getErrorMessage(error);
49
+ }
50
+ return result;
51
+ }
52
+ async recoverPwdValidateCode(args) {
53
+ const result = {};
54
+ try {
55
+ const response = await (this.axios ?? axios_1.default).post(`${this.baseApiUrl}${routes_1.ApiRoutesNames.usersRecoverPwdValidateCode}`, { email: args.email, code: args.code });
56
+ if (response.status == 200) {
57
+ result.data = response.data;
58
+ result.success = true;
59
+ }
60
+ }
61
+ catch (error) {
62
+ result.success = false;
63
+ result.msg = fwork_jsts_common_1.ApiClientUtils.getErrorMessage(error);
64
+ }
65
+ return result;
66
+ }
67
+ async recoverPwdReset(args) {
68
+ const result = {};
69
+ try {
70
+ const response = await (this.axios ?? axios_1.default).post(`${this.baseApiUrl}${routes_1.ApiRoutesNames.usersRecoverPwdReset}`, { newPwd: args.newPwd, token: args.token });
71
+ if (response.status == 200) {
72
+ result.data = response.data;
73
+ result.success = true;
74
+ }
75
+ }
76
+ catch (error) {
77
+ result.success = false;
78
+ result.msg = fwork_jsts_common_1.ApiClientUtils.getErrorMessage(error);
79
+ }
80
+ return result;
12
81
  }
13
82
  }
14
83
  exports.UsersApiClient = UsersApiClient;
@@ -1 +1 @@
1
- {"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/apiClient/users.ts"],"names":[],"mappings":";;;AACA,yDAAiD;AAGjD,0CAA8C;AAE9C,MAAa,cAAe,SAAQ,iCACP;IAC3B,YAAY,IAGX;QACC,KAAK,CAAC;YACJ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,uBAAc,CAAC,KAAK,EAAE;YACnD,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;CACF;AAXD,wCAWC"}
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/apiClient/users.ts"],"names":[],"mappings":";;;;AAAA,0DAAyD;AACzD,yDAA0F;AAC1F,0CAA8C;AAG9C,MAAa,cAAe,SAAQ,iCACP;IAG3B,YAAY,IAGX;QACC,KAAK,CAAC;YACJ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,uBAAc,CAAC,K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rB;QACC,MAAM,MAAM,GAA0C,EAAE,CAAA;QAExD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,eAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,GAAG,uBAAc,CAAC,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;YAEzJ,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;gBAC3B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAA;gBAC3B,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;YACvB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,OAAO,GAAG,KAAK,CAAA;YACtB,MAAM,CAAC,GAAG,GAAG,kCAAc,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;QACpD,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAEF;AAzGD,wCAyGC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthAppRoutesNames = void 0;
4
+ exports.AuthAppRoutesNames = {
5
+ home: '/',
6
+ register: '/register',
7
+ registerValidateCode: '/registervc',
8
+ registerCancel: '/registercl',
9
+ login: '/login',
10
+ profile: '/profile',
11
+ recoverPwdEmail: '/recovere',
12
+ recoverPwdValidateCode: '/recovervc',
13
+ recoverPwdReset: '/recoverr'
14
+ };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/authApp/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,IAAI,EAAE,GAAG;IACT,QAAQ,EAAE,WAAW;IACrB,oBAAoB,EAAE,aAAa;IACnC,cAAc,EAAE,aAAa;IAC7B,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,UAAU;IACnB,eAAe,EAAE,WAAW;IAC5B,sBAAsB,EAAE,YAAY;IACpC,eAAe,EAAE,WAAW;CAC7B,CAAA"}
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Authorizations = exports.AuthorizationKeys = exports.legalPersonPropsNames = exports.UserGroup_InviteStatusUtils = exports.UserGroup_InviteStatus = exports.User = exports.LegalPersonTypes = exports.AuthenticationType = exports.AuthenticationTokenDataProviders = exports.WorkgroupUnitsTypesApiClient = exports.WorkgroupUnitsApiClient = exports.WorkgroupsApiClient = exports.UsersSharedDataApiClient = exports.UsersGroups_invitesApiClient = exports.UsersGroupsApiClient = exports.Users_GroupsApiClient = exports.UsersApiClient = exports.LegalPersonsApiClient = exports.AuthorizationsApiClient = exports.AuthenticationsApiClient = exports.ApiRoutesNames = exports.ApiRequestHeaders = void 0;
3
+ exports.Authorizations = exports.AuthorizationKeys = exports.UserGroup_InviteStatusUtils = exports.UserGroup_InviteStatus = exports.User = exports.LegalPersonTypes = exports.AuthenticationType = exports.AuthenticationTokenDataProviders = exports.AuthAppRoutesNames = exports.WorkgroupUnitsTypesApiClient = exports.WorkgroupUnitsApiClient = exports.WorkgroupsApiClient = exports.UsersSharedDataApiClient = exports.UsersGroups_invitesApiClient = exports.UsersGroupsApiClient = exports.Users_GroupsApiClient = exports.UsersApiClient = exports.LegalPersonsApiClient = exports.AuthorizationsApiClient = exports.AuthenticationsApiClient = exports.ApiRoutesNames = exports.ApiRequestHeaders = void 0;
4
4
  const api_1 = require("./api");
5
5
  Object.defineProperty(exports, "ApiRequestHeaders", { enumerable: true, get: function () { return api_1.ApiRequestHeaders; } });
6
6
  const routes_1 = require("./api/routes");
@@ -27,6 +27,8 @@ const workgroupUnits_1 = require("./apiClient/workgroupUnits");
27
27
  Object.defineProperty(exports, "WorkgroupUnitsApiClient", { enumerable: true, get: function () { return workgroupUnits_1.WorkgroupUnitsApiClient; } });
28
28
  const workgroupUnitsTypes_1 = require("./apiClient/workgroupUnitsTypes");
29
29
  Object.defineProperty(exports, "WorkgroupUnitsTypesApiClient", { enumerable: true, get: function () { return workgroupUnitsTypes_1.WorkgroupUnitsTypesApiClient; } });
30
+ const authApp_1 = require("./authApp");
31
+ Object.defineProperty(exports, "AuthAppRoutesNames", { enumerable: true, get: function () { return authApp_1.AuthAppRoutesNames; } });
30
32
  const models_1 = require("./models");
31
33
  Object.defineProperty(exports, "AuthenticationTokenDataProviders", { enumerable: true, get: function () { return models_1.AuthenticationTokenDataProviders; } });
32
34
  Object.defineProperty(exports, "AuthenticationType", { enumerable: true, get: function () { return models_1.AuthenticationType; } });
@@ -34,7 +36,6 @@ Object.defineProperty(exports, "LegalPersonTypes", { enumerable: true, get: func
34
36
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return models_1.User; } });
35
37
  Object.defineProperty(exports, "UserGroup_InviteStatus", { enumerable: true, get: function () { return models_1.UserGroup_InviteStatus; } });
36
38
  Object.defineProperty(exports, "UserGroup_InviteStatusUtils", { enumerable: true, get: function () { return models_1.UserGroup_InviteStatusUtils; } });
37
- Object.defineProperty(exports, "legalPersonPropsNames", { enumerable: true, get: function () { return models_1.legalPersonPropsNames; } });
38
39
  const authorizations_2 = require("./models/authorizations");
39
40
  Object.defineProperty(exports, "AuthorizationKeys", { enumerable: true, get: function () { return authorizations_2.AuthorizationKeys; } });
40
41
  Object.defineProperty(exports, "Authorizations", { enumerable: true, get: function () { return authorizations_2.AuthorizationKeys; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAA0E;AAyBtE,kGAzBK,uBAAiB,OAyBL;AAxBrB,yCAA8C;AA0B1C,+FA1BK,uBAAc,OA0BL;AAxBlB,iEAAsE;AA2BlE,yGA3BK,0CAAwB,OA2BL;AA1B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GA7BK,kCAAoB,OA6BL;AA5BxB,yEAA8E;AA6B1E,6GA7BK,kDAA4B,OA6BL;AA5BhC,iEAA6G;AA6BlE,yGA7BK,0CAAwB,OA6BL;AA5BnE,uDAA4D;AA6BxD,oGA7BK,gCAAmB,OA6BL;AA5BvB,+DAAoE;AA6BhE,wGA7BK,wCAAuB,OA6BL;AA5B3B,yEAA8E;AA6B1E,6GA7BK,kDAA4B,OA6BL;AA3BhC,uCAA8C;AA8B1C,mGA9BK,4BAAkB,OA8BL;AA5BtB,qCAKkB;AA0Bd,iHA/BK,yCAAgC,OA+BL;AAAE,mGA/BK,2BAAkB,OA+BL;AAIhC,iGA/BA,yBAAgB,OA+BA;AAAE,qFA/BA,aAAI,OA+BA;AAAE,uGA/BA,+BAAsB,OA+BA;AAAG,4GA/BA,oCAA2B,OA+BA;AA7BpG,4DAA4D;AA+BxD,kGA/BK,kCAAiB,OA+BL;AAAuB,+FA/BnC,kCAAiB,OA+BgC"}
@@ -1 +1 @@
1
- {"version":3,"file":"authorizations.js","sourceRoot":"","sources":["../../../src/models/authorizations.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,gBAAgB,EAAE,kBAAkB;IAEpC,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,QAAQ,EAAE,UAAU;CACZ,CAAA"}
1
+ {"version":3,"file":"authorizations.js","sourceRoot":"","sources":["../../../src/models/authorizations.ts"],"names":[],"mappings":";;;AACa,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,gBAAgB,EAAE,kBAAkB;IAEpC,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,QAAQ,EAAE,UAAU;CACZ,CAAA"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserGroup_InviteStatusUtils = exports.UserGroup_InviteStatus = exports.User = exports.LegalPersonTypes = exports.legalPersonPropsNames = exports.AuthenticationTokenDataProviders = exports.AuthenticationType = void 0;
3
+ exports.UserGroup_InviteStatusUtils = exports.UserGroup_InviteStatus = exports.User = exports.LegalPersonTypes = exports.AuthenticationTokenDataProviders = exports.AuthenticationType = void 0;
4
4
  // authentication...
5
+ // TODO-rename to AuthenticationTypes
5
6
  exports.AuthenticationType = {
6
7
  default: 0,
7
8
  uuid: 1,
@@ -12,9 +13,9 @@ exports.AuthenticationTokenDataProviders = {
12
13
  default: 'default',
13
14
  google: 'accounts.google.com',
14
15
  };
15
- exports.legalPersonPropsNames = {
16
- workgroupUuid: 'workgroupUuid'
17
- };
16
+ // export const legalPersonPropsNames = {
17
+ // workgroupUuid: 'workgroupUuid'
18
+ // }
18
19
  exports.LegalPersonTypes = {
19
20
  person: 0,
20
21
  company: 1,
@@ -25,6 +26,7 @@ class User {
25
26
  this.name = data.name;
26
27
  this.login = data.login;
27
28
  this.email = data.email;
29
+ this.validated = data.validated;
28
30
  this.pwd = data.pwd;
29
31
  this.imageUrl = data.imageUrl;
30
32
  this.legalPersonUuid = data.legalPersonUuid;
@@ -32,7 +34,7 @@ class User {
32
34
  this.groups = data.groups;
33
35
  }
34
36
  toUserSharedData() {
35
- const sharedDataKeys = ['uuid', 'name', 'login', 'email', 'imageUrl'];
37
+ const sharedDataKeys = ['uuid', 'name', 'login', 'email', 'validated', 'imageUrl'];
36
38
  const sharedData = {};
37
39
  sharedDataKeys.forEach(key => {
38
40
  if (key in this) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;AAEA,oBAAoB;AAEP,QAAA,kBAAkB,GAAG;IAChC,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;CACD,CAAA;AA6BV,0CAA0C;AAC7B,QAAA,gCAAgC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AAI,CAAC,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM,iBAAiB,GAAQ,EAAE,CAAC;gBAClC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBACrC,iBAAiB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC7D,CAAC;gBACD,OAAO,iBAAiB,CAAC;YAC3B,CAAC;QACH,CAAC;QAED,yDAAyD;QACzD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAhFD,oBAgFC;AAgCY,QAAA,sBAAsB,GAAG;IACpC,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;CACF,CAAA;AAIV,MAAa,2BAA2B;;AAAxC,kEAOC;AANQ,gEAAoC,GAAG,CAAC,MAA8B,EAAE,EAAE;IAC/E,OAAO,MAAM,IAAI,8BAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,IAAI,8BAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAA;AAChI,CAAC,CAAA;AACM,wEAA4C,GAAG,CAAC,MAA8B,EAAE,EAAE;IACvF,OAAO,MAAM,IAAI,8BAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,IAAI,8BAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAA;AAC/H,CAAC,CAAA;AAuCH,mBAAmB"}
@@ -6,7 +6,11 @@ export const ApiRoutesNames = {
6
6
  workgroups: '/workgroups',
7
7
  legalPersons: '/legal-persons',
8
8
  users: '/users',
9
+ usersVerify: '/users/verify/:uuid/:code',
9
10
  usersSharedData: '/users-sd',
11
+ usersRecoverPwdCode: '/users/rpwd-c',
12
+ usersRecoverPwdValidateCode: '/users/rpwd-vc',
13
+ usersRecoverPwdReset: '/users/rpwd-r',
10
14
  workgroupUnits: '/workgroup-units',
11
15
  usersGroups: '/users-groups',
12
16
  usersGroups_authorizations: 'users-groups--authorizations',
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/api/routes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,kBAAkB;IACnC,cAAc,EAAE,iBAAiB;IACjC,mBAAmB,EAAE,wBAAwB;IAC7C,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,gBAAgB;IAC9B,KAAK,EAAE,QAAQ;IACf,eAAe,EAAE,WAAW;IAC5B,cAAc,EAAE,kBAAkB;IAClC,WAAW,EAAE,eAAe;IAC5B,0BAA0B,EAAE,8BAA8B;IAC1D,YAAY,EAAE,gBAAgB;IAC9B,mBAAmB,EAAE,wBAAwB;CAC9C,CAAA"}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/api/routes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,kBAAkB;IACnC,cAAc,EAAE,iBAAiB;IACjC,mBAAmB,EAAE,wBAAwB;IAC7C,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,gBAAgB;IAC9B,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,2BAA2B;IACxC,eAAe,EAAE,WAAW;IAC5B,mBAAmB,EAAE,eAAe;IACpC,2BAA2B,EAAE,gBAAgB;IAC7C,oBAAoB,EAAE,eAAe;IACrC,cAAc,EAAE,kBAAkB;IAClC,WAAW,EAAE,eAAe;IAC5B,0BAA0B,EAAE,8BAA8B;IAC1D,YAAY,EAAE,gBAAgB;IAC9B,mBAAmB,EAAE,wBAAwB;CAC9C,CAAA"}
@@ -1,4 +1,5 @@
1
- import { BaseApiClient } from 'fwork-jsts-common';
1
+ import axios from 'axios';
2
+ import { ApiClientUtils, BaseApiClient } from 'fwork-jsts-common';
2
3
  import { ApiRoutesNames } from '../api/routes';
3
4
  export class UsersApiClient extends BaseApiClient {
4
5
  constructor(args) {
@@ -6,6 +7,73 @@ export class UsersApiClient extends BaseApiClient {
6
7
  apiUrl: `${args.baseApiUrl}${ApiRoutesNames.users}`,
7
8
  axios: args.axios,
8
9
  });
10
+ this.baseApiUrl = args.baseApiUrl;
11
+ }
12
+ async verify(args) {
13
+ const result = {};
14
+ try {
15
+ const response = await (this.axios ?? axios).post(`${this.baseApiUrl}${ApiRoutesNames.usersVerify.replace(':uuid', args.userUuid).replace(':code', args.code)}`);
16
+ if (response.status == 200) {
17
+ if (response.data)
18
+ result.data = response.data;
19
+ result.success = true;
20
+ result.msg = 'Usuário confirmado com sucesso';
21
+ }
22
+ else {
23
+ result.success = false;
24
+ result.msg = 'Usuário não pode ser confirmado';
25
+ }
26
+ }
27
+ catch (error) {
28
+ result.success = false;
29
+ result.msg = ApiClientUtils.getErrorMessage(error);
30
+ }
31
+ return result;
32
+ }
33
+ async recoverPwdCode(args) {
34
+ const result = {};
35
+ try {
36
+ const response = await (this.axios ?? axios).post(`${this.baseApiUrl}${ApiRoutesNames.usersRecoverPwdCode}`, { email: args.email });
37
+ if (response.status == 200) {
38
+ result.data = response.data;
39
+ result.success = true;
40
+ }
41
+ }
42
+ catch (error) {
43
+ result.success = false;
44
+ result.msg = ApiClientUtils.getErrorMessage(error);
45
+ }
46
+ return result;
47
+ }
48
+ async recoverPwdValidateCode(args) {
49
+ const result = {};
50
+ try {
51
+ const response = await (this.axios ?? axios).post(`${this.baseApiUrl}${ApiRoutesNames.usersRecoverPwdValidateCode}`, { email: args.email, code: args.code });
52
+ if (response.status == 200) {
53
+ result.data = response.data;
54
+ result.success = true;
55
+ }
56
+ }
57
+ catch (error) {
58
+ result.success = false;
59
+ result.msg = ApiClientUtils.getErrorMessage(error);
60
+ }
61
+ return result;
62
+ }
63
+ async recoverPwdReset(args) {
64
+ const result = {};
65
+ try {
66
+ const response = await (this.axios ?? axios).post(`${this.baseApiUrl}${ApiRoutesNames.usersRecoverPwdReset}`, { newPwd: args.newPwd, token: args.token });
67
+ if (response.status == 200) {
68
+ result.data = response.data;
69
+ result.success = true;
70
+ }
71
+ }
72
+ catch (error) {
73
+ result.success = false;
74
+ result.msg = ApiClientUtils.getErrorMessage(error);
75
+ }
76
+ return result;
9
77
  }
10
78
  }
11
79
  //# sourceMappingURL=users.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/apiClient/users.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,OAAO,cAAe,SAAQ,aACP;IAC3B,YAAY,IAGX;QACC,KAAK,CAAC;YACJ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,KAAK,EAAE;YACnD,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/apiClient/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,aAAa,EAA2B,MAAM,mBAAmB,CAAA;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAG9C,MAAM,OAAO,cAAe,SAAQ,aACP;IAG3B,YAAY,IAGX;QACC,KAAK,CAAC;YACJ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,KAAK,EAAE;YACnD,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;QAEF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;IACnC,CAAC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AAI,CAAC,GAAG,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;YAEzJ,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;gBAC3B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAA;gBAC3B,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;YACvB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,OAAO,GAAG,KAAK,CAAA;YACtB,MAAM,CAAC,GAAG,GAAG,cAAc,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;QACpD,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAEF"}
@@ -0,0 +1,12 @@
1
+ export const AuthAppRoutesNames = {
2
+ home: '/',
3
+ register: '/register',
4
+ registerValidateCode: '/registervc',
5
+ registerCancel: '/registercl',
6
+ login: '/login',
7
+ profile: '/profile',
8
+ recoverPwdEmail: '/recovere',
9
+ recoverPwdValidateCode: '/recovervc',
10
+ recoverPwdReset: '/recoverr'
11
+ };
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/authApp/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,GAAG;IACT,QAAQ,EAAE,WAAW;IACrB,oBAAoB,EAAE,aAAa;IACnC,cAAc,EAAE,aAAa;IAC7B,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,UAAU;IACnB,eAAe,EAAE,WAAW;IAC5B,sBAAsB,EAAE,YAAY;IACpC,eAAe,EAAE,WAAW;CAC7B,CAAA"}
package/dist/esm/index.js CHANGED
@@ -11,13 +11,16 @@ import { UsersSharedDataApiClient } from './apiClient/usersSharedData';
11
11
  import { WorkgroupsApiClient } from './apiClient/workgroups';
12
12
  import { WorkgroupUnitsApiClient } from './apiClient/workgroupUnits';
13
13
  import { WorkgroupUnitsTypesApiClient } from './apiClient/workgroupUnitsTypes';
14
- import { AuthenticationTokenDataProviders, AuthenticationType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, legalPersonPropsNames, } from './models';
14
+ import { AuthAppRoutesNames } from './authApp';
15
+ import { AuthenticationTokenDataProviders, AuthenticationType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, } from './models';
15
16
  import { AuthorizationKeys, } from './models/authorizations';
16
17
  export {
17
18
  // api
18
19
  ApiRequestHeaders, ApiRoutesNames,
19
20
  // apiClient
20
21
  AuthenticationsApiClient, AuthorizationsApiClient, LegalPersonsApiClient, UsersApiClient, Users_GroupsApiClient, UsersGroupsApiClient, UsersGroups_invitesApiClient, UsersSharedDataApiClient, WorkgroupsApiClient, WorkgroupUnitsApiClient, WorkgroupUnitsTypesApiClient,
22
+ // authApp
23
+ AuthAppRoutesNames,
21
24
  // models
22
- AuthenticationTokenDataProviders, AuthenticationType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, legalPersonPropsNames, AuthorizationKeys, AuthorizationKeys as Authorizations, };
25
+ AuthenticationTokenDataProviders, AuthenticationType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, AuthorizationKeys, AuthorizationKeys as Authorizations, };
23
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,GAAmC,MAAM,OAAO,CAAA;AAC1E,OAAO,EAAE,cAAc,GAAG,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,C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":"authorizations.js","sourceRoot":"","sources":["../../../src/models/authorizations.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,gBAAgB,EAAE,kBAAkB;IAEpC,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,QAAQ,EAAE,UAAU;CACZ,CAAA"}
1
+ {"version":3,"file":"authorizations.js","sourceRoot":"","sources":["../../../src/models/authorizations.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;IAC5B,gBAAgB,EAAE,kBAAkB;IAEpC,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,QAAQ,EAAE,UAAU;CACZ,CAAA"}
@@ -1,4 +1,5 @@
1
1
  // authentication...
2
+ // TODO-rename to AuthenticationTypes
2
3
  export const AuthenticationType = {
3
4
  default: 0,
4
5
  uuid: 1,
@@ -9,9 +10,9 @@ export const AuthenticationTokenDataProviders = {
9
10
  default: 'default',
10
11
  google: 'accounts.google.com',
11
12
  };
12
- export const legalPersonPropsNames = {
13
- workgroupUuid: 'workgroupUuid'
14
- };
13
+ // export const legalPersonPropsNames = {
14
+ // workgroupUuid: 'workgroupUuid'
15
+ // }
15
16
  export const LegalPersonTypes = {
16
17
  person: 0,
17
18
  company: 1,
@@ -22,6 +23,7 @@ export class User {
22
23
  this.name = data.name;
23
24
  this.login = data.login;
24
25
  this.email = data.email;
26
+ this.validated = data.validated;
25
27
  this.pwd = data.pwd;
26
28
  this.imageUrl = data.imageUrl;
27
29
  this.legalPersonUuid = data.legalPersonUuid;
@@ -29,7 +31,7 @@ export class User {
29
31
  this.groups = data.groups;
30
32
  }
31
33
  toUserSharedData() {
32
- const sharedDataKeys = ['uuid', 'name', 'login', 'email', 'imageUrl'];
34
+ const sharedDataKeys = ['uuid', 'name', 'login', 'email', 'validated', 'imageUrl'];
33
35
  const sharedData = {};
34
36
  sharedDataKeys.forEach(key => {
35
37
  if (key in this) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAEA,oBAAoB;AAEpB,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;CACD,CAAA;AA6BV,0CAA0C;AAC1C,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,qBAAqB;CACrB,CAAA;AAmCV,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,aAAa,EAAE,eAAe;CAC/B,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;CACF,CAAA;AA0CV,MAAM,OAAO,IAAI;IAWf,YAAY,IAUX;QACC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;QACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC7B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAA;QAC3C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;QACnC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC3B,CAAC;IAED,gBAAgB;QACd,MAAM,cAAc,GAA8B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OA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AAE,EAAE;IACvF,OAAO,MAAM,IAAI,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAA;AAC/H,CAAC,CAAA;AAuCH,mBAAmB"}
@@ -6,7 +6,11 @@ export declare const ApiRoutesNames: {
6
6
  workgroups: string;
7
7
  legalPersons: string;
8
8
  users: string;
9
+ usersVerify: string;
9
10
  usersSharedData: string;
11
+ usersRecoverPwdCode: string;
12
+ usersRecoverPwdValidateCode: string;
13
+ usersRecoverPwdReset: string;
10
14
  workgroupUnits: string;
11
15
  usersGroups: string;
12
16
  usersGroups_authorizations: string;
@@ -1,10 +1,31 @@
1
1
  import { AxiosInstance, AxiosStatic } from 'axios';
2
- import { BaseApiClient } from 'fwork-jsts-common';
3
- import { Where } from 'fwork-jsts-common';
2
+ import { BaseApiClient, IApiClientResult, Where } from 'fwork-jsts-common';
4
3
  import { IUser } from '../models';
5
4
  export declare class UsersApiClient extends BaseApiClient<IUser, any, Where<IUser>, IUser, IUser> {
5
+ baseApiUrl: string;
6
6
  constructor(args: {
7
7
  baseApiUrl: string;
8
8
  axios?: AxiosStatic | AxiosInstance;
9
9
  });
10
+ verify(args: {
11
+ userUuid: string;
12
+ code: string;
13
+ }): Promise<IApiClientResult<boolean>>;
14
+ recoverPwdCode(args: {
15
+ email: string;
16
+ }): Promise<IApiClientResult<{
17
+ message: string;
18
+ }>>;
19
+ recoverPwdValidateCode(args: {
20
+ email: string;
21
+ code: string;
22
+ }): Promise<IApiClientResult<{
23
+ token: string;
24
+ }>>;
25
+ recoverPwdReset(args: {
26
+ token: string;
27
+ newPwd: string;
28
+ }): Promise<IApiClientResult<{
29
+ message: string;
30
+ }>>;
10
31
  }
@@ -0,0 +1,11 @@
1
+ export declare const AuthAppRoutesNames: {
2
+ home: string;
3
+ register: string;
4
+ registerValidateCode: string;
5
+ registerCancel: string;
6
+ login: string;
7
+ profile: string;
8
+ recoverPwdEmail: string;
9
+ recoverPwdValidateCode: string;
10
+ recoverPwdReset: string;
11
+ };
@@ -11,6 +11,7 @@ import { IUsers_SharedData_ApiClientGetOptions, UsersSharedDataApiClient } from
11
11
  import { WorkgroupsApiClient } from './apiClient/workgroups';
12
12
  import { WorkgroupUnitsApiClient } from './apiClient/workgroupUnits';
13
13
  import { WorkgroupUnitsTypesApiClient } from './apiClient/workgroupUnitsTypes';
14
- import { AuthenticationTokenDataProviders, AuthenticationType, IAuthentication, IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid, IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle, IAuthorization, ILegalPerson, IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IWorkgroup, IWorkgroupUnit, IWorkgroupUnitType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, legalPersonPropsNames } from './models';
14
+ import { AuthAppRoutesNames } from './authApp';
15
+ import { AuthenticationTokenDataProviders, AuthenticationType, IAuthentication, IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid, IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle, IAuthorization, ILegalPerson, IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IWorkgroup, IWorkgroupUnit, IWorkgroupUnitType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils } from './models';
15
16
  import { AuthorizationKeys } from './models/authorizations';
16
- export { ApiRequestHeaders, DatacenterApiRequestGetOptions, ApiRoutesNames, AuthenticationsApiClient, AuthorizationsApiClient, LegalPersonsApiClient, UsersApiClient, Users_GroupsApiClient, UsersGroupsApiClient, UsersGroups_invitesApiClient, IUsers_SharedData_ApiClientGetOptions, UsersSharedDataApiClient, WorkgroupsApiClient, WorkgroupUnitsApiClient, WorkgroupUnitsTypesApiClient, AuthenticationTokenDataProviders, AuthenticationType, IAuthentication, IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid, IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle, IAuthorization, ILegalPerson, IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IWorkgroup, IWorkgroupUnit, IWorkgroupUnitType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, legalPersonPropsNames, AuthorizationKeys, AuthorizationKeys as Authorizations, };
17
+ export { ApiRequestHeaders, DatacenterApiRequestGetOptions, ApiRoutesNames, AuthenticationsApiClient, AuthorizationsApiClient, LegalPersonsApiClient, UsersApiClient, Users_GroupsApiClient, UsersGroupsApiClient, UsersGroups_invitesApiClient, IUsers_SharedData_ApiClientGetOptions, UsersSharedDataApiClient, WorkgroupsApiClient, WorkgroupUnitsApiClient, WorkgroupUnitsTypesApiClient, AuthAppRoutesNames, AuthenticationTokenDataProviders, AuthenticationType, IAuthentication, IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid, IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle, IAuthorization, ILegalPerson, IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IWorkgroup, IWorkgroupUnit, IWorkgroupUnitType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, AuthorizationKeys, AuthorizationKeys as Authorizations, };
@@ -22,7 +22,6 @@ export interface IAuthenticationRequestBodyFromGoogleToken extends IAuthenticati
22
22
  export interface IAuthentication {
23
23
  uuid: string;
24
24
  userUuid: string;
25
- user?: IUser;
26
25
  token: string;
27
26
  }
28
27
  export declare const AuthenticationTokenDataProviders: {
@@ -50,12 +49,8 @@ export interface IWorkgroupUnitType {
50
49
  export interface IWorkgroup {
51
50
  uuid: string;
52
51
  name: string;
53
- allowCreateUsersFreely?: boolean;
54
52
  legalPersons?: ILegalPerson[];
55
53
  }
56
- export declare const legalPersonPropsNames: {
57
- workgroupUuid: string;
58
- };
59
54
  export declare const LegalPersonTypes: {
60
55
  readonly person: 0;
61
56
  readonly company: 1;
@@ -84,6 +79,7 @@ export interface IUser {
84
79
  email: string;
85
80
  pwd: string;
86
81
  imageUrl?: string;
82
+ validated?: boolean;
87
83
  legalPersonUuid?: string;
88
84
  legalPerson?: ILegalPerson;
89
85
  groups?: IUser_Group[];
@@ -96,6 +92,7 @@ export declare class User implements IUser {
96
92
  name: string;
97
93
  login: string;
98
94
  email: string;
95
+ validated?: boolean | undefined;
99
96
  pwd: string;
100
97
  imageUrl?: string | undefined;
101
98
  legalPersonUuid?: string | undefined;
@@ -106,6 +103,7 @@ export declare class User implements IUser {
106
103
  name: string;
107
104
  login: string;
108
105
  email: string;
106
+ validated?: boolean;
109
107
  pwd: string;
110
108
  imageUrl?: string | undefined;
111
109
  legalPersonUuid?: string | undefined;
@@ -120,6 +118,7 @@ export interface IUserSharedData {
120
118
  name: string;
121
119
  login: string;
122
120
  email: string;
121
+ validated?: boolean;
123
122
  imageUrl?: string;
124
123
  }
125
124
  export interface IUserGroup {
package/package.json CHANGED
@@ -2,7 +2,8 @@
2
2
  "author": "joabssilveira",
3
3
  "dependencies": {
4
4
  "@types/jsonwebtoken": "^9.0.5",
5
- "fwork-jsts-common": "^2.0.10",
5
+ "axios": "^1.7.9",
6
+ "fwork-jsts-common": "^2.0.11",
6
7
  "jsonwebtoken": "^9.0.2",
7
8
  "tslib": "^2.8.1"
8
9
  },
@@ -36,7 +37,7 @@
36
37
  "release:minor": "standard-version -m && git add CHANGELOG.md && git commit -m \"updated CHANGELOG.md\" && npm version minor && git push origin && git push origin --tags && npm publish --access public",
37
38
  "release:patch": "standard-version -p && git add CHANGELOG.md && git commit -m \"updated CHANGELOG.md\" && npm version patch && git push origin && git push origin --tags && npm publish --access public"
38
39
  },
39
- "version": "1.0.3",
40
+ "version": "1.1.3",
40
41
  "exports": {
41
42
  ".": {
42
43
  "require": "./dist/cjs/index.js",
package/src/api/index.ts CHANGED
@@ -5,7 +5,6 @@ import { IUser } from "../models"
5
5
  export const ApiRequestHeaders = {
6
6
  tokenProvider: 'token-provider'
7
7
  } as const
8
-
9
8
  export type ApiRequestHeaders = typeof ApiRequestHeaders[keyof typeof ApiRequestHeaders]
10
9
 
11
10
  export type DatacenterApiRequestGetOptions<T, TWhere extends Where<T>> = ApiRequestGetOptions<T, TWhere> & {
package/src/api/routes.ts CHANGED
@@ -6,10 +6,15 @@ export const ApiRoutesNames = {
6
6
  workgroups: '/workgroups',
7
7
  legalPersons: '/legal-persons',
8
8
  users: '/users',
9
+ usersVerify: '/users/verify/:uuid/:code',
9
10
  usersSharedData: '/users-sd',
11
+ usersRecoverPwdCode: '/users/rpwd-c',
12
+ usersRecoverPwdValidateCode: '/users/rpwd-vc',
13
+ usersRecoverPwdReset: '/users/rpwd-r',
10
14
  workgroupUnits: '/workgroup-units',
11
15
  usersGroups: '/users-groups',
12
16
  usersGroups_authorizations: 'users-groups--authorizations',
13
17
  users_groups: '/users--groups',
14
- usersGroups_invites: '/users-groups--invites'
18
+ usersGroups_invites: '/users-groups--invites',
19
+ integrationClients: '/integration-clients'
15
20
  }
@@ -24,7 +24,7 @@ export class AuthenticationsApiClient {
24
24
  }): Promise<IApiClientResult<IAuthentication> | undefined> {
25
25
  return await ApiClientUtils.post({
26
26
  apiUrl: this.apiUrl,
27
- data: args.data,
27
+ data: args.data,
28
28
  config: args.config
29
29
  })
30
30
  }
@@ -1,11 +1,12 @@
1
- import { AxiosInstance, AxiosStatic } from 'axios'
2
- import { BaseApiClient } from 'fwork-jsts-common'
3
- import { Where } from 'fwork-jsts-common'
4
- import { IUser } from '../models'
1
+ import axios, { AxiosInstance, AxiosStatic } from 'axios'
2
+ import { ApiClientUtils, BaseApiClient, IApiClientResult, Where } from 'fwork-jsts-common'
5
3
  import { ApiRoutesNames } from '../api/routes'
4
+ import { IUser } from '../models'
6
5
 
7
6
  export class UsersApiClient extends BaseApiClient<IUser, any,
8
7
  Where<IUser>, IUser, IUser> {
8
+ baseApiUrl: string
9
+
9
10
  constructor(args: {
10
11
  baseApiUrl: string
11
12
  axios?: AxiosStatic | AxiosInstance,
@@ -14,5 +15,97 @@ export class UsersApiClient extends BaseApiClient<IUser, any,
14
15
  apiUrl: `${args.baseApiUrl}${ApiRoutesNames.users}`,
15
16
  axios: args.axios,
16
17
  })
18
+
19
+ this.baseApiUrl = args.baseApiUrl
17
20
  }
21
+
22
+ async verify(args: {
23
+ userUuid: string,
24
+ code: string,
25
+ }): Promise<IApiClientResult<boolean>> {
26
+ const result: IApiClientResult<boolean> = {}
27
+
28
+ try {
29
+ const response = await (this.axios ?? axios).post(`${this.baseApiUrl}${ApiRoutesNames.usersVerify.replace(':uuid', args.userUuid).replace(':code', args.code)}`)
30
+
31
+ if (response.status == 200) {
32
+ if (response.data)
33
+ result.data = response.data as boolean
34
+ result.success = true
35
+ result.msg = 'Usuário confirmado com sucesso'
36
+ }
37
+ else {
38
+ result.success = false
39
+ result.msg = 'Usuário não pode ser confirmado'
40
+ }
41
+ } catch (error) {
42
+ result.success = false
43
+ result.msg = ApiClientUtils.getErrorMessage(error)
44
+ }
45
+
46
+ return result
47
+ }
48
+
49
+ async recoverPwdCode(args: {
50
+ email: string,
51
+ }): Promise<IApiClientResult<{ message: string }>> {
52
+ const result: IApiClientResult<{ message: string }> = {}
53
+
54
+ try {
55
+ const response = await (this.axios ?? axios).post(`${this.baseApiUrl}${ApiRoutesNames.usersRecoverPwdCode}`, { email: args.email })
56
+
57
+ if (response.status == 200) {
58
+ result.data = response.data
59
+ result.success = true
60
+ }
61
+ } catch (error) {
62
+ result.success = false
63
+ result.msg = ApiClientUtils.getErrorMessage(error)
64
+ }
65
+
66
+ return result
67
+ }
68
+
69
+ async recoverPwdValidateCode(args: {
70
+ email: string,
71
+ code: string
72
+ }): Promise<IApiClientResult<{ token: string }>> {
73
+ const result: IApiClientResult<{ token: string }> = {}
74
+
75
+ try {
76
+ const response = await (this.axios ?? axios).post(`${this.baseApiUrl}${ApiRoutesNames.usersRecoverPwdValidateCode}`, { email: args.email, code: args.code })
77
+
78
+ if (response.status == 200) {
79
+ result.data = response.data
80
+ result.success = true
81
+ }
82
+ } catch (error) {
83
+ result.success = false
84
+ result.msg = ApiClientUtils.getErrorMessage(error)
85
+ }
86
+
87
+ return result
88
+ }
89
+
90
+ async recoverPwdReset(args: {
91
+ token: string,
92
+ newPwd: string
93
+ }): Promise<IApiClientResult<{ message: string }>> {
94
+ const result: IApiClientResult<{ message: string }> = {}
95
+
96
+ try {
97
+ const response = await (this.axios ?? axios).post(`${this.baseApiUrl}${ApiRoutesNames.usersRecoverPwdReset}`, { newPwd: args.newPwd, token: args.token })
98
+
99
+ if (response.status == 200) {
100
+ result.data = response.data
101
+ result.success = true
102
+ }
103
+ } catch (error) {
104
+ result.success = false
105
+ result.msg = ApiClientUtils.getErrorMessage(error)
106
+ }
107
+
108
+ return result
109
+ }
110
+
18
111
  }
@@ -0,0 +1,11 @@
1
+ export const AuthAppRoutesNames = {
2
+ home: '/',
3
+ register: '/register',
4
+ registerValidateCode: '/registervc',
5
+ registerCancel: '/registercl',
6
+ login: '/login',
7
+ profile: '/profile',
8
+ recoverPwdEmail: '/recovere',
9
+ recoverPwdValidateCode: '/recovervc',
10
+ recoverPwdReset: '/recoverr'
11
+ }
package/src/index.ts CHANGED
@@ -13,39 +13,33 @@ import { WorkgroupsApiClient } from './apiClient/workgroups'
13
13
  import { WorkgroupUnitsApiClient } from './apiClient/workgroupUnits'
14
14
  import { WorkgroupUnitsTypesApiClient } from './apiClient/workgroupUnitsTypes'
15
15
 
16
- import { AuthenticationTokenDataProviders, AuthenticationType, IAuthentication,
17
- IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid,
18
- IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle, IAuthorization, ILegalPerson,
19
- IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IWorkgroup, IWorkgroupUnit,
20
- IWorkgroupUnitType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, legalPersonPropsNames,
21
- } from './models'
22
- import { AuthorizationKeys, } from './models/authorizations'
23
-
24
- export {
25
- // api
26
- ApiRequestHeaders, DatacenterApiRequestGetOptions,
27
-
28
- ApiRoutesNames,
16
+ import { AuthAppRoutesNames, } from './authApp'
29
17
 
30
- // apiClient
31
- AuthenticationsApiClient,
32
- AuthorizationsApiClient,
33
- LegalPersonsApiClient,
34
- UsersApiClient,
35
- Users_GroupsApiClient,
36
- UsersGroupsApiClient,
37
- UsersGroups_invitesApiClient,
38
- IUsers_SharedData_ApiClientGetOptions, UsersSharedDataApiClient,
39
- WorkgroupsApiClient,
40
- WorkgroupUnitsApiClient,
41
- WorkgroupUnitsTypesApiClient,
18
+ import { LicenseKeys } from './license'
42
19
 
43
- // models
44
- AuthenticationTokenDataProviders, AuthenticationType, IAuthentication,
45
- IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid,
46
- IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle, IAuthorization, ILegalPerson,
47
- IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IWorkgroup, IWorkgroupUnit,
48
- IWorkgroupUnitType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, legalPersonPropsNames,
20
+ import {
21
+ AuthenticationTokenDataProviders, AuthenticationType, IAuthentication,
22
+ IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid,
23
+ IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle,
24
+ IAuthenticationTokenDataIntegration,
25
+ IAuthorization,
26
+ IIntegrationClient,
27
+ ILegalPerson,
28
+ IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IWorkgroup, IWorkgroupUnit,
29
+ IWorkgroupUnitType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils,
30
+ } from './models'
31
+ import { AuthorizationKeys, } from './models/authorizations'
49
32
 
50
- AuthorizationKeys, AuthorizationKeys as Authorizations,
33
+ export {
34
+ ApiRequestHeaders, ApiRoutesNames,
35
+ AuthAppRoutesNames,
36
+ AuthenticationTokenDataProviders, AuthenticationType,
37
+ AuthenticationsApiClient, AuthorizationKeys, AuthorizationKeys as Authorizations, AuthorizationsApiClient, DatacenterApiRequestGetOptions, IAuthentication, IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid,
38
+ IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle, IAuthenticationTokenDataIntegration, IAuthorization, IIntegrationClient, ILegalPerson,
39
+ IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IUsers_SharedData_ApiClientGetOptions, IWorkgroup, IWorkgroupUnit,
40
+ IWorkgroupUnitType, LegalPersonTypes, LegalPersonsApiClient,
41
+ LicenseKeys, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, UsersApiClient, UsersGroupsApiClient,
42
+ UsersGroups_invitesApiClient, UsersSharedDataApiClient, Users_GroupsApiClient, WorkgroupUnitsApiClient,
43
+ WorkgroupUnitsTypesApiClient, WorkgroupsApiClient
51
44
  }
45
+
@@ -0,0 +1,5 @@
1
+ export const LicenseKeys = {
2
+ workgroups: 'dcenter-workgroups',
3
+ workgroupsUnits: 'dcenter-workgroups-units',
4
+ userSharing: 'dcenter-user-sharing',
5
+ }
@@ -1,3 +1,4 @@
1
+
1
2
  export const AuthorizationKeys = {
2
3
  sysAdm: 'sysAdm',
3
4
  workgroupAdm: 'workgroupAdm',
@@ -1,11 +1,14 @@
1
1
  import { JwtPayload } from "jsonwebtoken"
2
+ // import { CheckLicenseResponseItemStatus } from 'licensemanager-lib-common-ts'
2
3
 
3
4
  // authentication...
4
5
 
6
+ // TODO-rename to AuthenticationTypes
5
7
  export const AuthenticationType = {
6
8
  default: 0,
7
9
  uuid: 1,
8
10
  google: 2,
11
+ integration: 3,
9
12
  } as const
10
13
  export type AuthenticationType = typeof AuthenticationType[keyof typeof AuthenticationType]
11
14
 
@@ -14,30 +17,37 @@ export interface IAuthenticationRequestBody {
14
17
  }
15
18
 
16
19
  export interface IAuthenticationRequestBodyDefault extends IAuthenticationRequestBody {
20
+ type: typeof AuthenticationType.default,
17
21
  login: string,
18
22
  pwd: string,
19
23
  }
20
24
 
21
25
  export interface IAuthenticationRequestBodyFromUuid extends IAuthenticationRequestBody {
26
+ type: typeof AuthenticationType.uuid,
22
27
  uuid: string,
23
28
  }
24
29
 
25
30
  export interface IAuthenticationRequestBodyFromGoogleToken extends IAuthenticationRequestBody {
31
+ type: typeof AuthenticationType.google,
26
32
  idToken: string,
27
33
  accessToken: string,
28
34
  }
29
35
 
30
- // AUTHENTICATION RESPONSE
36
+ export interface IAuthenticationRequestBodyIntegration extends IAuthenticationRequestBody {
37
+ type: typeof AuthenticationType.integration,
38
+ clientUuid: string,
39
+ secret: string,
40
+ }
41
+
31
42
  export interface IAuthentication {
32
43
  uuid: string,
33
- userUuid: string,
34
- user?: IUser,
35
44
  token: string,
36
45
  }
37
46
 
38
47
  // USED IN TOKEN ON FIELD ISS OF JWT TOKEN
39
48
  export const AuthenticationTokenDataProviders = {
40
49
  default: 'default',
50
+ integration: 'integration',
41
51
  google: 'accounts.google.com',
42
52
  } as const
43
53
  export type AuthenticationTokenDataProviders = typeof AuthenticationTokenDataProviders[keyof typeof AuthenticationTokenDataProviders]
@@ -51,6 +61,12 @@ export interface IAuthenticationTokenDataDefault extends IAuthenticationTokenDat
51
61
  user: IUserSharedData,
52
62
  }
53
63
 
64
+ export interface IAuthenticationTokenDataIntegration extends IAuthenticationTokenData {
65
+ authUuid: string,
66
+ clientUuid: string,
67
+ }
68
+
69
+ // datacenter nao gera esse toke, é gerado pelo google
54
70
  export interface IAuthenticationTokenDataGoogle extends IAuthenticationTokenData {
55
71
  azp: string,
56
72
  email: string,
@@ -69,15 +85,20 @@ export interface IWorkgroupUnitType {
69
85
  export interface IWorkgroup {
70
86
  uuid: string,
71
87
  name: string,
72
- allowCreateUsersFreely?: boolean,
88
+ // allowCreateUsersFreely?: boolean,
73
89
 
74
90
  legalPersons?: ILegalPerson[]
75
- }
91
+ integrationClients?: IIntegrationClient[]
76
92
 
77
- export const legalPersonPropsNames = {
78
- workgroupUuid: 'workgroupUuid'
93
+ // licenseData?: {
94
+ // status: CheckLicenseResponseItemStatus,
95
+ // }
79
96
  }
80
97
 
98
+ // export const legalPersonPropsNames = {
99
+ // workgroupUuid: 'workgroupUuid'
100
+ // }
101
+
81
102
  export const LegalPersonTypes = {
82
103
  person: 0,
83
104
  company: 1,
@@ -114,6 +135,8 @@ export interface IUser {
114
135
  pwd: string,
115
136
  imageUrl?: string,
116
137
 
138
+ validated?: boolean,
139
+
117
140
  legalPersonUuid?: string,
118
141
  legalPerson?: ILegalPerson,
119
142
 
@@ -128,6 +151,7 @@ export class User implements IUser {
128
151
  name: string
129
152
  login: string
130
153
  email: string
154
+ validated?: boolean | undefined
131
155
  pwd: string
132
156
  imageUrl?: string | undefined
133
157
  legalPersonUuid?: string | undefined
@@ -139,6 +163,7 @@ export class User implements IUser {
139
163
  name: string
140
164
  login: string,
141
165
  email: string,
166
+ validated?: boolean,
142
167
  pwd: string,
143
168
  imageUrl?: string | undefined,
144
169
  legalPersonUuid?: string | undefined,
@@ -149,6 +174,7 @@ export class User implements IUser {
149
174
  this.name = data.name
150
175
  this.login = data.login
151
176
  this.email = data.email
177
+ this.validated = data.validated
152
178
  this.pwd = data.pwd
153
179
  this.imageUrl = data.imageUrl
154
180
  this.legalPersonUuid = data.legalPersonUuid
@@ -157,7 +183,7 @@ export class User implements IUser {
157
183
  }
158
184
 
159
185
  toUserSharedData() {
160
- const sharedDataKeys: (keyof IUserSharedData)[] = ['uuid', 'name', 'login', 'email', 'imageUrl']
186
+ const sharedDataKeys: (keyof IUserSharedData)[] = ['uuid', 'name', 'login', 'email', 'validated', 'imageUrl']
161
187
  const sharedData: Partial<IUserSharedData> = {};
162
188
  sharedDataKeys.forEach(key => {
163
189
  if (key in this) {
@@ -207,6 +233,7 @@ export interface IUserSharedData {
207
233
  name: string,
208
234
  login: string,
209
235
  email: string,
236
+ validated?: boolean,
210
237
  imageUrl?: string,
211
238
  }
212
239
 
@@ -284,4 +311,15 @@ export interface IUserGroup_Authorization {
284
311
  userGroup?: IUserGroup,
285
312
  }
286
313
 
287
- // ...AUTHORIZATION
314
+ // ...AUTHORIZATION
315
+
316
+ export interface IIntegrationClient {
317
+ uuid: string,
318
+
319
+ workgroupUuid: string,
320
+ workgroup?: IWorkgroup,
321
+
322
+ name: string,
323
+ secret: string,
324
+ active?: boolean,
325
+ }