@betterstore/sdk 0.3.57 → 0.3.59

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.59
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fix
8
+
9
+ ## 0.3.58
10
+
11
+ ### Patch Changes
12
+
13
+ - bug fix
14
+
3
15
  ## 0.3.57
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -204,6 +204,7 @@ interface CheckoutSession {
204
204
  shipping: number | null;
205
205
  discountAmount: number | null;
206
206
  appliedDiscounts: {
207
+ id: string;
207
208
  amount: number;
208
209
  allowedProductIDs: string[];
209
210
  discount: Discount;
@@ -233,11 +234,15 @@ declare class Checkout {
233
234
  */
234
235
  update(checkoutId: string, params: CheckoutUpdateParams): Promise<CheckoutSession>;
235
236
  /**
236
- * Update a checkout session
237
+ * Apply a discount code to a checkout session
237
238
  */
238
239
  applyDiscountCode(checkoutId: string, discountCode: string): Promise<CheckoutSession>;
239
240
  /**
240
- * Update a checkout session
241
+ * Remove a discount code from a checkout session
242
+ */
243
+ removeDiscountCode(checkoutId: string, discountId: string): Promise<CheckoutSession>;
244
+ /**
245
+ * Revalidate a checkout session
241
246
  */
242
247
  revalidateDiscounts(checkoutId: string): Promise<CheckoutSession>;
243
248
  /**
@@ -266,11 +271,15 @@ declare class Client {
266
271
  */
267
272
  updateCheckout(clientSecret: string, checkoutId: string, params: CheckoutUpdateParams): Promise<CheckoutSession>;
268
273
  /**
269
- * Update a checkout session
274
+ * Apply a discount code to a checkout session
270
275
  */
271
276
  applyDiscountCode(clientSecret: string, checkoutId: string, discountCode: string): Promise<CheckoutSession>;
272
277
  /**
273
- * Update a checkout session
278
+ * Remove a discount code from a checkout session
279
+ */
280
+ removeDiscountCode(clientSecret: string, checkoutId: string, discountId: string): Promise<CheckoutSession>;
281
+ /**
282
+ * Revalidate a checkout session
274
283
  */
275
284
  revalidateDiscounts(clientSecret: string, checkoutId: string): Promise<CheckoutSession>;
276
285
  /**
package/dist/index.d.ts CHANGED
@@ -204,6 +204,7 @@ interface CheckoutSession {
204
204
  shipping: number | null;
205
205
  discountAmount: number | null;
206
206
  appliedDiscounts: {
207
+ id: string;
207
208
  amount: number;
208
209
  allowedProductIDs: string[];
209
210
  discount: Discount;
@@ -233,11 +234,15 @@ declare class Checkout {
233
234
  */
234
235
  update(checkoutId: string, params: CheckoutUpdateParams): Promise<CheckoutSession>;
235
236
  /**
236
- * Update a checkout session
237
+ * Apply a discount code to a checkout session
237
238
  */
238
239
  applyDiscountCode(checkoutId: string, discountCode: string): Promise<CheckoutSession>;
239
240
  /**
240
- * Update a checkout session
241
+ * Remove a discount code from a checkout session
242
+ */
243
+ removeDiscountCode(checkoutId: string, discountId: string): Promise<CheckoutSession>;
244
+ /**
245
+ * Revalidate a checkout session
241
246
  */
242
247
  revalidateDiscounts(checkoutId: string): Promise<CheckoutSession>;
243
248
  /**
@@ -266,11 +271,15 @@ declare class Client {
266
271
  */
267
272
  updateCheckout(clientSecret: string, checkoutId: string, params: CheckoutUpdateParams): Promise<CheckoutSession>;
268
273
  /**
269
- * Update a checkout session
274
+ * Apply a discount code to a checkout session
270
275
  */
271
276
  applyDiscountCode(clientSecret: string, checkoutId: string, discountCode: string): Promise<CheckoutSession>;
272
277
  /**
273
- * Update a checkout session
278
+ * Remove a discount code from a checkout session
279
+ */
280
+ removeDiscountCode(clientSecret: string, checkoutId: string, discountId: string): Promise<CheckoutSession>;
281
+ /**
282
+ * Revalidate a checkout session
274
283
  */
275
284
  revalidateDiscounts(clientSecret: string, checkoutId: string): Promise<CheckoutSession>;
276
285
  /**
package/dist/index.js CHANGED
@@ -164,7 +164,7 @@ var Checkout = class {
164
164
  });
165
165
  }
166
166
  /**
167
- * Update a checkout session
167
+ * Apply a discount code to a checkout session
168
168
  */
169
169
  applyDiscountCode(checkoutId, discountCode) {
170
170
  return __async(this, null, function* () {
@@ -176,7 +176,18 @@ var Checkout = class {
176
176
  });
177
177
  }
178
178
  /**
179
- * Update a checkout session
179
+ * Remove a discount code from a checkout session
180
+ */
181
+ removeDiscountCode(checkoutId, discountId) {
182
+ return __async(this, null, function* () {
183
+ const data = yield this.apiClient.delete(
184
+ `/checkout/${checkoutId}/discounts/${discountId}`
185
+ );
186
+ return data;
187
+ });
188
+ }
189
+ /**
190
+ * Revalidate a checkout session
180
191
  */
181
192
  revalidateDiscounts(checkoutId) {
182
193
  return __async(this, null, function* () {
@@ -245,7 +256,7 @@ var Client = class {
245
256
  });
246
257
  }
247
258
  /**
248
- * Update a checkout session
259
+ * Apply a discount code to a checkout session
249
260
  */
250
261
  applyDiscountCode(clientSecret, checkoutId, discountCode) {
251
262
  return __async(this, null, function* () {
@@ -258,7 +269,19 @@ var Client = class {
258
269
  });
259
270
  }
260
271
  /**
261
- * Update a checkout session
272
+ * Remove a discount code from a checkout session
273
+ */
274
+ removeDiscountCode(clientSecret, checkoutId, discountId) {
275
+ return __async(this, null, function* () {
276
+ const apiClient = createApiClient(clientSecret, this.proxy);
277
+ const data = yield apiClient.delete(
278
+ `/checkout/${checkoutId}/discounts/${discountId}`
279
+ );
280
+ return data;
281
+ });
282
+ }
283
+ /**
284
+ * Revalidate a checkout session
262
285
  */
263
286
  revalidateDiscounts(clientSecret, checkoutId) {
264
287
  return __async(this, null, function* () {
package/dist/index.mjs CHANGED
@@ -128,7 +128,7 @@ var Checkout = class {
128
128
  });
129
129
  }
130
130
  /**
131
- * Update a checkout session
131
+ * Apply a discount code to a checkout session
132
132
  */
133
133
  applyDiscountCode(checkoutId, discountCode) {
134
134
  return __async(this, null, function* () {
@@ -140,7 +140,18 @@ var Checkout = class {
140
140
  });
141
141
  }
142
142
  /**
143
- * Update a checkout session
143
+ * Remove a discount code from a checkout session
144
+ */
145
+ removeDiscountCode(checkoutId, discountId) {
146
+ return __async(this, null, function* () {
147
+ const data = yield this.apiClient.delete(
148
+ `/checkout/${checkoutId}/discounts/${discountId}`
149
+ );
150
+ return data;
151
+ });
152
+ }
153
+ /**
154
+ * Revalidate a checkout session
144
155
  */
145
156
  revalidateDiscounts(checkoutId) {
146
157
  return __async(this, null, function* () {
@@ -209,7 +220,7 @@ var Client = class {
209
220
  });
210
221
  }
211
222
  /**
212
- * Update a checkout session
223
+ * Apply a discount code to a checkout session
213
224
  */
214
225
  applyDiscountCode(clientSecret, checkoutId, discountCode) {
215
226
  return __async(this, null, function* () {
@@ -222,7 +233,19 @@ var Client = class {
222
233
  });
223
234
  }
224
235
  /**
225
- * Update a checkout session
236
+ * Remove a discount code from a checkout session
237
+ */
238
+ removeDiscountCode(clientSecret, checkoutId, discountId) {
239
+ return __async(this, null, function* () {
240
+ const apiClient = createApiClient(clientSecret, this.proxy);
241
+ const data = yield apiClient.delete(
242
+ `/checkout/${checkoutId}/discounts/${discountId}`
243
+ );
244
+ return data;
245
+ });
246
+ }
247
+ /**
248
+ * Revalidate a checkout session
226
249
  */
227
250
  revalidateDiscounts(clientSecret, checkoutId) {
228
251
  return __async(this, null, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.57",
3
+ "version": "0.3.59",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {