@betterstore/sdk 0.3.57 → 0.3.58

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,11 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.58
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fix
8
+
3
9
  ## 0.3.57
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -233,11 +233,15 @@ declare class Checkout {
233
233
  */
234
234
  update(checkoutId: string, params: CheckoutUpdateParams): Promise<CheckoutSession>;
235
235
  /**
236
- * Update a checkout session
236
+ * Apply a discount code to a checkout session
237
237
  */
238
238
  applyDiscountCode(checkoutId: string, discountCode: string): Promise<CheckoutSession>;
239
239
  /**
240
- * Update a checkout session
240
+ * Remove a discount code from a checkout session
241
+ */
242
+ removeDiscountCode(checkoutId: string, discountId: string): Promise<CheckoutSession>;
243
+ /**
244
+ * Revalidate a checkout session
241
245
  */
242
246
  revalidateDiscounts(checkoutId: string): Promise<CheckoutSession>;
243
247
  /**
@@ -266,11 +270,15 @@ declare class Client {
266
270
  */
267
271
  updateCheckout(clientSecret: string, checkoutId: string, params: CheckoutUpdateParams): Promise<CheckoutSession>;
268
272
  /**
269
- * Update a checkout session
273
+ * Apply a discount code to a checkout session
270
274
  */
271
275
  applyDiscountCode(clientSecret: string, checkoutId: string, discountCode: string): Promise<CheckoutSession>;
272
276
  /**
273
- * Update a checkout session
277
+ * Remove a discount code from a checkout session
278
+ */
279
+ removeDiscountCode(clientSecret: string, checkoutId: string, discountId: string): Promise<CheckoutSession>;
280
+ /**
281
+ * Revalidate a checkout session
274
282
  */
275
283
  revalidateDiscounts(clientSecret: string, checkoutId: string): Promise<CheckoutSession>;
276
284
  /**
package/dist/index.d.ts CHANGED
@@ -233,11 +233,15 @@ declare class Checkout {
233
233
  */
234
234
  update(checkoutId: string, params: CheckoutUpdateParams): Promise<CheckoutSession>;
235
235
  /**
236
- * Update a checkout session
236
+ * Apply a discount code to a checkout session
237
237
  */
238
238
  applyDiscountCode(checkoutId: string, discountCode: string): Promise<CheckoutSession>;
239
239
  /**
240
- * Update a checkout session
240
+ * Remove a discount code from a checkout session
241
+ */
242
+ removeDiscountCode(checkoutId: string, discountId: string): Promise<CheckoutSession>;
243
+ /**
244
+ * Revalidate a checkout session
241
245
  */
242
246
  revalidateDiscounts(checkoutId: string): Promise<CheckoutSession>;
243
247
  /**
@@ -266,11 +270,15 @@ declare class Client {
266
270
  */
267
271
  updateCheckout(clientSecret: string, checkoutId: string, params: CheckoutUpdateParams): Promise<CheckoutSession>;
268
272
  /**
269
- * Update a checkout session
273
+ * Apply a discount code to a checkout session
270
274
  */
271
275
  applyDiscountCode(clientSecret: string, checkoutId: string, discountCode: string): Promise<CheckoutSession>;
272
276
  /**
273
- * Update a checkout session
277
+ * Remove a discount code from a checkout session
278
+ */
279
+ removeDiscountCode(clientSecret: string, checkoutId: string, discountId: string): Promise<CheckoutSession>;
280
+ /**
281
+ * Revalidate a checkout session
274
282
  */
275
283
  revalidateDiscounts(clientSecret: string, checkoutId: string): Promise<CheckoutSession>;
276
284
  /**
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.58",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {