Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopletzy/shop-sdk

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopletzy/shop-sdk - npm Package Compare versions

Comparing version 0.1.28 to 0.1.29

5

dist/order.d.ts
import { ShopletzyClient } from "./index";
import { MakePaymentReq, Order, PaymentFailureReq, PaymentSuccessReq } from "./types/index";
import { MakePaymentReq, Order, PaymentFailureReq, PaymentSuccessReq, Promotion } from "./types/index";
export declare class OrderResource {

@@ -8,2 +8,5 @@ client: ShopletzyClient;

getOrderById(orderId: string): Promise<Order>;
getPromotions(orderId: string): Promise<Promotion[]>;
applyPromotion(orderId: string, promoCode: string): Promise<any>;
removePromotion(orderId: string): Promise<any>;
makePayment(orderId: string, makePaymentReq: MakePaymentReq): Promise<{

@@ -10,0 +13,0 @@ rzrOrderId: string;

@@ -29,2 +29,33 @@ "use strict";

}
getPromotions(orderId) {
return __awaiter(this, void 0, void 0, function* () {
const d = yield this.client.fetch(`/${this.client.storeName}/v1/orders/${orderId}/promotions`);
return (yield d.json()).promotions;
});
}
applyPromotion(orderId, promoCode) {
return __awaiter(this, void 0, void 0, function* () {
const d = yield this.client.fetch(`/${this.client.storeName}/v1/orders/${orderId}/applyPromotion`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
promoCode
})
});
return yield d.json();
});
}
removePromotion(orderId) {
return __awaiter(this, void 0, void 0, function* () {
const d = yield this.client.fetch(`/${this.client.storeName}/v1/orders/${orderId}/removePromotion`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
}
});
return yield d.json();
});
}
makePayment(orderId, makePaymentReq) {

@@ -31,0 +62,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -490,2 +490,22 @@ export declare type ClientConfig = {

};
export declare type PromotionType = "amount" | "percentage";
export declare type Discount = {
amount: number;
percentage: number;
maxDiscountAmount: number;
};
export declare type Promotion = {
id: string;
title: string;
description: string;
promotionType: PromotionType;
code: string;
discount: Discount;
minOrderValue: number;
available: number;
claimed: number;
validFrom: Date;
validUpto: Date;
eligible: boolean;
};
export {};

2

package.json
{
"name": "@shopletzy/shop-sdk",
"version": "0.1.28",
"version": "0.1.29",
"description": "Shop SDK for Shopletzy Storefront APIs",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc