datacenter-lib-common-ts 1.0.4 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/routes.js +7 -2
- package/dist/cjs/api/routes.js.map +1 -1
- package/dist/cjs/apiClient/users.js +69 -0
- package/dist/cjs/apiClient/users.js.map +1 -1
- package/dist/cjs/authApp/index.js +15 -0
- package/dist/cjs/authApp/index.js.map +1 -0
- package/dist/cjs/index.js +5 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/license/index.js +9 -0
- package/dist/cjs/license/index.js.map +1 -0
- package/dist/cjs/models/authorizations.js.map +1 -1
- package/dist/cjs/models/index.js +10 -6
- package/dist/cjs/models/index.js.map +1 -1
- package/dist/esm/api/routes.js +7 -2
- package/dist/esm/api/routes.js.map +1 -1
- package/dist/esm/apiClient/users.js +69 -1
- package/dist/esm/apiClient/users.js.map +1 -1
- package/dist/esm/authApp/index.js +12 -0
- package/dist/esm/authApp/index.js.map +1 -0
- package/dist/esm/index.js +4 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/license/index.js +6 -0
- package/dist/esm/license/index.js.map +1 -0
- package/dist/esm/models/authorizations.js.map +1 -1
- package/dist/esm/models/index.js +9 -5
- package/dist/esm/models/index.js.map +1 -1
- package/dist/types/api/routes.d.ts +5 -0
- package/dist/types/apiClient/users.d.ts +23 -2
- package/dist/types/authApp/index.d.ts +11 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/license/index.d.ts +5 -0
- package/dist/types/models/index.d.ts +27 -6
- package/package.json +1 -1
- package/src/api/index.ts +0 -1
- package/src/api/routes.ts +7 -2
- package/src/apiClient/authentications.ts +1 -1
- package/src/apiClient/users.ts +97 -4
- package/src/authApp/index.ts +11 -0
- package/src/index.ts +26 -32
- package/src/license/index.ts +5 -0
- package/src/models/authorizations.ts +1 -0
- package/src/models/index.ts +47 -9
package/dist/cjs/api/routes.js
CHANGED
|
@@ -9,11 +9,16 @@ 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
|
-
usersGroups_authorizations: 'users-groups--authorizations',
|
|
19
|
+
usersGroups_authorizations: '/users-groups--authorizations',
|
|
16
20
|
users_groups: '/users--groups',
|
|
17
|
-
usersGroups_invites: '/users-groups--invites'
|
|
21
|
+
usersGroups_invites: '/users-groups--invites',
|
|
22
|
+
integrationClients: '/integration-clients'
|
|
18
23
|
};
|
|
19
24
|
//# sourceMappingURL=routes.js.map
|
|
@@ -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
|
|
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,+BAA+B;IAC3D,YAAY,EAAE,gBAAgB;IAC9B,mBAAmB,EAAE,wBAAwB;IAC7C,kBAAkB,EAAE,sBAAsB;CAC3C,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":"
|
|
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,KAAK,EAAE;YACnD,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;QAEF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;IACnC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAGZ;QACC,MAAM,MAAM,GAA8B,EAAE,CAAA;QAE5C,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,eAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,GAAG,uBAAc,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YAEhK,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;gBAC3B,IAAI,QA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AAM,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.
|
|
3
|
+
exports.WorkgroupsApiClient = exports.WorkgroupUnitsTypesApiClient = exports.WorkgroupUnitsApiClient = exports.Users_GroupsApiClient = exports.UsersSharedDataApiClient = exports.UsersGroups_invitesApiClient = exports.UsersGroupsApiClient = exports.UsersApiClient = exports.UserGroup_InviteStatusUtils = exports.UserGroup_InviteStatus = exports.User = exports.LicenseKeys = exports.LegalPersonsApiClient = exports.LegalPersonTypes = exports.AuthorizationsApiClient = exports.Authorizations = exports.AuthorizationKeys = exports.AuthenticationsApiClient = exports.AuthenticationType = exports.AuthenticationTokenDataProviders = exports.AuthAppRoutesNames = 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,10 @@ 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; } });
|
|
32
|
+
const license_1 = require("./license");
|
|
33
|
+
Object.defineProperty(exports, "LicenseKeys", { enumerable: true, get: function () { return license_1.LicenseKeys; } });
|
|
30
34
|
const models_1 = require("./models");
|
|
31
35
|
Object.defineProperty(exports, "AuthenticationTokenDataProviders", { enumerable: true, get: function () { return models_1.AuthenticationTokenDataProviders; } });
|
|
32
36
|
Object.defineProperty(exports, "AuthenticationType", { enumerable: true, get: function () { return models_1.AuthenticationType; } });
|
|
@@ -34,7 +38,6 @@ Object.defineProperty(exports, "LegalPersonTypes", { enumerable: true, get: func
|
|
|
34
38
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return models_1.User; } });
|
|
35
39
|
Object.defineProperty(exports, "UserGroup_InviteStatus", { enumerable: true, get: function () { return models_1.UserGroup_InviteStatus; } });
|
|
36
40
|
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
41
|
const authorizations_2 = require("./models/authorizations");
|
|
39
42
|
Object.defineProperty(exports, "AuthorizationKeys", { enumerable: true, get: function () { return authorizations_2.AuthorizationKeys; } });
|
|
40
43
|
Object.defineProperty(exports, "Authorizations", { enumerable: true, get: function () { return authorizations_2.AuthorizationKeys; } });
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAA0E;AAiCxE,kGAjCO,uBAAiB,OAiCP;AAhCnB,yCAA8C;AAgCzB,+FAhCZ,uBAAc,OAgCY;AA9BnC,iEAAsE;AAiCpE,yGAjCO,0CAAwB,OAiCP;AAhC1B,+DAAoE;AAgCgB,wGAhC3E,wCAAuB,OAgC2E;AA/B3G,2DAAgE;AAkCxB,sGAlC/B,oCAAqB,OAkC+B;AAjC7D,6CAAkD;AAkCwB,+FAlCjE,sBAAc,OAkCiE;AAjCxF,2DAAgE;AAkCN,sGAlCjD,oCAAqB,OAkCiD;AAjC/E,yDAA8D;AAgC4B,qGAhCjF,kCAAoB,OAgCiF;AA/B9G,yEAA8E;AAgC5E,6GAhCO,kDAA4B,OAgCP;AA/B9B,iEAA6G;AA+B7E,yGA/BgB,0CAAwB,OA+BhB;AA9BxD,uDAA4D;AA+B5B,oGA/BvB,gCAAmB,OA+BuB;AA9BnD,+DAAoE;AA6Ba,wGA7BxE,wCAAuB,OA6BwE;AA5BxG,yEAA8E;AA6B5E,6GA7BO,kDAA4B,OA6BP;AA3B9B,uCAA+C;AAmB7C,mGAnBO,4BAAkB,OAmBP;AAjBpB,uCAAuC;AAuBrC,4FAvBO,qBAAW,OAuBP;AArBb,qCAUiB;AAMf,iHAfA,yCAAgC,OAeA;AAAE,mGAfA,2BAAkB,OAeA;AAIhC,iGAXA,yBAAgB,OAWA;AACvB,qFAZyB,aAAI,OAYzB;AAAE,uGAZyB,+BAAsB,OAYzB;AAAE,4GAZyB,oCAA2B,OAYzB;AAVxE,4DAA4D;AAMhC,kGANnB,kCAAiB,OAMmB;AAAuB,+FAN3D,kCAAiB,OAMwD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LicenseKeys = void 0;
|
|
4
|
+
exports.LicenseKeys = {
|
|
5
|
+
workgroups: 'dcenter-workgroups',
|
|
6
|
+
workgroupsUnits: 'dcenter-workgroups-units',
|
|
7
|
+
userSharing: 'dcenter-user-sharing',
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/license/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,UAAU,EAAE,oBAAoB;IAChC,eAAe,EAAE,0BAA0B;IAC3C,WAAW,EAAE,sBAAsB;CACpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorizations.js","sourceRoot":"","sources":["../../../src/models/authorizations.ts"],"names":[],"mappings":";;;
|
|
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"}
|
package/dist/cjs/models/index.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserGroup_InviteStatusUtils = exports.UserGroup_InviteStatus = exports.User = exports.LegalPersonTypes = exports.
|
|
3
|
+
exports.UserGroup_InviteStatusUtils = exports.UserGroup_InviteStatus = exports.User = exports.LegalPersonTypes = exports.AuthenticationTokenDataProviders = exports.AuthenticationType = void 0;
|
|
4
|
+
// import { CheckLicenseResponseItemStatus } from 'licensemanager-lib-common-ts'
|
|
4
5
|
// authentication...
|
|
6
|
+
// TODO-rename to AuthenticationTypes
|
|
5
7
|
exports.AuthenticationType = {
|
|
6
8
|
default: 0,
|
|
7
9
|
uuid: 1,
|
|
8
10
|
google: 2,
|
|
11
|
+
integration: 3,
|
|
9
12
|
};
|
|
10
13
|
// USED IN TOKEN ON FIELD ISS OF JWT TOKEN
|
|
11
14
|
exports.AuthenticationTokenDataProviders = {
|
|
12
15
|
default: 'default',
|
|
16
|
+
integration: 'integration',
|
|
13
17
|
google: 'accounts.google.com',
|
|
14
18
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
19
|
+
// export const legalPersonPropsNames = {
|
|
20
|
+
// workgroupUuid: 'workgroupUuid'
|
|
21
|
+
// }
|
|
18
22
|
exports.LegalPersonTypes = {
|
|
19
23
|
person: 0,
|
|
20
24
|
company: 1,
|
|
@@ -25,6 +29,7 @@ class User {
|
|
|
25
29
|
this.name = data.name;
|
|
26
30
|
this.login = data.login;
|
|
27
31
|
this.email = data.email;
|
|
32
|
+
this.validated = data.validated;
|
|
28
33
|
this.pwd = data.pwd;
|
|
29
34
|
this.imageUrl = data.imageUrl;
|
|
30
35
|
this.legalPersonUuid = data.legalPersonUuid;
|
|
@@ -32,7 +37,7 @@ class User {
|
|
|
32
37
|
this.groups = data.groups;
|
|
33
38
|
}
|
|
34
39
|
toUserSharedData() {
|
|
35
|
-
const sharedDataKeys = ['uuid', 'name', 'login', 'email', 'imageUrl'];
|
|
40
|
+
const sharedDataKeys = ['uuid', 'name', 'login', 'email', 'validated', 'imageUrl'];
|
|
36
41
|
const sharedData = {};
|
|
37
42
|
sharedDataKeys.forEach(key => {
|
|
38
43
|
if (key in this) {
|
|
@@ -86,5 +91,4 @@ UserGroup_InviteStatusUtils.UserGroup_InviteStatusGetDescription = (status) => {
|
|
|
86
91
|
UserGroup_InviteStatusUtils.UserGroup_InviteStatusGetUiMaterialChipColor = (status) => {
|
|
87
92
|
return status == exports.UserGroup_InviteStatus.pending ? 'warning' : status == exports.UserGroup_InviteStatus.accepted ? 'success' : 'error';
|
|
88
93
|
};
|
|
89
|
-
// ...AUTHORIZATION
|
|
90
94
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";;;AACA,gFAAgF;AAEhF,oBAAoB;AAEpB,qCAAqC;AACxB,QAAA,kBAAkB,GAAG;IAChC,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,WAAW,EAAE,CAAC;CACN,CAAA;AAmCV,0CAA0C;AAC7B,QAAA,gCAAgC,GAAG;IAC9C,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,qBAAqB;CACrB,CAAA;AA8CV,yCAAyC;AACzC,mCAAmC;AACnC,IAAI;AAES,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;CACF,CAAA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A8B,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"}
|
package/dist/esm/api/routes.js
CHANGED
|
@@ -6,11 +6,16 @@ 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
|
-
usersGroups_authorizations: 'users-groups--authorizations',
|
|
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
|
};
|
|
16
21
|
//# sourceMappingURL=routes.js.map
|
|
@@ -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
|
|
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,+BAA+B;IAC3D,YAAY,EAAE,gBAAgB;IAC9B,mBAAmB,EAAE,wBAAwB;IAC7C,kBAAkB,EAAE,sBAAsB;CAC3C,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
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":"
|
|
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;IAED,KAAK,CAAC,MAAM,CAAC,IAGZ;QACC,MAAM,MAAM,GAA8B,EAAE,CAAA;QAE5C,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC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B,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,9 @@ 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 {
|
|
14
|
+
import { AuthAppRoutesNames, } from './authApp';
|
|
15
|
+
import { LicenseKeys } from './license';
|
|
16
|
+
import { AuthenticationTokenDataProviders, AuthenticationType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, } from './models';
|
|
15
17
|
import { AuthorizationKeys, } from './models/authorizations';
|
|
16
|
-
export {
|
|
17
|
-
// api
|
|
18
|
-
ApiRequestHeaders, ApiRoutesNames,
|
|
19
|
-
// apiClient
|
|
20
|
-
AuthenticationsApiClient, AuthorizationsApiClient, LegalPersonsApiClient, UsersApiClient, Users_GroupsApiClient, UsersGroupsApiClient, UsersGroups_invitesApiClient, UsersSharedDataApiClient, WorkgroupsApiClient, WorkgroupUnitsApiClient, WorkgroupUnitsTypesApiClient,
|
|
21
|
-
// models
|
|
22
|
-
AuthenticationTokenDataProviders, AuthenticationType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, legalPersonPropsNames, AuthorizationKeys, AuthorizationKeys as Authorizations, };
|
|
18
|
+
export { ApiRequestHeaders, ApiRoutesNames, AuthAppRoutesNames, AuthenticationTokenDataProviders, AuthenticationType, AuthenticationsApiClient, AuthorizationKeys, AuthorizationKeys as Authorizations, AuthorizationsApiClient, LegalPersonTypes, LegalPersonsApiClient, LicenseKeys, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, UsersApiClient, UsersGroupsApiClient, UsersGroups_invitesApiClient, UsersSharedDataApiClient, Users_GroupsApiClient, WorkgroupUnitsApiClient, WorkgroupUnitsTypesApiClient, WorkgroupsApiClient };
|
|
23
19
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -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;AA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OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAA;AAE9E,OAAO,EAAE,kBAAkB,GAAG,MAAM,WAAW,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EACL,gCAAgC,EAAE,kBAAkB,EAQhC,gBAAgB,EAAE,IAAI,EAAE,sBAAsB,EAAE,2BAA2B,GAChG,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,iBAAiB,GAAG,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EACL,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAClB,gCAAgC,EAAE,kBAAkB,EACpD,wBAAwB,EAAE,iBAAiB,EAAE,iBAAiB,IAAI,cAAc,EAAE,uBAAuB,EAGrF,gBAAgB,EAAE,qBAAqB,EAC3D,WAAW,EAAE,IAAI,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,cAAc,EAAE,oBAAoB,EAC5G,4BAA4B,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,uBAAuB,EACtG,4BAA4B,EAAE,mBAAmB,EAClD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/license/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU,EAAE,oBAAoB;IAChC,eAAe,EAAE,0BAA0B;IAC3C,WAAW,EAAE,sBAAsB;CACpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorizations.js","sourceRoot":"","sources":["../../../src/models/authorizations.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/esm/models/index.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
// import { CheckLicenseResponseItemStatus } from 'licensemanager-lib-common-ts'
|
|
1
2
|
// authentication...
|
|
3
|
+
// TODO-rename to AuthenticationTypes
|
|
2
4
|
export const AuthenticationType = {
|
|
3
5
|
default: 0,
|
|
4
6
|
uuid: 1,
|
|
5
7
|
google: 2,
|
|
8
|
+
integration: 3,
|
|
6
9
|
};
|
|
7
10
|
// USED IN TOKEN ON FIELD ISS OF JWT TOKEN
|
|
8
11
|
export const AuthenticationTokenDataProviders = {
|
|
9
12
|
default: 'default',
|
|
13
|
+
integration: 'integration',
|
|
10
14
|
google: 'accounts.google.com',
|
|
11
15
|
};
|
|
12
|
-
export const legalPersonPropsNames = {
|
|
13
|
-
|
|
14
|
-
}
|
|
16
|
+
// export const legalPersonPropsNames = {
|
|
17
|
+
// workgroupUuid: 'workgroupUuid'
|
|
18
|
+
// }
|
|
15
19
|
export const LegalPersonTypes = {
|
|
16
20
|
person: 0,
|
|
17
21
|
company: 1,
|
|
@@ -22,6 +26,7 @@ export class User {
|
|
|
22
26
|
this.name = data.name;
|
|
23
27
|
this.login = data.login;
|
|
24
28
|
this.email = data.email;
|
|
29
|
+
this.validated = data.validated;
|
|
25
30
|
this.pwd = data.pwd;
|
|
26
31
|
this.imageUrl = data.imageUrl;
|
|
27
32
|
this.legalPersonUuid = data.legalPersonUuid;
|
|
@@ -29,7 +34,7 @@ export class User {
|
|
|
29
34
|
this.groups = data.groups;
|
|
30
35
|
}
|
|
31
36
|
toUserSharedData() {
|
|
32
|
-
const sharedDataKeys = ['uuid', 'name', 'login', 'email', 'imageUrl'];
|
|
37
|
+
const sharedDataKeys = ['uuid', 'name', 'login', 'email', 'validated', 'imageUrl'];
|
|
33
38
|
const sharedData = {};
|
|
34
39
|
sharedDataKeys.forEach(key => {
|
|
35
40
|
if (key in this) {
|
|
@@ -81,5 +86,4 @@ UserGroup_InviteStatusUtils.UserGroup_InviteStatusGetDescription = (status) => {
|
|
|
81
86
|
UserGroup_InviteStatusUtils.UserGroup_InviteStatusGetUiMaterialChipColor = (status) => {
|
|
82
87
|
return status == UserGroup_InviteStatus.pending ? 'warning' : status == UserGroup_InviteStatus.accepted ? 'success' : 'error';
|
|
83
88
|
};
|
|
84
|
-
// ...AUTHORIZATION
|
|
85
89
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AACA,gFAAgF;AAEhF,oBAAoB;AAEpB,qCAAqC;AACrC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,WAAW,EAAE,CAAC;CACN,CAAA;AAmCV,0CAA0C;AAC1C,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,qBAAqB;CACrB,CAAA;AA8CV,yCAAyC;AACzC,mCAAmC;AACnC,IAAI;AAEJ,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;CACF,CAAA;AA4CV,MAAM,OAAO,IAAI;IAYf,YAAY,IAWX;QACC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QACrB,IAAI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CAAC,CAAC,OAAO,CAAA;AAC/H,CAAC,CAAA"}
|
|
@@ -6,10 +6,15 @@ 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;
|
|
13
17
|
users_groups: string;
|
|
14
18
|
usersGroups_invites: string;
|
|
19
|
+
integrationClients: string;
|
|
15
20
|
};
|
|
@@ -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
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ 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 {
|
|
14
|
+
import { AuthAppRoutesNames } from './authApp';
|
|
15
|
+
import { LicenseKeys } from './license';
|
|
16
|
+
import { AuthenticationTokenDataProviders, AuthenticationType, IAuthentication, IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid, IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle, IAuthenticationTokenDataIntegration, IAuthorization, IIntegrationClient, ILegalPerson, IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IWorkgroup, IWorkgroupUnit, IWorkgroupUnitType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils } from './models';
|
|
15
17
|
import { AuthorizationKeys } from './models/authorizations';
|
|
16
|
-
export { ApiRequestHeaders,
|
|
18
|
+
export { ApiRequestHeaders, ApiRoutesNames, AuthAppRoutesNames, AuthenticationTokenDataProviders, AuthenticationType, AuthenticationsApiClient, AuthorizationKeys, AuthorizationKeys as Authorizations, AuthorizationsApiClient, DatacenterApiRequestGetOptions, IAuthentication, IAuthenticationRequestBody, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid, IAuthenticationTokenData, IAuthenticationTokenDataDefault, IAuthenticationTokenDataGoogle, IAuthenticationTokenDataIntegration, IAuthorization, IIntegrationClient, ILegalPerson, IUser, IUserGroup, IUserGroup_Authorization, IUserGroup_Invite, IUserSharedData, IUser_Group, IUsers_SharedData_ApiClientGetOptions, IWorkgroup, IWorkgroupUnit, IWorkgroupUnitType, LegalPersonTypes, LegalPersonsApiClient, LicenseKeys, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, UsersApiClient, UsersGroupsApiClient, UsersGroups_invitesApiClient, UsersSharedDataApiClient, Users_GroupsApiClient, WorkgroupUnitsApiClient, WorkgroupUnitsTypesApiClient, WorkgroupsApiClient };
|
|
@@ -3,30 +3,38 @@ export declare const AuthenticationType: {
|
|
|
3
3
|
readonly default: 0;
|
|
4
4
|
readonly uuid: 1;
|
|
5
5
|
readonly google: 2;
|
|
6
|
+
readonly integration: 3;
|
|
6
7
|
};
|
|
7
8
|
export type AuthenticationType = typeof AuthenticationType[keyof typeof AuthenticationType];
|
|
8
9
|
export interface IAuthenticationRequestBody {
|
|
9
10
|
type: AuthenticationType;
|
|
10
11
|
}
|
|
11
12
|
export interface IAuthenticationRequestBodyDefault extends IAuthenticationRequestBody {
|
|
13
|
+
type: typeof AuthenticationType.default;
|
|
12
14
|
login: string;
|
|
13
15
|
pwd: string;
|
|
14
16
|
}
|
|
15
17
|
export interface IAuthenticationRequestBodyFromUuid extends IAuthenticationRequestBody {
|
|
18
|
+
type: typeof AuthenticationType.uuid;
|
|
16
19
|
uuid: string;
|
|
17
20
|
}
|
|
18
21
|
export interface IAuthenticationRequestBodyFromGoogleToken extends IAuthenticationRequestBody {
|
|
22
|
+
type: typeof AuthenticationType.google;
|
|
19
23
|
idToken: string;
|
|
20
24
|
accessToken: string;
|
|
21
25
|
}
|
|
26
|
+
export interface IAuthenticationRequestBodyIntegration extends IAuthenticationRequestBody {
|
|
27
|
+
type: typeof AuthenticationType.integration;
|
|
28
|
+
client_uuid: string;
|
|
29
|
+
secret: string;
|
|
30
|
+
}
|
|
22
31
|
export interface IAuthentication {
|
|
23
32
|
uuid: string;
|
|
24
|
-
userUuid: string;
|
|
25
|
-
user?: IUser;
|
|
26
33
|
token: string;
|
|
27
34
|
}
|
|
28
35
|
export declare const AuthenticationTokenDataProviders: {
|
|
29
36
|
readonly default: "default";
|
|
37
|
+
readonly integration: "integration";
|
|
30
38
|
readonly google: "accounts.google.com";
|
|
31
39
|
};
|
|
32
40
|
export type AuthenticationTokenDataProviders = typeof AuthenticationTokenDataProviders[keyof typeof AuthenticationTokenDataProviders];
|
|
@@ -36,6 +44,10 @@ export interface IAuthenticationTokenDataDefault extends IAuthenticationTokenDat
|
|
|
36
44
|
authUuid: string;
|
|
37
45
|
user: IUserSharedData;
|
|
38
46
|
}
|
|
47
|
+
export interface IAuthenticationTokenDataIntegration extends IAuthenticationTokenData {
|
|
48
|
+
authUuid: string;
|
|
49
|
+
clientUuid: string;
|
|
50
|
+
}
|
|
39
51
|
export interface IAuthenticationTokenDataGoogle extends IAuthenticationTokenData {
|
|
40
52
|
azp: string;
|
|
41
53
|
email: string;
|
|
@@ -50,12 +62,9 @@ export interface IWorkgroupUnitType {
|
|
|
50
62
|
export interface IWorkgroup {
|
|
51
63
|
uuid: string;
|
|
52
64
|
name: string;
|
|
53
|
-
allowCreateUsersFreely?: boolean;
|
|
54
65
|
legalPersons?: ILegalPerson[];
|
|
66
|
+
integrationClients?: IIntegrationClient[];
|
|
55
67
|
}
|
|
56
|
-
export declare const legalPersonPropsNames: {
|
|
57
|
-
workgroupUuid: string;
|
|
58
|
-
};
|
|
59
68
|
export declare const LegalPersonTypes: {
|
|
60
69
|
readonly person: 0;
|
|
61
70
|
readonly company: 1;
|
|
@@ -84,6 +93,7 @@ export interface IUser {
|
|
|
84
93
|
email: string;
|
|
85
94
|
pwd: string;
|
|
86
95
|
imageUrl?: string;
|
|
96
|
+
validated?: boolean;
|
|
87
97
|
legalPersonUuid?: string;
|
|
88
98
|
legalPerson?: ILegalPerson;
|
|
89
99
|
groups?: IUser_Group[];
|
|
@@ -96,6 +106,7 @@ export declare class User implements IUser {
|
|
|
96
106
|
name: string;
|
|
97
107
|
login: string;
|
|
98
108
|
email: string;
|
|
109
|
+
validated?: boolean | undefined;
|
|
99
110
|
pwd: string;
|
|
100
111
|
imageUrl?: string | undefined;
|
|
101
112
|
legalPersonUuid?: string | undefined;
|
|
@@ -106,6 +117,7 @@ export declare class User implements IUser {
|
|
|
106
117
|
name: string;
|
|
107
118
|
login: string;
|
|
108
119
|
email: string;
|
|
120
|
+
validated?: boolean;
|
|
109
121
|
pwd: string;
|
|
110
122
|
imageUrl?: string | undefined;
|
|
111
123
|
legalPersonUuid?: string | undefined;
|
|
@@ -120,6 +132,7 @@ export interface IUserSharedData {
|
|
|
120
132
|
name: string;
|
|
121
133
|
login: string;
|
|
122
134
|
email: string;
|
|
135
|
+
validated?: boolean;
|
|
123
136
|
imageUrl?: string;
|
|
124
137
|
}
|
|
125
138
|
export interface IUserGroup {
|
|
@@ -171,3 +184,11 @@ export interface IUserGroup_Authorization {
|
|
|
171
184
|
userGroupUuid: string;
|
|
172
185
|
userGroup?: IUserGroup;
|
|
173
186
|
}
|
|
187
|
+
export interface IIntegrationClient {
|
|
188
|
+
uuid: string;
|
|
189
|
+
workgroupUuid: string;
|
|
190
|
+
workgroup?: IWorkgroup;
|
|
191
|
+
name: string;
|
|
192
|
+
secret: string;
|
|
193
|
+
active?: boolean;
|
|
194
|
+
}
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
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",
|
|
38
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"
|
|
39
39
|
},
|
|
40
|
-
"version": "1.
|
|
40
|
+
"version": "1.1.4",
|
|
41
41
|
"exports": {
|
|
42
42
|
".": {
|
|
43
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
|
-
usersGroups_authorizations: 'users-groups--authorizations',
|
|
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
|
}
|
package/src/apiClient/users.ts
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
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
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -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
|
-
|
|
36
|
+
export interface IAuthenticationRequestBodyIntegration extends IAuthenticationRequestBody {
|
|
37
|
+
type: typeof AuthenticationType.integration,
|
|
38
|
+
client_uuid: 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
|
-
|
|
78
|
-
|
|
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
|
+
}
|