@readytomog/contracts 1.5.12 → 1.6.1

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.
@@ -1,6 +1,7 @@
1
1
  import { Roles } from "../../types";
2
2
  export interface UpdateUserEvent {
3
3
  id: string;
4
+ avatar?: string;
4
5
  email?: string;
5
6
  name?: string;
6
7
  surname?: string;
@@ -9,4 +10,7 @@ export interface UpdateUserEvent {
9
10
  isTwoFactorEnabled?: boolean;
10
11
  isEmailVerified?: boolean;
11
12
  isPhoneVerified?: boolean;
13
+ customerId?: string;
14
+ isAutoRenewal?: boolean;
15
+ stripeCustomerId?: string;
12
16
  }
@@ -1,3 +1,4 @@
1
1
  export * from "./auth";
2
2
  export * from "./chat";
3
+ export * from "./payment";
3
4
  export * from "./events-constants";
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./auth"), exports);
18
18
  __exportStar(require("./chat"), exports);
19
+ __exportStar(require("./payment"), exports);
19
20
  __exportStar(require("./events-constants"), exports);
@@ -0,0 +1,16 @@
1
+ import { BillingReasonEnum, EventTypeEnum } from "./stripe-webhook";
2
+ export interface StripeSessionMetadata {
3
+ transactionId: string;
4
+ planId: string;
5
+ paymentId: string;
6
+ billingPeriod: string;
7
+ userId: string;
8
+ }
9
+ export interface CreatePaymentSubscriptionEvent {
10
+ stripeToken: string;
11
+ eventType: EventTypeEnum;
12
+ billingReason: BillingReasonEnum;
13
+ dataObjectId: string;
14
+ sessionMetadata: StripeSessionMetadata;
15
+ stripeSubscriptionId: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { BillingReasonEnum, EventTypeEnum } from "./stripe-webhook";
2
+ export interface StripeEventMetadata {
3
+ transactionId: string;
4
+ planId: string;
5
+ paymentId: string;
6
+ }
7
+ export interface FailedPaymentSubscriptionEvent {
8
+ stripeToken: string;
9
+ eventType: EventTypeEnum;
10
+ billingReason: BillingReasonEnum;
11
+ customerId: string;
12
+ externalId: string;
13
+ metaData: StripeEventMetadata;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export * from "./stripe-webhook";
2
+ export * from "./create-payment-subscription";
3
+ export * from "./renewed-subscription";
4
+ export * from "./failed-payment-subscription";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./stripe-webhook"), exports);
18
+ __exportStar(require("./create-payment-subscription"), exports);
19
+ __exportStar(require("./renewed-subscription"), exports);
20
+ __exportStar(require("./failed-payment-subscription"), exports);
@@ -0,0 +1,8 @@
1
+ import { BillingReasonEnum, EventTypeEnum } from "./stripe-webhook";
2
+ export interface RenewedSubscriptionEvent {
3
+ stripeToken: string;
4
+ eventType: EventTypeEnum;
5
+ billingReason: BillingReasonEnum;
6
+ customerId: string;
7
+ externalId: string;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export declare enum EventTypeEnum {
2
+ SESSION_COMPLETED = "checkout.session.completed",
3
+ PAYMENT_SUCCEEDED = "invoice.payment_succeeded",
4
+ PAYMENT_FAILED = "invoice.payment_failed"
5
+ }
6
+ export declare enum BillingReasonEnum {
7
+ subscription_cycle = 0
8
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillingReasonEnum = exports.EventTypeEnum = void 0;
4
+ var EventTypeEnum;
5
+ (function (EventTypeEnum) {
6
+ EventTypeEnum["SESSION_COMPLETED"] = "checkout.session.completed";
7
+ EventTypeEnum["PAYMENT_SUCCEEDED"] = "invoice.payment_succeeded";
8
+ EventTypeEnum["PAYMENT_FAILED"] = "invoice.payment_failed";
9
+ })(EventTypeEnum || (exports.EventTypeEnum = EventTypeEnum = {}));
10
+ var BillingReasonEnum;
11
+ (function (BillingReasonEnum) {
12
+ BillingReasonEnum[BillingReasonEnum["subscription_cycle"] = 0] = "subscription_cycle";
13
+ })(BillingReasonEnum || (exports.BillingReasonEnum = BillingReasonEnum = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readytomog/contracts",
3
- "version": "1.5.12",
3
+ "version": "1.6.1",
4
4
  "description": "Protobuf definitions and generated Typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",