@fiado/api-invoker 4.68.0 → 4.71.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.
Files changed (118) hide show
  1. package/bin/activity-business/ActivityApi.d.ts +5 -0
  2. package/bin/activity-business/ActivityApi.js +4 -0
  3. package/bin/activity-business/interfaces/IActivityApi.d.ts +10 -0
  4. package/bin/address/AddressApi.d.ts +5 -0
  5. package/bin/address/AddressApi.js +4 -0
  6. package/bin/address/interfaces/IAddressApi.d.ts +10 -0
  7. package/bin/auth-business/AuthBusinessApi.d.ts +12 -0
  8. package/bin/auth-business/AuthBusinessApi.js +32 -0
  9. package/bin/auth-business/index.d.ts +2 -0
  10. package/bin/auth-business/index.js +2 -0
  11. package/bin/auth-business/interfaces/IAuthBusinessApi.d.ts +15 -0
  12. package/bin/auth-business/interfaces/IAuthBusinessApi.js +1 -0
  13. package/bin/bankAccount/BankAccountApi.d.ts +3 -0
  14. package/bin/bankAccount/BankAccountApi.js +4 -0
  15. package/bin/bankAccount/interfaces/IBankAccountApi.d.ts +10 -0
  16. package/bin/beneficiary/BeneficiaryApi.d.ts +12 -0
  17. package/bin/beneficiary/BeneficiaryApi.js +32 -0
  18. package/bin/beneficiary/index.d.ts +2 -0
  19. package/bin/beneficiary/index.js +2 -0
  20. package/bin/beneficiary/interfaces/IBeneficiaryApi.d.ts +15 -0
  21. package/bin/beneficiary/interfaces/IBeneficiaryApi.js +1 -0
  22. package/bin/contactInformation/ContactInformationApi.d.ts +5 -0
  23. package/bin/contactInformation/ContactInformationApi.js +4 -0
  24. package/bin/contactInformation/interface/IContactInformationApi.d.ts +10 -0
  25. package/bin/container.config.js +15 -0
  26. package/bin/directorySetting/DirectorySettingApi.d.ts +3 -0
  27. package/bin/directorySetting/DirectorySettingApi.js +4 -0
  28. package/bin/directorySetting/interfaces/IDirectorySettingApi.d.ts +8 -0
  29. package/bin/group/GroupApi.d.ts +3 -0
  30. package/bin/group/GroupApi.js +4 -0
  31. package/bin/group/interfaces/IGroupApi.d.ts +8 -0
  32. package/bin/index.d.ts +8 -0
  33. package/bin/index.js +8 -0
  34. package/bin/membership/MembershipApi.d.ts +12 -0
  35. package/bin/membership/MembershipApi.js +32 -0
  36. package/bin/membership/index.d.ts +2 -0
  37. package/bin/membership/index.js +2 -0
  38. package/bin/membership/interfaces/IMembershipApi.d.ts +15 -0
  39. package/bin/membership/interfaces/IMembershipApi.js +1 -0
  40. package/bin/notificationWebsockets/NotificationWebsocketApi.d.ts +12 -0
  41. package/bin/notificationWebsockets/NotificationWebsocketApi.js +32 -0
  42. package/bin/notificationWebsockets/index.d.ts +2 -0
  43. package/bin/notificationWebsockets/index.js +2 -0
  44. package/bin/notificationWebsockets/interfaces/INotificationWebsocketApi.d.ts +15 -0
  45. package/bin/notificationWebsockets/interfaces/INotificationWebsocketApi.js +1 -0
  46. package/bin/performance-profile/PerformanceProfileApi.d.ts +12 -0
  47. package/bin/performance-profile/PerformanceProfileApi.js +32 -0
  48. package/bin/performance-profile/index.d.ts +2 -0
  49. package/bin/performance-profile/index.js +2 -0
  50. package/bin/performance-profile/interfaces/IPerformanceProfileApi.d.ts +15 -0
  51. package/bin/performance-profile/interfaces/IPerformanceProfileApi.js +1 -0
  52. package/bin/places-business/api/PlacesBusinessApi.d.ts +12 -0
  53. package/bin/places-business/api/PlacesBusinessApi.js +32 -0
  54. package/bin/places-business/api/interfaces/IPlacesBusinessApi.d.ts +9 -0
  55. package/bin/places-business/api/interfaces/IPlacesBusinessApi.js +1 -0
  56. package/bin/places-business/index.d.ts +2 -0
  57. package/bin/places-business/index.js +2 -0
  58. package/bin/presence-websocket/PresenceWebsocketApi.d.ts +12 -0
  59. package/bin/presence-websocket/PresenceWebsocketApi.js +32 -0
  60. package/bin/presence-websocket/index.d.ts +2 -0
  61. package/bin/presence-websocket/index.js +2 -0
  62. package/bin/presence-websocket/interfaces/IPresenceWebsocketApi.d.ts +15 -0
  63. package/bin/presence-websocket/interfaces/IPresenceWebsocketApi.js +1 -0
  64. package/bin/retailCustomer/api/RetailCustomerBusinessApi.d.ts +27 -0
  65. package/bin/retailCustomer/api/RetailCustomerBusinessApi.js +56 -0
  66. package/bin/retailCustomer/api/interfaces/IRetailCustomerBusinessApi.d.ts +76 -0
  67. package/bin/retailCustomer/api/interfaces/IRetailCustomerBusinessApi.js +1 -0
  68. package/bin/retailCustomer/index.d.ts +2 -0
  69. package/bin/retailCustomer/index.js +2 -0
  70. package/bin/riskProfile/api/RiskProfileApi.d.ts +4 -0
  71. package/bin/riskProfile/api/RiskProfileApi.js +4 -0
  72. package/bin/riskProfile/api/interfaces/IRiskProfileApi.d.ts +9 -0
  73. package/bin/zendesk/ZendeskApi.d.ts +3 -0
  74. package/bin/zendesk/ZendeskApi.js +4 -0
  75. package/bin/zendesk/interfaces/IZendeskApi.d.ts +8 -0
  76. package/package.json +2 -2
  77. package/src/activity-business/ActivityApi.ts +6 -0
  78. package/src/activity-business/interfaces/IActivityApi.ts +9 -1
  79. package/src/address/AddressApi.ts +6 -0
  80. package/src/address/interfaces/IAddressApi.ts +10 -1
  81. package/src/auth-business/AuthBusinessApi.ts +20 -0
  82. package/src/auth-business/index.ts +2 -0
  83. package/src/auth-business/interfaces/IAuthBusinessApi.ts +15 -0
  84. package/src/bankAccount/BankAccountApi.ts +5 -0
  85. package/src/bankAccount/interfaces/IBankAccountApi.ts +10 -0
  86. package/src/beneficiary/BeneficiaryApi.ts +20 -0
  87. package/src/beneficiary/index.ts +2 -0
  88. package/src/beneficiary/interfaces/IBeneficiaryApi.ts +15 -0
  89. package/src/contactInformation/ContactInformationApi.ts +6 -0
  90. package/src/contactInformation/interface/IContactInformationApi.ts +10 -1
  91. package/src/container.config.ts +17 -0
  92. package/src/directorySetting/DirectorySettingApi.ts +5 -0
  93. package/src/directorySetting/interfaces/IDirectorySettingApi.ts +8 -1
  94. package/src/group/GroupApi.ts +5 -0
  95. package/src/group/interfaces/IGroupApi.ts +8 -0
  96. package/src/index.ts +8 -0
  97. package/src/membership/MembershipApi.ts +20 -0
  98. package/src/membership/index.ts +2 -0
  99. package/src/membership/interfaces/IMembershipApi.ts +15 -0
  100. package/src/notificationWebsockets/NotificationWebsocketApi.ts +20 -0
  101. package/src/notificationWebsockets/index.ts +3 -1
  102. package/src/notificationWebsockets/interfaces/INotificationWebsocketApi.ts +15 -0
  103. package/src/performance-profile/PerformanceProfileApi.ts +20 -0
  104. package/src/performance-profile/index.ts +2 -0
  105. package/src/performance-profile/interfaces/IPerformanceProfileApi.ts +15 -0
  106. package/src/places-business/api/PlacesBusinessApi.ts +22 -0
  107. package/src/places-business/api/interfaces/IPlacesBusinessApi.ts +9 -0
  108. package/src/places-business/index.ts +2 -0
  109. package/src/presence-websocket/PresenceWebsocketApi.ts +20 -0
  110. package/src/presence-websocket/index.ts +2 -0
  111. package/src/presence-websocket/interfaces/IPresenceWebsocketApi.ts +15 -0
  112. package/src/retailCustomer/api/RetailCustomerBusinessApi.ts +63 -0
  113. package/src/retailCustomer/api/interfaces/IRetailCustomerBusinessApi.ts +97 -0
  114. package/src/retailCustomer/index.ts +2 -0
  115. package/src/riskProfile/api/RiskProfileApi.ts +6 -0
  116. package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +9 -0
  117. package/src/zendesk/ZendeskApi.ts +5 -0
  118. package/src/zendesk/interfaces/IZendeskApi.ts +8 -0
@@ -1,2 +1,4 @@
1
1
  export * from './queue/NotificationWSMessagePublisher.js';
2
2
  export * from './queue/interfaces/INotificationWSMessagesPublisher.js';
3
+ export * from './interfaces/INotificationWebsocketApi.js';
4
+ export * from './NotificationWebsocketApi.js';
@@ -1,2 +1,4 @@
1
1
  export * from './queue/NotificationWSMessagePublisher.js';
2
2
  export * from './queue/interfaces/INotificationWSMessagesPublisher.js';
3
+ export * from './interfaces/INotificationWebsocketApi.js';
4
+ export * from './NotificationWebsocketApi.js';
@@ -0,0 +1,15 @@
1
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
2
+ /**
3
+ * Interfaz para el servicio Notifications Websocket (notifications-websocket).
4
+ */
5
+ export interface INotificationWebsocketApi {
6
+ /**
7
+ * Borra en cascada las conexiones/notificaciones WS asociadas a un directoryId.
8
+ * @param directoryId ID del directorio.
9
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
10
+ */
11
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
12
+ deletedCount: number;
13
+ }>>;
14
+ }
15
+ export {};
@@ -0,0 +1,12 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IPerformanceProfileApi } from "./interfaces/IPerformanceProfileApi.js";
3
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
4
+ export declare class PerformanceProfileApi implements IPerformanceProfileApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
9
+ deletedCount: number;
10
+ }>>;
11
+ }
12
+ export {};
@@ -0,0 +1,32 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { inject, injectable } from "inversify";
14
+ import dotenv from 'dotenv';
15
+ dotenv.config();
16
+ let PerformanceProfileApi = class PerformanceProfileApi {
17
+ httpRequest;
18
+ baseUrl = process.env.PERFORMANCE_PROFILE_BUSINESS_LAMBDA_URL || "";
19
+ constructor(httpRequest) {
20
+ this.httpRequest = httpRequest;
21
+ }
22
+ async deleteByDirectoryId(directoryId) {
23
+ const url = `${this.baseUrl}private/directory/${directoryId}`;
24
+ return await this.httpRequest.delete(url);
25
+ }
26
+ };
27
+ PerformanceProfileApi = __decorate([
28
+ injectable(),
29
+ __param(0, inject("IHttpRequest")),
30
+ __metadata("design:paramtypes", [Object])
31
+ ], PerformanceProfileApi);
32
+ export { PerformanceProfileApi };
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IPerformanceProfileApi.js';
2
+ export * from './PerformanceProfileApi.js';
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IPerformanceProfileApi.js';
2
+ export * from './PerformanceProfileApi.js';
@@ -0,0 +1,15 @@
1
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
2
+ /**
3
+ * Interfaz para el servicio Performance Profile (performance-profile-business).
4
+ */
5
+ export interface IPerformanceProfileApi {
6
+ /**
7
+ * Borra en cascada los perfiles de desempeño asociados a un directoryId.
8
+ * @param directoryId ID del directorio.
9
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
10
+ */
11
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
12
+ deletedCount: number;
13
+ }>>;
14
+ }
15
+ export {};
@@ -0,0 +1,12 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { SearchAddressRequest, SearchAddressResponse, ReverseGeocodeRequest, ReverseGeocodeResponse } from "@fiado/type-kit/bin/places/index.js";
3
+ import { IPlacesBusinessApi } from "./interfaces/IPlacesBusinessApi.js";
4
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
5
+ export default class PlacesBusinessApi implements IPlacesBusinessApi {
6
+ private httpRequest;
7
+ private readonly baseUrl;
8
+ constructor(httpRequest: IHttpRequest);
9
+ searchAddress(request: SearchAddressRequest): Promise<FiadoApiResponse<SearchAddressResponse>>;
10
+ reverseGeocode(request: ReverseGeocodeRequest): Promise<FiadoApiResponse<ReverseGeocodeResponse>>;
11
+ }
12
+ export {};
@@ -0,0 +1,32 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { inject, injectable } from "inversify";
14
+ let PlacesBusinessApi = class PlacesBusinessApi {
15
+ httpRequest;
16
+ baseUrl = process.env.PLACES_BUSINESS_LAMBDA_URL || "";
17
+ constructor(httpRequest) {
18
+ this.httpRequest = httpRequest;
19
+ }
20
+ async searchAddress(request) {
21
+ return await this.httpRequest.post(`${this.baseUrl}private/search-address`, request, { operationName: "privateSearchAddress" });
22
+ }
23
+ async reverseGeocode(request) {
24
+ return await this.httpRequest.post(`${this.baseUrl}private/reverse-geocode`, request, { operationName: "privateReverseGeocode" });
25
+ }
26
+ };
27
+ PlacesBusinessApi = __decorate([
28
+ injectable(),
29
+ __param(0, inject("IHttpRequest")),
30
+ __metadata("design:paramtypes", [Object])
31
+ ], PlacesBusinessApi);
32
+ export default PlacesBusinessApi;
@@ -0,0 +1,9 @@
1
+ import { SearchAddressRequest, SearchAddressResponse, ReverseGeocodeRequest, ReverseGeocodeResponse } from "@fiado/type-kit/bin/places/index.js";
2
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
3
+ export interface IPlacesBusinessApi {
4
+ /** Geocoding por texto (POST /private/search-address, operationId privateSearchAddress). */
5
+ searchAddress(request: SearchAddressRequest): Promise<FiadoApiResponse<SearchAddressResponse>>;
6
+ /** Reverse geocoding (POST /private/reverse-geocode, operationId privateReverseGeocode). */
7
+ reverseGeocode(request: ReverseGeocodeRequest): Promise<FiadoApiResponse<ReverseGeocodeResponse>>;
8
+ }
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './api/PlacesBusinessApi.js';
2
+ export * from './api/interfaces/IPlacesBusinessApi.js';
@@ -0,0 +1,2 @@
1
+ export * from './api/PlacesBusinessApi.js';
2
+ export * from './api/interfaces/IPlacesBusinessApi.js';
@@ -0,0 +1,12 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IPresenceWebsocketApi } from "./interfaces/IPresenceWebsocketApi.js";
3
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
4
+ export declare class PresenceWebsocketApi implements IPresenceWebsocketApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
9
+ deletedCount: number;
10
+ }>>;
11
+ }
12
+ export {};
@@ -0,0 +1,32 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { inject, injectable } from "inversify";
14
+ import dotenv from 'dotenv';
15
+ dotenv.config();
16
+ let PresenceWebsocketApi = class PresenceWebsocketApi {
17
+ httpRequest;
18
+ baseUrl = process.env.PRESENCE_WEBSOCKET_LAMBDA_URL || "";
19
+ constructor(httpRequest) {
20
+ this.httpRequest = httpRequest;
21
+ }
22
+ async deleteByDirectoryId(directoryId) {
23
+ const url = `${this.baseUrl}private/directory/${directoryId}`;
24
+ return await this.httpRequest.delete(url);
25
+ }
26
+ };
27
+ PresenceWebsocketApi = __decorate([
28
+ injectable(),
29
+ __param(0, inject("IHttpRequest")),
30
+ __metadata("design:paramtypes", [Object])
31
+ ], PresenceWebsocketApi);
32
+ export { PresenceWebsocketApi };
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IPresenceWebsocketApi.js';
2
+ export * from './PresenceWebsocketApi.js';
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IPresenceWebsocketApi.js';
2
+ export * from './PresenceWebsocketApi.js';
@@ -0,0 +1,15 @@
1
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
2
+ /**
3
+ * Interfaz para el servicio Presence Websocket (presence-websocket).
4
+ */
5
+ export interface IPresenceWebsocketApi {
6
+ /**
7
+ * Borra en cascada los registros de presencia asociados a un directoryId.
8
+ * @param directoryId ID del directorio.
9
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
10
+ */
11
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
12
+ deletedCount: number;
13
+ }>>;
14
+ }
15
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { IHttpRequest } from "@fiado/http-client";
2
+ import { StandardResponse } from "@fiado/gateway-adapter";
3
+ import { UpsertCustomerFromKycRequest, AccountResultRequest, CustomerResponse } from "@fiado/type-kit/bin/retailCustomer/index.js";
4
+ import { IRetailCustomerBusinessApi } from "./interfaces/IRetailCustomerBusinessApi.js";
5
+ /**
6
+ * Publisher HTTP del lambda `retail-customer-business` (SureKeep Fase 2, pista Retail) para sus 4
7
+ * endpoints privados de cliente. Contrato y semántica completos → `IRetailCustomerBusinessApi`.
8
+ *
9
+ * Los paths y el `?tenantId=` matchean `openapi/private.yaml` del lambda destino (mismo patrón que
10
+ * `retail-org-business`: el silo se resuelve por el `tenantId` canónico que manda el caller).
11
+ *
12
+ * Env var requerida en el consumer: `RETAIL_CUSTOMER_BUSINESS_URL`.
13
+ * El template.yml del consumer la setea con:
14
+ *
15
+ * RETAIL_CUSTOMER_BUSINESS_URL: '{{resolve:ssm:retail-customer-business}}'
16
+ *
17
+ * Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
18
+ */
19
+ export default class RetailCustomerBusinessApi implements IRetailCustomerBusinessApi {
20
+ private httpRequest;
21
+ private readonly baseUrl;
22
+ constructor(httpRequest: IHttpRequest);
23
+ upsertCustomerFromKyc(payload: UpsertCustomerFromKycRequest, tenantId: string): Promise<StandardResponse<CustomerResponse>>;
24
+ setAccountResult(customerId: string, payload: AccountResultRequest, tenantId: string): Promise<StandardResponse<CustomerResponse>>;
25
+ getCustomerByPhone(phone: string, tenantId: string): Promise<StandardResponse<CustomerResponse>>;
26
+ getCustomer(customerId: string, tenantId: string): Promise<StandardResponse<CustomerResponse>>;
27
+ }
@@ -0,0 +1,56 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { inject, injectable } from "inversify";
14
+ /**
15
+ * Publisher HTTP del lambda `retail-customer-business` (SureKeep Fase 2, pista Retail) para sus 4
16
+ * endpoints privados de cliente. Contrato y semántica completos → `IRetailCustomerBusinessApi`.
17
+ *
18
+ * Los paths y el `?tenantId=` matchean `openapi/private.yaml` del lambda destino (mismo patrón que
19
+ * `retail-org-business`: el silo se resuelve por el `tenantId` canónico que manda el caller).
20
+ *
21
+ * Env var requerida en el consumer: `RETAIL_CUSTOMER_BUSINESS_URL`.
22
+ * El template.yml del consumer la setea con:
23
+ *
24
+ * RETAIL_CUSTOMER_BUSINESS_URL: '{{resolve:ssm:retail-customer-business}}'
25
+ *
26
+ * Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
27
+ */
28
+ let RetailCustomerBusinessApi = class RetailCustomerBusinessApi {
29
+ httpRequest;
30
+ baseUrl = process.env.RETAIL_CUSTOMER_BUSINESS_URL || "";
31
+ constructor(httpRequest) {
32
+ this.httpRequest = httpRequest;
33
+ }
34
+ async upsertCustomerFromKyc(payload, tenantId) {
35
+ const url = `${this.baseUrl}/private/customers/upsert-from-kyc?tenantId=${encodeURIComponent(tenantId)}`;
36
+ return await this.httpRequest.post(url, payload);
37
+ }
38
+ async setAccountResult(customerId, payload, tenantId) {
39
+ const url = `${this.baseUrl}/private/customers/${encodeURIComponent(customerId)}/account-result?tenantId=${encodeURIComponent(tenantId)}`;
40
+ return await this.httpRequest.put(url, payload);
41
+ }
42
+ async getCustomerByPhone(phone, tenantId) {
43
+ const url = `${this.baseUrl}/private/customers/by-phone/${encodeURIComponent(phone)}?tenantId=${encodeURIComponent(tenantId)}`;
44
+ return await this.httpRequest.get(url);
45
+ }
46
+ async getCustomer(customerId, tenantId) {
47
+ const url = `${this.baseUrl}/private/customers/${encodeURIComponent(customerId)}?tenantId=${encodeURIComponent(tenantId)}`;
48
+ return await this.httpRequest.get(url);
49
+ }
50
+ };
51
+ RetailCustomerBusinessApi = __decorate([
52
+ injectable(),
53
+ __param(0, inject("IHttpRequest")),
54
+ __metadata("design:paramtypes", [Object])
55
+ ], RetailCustomerBusinessApi);
56
+ export default RetailCustomerBusinessApi;
@@ -0,0 +1,76 @@
1
+ import { StandardResponse } from "@fiado/gateway-adapter";
2
+ import { UpsertCustomerFromKycRequest, AccountResultRequest, CustomerResponse } from "@fiado/type-kit/bin/retailCustomer/index.js";
3
+ /**
4
+ * Contrato del publisher HTTP del lambda `retail-customer-business` (SureKeep Fase 2, pista Retail)
5
+ * para sus 4 endpoints privados de cliente (service-to-service, VPC-only).
6
+ *
7
+ * Consumidor previsto:
8
+ * - `retail-wizard-business` → upsert del cliente post-KYC, aterrizaje del resultado de apertura
9
+ * de cuenta (D35), y lecturas del cliente por teléfono / id durante la saga de venta.
10
+ *
11
+ * ─────────────────────────────────────────────────────────────────────────────
12
+ * `tenantId` es OBLIGATORIO en los 4 métodos — no es un detalle de firma.
13
+ * ─────────────────────────────────────────────────────────────────────────────
14
+ * Los privados NO llevan token de usuario (`Feature.ANONIMUS`; la protección es la red VPC), así que
15
+ * el lambda destino no tiene `AuthContext.issuer` y NO puede inferir el silo. El caller declara el
16
+ * tenant explícito por query (`?tenantId=`) y `@fiado/tenant-context` (`withContextByTenantId`) asume
17
+ * el rol de ESE silo. Sin `tenantId` → `400 UNKNOWN_TENANT` (fail-closed). Nunca hay default: caer a un
18
+ * tenant por default sería fail-OPEN y podría devolver datos de otra SOFOM.
19
+ *
20
+ * ⚠️ `tenantId` = el tenant CANÓNICO (p.ej. `'surekeep'`), NO el issuer Cognito ni la URL del pool.
21
+ * Es el mismo valor que consume `retail-org-business` en sus privados (`withContextByTenantId`).
22
+ *
23
+ * ─────────────────────────────────────────────────────────────────────────────
24
+ * ⚠️ Patrón de retorno: `StandardResponse<T>` — el consumer accede `result.data`, NO `result.body`.
25
+ * ─────────────────────────────────────────────────────────────────────────────
26
+ * `@fiado/http-client` entrega el BODY PELADO (hace `return response.data` en `AxiosHttpRequest`), así
27
+ * que `.statusCode`/`.body` no existen en runtime. El envelope real del lambda destino es
28
+ * `{ code, date, data, msg, description }` = `StandardResponse<T>` (ya exportado por
29
+ * `@fiado/gateway-adapter`). El consumer lee el shape del cliente en `result.data`.
30
+ *
31
+ * Errores: el lambda destino lanza `DomainError` tipado → el publisher RECHAZA (no devuelve null).
32
+ * Cada consumer mapea a su propio error de dominio (ver `fiado-api-invoker § 6`):
33
+ * `404 CUSTOMER_NOT_FOUND` (por id / por teléfono inexistente)
34
+ * `400 UNKNOWN_TENANT` (tenantId ausente o desconocido)
35
+ *
36
+ * Env var requerida en el consumer: `RETAIL_CUSTOMER_BUSINESS_URL`.
37
+ * El template.yml del consumer la setea con:
38
+ *
39
+ * RETAIL_CUSTOMER_BUSINESS_URL: '{{resolve:ssm:retail-customer-business}}'
40
+ *
41
+ * Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
42
+ */
43
+ export interface IRetailCustomerBusinessApi {
44
+ /**
45
+ * POST /private/customers/upsert-from-kyc?tenantId= — upsert idempotente del cliente tras el KYC
46
+ * (paso 02f). El lambda resuelve UNIQ#PHONE + UNIQ#CURP en la misma TX y setea
47
+ * `accountStatus=OPENING` server-side (la apertura corre en background, D35). Responde `201`.
48
+ *
49
+ * NOTA (TD-014 del customer): el `address` del type-kit tipa el `AddressBase` canónico (pesado);
50
+ * el lambda valida con un DTO local ligero. El domicilio OCR-parcial se salda con `RetailAddress`
51
+ * aditivo al type-kit (backlog) — no acá.
52
+ */
53
+ upsertCustomerFromKyc(payload: UpsertCustomerFromKycRequest, tenantId: string): Promise<StandardResponse<CustomerResponse>>;
54
+ /**
55
+ * PUT /private/customers/{customerId}/account-result?tenantId= — aterriza el resultado terminal de
56
+ * la apertura de cuenta async (D35). Solo acepta OPEN/FAILED (nunca el intermedio OPENING). OPEN
57
+ * llega con `pcfClabe`/`pcfAccountLevel`; FAILED con `failReason`.
58
+ *
59
+ * @throws si el cliente no existe (`404 CUSTOMER_NOT_FOUND`).
60
+ */
61
+ setAccountResult(customerId: string, payload: AccountResultRequest, tenantId: string): Promise<StandardResponse<CustomerResponse>>;
62
+ /**
63
+ * GET /private/customers/by-phone/{phone}?tenantId= — resuelve el cliente por su teléfono MX (10
64
+ * dígitos, ya normalizado sin separadores). Usado por el wizard para saber si el teléfono ya es
65
+ * cliente del silo.
66
+ *
67
+ * @throws si no hay cliente con ese teléfono (`404 CUSTOMER_NOT_FOUND`).
68
+ */
69
+ getCustomerByPhone(phone: string, tenantId: string): Promise<StandardResponse<CustomerResponse>>;
70
+ /**
71
+ * GET /private/customers/{customerId}?tenantId= — resuelve el cliente por su id.
72
+ *
73
+ * @throws si el cliente no existe (`404 CUSTOMER_NOT_FOUND`).
74
+ */
75
+ getCustomer(customerId: string, tenantId: string): Promise<StandardResponse<CustomerResponse>>;
76
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api/interfaces/IRetailCustomerBusinessApi.js";
2
+ export { default as RetailCustomerBusinessApi } from "./api/RetailCustomerBusinessApi.js";
@@ -0,0 +1,2 @@
1
+ export * from "./api/interfaces/IRetailCustomerBusinessApi.js";
2
+ export { default as RetailCustomerBusinessApi } from "./api/RetailCustomerBusinessApi.js";
@@ -4,6 +4,7 @@ import { CreatePrivateAlarm, CreateRiskProfileRequest } from "@fiado/type-kit/bi
4
4
  type UpdateRiskProfileRequest = import("@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest.js").default;
5
5
  type UpdateAlarmProfileRequest = import("@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest.js").default;
6
6
  import { ResponseOptions } from "@fiado/gateway-adapter";
7
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
7
8
  import { SetCustomAlarmRequest, SetCustomAlarmResponse, SetDeclaredIncomeRequest, SetDeclaredIncomeResponse, SetManualRiskLevelRequest, SetManualRiskLevelResponse, CreateClientFinancialHistoryRequest, ClientFinancialHistoryResponse, ListClientFinancialHistoryResponse } from "@fiado/type-kit/bin/riskProfile/index.js";
8
9
  export default class RiskProfileApi implements IRiskProfileApi {
9
10
  private httpRequest;
@@ -30,5 +31,8 @@ export default class RiskProfileApi implements IRiskProfileApi {
30
31
  limit?: number;
31
32
  continuationToken?: string;
32
33
  }): Promise<ResponseOptions<ListClientFinancialHistoryResponse>>;
34
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
35
+ deletedCount: number;
36
+ }>>;
33
37
  }
34
38
  export {};
@@ -71,6 +71,10 @@ let RiskProfileApi = class RiskProfileApi {
71
71
  const url = `${this.baseUrl}/profiles/${directoryId}/financial-history${qs}`;
72
72
  return await this.httpRequest.get(url);
73
73
  }
74
+ async deleteByDirectoryId(directoryId) {
75
+ const url = `${this.baseUrl}/private/directory/${directoryId}`;
76
+ return await this.httpRequest.delete(url);
77
+ }
74
78
  };
75
79
  RiskProfileApi = __decorate([
76
80
  injectable(),
@@ -2,6 +2,7 @@ import { CreatePrivateAlarm, CreateRiskProfileRequest } from "@fiado/type-kit/bi
2
2
  type UpdateAlarmProfileRequest = import("@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest.js").default;
3
3
  type UpdateRiskProfileRequest = import("@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest.js").default;
4
4
  import { ResponseOptions } from "@fiado/gateway-adapter";
5
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
5
6
  import { SetCustomAlarmRequest, SetCustomAlarmResponse, SetDeclaredIncomeRequest, SetDeclaredIncomeResponse, SetManualRiskLevelRequest, SetManualRiskLevelResponse, CreateClientFinancialHistoryRequest, ClientFinancialHistoryResponse, ListClientFinancialHistoryResponse } from "@fiado/type-kit/bin/riskProfile/index.js";
6
7
  export interface IRiskProfileApi {
7
8
  createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
@@ -50,5 +51,13 @@ export interface IRiskProfileApi {
50
51
  limit?: number;
51
52
  continuationToken?: string;
52
53
  }): Promise<ResponseOptions<ListClientFinancialHistoryResponse>>;
54
+ /**
55
+ * Borra en cascada el perfil de riesgo asociado a un directoryId.
56
+ * @param directoryId ID del directorio.
57
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
58
+ */
59
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
60
+ deletedCount: number;
61
+ }>>;
53
62
  }
54
63
  export {};
@@ -8,5 +8,8 @@ export declare class ZendeskApi implements IZendeskApi {
8
8
  constructor(httpRequest: IHttpRequest);
9
9
  createUser(data: HelpdeskCreateUserRequest): Promise<FiadoApiResponse<any>>;
10
10
  createTicket(data: HelpdeskCreateTicketRequest): Promise<FiadoApiResponse<any>>;
11
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
12
+ deletedCount: number;
13
+ }>>;
11
14
  }
12
15
  export {};
@@ -27,6 +27,10 @@ let ZendeskApi = class ZendeskApi {
27
27
  const url = `${this.baseUrl}tickets/create`;
28
28
  return await this.httpRequest.post(url, data);
29
29
  }
30
+ async deleteByDirectoryId(directoryId) {
31
+ const url = `${this.baseUrl}private/directory/${directoryId}`;
32
+ return await this.httpRequest.delete(url);
33
+ }
30
34
  };
31
35
  ZendeskApi = __decorate([
32
36
  injectable(),
@@ -6,5 +6,13 @@ import { HelpdeskCreateTicketRequest, HelpdeskCreateUserRequest } from '@fiado/t
6
6
  export interface IZendeskApi {
7
7
  createUser(data: HelpdeskCreateUserRequest): Promise<FiadoApiResponse<any>>;
8
8
  createTicket(data: HelpdeskCreateTicketRequest): Promise<FiadoApiResponse<any>>;
9
+ /**
10
+ * Borra en cascada los registros de Zendesk asociados a un directoryId.
11
+ * @param directoryId ID del directorio.
12
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
13
+ */
14
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{
15
+ deletedCount: number;
16
+ }>>;
9
17
  }
10
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "4.68.0",
3
+ "version": "4.71.0",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
5
5
  "type": "module",
6
6
  "main": "bin/index.js",
@@ -34,7 +34,7 @@
34
34
  "@fiado/gateway-adapter": "^3.9.0",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.193.0",
37
+ "@fiado/type-kit": "^3.196.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -1,6 +1,7 @@
1
1
  import { IHttpRequest } from "@fiado/http-client";
2
2
  import { inject, injectable } from "inversify";
3
3
  import { IActivityApi } from "./interfaces/IActivityApi.js";
4
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
4
5
 
5
6
  @injectable()
6
7
  export default class ActivityApi implements IActivityApi {
@@ -33,4 +34,9 @@ export default class ActivityApi implements IActivityApi {
33
34
  const url = `${this.baseUrl}activities/history?typeOfActivity=${typeOfActivity}&startDate=${startDate}&endDate=${endDate}`;
34
35
  return await this.httpRequest.get(url);
35
36
  }
37
+
38
+ async deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>> {
39
+ const url = `${this.baseUrl}private/directory/${directoryId}`;
40
+ return await this.httpRequest.delete<FiadoApiResponse<{ deletedCount: number }>>(url);
41
+ }
36
42
  }
@@ -1,4 +1,4 @@
1
-
1
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
2
2
 
3
3
  export interface IActivityApi {
4
4
 
@@ -11,4 +11,12 @@ export interface IActivityApi {
11
11
  findByDirectoriesList(directories: string[]): Promise<any>
12
12
 
13
13
  correctCounters(): Promise<any>
14
+
15
+ /**
16
+ * Borra en cascada las actividades asociadas a un directoryId.
17
+ * @param directoryId ID del directorio.
18
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
19
+ */
20
+ // TODO(type-kit): swap a Directory.DeleteByDirectoryResponse cuando se publique
21
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>>
14
22
  }
@@ -2,6 +2,7 @@ import { IHttpRequest } from "@fiado/http-client";
2
2
  import { AddressCreateRequest, AddressShippingCardResponse } from "@fiado/type-kit/bin/address/index.js";
3
3
  import { inject, injectable } from "inversify";
4
4
  import { IAddressApi } from "./interfaces/IAddressApi.js";
5
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
5
6
 
6
7
 
7
8
  @injectable()
@@ -33,6 +34,11 @@ export class AddressApi implements IAddressApi {
33
34
  return await this.httpRequest.post<AddressShippingCardResponse>(url, { directoryId });
34
35
  }
35
36
 
37
+ async deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>> {
38
+ const url = `${this.baseUrl}private/directory/${directoryId}`;
39
+ return await this.httpRequest.delete<FiadoApiResponse<{ deletedCount: number }>>(url);
40
+ }
41
+
36
42
  private validateBaseUrl() {
37
43
  if (!this.baseUrl) {
38
44
  throw new Error("Environment variable ADDRESS_LAMBDA_URL value not found");
@@ -1,4 +1,5 @@
1
1
  import { AddressCreateRequest, AddressResponse, AddressShippingCardResponse } from "@fiado/type-kit/bin/address/index.js";
2
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
2
3
 
3
4
  export interface IAddressApi {
4
5
 
@@ -26,6 +27,14 @@ export interface IAddressApi {
26
27
  * @returns Una promesa que resuelve a un objeto de respuesta de dirección de envío.
27
28
  * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
28
29
  */
29
- getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse>
30
+ getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse>
31
+
32
+ /**
33
+ * Borra en cascada las direcciones asociadas a un directoryId.
34
+ * @param directoryId ID del directorio.
35
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
36
+ */
37
+ // TODO(type-kit): swap a Directory.DeleteByDirectoryResponse cuando se publique
38
+ deleteByDirectoryId(directoryId: string): Promise<FiadoApiResponse<{ deletedCount: number }>>;
30
39
 
31
40
  }