controlresell 2.9.2 → 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 +2 -2
- package/src/com/controlresell/api/responses/ErrorResponse.d.ts +16 -0
- package/src/com/controlresell/api/responses/ErrorResponse.d.ts.map +1 -0
- package/src/com/controlresell/api/responses/ErrorResponse.js +7 -0
- package/src/com/controlresell/api/responses/ErrorResponse.js.map +1 -0
- package/src/com/controlresell/api/responses/ErrorResponse.ts +8 -0
- package/src/com/controlresell/api/responses/items/ItemAction.d.ts +4 -0
- package/src/com/controlresell/api/responses/items/ItemAction.d.ts.map +1 -0
- package/src/com/controlresell/api/responses/items/ItemAction.js +5 -0
- package/src/com/controlresell/api/responses/items/ItemAction.js.map +1 -0
- package/src/com/controlresell/api/responses/items/ItemAction.ts +6 -0
- package/src/com/controlresell/{inventory/models → api/responses}/items/ItemsWithFilters.d.ts +30 -144
- package/src/com/controlresell/{inventory/models → api/responses}/items/ItemsWithFilters.d.ts.map +1 -1
- package/src/com/controlresell/{inventory/models → api/responses}/items/ItemsWithFilters.js +2 -2
- package/src/com/controlresell/api/responses/items/ItemsWithFilters.js.map +1 -0
- package/src/com/controlresell/{inventory/models → api/responses}/items/ItemsWithFilters.ts +2 -2
- package/src/com/controlresell/api/responses/items/ListedItem.d.ts +1995 -0
- package/src/com/controlresell/api/responses/items/ListedItem.d.ts.map +1 -0
- package/src/com/controlresell/api/responses/items/ListedItem.js +42 -0
- package/src/com/controlresell/api/responses/items/ListedItem.js.map +1 -0
- package/src/com/controlresell/api/responses/items/ListedItem.ts +43 -0
- 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/src/index.d.ts +4 -1
- package/src/index.d.ts.map +1 -1
- package/src/index.js +4 -1
- package/src/index.js.map +1 -1
- package/src/index.ts +4 -1
- package/src/com/controlresell/inventory/models/items/ItemsWithFilters.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListedItem.d.ts","sourceRoot":"","sources":["ListedItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AASrB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgC3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ItemFileSchema } from "../../../inventory/models/items/files/ItemFile";
|
|
3
|
+
import { FeeSchema } from "../../../inventory/models/fees/Fee";
|
|
4
|
+
import { ItemLabelSchema } from "../../../inventory/models/items/labels/ItemLabel";
|
|
5
|
+
import { ItemFieldSchema } from "../../../inventory/models/items/fields/ItemField";
|
|
6
|
+
import { ItemHistorySchema } from "../../../inventory/models/items/history/ItemHistory";
|
|
7
|
+
import { ItemOnPlatformSchema } from "../../../inventory/models/items/platforms/ItemOnPlatform";
|
|
8
|
+
import { ItemActionSchema } from "./ItemAction";
|
|
9
|
+
export const ListedItemSchema = z.object({
|
|
10
|
+
id: z.number(),
|
|
11
|
+
userId: z.number(),
|
|
12
|
+
name: z.string(),
|
|
13
|
+
sku: z.string().nullish(),
|
|
14
|
+
description: z.string().nullish(),
|
|
15
|
+
files: z.array(ItemFileSchema).nullish(),
|
|
16
|
+
categoryId: z.number().nullish(),
|
|
17
|
+
brandId: z.number().nullish(),
|
|
18
|
+
sex: z.string().nullish(),
|
|
19
|
+
state: z.number().nullish(),
|
|
20
|
+
sizeId: z.number().nullish(),
|
|
21
|
+
purchasePrice: z.number().nullish(),
|
|
22
|
+
purchaseDate: z.coerce.date().nullish(),
|
|
23
|
+
purchasePlaceId: z.number().nullish(),
|
|
24
|
+
sold: z.boolean(),
|
|
25
|
+
purchased: z.boolean().nullish(),
|
|
26
|
+
sellingPrice: z.number().nullish(),
|
|
27
|
+
sellingDate: z.coerce.date().nullish(),
|
|
28
|
+
sellingPlaceId: z.number().nullish(),
|
|
29
|
+
estimatedPrice: z.number().nullish(),
|
|
30
|
+
fees: z.array(FeeSchema).nullish(),
|
|
31
|
+
feesSum: z.number().nullish(),
|
|
32
|
+
labels: z.array(ItemLabelSchema).nullish(),
|
|
33
|
+
colorIds: z.array(z.number()).nullish(),
|
|
34
|
+
packageSizeId: z.number().nullish(),
|
|
35
|
+
fields: z.array(ItemFieldSchema).nullish(),
|
|
36
|
+
lastHistory: ItemHistorySchema.nullish(),
|
|
37
|
+
platforms: z.array(ItemOnPlatformSchema).nullish(),
|
|
38
|
+
actions: z.array(ItemActionSchema),
|
|
39
|
+
createdAt: z.coerce.date(),
|
|
40
|
+
updatedAt: z.coerce.date()
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=ListedItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListedItem.js","sourceRoot":"","sources":["ListedItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AACrB,OAAO,EAAC,cAAc,EAAC,MAAM,gDAAgD,CAAA;AAC7E,OAAO,EAAC,SAAS,EAAC,MAAM,oCAAoC,CAAA;AAC5D,OAAO,EAAC,eAAe,EAAC,MAAM,kDAAkD,CAAA;AAChF,OAAO,EAAC,eAAe,EAAC,MAAM,kDAAkD,CAAA;AAChF,OAAO,EAAC,iBAAiB,EAAC,MAAM,qDAAqD,CAAA;AACrF,OAAO,EAAC,oBAAoB,EAAC,MAAM,0DAA0D,CAAA;AAC7F,OAAO,EAAC,gBAAgB,EAAC,MAA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AC,OAAO,EAAE;IACpC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,OAAO,EAAE;IAC1C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACvC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IACnC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,OAAO,EAAE;IAC1C,WAAW,EAAE,iBAAiB,CAAC,OAAO,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE;IAClD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAClC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE;CAC7B,CAAC,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {z} from "zod"
|
|
2
|
+
import {ItemFileSchema} from "../../../inventory/models/items/files/ItemFile"
|
|
3
|
+
import {FeeSchema} from "../../../inventory/models/fees/Fee"
|
|
4
|
+
import {ItemLabelSchema} from "../../../inventory/models/items/labels/ItemLabel"
|
|
5
|
+
import {ItemFieldSchema} from "../../../inventory/models/items/fields/ItemField"
|
|
6
|
+
import {ItemHistorySchema} from "../../../inventory/models/items/history/ItemHistory"
|
|
7
|
+
import {ItemOnPlatformSchema} from "../../../inventory/models/items/platforms/ItemOnPlatform"
|
|
8
|
+
import {ItemActionSchema} from "./ItemAction"
|
|
9
|
+
|
|
10
|
+
export const ListedItemSchema = z.object({
|
|
11
|
+
id: z.number(),
|
|
12
|
+
userId: z.number(),
|
|
13
|
+
name: z.string(),
|
|
14
|
+
sku: z.string().nullish(),
|
|
15
|
+
description: z.string().nullish(),
|
|
16
|
+
files: z.array(ItemFileSchema).nullish(),
|
|
17
|
+
categoryId: z.number().nullish(),
|
|
18
|
+
brandId: z.number().nullish(),
|
|
19
|
+
sex: z.string().nullish(),
|
|
20
|
+
state: z.number().nullish(),
|
|
21
|
+
sizeId: z.number().nullish(),
|
|
22
|
+
purchasePrice: z.number().nullish(),
|
|
23
|
+
purchaseDate: z.coerce.date().nullish(),
|
|
24
|
+
purchasePlaceId: z.number().nullish(),
|
|
25
|
+
sold: z.boolean(),
|
|
26
|
+
purchased: z.boolean().nullish(),
|
|
27
|
+
sellingPrice: z.number().nullish(),
|
|
28
|
+
sellingDate: z.coerce.date().nullish(),
|
|
29
|
+
sellingPlaceId: z.number().nullish(),
|
|
30
|
+
estimatedPrice: z.number().nullish(),
|
|
31
|
+
fees: z.array(FeeSchema).nullish(),
|
|
32
|
+
feesSum: z.number().nullish(),
|
|
33
|
+
labels: z.array(ItemLabelSchema).nullish(),
|
|
34
|
+
colorIds: z.array(z.number()).nullish(),
|
|
35
|
+
packageSizeId: z.number().nullish(),
|
|
36
|
+
fields: z.array(ItemFieldSchema).nullish(),
|
|
37
|
+
lastHistory: ItemHistorySchema.nullish(),
|
|
38
|
+
platforms: z.array(ItemOnPlatformSchema).nullish(),
|
|
39
|
+
actions: z.array(ItemActionSchema),
|
|
40
|
+
createdAt: z.coerce.date(),
|
|
41
|
+
updatedAt: z.coerce.date()
|
|
42
|
+
})
|
|
43
|
+
export type ListedItem = z.infer<typeof ListedItemSchema>
|
|
@@ -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;
|