@fiado/api-invoker 5.30.0 → 5.32.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 (33) hide show
  1. package/bin/card/CardApi.d.ts +2 -1
  2. package/bin/card/CardApi.js +4 -0
  3. package/bin/card/interfaces/ICardApi.d.ts +9 -1
  4. package/bin/membership/MembershipApi.d.ts +12 -0
  5. package/bin/membership/MembershipApi.js +32 -0
  6. package/bin/membership/index.d.ts +2 -0
  7. package/bin/membership/index.js +2 -0
  8. package/bin/membership/interfaces/IMembershipApi.d.ts +15 -0
  9. package/bin/membership/interfaces/IMembershipApi.js +1 -0
  10. package/bin/notificationWebsockets/NotificationWebsocketApi.d.ts +12 -0
  11. package/bin/notificationWebsockets/NotificationWebsocketApi.js +32 -0
  12. package/bin/notificationWebsockets/interfaces/INotificationWebsocketApi.d.ts +15 -0
  13. package/bin/notificationWebsockets/interfaces/INotificationWebsocketApi.js +1 -0
  14. package/bin/performance-profile/PerformanceProfileApi.d.ts +12 -0
  15. package/bin/performance-profile/PerformanceProfileApi.js +32 -0
  16. package/bin/performance-profile/index.d.ts +2 -0
  17. package/bin/performance-profile/index.js +2 -0
  18. package/bin/performance-profile/interfaces/IPerformanceProfileApi.d.ts +15 -0
  19. package/bin/performance-profile/interfaces/IPerformanceProfileApi.js +1 -0
  20. package/bin/presence-websocket/PresenceWebsocketApi.d.ts +12 -0
  21. package/bin/presence-websocket/PresenceWebsocketApi.js +32 -0
  22. package/bin/presence-websocket/index.d.ts +2 -0
  23. package/bin/presence-websocket/index.js +2 -0
  24. package/bin/presence-websocket/interfaces/IPresenceWebsocketApi.d.ts +15 -0
  25. package/bin/presence-websocket/interfaces/IPresenceWebsocketApi.js +1 -0
  26. package/bin/retailCards/api/RetailCardsBusinessApi.d.ts +6 -7
  27. package/bin/retailCards/api/RetailCardsBusinessApi.js +6 -10
  28. package/bin/retailCards/api/interfaces/IRetailCardsBusinessApi.d.ts +15 -19
  29. package/package.json +2 -2
  30. package/src/card/CardApi.ts +7 -1
  31. package/src/card/interfaces/ICardApi.ts +10 -1
  32. package/src/retailCards/api/RetailCardsBusinessApi.ts +19 -16
  33. package/src/retailCards/api/interfaces/IRetailCardsBusinessApi.ts +27 -23
@@ -1,6 +1,6 @@
1
1
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
2
  import type { IHttpRequest } from "@fiado/http-client";
3
- import { CardApplicationRequest, CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest, Status, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
3
+ import { CardApplicationRequest, CardIssuanceBySideRequest, CardIssuanceBySideResponse, CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest, Status, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
4
4
  import { CardsByStatusResponse, ICardApi } from "./interfaces/ICardApi.js";
5
5
  import { Provider } from "@fiado/type-kit/bin/provider/index.js";
6
6
  import { InfoSelfVerifiedStatus } from "@fiado/type-kit/bin/identity/index.js";
@@ -18,6 +18,7 @@ export declare class CardApi implements ICardApi {
18
18
  updateIssuance(provider: Provider, input: CardUpdateIssuanceRequest): Promise<ApiGatewayResponse<void>>;
19
19
  updateIssuanceObservation(directoryId: string, input: CardIssuanceObservationUpdateRequest): Promise<ApiGatewayResponse<void>>;
20
20
  issuance(directoryId: string, USA_InfoSelfVerified: InfoSelfVerifiedStatus): Promise<void>;
21
+ issuanceBySide(request: CardIssuanceBySideRequest): Promise<ApiGatewayResponse<CardIssuanceBySideResponse>>;
21
22
  updateShipping(provider: Provider, shippingId: string, input: UpdateBankAccountCardRequest): Promise<ApiGatewayResponse<void>>;
22
23
  cardApplication(directoryId: string, provider: Provider, input: CardApplicationRequest): Promise<void>;
23
24
  }
@@ -66,6 +66,10 @@ let CardApi = class CardApi {
66
66
  const url = `${this.baseUrl}`;
67
67
  await this.httpRequest.post(url, { USA_InfoSelfVerified, directoryId });
68
68
  }
69
+ async issuanceBySide(request) {
70
+ const url = `${this.baseUrl}`;
71
+ return await this.httpRequest.post(url, request);
72
+ }
69
73
  async updateShipping(provider, shippingId, input) {
70
74
  const url = `${this.baseUrl}${provider}/shipping/${shippingId}`;
71
75
  return await this.httpRequest.put(url, input);
@@ -1,5 +1,5 @@
1
1
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
- import { CardApplicationRequest, CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest, Status, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
2
+ import { CardApplicationRequest, CardIssuanceBySideRequest, CardIssuanceBySideResponse, CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest, Status, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
3
3
  import { InfoSelfVerifiedStatus } from "@fiado/type-kit/bin/identity/index.js";
4
4
  import { Provider } from "@fiado/type-kit/bin/provider/index.js";
5
5
  export interface CardsByStatusResponse {
@@ -16,6 +16,14 @@ export interface ICardApi {
16
16
  updateIssuance(provider: Provider, input: CardUpdateIssuanceRequest): Promise<ApiGatewayResponse<void>>;
17
17
  updateIssuanceObservation(directoryId: string, input: CardIssuanceObservationUpdateRequest): Promise<ApiGatewayResponse<void>>;
18
18
  issuance(directoryId: string, USA_InfoSelfVerified: InfoSelfVerifiedStatus): Promise<void>;
19
+ /**
20
+ * Emisión por lado (DEC-025 de onboarding-business). `trigger: AUTOMATIC` activa
21
+ * el guard estricto en fiado-card-business (nunca re-emite un lado FAILED);
22
+ * la respuesta distingue `CREATED` de `SKIPPED {reason}` — SKIPPED es resultado
23
+ * normal del guard atómico, no un error. Mismo endpoint raíz que `issuance`
24
+ * (operationId `privateIssuance`), body superset retrocompatible.
25
+ */
26
+ issuanceBySide(request: CardIssuanceBySideRequest): Promise<ApiGatewayResponse<CardIssuanceBySideResponse>>;
19
27
  updateShipping(provider: Provider, shippingId: string, input: UpdateBankAccountCardRequest): Promise<ApiGatewayResponse<void>>;
20
28
  /**
21
29
  * Emite la tarjeta virtual de un directorio y la registra en
@@ -0,0 +1,12 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IMembershipApi } from "./interfaces/IMembershipApi.js";
3
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
4
+ export declare class MembershipApi implements IMembershipApi {
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 MembershipApi = class MembershipApi {
17
+ httpRequest;
18
+ baseUrl = process.env.MEMBERSHIP_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
+ MembershipApi = __decorate([
28
+ injectable(),
29
+ __param(0, inject("IHttpRequest")),
30
+ __metadata("design:paramtypes", [Object])
31
+ ], MembershipApi);
32
+ export { MembershipApi };
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IMembershipApi.js';
2
+ export * from './MembershipApi.js';
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IMembershipApi.js';
2
+ export * from './MembershipApi.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 Membership (membership-business).
4
+ */
5
+ export interface IMembershipApi {
6
+ /**
7
+ * Borra en cascada las membresías 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 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { INotificationWebsocketApi } from "./interfaces/INotificationWebsocketApi.js";
3
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
4
+ export declare class NotificationWebsocketApi implements INotificationWebsocketApi {
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 NotificationWebsocketApi = class NotificationWebsocketApi {
17
+ httpRequest;
18
+ baseUrl = process.env.NOTIFICATIONS_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
+ NotificationWebsocketApi = __decorate([
28
+ injectable(),
29
+ __param(0, inject("IHttpRequest")),
30
+ __metadata("design:paramtypes", [Object])
31
+ ], NotificationWebsocketApi);
32
+ export { NotificationWebsocketApi };
@@ -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 { 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 {};
@@ -1,11 +1,11 @@
1
1
  import type { IHttpRequest } from "@fiado/http-client";
2
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";
3
+ import { CardDeliveryResponse, RegisterCardDeliveryRequest, ReverseCardMovementRequest } from "@fiado/type-kit/bin/retailCards/index.js";
4
+ import { IRetailCardsBusinessApi } from "./interfaces/IRetailCardsBusinessApi.js";
5
5
  /**
6
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`).
7
+ * privados del inventario de tarjetas físicas PCF. Contrato y semántica completos →
8
+ * `IRetailCardsBusinessApi` (tenant por `?tenantId=` canónico, `StandardResponse` → leer `result.data`).
9
9
  *
10
10
  * Env var requerida en el consumer: `RETAIL_CARDS_BUSINESS_URL`.
11
11
  * El template.yml del consumer la setea con:
@@ -18,7 +18,6 @@ export default class RetailCardsBusinessApi implements IRetailCardsBusinessApi {
18
18
  private httpRequest;
19
19
  private readonly baseUrl;
20
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>>;
21
+ registerDelivery(storeId: string, body: RegisterCardDeliveryRequest, tenantId: string): Promise<StandardResponse<CardDeliveryResponse>>;
22
+ reverseDelivery(storeId: string, body: ReverseCardMovementRequest, tenantId: string): Promise<StandardResponse<void>>;
24
23
  }
@@ -13,8 +13,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  import { inject, injectable } from "inversify";
14
14
  /**
15
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`).
16
+ * privados del inventario de tarjetas físicas PCF. Contrato y semántica completos →
17
+ * `IRetailCardsBusinessApi` (tenant por `?tenantId=` canónico, `StandardResponse` → leer `result.data`).
18
18
  *
19
19
  * Env var requerida en el consumer: `RETAIL_CARDS_BUSINESS_URL`.
20
20
  * El template.yml del consumer la setea con:
@@ -30,16 +30,12 @@ let RetailCardsBusinessApi = class RetailCardsBusinessApi {
30
30
  constructor(httpRequest) {
31
31
  this.httpRequest = httpRequest;
32
32
  }
33
- async assign(cardNumber, body, tenantId) {
34
- const url = `${this.baseUrl}/private/cards/${encodeURIComponent(cardNumber)}/assign?tenantId=${encodeURIComponent(tenantId)}`;
33
+ async registerDelivery(storeId, body, tenantId) {
34
+ const url = `${this.baseUrl}/private/stores/${encodeURIComponent(storeId)}/card-deliveries?tenantId=${encodeURIComponent(tenantId)}`;
35
35
  return await this.httpRequest.post(url, body);
36
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)}`;
37
+ async reverseDelivery(storeId, body, tenantId) {
38
+ const url = `${this.baseUrl}/private/stores/${encodeURIComponent(storeId)}/card-movements/reverse?tenantId=${encodeURIComponent(tenantId)}`;
43
39
  return await this.httpRequest.post(url, body);
44
40
  }
45
41
  };
@@ -1,8 +1,8 @@
1
1
  import { StandardResponse } from "@fiado/gateway-adapter";
2
- import { AssignCardRequest } from "@fiado/type-kit/bin/retailCards/index.js";
2
+ import { CardDeliveryResponse, RegisterCardDeliveryRequest, ReverseCardMovementRequest } from "@fiado/type-kit/bin/retailCards/index.js";
3
3
  /**
4
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).
5
+ * sus endpoints privados del inventario de tarjetas físicas PCF, consumidos por el wizard F2 (paso 09).
6
6
  *
7
7
  * ─────────────────────────────────────────────────────────────────────────────
8
8
  * TENANT — `?tenantId=` CANÓNICO (query), NO header `x-tenant-issuer`.
@@ -14,28 +14,24 @@ import { AssignCardRequest } from "@fiado/type-kit/bin/retailCards/index.js";
14
14
  * ⚠️ Retorno `StandardResponse<T>` — el consumer lee `result.data`, NO `result.body`.
15
15
  * Errores: el destino lanza `DomainError` tipado → el publisher RECHAZA (no devuelve null).
16
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? }`).
17
+ * El inventario se lleva por CANTIDAD: no hay número de tarjeta en ningún path ni body. El `storeId`
18
+ * viaja en el path y el destino valida que la tienda pertenezca al retailer del caller.
20
19
  *
21
20
  * Env var requerida en el consumer: `RETAIL_CARDS_BUSINESS_URL`.
22
21
  * El template.yml del consumer la setea con:
23
22
  *
24
23
  * RETAIL_CARDS_BUSINESS_URL: '{{resolve:ssm:retail-cards-business}}'
25
24
  */
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
25
  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>>;
26
+ /**
27
+ * POST `/private/stores/{storeId}/card-deliveries` — entrega una tarjeta física a un cliente
28
+ * (paso 09): descuenta el saldo y asienta el movimiento en una sola operación. Idempotente por
29
+ * `sessionId` — el reintento devuelve el `deliveryId` original con 200.
30
+ */
31
+ registerDelivery(storeId: string, body: RegisterCardDeliveryRequest, tenantId: string): Promise<StandardResponse<CardDeliveryResponse>>;
32
+ /**
33
+ * POST `/private/stores/{storeId}/card-movements/reverse` — revierte un asiento si la venta se
34
+ * cancela (DEC-007 destino). Escribe un contraasiento, no borra el original.
35
+ */
36
+ reverseDelivery(storeId: string, body: ReverseCardMovementRequest, tenantId: string): Promise<StandardResponse<void>>;
41
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.30.0",
3
+ "version": "5.32.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.309.0",
37
+ "@fiado/type-kit": "^3.316.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -5,7 +5,7 @@ import { ApiGatewayResponse } from "@fiado/gateway-adapter";
5
5
  // que si tienen suite (p. ej. `RetailCardsBusinessApi`). No cambia el runtime:
6
6
  // tsc borra las dos formas por igual.
7
7
  import type { IHttpRequest } from "@fiado/http-client";
8
- import { CardApplicationRequest, CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest, Status, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
8
+ import { CardApplicationRequest, CardIssuanceBySideRequest, CardIssuanceBySideResponse, CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest, Status, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
9
9
  import { inject, injectable } from "inversify";
10
10
  import { CardsByStatusResponse, ICardApi } from "./interfaces/ICardApi.js";
11
11
  import { Provider } from "@fiado/type-kit/bin/provider/index.js";
@@ -95,6 +95,12 @@ export class CardApi implements ICardApi {
95
95
  await this.httpRequest.post(url, { USA_InfoSelfVerified, directoryId });
96
96
  }
97
97
 
98
+ async issuanceBySide(request: CardIssuanceBySideRequest): Promise<ApiGatewayResponse<CardIssuanceBySideResponse>> {
99
+
100
+ const url = `${this.baseUrl}`;
101
+ return await this.httpRequest.post(url, request);
102
+ }
103
+
98
104
  async updateShipping(provider: Provider, shippingId: string, input: UpdateBankAccountCardRequest): Promise<ApiGatewayResponse<void>> {
99
105
 
100
106
  const url = `${this.baseUrl}${provider}/shipping/${shippingId}`;
@@ -1,5 +1,5 @@
1
1
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
- import { CardApplicationRequest, CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest, Status, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
2
+ import { CardApplicationRequest, CardIssuanceBySideRequest, CardIssuanceBySideResponse, CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest, Status, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
3
3
  import { InfoSelfVerifiedStatus } from "@fiado/type-kit/bin/identity/index.js";
4
4
  import { Provider } from "@fiado/type-kit/bin/provider/index.js";
5
5
 
@@ -28,6 +28,15 @@ export interface ICardApi {
28
28
 
29
29
  issuance(directoryId: string, USA_InfoSelfVerified: InfoSelfVerifiedStatus): Promise<void>;
30
30
 
31
+ /**
32
+ * Emisión por lado (DEC-025 de onboarding-business). `trigger: AUTOMATIC` activa
33
+ * el guard estricto en fiado-card-business (nunca re-emite un lado FAILED);
34
+ * la respuesta distingue `CREATED` de `SKIPPED {reason}` — SKIPPED es resultado
35
+ * normal del guard atómico, no un error. Mismo endpoint raíz que `issuance`
36
+ * (operationId `privateIssuance`), body superset retrocompatible.
37
+ */
38
+ issuanceBySide(request: CardIssuanceBySideRequest): Promise<ApiGatewayResponse<CardIssuanceBySideResponse>>;
39
+
31
40
  updateShipping(provider: Provider, shippingId: string, input: UpdateBankAccountCardRequest): Promise<ApiGatewayResponse<void>>;
32
41
 
33
42
  /**
@@ -1,17 +1,17 @@
1
1
  import { inject, injectable } from "inversify";
2
2
  import type { IHttpRequest } from "@fiado/http-client";
3
3
  import { StandardResponse } from "@fiado/gateway-adapter";
4
- import { AssignCardRequest } from "@fiado/type-kit/bin/retailCards/index.js";
5
4
  import {
6
- IRetailCardsBusinessApi,
7
- MarkDeliveredBody,
8
- ReleaseCardBody,
9
- } from "./interfaces/IRetailCardsBusinessApi.js";
5
+ CardDeliveryResponse,
6
+ RegisterCardDeliveryRequest,
7
+ ReverseCardMovementRequest,
8
+ } from "@fiado/type-kit/bin/retailCards/index.js";
9
+ import { IRetailCardsBusinessApi } from "./interfaces/IRetailCardsBusinessApi.js";
10
10
 
11
11
  /**
12
12
  * Publisher HTTP del lambda `retail-cards-business` (SureKeep Fase 1, pista Retail) para sus endpoints
13
- * privados de la tarjeta física PCF. Contrato y semántica completos → `IRetailCardsBusinessApi`
14
- * (tenant por `?tenantId=` canónico, `StandardResponse` → leer `result.data`).
13
+ * privados del inventario de tarjetas físicas PCF. Contrato y semántica completos →
14
+ * `IRetailCardsBusinessApi` (tenant por `?tenantId=` canónico, `StandardResponse` → leer `result.data`).
15
15
  *
16
16
  * Env var requerida en el consumer: `RETAIL_CARDS_BUSINESS_URL`.
17
17
  * El template.yml del consumer la setea con:
@@ -27,18 +27,21 @@ export default class RetailCardsBusinessApi implements IRetailCardsBusinessApi {
27
27
 
28
28
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
29
29
 
30
- async assign(cardNumber: string, body: AssignCardRequest, tenantId: string): Promise<StandardResponse<void>> {
31
- const url = `${this.baseUrl}/private/cards/${encodeURIComponent(cardNumber)}/assign?tenantId=${encodeURIComponent(tenantId)}`;
30
+ async registerDelivery(
31
+ storeId: string,
32
+ body: RegisterCardDeliveryRequest,
33
+ tenantId: string,
34
+ ): Promise<StandardResponse<CardDeliveryResponse>> {
35
+ const url = `${this.baseUrl}/private/stores/${encodeURIComponent(storeId)}/card-deliveries?tenantId=${encodeURIComponent(tenantId)}`;
32
36
  return await this.httpRequest.post(url, body);
33
37
  }
34
38
 
35
- async markDelivered(cardNumber: string, body: MarkDeliveredBody, tenantId: string): Promise<StandardResponse<void>> {
36
- const url = `${this.baseUrl}/private/cards/${encodeURIComponent(cardNumber)}/deliver?tenantId=${encodeURIComponent(tenantId)}`;
37
- return await this.httpRequest.post(url, body);
38
- }
39
-
40
- async release(cardNumber: string, body: ReleaseCardBody, tenantId: string): Promise<StandardResponse<void>> {
41
- const url = `${this.baseUrl}/private/cards/${encodeURIComponent(cardNumber)}/release?tenantId=${encodeURIComponent(tenantId)}`;
39
+ async reverseDelivery(
40
+ storeId: string,
41
+ body: ReverseCardMovementRequest,
42
+ tenantId: string,
43
+ ): Promise<StandardResponse<void>> {
44
+ const url = `${this.baseUrl}/private/stores/${encodeURIComponent(storeId)}/card-movements/reverse?tenantId=${encodeURIComponent(tenantId)}`;
42
45
  return await this.httpRequest.post(url, body);
43
46
  }
44
47
  }
@@ -1,9 +1,13 @@
1
1
  import { StandardResponse } from "@fiado/gateway-adapter";
2
- import { AssignCardRequest } from "@fiado/type-kit/bin/retailCards/index.js";
2
+ import {
3
+ CardDeliveryResponse,
4
+ RegisterCardDeliveryRequest,
5
+ ReverseCardMovementRequest,
6
+ } from "@fiado/type-kit/bin/retailCards/index.js";
3
7
 
4
8
  /**
5
9
  * Contrato del publisher HTTP del lambda `retail-cards-business` (SureKeep Fase 1, pista Retail) para
6
- * sus endpoints privados de la tarjeta física PCF, consumidos por el wizard F2 (paso 09, spike S7).
10
+ * sus endpoints privados del inventario de tarjetas físicas PCF, consumidos por el wizard F2 (paso 09).
7
11
  *
8
12
  * ─────────────────────────────────────────────────────────────────────────────
9
13
  * TENANT — `?tenantId=` CANÓNICO (query), NO header `x-tenant-issuer`.
@@ -15,33 +19,33 @@ import { AssignCardRequest } from "@fiado/type-kit/bin/retailCards/index.js";
15
19
  * ⚠️ Retorno `StandardResponse<T>` — el consumer lee `result.data`, NO `result.body`.
16
20
  * Errores: el destino lanza `DomainError` tipado → el publisher RECHAZA (no devuelve null).
17
21
  *
18
- * `deliver`/`release` reciben un body ligero (`{ deliveredByUserId? }` / `{ releasedByUserId? }`) que el
19
- * destino no publica como DTO en `@fiado/type-kit` → se declara INLINE aquí. `assign` sí usa el DTO
20
- * `AssignCardRequest` del type-kit (`{ assignedToCustomerId, assignedByUserId, creditId? }`).
22
+ * El inventario se lleva por CANTIDAD: no hay número de tarjeta en ningún path ni body. El `storeId`
23
+ * viaja en el path y el destino valida que la tienda pertenezca al retailer del caller.
21
24
  *
22
25
  * Env var requerida en el consumer: `RETAIL_CARDS_BUSINESS_URL`.
23
26
  * El template.yml del consumer la setea con:
24
27
  *
25
28
  * RETAIL_CARDS_BUSINESS_URL: '{{resolve:ssm:retail-cards-business}}'
26
29
  */
27
-
28
- /** Body de POST `/private/cards/{cardNumber}/deliver`. */
29
- export interface MarkDeliveredBody {
30
- deliveredByUserId?: string;
31
- }
32
-
33
- /** Body de POST `/private/cards/{cardNumber}/release`. */
34
- export interface ReleaseCardBody {
35
- releasedByUserId?: string;
36
- }
37
-
38
30
  export interface IRetailCardsBusinessApi {
39
- /** POST `/private/cards/{cardNumber}/assign` — asigna la tarjeta física a un cliente (paso 09). */
40
- assign(cardNumber: string, body: AssignCardRequest, tenantId: string): Promise<StandardResponse<void>>;
41
-
42
- /** POST `/private/cards/{cardNumber}/deliver` — marca la tarjeta como entregada al cliente (D8). */
43
- markDelivered(cardNumber: string, body: MarkDeliveredBody, tenantId: string): Promise<StandardResponse<void>>;
31
+ /**
32
+ * POST `/private/stores/{storeId}/card-deliveries` — entrega una tarjeta física a un cliente
33
+ * (paso 09): descuenta el saldo y asienta el movimiento en una sola operación. Idempotente por
34
+ * `sessionId` — el reintento devuelve el `deliveryId` original con 200.
35
+ */
36
+ registerDelivery(
37
+ storeId: string,
38
+ body: RegisterCardDeliveryRequest,
39
+ tenantId: string,
40
+ ): Promise<StandardResponse<CardDeliveryResponse>>;
44
41
 
45
- /** POST `/private/cards/{cardNumber}/release` — revierte la asignación si la venta se cancela (DEC-007 destino). */
46
- release(cardNumber: string, body: ReleaseCardBody, tenantId: string): Promise<StandardResponse<void>>;
42
+ /**
43
+ * POST `/private/stores/{storeId}/card-movements/reverse` — revierte un asiento si la venta se
44
+ * cancela (DEC-007 destino). Escribe un contraasiento, no borra el original.
45
+ */
46
+ reverseDelivery(
47
+ storeId: string,
48
+ body: ReverseCardMovementRequest,
49
+ tenantId: string,
50
+ ): Promise<StandardResponse<void>>;
47
51
  }