@fiado/type-kit 3.591.0 → 3.592.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.
@@ -0,0 +1,16 @@
1
+ import { CountryId } from "../../country/enums/CountryId";
2
+ export declare const DIRECTORY_EVENTS_SOURCE = "fiado.directory";
3
+ export declare enum DirectoryEventDetailTypeEnum {
4
+ /** Alta real del scope de un país (fiado.mx o fiado.us) en el directorio: la cuenta de ese lado quedó abierta. */
5
+ ACCOUNT_CREATED = "AccountCreated"
6
+ }
7
+ export declare class AccountCreatedEventDetail {
8
+ /** Fijo por directorio y país (`<countryId>#<directoryId>`): un reenvío llega con el mismo id y el consumidor lo descarta. */
9
+ eventId: string;
10
+ directoryId: string;
11
+ peopleId: string;
12
+ /** CountryId.MEX (484) o CountryId.USA (840). */
13
+ countryId: CountryId;
14
+ /** ISO 8601 del momento en que se guardó el scope. */
15
+ occurredAt: string;
16
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountCreatedEventDetail = exports.DirectoryEventDetailTypeEnum = exports.DIRECTORY_EVENTS_SOURCE = void 0;
4
+ // Origen de los eventos de EventBridge que publica directory-business.
5
+ exports.DIRECTORY_EVENTS_SOURCE = "fiado.directory";
6
+ var DirectoryEventDetailTypeEnum;
7
+ (function (DirectoryEventDetailTypeEnum) {
8
+ /** Alta real del scope de un país (fiado.mx o fiado.us) en el directorio: la cuenta de ese lado quedó abierta. */
9
+ DirectoryEventDetailTypeEnum["ACCOUNT_CREATED"] = "AccountCreated";
10
+ })(DirectoryEventDetailTypeEnum || (exports.DirectoryEventDetailTypeEnum = DirectoryEventDetailTypeEnum = {}));
11
+ // `detail` del evento AccountCreated. Sale uno por país dado de alta.
12
+ class AccountCreatedEventDetail {
13
+ }
14
+ exports.AccountCreatedEventDetail = AccountCreatedEventDetail;
@@ -0,0 +1,5 @@
1
+ export declare class DirectoryUserScopeUpdateRequest {
2
+ directoryId: string;
3
+ scope: string[];
4
+ app?: string | null;
5
+ }
@@ -0,0 +1,34 @@
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.DirectoryUserScopeUpdateRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ // Body de POST /directories/users/scope (directory-business), sucesor de updateScope de fiado-directory-lambda.
15
+ // `scope` es el arreglo COMPLETO que queda guardado, no un delta. Se valida como string y no contra el enum
16
+ // Scope porque los llamadores reenvían el arreglo que ya tenía el directorio, como en v1.
17
+ class DirectoryUserScopeUpdateRequest {
18
+ }
19
+ exports.DirectoryUserScopeUpdateRequest = DirectoryUserScopeUpdateRequest;
20
+ __decorate([
21
+ (0, class_validator_1.IsString)(),
22
+ (0, class_validator_1.IsNotEmpty)(),
23
+ __metadata("design:type", String)
24
+ ], DirectoryUserScopeUpdateRequest.prototype, "directoryId", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsArray)(),
27
+ (0, class_validator_1.IsString)({ each: true }),
28
+ __metadata("design:type", Array)
29
+ ], DirectoryUserScopeUpdateRequest.prototype, "scope", void 0);
30
+ __decorate([
31
+ (0, class_validator_1.IsOptional)(),
32
+ (0, class_validator_1.IsString)(),
33
+ __metadata("design:type", String)
34
+ ], DirectoryUserScopeUpdateRequest.prototype, "app", void 0);
@@ -8,6 +8,8 @@ export * from './dtos/CreateDirectoryUserEventResponse';
8
8
  export * from './dtos/DeleteByDirectoryResponse';
9
9
  export * from './dtos/DirectoryAgentsBySponsorRequest';
10
10
  export * from './dtos/DirectoryAgentsBySponsorResponse';
11
+ export * from './dtos/DirectoryUserScopeUpdateRequest';
12
+ export * from './dtos/AccountCreatedEventDetail';
11
13
  export * from './dtos/External';
12
14
  export * from './enums/TypeOfDirectoryId';
13
15
  export * from './enums/DirectoryBackofficeStatusEnum';
@@ -25,6 +25,8 @@ __exportStar(require("./dtos/CreateDirectoryUserEventResponse"), exports);
25
25
  __exportStar(require("./dtos/DeleteByDirectoryResponse"), exports);
26
26
  __exportStar(require("./dtos/DirectoryAgentsBySponsorRequest"), exports);
27
27
  __exportStar(require("./dtos/DirectoryAgentsBySponsorResponse"), exports);
28
+ __exportStar(require("./dtos/DirectoryUserScopeUpdateRequest"), exports);
29
+ __exportStar(require("./dtos/AccountCreatedEventDetail"), exports);
28
30
  __exportStar(require("./dtos/External"), exports);
29
31
  //enums
30
32
  __exportStar(require("./enums/TypeOfDirectoryId"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.591.0",
3
+ "version": "3.592.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,21 @@
1
+ import { CountryId } from "../../country/enums/CountryId";
2
+
3
+ // Origen de los eventos de EventBridge que publica directory-business.
4
+ export const DIRECTORY_EVENTS_SOURCE = "fiado.directory";
5
+
6
+ export enum DirectoryEventDetailTypeEnum {
7
+ /** Alta real del scope de un país (fiado.mx o fiado.us) en el directorio: la cuenta de ese lado quedó abierta. */
8
+ ACCOUNT_CREATED = "AccountCreated",
9
+ }
10
+
11
+ // `detail` del evento AccountCreated. Sale uno por país dado de alta.
12
+ export class AccountCreatedEventDetail {
13
+ /** Fijo por directorio y país (`<countryId>#<directoryId>`): un reenvío llega con el mismo id y el consumidor lo descarta. */
14
+ eventId!: string;
15
+ directoryId!: string;
16
+ peopleId!: string;
17
+ /** CountryId.MEX (484) o CountryId.USA (840). */
18
+ countryId!: CountryId;
19
+ /** ISO 8601 del momento en que se guardó el scope. */
20
+ occurredAt!: string;
21
+ }
@@ -0,0 +1,19 @@
1
+ import { IsArray, IsNotEmpty, IsOptional, IsString } from "class-validator";
2
+
3
+ // Body de POST /directories/users/scope (directory-business), sucesor de updateScope de fiado-directory-lambda.
4
+ // `scope` es el arreglo COMPLETO que queda guardado, no un delta. Se valida como string y no contra el enum
5
+ // Scope porque los llamadores reenvían el arreglo que ya tenía el directorio, como en v1.
6
+ export class DirectoryUserScopeUpdateRequest {
7
+ @IsString()
8
+ @IsNotEmpty()
9
+ directoryId!: string;
10
+
11
+ @IsArray()
12
+ @IsString({ each: true })
13
+ scope!: string[];
14
+
15
+ // App de origen tomada del token por quien llama; decide si se puede pedir el lado americano.
16
+ @IsOptional()
17
+ @IsString()
18
+ app?: string | null;
19
+ }
@@ -10,6 +10,8 @@ export * from './dtos/CreateDirectoryUserEventResponse';
10
10
  export * from './dtos/DeleteByDirectoryResponse';
11
11
  export * from './dtos/DirectoryAgentsBySponsorRequest';
12
12
  export * from './dtos/DirectoryAgentsBySponsorResponse';
13
+ export * from './dtos/DirectoryUserScopeUpdateRequest';
14
+ export * from './dtos/AccountCreatedEventDetail';
13
15
 
14
16
  export * from './dtos/External';
15
17