![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@samchon/shopping-api
Advanced tools
samchon/shopping-backend
provides SDK (Software Development Kit) for convenience.
For the client developers who are connecting to this backend server, samchon/shopping-backend
provides not API documents like the Swagger, but provides the API interaction library, one of the typical SDK (Software Development Kit) for the convenience.
With the SDK, client developers never need to re-define the duplicated API interfaces. Just utilize the provided interfaces and asynchronous functions defined in the SDK. It would be much convenient than any other Rest API solutions.
npm install --save samchon/shopping-api
Import the samchon/shopping-api
and enjoy the auto-completion.
import { TestValidator } from "@nestia/e2e";
import typia from "typia";
import ShoppingApi from "@samchon/shopping-api/lib/index";
import { IShoppingOrderDiscountable } from "@samchon/shopping-api/lib/structures/shoppings/orders/IShoppingOrderDiscountable";
import { IShoppingOrderPrice } from "@samchon/shopping-api/lib/structures/shoppings/orders/IShoppingOrderPrice";
import { validate_api_shopping_order_discountable } from "./internal/validate_api_shopping_order_discountable";
export const test_api_shopping_order_discountable_after_discount =
validate_api_shopping_order_discountable(async (pool, props) => {
const price: IShoppingOrderPrice =
await ShoppingApi.functional.shoppings.customers.orders.discount(
pool.customer,
props.order.id,
{
deposit: 0,
mileage: 0,
coupon_ids: props.discountable.combinations[0].coupons.map(
(coupon) => coupon.id,
),
},
);
typia.assertEquals(price);
const discountable: IShoppingOrderDiscountable =
await ShoppingApi.functional.shoppings.customers.orders.discountable(
pool.customer,
props.order.id,
{
good_ids: props.order.goods.map((good) => good.id),
},
);
typia.assertEquals(discountable);
TestValidator.equals("discountable.combinations[].amount")(
props.discountable.combinations[0].amount,
)(discountable.combinations[0].amount);
TestValidator.equals("discountable.combinations[0].coupons")(
props.discountable.combinations[0].tickets
.map((t) => t.coupon)
.sort((a, b) => a.id.localeCompare(b.id)),
)(
discountable.combinations[0].coupons.sort((a, b) =>
a.id.localeCompare(b.id),
),
);
});
FAQs
API for shopping
The npm package @samchon/shopping-api receives a total of 147 weekly downloads. As such, @samchon/shopping-api popularity was classified as not popular.
We found that @samchon/shopping-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.