@pristine-ts/stripe 0.0.166 → 0.0.170

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.
@@ -47,22 +47,22 @@ let StripeWebhooksManager = StripeWebhooksManager_1 = class StripeWebhooksManage
47
47
  throw new Error("Event is not a subscription");
48
48
  }
49
49
  const stripeSubscription = event.data.object;
50
- const parsedEvent = new event_1.Event();
51
- parsedEvent.payload = stripeSubscription;
50
+ let type;
52
51
  switch (event.type) {
53
52
  case "customer.subscription.created":
54
- parsedEvent.type = stripe_event_type_enum_1.StripeEventTypeEnum.StripeSubscriptionCreated;
53
+ type = stripe_event_type_enum_1.StripeEventTypeEnum.StripeSubscriptionCreated;
55
54
  break;
56
55
  case "customer.subscription.updated":
57
- parsedEvent.type = stripe_event_type_enum_1.StripeEventTypeEnum.StripeSubscriptionUpdated;
56
+ type = stripe_event_type_enum_1.StripeEventTypeEnum.StripeSubscriptionUpdated;
58
57
  break;
59
58
  case "customer.subscription.deleted":
60
- parsedEvent.type = stripe_event_type_enum_1.StripeEventTypeEnum.StripeSubscriptionDeleted;
59
+ type = stripe_event_type_enum_1.StripeEventTypeEnum.StripeSubscriptionDeleted;
61
60
  break;
62
61
  default:
63
62
  yield this.logHandler.debug("This event type is not supported", { event, className: StripeWebhooksManager_1.name }, stripe_module_keyname_1.StripeModuleKeyname);
64
- break;
63
+ return Promise.resolve();
65
64
  }
65
+ const parsedEvent = new event_1.Event(type, stripeSubscription);
66
66
  yield this.eventDispatcher.dispatch(parsedEvent);
67
67
  });
68
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-webhooks.manager.js","sourceRoot":"","sources":["../../../../src/managers/stripe-webhooks.manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAG5C,8CAA0D;AAC1D,4EAAoE;AAEpE,4DAAsD;AACtD,oEAA6D;AAG7D,IAAa,qBAAqB,6BAAlC,MAAa,qBAAqB;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,IAAI,GAAG,4CAAmB,CAAC,yBAAyB,CAAA;oBACpD,MAAM;gBACV,KAAK,+BAA+B;oBAChC,IAAI,GAAG,4CAAmB,CAAC,yBAAyB,CAAA;oBACpD,MAAM;gBACV,KAAK,+BAA+B;oBAChC,IAAI,GAAG,4CAAmB,CAAC,yBAAyB,CAAA;oBACpD,MAAM;gBACV;oBACI,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,kCAAkC,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,uBAAqB,CAAC,IAAI,EAAC,EAAE,2CAAmB,CAAC,CAAC;oBACrI,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;aAChC;YAED,MAAM,WAAW,GAAG,IAAI,aAAK,CAAC,IAAK,EAAE,kBAAkB,CAAC,CAAA;YAExD,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;QACpD,CAAC;KAAA;CACJ,CAAA;AA3CY,qBAAqB;IADjC,qBAAU,EAAE;IAKJ,WAAA,iBAAM,CAAC,qBAAqB,CAAC,CAAA;qCAFI,uBAAe;QAClB,4BAAY;GAHtC,qBAAqB,CA2CjC;AA3CY,sDAAqB"}
@@ -44,22 +44,22 @@ let StripeWebhooksManager = StripeWebhooksManager_1 = class StripeWebhooksManage
44
44
  throw new Error("Event is not a subscription");
45
45
  }
46
46
  const stripeSubscription = event.data.object;
47
- const parsedEvent = new Event();
48
- parsedEvent.payload = stripeSubscription;
47
+ let type;
49
48
  switch (event.type) {
50
49
  case "customer.subscription.created":
51
- parsedEvent.type = StripeEventTypeEnum.StripeSubscriptionCreated;
50
+ type = StripeEventTypeEnum.StripeSubscriptionCreated;
52
51
  break;
53
52
  case "customer.subscription.updated":
54
- parsedEvent.type = StripeEventTypeEnum.StripeSubscriptionUpdated;
53
+ type = StripeEventTypeEnum.StripeSubscriptionUpdated;
55
54
  break;
56
55
  case "customer.subscription.deleted":
57
- parsedEvent.type = StripeEventTypeEnum.StripeSubscriptionDeleted;
56
+ type = StripeEventTypeEnum.StripeSubscriptionDeleted;
58
57
  break;
59
58
  default:
60
59
  yield this.logHandler.debug("This event type is not supported", { event, className: StripeWebhooksManager_1.name }, StripeModuleKeyname);
61
- break;
60
+ return Promise.resolve();
62
61
  }
62
+ const parsedEvent = new Event(type, stripeSubscription);
63
63
  yield this.eventDispatcher.dispatch(parsedEvent);
64
64
  });
65
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-webhooks.manager.js","sourceRoot":"","sources":["../../../../src/managers/stripe-webhooks.manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAG5C,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAG7D,IAAa,qBAAqB,6BAAlC,MAAa,qBAAqB;IAC9B,YACqB,eAAgC,EAChC,YAA0B,EACK,UAA+B;QAF9D,oBAAe,GAAf,eAAe,CAAiB;QAChC,iBAAY,GAAZ,YAAY,CAAc;QACK,eAAU,GAAV,UAAU,CAAqB;IAChF,CAAC;IAEJ;;;;OAIG;IACG,qBAAqB,CAAC,OAAyB,EAAE,2BAAmC;;YACtF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,OAAO,EAAE,2BAA2B,CAAC,CAAC;YAE5F,IAAG,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE;gBAChD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,oCAAoC,EAAE,EAAC,KAAK,EAAE,SAAS,EAAE,uBAAqB,CAAC,IAAI,EAAC,EAAE,mBAAmB,CA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AAqB,CAAC,IAAI,EAAC,EAAE,mBAAmB,CAAC,CAAC;oBACrI,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;aAChC;YAED,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,IAAK,EAAE,kBAAkB,CAAC,CAAA;YAExD,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;QACpD,CAAC;KAAA;CACJ,CAAA;AA3CY,qBAAqB;IADjC,UAAU,EAAE;IAKJ,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;qCAFI,eAAe;QAClB,YAAY;GAHtC,qBAAqB,CA2CjC;SA3CY,qBAAqB"}
@@ -5,7 +5,7 @@ import Stripe from "stripe";
5
5
  export declare class StripeClient implements StripeClientInterface {
6
6
  private readonly logHandler;
7
7
  private readonly stripeApiKey;
8
- client: Stripe;
8
+ private client?;
9
9
  constructor(logHandler: LogHandlerInterface, stripeApiKey: string);
10
10
  /**
11
11
  * Returns the Stripe client of the Stripe library with the api version '2020-08-27'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pristine-ts/stripe",
3
- "version": "0.0.166",
3
+ "version": "0.0.170",
4
4
  "description": "",
5
5
  "module": "dist/lib/esm/stripe.module.js",
6
6
  "main": "dist/lib/cjs/stripe.module.js",
@@ -11,9 +11,9 @@
11
11
  "test": "jest"
12
12
  },
13
13
  "dependencies": {
14
- "@pristine-ts/common": "^0.0.166",
15
- "@pristine-ts/event": "^0.0.166",
16
- "@pristine-ts/logging": "^0.0.166",
14
+ "@pristine-ts/common": "^0.0.170",
15
+ "@pristine-ts/event": "^0.0.170",
16
+ "@pristine-ts/logging": "^0.0.170",
17
17
  "stripe": "^8.161.0"
18
18
  },
19
19
  "files": [
@@ -58,5 +58,5 @@
58
58
  "src/*.{js,ts}"
59
59
  ]
60
60
  },
61
- "gitHead": "c452544a69d17814c83d6a99a4fd788fdaa0daff"
61
+ "gitHead": "03decbb25315a120f2ead0b4f663e4148d8548a8"
62
62
  }