@fiado/api-invoker 4.70.0 → 4.72.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/bin/activity-business/ActivityApi.d.ts +5 -0
- package/bin/activity-business/ActivityApi.js +4 -0
- package/bin/activity-business/interfaces/IActivityApi.d.ts +10 -0
- package/bin/address/AddressApi.d.ts +5 -0
- package/bin/address/AddressApi.js +4 -0
- package/bin/address/interfaces/IAddressApi.d.ts +10 -0
- package/bin/auth-business/AuthBusinessApi.d.ts +12 -0
- package/bin/auth-business/AuthBusinessApi.js +32 -0
- package/bin/auth-business/index.d.ts +2 -0
- package/bin/auth-business/index.js +2 -0
- package/bin/auth-business/interfaces/IAuthBusinessApi.d.ts +15 -0
- package/bin/auth-business/interfaces/IAuthBusinessApi.js +1 -0
- package/bin/bankAccount/BankAccountApi.d.ts +3 -0
- package/bin/bankAccount/BankAccountApi.js +4 -0
- package/bin/bankAccount/interfaces/IBankAccountApi.d.ts +10 -0
- package/bin/beneficiary/BeneficiaryApi.d.ts +12 -0
- package/bin/beneficiary/BeneficiaryApi.js +32 -0
- package/bin/beneficiary/index.d.ts +2 -0
- package/bin/beneficiary/index.js +2 -0
- package/bin/beneficiary/interfaces/IBeneficiaryApi.d.ts +15 -0
- package/bin/beneficiary/interfaces/IBeneficiaryApi.js +1 -0
- package/bin/contactInformation/ContactInformationApi.d.ts +5 -0
- package/bin/contactInformation/ContactInformationApi.js +4 -0
- package/bin/contactInformation/interface/IContactInformationApi.d.ts +10 -0
- package/bin/container.config.js +13 -0
- package/bin/directorySetting/DirectorySettingApi.d.ts +3 -0
- package/bin/directorySetting/DirectorySettingApi.js +4 -0
- package/bin/directorySetting/interfaces/IDirectorySettingApi.d.ts +8 -0
- package/bin/group/GroupApi.d.ts +3 -0
- package/bin/group/GroupApi.js +4 -0
- package/bin/group/interfaces/IGroupApi.d.ts +8 -0
- package/bin/index.d.ts +8 -0
- package/bin/index.js +8 -0
- package/bin/membership/MembershipApi.d.ts +12 -0
- package/bin/membership/MembershipApi.js +32 -0
- package/bin/membership/index.d.ts +2 -0
- package/bin/membership/index.js +2 -0
- package/bin/membership/interfaces/IMembershipApi.d.ts +15 -0
- package/bin/membership/interfaces/IMembershipApi.js +1 -0
- package/bin/notificationWebsockets/NotificationWebsocketApi.d.ts +12 -0
- package/bin/notificationWebsockets/NotificationWebsocketApi.js +32 -0
- package/bin/notificationWebsockets/index.d.ts +2 -0
- package/bin/notificationWebsockets/index.js +2 -0
- package/bin/notificationWebsockets/interfaces/INotificationWebsocketApi.d.ts +15 -0
- package/bin/notificationWebsockets/interfaces/INotificationWebsocketApi.js +1 -0
- package/bin/performance-profile/PerformanceProfileApi.d.ts +12 -0
- package/bin/performance-profile/PerformanceProfileApi.js +32 -0
- package/bin/performance-profile/index.d.ts +2 -0
- package/bin/performance-profile/index.js +2 -0
- package/bin/performance-profile/interfaces/IPerformanceProfileApi.d.ts +15 -0
- package/bin/performance-profile/interfaces/IPerformanceProfileApi.js +1 -0
- package/bin/presence-websocket/PresenceWebsocketApi.d.ts +12 -0
- package/bin/presence-websocket/PresenceWebsocketApi.js +32 -0
- package/bin/presence-websocket/index.d.ts +2 -0
- package/bin/presence-websocket/index.js +2 -0
- package/bin/presence-websocket/interfaces/IPresenceWebsocketApi.d.ts +15 -0
- package/bin/presence-websocket/interfaces/IPresenceWebsocketApi.js +1 -0
- package/bin/retailCards/api/RetailCardsBusinessApi.d.ts +24 -0
- package/bin/retailCards/api/RetailCardsBusinessApi.js +51 -0
- package/bin/retailCards/api/interfaces/IRetailCardsBusinessApi.d.ts +41 -0
- package/bin/retailCards/api/interfaces/IRetailCardsBusinessApi.js +1 -0
- package/bin/retailCards/index.d.ts +2 -0
- package/bin/retailCards/index.js +2 -0
- package/bin/retailCatalog/api/RetailCatalogBusinessApi.d.ts +27 -0
- package/bin/retailCatalog/api/RetailCatalogBusinessApi.js +65 -0
- package/bin/retailCatalog/api/interfaces/IRetailCatalogBusinessApi.d.ts +64 -0
- package/bin/retailCatalog/api/interfaces/IRetailCatalogBusinessApi.js +1 -0
- package/bin/retailCatalog/index.d.ts +2 -0
- package/bin/retailCatalog/index.js +2 -0
- package/bin/riskProfile/api/RiskProfileApi.d.ts +4 -0
- package/bin/riskProfile/api/RiskProfileApi.js +4 -0
- package/bin/riskProfile/api/interfaces/IRiskProfileApi.d.ts +9 -0
- package/bin/zendesk/ZendeskApi.d.ts +3 -0
- package/bin/zendesk/ZendeskApi.js +4 -0
- package/bin/zendesk/interfaces/IZendeskApi.d.ts +8 -0
- package/docs/TECH_DEBT.md +7 -0
- package/package.json +1 -1
- package/src/activity-business/ActivityApi.ts +6 -0
- package/src/activity-business/interfaces/IActivityApi.ts +9 -1
- package/src/address/AddressApi.ts +6 -0
- package/src/address/interfaces/IAddressApi.ts +10 -1
- package/src/auth-business/AuthBusinessApi.ts +20 -0
- package/src/auth-business/index.ts +2 -0
- package/src/auth-business/interfaces/IAuthBusinessApi.ts +15 -0
- package/src/bankAccount/BankAccountApi.ts +5 -0
- package/src/bankAccount/interfaces/IBankAccountApi.ts +10 -0
- package/src/beneficiary/BeneficiaryApi.ts +20 -0
- package/src/beneficiary/index.ts +2 -0
- package/src/beneficiary/interfaces/IBeneficiaryApi.ts +15 -0
- package/src/contactInformation/ContactInformationApi.ts +6 -0
- package/src/contactInformation/interface/IContactInformationApi.ts +10 -1
- package/src/container.config.ts +14 -0
- package/src/directorySetting/DirectorySettingApi.ts +5 -0
- package/src/directorySetting/interfaces/IDirectorySettingApi.ts +8 -1
- package/src/group/GroupApi.ts +5 -0
- package/src/group/interfaces/IGroupApi.ts +8 -0
- package/src/index.ts +8 -0
- package/src/membership/MembershipApi.ts +20 -0
- package/src/membership/index.ts +2 -0
- package/src/membership/interfaces/IMembershipApi.ts +15 -0
- package/src/notificationWebsockets/NotificationWebsocketApi.ts +20 -0
- package/src/notificationWebsockets/index.ts +3 -1
- package/src/notificationWebsockets/interfaces/INotificationWebsocketApi.ts +15 -0
- package/src/performance-profile/PerformanceProfileApi.ts +20 -0
- package/src/performance-profile/index.ts +2 -0
- package/src/performance-profile/interfaces/IPerformanceProfileApi.ts +15 -0
- package/src/presence-websocket/PresenceWebsocketApi.ts +20 -0
- package/src/presence-websocket/index.ts +2 -0
- package/src/presence-websocket/interfaces/IPresenceWebsocketApi.ts +15 -0
- package/src/retailCards/api/RetailCardsBusinessApi.ts +44 -0
- package/src/retailCards/api/interfaces/IRetailCardsBusinessApi.ts +47 -0
- package/src/retailCards/index.ts +2 -0
- package/src/retailCatalog/api/RetailCatalogBusinessApi.ts +68 -0
- package/src/retailCatalog/api/interfaces/IRetailCatalogBusinessApi.ts +75 -0
- package/src/retailCatalog/index.ts +2 -0
- package/src/riskProfile/api/RiskProfileApi.ts +6 -0
- package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +9 -0
- package/src/zendesk/ZendeskApi.ts +5 -0
- package/src/zendesk/interfaces/IZendeskApi.ts +8 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { AssignCardRequest } from "@fiado/type-kit/bin/retailCards/index.js";
|
|
4
|
+
import { IRetailCardsBusinessApi, MarkDeliveredBody, ReleaseCardBody } from "./interfaces/IRetailCardsBusinessApi.js";
|
|
5
|
+
/**
|
|
6
|
+
* Publisher HTTP del lambda `retail-cards-business` (SureKeep Fase 1, pista Retail) para sus endpoints
|
|
7
|
+
* privados de la tarjeta física PCF. Contrato y semántica completos → `IRetailCardsBusinessApi`
|
|
8
|
+
* (tenant por `?tenantId=` canónico, `StandardResponse` → leer `result.data`).
|
|
9
|
+
*
|
|
10
|
+
* Env var requerida en el consumer: `RETAIL_CARDS_BUSINESS_URL`.
|
|
11
|
+
* El template.yml del consumer la setea con:
|
|
12
|
+
*
|
|
13
|
+
* RETAIL_CARDS_BUSINESS_URL: '{{resolve:ssm:retail-cards-business}}'
|
|
14
|
+
*
|
|
15
|
+
* Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
|
|
16
|
+
*/
|
|
17
|
+
export default class RetailCardsBusinessApi implements IRetailCardsBusinessApi {
|
|
18
|
+
private httpRequest;
|
|
19
|
+
private readonly baseUrl;
|
|
20
|
+
constructor(httpRequest: IHttpRequest);
|
|
21
|
+
assign(cardNumber: string, body: AssignCardRequest, tenantId: string): Promise<StandardResponse<void>>;
|
|
22
|
+
markDelivered(cardNumber: string, body: MarkDeliveredBody, tenantId: string): Promise<StandardResponse<void>>;
|
|
23
|
+
release(cardNumber: string, body: ReleaseCardBody, tenantId: string): Promise<StandardResponse<void>>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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-cards-business` (SureKeep Fase 1, pista Retail) para sus endpoints
|
|
16
|
+
* privados de la tarjeta física PCF. Contrato y semántica completos → `IRetailCardsBusinessApi`
|
|
17
|
+
* (tenant por `?tenantId=` canónico, `StandardResponse` → leer `result.data`).
|
|
18
|
+
*
|
|
19
|
+
* Env var requerida en el consumer: `RETAIL_CARDS_BUSINESS_URL`.
|
|
20
|
+
* El template.yml del consumer la setea con:
|
|
21
|
+
*
|
|
22
|
+
* RETAIL_CARDS_BUSINESS_URL: '{{resolve:ssm:retail-cards-business}}'
|
|
23
|
+
*
|
|
24
|
+
* Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
|
|
25
|
+
*/
|
|
26
|
+
let RetailCardsBusinessApi = class RetailCardsBusinessApi {
|
|
27
|
+
httpRequest;
|
|
28
|
+
// El buildspec publica la URL en SSM con "/" final — se normaliza para no armar "//private".
|
|
29
|
+
baseUrl = (process.env.RETAIL_CARDS_BUSINESS_URL || "").replace(/\/+$/, "");
|
|
30
|
+
constructor(httpRequest) {
|
|
31
|
+
this.httpRequest = httpRequest;
|
|
32
|
+
}
|
|
33
|
+
async assign(cardNumber, body, tenantId) {
|
|
34
|
+
const url = `${this.baseUrl}/private/cards/${encodeURIComponent(cardNumber)}/assign?tenantId=${encodeURIComponent(tenantId)}`;
|
|
35
|
+
return await this.httpRequest.post(url, body);
|
|
36
|
+
}
|
|
37
|
+
async markDelivered(cardNumber, body, tenantId) {
|
|
38
|
+
const url = `${this.baseUrl}/private/cards/${encodeURIComponent(cardNumber)}/deliver?tenantId=${encodeURIComponent(tenantId)}`;
|
|
39
|
+
return await this.httpRequest.post(url, body);
|
|
40
|
+
}
|
|
41
|
+
async release(cardNumber, body, tenantId) {
|
|
42
|
+
const url = `${this.baseUrl}/private/cards/${encodeURIComponent(cardNumber)}/release?tenantId=${encodeURIComponent(tenantId)}`;
|
|
43
|
+
return await this.httpRequest.post(url, body);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
RetailCardsBusinessApi = __decorate([
|
|
47
|
+
injectable(),
|
|
48
|
+
__param(0, inject("IHttpRequest")),
|
|
49
|
+
__metadata("design:paramtypes", [Object])
|
|
50
|
+
], RetailCardsBusinessApi);
|
|
51
|
+
export default RetailCardsBusinessApi;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { AssignCardRequest } from "@fiado/type-kit/bin/retailCards/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Contrato del publisher HTTP del lambda `retail-cards-business` (SureKeep Fase 1, pista Retail) para
|
|
5
|
+
* sus endpoints privados de la tarjeta física PCF, consumidos por el wizard F2 (paso 09, spike S7).
|
|
6
|
+
*
|
|
7
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
8
|
+
* TENANT — `?tenantId=` CANÓNICO (query), NO header `x-tenant-issuer`.
|
|
9
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
* El silo se resuelve por el `tenantId` canónico que manda el caller (`?tenantId=` →
|
|
11
|
+
* `withContextByTenantId`). Los privados son `Feature.ANONIMUS` (sin RBAC; protección VPC). Sin
|
|
12
|
+
* `tenantId` → `UnknownTenantError` (fail-closed).
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ Retorno `StandardResponse<T>` — el consumer lee `result.data`, NO `result.body`.
|
|
15
|
+
* Errores: el destino lanza `DomainError` tipado → el publisher RECHAZA (no devuelve null).
|
|
16
|
+
*
|
|
17
|
+
* `deliver`/`release` reciben un body ligero (`{ deliveredByUserId? }` / `{ releasedByUserId? }`) que el
|
|
18
|
+
* destino no publica como DTO en `@fiado/type-kit` → se declara INLINE aquí. `assign` sí usa el DTO
|
|
19
|
+
* `AssignCardRequest` del type-kit (`{ assignedToCustomerId, assignedByUserId, creditId? }`).
|
|
20
|
+
*
|
|
21
|
+
* Env var requerida en el consumer: `RETAIL_CARDS_BUSINESS_URL`.
|
|
22
|
+
* El template.yml del consumer la setea con:
|
|
23
|
+
*
|
|
24
|
+
* RETAIL_CARDS_BUSINESS_URL: '{{resolve:ssm:retail-cards-business}}'
|
|
25
|
+
*/
|
|
26
|
+
/** Body de POST `/private/cards/{cardNumber}/deliver`. */
|
|
27
|
+
export interface MarkDeliveredBody {
|
|
28
|
+
deliveredByUserId?: string;
|
|
29
|
+
}
|
|
30
|
+
/** Body de POST `/private/cards/{cardNumber}/release`. */
|
|
31
|
+
export interface ReleaseCardBody {
|
|
32
|
+
releasedByUserId?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IRetailCardsBusinessApi {
|
|
35
|
+
/** POST `/private/cards/{cardNumber}/assign` — asigna la tarjeta física a un cliente (paso 09). */
|
|
36
|
+
assign(cardNumber: string, body: AssignCardRequest, tenantId: string): Promise<StandardResponse<void>>;
|
|
37
|
+
/** POST `/private/cards/{cardNumber}/deliver` — marca la tarjeta como entregada al cliente (D8). */
|
|
38
|
+
markDelivered(cardNumber: string, body: MarkDeliveredBody, tenantId: string): Promise<StandardResponse<void>>;
|
|
39
|
+
/** POST `/private/cards/{cardNumber}/release` — revierte la asignación si la venta se cancela (DEC-007 destino). */
|
|
40
|
+
release(cardNumber: string, body: ReleaseCardBody, tenantId: string): Promise<StandardResponse<void>>;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { IRetailCatalogBusinessApi, ReleaseReservationBody, ReserveInventoryBody, ReserveInventoryResult, SellInventoryBody, StoreCatalogItem } from "./interfaces/IRetailCatalogBusinessApi.js";
|
|
4
|
+
/**
|
|
5
|
+
* Publisher HTTP del lambda `retail-catalog-business` (SureKeep Fase 1, pista Retail) para sus
|
|
6
|
+
* endpoints privados del ciclo de venta del IMEI. Contrato y semántica completos →
|
|
7
|
+
* `IRetailCatalogBusinessApi` (tenant por header `x-tenant-issuer`, `StandardResponse` → leer
|
|
8
|
+
* `result.data`).
|
|
9
|
+
*
|
|
10
|
+
* Env var requerida en el consumer: `RETAIL_CATALOG_BUSINESS_URL`.
|
|
11
|
+
* El template.yml del consumer la setea con:
|
|
12
|
+
*
|
|
13
|
+
* RETAIL_CATALOG_BUSINESS_URL: '{{resolve:ssm:retail-catalog-business}}'
|
|
14
|
+
*
|
|
15
|
+
* Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
|
|
16
|
+
*/
|
|
17
|
+
export default class RetailCatalogBusinessApi implements IRetailCatalogBusinessApi {
|
|
18
|
+
private httpRequest;
|
|
19
|
+
private readonly baseUrl;
|
|
20
|
+
constructor(httpRequest: IHttpRequest);
|
|
21
|
+
private tenantHeader;
|
|
22
|
+
getStoreCatalog(storeId: string, issuer: string): Promise<StandardResponse<StoreCatalogItem[]>>;
|
|
23
|
+
reserveInventory(imei: string, body: ReserveInventoryBody, issuer: string): Promise<StandardResponse<ReserveInventoryResult>>;
|
|
24
|
+
sellInventory(imei: string, body: SellInventoryBody, issuer: string): Promise<StandardResponse<void>>;
|
|
25
|
+
releaseInventory(imei: string, body: ReleaseReservationBody, issuer: string): Promise<StandardResponse<void>>;
|
|
26
|
+
returnInventory(imei: string, issuer: string): Promise<StandardResponse<void>>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
/** Header por el que el destino resuelve el silo (issuer Cognito forwardeado por el caller). */
|
|
15
|
+
const TENANT_ISSUER_HEADER = "x-tenant-issuer";
|
|
16
|
+
/**
|
|
17
|
+
* Publisher HTTP del lambda `retail-catalog-business` (SureKeep Fase 1, pista Retail) para sus
|
|
18
|
+
* endpoints privados del ciclo de venta del IMEI. Contrato y semántica completos →
|
|
19
|
+
* `IRetailCatalogBusinessApi` (tenant por header `x-tenant-issuer`, `StandardResponse` → leer
|
|
20
|
+
* `result.data`).
|
|
21
|
+
*
|
|
22
|
+
* Env var requerida en el consumer: `RETAIL_CATALOG_BUSINESS_URL`.
|
|
23
|
+
* El template.yml del consumer la setea con:
|
|
24
|
+
*
|
|
25
|
+
* RETAIL_CATALOG_BUSINESS_URL: '{{resolve:ssm:retail-catalog-business}}'
|
|
26
|
+
*
|
|
27
|
+
* Convención CLAUDE.md global: SSM key = nombre del lambda owner de la URL.
|
|
28
|
+
*/
|
|
29
|
+
let RetailCatalogBusinessApi = class RetailCatalogBusinessApi {
|
|
30
|
+
httpRequest;
|
|
31
|
+
// El buildspec publica la URL en SSM con "/" final — se normaliza para no armar "//private".
|
|
32
|
+
baseUrl = (process.env.RETAIL_CATALOG_BUSINESS_URL || "").replace(/\/+$/, "");
|
|
33
|
+
constructor(httpRequest) {
|
|
34
|
+
this.httpRequest = httpRequest;
|
|
35
|
+
}
|
|
36
|
+
tenantHeader(issuer) {
|
|
37
|
+
return { [TENANT_ISSUER_HEADER]: issuer };
|
|
38
|
+
}
|
|
39
|
+
async getStoreCatalog(storeId, issuer) {
|
|
40
|
+
const url = `${this.baseUrl}/private/stores/${encodeURIComponent(storeId)}/catalog`;
|
|
41
|
+
return await this.httpRequest.get(url, undefined, this.tenantHeader(issuer));
|
|
42
|
+
}
|
|
43
|
+
async reserveInventory(imei, body, issuer) {
|
|
44
|
+
const url = `${this.baseUrl}/private/inventory/${encodeURIComponent(imei)}/reserve`;
|
|
45
|
+
return await this.httpRequest.put(url, body, this.tenantHeader(issuer));
|
|
46
|
+
}
|
|
47
|
+
async sellInventory(imei, body, issuer) {
|
|
48
|
+
const url = `${this.baseUrl}/private/inventory/${encodeURIComponent(imei)}/sell`;
|
|
49
|
+
return await this.httpRequest.put(url, body, this.tenantHeader(issuer));
|
|
50
|
+
}
|
|
51
|
+
async releaseInventory(imei, body, issuer) {
|
|
52
|
+
const url = `${this.baseUrl}/private/inventory/${encodeURIComponent(imei)}/release`;
|
|
53
|
+
return await this.httpRequest.put(url, body, this.tenantHeader(issuer));
|
|
54
|
+
}
|
|
55
|
+
async returnInventory(imei, issuer) {
|
|
56
|
+
const url = `${this.baseUrl}/private/inventory/${encodeURIComponent(imei)}/return`;
|
|
57
|
+
return await this.httpRequest.put(url, undefined, this.tenantHeader(issuer));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
RetailCatalogBusinessApi = __decorate([
|
|
61
|
+
injectable(),
|
|
62
|
+
__param(0, inject("IHttpRequest")),
|
|
63
|
+
__metadata("design:paramtypes", [Object])
|
|
64
|
+
], RetailCatalogBusinessApi);
|
|
65
|
+
export default RetailCatalogBusinessApi;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
/**
|
|
3
|
+
* Contrato del publisher HTTP del lambda `retail-catalog-business` (SureKeep Fase 1, pista Retail)
|
|
4
|
+
* para sus endpoints privados del ciclo de venta del IMEI, consumidos por el wizard F2.
|
|
5
|
+
*
|
|
6
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
* TENANT — header `x-tenant-issuer` (NO `?tenantId=`).
|
|
8
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
9
|
+
* A diferencia de customer/cards/loan-config (que resuelven el silo por `?tenantId=` canónico), este
|
|
10
|
+
* lambda resuelve el tenant por el ISSUER Cognito forwardeado en el header `x-tenant-issuer`
|
|
11
|
+
* (`PrivateController.issuerFromHeader` → `TenantContextService.withContext(issuer)`). Los privados son
|
|
12
|
+
* `Feature.ANONIMUS` (sin RBAC; la protección es la red VPC), así que el caller DEBE declarar el issuer.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ Retorno `StandardResponse<T>` — el consumer lee `result.data`, NO `result.body`.
|
|
15
|
+
* Errores: el destino lanza `DomainError` tipado → el publisher RECHAZA (no devuelve null); cada
|
|
16
|
+
* consumer mapea a su propio error de dominio.
|
|
17
|
+
*
|
|
18
|
+
* DTOs de catálogo/reserva: el lambda destino NO publica todavía estos shapes en `@fiado/type-kit`
|
|
19
|
+
* (`StoreCatalogItem`, `ReserveInventoryResult`), así que se declaran INLINE aquí (TD: migrar a
|
|
20
|
+
* type-kit cuando el contrato se estabilice). El shape espeja `StoreCatalogItemResponse` /
|
|
21
|
+
* `ReserveInventoryResponse` del `retail-catalog-business`.
|
|
22
|
+
*
|
|
23
|
+
* Env var requerida en el consumer: `RETAIL_CATALOG_BUSINESS_URL`.
|
|
24
|
+
* El template.yml del consumer la setea con:
|
|
25
|
+
*
|
|
26
|
+
* RETAIL_CATALOG_BUSINESS_URL: '{{resolve:ssm:retail-catalog-business}}'
|
|
27
|
+
*/
|
|
28
|
+
/** Ítem del catálogo vendible de un store (espeja `StoreCatalogItemResponse` del destino). */
|
|
29
|
+
export interface StoreCatalogItem {
|
|
30
|
+
sku: string;
|
|
31
|
+
imei: string;
|
|
32
|
+
cashPriceCents: number;
|
|
33
|
+
available: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** Resultado de la reserva (espeja `ReserveInventoryResponse` del destino). */
|
|
36
|
+
export interface ReserveInventoryResult {
|
|
37
|
+
reservationExpiresAt: string;
|
|
38
|
+
}
|
|
39
|
+
/** Body de PUT `/private/inventory/{imei}/reserve`. */
|
|
40
|
+
export interface ReserveInventoryBody {
|
|
41
|
+
sku: string;
|
|
42
|
+
sessionId: string;
|
|
43
|
+
}
|
|
44
|
+
/** Body de PUT `/private/inventory/{imei}/sell` (DEC-020 del destino: `customerId` puebla `soldToCustomerId`). */
|
|
45
|
+
export interface SellInventoryBody {
|
|
46
|
+
sessionId: string;
|
|
47
|
+
customerId: string;
|
|
48
|
+
}
|
|
49
|
+
/** Body de PUT `/private/inventory/{imei}/release` (DEC-018 del destino: verifica titularidad de la sesión). */
|
|
50
|
+
export interface ReleaseReservationBody {
|
|
51
|
+
sessionId: string;
|
|
52
|
+
}
|
|
53
|
+
export interface IRetailCatalogBusinessApi {
|
|
54
|
+
/** GET `/private/stores/{storeId}/catalog` — catálogo vendible (sku, imei, precio de contado, disponibilidad). */
|
|
55
|
+
getStoreCatalog(storeId: string, issuer: string): Promise<StandardResponse<StoreCatalogItem[]>>;
|
|
56
|
+
/** PUT `/private/inventory/{imei}/reserve` — reserva atómica del IMEI para una sesión (AVAILABLE → RESERVED). */
|
|
57
|
+
reserveInventory(imei: string, body: ReserveInventoryBody, issuer: string): Promise<StandardResponse<ReserveInventoryResult>>;
|
|
58
|
+
/** PUT `/private/inventory/{imei}/sell` — vende el IMEI (RESERVED → SOLD). */
|
|
59
|
+
sellInventory(imei: string, body: SellInventoryBody, issuer: string): Promise<StandardResponse<void>>;
|
|
60
|
+
/** PUT `/private/inventory/{imei}/release` — libera la reserva (RESERVED → AVAILABLE, titularidad de la sesión). */
|
|
61
|
+
releaseInventory(imei: string, body: ReleaseReservationBody, issuer: string): Promise<StandardResponse<void>>;
|
|
62
|
+
/** PUT `/private/inventory/{imei}/return` — devuelve el IMEI vendido al stock (SOLD → AVAILABLE, sin body). */
|
|
63
|
+
returnInventory(imei: string, issuer: string): Promise<StandardResponse<void>>;
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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/docs/TECH_DEBT.md
CHANGED
|
@@ -14,3 +14,10 @@ Registro vivo de deudas conscientes del repo. Cada entrada con ID estable `TD-AI
|
|
|
14
14
|
5. `npx tsc --noEmit` verde.
|
|
15
15
|
6. `npm publish` del api-invoker en su nueva version (Andres ejecuta).
|
|
16
16
|
- **Bloqueante:** SÍ — el primer deploy productivo o CI run del api-invoker (y de cualquier consumer que bumpee a la 4.6.0) rompe si el publish del type-kit NO se materializó antes.
|
|
17
|
+
|
|
18
|
+
## TD-AI-002 — 2026-07-20 — DTOs de catálogo/reserva/deliver tipados INLINE en los clients retail F2
|
|
19
|
+
|
|
20
|
+
- **Contexto:** los clients nuevos `RetailCatalogBusinessApi` (`src/retailCatalog/`) y `RetailCardsBusinessApi` (`src/retailCards/`) declaran INLINE algunos shapes que el lambda destino aún NO publica en `@fiado/type-kit`: `StoreCatalogItem` y `ReserveInventoryResult` (catalog, espejan `StoreCatalogItemResponse`/`ReserveInventoryResponse` del destino), y los bodies ligeros `MarkDeliveredBody`/`ReleaseCardBody` (cards). `assign` sí usa el DTO real `AssignCardRequest` del type-kit.
|
|
21
|
+
- **Asunción / pendiente:** se tiparon inline a propósito para no bloquear el cableado del wizard F2 en un bump de type-kit (regla de la sesión: NO tocar type-kit sin OK). Los shapes espejan fielmente el contrato del destino verificado en código.
|
|
22
|
+
- **Condición para cerrar:** cuando `retail-catalog-business`/`retail-cards-business` publiquen esos DTOs en `@fiado/type-kit` (dominios `retailCatalog`/`retailCards`), reemplazar los inline por el import del type-kit y bumpear.
|
|
23
|
+
- **Bloqueante:** NO — el contrato de red es correcto; es unificación de tipos con downstream.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.72.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",
|
|
@@ -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");
|