@fiado/api-invoker 1.0.69 → 1.0.71
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { AddressCreateRequest,
|
|
2
|
+
import { AddressCreateRequest, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
3
3
|
import { IAddressApi } from "./interfaces/IAddressApi";
|
|
4
4
|
export declare class AddressApi implements IAddressApi {
|
|
5
5
|
private httpRequest;
|
|
@@ -7,7 +7,7 @@ export declare class AddressApi implements IAddressApi {
|
|
|
7
7
|
constructor(httpRequest: IHttpRequest);
|
|
8
8
|
getByDirectoryId(directoryId: string): Promise<any>;
|
|
9
9
|
create(directoryId: string, address: AddressCreateRequest): Promise<void>;
|
|
10
|
-
getAddressLocationShipping(
|
|
10
|
+
getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse>;
|
|
11
11
|
private validateBaseUrl;
|
|
12
12
|
private validateDirectoryId;
|
|
13
13
|
}
|
|
@@ -31,10 +31,10 @@ let AddressApi = class AddressApi {
|
|
|
31
31
|
const url = `${this.baseUrl}users/${directoryId}`;
|
|
32
32
|
await this.httpRequest.post(url, address);
|
|
33
33
|
}
|
|
34
|
-
async getAddressLocationShipping(
|
|
34
|
+
async getAddressLocationShipping(directoryId) {
|
|
35
35
|
this.validateBaseUrl();
|
|
36
36
|
const url = `${this.baseUrl}shipping`;
|
|
37
|
-
return await this.httpRequest.post(url,
|
|
37
|
+
return await this.httpRequest.post(url, directoryId);
|
|
38
38
|
}
|
|
39
39
|
validateBaseUrl() {
|
|
40
40
|
if (!this.baseUrl) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddressCreateRequest, AddressResponse,
|
|
1
|
+
import { AddressCreateRequest, AddressResponse, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
2
2
|
export interface IAddressApi {
|
|
3
3
|
/**
|
|
4
4
|
* Obtiene una lista de direcciones por su ID de directorio.
|
|
@@ -22,5 +22,5 @@ export interface IAddressApi {
|
|
|
22
22
|
* @returns Una promesa que resuelve a un objeto de respuesta de dirección de envío.
|
|
23
23
|
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
24
24
|
*/
|
|
25
|
-
getAddressLocationShipping(
|
|
25
|
+
getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse>;
|
|
26
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.71",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { AddressCreateRequest,
|
|
2
|
+
import { AddressCreateRequest, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
3
3
|
import { inject, injectable } from "inversify";
|
|
4
4
|
import { IAddressApi } from "./interfaces/IAddressApi";
|
|
5
5
|
|
|
@@ -27,10 +27,10 @@ export class AddressApi implements IAddressApi {
|
|
|
27
27
|
await this.httpRequest.post<void>(url, address);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
async getAddressLocationShipping(
|
|
30
|
+
async getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse> {
|
|
31
31
|
this.validateBaseUrl();
|
|
32
32
|
const url = `${this.baseUrl}shipping`;
|
|
33
|
-
return await this.httpRequest.post<AddressShippingCardResponse>(url,
|
|
33
|
+
return await this.httpRequest.post<AddressShippingCardResponse>(url, directoryId);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
private validateBaseUrl() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddressCreateRequest, AddressResponse,
|
|
1
|
+
import { AddressCreateRequest, AddressResponse, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
2
2
|
|
|
3
3
|
export interface IAddressApi {
|
|
4
4
|
|
|
@@ -26,6 +26,6 @@ export interface IAddressApi {
|
|
|
26
26
|
* @returns Una promesa que resuelve a un objeto de respuesta de dirección de envío.
|
|
27
27
|
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
28
28
|
*/
|
|
29
|
-
getAddressLocationShipping(
|
|
29
|
+
getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse>
|
|
30
30
|
|
|
31
31
|
}
|