controlresell 2.27.0 → 3.1.0

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.
Files changed (75) hide show
  1. package/package.json +1 -1
  2. package/src/com/controlresell/api/requests/subscriptions/CancelSubscriptionRequest.d.ts +19 -0
  3. package/src/com/controlresell/api/requests/subscriptions/CancelSubscriptionRequest.d.ts.map +1 -0
  4. package/src/com/controlresell/api/requests/subscriptions/CancelSubscriptionRequest.js +9 -0
  5. package/src/com/controlresell/api/requests/subscriptions/CancelSubscriptionRequest.js.map +1 -0
  6. package/src/com/controlresell/api/requests/subscriptions/CancelSubscriptionRequest.ts +10 -0
  7. package/src/com/controlresell/api/requests/subscriptions/ChangeSubscriptionPlanRequest.d.ts +3 -0
  8. package/src/com/controlresell/api/requests/subscriptions/ChangeSubscriptionPlanRequest.d.ts.map +1 -1
  9. package/src/com/controlresell/api/requests/subscriptions/ChangeSubscriptionPlanRequest.js +2 -1
  10. package/src/com/controlresell/api/requests/subscriptions/ChangeSubscriptionPlanRequest.js.map +1 -1
  11. package/src/com/controlresell/api/requests/subscriptions/ChangeSubscriptionPlanRequest.ts +2 -1
  12. package/src/com/controlresell/api/requests/subscriptions/PauseSubscriptionRequest.d.ts +10 -0
  13. package/src/com/controlresell/api/requests/subscriptions/PauseSubscriptionRequest.d.ts.map +1 -0
  14. package/src/com/controlresell/api/requests/subscriptions/PauseSubscriptionRequest.js +5 -0
  15. package/src/com/controlresell/api/requests/subscriptions/PauseSubscriptionRequest.js.map +1 -0
  16. package/src/com/controlresell/api/requests/subscriptions/PauseSubscriptionRequest.ts +6 -0
  17. package/src/com/controlresell/api/requests/subscriptions/SubscriptionHelpRequest.d.ts +13 -0
  18. package/src/com/controlresell/api/requests/subscriptions/SubscriptionHelpRequest.d.ts.map +1 -0
  19. package/src/com/controlresell/api/requests/subscriptions/SubscriptionHelpRequest.js +7 -0
  20. package/src/com/controlresell/api/requests/subscriptions/SubscriptionHelpRequest.js.map +1 -0
  21. package/src/com/controlresell/api/requests/subscriptions/SubscriptionHelpRequest.ts +8 -0
  22. package/src/com/controlresell/api/responses/activity/ActivityLateReasonCount.d.ts +16 -0
  23. package/src/com/controlresell/api/responses/activity/ActivityLateReasonCount.d.ts.map +1 -0
  24. package/src/com/controlresell/api/responses/activity/ActivityLateReasonCount.js +8 -0
  25. package/src/com/controlresell/api/responses/activity/ActivityLateReasonCount.js.map +1 -0
  26. package/src/com/controlresell/api/responses/activity/ActivityLateReasonCount.ts +9 -0
  27. package/src/com/controlresell/api/responses/activity/ActivitySummaryResponse.d.ts +29 -0
  28. package/src/com/controlresell/api/responses/activity/ActivitySummaryResponse.d.ts.map +1 -1
  29. package/src/com/controlresell/api/responses/activity/ActivitySummaryResponse.js +5 -1
  30. package/src/com/controlresell/api/responses/activity/ActivitySummaryResponse.js.map +1 -1
  31. package/src/com/controlresell/api/responses/activity/ActivitySummaryResponse.ts +5 -1
  32. package/src/com/controlresell/api/responses/subscriptions/SubscriptionAmount.d.ts +13 -0
  33. package/src/com/controlresell/api/responses/subscriptions/SubscriptionAmount.d.ts.map +1 -0
  34. package/src/com/controlresell/api/responses/subscriptions/SubscriptionAmount.js +6 -0
  35. package/src/com/controlresell/api/responses/subscriptions/SubscriptionAmount.js.map +1 -0
  36. package/src/com/controlresell/api/responses/subscriptions/SubscriptionAmount.ts +7 -0
  37. package/src/com/controlresell/api/responses/subscriptions/SubscriptionChangePreview.d.ts +85 -0
  38. package/src/com/controlresell/api/responses/subscriptions/SubscriptionChangePreview.d.ts.map +1 -0
  39. package/src/com/controlresell/api/responses/subscriptions/SubscriptionChangePreview.js +12 -0
  40. package/src/com/controlresell/api/responses/subscriptions/SubscriptionChangePreview.js.map +1 -0
  41. package/src/com/controlresell/api/responses/subscriptions/SubscriptionChangePreview.ts +13 -0
  42. package/src/com/controlresell/api/responses/subscriptions/SubscriptionStatus.d.ts +39 -3
  43. package/src/com/controlresell/api/responses/subscriptions/SubscriptionStatus.d.ts.map +1 -1
  44. package/src/com/controlresell/api/responses/subscriptions/SubscriptionStatus.js +10 -1
  45. package/src/com/controlresell/api/responses/subscriptions/SubscriptionStatus.js.map +1 -1
  46. package/src/com/controlresell/api/responses/subscriptions/SubscriptionStatus.ts +10 -1
  47. package/src/com/controlresell/models/discord/DiscordLinkCreatedEvent.d.ts +3 -3
  48. package/src/com/controlresell/models/subscriptions/CancellationReason.d.ts +1 -1
  49. package/src/com/controlresell/models/subscriptions/CancellationReason.d.ts.map +1 -1
  50. package/src/com/controlresell/models/subscriptions/CancellationReason.js +2 -2
  51. package/src/com/controlresell/models/subscriptions/CancellationReason.js.map +1 -1
  52. package/src/com/controlresell/models/subscriptions/CancellationReason.ts +2 -2
  53. package/src/com/controlresell/models/subscriptions/SubscriptionChangedEvent.d.ts +3 -3
  54. package/src/com/controlresell/models/subscriptions/SubscriptionHistory.d.ts +48 -8
  55. package/src/com/controlresell/models/subscriptions/SubscriptionHistory.d.ts.map +1 -1
  56. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryMetadata.d.ts +56 -6
  57. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryMetadata.d.ts.map +1 -1
  58. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryMetadata.js +10 -0
  59. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryMetadata.js.map +1 -1
  60. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryMetadata.ts +12 -0
  61. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryType.d.ts +1 -1
  62. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryType.d.ts.map +1 -1
  63. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryType.js +2 -2
  64. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryType.js.map +1 -1
  65. package/src/com/controlresell/models/subscriptions/SubscriptionHistoryType.ts +2 -2
  66. package/src/com/controlresell/models/subscriptions/SubscriptionState.d.ts +1 -1
  67. package/src/com/controlresell/models/subscriptions/SubscriptionState.d.ts.map +1 -1
  68. package/src/com/controlresell/models/subscriptions/SubscriptionState.js +2 -2
  69. package/src/com/controlresell/models/subscriptions/SubscriptionState.js.map +1 -1
  70. package/src/com/controlresell/models/subscriptions/SubscriptionState.ts +2 -2
  71. package/src/index.d.ts +6 -0
  72. package/src/index.d.ts.map +1 -1
  73. package/src/index.js +6 -0
  74. package/src/index.js.map +1 -1
  75. package/src/index.ts +6 -0
@@ -3,7 +3,7 @@ export declare const DiscordLinkCreatedEventSchema: z.ZodObject<{
3
3
  userId: z.ZodNumber;
4
4
  discordUserId: z.ZodString;
5
5
  discordUsername: z.ZodString;
6
- subscriptionState: z.ZodEnum<["NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED"]>;
6
+ subscriptionState: z.ZodCatch<z.ZodEnum<["NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED", "PAUSED", "UNKNOWN"]>>;
7
7
  activeLevels: z.ZodArray<z.ZodObject<{
8
8
  id: z.ZodNumber;
9
9
  name: z.ZodString;
@@ -24,7 +24,7 @@ export declare const DiscordLinkCreatedEventSchema: z.ZodObject<{
24
24
  userId: number;
25
25
  discordUserId: string;
26
26
  discordUsername: string;
27
- subscriptionState: "NONE" | "ACTIVE" | "TRIAL" | "TRIAL_ENDED" | "CANCELING" | "GRACE_PERIOD" | "EXPIRED";
27
+ subscriptionState: "UNKNOWN" | "NONE" | "ACTIVE" | "PAUSED" | "TRIAL" | "TRIAL_ENDED" | "CANCELING" | "GRACE_PERIOD" | "EXPIRED";
28
28
  activeLevels: {
29
29
  name: string;
30
30
  id: number;
@@ -35,13 +35,13 @@ export declare const DiscordLinkCreatedEventSchema: z.ZodObject<{
35
35
  userId: number;
36
36
  discordUserId: string;
37
37
  discordUsername: string;
38
- subscriptionState: "NONE" | "ACTIVE" | "TRIAL" | "TRIAL_ENDED" | "CANCELING" | "GRACE_PERIOD" | "EXPIRED";
39
38
  activeLevels: {
40
39
  name: string;
41
40
  id: number;
42
41
  multiplier: number;
43
42
  discordRoleId?: string | null | undefined;
44
43
  }[];
44
+ subscriptionState?: unknown;
45
45
  }>;
46
46
  export type DiscordLinkCreatedEvent = z.infer<typeof DiscordLinkCreatedEventSchema>;
47
47
  //# sourceMappingURL=DiscordLinkCreatedEvent.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import { z } from "zod";
2
- export declare const CancellationReasonSchema: z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"]>;
2
+ export declare const CancellationReasonSchema: z.ZodCatch<z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER", "TOO_EXPENSIVE", "SEASONAL_PAUSE", "BUGS", "VINTED_ACCOUNT_BLOCKED", "SWITCHED_COMPETITOR", "CANT_USE_IT", "NOT_SELLING_ENOUGH", "MISSING_FEATURE", "UNKNOWN"]>>;
3
3
  export type CancellationReason = z.infer<typeof CancellationReasonSchema>;
4
4
  //# sourceMappingURL=CancellationReason.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CancellationReason.d.ts","sourceRoot":"","sources":["CancellationReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,eAAO,MAAM,wBAAwB,yFAEnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
1
+ {"version":3,"file":"CancellationReason.d.ts","sourceRoot":"","sources":["CancellationReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,eAAO,MAAM,wBAAwB,oQAElB,CAAA;AACnB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
2
  export const CancellationReasonSchema = z.enum([
3
- "USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"
4
- ]);
3
+ "USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER", "TOO_EXPENSIVE", "SEASONAL_PAUSE", "BUGS", "VINTED_ACCOUNT_BLOCKED", "SWITCHED_COMPETITOR", "CANT_USE_IT", "NOT_SELLING_ENOUGH", "MISSING_FEATURE", "UNKNOWN"
4
+ ]).catch("UNKNOWN");
5
5
  //# sourceMappingURL=CancellationReason.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CancellationReason.js","sourceRoot":"","sources":["CancellationReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3C,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,OAAO;CAC7E,CAAC,CAAA"}
1
+ {"version":3,"file":"CancellationReason.js","sourceRoot":"","sources":["CancellationReason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3C,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,SAAS;CAC5O,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import {z} from "zod"
2
2
 
3
3
  export const CancellationReasonSchema = z.enum([
4
- "USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"
5
- ])
4
+ "USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER", "TOO_EXPENSIVE", "SEASONAL_PAUSE", "BUGS", "VINTED_ACCOUNT_BLOCKED", "SWITCHED_COMPETITOR", "CANT_USE_IT", "NOT_SELLING_ENOUGH", "MISSING_FEATURE", "UNKNOWN"
5
+ ]).catch("UNKNOWN")
6
6
  export type CancellationReason = z.infer<typeof CancellationReasonSchema>
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const SubscriptionChangedEventSchema: z.ZodObject<{
3
3
  userId: z.ZodNumber;
4
- state: z.ZodEnum<["NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED"]>;
4
+ state: z.ZodCatch<z.ZodEnum<["NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED", "PAUSED", "UNKNOWN"]>>;
5
5
  activeLevels: z.ZodArray<z.ZodObject<{
6
6
  id: z.ZodNumber;
7
7
  name: z.ZodString;
@@ -21,7 +21,7 @@ export declare const SubscriptionChangedEventSchema: z.ZodObject<{
21
21
  managedRoleIds: z.ZodArray<z.ZodString, "many">;
22
22
  }, "strip", z.ZodTypeAny, {
23
23
  userId: number;
24
- state: "NONE" | "ACTIVE" | "TRIAL" | "TRIAL_ENDED" | "CANCELING" | "GRACE_PERIOD" | "EXPIRED";
24
+ state: "UNKNOWN" | "NONE" | "ACTIVE" | "PAUSED" | "TRIAL" | "TRIAL_ENDED" | "CANCELING" | "GRACE_PERIOD" | "EXPIRED";
25
25
  activeLevels: {
26
26
  name: string;
27
27
  id: number;
@@ -31,7 +31,6 @@ export declare const SubscriptionChangedEventSchema: z.ZodObject<{
31
31
  managedRoleIds: string[];
32
32
  }, {
33
33
  userId: number;
34
- state: "NONE" | "ACTIVE" | "TRIAL" | "TRIAL_ENDED" | "CANCELING" | "GRACE_PERIOD" | "EXPIRED";
35
34
  activeLevels: {
36
35
  name: string;
37
36
  id: number;
@@ -39,6 +38,7 @@ export declare const SubscriptionChangedEventSchema: z.ZodObject<{
39
38
  discordRoleId?: string | null | undefined;
40
39
  }[];
41
40
  managedRoleIds: string[];
41
+ state?: unknown;
42
42
  }>;
43
43
  export type SubscriptionChangedEvent = z.infer<typeof SubscriptionChangedEventSchema>;
44
44
  //# sourceMappingURL=SubscriptionChangedEvent.d.ts.map
@@ -2,24 +2,48 @@ import { z } from "zod";
2
2
  export declare const SubscriptionHistorySchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  userId: z.ZodNumber;
5
- type: z.ZodEnum<["TRIAL_STARTED", "TRIAL_UPGRADED", "TRIAL_EXPIRED", "LEVEL_ADDED", "LEVEL_REMOVED", "MULTIPLIER_CHANGED", "SUBSCRIPTION_PAUSED", "SUBSCRIPTION_RESUMED", "SUBSCRIPTION_CANCELED", "PAYMENT_SUCCEEDED", "PAYMENT_FAILED"]>;
5
+ type: z.ZodCatch<z.ZodEnum<["TRIAL_STARTED", "TRIAL_UPGRADED", "TRIAL_EXPIRED", "LEVEL_ADDED", "LEVEL_REMOVED", "MULTIPLIER_CHANGED", "SUBSCRIPTION_PAUSED", "SUBSCRIPTION_RESUMED", "SUBSCRIPTION_CANCELED", "PAYMENT_SUCCEEDED", "PAYMENT_FAILED", "CANCELLATION_REQUESTED", "CANCELLATION_UNDONE", "SUBSCRIPTION_REACTIVATED", "ADDON_SUBSCRIPTION_CANCELED", "SECONDARY_SUBSCRIPTION_CANCELED", "UNKNOWN"]>>;
6
6
  levelId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7
7
  levelName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
8
  multiplierBefore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
9
9
  multiplierAfter: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
10
10
  source: z.ZodEnum<["STRIPE_WEBHOOK", "MANUAL_SYNC", "USER_ACTION"]>;
11
11
  metadata: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
12
- reason: z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"]>;
12
+ reason: z.ZodCatch<z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER", "TOO_EXPENSIVE", "SEASONAL_PAUSE", "BUGS", "VINTED_ACCOUNT_BLOCKED", "SWITCHED_COMPETITOR", "CANT_USE_IT", "NOT_SELLING_ENOUGH", "MISSING_FEATURE", "UNKNOWN"]>>;
13
13
  comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
+ competitor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ missingFeature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
16
  type: z.ZodLiteral<"CANCELLATION">;
15
17
  }, "strip", z.ZodTypeAny, {
16
18
  type: "CANCELLATION";
17
- reason: "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
19
+ reason: "UNKNOWN" | "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER" | "TOO_EXPENSIVE" | "SEASONAL_PAUSE" | "BUGS" | "VINTED_ACCOUNT_BLOCKED" | "SWITCHED_COMPETITOR" | "CANT_USE_IT" | "NOT_SELLING_ENOUGH" | "MISSING_FEATURE";
18
20
  comment?: string | null | undefined;
21
+ competitor?: string | null | undefined;
22
+ missingFeature?: string | null | undefined;
19
23
  }, {
20
24
  type: "CANCELLATION";
21
- reason: "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
25
+ reason?: unknown;
22
26
  comment?: string | null | undefined;
27
+ competitor?: string | null | undefined;
28
+ missingFeature?: string | null | undefined;
29
+ }>, z.ZodObject<{
30
+ pauseId: z.ZodString;
31
+ resumesAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
32
+ months: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
33
+ eventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
+ type: z.ZodLiteral<"PAUSE">;
35
+ }, "strip", z.ZodTypeAny, {
36
+ type: "PAUSE";
37
+ pauseId: string;
38
+ resumesAt?: Date | null | undefined;
39
+ months?: number | null | undefined;
40
+ eventId?: string | null | undefined;
41
+ }, {
42
+ type: "PAUSE";
43
+ pauseId: string;
44
+ resumesAt?: Date | null | undefined;
45
+ months?: number | null | undefined;
46
+ eventId?: string | null | undefined;
23
47
  }>, z.ZodObject<{
24
48
  amount: z.ZodNumber;
25
49
  currency: z.ZodString;
@@ -72,7 +96,7 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
72
96
  createdAt: z.ZodDate;
73
97
  requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
98
  }, "strip", z.ZodTypeAny, {
75
- type: "PAYMENT_FAILED" | "TRIAL_STARTED" | "TRIAL_UPGRADED" | "TRIAL_EXPIRED" | "LEVEL_ADDED" | "LEVEL_REMOVED" | "MULTIPLIER_CHANGED" | "SUBSCRIPTION_PAUSED" | "SUBSCRIPTION_RESUMED" | "SUBSCRIPTION_CANCELED" | "PAYMENT_SUCCEEDED";
99
+ type: "UNKNOWN" | "PAYMENT_FAILED" | "TRIAL_STARTED" | "TRIAL_UPGRADED" | "TRIAL_EXPIRED" | "LEVEL_ADDED" | "LEVEL_REMOVED" | "MULTIPLIER_CHANGED" | "SUBSCRIPTION_PAUSED" | "SUBSCRIPTION_RESUMED" | "SUBSCRIPTION_CANCELED" | "PAYMENT_SUCCEEDED" | "CANCELLATION_REQUESTED" | "CANCELLATION_UNDONE" | "SUBSCRIPTION_REACTIVATED" | "ADDON_SUBSCRIPTION_CANCELED" | "SECONDARY_SUBSCRIPTION_CANCELED";
76
100
  id: string;
77
101
  createdAt: Date;
78
102
  userId: number;
@@ -84,8 +108,16 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
84
108
  multiplierAfter?: number | null | undefined;
85
109
  metadata?: {
86
110
  type: "CANCELLATION";
87
- reason: "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
111
+ reason: "UNKNOWN" | "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER" | "TOO_EXPENSIVE" | "SEASONAL_PAUSE" | "BUGS" | "VINTED_ACCOUNT_BLOCKED" | "SWITCHED_COMPETITOR" | "CANT_USE_IT" | "NOT_SELLING_ENOUGH" | "MISSING_FEATURE";
88
112
  comment?: string | null | undefined;
113
+ competitor?: string | null | undefined;
114
+ missingFeature?: string | null | undefined;
115
+ } | {
116
+ type: "PAUSE";
117
+ pauseId: string;
118
+ resumesAt?: Date | null | undefined;
119
+ months?: number | null | undefined;
120
+ eventId?: string | null | undefined;
89
121
  } | {
90
122
  type: "PRICE_CHANGE";
91
123
  amount: number;
@@ -104,11 +136,11 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
104
136
  convertedToPaid: boolean;
105
137
  } | null | undefined;
106
138
  }, {
107
- type: "PAYMENT_FAILED" | "TRIAL_STARTED" | "TRIAL_UPGRADED" | "TRIAL_EXPIRED" | "LEVEL_ADDED" | "LEVEL_REMOVED" | "MULTIPLIER_CHANGED" | "SUBSCRIPTION_PAUSED" | "SUBSCRIPTION_RESUMED" | "SUBSCRIPTION_CANCELED" | "PAYMENT_SUCCEEDED";
108
139
  id: string;
109
140
  createdAt: Date;
110
141
  userId: number;
111
142
  source: "STRIPE_WEBHOOK" | "MANUAL_SYNC" | "USER_ACTION";
143
+ type?: unknown;
112
144
  requestId?: string | null | undefined;
113
145
  levelId?: number | null | undefined;
114
146
  levelName?: string | null | undefined;
@@ -116,8 +148,16 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
116
148
  multiplierAfter?: number | null | undefined;
117
149
  metadata?: {
118
150
  type: "CANCELLATION";
119
- reason: "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
151
+ reason?: unknown;
120
152
  comment?: string | null | undefined;
153
+ competitor?: string | null | undefined;
154
+ missingFeature?: string | null | undefined;
155
+ } | {
156
+ type: "PAUSE";
157
+ pauseId: string;
158
+ resumesAt?: Date | null | undefined;
159
+ months?: number | null | undefined;
160
+ eventId?: string | null | undefined;
121
161
  } | {
122
162
  type: "PRICE_CHANGE";
123
163
  amount: number;
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionHistory.d.ts","sourceRoot":"","sources":["SubscriptionHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAKrB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
1
+ {"version":3,"file":"SubscriptionHistory.d.ts","sourceRoot":"","sources":["SubscriptionHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAKrB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
@@ -1,18 +1,44 @@
1
1
  import { z } from "zod";
2
2
  export declare const CancellationSchema: z.ZodObject<{
3
- reason: z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"]>;
3
+ reason: z.ZodCatch<z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER", "TOO_EXPENSIVE", "SEASONAL_PAUSE", "BUGS", "VINTED_ACCOUNT_BLOCKED", "SWITCHED_COMPETITOR", "CANT_USE_IT", "NOT_SELLING_ENOUGH", "MISSING_FEATURE", "UNKNOWN"]>>;
4
4
  comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
+ competitor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
+ missingFeature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
7
  type: z.ZodLiteral<"CANCELLATION">;
6
8
  }, "strip", z.ZodTypeAny, {
7
9
  type: "CANCELLATION";
8
- reason: "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
10
+ reason: "UNKNOWN" | "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER" | "TOO_EXPENSIVE" | "SEASONAL_PAUSE" | "BUGS" | "VINTED_ACCOUNT_BLOCKED" | "SWITCHED_COMPETITOR" | "CANT_USE_IT" | "NOT_SELLING_ENOUGH" | "MISSING_FEATURE";
9
11
  comment?: string | null | undefined;
12
+ competitor?: string | null | undefined;
13
+ missingFeature?: string | null | undefined;
10
14
  }, {
11
15
  type: "CANCELLATION";
12
- reason: "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
16
+ reason?: unknown;
13
17
  comment?: string | null | undefined;
18
+ competitor?: string | null | undefined;
19
+ missingFeature?: string | null | undefined;
14
20
  }>;
15
21
  export type Cancellation = z.infer<typeof CancellationSchema>;
22
+ export declare const PauseSchema: z.ZodObject<{
23
+ pauseId: z.ZodString;
24
+ resumesAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
25
+ months: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
26
+ eventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ type: z.ZodLiteral<"PAUSE">;
28
+ }, "strip", z.ZodTypeAny, {
29
+ type: "PAUSE";
30
+ pauseId: string;
31
+ resumesAt?: Date | null | undefined;
32
+ months?: number | null | undefined;
33
+ eventId?: string | null | undefined;
34
+ }, {
35
+ type: "PAUSE";
36
+ pauseId: string;
37
+ resumesAt?: Date | null | undefined;
38
+ months?: number | null | undefined;
39
+ eventId?: string | null | undefined;
40
+ }>;
41
+ export type Pause = z.infer<typeof PauseSchema>;
16
42
  export declare const PriceChangeSchema: z.ZodObject<{
17
43
  amount: z.ZodNumber;
18
44
  currency: z.ZodString;
@@ -68,17 +94,41 @@ export declare const TrialSchema: z.ZodObject<{
68
94
  }>;
69
95
  export type Trial = z.infer<typeof TrialSchema>;
70
96
  export declare const SubscriptionHistoryMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
71
- reason: z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"]>;
97
+ reason: z.ZodCatch<z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER", "TOO_EXPENSIVE", "SEASONAL_PAUSE", "BUGS", "VINTED_ACCOUNT_BLOCKED", "SWITCHED_COMPETITOR", "CANT_USE_IT", "NOT_SELLING_ENOUGH", "MISSING_FEATURE", "UNKNOWN"]>>;
72
98
  comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
99
+ competitor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
100
+ missingFeature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
101
  type: z.ZodLiteral<"CANCELLATION">;
74
102
  }, "strip", z.ZodTypeAny, {
75
103
  type: "CANCELLATION";
76
- reason: "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
104
+ reason: "UNKNOWN" | "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER" | "TOO_EXPENSIVE" | "SEASONAL_PAUSE" | "BUGS" | "VINTED_ACCOUNT_BLOCKED" | "SWITCHED_COMPETITOR" | "CANT_USE_IT" | "NOT_SELLING_ENOUGH" | "MISSING_FEATURE";
77
105
  comment?: string | null | undefined;
106
+ competitor?: string | null | undefined;
107
+ missingFeature?: string | null | undefined;
78
108
  }, {
79
109
  type: "CANCELLATION";
80
- reason: "PAYMENT_FAILED" | "USER_REQUESTED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
110
+ reason?: unknown;
81
111
  comment?: string | null | undefined;
112
+ competitor?: string | null | undefined;
113
+ missingFeature?: string | null | undefined;
114
+ }>, z.ZodObject<{
115
+ pauseId: z.ZodString;
116
+ resumesAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
117
+ months: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
118
+ eventId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
119
+ type: z.ZodLiteral<"PAUSE">;
120
+ }, "strip", z.ZodTypeAny, {
121
+ type: "PAUSE";
122
+ pauseId: string;
123
+ resumesAt?: Date | null | undefined;
124
+ months?: number | null | undefined;
125
+ eventId?: string | null | undefined;
126
+ }, {
127
+ type: "PAUSE";
128
+ pauseId: string;
129
+ resumesAt?: Date | null | undefined;
130
+ months?: number | null | undefined;
131
+ eventId?: string | null | undefined;
82
132
  }>, z.ZodObject<{
83
133
  amount: z.ZodNumber;
84
134
  currency: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionHistoryMetadata.d.ts","sourceRoot":"","sources":["SubscriptionHistoryMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,C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M,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAKtB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAE/C,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAM5C,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA"}
@@ -3,8 +3,17 @@ import { CancellationReasonSchema } from "./CancellationReason";
3
3
  export const CancellationSchema = z.object({
4
4
  reason: CancellationReasonSchema,
5
5
  comment: z.string().nullish(),
6
+ competitor: z.string().nullish(),
7
+ missingFeature: z.string().nullish(),
6
8
  type: z.literal("CANCELLATION")
7
9
  });
10
+ export const PauseSchema = z.object({
11
+ pauseId: z.string(),
12
+ resumesAt: z.coerce.date().nullish(),
13
+ months: z.number().int().nullish(),
14
+ eventId: z.string().nullish(),
15
+ type: z.literal("PAUSE")
16
+ });
8
17
  export const PriceChangeSchema = z.object({
9
18
  amount: z.number(),
10
19
  currency: z.string(),
@@ -26,6 +35,7 @@ export const TrialSchema = z.object({
26
35
  });
27
36
  export const SubscriptionHistoryMetadataSchema = z.discriminatedUnion("type", [
28
37
  CancellationSchema,
38
+ PauseSchema,
29
39
  PriceChangeSchema,
30
40
  StripeEventSchema,
31
41
  TrialSchema
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionHistoryMetadata.js","sourceRoot":"","sources":["SubscriptionHistoryMetadata.ts"],"names":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E,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;CAClC,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IACpC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC/B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;CAClC,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE;IAC1B,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE;IACxB,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;IAC5B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;CAC3B,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC1E,kBAAkB;IAClB,WAAW;IACX,iBAAiB;IACjB,iBAAiB;IACjB,WAAW;CACd,CAAC,CAAA"}
@@ -4,10 +4,21 @@ import {CancellationReasonSchema} from "./CancellationReason"
4
4
  export const CancellationSchema = z.object({
5
5
  reason: CancellationReasonSchema,
6
6
  comment: z.string().nullish(),
7
+ competitor: z.string().nullish(),
8
+ missingFeature: z.string().nullish(),
7
9
  type: z.literal("CANCELLATION")
8
10
  })
9
11
  export type Cancellation = z.infer<typeof CancellationSchema>
10
12
 
13
+ export const PauseSchema = z.object({
14
+ pauseId: z.string(),
15
+ resumesAt: z.coerce.date().nullish(),
16
+ months: z.number().int().nullish(),
17
+ eventId: z.string().nullish(),
18
+ type: z.literal("PAUSE")
19
+ })
20
+ export type Pause = z.infer<typeof PauseSchema>
21
+
11
22
  export const PriceChangeSchema = z.object({
12
23
  amount: z.number(),
13
24
  currency: z.string(),
@@ -35,6 +46,7 @@ export type Trial = z.infer<typeof TrialSchema>
35
46
 
36
47
  export const SubscriptionHistoryMetadataSchema = z.discriminatedUnion("type", [
37
48
  CancellationSchema,
49
+ PauseSchema,
38
50
  PriceChangeSchema,
39
51
  StripeEventSchema,
40
52
  TrialSchema
@@ -1,4 +1,4 @@
1
1
  import { z } from "zod";
2
- export declare const SubscriptionHistoryTypeSchema: z.ZodEnum<["TRIAL_STARTED", "TRIAL_UPGRADED", "TRIAL_EXPIRED", "LEVEL_ADDED", "LEVEL_REMOVED", "MULTIPLIER_CHANGED", "SUBSCRIPTION_PAUSED", "SUBSCRIPTION_RESUMED", "SUBSCRIPTION_CANCELED", "PAYMENT_SUCCEEDED", "PAYMENT_FAILED"]>;
2
+ export declare const SubscriptionHistoryTypeSchema: z.ZodCatch<z.ZodEnum<["TRIAL_STARTED", "TRIAL_UPGRADED", "TRIAL_EXPIRED", "LEVEL_ADDED", "LEVEL_REMOVED", "MULTIPLIER_CHANGED", "SUBSCRIPTION_PAUSED", "SUBSCRIPTION_RESUMED", "SUBSCRIPTION_CANCELED", "PAYMENT_SUCCEEDED", "PAYMENT_FAILED", "CANCELLATION_REQUESTED", "CANCELLATION_UNDONE", "SUBSCRIPTION_REACTIVATED", "ADDON_SUBSCRIPTION_CANCELED", "SECONDARY_SUBSCRIPTION_CANCELED", "UNKNOWN"]>>;
3
3
  export type SubscriptionHistoryType = z.infer<typeof SubscriptionHistoryTypeSchema>;
4
4
  //# sourceMappingURL=SubscriptionHistoryType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionHistoryType.d.ts","sourceRoot":"","sources":["SubscriptionHistoryType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,eAAO,MAAM,6BAA6B,sOAExC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA"}
1
+ {"version":3,"file":"SubscriptionHistoryType.d.ts","sourceRoot":"","sources":["SubscriptionHistoryType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,eAAO,MAAM,6BAA6B,4YAEvB,CAAA;AACnB,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
2
  export const SubscriptionHistoryTypeSchema = z.enum([
3
- "TRIAL_STARTED", "TRIAL_UPGRADED", "TRIAL_EXPIRED", "LEVEL_ADDED", "LEVEL_REMOVED", "MULTIPLIER_CHANGED", "SUBSCRIPTION_PAUSED", "SUBSCRIPTION_RESUMED", "SUBSCRIPTION_CANCELED", "PAYMENT_SUCCEEDED", "PAYMENT_FAILED"
4
- ]);
3
+ "TRIAL_STARTED", "TRIAL_UPGRADED", "TRIAL_EXPIRED", "LEVEL_ADDED", "LEVEL_REMOVED", "MULTIPLIER_CHANGED", "SUBSCRIPTION_PAUSED", "SUBSCRIPTION_RESUMED", "SUBSCRIPTION_CANCELED", "PAYMENT_SUCCEEDED", "PAYMENT_FAILED", "CANCELLATION_REQUESTED", "CANCELLATION_UNDONE", "SUBSCRIPTION_REACTIVATED", "ADDON_SUBSCRIPTION_CANCELED", "SECONDARY_SUBSCRIPTION_CANCELED", "UNKNOWN"
4
+ ]).catch("UNKNOWN");
5
5
  //# sourceMappingURL=SubscriptionHistoryType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionHistoryType.js","sourceRoot":"","sources":["SubscriptionHistoryType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,IAAI,CAAC;IAChD,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,gBAAgB;CAC1N,CAAC,CAAA"}
1
+ {"version":3,"file":"SubscriptionHistoryType.js","sourceRoot":"","sources":["SubscriptionHistoryType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,IAAI,CAAC;IAChD,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,iCAAiC,EAAE,SAAS;CACpX,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import {z} from "zod"
2
2
 
3
3
  export const SubscriptionHistoryTypeSchema = z.enum([
4
- "TRIAL_STARTED", "TRIAL_UPGRADED", "TRIAL_EXPIRED", "LEVEL_ADDED", "LEVEL_REMOVED", "MULTIPLIER_CHANGED", "SUBSCRIPTION_PAUSED", "SUBSCRIPTION_RESUMED", "SUBSCRIPTION_CANCELED", "PAYMENT_SUCCEEDED", "PAYMENT_FAILED"
5
- ])
4
+ "TRIAL_STARTED", "TRIAL_UPGRADED", "TRIAL_EXPIRED", "LEVEL_ADDED", "LEVEL_REMOVED", "MULTIPLIER_CHANGED", "SUBSCRIPTION_PAUSED", "SUBSCRIPTION_RESUMED", "SUBSCRIPTION_CANCELED", "PAYMENT_SUCCEEDED", "PAYMENT_FAILED", "CANCELLATION_REQUESTED", "CANCELLATION_UNDONE", "SUBSCRIPTION_REACTIVATED", "ADDON_SUBSCRIPTION_CANCELED", "SECONDARY_SUBSCRIPTION_CANCELED", "UNKNOWN"
5
+ ]).catch("UNKNOWN")
6
6
  export type SubscriptionHistoryType = z.infer<typeof SubscriptionHistoryTypeSchema>
@@ -1,4 +1,4 @@
1
1
  import { z } from "zod";
2
- export declare const SubscriptionStateSchema: z.ZodEnum<["NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED"]>;
2
+ export declare const SubscriptionStateSchema: z.ZodCatch<z.ZodEnum<["NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED", "PAUSED", "UNKNOWN"]>>;
3
3
  export type SubscriptionState = z.infer<typeof SubscriptionStateSchema>;
4
4
  //# sourceMappingURL=SubscriptionState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionState.d.ts","sourceRoot":"","sources":["SubscriptionState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,eAAO,MAAM,uBAAuB,+FAElC,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
1
+ {"version":3,"file":"SubscriptionState.d.ts","sourceRoot":"","sources":["SubscriptionState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,eAAO,MAAM,uBAAuB,gIAEjB,CAAA;AACnB,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
2
  export const SubscriptionStateSchema = z.enum([
3
- "NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED"
4
- ]);
3
+ "NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED", "PAUSED", "UNKNOWN"
4
+ ]).catch("UNKNOWN");
5
5
  //# sourceMappingURL=SubscriptionState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubscriptionState.js","sourceRoot":"","sources":["SubscriptionState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC1C,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS;CACnF,CAAC,CAAA"}
1
+ {"version":3,"file":"SubscriptionState.js","sourceRoot":"","sources":["SubscriptionState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC1C,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS;CACxG,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import {z} from "zod"
2
2
 
3
3
  export const SubscriptionStateSchema = z.enum([
4
- "NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED"
5
- ])
4
+ "NONE", "TRIAL", "TRIAL_ENDED", "ACTIVE", "CANCELING", "GRACE_PERIOD", "EXPIRED", "PAUSED", "UNKNOWN"
5
+ ]).catch("UNKNOWN")
6
6
  export type SubscriptionState = z.infer<typeof SubscriptionStateSchema>
package/src/index.d.ts CHANGED
@@ -384,6 +384,7 @@ export { ActivityDaySummarySchema, ActivityDaySummary } from "./com/controlresel
384
384
  export { ActivityPriceChangeSchema, ActivityPriceChange } from "./com/controlresell/api/responses/activity/ActivityPriceChange";
385
385
  export { ActivityFamilySchema, ActivityFamily } from "./com/controlresell/api/responses/activity/ActivityFamily";
386
386
  export { ActivityUpcomingCountsSchema, ActivityUpcomingCounts } from "./com/controlresell/api/responses/activity/ActivityUpcomingCounts";
387
+ export { ActivityLateReasonCountSchema, ActivityLateReasonCount } from "./com/controlresell/api/responses/activity/ActivityLateReasonCount";
387
388
  export { ActivityAutomationSchema, ActivityAutomation } from "./com/controlresell/api/responses/activity/ActivityAutomation";
388
389
  export { ActivitySummaryResponseSchema, ActivitySummaryResponse } from "./com/controlresell/api/responses/activity/ActivitySummaryResponse";
389
390
  export { ActivityStatusSchema, ActivityStatus } from "./com/controlresell/api/responses/activity/ActivityStatus";
@@ -399,10 +400,12 @@ export { ActivationResponseSchema, ActivationResponse } from "./com/controlresel
399
400
  export { ActivationStepTypeSchema, ActivationStepType } from "./com/controlresell/api/responses/activation/ActivationStepType";
400
401
  export { SubscriptionLevelResponseSchema, SubscriptionLevelResponse } from "./com/controlresell/api/responses/subscriptions/SubscriptionLevelResponse";
401
402
  export { BillingPortalUrlResponseSchema, BillingPortalUrlResponse } from "./com/controlresell/api/responses/subscriptions/BillingPortalUrlResponse";
403
+ export { SubscriptionAmountSchema, SubscriptionAmount } from "./com/controlresell/api/responses/subscriptions/SubscriptionAmount";
402
404
  export { SubscriptionPaymentLinkResponseSchema, SubscriptionPaymentLinkResponse } from "./com/controlresell/api/responses/subscriptions/SubscriptionPaymentLinkResponse";
403
405
  export { SubscriptionLevelsResponseSchema, SubscriptionLevelsResponse } from "./com/controlresell/api/responses/subscriptions/SubscriptionLevelsResponse";
404
406
  export { SubscriptionStatusSchema, SubscriptionStatus } from "./com/controlresell/api/responses/subscriptions/SubscriptionStatus";
405
407
  export { PromoCodeResponseSchema, PromoCodeResponse } from "./com/controlresell/api/responses/subscriptions/PromoCodeResponse";
408
+ export { SubscriptionChangePreviewSchema, SubscriptionChangePreview } from "./com/controlresell/api/responses/subscriptions/SubscriptionChangePreview";
406
409
  export { CoachAnswerResponseSchema, CoachAnswerResponse } from "./com/controlresell/api/responses/coach/CoachAnswerResponse";
407
410
  export { CoachMessageResponseSchema, CoachMessageResponse } from "./com/controlresell/api/responses/coach/CoachMessageResponse";
408
411
  export { CoachThreadResponseSchema, CoachThreadResponse } from "./com/controlresell/api/responses/coach/CoachThreadResponse";
@@ -422,9 +425,12 @@ export { VerifyCustomerRequestSchema, VerifyCustomerRequest } from "./com/contro
422
425
  export { CreateCustomerRequestSchema, CreateCustomerRequest } from "./com/controlresell/api/requests/customers/CreateCustomerRequest";
423
426
  export { CreateQuizResponseRequestSchema, CreateQuizResponseRequest } from "./com/controlresell/api/requests/quizresponses/CreateQuizResponseRequest";
424
427
  export { ActivityDismissalRequestSchema, ActivityDismissalRequest } from "./com/controlresell/api/requests/activity/ActivityDismissalRequest";
428
+ export { SubscriptionHelpRequestSchema, SubscriptionHelpRequest } from "./com/controlresell/api/requests/subscriptions/SubscriptionHelpRequest";
425
429
  export { BillingIntervalSchema, BillingInterval } from "./com/controlresell/api/requests/subscriptions/BillingInterval";
426
430
  export { ChangeSubscriptionPlanRequestSchema, ChangeSubscriptionPlanRequest } from "./com/controlresell/api/requests/subscriptions/ChangeSubscriptionPlanRequest";
431
+ export { CancelSubscriptionRequestSchema, CancelSubscriptionRequest } from "./com/controlresell/api/requests/subscriptions/CancelSubscriptionRequest";
427
432
  export { CreateSubscriptionPaymentLinkRequestSchema, CreateSubscriptionPaymentLinkRequest } from "./com/controlresell/api/requests/subscriptions/CreateSubscriptionPaymentLinkRequest";
433
+ export { PauseSubscriptionRequestSchema, PauseSubscriptionRequest } from "./com/controlresell/api/requests/subscriptions/PauseSubscriptionRequest";
428
434
  export { SubscriptionLevelQuantitySchema, SubscriptionLevelQuantity } from "./com/controlresell/api/requests/subscriptions/SubscriptionLevelQuantity";
429
435
  export { AskCoachRequestSchema, AskCoachRequest } from "./com/controlresell/api/requests/coach/AskCoachRequest";
430
436
  export { EscalateCoachRequestSchema, EscalateCoachRequest } from "./com/controlresell/api/requests/coach/EscalateCoachRequest";