@fiado/api-invoker 5.8.0 → 5.10.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/account-beneficiary/AccountBeneficiaryApi.d.ts +5 -1
- package/bin/account-beneficiary/AccountBeneficiaryApi.js +8 -0
- package/bin/account-beneficiary/interfaces/IAccountBeneficiaryApi.d.ts +16 -1
- package/bin/container.config.js +2 -0
- package/bin/estafeta/api/EstafetaApi.d.ts +7 -5
- package/bin/estafeta/api/EstafetaApi.js +4 -0
- package/bin/estafeta/api/interfaces/IEstafetaApi.d.ts +6 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/shipping/api/ShippingStatusApi.d.ts +10 -0
- package/bin/shipping/api/ShippingStatusApi.js +29 -0
- package/bin/shipping/api/interfaces/IShippingStatusApi.d.ts +11 -0
- package/bin/shipping/api/interfaces/IShippingStatusApi.js +1 -0
- package/bin/shipping/index.d.ts +2 -0
- package/bin/shipping/index.js +2 -0
- package/package.json +2 -2
- package/src/account-beneficiary/AccountBeneficiaryApi.ts +13 -2
- package/src/account-beneficiary/interfaces/IAccountBeneficiaryApi.ts +19 -2
- package/src/container.config.ts +3 -0
- package/src/estafeta/api/EstafetaApi.ts +11 -5
- package/src/estafeta/api/interfaces/IEstafetaApi.ts +7 -0
- package/src/index.ts +1 -0
- package/src/shipping/api/ShippingStatusApi.ts +19 -0
- package/src/shipping/api/interfaces/IShippingStatusApi.ts +12 -0
- package/src/shipping/index.ts +2 -0
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { IAccountBeneficiaryApi } from "./interfaces/IAccountBeneficiaryApi.js";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary/index.js";
|
|
3
|
+
import { AccountBeneficiaryCreateRequest, AccountBeneficiaryResponse } from "@fiado/type-kit/bin/beneficiary/index.js";
|
|
4
4
|
import { CountryId } from "@fiado/type-kit/bin/country/index.js";
|
|
5
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
6
|
export declare class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
|
|
6
7
|
private httpRequest;
|
|
7
8
|
private readonly baseUrl;
|
|
8
9
|
constructor(httpRequest: IHttpRequest);
|
|
9
10
|
create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void>;
|
|
11
|
+
getByDirectoryId(directoryId: string, countryId: CountryId): Promise<FiadoApiResponse<AccountBeneficiaryResponse[]>>;
|
|
12
|
+
update(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<FiadoApiResponse<unknown>>;
|
|
10
13
|
}
|
|
14
|
+
export {};
|
|
@@ -21,6 +21,14 @@ let AccountBeneficiaryApi = class AccountBeneficiaryApi {
|
|
|
21
21
|
const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
|
|
22
22
|
return await this.httpRequest.post(url, input);
|
|
23
23
|
}
|
|
24
|
+
async getByDirectoryId(directoryId, countryId) {
|
|
25
|
+
const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
|
|
26
|
+
return await this.httpRequest.get(url);
|
|
27
|
+
}
|
|
28
|
+
async update(directoryId, countryId, input) {
|
|
29
|
+
const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
|
|
30
|
+
return await this.httpRequest.put(url, input);
|
|
31
|
+
}
|
|
24
32
|
};
|
|
25
33
|
AccountBeneficiaryApi = __decorate([
|
|
26
34
|
injectable(),
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary/index.js";
|
|
1
|
+
import { AccountBeneficiaryCreateRequest, AccountBeneficiaryResponse } from "@fiado/type-kit/bin/beneficiary/index.js";
|
|
2
2
|
import { CountryId } from "@fiado/type-kit/bin/country/index.js";
|
|
3
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
4
|
+
/**
|
|
5
|
+
* API PRIVADA de `beneficiary-business` (M2M, VPC-only). Las tres operaciones viven en la MISMA ruta
|
|
6
|
+
* (`/{countryId}/users/{directoryId}`) y se distinguen por método HTTP.
|
|
7
|
+
*/
|
|
3
8
|
export interface IAccountBeneficiaryApi {
|
|
4
9
|
create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void>;
|
|
10
|
+
/** Beneficiarios vigentes del directorio. Lista vacía si no tiene ninguno. */
|
|
11
|
+
getByDirectoryId(directoryId: string, countryId: CountryId): Promise<FiadoApiResponse<AccountBeneficiaryResponse[]>>;
|
|
12
|
+
/**
|
|
13
|
+
* Reemplaza el conjunto de beneficiarios del directorio.
|
|
14
|
+
*
|
|
15
|
+
* ⚠️ Es un REEMPLAZO, no un alta incremental: se manda SIEMPRE la lista completa que debe quedar.
|
|
16
|
+
* Mandar uno solo deja uno solo.
|
|
17
|
+
*/
|
|
18
|
+
update(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<FiadoApiResponse<unknown>>;
|
|
5
19
|
}
|
|
20
|
+
export {};
|
package/bin/container.config.js
CHANGED
|
@@ -58,6 +58,7 @@ import { ServiceApi } from "./service-business/index.js";
|
|
|
58
58
|
import { DocumentImageProcessorApi } from "./document-image-processor/index.js";
|
|
59
59
|
import { OrderCollectorApi } from "./order-collector-business/index.js";
|
|
60
60
|
import EstafetaApi from "./estafeta/api/EstafetaApi.js";
|
|
61
|
+
import ShippingStatusApi from "./shipping/api/ShippingStatusApi.js";
|
|
61
62
|
import { AppSelectionDataApi } from "./appselectondata/index.js";
|
|
62
63
|
import { DirectorySettingApi } from "./directorySetting/index.js";
|
|
63
64
|
import { FirebaseConnectorApi } from "./firebase-connector/index.js";
|
|
@@ -189,6 +190,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
189
190
|
bind("IDocumentImageProcessorApi").to(DocumentImageProcessorApi);
|
|
190
191
|
bind("IOrderCollectorApi").to(OrderCollectorApi);
|
|
191
192
|
bind("IEstafetaApi").to(EstafetaApi);
|
|
193
|
+
bind("IShippingStatusApi").to(ShippingStatusApi);
|
|
192
194
|
bind("IAppSelectionDataApi").to(AppSelectionDataApi);
|
|
193
195
|
bind("IDirectorySettingApi").to(DirectorySettingApi);
|
|
194
196
|
bind("IFirebaseConnectorApi").to(FirebaseConnectorApi);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { IEstafetaApi } from "./interfaces/IEstafetaApi.js";
|
|
3
|
-
import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
|
|
4
|
-
import { CreateBankAccountCardShippingResponse } from "@fiado/type-kit/bin/card/index.js";
|
|
3
|
+
import type { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
|
|
4
|
+
import type { CreateBankAccountCardShippingResponse } from "@fiado/type-kit/bin/card/index.js";
|
|
5
5
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
6
|
-
import { UpdateBankAccountUserRequest, CreateBankAccountUserRequest, CreateBankAccountRequest } from "@fiado/type-kit/bin/account/index.js";
|
|
7
|
-
import { OfficeDetails } from "@fiado/type-kit/bin/address/index.js";
|
|
6
|
+
import type { UpdateBankAccountUserRequest, CreateBankAccountUserRequest, CreateBankAccountRequest } from "@fiado/type-kit/bin/account/index.js";
|
|
7
|
+
import type { OfficeDetails } from "@fiado/type-kit/bin/address/index.js";
|
|
8
|
+
import type { CreateShippingRequest, CreateShippingResponse } from "@fiado/type-kit/bin/shipping/index.js";
|
|
8
9
|
export default class EstafetaApi implements IEstafetaApi {
|
|
9
10
|
private httpRequest;
|
|
10
11
|
private readonly baseUrl;
|
|
@@ -22,6 +23,7 @@ export default class EstafetaApi implements IEstafetaApi {
|
|
|
22
23
|
assignCardToUser(request: AssignCardRequest): Promise<any>;
|
|
23
24
|
getShipment(object: GetBankAccountShippingRequest): Promise<any>;
|
|
24
25
|
createShipment(object: CreateBankAccountCardShippingRequest): Promise<FiadoApiResponse<CreateBankAccountCardShippingResponse>>;
|
|
26
|
+
createShipping(object: CreateShippingRequest): Promise<FiadoApiResponse<CreateShippingResponse>>;
|
|
25
27
|
getLocations(params: any): Promise<FiadoApiResponse<OfficeDetails[]>>;
|
|
26
28
|
}
|
|
27
29
|
export {};
|
|
@@ -57,6 +57,10 @@ let EstafetaApi = class EstafetaApi {
|
|
|
57
57
|
const url = `${this.baseUrl}estafeta/shipping/card`;
|
|
58
58
|
return await this.httpRequest.post(url, object);
|
|
59
59
|
}
|
|
60
|
+
async createShipping(object) {
|
|
61
|
+
const url = `${this.baseUrl}estafeta/shipping`;
|
|
62
|
+
return await this.httpRequest.post(url, object);
|
|
63
|
+
}
|
|
60
64
|
async getLocations(params) {
|
|
61
65
|
const url = `${this.baseUrl}estafeta/locations?latitude=${params.latitude}&longitude=${params.longitude}`;
|
|
62
66
|
return await this.httpRequest.get(url);
|
|
@@ -2,8 +2,14 @@ import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCar
|
|
|
2
2
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
3
3
|
import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account/index.js";
|
|
4
4
|
import { OfficeDetails } from "@fiado/type-kit/bin/address/index.js";
|
|
5
|
+
import { CreateShippingRequest, CreateShippingResponse } from "@fiado/type-kit/bin/shipping/index.js";
|
|
5
6
|
export interface IEstafetaApi {
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated El conector retiro el path `estafeta/shipping/card`. Usar `createShipping`.
|
|
9
|
+
* No se borra porque la consumen varias lambdas y borrar un metodo es un major.
|
|
10
|
+
*/
|
|
6
11
|
createShipment(object: CreateBankAccountCardShippingRequest): Promise<FiadoApiResponse<CreateBankAccountCardShippingResponse>>;
|
|
12
|
+
createShipping(object: CreateShippingRequest): Promise<FiadoApiResponse<CreateShippingResponse>>;
|
|
7
13
|
updateUser(object: UpdateBankAccountUserRequest): Promise<any>;
|
|
8
14
|
getUserById(externalUserId: string): Promise<any>;
|
|
9
15
|
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
package/bin/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export * from "./card/index.js";
|
|
|
51
51
|
export * from "./document-image-processor/index.js";
|
|
52
52
|
export * from "./order-collector-business/index.js";
|
|
53
53
|
export * from "./estafeta/index.js";
|
|
54
|
+
export * from "./shipping/index.js";
|
|
54
55
|
export * from "./appselectondata/index.js";
|
|
55
56
|
export * from "./directorySetting/index.js";
|
|
56
57
|
export * from "./firebase-connector/index.js";
|
package/bin/index.js
CHANGED
|
@@ -51,6 +51,7 @@ export * from "./card/index.js";
|
|
|
51
51
|
export * from "./document-image-processor/index.js";
|
|
52
52
|
export * from "./order-collector-business/index.js";
|
|
53
53
|
export * from "./estafeta/index.js";
|
|
54
|
+
export * from "./shipping/index.js";
|
|
54
55
|
export * from "./appselectondata/index.js";
|
|
55
56
|
export * from "./directorySetting/index.js";
|
|
56
57
|
export * from "./firebase-connector/index.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { IShippingStatusApi } from "./interfaces/IShippingStatusApi.js";
|
|
3
|
+
import type { UpdateShippingStatusRequest } from "@fiado/type-kit/bin/shipping/index.js";
|
|
4
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
|
+
export default class ShippingStatusApi implements IShippingStatusApi {
|
|
6
|
+
private httpRequest;
|
|
7
|
+
constructor(httpRequest: IHttpRequest);
|
|
8
|
+
updateShippingStatus(baseUrl: string, path: string, request: UpdateShippingStatusRequest): Promise<FiadoApiResponse<void>>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { injectable, inject } from "inversify";
|
|
14
|
+
let ShippingStatusApi = class ShippingStatusApi {
|
|
15
|
+
httpRequest;
|
|
16
|
+
constructor(httpRequest) {
|
|
17
|
+
this.httpRequest = httpRequest;
|
|
18
|
+
}
|
|
19
|
+
async updateShippingStatus(baseUrl, path, request) {
|
|
20
|
+
const url = `${baseUrl.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
|
21
|
+
return await this.httpRequest.post(url, request);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
ShippingStatusApi = __decorate([
|
|
25
|
+
injectable(),
|
|
26
|
+
__param(0, inject("IHttpRequest")),
|
|
27
|
+
__metadata("design:paramtypes", [Object])
|
|
28
|
+
], ShippingStatusApi);
|
|
29
|
+
export default ShippingStatusApi;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UpdateShippingStatusRequest } from "@fiado/type-kit/bin/shipping/index.js";
|
|
2
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
3
|
+
/**
|
|
4
|
+
* Publisher generico de notificacion de status de envio. A diferencia del resto de los Api de la
|
|
5
|
+
* lib, la baseUrl NO sale de una env del constructor: el conector la resuelve por consumidor desde
|
|
6
|
+
* su tabla de configuracion, asi que baseUrl y path viajan por llamada.
|
|
7
|
+
*/
|
|
8
|
+
export interface IShippingStatusApi {
|
|
9
|
+
updateShippingStatus(baseUrl: string, path: string, request: UpdateShippingStatusRequest): Promise<FiadoApiResponse<void>>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.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.
|
|
37
|
+
"@fiado/type-kit": "^3.235.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { inject, injectable } from "inversify";
|
|
2
2
|
import { IAccountBeneficiaryApi } from "./interfaces/IAccountBeneficiaryApi.js";
|
|
3
3
|
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
-
import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary/index.js";
|
|
4
|
+
import { AccountBeneficiaryCreateRequest, AccountBeneficiaryResponse } from "@fiado/type-kit/bin/beneficiary/index.js";
|
|
5
5
|
import { CountryId } from "@fiado/type-kit/bin/country/index.js";
|
|
6
6
|
|
|
7
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
7
8
|
|
|
8
9
|
@injectable()
|
|
9
10
|
export class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
|
|
@@ -16,4 +17,14 @@ export class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
|
|
|
16
17
|
const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
|
|
17
18
|
return await this.httpRequest.post(url, input);
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
async getByDirectoryId(directoryId: string, countryId: CountryId): Promise<FiadoApiResponse<AccountBeneficiaryResponse[]>> {
|
|
22
|
+
const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
|
|
23
|
+
return await this.httpRequest.get<FiadoApiResponse<AccountBeneficiaryResponse[]>>(url);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async update(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<FiadoApiResponse<unknown>> {
|
|
27
|
+
const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
|
|
28
|
+
return await this.httpRequest.put<FiadoApiResponse<unknown>>(url, input);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary/index.js";
|
|
1
|
+
import { AccountBeneficiaryCreateRequest, AccountBeneficiaryResponse } from "@fiado/type-kit/bin/beneficiary/index.js";
|
|
2
2
|
import { CountryId } from "@fiado/type-kit/bin/country/index.js";
|
|
3
3
|
|
|
4
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* API PRIVADA de `beneficiary-business` (M2M, VPC-only). Las tres operaciones viven en la MISMA ruta
|
|
8
|
+
* (`/{countryId}/users/{directoryId}`) y se distinguen por método HTTP.
|
|
9
|
+
*/
|
|
4
10
|
export interface IAccountBeneficiaryApi {
|
|
5
11
|
|
|
6
12
|
create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void>;
|
|
7
13
|
|
|
8
|
-
|
|
14
|
+
/** Beneficiarios vigentes del directorio. Lista vacía si no tiene ninguno. */
|
|
15
|
+
getByDirectoryId(directoryId: string, countryId: CountryId): Promise<FiadoApiResponse<AccountBeneficiaryResponse[]>>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Reemplaza el conjunto de beneficiarios del directorio.
|
|
19
|
+
*
|
|
20
|
+
* ⚠️ Es un REEMPLAZO, no un alta incremental: se manda SIEMPRE la lista completa que debe quedar.
|
|
21
|
+
* Mandar uno solo deja uno solo.
|
|
22
|
+
*/
|
|
23
|
+
update(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<FiadoApiResponse<unknown>>;
|
|
24
|
+
|
|
25
|
+
}
|
package/src/container.config.ts
CHANGED
|
@@ -85,6 +85,8 @@ import { IDocumentImageProcessorApi, DocumentImageProcessorApi } from "./documen
|
|
|
85
85
|
import { IOrderCollectorApi, OrderCollectorApi } from "./order-collector-business/index.js";
|
|
86
86
|
import { IEstafetaApi } from "./estafeta/index.js";
|
|
87
87
|
import EstafetaApi from "./estafeta/api/EstafetaApi.js";
|
|
88
|
+
import { IShippingStatusApi } from "./shipping/index.js";
|
|
89
|
+
import ShippingStatusApi from "./shipping/api/ShippingStatusApi.js";
|
|
88
90
|
import { AppSelectionDataApi, IAppSelectionDataApi } from "./appselectondata/index.js";
|
|
89
91
|
import { DirectorySettingApi, IDirectorySettingApi } from "./directorySetting/index.js";
|
|
90
92
|
import { FirebaseConnectorApi, IFirebaseConnectorApi } from "./firebase-connector/index.js";
|
|
@@ -252,6 +254,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
252
254
|
bind<IDocumentImageProcessorApi>("IDocumentImageProcessorApi").to(DocumentImageProcessorApi);
|
|
253
255
|
bind<IOrderCollectorApi>("IOrderCollectorApi").to(OrderCollectorApi);
|
|
254
256
|
bind<IEstafetaApi>("IEstafetaApi").to(EstafetaApi);
|
|
257
|
+
bind<IShippingStatusApi>("IShippingStatusApi").to(ShippingStatusApi);
|
|
255
258
|
bind<IAppSelectionDataApi>("IAppSelectionDataApi").to(AppSelectionDataApi);
|
|
256
259
|
bind<IDirectorySettingApi>("IDirectorySettingApi").to(DirectorySettingApi);
|
|
257
260
|
bind<IFirebaseConnectorApi>("IFirebaseConnectorApi").to(FirebaseConnectorApi);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { injectable, inject } from "inversify";
|
|
2
2
|
|
|
3
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
4
4
|
|
|
5
5
|
import { IEstafetaApi } from "./interfaces/IEstafetaApi.js";
|
|
6
|
-
import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
|
|
7
|
-
import { CreateBankAccountCardShippingResponse } from "@fiado/type-kit/bin/card/index.js";
|
|
6
|
+
import type { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card/index.js";
|
|
7
|
+
import type { CreateBankAccountCardShippingResponse } from "@fiado/type-kit/bin/card/index.js";
|
|
8
8
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
9
|
-
import { UpdateBankAccountUserRequest, CreateBankAccountUserRequest, CreateBankAccountRequest } from "@fiado/type-kit/bin/account/index.js";
|
|
10
|
-
import { OfficeDetails } from "@fiado/type-kit/bin/address/index.js";
|
|
9
|
+
import type { UpdateBankAccountUserRequest, CreateBankAccountUserRequest, CreateBankAccountRequest } from "@fiado/type-kit/bin/account/index.js";
|
|
10
|
+
import type { OfficeDetails } from "@fiado/type-kit/bin/address/index.js";
|
|
11
|
+
import type { CreateShippingRequest, CreateShippingResponse } from "@fiado/type-kit/bin/shipping/index.js";
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
@injectable()
|
|
@@ -60,6 +61,11 @@ export default class EstafetaApi implements IEstafetaApi {
|
|
|
60
61
|
return await this.httpRequest.post(url, object);
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
public async createShipping(object: CreateShippingRequest): Promise<FiadoApiResponse<CreateShippingResponse>> {
|
|
65
|
+
const url: string = `${this.baseUrl}estafeta/shipping`;
|
|
66
|
+
return await this.httpRequest.post(url, object);
|
|
67
|
+
}
|
|
68
|
+
|
|
63
69
|
public async getLocations(params: any): Promise<FiadoApiResponse<OfficeDetails[]>> {
|
|
64
70
|
|
|
65
71
|
const url = `${this.baseUrl}estafeta/locations?latitude=${params.latitude}&longitude=${params.longitude}`;
|
|
@@ -2,12 +2,19 @@ import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCar
|
|
|
2
2
|
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
3
3
|
import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account/index.js";
|
|
4
4
|
import { OfficeDetails } from "@fiado/type-kit/bin/address/index.js";
|
|
5
|
+
import { CreateShippingRequest, CreateShippingResponse } from "@fiado/type-kit/bin/shipping/index.js";
|
|
5
6
|
|
|
6
7
|
export interface IEstafetaApi {
|
|
7
8
|
|
|
8
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated El conector retiro el path `estafeta/shipping/card`. Usar `createShipping`.
|
|
12
|
+
* No se borra porque la consumen varias lambdas y borrar un metodo es un major.
|
|
13
|
+
*/
|
|
9
14
|
createShipment(object: CreateBankAccountCardShippingRequest): Promise<FiadoApiResponse<CreateBankAccountCardShippingResponse>>
|
|
10
15
|
|
|
16
|
+
createShipping(object: CreateShippingRequest): Promise<FiadoApiResponse<CreateShippingResponse>>
|
|
17
|
+
|
|
11
18
|
updateUser(object: UpdateBankAccountUserRequest): Promise<any>
|
|
12
19
|
getUserById(externalUserId: string): Promise<any>
|
|
13
20
|
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
package/src/index.ts
CHANGED
|
@@ -51,6 +51,7 @@ export * from "./card/index.js";
|
|
|
51
51
|
export * from "./document-image-processor/index.js";
|
|
52
52
|
export * from "./order-collector-business/index.js";
|
|
53
53
|
export * from "./estafeta/index.js";
|
|
54
|
+
export * from "./shipping/index.js";
|
|
54
55
|
export * from "./appselectondata/index.js";
|
|
55
56
|
export * from "./directorySetting/index.js";
|
|
56
57
|
export * from "./firebase-connector/index.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { injectable, inject } from "inversify";
|
|
2
|
+
|
|
3
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
|
|
5
|
+
import { IShippingStatusApi } from "./interfaces/IShippingStatusApi.js";
|
|
6
|
+
import type { UpdateShippingStatusRequest } from "@fiado/type-kit/bin/shipping/index.js";
|
|
7
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
8
|
+
|
|
9
|
+
@injectable()
|
|
10
|
+
export default class ShippingStatusApi implements IShippingStatusApi {
|
|
11
|
+
|
|
12
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public async updateShippingStatus(baseUrl: string, path: string, request: UpdateShippingStatusRequest): Promise<FiadoApiResponse<void>> {
|
|
16
|
+
const url: string = `${baseUrl.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
|
17
|
+
return await this.httpRequest.post(url, request);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UpdateShippingStatusRequest } from "@fiado/type-kit/bin/shipping/index.js";
|
|
2
|
+
type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Publisher generico de notificacion de status de envio. A diferencia del resto de los Api de la
|
|
6
|
+
* lib, la baseUrl NO sale de una env del constructor: el conector la resuelve por consumidor desde
|
|
7
|
+
* su tabla de configuracion, asi que baseUrl y path viajan por llamada.
|
|
8
|
+
*/
|
|
9
|
+
export interface IShippingStatusApi {
|
|
10
|
+
|
|
11
|
+
updateShippingStatus(baseUrl: string, path: string, request: UpdateShippingStatusRequest): Promise<FiadoApiResponse<void>>
|
|
12
|
+
}
|