controlresell 2.9.3 → 2.9.4
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/package.json +1 -1
- package/src/com/controlresell/api/responses/subscriptions/SubscriptionStatus.d.ts +28 -28
- package/src/com/controlresell/subscriptions/api/CreateSubscriptionHistoryPayload.d.ts +20 -20
- package/src/com/controlresell/subscriptions/models/SubscriptionHistory.d.ts +20 -20
- package/src/com/controlresell/subscriptions/models/SubscriptionHistoryMetadata.d.ts +24 -24
- package/src/com/controlresell/subscriptions/models/SubscriptionHistoryMetadata.js +4 -4
- package/src/com/controlresell/subscriptions/models/SubscriptionHistoryMetadata.js.map +1 -1
- package/src/com/controlresell/subscriptions/models/SubscriptionHistoryMetadata.ts +4 -4
package/package.json
CHANGED
|
@@ -15,13 +15,13 @@ export declare const SubscriptionStatusSchema: z.ZodObject<{
|
|
|
15
15
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
16
16
|
reason: z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"]>;
|
|
17
17
|
comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
-
type: z.ZodLiteral<"
|
|
18
|
+
type: z.ZodLiteral<"CANCELLATION">;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
type: "
|
|
20
|
+
type: "CANCELLATION";
|
|
21
21
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
22
22
|
comment?: string | null | undefined;
|
|
23
23
|
}, {
|
|
24
|
-
type: "
|
|
24
|
+
type: "CANCELLATION";
|
|
25
25
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
26
26
|
comment?: string | null | undefined;
|
|
27
27
|
}>, z.ZodObject<{
|
|
@@ -29,15 +29,15 @@ export declare const SubscriptionStatusSchema: z.ZodObject<{
|
|
|
29
29
|
currency: z.ZodString;
|
|
30
30
|
interval: z.ZodString;
|
|
31
31
|
priceId: z.ZodString;
|
|
32
|
-
type: z.ZodLiteral<"
|
|
32
|
+
type: z.ZodLiteral<"PRICE_CHANGE">;
|
|
33
33
|
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
type: "
|
|
34
|
+
type: "PRICE_CHANGE";
|
|
35
35
|
currency: string;
|
|
36
36
|
amount: number;
|
|
37
37
|
interval: string;
|
|
38
38
|
priceId: string;
|
|
39
39
|
}, {
|
|
40
|
-
type: "
|
|
40
|
+
type: "PRICE_CHANGE";
|
|
41
41
|
currency: string;
|
|
42
42
|
amount: number;
|
|
43
43
|
interval: string;
|
|
@@ -46,14 +46,14 @@ export declare const SubscriptionStatusSchema: z.ZodObject<{
|
|
|
46
46
|
eventId: z.ZodString;
|
|
47
47
|
subscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
48
|
invoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
-
type: z.ZodLiteral<"
|
|
49
|
+
type: z.ZodLiteral<"STRIPE_EVENT">;
|
|
50
50
|
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
type: "
|
|
51
|
+
type: "STRIPE_EVENT";
|
|
52
52
|
eventId: string;
|
|
53
53
|
subscriptionId?: string | null | undefined;
|
|
54
54
|
invoiceId?: string | null | undefined;
|
|
55
55
|
}, {
|
|
56
|
-
type: "
|
|
56
|
+
type: "STRIPE_EVENT";
|
|
57
57
|
eventId: string;
|
|
58
58
|
subscriptionId?: string | null | undefined;
|
|
59
59
|
invoiceId?: string | null | undefined;
|
|
@@ -61,14 +61,14 @@ export declare const SubscriptionStatusSchema: z.ZodObject<{
|
|
|
61
61
|
startDate: z.ZodDate;
|
|
62
62
|
endDate: z.ZodDate;
|
|
63
63
|
convertedToPaid: z.ZodBoolean;
|
|
64
|
-
type: z.ZodLiteral<"
|
|
64
|
+
type: z.ZodLiteral<"TRIAL">;
|
|
65
65
|
}, "strip", z.ZodTypeAny, {
|
|
66
|
-
type: "
|
|
66
|
+
type: "TRIAL";
|
|
67
67
|
startDate: Date;
|
|
68
68
|
endDate: Date;
|
|
69
69
|
convertedToPaid: boolean;
|
|
70
70
|
}, {
|
|
71
|
-
type: "
|
|
71
|
+
type: "TRIAL";
|
|
72
72
|
startDate: Date;
|
|
73
73
|
endDate: Date;
|
|
74
74
|
convertedToPaid: boolean;
|
|
@@ -82,22 +82,22 @@ export declare const SubscriptionStatusSchema: z.ZodObject<{
|
|
|
82
82
|
createdAt: Date;
|
|
83
83
|
source: "STRIPE_WEBHOOK" | "MANUAL_SYNC" | "USER_ACTION";
|
|
84
84
|
metadata?: {
|
|
85
|
-
type: "
|
|
85
|
+
type: "CANCELLATION";
|
|
86
86
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
87
87
|
comment?: string | null | undefined;
|
|
88
88
|
} | {
|
|
89
|
-
type: "
|
|
89
|
+
type: "PRICE_CHANGE";
|
|
90
90
|
currency: string;
|
|
91
91
|
amount: number;
|
|
92
92
|
interval: string;
|
|
93
93
|
priceId: string;
|
|
94
94
|
} | {
|
|
95
|
-
type: "
|
|
95
|
+
type: "STRIPE_EVENT";
|
|
96
96
|
eventId: string;
|
|
97
97
|
subscriptionId?: string | null | undefined;
|
|
98
98
|
invoiceId?: string | null | undefined;
|
|
99
99
|
} | {
|
|
100
|
-
type: "
|
|
100
|
+
type: "TRIAL";
|
|
101
101
|
startDate: Date;
|
|
102
102
|
endDate: Date;
|
|
103
103
|
convertedToPaid: boolean;
|
|
@@ -114,22 +114,22 @@ export declare const SubscriptionStatusSchema: z.ZodObject<{
|
|
|
114
114
|
createdAt: Date;
|
|
115
115
|
source: "STRIPE_WEBHOOK" | "MANUAL_SYNC" | "USER_ACTION";
|
|
116
116
|
metadata?: {
|
|
117
|
-
type: "
|
|
117
|
+
type: "CANCELLATION";
|
|
118
118
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
119
119
|
comment?: string | null | undefined;
|
|
120
120
|
} | {
|
|
121
|
-
type: "
|
|
121
|
+
type: "PRICE_CHANGE";
|
|
122
122
|
currency: string;
|
|
123
123
|
amount: number;
|
|
124
124
|
interval: string;
|
|
125
125
|
priceId: string;
|
|
126
126
|
} | {
|
|
127
|
-
type: "
|
|
127
|
+
type: "STRIPE_EVENT";
|
|
128
128
|
eventId: string;
|
|
129
129
|
subscriptionId?: string | null | undefined;
|
|
130
130
|
invoiceId?: string | null | undefined;
|
|
131
131
|
} | {
|
|
132
|
-
type: "
|
|
132
|
+
type: "TRIAL";
|
|
133
133
|
startDate: Date;
|
|
134
134
|
endDate: Date;
|
|
135
135
|
convertedToPaid: boolean;
|
|
@@ -150,22 +150,22 @@ export declare const SubscriptionStatusSchema: z.ZodObject<{
|
|
|
150
150
|
createdAt: Date;
|
|
151
151
|
source: "STRIPE_WEBHOOK" | "MANUAL_SYNC" | "USER_ACTION";
|
|
152
152
|
metadata?: {
|
|
153
|
-
type: "
|
|
153
|
+
type: "CANCELLATION";
|
|
154
154
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
155
155
|
comment?: string | null | undefined;
|
|
156
156
|
} | {
|
|
157
|
-
type: "
|
|
157
|
+
type: "PRICE_CHANGE";
|
|
158
158
|
currency: string;
|
|
159
159
|
amount: number;
|
|
160
160
|
interval: string;
|
|
161
161
|
priceId: string;
|
|
162
162
|
} | {
|
|
163
|
-
type: "
|
|
163
|
+
type: "STRIPE_EVENT";
|
|
164
164
|
eventId: string;
|
|
165
165
|
subscriptionId?: string | null | undefined;
|
|
166
166
|
invoiceId?: string | null | undefined;
|
|
167
167
|
} | {
|
|
168
|
-
type: "
|
|
168
|
+
type: "TRIAL";
|
|
169
169
|
startDate: Date;
|
|
170
170
|
endDate: Date;
|
|
171
171
|
convertedToPaid: boolean;
|
|
@@ -187,22 +187,22 @@ export declare const SubscriptionStatusSchema: z.ZodObject<{
|
|
|
187
187
|
createdAt: Date;
|
|
188
188
|
source: "STRIPE_WEBHOOK" | "MANUAL_SYNC" | "USER_ACTION";
|
|
189
189
|
metadata?: {
|
|
190
|
-
type: "
|
|
190
|
+
type: "CANCELLATION";
|
|
191
191
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
192
192
|
comment?: string | null | undefined;
|
|
193
193
|
} | {
|
|
194
|
-
type: "
|
|
194
|
+
type: "PRICE_CHANGE";
|
|
195
195
|
currency: string;
|
|
196
196
|
amount: number;
|
|
197
197
|
interval: string;
|
|
198
198
|
priceId: string;
|
|
199
199
|
} | {
|
|
200
|
-
type: "
|
|
200
|
+
type: "STRIPE_EVENT";
|
|
201
201
|
eventId: string;
|
|
202
202
|
subscriptionId?: string | null | undefined;
|
|
203
203
|
invoiceId?: string | null | undefined;
|
|
204
204
|
} | {
|
|
205
|
-
type: "
|
|
205
|
+
type: "TRIAL";
|
|
206
206
|
startDate: Date;
|
|
207
207
|
endDate: Date;
|
|
208
208
|
convertedToPaid: boolean;
|
|
@@ -9,13 +9,13 @@ export declare const CreateSubscriptionHistoryPayloadSchema: z.ZodObject<{
|
|
|
9
9
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
10
10
|
reason: z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"]>;
|
|
11
11
|
comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
-
type: z.ZodLiteral<"
|
|
12
|
+
type: z.ZodLiteral<"CANCELLATION">;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
type: "
|
|
14
|
+
type: "CANCELLATION";
|
|
15
15
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
16
16
|
comment?: string | null | undefined;
|
|
17
17
|
}, {
|
|
18
|
-
type: "
|
|
18
|
+
type: "CANCELLATION";
|
|
19
19
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
20
20
|
comment?: string | null | undefined;
|
|
21
21
|
}>, z.ZodObject<{
|
|
@@ -23,15 +23,15 @@ export declare const CreateSubscriptionHistoryPayloadSchema: z.ZodObject<{
|
|
|
23
23
|
currency: z.ZodString;
|
|
24
24
|
interval: z.ZodString;
|
|
25
25
|
priceId: z.ZodString;
|
|
26
|
-
type: z.ZodLiteral<"
|
|
26
|
+
type: z.ZodLiteral<"PRICE_CHANGE">;
|
|
27
27
|
}, "strip", z.ZodTypeAny, {
|
|
28
|
-
type: "
|
|
28
|
+
type: "PRICE_CHANGE";
|
|
29
29
|
currency: string;
|
|
30
30
|
amount: number;
|
|
31
31
|
interval: string;
|
|
32
32
|
priceId: string;
|
|
33
33
|
}, {
|
|
34
|
-
type: "
|
|
34
|
+
type: "PRICE_CHANGE";
|
|
35
35
|
currency: string;
|
|
36
36
|
amount: number;
|
|
37
37
|
interval: string;
|
|
@@ -40,14 +40,14 @@ export declare const CreateSubscriptionHistoryPayloadSchema: z.ZodObject<{
|
|
|
40
40
|
eventId: z.ZodString;
|
|
41
41
|
subscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
42
|
invoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
-
type: z.ZodLiteral<"
|
|
43
|
+
type: z.ZodLiteral<"STRIPE_EVENT">;
|
|
44
44
|
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
type: "
|
|
45
|
+
type: "STRIPE_EVENT";
|
|
46
46
|
eventId: string;
|
|
47
47
|
subscriptionId?: string | null | undefined;
|
|
48
48
|
invoiceId?: string | null | undefined;
|
|
49
49
|
}, {
|
|
50
|
-
type: "
|
|
50
|
+
type: "STRIPE_EVENT";
|
|
51
51
|
eventId: string;
|
|
52
52
|
subscriptionId?: string | null | undefined;
|
|
53
53
|
invoiceId?: string | null | undefined;
|
|
@@ -55,14 +55,14 @@ export declare const CreateSubscriptionHistoryPayloadSchema: z.ZodObject<{
|
|
|
55
55
|
startDate: z.ZodDate;
|
|
56
56
|
endDate: z.ZodDate;
|
|
57
57
|
convertedToPaid: z.ZodBoolean;
|
|
58
|
-
type: z.ZodLiteral<"
|
|
58
|
+
type: z.ZodLiteral<"TRIAL">;
|
|
59
59
|
}, "strip", z.ZodTypeAny, {
|
|
60
|
-
type: "
|
|
60
|
+
type: "TRIAL";
|
|
61
61
|
startDate: Date;
|
|
62
62
|
endDate: Date;
|
|
63
63
|
convertedToPaid: boolean;
|
|
64
64
|
}, {
|
|
65
|
-
type: "
|
|
65
|
+
type: "TRIAL";
|
|
66
66
|
startDate: Date;
|
|
67
67
|
endDate: Date;
|
|
68
68
|
convertedToPaid: boolean;
|
|
@@ -71,22 +71,22 @@ export declare const CreateSubscriptionHistoryPayloadSchema: z.ZodObject<{
|
|
|
71
71
|
type: "PAYMENT_FAILED" | "TRIAL_STARTED" | "TRIAL_UPGRADED" | "TRIAL_EXPIRED" | "LEVEL_ADDED" | "LEVEL_REMOVED" | "MULTIPLIER_CHANGED" | "SUBSCRIPTION_PAUSED" | "SUBSCRIPTION_RESUMED" | "SUBSCRIPTION_CANCELED" | "PAYMENT_SUCCEEDED";
|
|
72
72
|
source: "STRIPE_WEBHOOK" | "MANUAL_SYNC" | "USER_ACTION";
|
|
73
73
|
metadata?: {
|
|
74
|
-
type: "
|
|
74
|
+
type: "CANCELLATION";
|
|
75
75
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
76
76
|
comment?: string | null | undefined;
|
|
77
77
|
} | {
|
|
78
|
-
type: "
|
|
78
|
+
type: "PRICE_CHANGE";
|
|
79
79
|
currency: string;
|
|
80
80
|
amount: number;
|
|
81
81
|
interval: string;
|
|
82
82
|
priceId: string;
|
|
83
83
|
} | {
|
|
84
|
-
type: "
|
|
84
|
+
type: "STRIPE_EVENT";
|
|
85
85
|
eventId: string;
|
|
86
86
|
subscriptionId?: string | null | undefined;
|
|
87
87
|
invoiceId?: string | null | undefined;
|
|
88
88
|
} | {
|
|
89
|
-
type: "
|
|
89
|
+
type: "TRIAL";
|
|
90
90
|
startDate: Date;
|
|
91
91
|
endDate: Date;
|
|
92
92
|
convertedToPaid: boolean;
|
|
@@ -99,22 +99,22 @@ export declare const CreateSubscriptionHistoryPayloadSchema: z.ZodObject<{
|
|
|
99
99
|
type: "PAYMENT_FAILED" | "TRIAL_STARTED" | "TRIAL_UPGRADED" | "TRIAL_EXPIRED" | "LEVEL_ADDED" | "LEVEL_REMOVED" | "MULTIPLIER_CHANGED" | "SUBSCRIPTION_PAUSED" | "SUBSCRIPTION_RESUMED" | "SUBSCRIPTION_CANCELED" | "PAYMENT_SUCCEEDED";
|
|
100
100
|
source: "STRIPE_WEBHOOK" | "MANUAL_SYNC" | "USER_ACTION";
|
|
101
101
|
metadata?: {
|
|
102
|
-
type: "
|
|
102
|
+
type: "CANCELLATION";
|
|
103
103
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
104
104
|
comment?: string | null | undefined;
|
|
105
105
|
} | {
|
|
106
|
-
type: "
|
|
106
|
+
type: "PRICE_CHANGE";
|
|
107
107
|
currency: string;
|
|
108
108
|
amount: number;
|
|
109
109
|
interval: string;
|
|
110
110
|
priceId: string;
|
|
111
111
|
} | {
|
|
112
|
-
type: "
|
|
112
|
+
type: "STRIPE_EVENT";
|
|
113
113
|
eventId: string;
|
|
114
114
|
subscriptionId?: string | null | undefined;
|
|
115
115
|
invoiceId?: string | null | undefined;
|
|
116
116
|
} | {
|
|
117
|
-
type: "
|
|
117
|
+
type: "TRIAL";
|
|
118
118
|
startDate: Date;
|
|
119
119
|
endDate: Date;
|
|
120
120
|
convertedToPaid: boolean;
|
|
@@ -11,13 +11,13 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
|
|
|
11
11
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
12
12
|
reason: z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"]>;
|
|
13
13
|
comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
-
type: z.ZodLiteral<"
|
|
14
|
+
type: z.ZodLiteral<"CANCELLATION">;
|
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
type: "
|
|
16
|
+
type: "CANCELLATION";
|
|
17
17
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
18
18
|
comment?: string | null | undefined;
|
|
19
19
|
}, {
|
|
20
|
-
type: "
|
|
20
|
+
type: "CANCELLATION";
|
|
21
21
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
22
22
|
comment?: string | null | undefined;
|
|
23
23
|
}>, z.ZodObject<{
|
|
@@ -25,15 +25,15 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
|
|
|
25
25
|
currency: z.ZodString;
|
|
26
26
|
interval: z.ZodString;
|
|
27
27
|
priceId: z.ZodString;
|
|
28
|
-
type: z.ZodLiteral<"
|
|
28
|
+
type: z.ZodLiteral<"PRICE_CHANGE">;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
type: "
|
|
30
|
+
type: "PRICE_CHANGE";
|
|
31
31
|
currency: string;
|
|
32
32
|
amount: number;
|
|
33
33
|
interval: string;
|
|
34
34
|
priceId: string;
|
|
35
35
|
}, {
|
|
36
|
-
type: "
|
|
36
|
+
type: "PRICE_CHANGE";
|
|
37
37
|
currency: string;
|
|
38
38
|
amount: number;
|
|
39
39
|
interval: string;
|
|
@@ -42,14 +42,14 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
|
|
|
42
42
|
eventId: z.ZodString;
|
|
43
43
|
subscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
44
44
|
invoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
-
type: z.ZodLiteral<"
|
|
45
|
+
type: z.ZodLiteral<"STRIPE_EVENT">;
|
|
46
46
|
}, "strip", z.ZodTypeAny, {
|
|
47
|
-
type: "
|
|
47
|
+
type: "STRIPE_EVENT";
|
|
48
48
|
eventId: string;
|
|
49
49
|
subscriptionId?: string | null | undefined;
|
|
50
50
|
invoiceId?: string | null | undefined;
|
|
51
51
|
}, {
|
|
52
|
-
type: "
|
|
52
|
+
type: "STRIPE_EVENT";
|
|
53
53
|
eventId: string;
|
|
54
54
|
subscriptionId?: string | null | undefined;
|
|
55
55
|
invoiceId?: string | null | undefined;
|
|
@@ -57,14 +57,14 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
|
|
|
57
57
|
startDate: z.ZodDate;
|
|
58
58
|
endDate: z.ZodDate;
|
|
59
59
|
convertedToPaid: z.ZodBoolean;
|
|
60
|
-
type: z.ZodLiteral<"
|
|
60
|
+
type: z.ZodLiteral<"TRIAL">;
|
|
61
61
|
}, "strip", z.ZodTypeAny, {
|
|
62
|
-
type: "
|
|
62
|
+
type: "TRIAL";
|
|
63
63
|
startDate: Date;
|
|
64
64
|
endDate: Date;
|
|
65
65
|
convertedToPaid: boolean;
|
|
66
66
|
}, {
|
|
67
|
-
type: "
|
|
67
|
+
type: "TRIAL";
|
|
68
68
|
startDate: Date;
|
|
69
69
|
endDate: Date;
|
|
70
70
|
convertedToPaid: boolean;
|
|
@@ -78,22 +78,22 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
|
|
|
78
78
|
createdAt: Date;
|
|
79
79
|
source: "STRIPE_WEBHOOK" | "MANUAL_SYNC" | "USER_ACTION";
|
|
80
80
|
metadata?: {
|
|
81
|
-
type: "
|
|
81
|
+
type: "CANCELLATION";
|
|
82
82
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
83
83
|
comment?: string | null | undefined;
|
|
84
84
|
} | {
|
|
85
|
-
type: "
|
|
85
|
+
type: "PRICE_CHANGE";
|
|
86
86
|
currency: string;
|
|
87
87
|
amount: number;
|
|
88
88
|
interval: string;
|
|
89
89
|
priceId: string;
|
|
90
90
|
} | {
|
|
91
|
-
type: "
|
|
91
|
+
type: "STRIPE_EVENT";
|
|
92
92
|
eventId: string;
|
|
93
93
|
subscriptionId?: string | null | undefined;
|
|
94
94
|
invoiceId?: string | null | undefined;
|
|
95
95
|
} | {
|
|
96
|
-
type: "
|
|
96
|
+
type: "TRIAL";
|
|
97
97
|
startDate: Date;
|
|
98
98
|
endDate: Date;
|
|
99
99
|
convertedToPaid: boolean;
|
|
@@ -110,22 +110,22 @@ export declare const SubscriptionHistorySchema: z.ZodObject<{
|
|
|
110
110
|
createdAt: Date;
|
|
111
111
|
source: "STRIPE_WEBHOOK" | "MANUAL_SYNC" | "USER_ACTION";
|
|
112
112
|
metadata?: {
|
|
113
|
-
type: "
|
|
113
|
+
type: "CANCELLATION";
|
|
114
114
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
115
115
|
comment?: string | null | undefined;
|
|
116
116
|
} | {
|
|
117
|
-
type: "
|
|
117
|
+
type: "PRICE_CHANGE";
|
|
118
118
|
currency: string;
|
|
119
119
|
amount: number;
|
|
120
120
|
interval: string;
|
|
121
121
|
priceId: string;
|
|
122
122
|
} | {
|
|
123
|
-
type: "
|
|
123
|
+
type: "STRIPE_EVENT";
|
|
124
124
|
eventId: string;
|
|
125
125
|
subscriptionId?: string | null | undefined;
|
|
126
126
|
invoiceId?: string | null | undefined;
|
|
127
127
|
} | {
|
|
128
|
-
type: "
|
|
128
|
+
type: "TRIAL";
|
|
129
129
|
startDate: Date;
|
|
130
130
|
endDate: Date;
|
|
131
131
|
convertedToPaid: boolean;
|
|
@@ -2,13 +2,13 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const CancellationSchema: z.ZodObject<{
|
|
3
3
|
reason: z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"]>;
|
|
4
4
|
comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
-
type: z.ZodLiteral<"
|
|
5
|
+
type: z.ZodLiteral<"CANCELLATION">;
|
|
6
6
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
type: "
|
|
7
|
+
type: "CANCELLATION";
|
|
8
8
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
9
9
|
comment?: string | null | undefined;
|
|
10
10
|
}, {
|
|
11
|
-
type: "
|
|
11
|
+
type: "CANCELLATION";
|
|
12
12
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
13
13
|
comment?: string | null | undefined;
|
|
14
14
|
}>;
|
|
@@ -18,15 +18,15 @@ export declare const PriceChangeSchema: z.ZodObject<{
|
|
|
18
18
|
currency: z.ZodString;
|
|
19
19
|
interval: z.ZodString;
|
|
20
20
|
priceId: z.ZodString;
|
|
21
|
-
type: z.ZodLiteral<"
|
|
21
|
+
type: z.ZodLiteral<"PRICE_CHANGE">;
|
|
22
22
|
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
type: "
|
|
23
|
+
type: "PRICE_CHANGE";
|
|
24
24
|
currency: string;
|
|
25
25
|
amount: number;
|
|
26
26
|
interval: string;
|
|
27
27
|
priceId: string;
|
|
28
28
|
}, {
|
|
29
|
-
type: "
|
|
29
|
+
type: "PRICE_CHANGE";
|
|
30
30
|
currency: string;
|
|
31
31
|
amount: number;
|
|
32
32
|
interval: string;
|
|
@@ -37,14 +37,14 @@ export declare const StripeEventSchema: z.ZodObject<{
|
|
|
37
37
|
eventId: z.ZodString;
|
|
38
38
|
subscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
39
|
invoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
-
type: z.ZodLiteral<"
|
|
40
|
+
type: z.ZodLiteral<"STRIPE_EVENT">;
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
type: "
|
|
42
|
+
type: "STRIPE_EVENT";
|
|
43
43
|
eventId: string;
|
|
44
44
|
subscriptionId?: string | null | undefined;
|
|
45
45
|
invoiceId?: string | null | undefined;
|
|
46
46
|
}, {
|
|
47
|
-
type: "
|
|
47
|
+
type: "STRIPE_EVENT";
|
|
48
48
|
eventId: string;
|
|
49
49
|
subscriptionId?: string | null | undefined;
|
|
50
50
|
invoiceId?: string | null | undefined;
|
|
@@ -54,14 +54,14 @@ export declare const TrialSchema: z.ZodObject<{
|
|
|
54
54
|
startDate: z.ZodDate;
|
|
55
55
|
endDate: z.ZodDate;
|
|
56
56
|
convertedToPaid: z.ZodBoolean;
|
|
57
|
-
type: z.ZodLiteral<"
|
|
57
|
+
type: z.ZodLiteral<"TRIAL">;
|
|
58
58
|
}, "strip", z.ZodTypeAny, {
|
|
59
|
-
type: "
|
|
59
|
+
type: "TRIAL";
|
|
60
60
|
startDate: Date;
|
|
61
61
|
endDate: Date;
|
|
62
62
|
convertedToPaid: boolean;
|
|
63
63
|
}, {
|
|
64
|
-
type: "
|
|
64
|
+
type: "TRIAL";
|
|
65
65
|
startDate: Date;
|
|
66
66
|
endDate: Date;
|
|
67
67
|
convertedToPaid: boolean;
|
|
@@ -70,13 +70,13 @@ export type Trial = z.infer<typeof TrialSchema>;
|
|
|
70
70
|
export declare const SubscriptionHistoryMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
71
71
|
reason: z.ZodEnum<["USER_REQUESTED", "PAYMENT_FAILED", "DOWNGRADED", "SWITCHED_PLAN", "OTHER"]>;
|
|
72
72
|
comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
-
type: z.ZodLiteral<"
|
|
73
|
+
type: z.ZodLiteral<"CANCELLATION">;
|
|
74
74
|
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
type: "
|
|
75
|
+
type: "CANCELLATION";
|
|
76
76
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
77
77
|
comment?: string | null | undefined;
|
|
78
78
|
}, {
|
|
79
|
-
type: "
|
|
79
|
+
type: "CANCELLATION";
|
|
80
80
|
reason: "USER_REQUESTED" | "PAYMENT_FAILED" | "DOWNGRADED" | "SWITCHED_PLAN" | "OTHER";
|
|
81
81
|
comment?: string | null | undefined;
|
|
82
82
|
}>, z.ZodObject<{
|
|
@@ -84,15 +84,15 @@ export declare const SubscriptionHistoryMetadataSchema: z.ZodDiscriminatedUnion<
|
|
|
84
84
|
currency: z.ZodString;
|
|
85
85
|
interval: z.ZodString;
|
|
86
86
|
priceId: z.ZodString;
|
|
87
|
-
type: z.ZodLiteral<"
|
|
87
|
+
type: z.ZodLiteral<"PRICE_CHANGE">;
|
|
88
88
|
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
type: "
|
|
89
|
+
type: "PRICE_CHANGE";
|
|
90
90
|
currency: string;
|
|
91
91
|
amount: number;
|
|
92
92
|
interval: string;
|
|
93
93
|
priceId: string;
|
|
94
94
|
}, {
|
|
95
|
-
type: "
|
|
95
|
+
type: "PRICE_CHANGE";
|
|
96
96
|
currency: string;
|
|
97
97
|
amount: number;
|
|
98
98
|
interval: string;
|
|
@@ -101,14 +101,14 @@ export declare const SubscriptionHistoryMetadataSchema: z.ZodDiscriminatedUnion<
|
|
|
101
101
|
eventId: z.ZodString;
|
|
102
102
|
subscriptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
103
|
invoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
|
-
type: z.ZodLiteral<"
|
|
104
|
+
type: z.ZodLiteral<"STRIPE_EVENT">;
|
|
105
105
|
}, "strip", z.ZodTypeAny, {
|
|
106
|
-
type: "
|
|
106
|
+
type: "STRIPE_EVENT";
|
|
107
107
|
eventId: string;
|
|
108
108
|
subscriptionId?: string | null | undefined;
|
|
109
109
|
invoiceId?: string | null | undefined;
|
|
110
110
|
}, {
|
|
111
|
-
type: "
|
|
111
|
+
type: "STRIPE_EVENT";
|
|
112
112
|
eventId: string;
|
|
113
113
|
subscriptionId?: string | null | undefined;
|
|
114
114
|
invoiceId?: string | null | undefined;
|
|
@@ -116,14 +116,14 @@ export declare const SubscriptionHistoryMetadataSchema: z.ZodDiscriminatedUnion<
|
|
|
116
116
|
startDate: z.ZodDate;
|
|
117
117
|
endDate: z.ZodDate;
|
|
118
118
|
convertedToPaid: z.ZodBoolean;
|
|
119
|
-
type: z.ZodLiteral<"
|
|
119
|
+
type: z.ZodLiteral<"TRIAL">;
|
|
120
120
|
}, "strip", z.ZodTypeAny, {
|
|
121
|
-
type: "
|
|
121
|
+
type: "TRIAL";
|
|
122
122
|
startDate: Date;
|
|
123
123
|
endDate: Date;
|
|
124
124
|
convertedToPaid: boolean;
|
|
125
125
|
}, {
|
|
126
|
-
type: "
|
|
126
|
+
type: "TRIAL";
|
|
127
127
|
startDate: Date;
|
|
128
128
|
endDate: Date;
|
|
129
129
|
convertedToPaid: boolean;
|
|
@@ -3,26 +3,26 @@ import { CancellationReasonSchema } from "./CancellationReason";
|
|
|
3
3
|
export const CancellationSchema = z.object({
|
|
4
4
|
reason: CancellationReasonSchema,
|
|
5
5
|
comment: z.string().nullish(),
|
|
6
|
-
type: z.literal("
|
|
6
|
+
type: z.literal("CANCELLATION")
|
|
7
7
|
});
|
|
8
8
|
export const PriceChangeSchema = z.object({
|
|
9
9
|
amount: z.number(),
|
|
10
10
|
currency: z.string(),
|
|
11
11
|
interval: z.string(),
|
|
12
12
|
priceId: z.string(),
|
|
13
|
-
type: z.literal("
|
|
13
|
+
type: z.literal("PRICE_CHANGE")
|
|
14
14
|
});
|
|
15
15
|
export const StripeEventSchema = z.object({
|
|
16
16
|
eventId: z.string(),
|
|
17
17
|
subscriptionId: z.string().nullish(),
|
|
18
18
|
invoiceId: z.string().nullish(),
|
|
19
|
-
type: z.literal("
|
|
19
|
+
type: z.literal("STRIPE_EVENT")
|
|
20
20
|
});
|
|
21
21
|
export const TrialSchema = z.object({
|
|
22
22
|
startDate: z.coerce.date(),
|
|
23
23
|
endDate: z.coerce.date(),
|
|
24
24
|
convertedToPaid: z.boolean(),
|
|
25
|
-
type: z.literal("
|
|
25
|
+
type: z.literal("TRIAL")
|
|
26
26
|
});
|
|
27
27
|
export const SubscriptionHistoryMetadataSchema = z.discriminatedUnion("type", [
|
|
28
28
|
CancellationSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionHistoryMetadata.js","sourceRoot":"","sources":["SubscriptionHistoryMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AACrB,OAAO,EAAC,wBAAwB,EAAC,MAAM,sBAAsB,CAAA;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,wBAAwB;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC7B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;CAClC,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"SubscriptionHistoryMetadata.js","sourceRoot":"","sources":["SubscriptionHistoryMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AACrB,OAAO,EAAC,wBAAwB,EAAC,MAAM,sBAAsB,CAAA;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,wBAAwB;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC7B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;CAClC,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,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,iBAAiB;IACjB,iBAAiB;IACjB,WAAW;CACd,CAAC,CAAA"}
|
|
@@ -4,7 +4,7 @@ import {CancellationReasonSchema} from "./CancellationReason"
|
|
|
4
4
|
export const CancellationSchema = z.object({
|
|
5
5
|
reason: CancellationReasonSchema,
|
|
6
6
|
comment: z.string().nullish(),
|
|
7
|
-
type: z.literal("
|
|
7
|
+
type: z.literal("CANCELLATION")
|
|
8
8
|
})
|
|
9
9
|
export type Cancellation = z.infer<typeof CancellationSchema>
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ export const PriceChangeSchema = z.object({
|
|
|
13
13
|
currency: z.string(),
|
|
14
14
|
interval: z.string(),
|
|
15
15
|
priceId: z.string(),
|
|
16
|
-
type: z.literal("
|
|
16
|
+
type: z.literal("PRICE_CHANGE")
|
|
17
17
|
})
|
|
18
18
|
export type PriceChange = z.infer<typeof PriceChangeSchema>
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ export const StripeEventSchema = z.object({
|
|
|
21
21
|
eventId: z.string(),
|
|
22
22
|
subscriptionId: z.string().nullish(),
|
|
23
23
|
invoiceId: z.string().nullish(),
|
|
24
|
-
type: z.literal("
|
|
24
|
+
type: z.literal("STRIPE_EVENT")
|
|
25
25
|
})
|
|
26
26
|
export type StripeEvent = z.infer<typeof StripeEventSchema>
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ export const TrialSchema = z.object({
|
|
|
29
29
|
startDate: z.coerce.date(),
|
|
30
30
|
endDate: z.coerce.date(),
|
|
31
31
|
convertedToPaid: z.boolean(),
|
|
32
|
-
type: z.literal("
|
|
32
|
+
type: z.literal("TRIAL")
|
|
33
33
|
})
|
|
34
34
|
export type Trial = z.infer<typeof TrialSchema>
|
|
35
35
|
|