wabe 0.5.11 → 0.5.12

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/dist/index.d.ts CHANGED
@@ -1190,13 +1190,30 @@ export type CreatePromotionCodeOptions = {
1190
1190
  active?: boolean;
1191
1191
  maxRedemptions?: number;
1192
1192
  };
1193
+ export type DeleteCouponOptions = {
1194
+ id: string;
1195
+ };
1196
+ export type UpdatePromotionCodeOptions = {
1197
+ id: string;
1198
+ active: boolean;
1199
+ };
1193
1200
  export interface PaymentAdapter {
1201
+ /**
1202
+ * Delete a coupon
1203
+ * @param options DeleteCouponOptions
1204
+ */
1205
+ deleteCoupon: (options: DeleteCouponOptions) => Promise<void>;
1194
1206
  /**
1195
1207
  * Create a coupon
1196
1208
  * @param options CreateCouponOptions
1197
1209
  * @returns id The coupon id
1198
1210
  */
1199
1211
  createCoupon: (options: CreateCouponOptions) => Promise<string>;
1212
+ /**
1213
+ * Disable a promotion code
1214
+ * @param options DeletePromotionCodeOptions
1215
+ */
1216
+ updatePromotionCode: (options: UpdatePromotionCodeOptions) => Promise<void>;
1200
1217
  /**
1201
1218
  * Create a promotion code from a coupon
1202
1219
  * @param options CreatePromotionCodeOptions
@@ -1262,6 +1279,8 @@ declare class PaymentController implements PaymentAdapter {
1262
1279
  private adapter;
1263
1280
  private config;
1264
1281
  constructor(paymentConfig: PaymentConfig);
1282
+ deleteCoupon(options: DeleteCouponOptions): Promise<void>;
1283
+ updatePromotionCode(options: UpdatePromotionCodeOptions): Promise<void>;
1265
1284
  createCoupon(options: CreateCouponOptions): Promise<string>;
1266
1285
  createPromotionCode(options: CreatePromotionCodeOptions): Promise<string>;
1267
1286
  getCustomerById(options: GetCustomerByIdOptions): Promise<{
@@ -1406,6 +1425,8 @@ export declare class PaymentDevAdapter implements PaymentAdapter {
1406
1425
  getCustomerById(): Promise<{
1407
1426
  email: string;
1408
1427
  }>;
1428
+ deleteCoupon(): Promise<void>;
1429
+ updatePromotionCode(): Promise<void>;
1409
1430
  createCoupon(): Promise<string>;
1410
1431
  createPromotionCode(): Promise<string>;
1411
1432
  validateWebhook(): Promise<{
package/dist/index.js CHANGED
@@ -61414,6 +61414,10 @@ class PaymentDevAdapter {
61414
61414
  email: "customer@test.com"
61415
61415
  };
61416
61416
  }
61417
+ async deleteCoupon() {
61418
+ }
61419
+ async updatePromotionCode() {
61420
+ }
61417
61421
  async createCoupon() {
61418
61422
  return "";
61419
61423
  }
@@ -75667,6 +75671,12 @@ class PaymentController {
75667
75671
  this.adapter = paymentConfig.adapter;
75668
75672
  this.config = paymentConfig;
75669
75673
  }
75674
+ deleteCoupon(options) {
75675
+ return this.adapter.deleteCoupon(options);
75676
+ }
75677
+ updatePromotionCode(options) {
75678
+ return this.adapter.updatePromotionCode(options);
75679
+ }
75670
75680
  createCoupon(options) {
75671
75681
  return this.adapter.createCoupon(options);
75672
75682
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wabe",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
4
4
  "description": "Your backend in minutes not days",
5
5
  "homepage": "https://wabe.dev",
6
6
  "author": {