datacenter-lib-common-ts 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +4 -0
- package/dist/cjs/api/index.js +7 -0
- package/dist/cjs/api/index.js.map +1 -0
- package/dist/cjs/api/routes.js +19 -0
- package/dist/cjs/api/routes.js.map +1 -0
- package/dist/cjs/apiClient/authentications.js +22 -0
- package/dist/cjs/apiClient/authentications.js.map +1 -0
- package/dist/cjs/apiClient/authorizations.js +15 -0
- package/dist/cjs/apiClient/authorizations.js.map +1 -0
- package/dist/cjs/apiClient/legalPersons.js +15 -0
- package/dist/cjs/apiClient/legalPersons.js.map +1 -0
- package/dist/cjs/apiClient/users.js +15 -0
- package/dist/cjs/apiClient/users.js.map +1 -0
- package/dist/cjs/apiClient/usersGroups.js +15 -0
- package/dist/cjs/apiClient/usersGroups.js.map +1 -0
- package/dist/cjs/apiClient/usersGroups_invites.js +22 -0
- package/dist/cjs/apiClient/usersGroups_invites.js.map +1 -0
- package/dist/cjs/apiClient/usersSharedData.js +25 -0
- package/dist/cjs/apiClient/usersSharedData.js.map +1 -0
- package/dist/cjs/apiClient/users_groups.js +15 -0
- package/dist/cjs/apiClient/users_groups.js.map +1 -0
- package/dist/cjs/apiClient/workgroupUnits.js +15 -0
- package/dist/cjs/apiClient/workgroupUnits.js.map +1 -0
- package/dist/cjs/apiClient/workgroupUnitsTypes.js +15 -0
- package/dist/cjs/apiClient/workgroupUnitsTypes.js.map +1 -0
- package/dist/cjs/apiClient/workgroups.js +15 -0
- package/dist/cjs/apiClient/workgroups.js.map +1 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/models/authorizations.js +12 -0
- package/dist/cjs/models/authorizations.js.map +1 -0
- package/dist/cjs/models/index.js +90 -0
- package/dist/cjs/models/index.js.map +1 -0
- package/dist/esm/api/index.js +4 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/routes.js +16 -0
- package/dist/esm/api/routes.js.map +1 -0
- package/dist/esm/apiClient/authentications.js +17 -0
- package/dist/esm/apiClient/authentications.js.map +1 -0
- package/dist/esm/apiClient/authorizations.js +11 -0
- package/dist/esm/apiClient/authorizations.js.map +1 -0
- package/dist/esm/apiClient/legalPersons.js +11 -0
- package/dist/esm/apiClient/legalPersons.js.map +1 -0
- package/dist/esm/apiClient/users.js +11 -0
- package/dist/esm/apiClient/users.js.map +1 -0
- package/dist/esm/apiClient/usersGroups.js +11 -0
- package/dist/esm/apiClient/usersGroups.js.map +1 -0
- package/dist/esm/apiClient/usersGroups_invites.js +18 -0
- package/dist/esm/apiClient/usersGroups_invites.js.map +1 -0
- package/dist/esm/apiClient/usersSharedData.js +20 -0
- package/dist/esm/apiClient/usersSharedData.js.map +1 -0
- package/dist/esm/apiClient/users_groups.js +11 -0
- package/dist/esm/apiClient/users_groups.js.map +1 -0
- package/dist/esm/apiClient/workgroupUnits.js +11 -0
- package/dist/esm/apiClient/workgroupUnits.js.map +1 -0
- package/dist/esm/apiClient/workgroupUnitsTypes.js +11 -0
- package/dist/esm/apiClient/workgroupUnitsTypes.js.map +1 -0
- package/dist/esm/apiClient/workgroups.js +11 -0
- package/dist/esm/apiClient/workgroups.js.map +1 -0
- package/dist/esm/index.js +22 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/models/authorizations.js +9 -0
- package/dist/esm/models/authorizations.js.map +1 -0
- package/dist/esm/models/index.js +85 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/types/api/index.d.ts +10 -0
- package/dist/types/api/routes.d.ts +15 -0
- package/dist/types/apiClient/authentications.d.ts +15 -0
- package/dist/types/apiClient/authorizations.d.ts +10 -0
- package/dist/types/apiClient/legalPersons.d.ts +10 -0
- package/dist/types/apiClient/users.d.ts +10 -0
- package/dist/types/apiClient/usersGroups.d.ts +9 -0
- package/dist/types/apiClient/usersGroups_invites.d.ts +14 -0
- package/dist/types/apiClient/usersSharedData.d.ts +15 -0
- package/dist/types/apiClient/users_groups.d.ts +10 -0
- package/dist/types/apiClient/workgroupUnits.d.ts +10 -0
- package/dist/types/apiClient/workgroupUnitsTypes.d.ts +10 -0
- package/dist/types/apiClient/workgroups.d.ts +10 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/models/authorizations.d.ts +9 -0
- package/dist/types/models/index.d.ts +173 -0
- package/package.json +46 -0
- package/src/api/index.ts +13 -0
- package/src/api/routes.ts +15 -0
- package/src/apiClient/authentications.ts +31 -0
- package/src/apiClient/authorizations.ts +19 -0
- package/src/apiClient/legalPersons.ts +19 -0
- package/src/apiClient/users.ts +18 -0
- package/src/apiClient/usersGroups.ts +17 -0
- package/src/apiClient/usersGroups_invites.ts +29 -0
- package/src/apiClient/usersSharedData.ts +33 -0
- package/src/apiClient/users_groups.ts +18 -0
- package/src/apiClient/workgroupUnits.ts +18 -0
- package/src/apiClient/workgroupUnitsTypes.ts +18 -0
- package/src/apiClient/workgroups.ts +18 -0
- package/src/index.ts +51 -0
- package/src/models/authorizations.ts +10 -0
- package/src/models/index.ts +287 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { ApiClientUtils } from 'fwork-jsts-common';
|
|
3
|
+
import { ApiRoutesNames } from '../api/routes';
|
|
4
|
+
export class UsersSharedDataApiClient {
|
|
5
|
+
constructor(args) {
|
|
6
|
+
this.apiUrl = `${args.baseApiUrl}${ApiRoutesNames.usersSharedData}`;
|
|
7
|
+
this.axios = args.axios ?? axios;
|
|
8
|
+
}
|
|
9
|
+
async get(args) {
|
|
10
|
+
return ApiClientUtils.get({
|
|
11
|
+
apiUrl: this.apiUrl,
|
|
12
|
+
axios: this.axios,
|
|
13
|
+
...args,
|
|
14
|
+
params: {
|
|
15
|
+
'onlyRelated': args?.onlyRelated
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=usersSharedData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usersSharedData.js","sourceRoot":"","sources":["../../../src/apiClient/usersSharedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAA;AACzD,OAAO,EAAsD,cAAc,EAAoB,MAAM,mBAAmB,CAAA;AAExH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAO9C,MAAM,OAAO,wBAAwB;IAInC,YAAY,IAGX;QACC,IAAI,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,eAAe,EAAE,CAAA;QACnE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAA;IAClC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAA4C;QACpD,OAAO,cAAc,CAAC,GAAG,CAA0C;YACjE,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,IAAI;YACP,MAAM,EAAE;gBACN,aAAa,EAAE,IAAI,EAAE,WAAW;aACjC;SACF,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
2
|
+
import { ApiRoutesNames } from '../api/routes';
|
|
3
|
+
export class Users_GroupsApiClient extends BaseApiClient {
|
|
4
|
+
constructor(args) {
|
|
5
|
+
super({
|
|
6
|
+
apiUrl: `${args.baseApiUrl}${ApiRoutesNames.users_groups}`,
|
|
7
|
+
axios: args.axios,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=users_groups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users_groups.js","sourceRoot":"","sources":["../../../src/apiClient/users_groups.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,OAAO,qBAAsB,SAAQ,aACI;IAC7C,YAAY,IAGX;QACC,KAAK,CAAC;YACJ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,YAAY,EAAE;YAC1D,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
2
|
+
import { ApiRoutesNames } from '../api/routes';
|
|
3
|
+
export class WorkgroupUnitsApiClient extends BaseApiClient {
|
|
4
|
+
constructor(args) {
|
|
5
|
+
super({
|
|
6
|
+
apiUrl: `${args.baseApiUrl}${ApiRoutesNames.workgroupUnits}`,
|
|
7
|
+
axios: args.axios,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=workgroupUnits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workgroupUnits.js","sourceRoot":"","sources":["../../../src/apiClient/workgroupUnits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,OAAO,uBAAwB,SAAQ,aACW;IACtD,YAAY,IAGX;QACC,KAAK,CAAC;YACJ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,cAAc,EAAE;YAC5D,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
2
|
+
import { ApiRoutesNames } from '../api/routes';
|
|
3
|
+
export class WorkgroupUnitsTypesApiClient extends BaseApiClient {
|
|
4
|
+
constructor(args) {
|
|
5
|
+
super({
|
|
6
|
+
apiUrl: `${args.baseApiUrl}${ApiRoutesNames.workgroupUnitsTypes}`,
|
|
7
|
+
axios: args.axios,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=workgroupUnitsTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workgroupUnitsTypes.js","sourceRoot":"","sources":["../../../src/apiClient/workgroupUnitsTypes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAG9C,MAAM,OAAO,4BAA6B,SAAQ,aACkB;IAClE,YAAY,IAGX;QACC,KAAK,CAAC;YACJ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,mBAAmB,EAAE;YACjE,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
2
|
+
import { ApiRoutesNames } from '../api/routes';
|
|
3
|
+
export class WorkgroupsApiClient extends BaseApiClient {
|
|
4
|
+
constructor(args) {
|
|
5
|
+
super({
|
|
6
|
+
apiUrl: `${args.baseApiUrl}${ApiRoutesNames.workgroups}`,
|
|
7
|
+
axios: args.axios,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=workgroups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workgroups.js","sourceRoot":"","sources":["../../../src/apiClient/workgroups.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,OAAO,mBAAoB,SAAQ,aACG;IAC1C,YAAY,IAGX;QACC,KAAK,CAAC;YACJ,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,UAAU,EAAE;YACxD,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ApiRequestHeaders, } from './api';
|
|
2
|
+
import { ApiRoutesNames, } from './api/routes';
|
|
3
|
+
import { AuthenticationsApiClient } from './apiClient/authentications';
|
|
4
|
+
import { AuthorizationsApiClient } from './apiClient/authorizations';
|
|
5
|
+
import { LegalPersonsApiClient } from './apiClient/legalPersons';
|
|
6
|
+
import { UsersApiClient } from './apiClient/users';
|
|
7
|
+
import { Users_GroupsApiClient } from './apiClient/users_groups';
|
|
8
|
+
import { UsersGroupsApiClient } from './apiClient/usersGroups';
|
|
9
|
+
import { UsersGroups_invitesApiClient } from './apiClient/usersGroups_invites';
|
|
10
|
+
import { WorkgroupsApiClient } from './apiClient/workgroups';
|
|
11
|
+
import { WorkgroupUnitsApiClient } from './apiClient/workgroupUnits';
|
|
12
|
+
import { WorkgroupUnitsTypesApiClient } from './apiClient/workgroupUnitsTypes';
|
|
13
|
+
import { AuthenticationTokenDataProviders, AuthenticationType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, legalPersonPropsNames, } from './models';
|
|
14
|
+
import { AuthorizationKeys, } from './models/authorizations';
|
|
15
|
+
export {
|
|
16
|
+
// api
|
|
17
|
+
ApiRequestHeaders, ApiRoutesNames,
|
|
18
|
+
// apiClient
|
|
19
|
+
AuthenticationsApiClient, AuthorizationsApiClient, LegalPersonsApiClient, UsersApiClient, Users_GroupsApiClient, UsersGroupsApiClient, UsersGroups_invitesApiClient, WorkgroupsApiClient, WorkgroupUnitsApiClient, WorkgroupUnitsTypesApiClient,
|
|
20
|
+
// models
|
|
21
|
+
AuthenticationTokenDataProviders, AuthenticationType, LegalPersonTypes, User, UserGroup_InviteStatus, UserGroup_InviteStatusUtils, legalPersonPropsNames, AuthorizationKeys, };
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,CAAA;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAA;AAE9E,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,gCAAgC,EAAE,kBAAkB,EAIrC,gBAAgB,EAAE,IAAI,EAAE,sBAAsB,EAAG,2BAA2B,EAAE,qBAAqB,GACzH,MAAM,UAAU,CAAA;AAClB,OAAO,EAAE,iBAAiB,GAAuB,MAAM,yBAAyB,CAAA;AAEhF,OAAO;AACH,MAAM;AACN,iBAAiB,EAEjB,cAAc;AAEd,YAAY;AACZ,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAE5B,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B;AAE5B,SAAS;AACT,gCAAgC,EAAE,kBAAkB,EAIhC,gBAAgB,EAAE,IAAI,EAAE,sBAAsB,EAAG,2BAA2B,EAAE,qBAAqB,EAEvH,iBAAiB,GACpB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const AuthorizationKeys = {
|
|
2
|
+
sysAdm: 'sysAdm',
|
|
3
|
+
workgroupAdm: 'workgroupAdm',
|
|
4
|
+
workgroupUnitAdm: 'workgroupUnitAdm',
|
|
5
|
+
legalPersonsAdm: 'legalPersonsAdm',
|
|
6
|
+
usersGroupsAdm: 'usersGroupsAdm',
|
|
7
|
+
usersAdm: 'usersAdm',
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=authorizations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// authentication...
|
|
2
|
+
export const AuthenticationType = {
|
|
3
|
+
default: 0,
|
|
4
|
+
uuid: 1,
|
|
5
|
+
google: 2,
|
|
6
|
+
};
|
|
7
|
+
// USED IN TOKEN ON FIELD ISS OF JWT TOKEN
|
|
8
|
+
export const AuthenticationTokenDataProviders = {
|
|
9
|
+
default: 'default',
|
|
10
|
+
google: 'accounts.google.com',
|
|
11
|
+
};
|
|
12
|
+
export const legalPersonPropsNames = {
|
|
13
|
+
workgroupUuid: 'workgroupUuid'
|
|
14
|
+
};
|
|
15
|
+
export const LegalPersonTypes = {
|
|
16
|
+
person: 0,
|
|
17
|
+
company: 1,
|
|
18
|
+
};
|
|
19
|
+
export class User {
|
|
20
|
+
constructor(data) {
|
|
21
|
+
this.uuid = data.uuid;
|
|
22
|
+
this.name = data.name;
|
|
23
|
+
this.login = data.login;
|
|
24
|
+
this.email = data.email;
|
|
25
|
+
this.pwd = data.pwd;
|
|
26
|
+
this.imageUrl = data.imageUrl;
|
|
27
|
+
this.legalPersonUuid = data.legalPersonUuid;
|
|
28
|
+
this.legalPerson = data.legalPerson;
|
|
29
|
+
this.groups = data.groups;
|
|
30
|
+
}
|
|
31
|
+
toUserSharedData() {
|
|
32
|
+
const sharedDataKeys = ['uuid', 'name', 'login', 'email', 'imageUrl'];
|
|
33
|
+
const sharedData = {};
|
|
34
|
+
sharedDataKeys.forEach(key => {
|
|
35
|
+
if (key in this) {
|
|
36
|
+
sharedData[key] = this[key];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return sharedData;
|
|
40
|
+
}
|
|
41
|
+
static toUserSharedData(input) {
|
|
42
|
+
// Verifica se o objeto é um IUser
|
|
43
|
+
if (input &&
|
|
44
|
+
typeof input === 'object' &&
|
|
45
|
+
'uuid' in input &&
|
|
46
|
+
'name' in input &&
|
|
47
|
+
'login' in input &&
|
|
48
|
+
'email' in input &&
|
|
49
|
+
'pwd' in input) {
|
|
50
|
+
// Cria uma instância de User e converte para IUserSharedData
|
|
51
|
+
const userInstance = input instanceof User ? input : new User(input);
|
|
52
|
+
return userInstance.toUserSharedData();
|
|
53
|
+
}
|
|
54
|
+
if (typeof input === 'object' && input !== null) {
|
|
55
|
+
// Itera pelas propriedades do objeto ou elementos do array
|
|
56
|
+
if (Array.isArray(input)) {
|
|
57
|
+
return input.map(item => User.toUserSharedData(item));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const transformedObject = {};
|
|
61
|
+
for (const key of Object.keys(input)) {
|
|
62
|
+
transformedObject[key] = User.toUserSharedData(input[key]);
|
|
63
|
+
}
|
|
64
|
+
return transformedObject;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Retorna o valor original se não for um objeto ou array
|
|
68
|
+
return input;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export const UserGroup_InviteStatus = {
|
|
72
|
+
pending: 0,
|
|
73
|
+
accepted: 1,
|
|
74
|
+
refused: 2,
|
|
75
|
+
};
|
|
76
|
+
export class UserGroup_InviteStatusUtils {
|
|
77
|
+
}
|
|
78
|
+
UserGroup_InviteStatusUtils.UserGroup_InviteStatusGetDescription = (status) => {
|
|
79
|
+
return status == UserGroup_InviteStatus.pending ? 'Pendente' : status == UserGroup_InviteStatus.accepted ? 'Aceito' : 'Negado';
|
|
80
|
+
};
|
|
81
|
+
UserGroup_InviteStatusUtils.UserGroup_InviteStatusGetUiMaterialChipColor = (status) => {
|
|
82
|
+
return status == UserGroup_InviteStatus.pending ? 'warning' : status == UserGroup_InviteStatus.accepted ? 'success' : 'error';
|
|
83
|
+
};
|
|
84
|
+
// ...AUTHORIZATION
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,OAAO,EAAE,UAAU,CAAC,CAAA;QAChG,MAAM,UAAU,GAA6B,EAAE,CAAC;QAChD,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC3B,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;gBAChB,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,UAA6B,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,KAAU;QAChC,kCAAkC;QAClC,IACE,KAAK;YACL,OAAO,KAAK,KAAK,QAAQ;YACzB,MAAM,IAAI,KAAK;YACf,MAAM,IAAI,KAAK;YACf,OAAO,IAAI,KAAK;YAChB,OAAO,IAAI,KAAK;YAChB,KAAK,IAAI,KAAK,EACd,CAAC;YACD,6DAA6D;YAC7D,MAAM,YAAY,GAAG,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;YACrE,OAAO,YAAY,CAAC,gBAAgB,EAAE,CAAC;QACzC,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAChD,2DAA2D;YAC3D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,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;AA+BD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;CACF,CAAA;AAIV,MAAM,OAAO,2BAA2B;;AAC/B,gEAAoC,GAAG,CAAC,MAA8B,EAAE,EAAE;IAC/E,OAAO,MAAM,IAAI,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,IAAI,sBAAsB,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,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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApiRequestGetOptions } from "fwork-jsts-common";
|
|
2
|
+
import { Where } from "fwork-jsts-common";
|
|
3
|
+
import { IUser } from "../models";
|
|
4
|
+
export declare const ApiRequestHeaders: {
|
|
5
|
+
readonly tokenProvider: "token-provider";
|
|
6
|
+
};
|
|
7
|
+
export type ApiRequestHeaders = typeof ApiRequestHeaders[keyof typeof ApiRequestHeaders];
|
|
8
|
+
export type DatacenterApiRequestGetOptions<T, TWhere extends Where<T>> = ApiRequestGetOptions<T, TWhere> & {
|
|
9
|
+
user?: IUser;
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ApiRoutesNames: {
|
|
2
|
+
system: string;
|
|
3
|
+
authentications: string;
|
|
4
|
+
authorizations: string;
|
|
5
|
+
workgroupUnitsTypes: string;
|
|
6
|
+
workgroups: string;
|
|
7
|
+
legalPersons: string;
|
|
8
|
+
users: string;
|
|
9
|
+
usersSharedData: string;
|
|
10
|
+
workgroupUnits: string;
|
|
11
|
+
usersGroups: string;
|
|
12
|
+
usersGroups_authorizations: string;
|
|
13
|
+
users_groups: string;
|
|
14
|
+
usersGroups_invites: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosStatic } from 'axios';
|
|
2
|
+
import { IApiClientResult } from 'fwork-jsts-common';
|
|
3
|
+
import { IAuthentication, IAuthenticationRequestBodyDefault, IAuthenticationRequestBodyFromGoogleToken, IAuthenticationRequestBodyFromUuid } from '../models';
|
|
4
|
+
export declare class AuthenticationsApiClient {
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
axios: AxiosStatic | AxiosInstance;
|
|
7
|
+
constructor(args: {
|
|
8
|
+
baseApiUrl: string;
|
|
9
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
10
|
+
});
|
|
11
|
+
post(args: {
|
|
12
|
+
data: IAuthenticationRequestBodyDefault | IAuthenticationRequestBodyFromUuid | IAuthenticationRequestBodyFromGoogleToken;
|
|
13
|
+
config?: AxiosRequestConfig<IAuthenticationRequestBodyDefault | IAuthenticationRequestBodyFromUuid | IAuthenticationRequestBodyFromGoogleToken> | undefined;
|
|
14
|
+
}): Promise<IApiClientResult<IAuthentication> | undefined>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosStatic } from 'axios';
|
|
2
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
3
|
+
import { Where } from 'fwork-jsts-common';
|
|
4
|
+
import { IAuthorization } from '../models';
|
|
5
|
+
export declare class AuthorizationsApiClient extends BaseApiClient<IAuthorization, any, Where<IAuthorization>, IAuthorization, IAuthorization> {
|
|
6
|
+
constructor(args: {
|
|
7
|
+
baseApiUrl: string;
|
|
8
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosStatic } from 'axios';
|
|
2
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
3
|
+
import { Where } from 'fwork-jsts-common';
|
|
4
|
+
import { ILegalPerson } from '../models';
|
|
5
|
+
export declare class LegalPersonsApiClient extends BaseApiClient<ILegalPerson, any, Where<ILegalPerson>, ILegalPerson, ILegalPerson> {
|
|
6
|
+
constructor(args: {
|
|
7
|
+
baseApiUrl: string;
|
|
8
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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';
|
|
5
|
+
export declare class UsersApiClient extends BaseApiClient<IUser, any, Where<IUser>, IUser, IUser> {
|
|
6
|
+
constructor(args: {
|
|
7
|
+
baseApiUrl: string;
|
|
8
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosStatic } from 'axios';
|
|
2
|
+
import { BaseApiClient, Where } from 'fwork-jsts-common';
|
|
3
|
+
import { IUserGroup } from '../models';
|
|
4
|
+
export declare class UsersGroupsApiClient extends BaseApiClient<IUserGroup, any, Where<IUserGroup>, IUserGroup, IUserGroup> {
|
|
5
|
+
constructor(args: {
|
|
6
|
+
baseApiUrl: string;
|
|
7
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosStatic } from 'axios';
|
|
2
|
+
import { ApiResponsePostData, Where, BaseApiClient, IApiClientResult } from 'fwork-jsts-common';
|
|
3
|
+
import { IUserGroup_Invite } from '../models';
|
|
4
|
+
export declare class UsersGroups_invitesApiClient extends BaseApiClient<IUserGroup_Invite, any, Where<IUserGroup_Invite>, IUserGroup_Invite, IUserGroup_Invite> {
|
|
5
|
+
constructor(args: {
|
|
6
|
+
baseApiUrl: string;
|
|
7
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
8
|
+
});
|
|
9
|
+
bulkPost(args: {
|
|
10
|
+
data: IUserGroup_Invite[];
|
|
11
|
+
status?: number[];
|
|
12
|
+
config?: AxiosRequestConfig<IUserGroup_Invite[]> | undefined;
|
|
13
|
+
}): Promise<IApiClientResult<ApiResponsePostData<IUserGroup_Invite[]>>>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosStatic } from 'axios';
|
|
2
|
+
import { ApiResponseGetListData, Where, ApiClientGetOptions, IApiClientResult } from 'fwork-jsts-common';
|
|
3
|
+
import { IUserSharedData } from '../models';
|
|
4
|
+
export interface IUsers_SharedData_ApiClientGetOptions extends ApiClientGetOptions<IUserSharedData, Where<IUserSharedData>> {
|
|
5
|
+
onlyRelated?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class UsersSharedDataApiClient {
|
|
8
|
+
apiUrl: string;
|
|
9
|
+
axios: AxiosStatic | AxiosInstance;
|
|
10
|
+
constructor(args: {
|
|
11
|
+
baseApiUrl: string;
|
|
12
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
13
|
+
});
|
|
14
|
+
get(args?: IUsers_SharedData_ApiClientGetOptions): Promise<IApiClientResult<ApiResponseGetListData<IUserSharedData>>>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosStatic } from 'axios';
|
|
2
|
+
import { Where } from 'fwork-jsts-common';
|
|
3
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
4
|
+
import { IUser_Group } from '../models';
|
|
5
|
+
export declare class Users_GroupsApiClient extends BaseApiClient<IUser_Group, any, Where<IUser_Group>, IUser_Group, IUser_Group> {
|
|
6
|
+
constructor(args: {
|
|
7
|
+
baseApiUrl: string;
|
|
8
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosStatic } from 'axios';
|
|
2
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
3
|
+
import { Where } from 'fwork-jsts-common';
|
|
4
|
+
import { IWorkgroupUnit } from '../models';
|
|
5
|
+
export declare class WorkgroupUnitsApiClient extends BaseApiClient<IWorkgroupUnit, any, Where<IWorkgroupUnit>, IWorkgroupUnit, IWorkgroupUnit> {
|
|
6
|
+
constructor(args: {
|
|
7
|
+
baseApiUrl: string;
|
|
8
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosStatic } from 'axios';
|
|
2
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
3
|
+
import { Where } from 'fwork-jsts-common';
|
|
4
|
+
import { IWorkgroupUnitType } from '../models';
|
|
5
|
+
export declare class WorkgroupUnitsTypesApiClient extends BaseApiClient<IWorkgroupUnitType, any, Where<IWorkgroupUnitType>, IWorkgroupUnitType, IWorkgroupUnitType> {
|
|
6
|
+
constructor(args: {
|
|
7
|
+
baseApiUrl: string;
|
|
8
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosStatic } from 'axios';
|
|
2
|
+
import { BaseApiClient } from 'fwork-jsts-common';
|
|
3
|
+
import { Where } from 'fwork-jsts-common';
|
|
4
|
+
import { IWorkgroup } from '../models';
|
|
5
|
+
export declare class WorkgroupsApiClient extends BaseApiClient<IWorkgroup, any, Where<IWorkgroup>, IWorkgroup, IWorkgroup> {
|
|
6
|
+
constructor(args: {
|
|
7
|
+
baseApiUrl: string;
|
|
8
|
+
axios?: AxiosStatic | AxiosInstance;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApiRequestHeaders, DatacenterApiRequestGetOptions } from './api';
|
|
2
|
+
import { ApiRoutesNames } from './api/routes';
|
|
3
|
+
import { AuthenticationsApiClient } from './apiClient/authentications';
|
|
4
|
+
import { AuthorizationsApiClient } from './apiClient/authorizations';
|
|
5
|
+
import { LegalPersonsApiClient } from './apiClient/legalPersons';
|
|
6
|
+
import { UsersApiClient } from './apiClient/users';
|
|
7
|
+
import { Users_GroupsApiClient } from './apiClient/users_groups';
|
|
8
|
+
import { UsersGroupsApiClient } from './apiClient/usersGroups';
|
|
9
|
+
import { UsersGroups_invitesApiClient } from './apiClient/usersGroups_invites';
|
|
10
|
+
import { IUsers_SharedData_ApiClientGetOptions } from './apiClient/usersSharedData';
|
|
11
|
+
import { WorkgroupsApiClient } from './apiClient/workgroups';
|
|
12
|
+
import { WorkgroupUnitsApiClient } from './apiClient/workgroupUnits';
|
|
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';
|
|
15
|
+
import { AuthorizationKeys, AuthorizationsKeys } from './models/authorizations';
|
|
16
|
+
export { ApiRequestHeaders, DatacenterApiRequestGetOptions, ApiRoutesNames, AuthenticationsApiClient, AuthorizationsApiClient, LegalPersonsApiClient, UsersApiClient, Users_GroupsApiClient, UsersGroupsApiClient, UsersGroups_invitesApiClient, IUsers_SharedData_ApiClientGetOptions, 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, AuthorizationsKeys, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const AuthorizationKeys: {
|
|
2
|
+
readonly sysAdm: "sysAdm";
|
|
3
|
+
readonly workgroupAdm: "workgroupAdm";
|
|
4
|
+
readonly workgroupUnitAdm: "workgroupUnitAdm";
|
|
5
|
+
readonly legalPersonsAdm: "legalPersonsAdm";
|
|
6
|
+
readonly usersGroupsAdm: "usersGroupsAdm";
|
|
7
|
+
readonly usersAdm: "usersAdm";
|
|
8
|
+
};
|
|
9
|
+
export type AuthorizationsKeys = typeof AuthorizationKeys[keyof typeof AuthorizationKeys];
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { JwtPayload } from "jsonwebtoken";
|
|
2
|
+
export declare const AuthenticationType: {
|
|
3
|
+
readonly default: 0;
|
|
4
|
+
readonly uuid: 1;
|
|
5
|
+
readonly google: 2;
|
|
6
|
+
};
|
|
7
|
+
export type AuthenticationType = typeof AuthenticationType[keyof typeof AuthenticationType];
|
|
8
|
+
export interface IAuthenticationRequestBody {
|
|
9
|
+
type: AuthenticationType;
|
|
10
|
+
}
|
|
11
|
+
export interface IAuthenticationRequestBodyDefault extends IAuthenticationRequestBody {
|
|
12
|
+
login: string;
|
|
13
|
+
pwd: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IAuthenticationRequestBodyFromUuid extends IAuthenticationRequestBody {
|
|
16
|
+
uuid: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IAuthenticationRequestBodyFromGoogleToken extends IAuthenticationRequestBody {
|
|
19
|
+
idToken: string;
|
|
20
|
+
accessToken: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IAuthentication {
|
|
23
|
+
uuid: string;
|
|
24
|
+
userUuid: string;
|
|
25
|
+
user?: IUser;
|
|
26
|
+
token: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const AuthenticationTokenDataProviders: {
|
|
29
|
+
readonly default: "default";
|
|
30
|
+
readonly google: "accounts.google.com";
|
|
31
|
+
};
|
|
32
|
+
export type AuthenticationTokenDataProviders = typeof AuthenticationTokenDataProviders[keyof typeof AuthenticationTokenDataProviders];
|
|
33
|
+
export interface IAuthenticationTokenData extends JwtPayload {
|
|
34
|
+
}
|
|
35
|
+
export interface IAuthenticationTokenDataDefault extends IAuthenticationTokenData {
|
|
36
|
+
authUuid: string;
|
|
37
|
+
user: IUserSharedData;
|
|
38
|
+
}
|
|
39
|
+
export interface IAuthenticationTokenDataGoogle extends IAuthenticationTokenData {
|
|
40
|
+
azp: string;
|
|
41
|
+
email: string;
|
|
42
|
+
email_verified: string;
|
|
43
|
+
at_hash: string;
|
|
44
|
+
}
|
|
45
|
+
export interface IWorkgroupUnitType {
|
|
46
|
+
uuid: string;
|
|
47
|
+
name: string;
|
|
48
|
+
workgroupUnits?: IWorkgroupUnit[];
|
|
49
|
+
}
|
|
50
|
+
export interface IWorkgroup {
|
|
51
|
+
uuid: string;
|
|
52
|
+
name: string;
|
|
53
|
+
allowCreateUsersFreely?: boolean;
|
|
54
|
+
legalPersons?: ILegalPerson[];
|
|
55
|
+
}
|
|
56
|
+
export declare const legalPersonPropsNames: {
|
|
57
|
+
workgroupUuid: string;
|
|
58
|
+
};
|
|
59
|
+
export declare const LegalPersonTypes: {
|
|
60
|
+
readonly person: 0;
|
|
61
|
+
readonly company: 1;
|
|
62
|
+
};
|
|
63
|
+
export type LegalPersonTypes = typeof LegalPersonTypes[keyof typeof LegalPersonTypes];
|
|
64
|
+
export interface ILegalPerson {
|
|
65
|
+
uuid: string;
|
|
66
|
+
type: LegalPersonTypes;
|
|
67
|
+
name: string;
|
|
68
|
+
workgroupUuid: string;
|
|
69
|
+
workgroup?: IWorkgroup;
|
|
70
|
+
workgroupUnit?: IWorkgroupUnit;
|
|
71
|
+
users?: IUser[];
|
|
72
|
+
}
|
|
73
|
+
export interface IWorkgroupUnit {
|
|
74
|
+
workgroupUnitTypeUuid: string;
|
|
75
|
+
workgroupUnitType?: IWorkgroupUnitType;
|
|
76
|
+
legalPersonUuid: string;
|
|
77
|
+
legalPerson?: ILegalPerson;
|
|
78
|
+
usersGroups?: IUserGroup[];
|
|
79
|
+
}
|
|
80
|
+
export interface IUser {
|
|
81
|
+
uuid: string;
|
|
82
|
+
name: string;
|
|
83
|
+
login: string;
|
|
84
|
+
email: string;
|
|
85
|
+
pwd: string;
|
|
86
|
+
imageUrl?: string;
|
|
87
|
+
legalPersonUuid?: string;
|
|
88
|
+
legalPerson?: ILegalPerson;
|
|
89
|
+
groups?: IUser_Group[];
|
|
90
|
+
receivedInvites?: IUserGroup_Invite[];
|
|
91
|
+
sentInvites?: IUserGroup_Invite[];
|
|
92
|
+
authentications?: IAuthentication[];
|
|
93
|
+
}
|
|
94
|
+
export declare class User implements IUser {
|
|
95
|
+
uuid: any;
|
|
96
|
+
name: string;
|
|
97
|
+
login: string;
|
|
98
|
+
email: string;
|
|
99
|
+
pwd: string;
|
|
100
|
+
imageUrl?: string | undefined;
|
|
101
|
+
legalPersonUuid?: string | undefined;
|
|
102
|
+
legalPerson?: ILegalPerson | undefined;
|
|
103
|
+
groups?: IUser_Group[] | undefined;
|
|
104
|
+
constructor(data: {
|
|
105
|
+
uuid: string;
|
|
106
|
+
name: string;
|
|
107
|
+
login: string;
|
|
108
|
+
email: string;
|
|
109
|
+
pwd: string;
|
|
110
|
+
imageUrl?: string | undefined;
|
|
111
|
+
legalPersonUuid?: string | undefined;
|
|
112
|
+
legalPerson?: ILegalPerson | undefined;
|
|
113
|
+
groups?: IUser_Group[] | undefined;
|
|
114
|
+
});
|
|
115
|
+
toUserSharedData(): IUserSharedData;
|
|
116
|
+
static toUserSharedData(input: any): any;
|
|
117
|
+
}
|
|
118
|
+
export interface IUserSharedData {
|
|
119
|
+
uuid: string;
|
|
120
|
+
name: string;
|
|
121
|
+
login: string;
|
|
122
|
+
email: string;
|
|
123
|
+
imageUrl?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface IUserGroup {
|
|
126
|
+
uuid: string;
|
|
127
|
+
name: string;
|
|
128
|
+
workgroupUnitUuid: string;
|
|
129
|
+
workgroupUnit?: IWorkgroupUnit;
|
|
130
|
+
users?: IUser_Group[];
|
|
131
|
+
authorizations?: IUserGroup_Authorization[];
|
|
132
|
+
usersInvites?: IUserGroup_Invite[];
|
|
133
|
+
}
|
|
134
|
+
export interface IUser_Group {
|
|
135
|
+
uuid: string;
|
|
136
|
+
userUuid: string;
|
|
137
|
+
user?: IUser;
|
|
138
|
+
userGroupUuid: string;
|
|
139
|
+
userGroup?: IUserGroup;
|
|
140
|
+
}
|
|
141
|
+
export declare const UserGroup_InviteStatus: {
|
|
142
|
+
readonly pending: 0;
|
|
143
|
+
readonly accepted: 1;
|
|
144
|
+
readonly refused: 2;
|
|
145
|
+
};
|
|
146
|
+
export type UserGroup_InviteStatus = typeof UserGroup_InviteStatus[keyof typeof UserGroup_InviteStatus];
|
|
147
|
+
export declare class UserGroup_InviteStatusUtils {
|
|
148
|
+
static UserGroup_InviteStatusGetDescription: (status: UserGroup_InviteStatus) => "Pendente" | "Aceito" | "Negado";
|
|
149
|
+
static UserGroup_InviteStatusGetUiMaterialChipColor: (status: UserGroup_InviteStatus) => "warning" | "success" | "error";
|
|
150
|
+
}
|
|
151
|
+
export interface IUserGroup_Invite {
|
|
152
|
+
uuid: string;
|
|
153
|
+
userUuid: string;
|
|
154
|
+
user?: IUser;
|
|
155
|
+
targetUserUuid: string;
|
|
156
|
+
targetUser?: IUser;
|
|
157
|
+
userGroupUuid: string;
|
|
158
|
+
userGroup?: IUserGroup;
|
|
159
|
+
dtUnix: number;
|
|
160
|
+
status: UserGroup_InviteStatus;
|
|
161
|
+
}
|
|
162
|
+
export interface IAuthorization {
|
|
163
|
+
key: string;
|
|
164
|
+
description: string;
|
|
165
|
+
usersGroups?: IUserGroup_Authorization[];
|
|
166
|
+
}
|
|
167
|
+
export interface IUserGroup_Authorization {
|
|
168
|
+
uuid: string;
|
|
169
|
+
authorizationKey: string;
|
|
170
|
+
authorization?: IAuthorization;
|
|
171
|
+
userGroupUuid: string;
|
|
172
|
+
userGroup?: IUserGroup;
|
|
173
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "joabssilveira",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"@types/jsonwebtoken": "^9.0.5",
|
|
5
|
+
"fwork-jsts-common": "^2.0.7",
|
|
6
|
+
"jsonwebtoken": "^9.0.2",
|
|
7
|
+
"tslib": "^2.8.1"
|
|
8
|
+
},
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"standard-version": "^9.5.0",
|
|
11
|
+
"typescript": "^5.6.3"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=10"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"src"
|
|
19
|
+
],
|
|
20
|
+
"homepage": "https://github.com/joabssilveira/datacenter-lib-common-ts",
|
|
21
|
+
"keywords": [],
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"main": "dist/cjs/index.js",
|
|
24
|
+
"module": "dist/esm/index.js",
|
|
25
|
+
"types": "dist/types/index.d.ts",
|
|
26
|
+
"name": "datacenter-lib-common-ts",
|
|
27
|
+
"prettier": {
|
|
28
|
+
"printWidth": 80,
|
|
29
|
+
"semi": true,
|
|
30
|
+
"singleQuote": true,
|
|
31
|
+
"trailingComma": "es5"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json",
|
|
35
|
+
"release:major": "standard-version -M && git add CHANGELOG.md && git commit -m \"updated CHANGELOG.md\" && npm version major && git push origin && git push origin --tags && npm publish --access public",
|
|
36
|
+
"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
|
+
"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
|
+
"version": "1.0.0",
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"require": "./dist/cjs/index.js",
|
|
43
|
+
"import": "./dist/esm/index.js"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|