@fiado/type-kit 3.467.0 → 3.468.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/_test_/unit/directory/directoryAgentsBySponsorDtos.test.ts +69 -0
- package/_test_/unit/group/groupMemberHubItem.test.ts +87 -0
- package/_test_/unit/platformRbac/dtos/tenantUsersBySubsDtos.test.ts +61 -0
- package/_test_/unit/referral-business/agentsByDirectoryIdsDtos.test.ts +65 -0
- package/bin/directory/dtos/DirectoryAgentsBySponsorRequest.d.ts +4 -0
- package/bin/directory/dtos/DirectoryAgentsBySponsorRequest.js +25 -0
- package/bin/directory/dtos/DirectoryAgentsBySponsorResponse.d.ts +9 -0
- package/bin/directory/dtos/DirectoryAgentsBySponsorResponse.js +2 -0
- package/bin/directory/index.d.ts +2 -0
- package/bin/directory/index.js +2 -0
- package/bin/group/dtos/GroupMemberHubItem.d.ts +36 -0
- package/bin/group/dtos/GroupMemberHubItem.js +2 -0
- package/bin/group/index.d.ts +1 -0
- package/bin/group/index.js +1 -0
- package/bin/platformRbac/dtos/TenantUsersBySubsRequest.d.ts +4 -0
- package/bin/platformRbac/dtos/TenantUsersBySubsRequest.js +25 -0
- package/bin/platformRbac/dtos/TenantUsersBySubsResponse.d.ts +8 -0
- package/bin/platformRbac/dtos/TenantUsersBySubsResponse.js +2 -0
- package/bin/platformRbac/index.d.ts +2 -0
- package/bin/platformRbac/index.js +2 -0
- package/bin/referral-business/dtos/AgentsByDirectoryIdsRequest.d.ts +4 -0
- package/bin/referral-business/dtos/AgentsByDirectoryIdsRequest.js +25 -0
- package/bin/referral-business/dtos/AgentsByDirectoryIdsResponse.d.ts +11 -0
- package/bin/referral-business/dtos/AgentsByDirectoryIdsResponse.js +2 -0
- package/bin/referral-business/index.d.ts +2 -0
- package/bin/referral-business/index.js +3 -0
- package/package.json +1 -1
- package/src/directory/dtos/DirectoryAgentsBySponsorRequest.ts +12 -0
- package/src/directory/dtos/DirectoryAgentsBySponsorResponse.ts +12 -0
- package/src/directory/index.ts +2 -0
- package/src/group/dtos/GroupMemberHubItem.ts +40 -0
- package/src/group/index.ts +1 -0
- package/src/platformRbac/dtos/TenantUsersBySubsRequest.ts +12 -0
- package/src/platformRbac/dtos/TenantUsersBySubsResponse.ts +12 -0
- package/src/platformRbac/index.ts +4 -0
- package/src/referral-business/dtos/AgentsByDirectoryIdsRequest.ts +12 -0
- package/src/referral-business/dtos/AgentsByDirectoryIdsResponse.ts +14 -0
- package/src/referral-business/index.ts +5 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validate } from 'class-validator';
|
|
4
|
+
import {
|
|
5
|
+
DirectoryAgentsBySponsorRequest,
|
|
6
|
+
DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH,
|
|
7
|
+
} from '../../../src/directory';
|
|
8
|
+
import type {
|
|
9
|
+
DirectoryAgentBySponsorItem,
|
|
10
|
+
DirectoryAgentsBySponsorResponse,
|
|
11
|
+
} from '../../../src/directory';
|
|
12
|
+
|
|
13
|
+
describe('DirectoryAgentsBySponsorRequest', () => {
|
|
14
|
+
it('el tope del lote es 100', () => {
|
|
15
|
+
expect(DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH).toBe(100);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('acepta una lista de ids', async () => {
|
|
19
|
+
const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: ['d1', 'd2'] });
|
|
20
|
+
expect(await validate(dto)).toEqual([]);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('acepta la lista vacía', async () => {
|
|
24
|
+
const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: [] });
|
|
25
|
+
expect(await validate(dto)).toEqual([]);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('acepta exactamente 100 ids', async () => {
|
|
29
|
+
const ids = Array.from({ length: 100 }, (_, i) => `d${i}`);
|
|
30
|
+
const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: ids });
|
|
31
|
+
expect(await validate(dto)).toEqual([]);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('rechaza 101 ids con la constraint arrayMaxSize', async () => {
|
|
35
|
+
const ids = Array.from({ length: 101 }, (_, i) => `d${i}`);
|
|
36
|
+
const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: ids });
|
|
37
|
+
const errors = await validate(dto);
|
|
38
|
+
expect(errors).toHaveLength(1);
|
|
39
|
+
expect(errors[0].property).toBe('sponsorDirectoryIds');
|
|
40
|
+
expect(errors[0].constraints?.arrayMaxSize).toBeDefined();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('rechaza si falta el campo', async () => {
|
|
44
|
+
const dto = plainToInstance(DirectoryAgentsBySponsorRequest, {});
|
|
45
|
+
const errors = await validate(dto);
|
|
46
|
+
expect(errors[0].constraints?.isArray).toBeDefined();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('rechaza un id que no es string', async () => {
|
|
50
|
+
const dto = plainToInstance(DirectoryAgentsBySponsorRequest, { sponsorDirectoryIds: ['d1', 7] });
|
|
51
|
+
const errors = await validate(dto);
|
|
52
|
+
expect(errors[0].constraints?.isString).toBeDefined();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe('DirectoryAgentsBySponsorResponse', () => {
|
|
57
|
+
it('es un mapa sponsorDirectoryId -> directorio AGENT', () => {
|
|
58
|
+
const item: DirectoryAgentBySponsorItem = {
|
|
59
|
+
id: 'agent-dir-1',
|
|
60
|
+
sponsorDirectoryId: 'd1',
|
|
61
|
+
identityId: null,
|
|
62
|
+
email: null,
|
|
63
|
+
status: 'ACTIVE',
|
|
64
|
+
updatedAt: null,
|
|
65
|
+
};
|
|
66
|
+
const response: DirectoryAgentsBySponsorResponse = { d1: item };
|
|
67
|
+
expect(response.d1.sponsorDirectoryId).toBe('d1');
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { GroupMemberHubItem } from '../../../src/group';
|
|
3
|
+
import { RelationStatus, RelationType } from '../../../src/group';
|
|
4
|
+
import { CPStatusEnum } from '../../../src/identity/enums/CPStatusEnum';
|
|
5
|
+
|
|
6
|
+
const [anyRelationType] = Object.values(RelationType) as RelationType[];
|
|
7
|
+
const [anyRelationStatus] = Object.values(RelationStatus) as RelationStatus[];
|
|
8
|
+
const [anyCpStatus] = Object.values(CPStatusEnum) as CPStatusEnum[];
|
|
9
|
+
|
|
10
|
+
describe('GroupMemberHubItem', () => {
|
|
11
|
+
it('un miembro que no es agente lleva las columnas de agente en null', () => {
|
|
12
|
+
const row: GroupMemberHubItem = {
|
|
13
|
+
PK: 'GROUP#g1',
|
|
14
|
+
SK: 'DIRECTORY#d1',
|
|
15
|
+
directoryId: 'd1',
|
|
16
|
+
groupId: 'g1',
|
|
17
|
+
relationType: anyRelationType,
|
|
18
|
+
status: anyRelationStatus,
|
|
19
|
+
agent: null,
|
|
20
|
+
createdAt: '2026-09-24T00:00:00.000Z',
|
|
21
|
+
updatedAt: '2026-09-24T00:00:00.000Z',
|
|
22
|
+
phoneNumber: null,
|
|
23
|
+
indexName: null,
|
|
24
|
+
peopleId: null,
|
|
25
|
+
referralCode: null,
|
|
26
|
+
myReferralCode: null,
|
|
27
|
+
CP_Status: null,
|
|
28
|
+
parentGroupId: null,
|
|
29
|
+
operationId: null,
|
|
30
|
+
referralDirectoryId: null,
|
|
31
|
+
promotedToDirectory: null,
|
|
32
|
+
isAgent: false,
|
|
33
|
+
agentId: null,
|
|
34
|
+
agentRole: null,
|
|
35
|
+
agentStatus: null,
|
|
36
|
+
position: null,
|
|
37
|
+
reportsToDirectoryId: null,
|
|
38
|
+
reportsToName: null,
|
|
39
|
+
agentDirectoryStatus: null,
|
|
40
|
+
loginEmail: null,
|
|
41
|
+
hasRbac: false,
|
|
42
|
+
rbacStatus: null,
|
|
43
|
+
};
|
|
44
|
+
expect(row.isAgent).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('hasRbac admite null cuando la fuente RBAC no respondió', () => {
|
|
48
|
+
const unknownRbac: GroupMemberHubItem['hasRbac'] = null;
|
|
49
|
+
expect(unknownRbac).toBeNull();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('un agente con RBAC llena las columnas nuevas', () => {
|
|
53
|
+
const row: GroupMemberHubItem = {
|
|
54
|
+
PK: 'GROUP#g1',
|
|
55
|
+
SK: 'DIRECTORY#d2',
|
|
56
|
+
directoryId: 'd2',
|
|
57
|
+
groupId: 'g1',
|
|
58
|
+
relationType: anyRelationType,
|
|
59
|
+
status: anyRelationStatus,
|
|
60
|
+
agent: 'agent-1',
|
|
61
|
+
createdAt: '2026-09-24T00:00:00.000Z',
|
|
62
|
+
updatedAt: '2026-09-24T00:00:00.000Z',
|
|
63
|
+
phoneNumber: '+525500000000',
|
|
64
|
+
indexName: 'ANA PEREZ',
|
|
65
|
+
peopleId: 'p2',
|
|
66
|
+
referralCode: 'SPONSOR1',
|
|
67
|
+
myReferralCode: 'MINE1',
|
|
68
|
+
CP_Status: anyCpStatus,
|
|
69
|
+
parentGroupId: null,
|
|
70
|
+
operationId: 'op-1',
|
|
71
|
+
referralDirectoryId: 'd9',
|
|
72
|
+
promotedToDirectory: false,
|
|
73
|
+
isAgent: true,
|
|
74
|
+
agentId: 'agent-1',
|
|
75
|
+
agentRole: 'AGENT',
|
|
76
|
+
agentStatus: 'ACTIVE',
|
|
77
|
+
position: 'Supervisora',
|
|
78
|
+
reportsToDirectoryId: 'd1',
|
|
79
|
+
reportsToName: 'JUAN LOPEZ',
|
|
80
|
+
agentDirectoryStatus: 'ACTIVE',
|
|
81
|
+
loginEmail: 'ana@somosfiado.com',
|
|
82
|
+
hasRbac: true,
|
|
83
|
+
rbacStatus: 'ACTIVE',
|
|
84
|
+
};
|
|
85
|
+
expect(row.rbacStatus).toBe('ACTIVE');
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validate } from 'class-validator';
|
|
4
|
+
import {
|
|
5
|
+
TenantUsersBySubsRequest,
|
|
6
|
+
TENANT_USERS_BY_SUBS_MAX_BATCH,
|
|
7
|
+
} from '../../../../src/platformRbac';
|
|
8
|
+
import type {
|
|
9
|
+
TenantUserBySubItem,
|
|
10
|
+
TenantUsersBySubsResponse,
|
|
11
|
+
} from '../../../../src/platformRbac';
|
|
12
|
+
|
|
13
|
+
describe('TenantUsersBySubsRequest', () => {
|
|
14
|
+
it('el tope del lote es 100', () => {
|
|
15
|
+
expect(TENANT_USERS_BY_SUBS_MAX_BATCH).toBe(100);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('acepta una lista de cognitoSubs', async () => {
|
|
19
|
+
const dto = plainToInstance(TenantUsersBySubsRequest, { cognitoSubs: ['sub-1', 'sub-2'] });
|
|
20
|
+
expect(await validate(dto)).toEqual([]);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('acepta la lista vacía', async () => {
|
|
24
|
+
const dto = plainToInstance(TenantUsersBySubsRequest, { cognitoSubs: [] });
|
|
25
|
+
expect(await validate(dto)).toEqual([]);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('rechaza 101 subs con la constraint arrayMaxSize', async () => {
|
|
29
|
+
const subs = Array.from({ length: 101 }, (_, i) => `sub-${i}`);
|
|
30
|
+
const dto = plainToInstance(TenantUsersBySubsRequest, { cognitoSubs: subs });
|
|
31
|
+
const errors = await validate(dto);
|
|
32
|
+
expect(errors).toHaveLength(1);
|
|
33
|
+
expect(errors[0].property).toBe('cognitoSubs');
|
|
34
|
+
expect(errors[0].constraints?.arrayMaxSize).toBeDefined();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('rechaza si falta el campo', async () => {
|
|
38
|
+
const dto = plainToInstance(TenantUsersBySubsRequest, {});
|
|
39
|
+
const errors = await validate(dto);
|
|
40
|
+
expect(errors[0].constraints?.isArray).toBeDefined();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('rechaza un sub que no es string', async () => {
|
|
44
|
+
const dto = plainToInstance(TenantUsersBySubsRequest, { cognitoSubs: [null] });
|
|
45
|
+
const errors = await validate(dto);
|
|
46
|
+
expect(errors[0].constraints?.isString).toBeDefined();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('TenantUsersBySubsResponse', () => {
|
|
51
|
+
it('es un mapa cognitoSub -> usuario, con email nullable', () => {
|
|
52
|
+
const item: TenantUserBySubItem = {
|
|
53
|
+
cognitoSub: 'sub-1',
|
|
54
|
+
email: null,
|
|
55
|
+
status: 'ACTIVE',
|
|
56
|
+
displayName: null,
|
|
57
|
+
};
|
|
58
|
+
const response: TenantUsersBySubsResponse = { 'sub-1': item };
|
|
59
|
+
expect(response['sub-1'].status).toBe('ACTIVE');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { plainToInstance } from 'class-transformer';
|
|
3
|
+
import { validate } from 'class-validator';
|
|
4
|
+
import {
|
|
5
|
+
AgentsByDirectoryIdsRequest,
|
|
6
|
+
AGENTS_BY_DIRECTORY_IDS_MAX_BATCH,
|
|
7
|
+
} from '../../../src/referral-business';
|
|
8
|
+
import type {
|
|
9
|
+
AgentByDirectoryIdItem,
|
|
10
|
+
AgentsByDirectoryIdsResponse,
|
|
11
|
+
} from '../../../src/referral-business';
|
|
12
|
+
|
|
13
|
+
describe('AgentsByDirectoryIdsRequest', () => {
|
|
14
|
+
it('el tope del lote es 100', () => {
|
|
15
|
+
expect(AGENTS_BY_DIRECTORY_IDS_MAX_BATCH).toBe(100);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('acepta una lista de ids', async () => {
|
|
19
|
+
const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: ['d1', 'd2'] });
|
|
20
|
+
expect(await validate(dto)).toEqual([]);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('acepta la lista vacía', async () => {
|
|
24
|
+
const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: [] });
|
|
25
|
+
expect(await validate(dto)).toEqual([]);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('rechaza 101 ids con la constraint arrayMaxSize', async () => {
|
|
29
|
+
const ids = Array.from({ length: 101 }, (_, i) => `d${i}`);
|
|
30
|
+
const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: ids });
|
|
31
|
+
const errors = await validate(dto);
|
|
32
|
+
expect(errors).toHaveLength(1);
|
|
33
|
+
expect(errors[0].property).toBe('directoryIds');
|
|
34
|
+
expect(errors[0].constraints?.arrayMaxSize).toBeDefined();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('rechaza si directoryIds no es arreglo', async () => {
|
|
38
|
+
const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: 'd1' });
|
|
39
|
+
const errors = await validate(dto);
|
|
40
|
+
expect(errors[0].constraints?.isArray).toBeDefined();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('rechaza un id que no es string', async () => {
|
|
44
|
+
const dto = plainToInstance(AgentsByDirectoryIdsRequest, { directoryIds: [1] });
|
|
45
|
+
const errors = await validate(dto);
|
|
46
|
+
expect(errors[0].constraints?.isString).toBeDefined();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('AgentsByDirectoryIdsResponse', () => {
|
|
51
|
+
it('es un mapa directoryId -> agente', () => {
|
|
52
|
+
const item: AgentByDirectoryIdItem = {
|
|
53
|
+
id: 'agent-1',
|
|
54
|
+
directoryId: 'd1',
|
|
55
|
+
groupId: null,
|
|
56
|
+
agentRole: 'AGENT',
|
|
57
|
+
notes: null,
|
|
58
|
+
parentDirectoryId: null,
|
|
59
|
+
status: 'ACTIVE',
|
|
60
|
+
updatedAt: 1727222400000,
|
|
61
|
+
};
|
|
62
|
+
const response: AgentsByDirectoryIdsResponse = { d1: item };
|
|
63
|
+
expect(response.d1.id).toBe('agent-1');
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DirectoryAgentsBySponsorRequest = exports.DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
// Tope de sponsorDirectoryIds por request del endpoint batch de directorios AGENT por sponsor.
|
|
15
|
+
exports.DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH = 100;
|
|
16
|
+
// Body de POST /directories/search/by-sponsor-directory-ids; la lista vacía es válida y responde {}.
|
|
17
|
+
class DirectoryAgentsBySponsorRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.DirectoryAgentsBySponsorRequest = DirectoryAgentsBySponsorRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsArray)(),
|
|
22
|
+
(0, class_validator_1.ArrayMaxSize)(exports.DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH),
|
|
23
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
24
|
+
__metadata("design:type", Array)
|
|
25
|
+
], DirectoryAgentsBySponsorRequest.prototype, "sponsorDirectoryIds", void 0);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface DirectoryAgentBySponsorItem {
|
|
2
|
+
id: string;
|
|
3
|
+
sponsorDirectoryId: string;
|
|
4
|
+
identityId: string | null;
|
|
5
|
+
email: string | null;
|
|
6
|
+
status: string;
|
|
7
|
+
updatedAt: number | null;
|
|
8
|
+
}
|
|
9
|
+
export type DirectoryAgentsBySponsorResponse = Record<string, DirectoryAgentBySponsorItem>;
|
package/bin/directory/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export * from './dtos/DirectoryBackofficeUpdateRequest';
|
|
|
6
6
|
export * from './dtos/CreateDirectoryUserEventRequest';
|
|
7
7
|
export * from './dtos/CreateDirectoryUserEventResponse';
|
|
8
8
|
export * from './dtos/DeleteByDirectoryResponse';
|
|
9
|
+
export * from './dtos/DirectoryAgentsBySponsorRequest';
|
|
10
|
+
export * from './dtos/DirectoryAgentsBySponsorResponse';
|
|
9
11
|
export * from './dtos/External';
|
|
10
12
|
export * from './enums/TypeOfDirectoryId';
|
|
11
13
|
export * from './enums/DirectoryBackofficeStatusEnum';
|
package/bin/directory/index.js
CHANGED
|
@@ -23,6 +23,8 @@ __exportStar(require("./dtos/DirectoryBackofficeUpdateRequest"), exports);
|
|
|
23
23
|
__exportStar(require("./dtos/CreateDirectoryUserEventRequest"), exports);
|
|
24
24
|
__exportStar(require("./dtos/CreateDirectoryUserEventResponse"), exports);
|
|
25
25
|
__exportStar(require("./dtos/DeleteByDirectoryResponse"), exports);
|
|
26
|
+
__exportStar(require("./dtos/DirectoryAgentsBySponsorRequest"), exports);
|
|
27
|
+
__exportStar(require("./dtos/DirectoryAgentsBySponsorResponse"), exports);
|
|
26
28
|
__exportStar(require("./dtos/External"), exports);
|
|
27
29
|
//enums
|
|
28
30
|
__exportStar(require("./enums/TypeOfDirectoryId"), exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { RelationStatus } from "../enums/RelationStatus";
|
|
2
|
+
import { RelationType } from "../enums/RelationType";
|
|
3
|
+
import { CPStatusEnum } from "../../identity/enums/CPStatusEnum";
|
|
4
|
+
import type { TenantUserStatusValue } from "../../platformRbac/dtos/TenantUserResponse";
|
|
5
|
+
export interface GroupMemberHubItem {
|
|
6
|
+
PK: string;
|
|
7
|
+
SK: string;
|
|
8
|
+
directoryId: string;
|
|
9
|
+
groupId: string;
|
|
10
|
+
relationType: RelationType;
|
|
11
|
+
status: RelationStatus;
|
|
12
|
+
agent: string | null;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
phoneNumber: string | null;
|
|
16
|
+
indexName: string | null;
|
|
17
|
+
peopleId: string | null;
|
|
18
|
+
referralCode: string | null;
|
|
19
|
+
myReferralCode: string | null;
|
|
20
|
+
CP_Status: CPStatusEnum | null;
|
|
21
|
+
parentGroupId: string | null;
|
|
22
|
+
operationId: string | null;
|
|
23
|
+
referralDirectoryId: string | null;
|
|
24
|
+
promotedToDirectory: boolean | null;
|
|
25
|
+
isAgent: boolean;
|
|
26
|
+
agentId: string | null;
|
|
27
|
+
agentRole: string | null;
|
|
28
|
+
agentStatus: string | null;
|
|
29
|
+
position: string | null;
|
|
30
|
+
reportsToDirectoryId: string | null;
|
|
31
|
+
reportsToName: string | null;
|
|
32
|
+
agentDirectoryStatus: string | null;
|
|
33
|
+
loginEmail: string | null;
|
|
34
|
+
hasRbac: boolean | null;
|
|
35
|
+
rbacStatus: TenantUserStatusValue | null;
|
|
36
|
+
}
|
package/bin/group/index.d.ts
CHANGED
package/bin/group/index.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TenantUsersBySubsRequest = exports.TENANT_USERS_BY_SUBS_MAX_BATCH = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
// Tope de cognitoSubs por request del endpoint batch de usuarios del tenant.
|
|
15
|
+
exports.TENANT_USERS_BY_SUBS_MAX_BATCH = 100;
|
|
16
|
+
// Body de POST /internal/tenants/{tenantId}/users/by-subs; la lista vacía es válida y responde {}.
|
|
17
|
+
class TenantUsersBySubsRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.TenantUsersBySubsRequest = TenantUsersBySubsRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsArray)(),
|
|
22
|
+
(0, class_validator_1.ArrayMaxSize)(exports.TENANT_USERS_BY_SUBS_MAX_BATCH),
|
|
23
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
24
|
+
__metadata("design:type", Array)
|
|
25
|
+
], TenantUsersBySubsRequest.prototype, "cognitoSubs", void 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TenantUserStatusValue } from './TenantUserResponse';
|
|
2
|
+
export interface TenantUserBySubItem {
|
|
3
|
+
cognitoSub: string;
|
|
4
|
+
email: string | null;
|
|
5
|
+
status: TenantUserStatusValue;
|
|
6
|
+
displayName: string | null;
|
|
7
|
+
}
|
|
8
|
+
export type TenantUsersBySubsResponse = Record<string, TenantUserBySubItem>;
|
|
@@ -84,3 +84,5 @@ export * from './dtos/AssignTenantRoleRequest';
|
|
|
84
84
|
export type { AssignTenantRoleResponse } from './dtos/AssignTenantRoleResponse';
|
|
85
85
|
export * from './dtos/RevokeTenantRoleRequest';
|
|
86
86
|
export type { RevokeTenantRoleResponse } from './dtos/RevokeTenantRoleResponse';
|
|
87
|
+
export * from './dtos/TenantUsersBySubsRequest';
|
|
88
|
+
export type { TenantUserBySubItem, TenantUsersBySubsResponse } from './dtos/TenantUsersBySubsResponse';
|
|
@@ -125,3 +125,5 @@ __exportStar(require("./dtos/ResetTenantUserPasswordRequest"), exports);
|
|
|
125
125
|
__exportStar(require("./dtos/ResetTenantUserMfaRequest"), exports);
|
|
126
126
|
__exportStar(require("./dtos/AssignTenantRoleRequest"), exports);
|
|
127
127
|
__exportStar(require("./dtos/RevokeTenantRoleRequest"), exports);
|
|
128
|
+
// Batch privado de usuarios del tenant por cognitoSub (hub de miembros de group-business).
|
|
129
|
+
__exportStar(require("./dtos/TenantUsersBySubsRequest"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentsByDirectoryIdsRequest = exports.AGENTS_BY_DIRECTORY_IDS_MAX_BATCH = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
// Tope de directoryIds por request del endpoint batch de agentes por directorio.
|
|
15
|
+
exports.AGENTS_BY_DIRECTORY_IDS_MAX_BATCH = 100;
|
|
16
|
+
// Body de POST /private/agents/by-directory-ids; la lista vacía es válida y responde {}.
|
|
17
|
+
class AgentsByDirectoryIdsRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.AgentsByDirectoryIdsRequest = AgentsByDirectoryIdsRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsArray)(),
|
|
22
|
+
(0, class_validator_1.ArrayMaxSize)(exports.AGENTS_BY_DIRECTORY_IDS_MAX_BATCH),
|
|
23
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
24
|
+
__metadata("design:type", Array)
|
|
25
|
+
], AgentsByDirectoryIdsRequest.prototype, "directoryIds", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AgentByDirectoryIdItem {
|
|
2
|
+
id: string;
|
|
3
|
+
directoryId: string;
|
|
4
|
+
groupId: string | null;
|
|
5
|
+
agentRole: string | null;
|
|
6
|
+
notes: string | null;
|
|
7
|
+
parentDirectoryId: string | null;
|
|
8
|
+
status: string;
|
|
9
|
+
updatedAt: number | null;
|
|
10
|
+
}
|
|
11
|
+
export type AgentsByDirectoryIdsResponse = Record<string, AgentByDirectoryIdItem>;
|
|
@@ -16,3 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
//Enums
|
|
18
18
|
__exportStar(require("./enums/AgentRoleEnum"), exports);
|
|
19
|
+
//dtos
|
|
20
|
+
__exportStar(require("./dtos/AgentsByDirectoryIdsRequest"), exports);
|
|
21
|
+
__exportStar(require("./dtos/AgentsByDirectoryIdsResponse"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ArrayMaxSize, IsArray, IsString } from "class-validator";
|
|
2
|
+
|
|
3
|
+
// Tope de sponsorDirectoryIds por request del endpoint batch de directorios AGENT por sponsor.
|
|
4
|
+
export const DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH = 100;
|
|
5
|
+
|
|
6
|
+
// Body de POST /directories/search/by-sponsor-directory-ids; la lista vacía es válida y responde {}.
|
|
7
|
+
export class DirectoryAgentsBySponsorRequest {
|
|
8
|
+
@IsArray()
|
|
9
|
+
@ArrayMaxSize(DIRECTORY_AGENTS_BY_SPONSOR_MAX_BATCH)
|
|
10
|
+
@IsString({ each: true })
|
|
11
|
+
sponsorDirectoryIds!: string[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Directorio AGENT ganador de un sponsor: excluye DELETE, ACTIVE gana y luego el updatedAt más reciente.
|
|
2
|
+
export interface DirectoryAgentBySponsorItem {
|
|
3
|
+
id: string;
|
|
4
|
+
sponsorDirectoryId: string;
|
|
5
|
+
identityId: string | null;
|
|
6
|
+
email: string | null;
|
|
7
|
+
status: string;
|
|
8
|
+
updatedAt: number | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Respuesta de POST /directories/search/by-sponsor-directory-ids; un sponsor sin agente no aparece.
|
|
12
|
+
export type DirectoryAgentsBySponsorResponse = Record<string, DirectoryAgentBySponsorItem>;
|
package/src/directory/index.ts
CHANGED
|
@@ -8,6 +8,8 @@ export * from './dtos/DirectoryBackofficeUpdateRequest';
|
|
|
8
8
|
export * from './dtos/CreateDirectoryUserEventRequest';
|
|
9
9
|
export * from './dtos/CreateDirectoryUserEventResponse';
|
|
10
10
|
export * from './dtos/DeleteByDirectoryResponse';
|
|
11
|
+
export * from './dtos/DirectoryAgentsBySponsorRequest';
|
|
12
|
+
export * from './dtos/DirectoryAgentsBySponsorResponse';
|
|
11
13
|
|
|
12
14
|
export * from './dtos/External';
|
|
13
15
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RelationStatus } from "../enums/RelationStatus";
|
|
2
|
+
import { RelationType } from "../enums/RelationType";
|
|
3
|
+
import { CPStatusEnum } from "../../identity/enums/CPStatusEnum";
|
|
4
|
+
import type { TenantUserStatusValue } from "../../platformRbac/dtos/TenantUserResponse";
|
|
5
|
+
|
|
6
|
+
// Fila de GET /backoffice/members por groupIds: membresía + directorio, people, onboarding, agente y RBAC.
|
|
7
|
+
// Las columnas de una fuente que falló o no aplica salen en null (enriquecimiento best-effort).
|
|
8
|
+
export interface GroupMemberHubItem {
|
|
9
|
+
PK: string;
|
|
10
|
+
SK: string;
|
|
11
|
+
directoryId: string;
|
|
12
|
+
groupId: string;
|
|
13
|
+
relationType: RelationType;
|
|
14
|
+
status: RelationStatus;
|
|
15
|
+
agent: string | null;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
phoneNumber: string | null;
|
|
19
|
+
indexName: string | null;
|
|
20
|
+
peopleId: string | null;
|
|
21
|
+
referralCode: string | null;
|
|
22
|
+
myReferralCode: string | null;
|
|
23
|
+
CP_Status: CPStatusEnum | null;
|
|
24
|
+
parentGroupId: string | null;
|
|
25
|
+
operationId: string | null;
|
|
26
|
+
referralDirectoryId: string | null;
|
|
27
|
+
promotedToDirectory: boolean | null;
|
|
28
|
+
isAgent: boolean;
|
|
29
|
+
agentId: string | null;
|
|
30
|
+
agentRole: string | null;
|
|
31
|
+
agentStatus: string | null;
|
|
32
|
+
position: string | null;
|
|
33
|
+
reportsToDirectoryId: string | null;
|
|
34
|
+
reportsToName: string | null;
|
|
35
|
+
agentDirectoryStatus: string | null;
|
|
36
|
+
loginEmail: string | null;
|
|
37
|
+
// null = la fuente RBAC o la de directorios AGENT falló; false = respondió y no hay usuario.
|
|
38
|
+
hasRbac: boolean | null;
|
|
39
|
+
rbacStatus: TenantUserStatusValue | null;
|
|
40
|
+
}
|
package/src/group/index.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ArrayMaxSize, IsArray, IsString } from "class-validator";
|
|
2
|
+
|
|
3
|
+
// Tope de cognitoSubs por request del endpoint batch de usuarios del tenant.
|
|
4
|
+
export const TENANT_USERS_BY_SUBS_MAX_BATCH = 100;
|
|
5
|
+
|
|
6
|
+
// Body de POST /internal/tenants/{tenantId}/users/by-subs; la lista vacía es válida y responde {}.
|
|
7
|
+
export class TenantUsersBySubsRequest {
|
|
8
|
+
@IsArray()
|
|
9
|
+
@ArrayMaxSize(TENANT_USERS_BY_SUBS_MAX_BATCH)
|
|
10
|
+
@IsString({ each: true })
|
|
11
|
+
cognitoSubs!: string[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TenantUserStatusValue } from './TenantUserResponse';
|
|
2
|
+
|
|
3
|
+
// Usuario del tenant (SharedUser) sin roles; email nulo en tenants phone-primary sin correo.
|
|
4
|
+
export interface TenantUserBySubItem {
|
|
5
|
+
cognitoSub: string;
|
|
6
|
+
email: string | null;
|
|
7
|
+
status: TenantUserStatusValue;
|
|
8
|
+
displayName: string | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Respuesta de POST /internal/tenants/{tenantId}/users/by-subs; un sub inexistente o de otro tenant no aparece.
|
|
12
|
+
export type TenantUsersBySubsResponse = Record<string, TenantUserBySubItem>;
|
|
@@ -178,3 +178,7 @@ export * from './dtos/AssignTenantRoleRequest';
|
|
|
178
178
|
export type { AssignTenantRoleResponse } from './dtos/AssignTenantRoleResponse';
|
|
179
179
|
export * from './dtos/RevokeTenantRoleRequest';
|
|
180
180
|
export type { RevokeTenantRoleResponse } from './dtos/RevokeTenantRoleResponse';
|
|
181
|
+
|
|
182
|
+
// Batch privado de usuarios del tenant por cognitoSub (hub de miembros de group-business).
|
|
183
|
+
export * from './dtos/TenantUsersBySubsRequest';
|
|
184
|
+
export type { TenantUserBySubItem, TenantUsersBySubsResponse } from './dtos/TenantUsersBySubsResponse';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ArrayMaxSize, IsArray, IsString } from "class-validator";
|
|
2
|
+
|
|
3
|
+
// Tope de directoryIds por request del endpoint batch de agentes por directorio.
|
|
4
|
+
export const AGENTS_BY_DIRECTORY_IDS_MAX_BATCH = 100;
|
|
5
|
+
|
|
6
|
+
// Body de POST /private/agents/by-directory-ids; la lista vacía es válida y responde {}.
|
|
7
|
+
export class AgentsByDirectoryIdsRequest {
|
|
8
|
+
@IsArray()
|
|
9
|
+
@ArrayMaxSize(AGENTS_BY_DIRECTORY_IDS_MAX_BATCH)
|
|
10
|
+
@IsString({ each: true })
|
|
11
|
+
directoryIds!: string[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Fila ganadora de Agents_GT de un directorio: excluye DELETE, ACTIVE gana y luego el updatedAt más reciente.
|
|
2
|
+
export interface AgentByDirectoryIdItem {
|
|
3
|
+
id: string;
|
|
4
|
+
directoryId: string;
|
|
5
|
+
groupId: string | null;
|
|
6
|
+
agentRole: string | null;
|
|
7
|
+
notes: string | null;
|
|
8
|
+
parentDirectoryId: string | null;
|
|
9
|
+
status: string;
|
|
10
|
+
updatedAt: number | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Respuesta de POST /private/agents/by-directory-ids; un directorio sin agente no aparece.
|
|
14
|
+
export type AgentsByDirectoryIdsResponse = Record<string, AgentByDirectoryIdItem>;
|