@marcoappio/marco-config 2.0.552 → 2.0.554

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 (42) hide show
  1. package/dist/marcoPublicConfig.d.ts +12 -0
  2. package/dist/marcoPublicConfig.d.ts.map +1 -1
  3. package/dist/marcoPublicConfig.js +33 -0
  4. package/dist/schemas/index.d.ts +82 -2
  5. package/dist/schemas/index.d.ts.map +1 -1
  6. package/dist/schemas/index.js +2 -0
  7. package/dist/schemas/models/user.d.ts +40 -2
  8. package/dist/schemas/models/user.d.ts.map +1 -1
  9. package/dist/schemas/models/user.js +3 -3
  10. package/dist/schemas/stripe.d.ts +44 -0
  11. package/dist/schemas/stripe.d.ts.map +1 -0
  12. package/dist/schemas/stripe.js +48 -0
  13. package/dist/sdk/endpoints/index.d.ts +20 -6
  14. package/dist/sdk/endpoints/index.d.ts.map +1 -1
  15. package/dist/sdk/endpoints/private/index.d.ts +20 -6
  16. package/dist/sdk/endpoints/private/index.d.ts.map +1 -1
  17. package/dist/sdk/endpoints/private/models/user/getUser.d.ts +40 -2
  18. package/dist/sdk/endpoints/private/models/user/getUser.d.ts.map +1 -1
  19. package/dist/sdk/endpoints/private/user/createCheckoutSession.d.ts +27 -0
  20. package/dist/sdk/endpoints/private/user/createCheckoutSession.d.ts.map +1 -0
  21. package/dist/sdk/endpoints/private/user/createCheckoutSession.js +20 -0
  22. package/dist/sdk/endpoints/private/user/index.d.ts +20 -6
  23. package/dist/sdk/endpoints/private/user/index.d.ts.map +1 -1
  24. package/dist/sdk/endpoints/private/user/index.js +2 -2
  25. package/dist/sdk/index.d.ts +20 -6
  26. package/dist/sdk/index.d.ts.map +1 -1
  27. package/dist/types/StripeSubscriptionStatus.d.ts +4 -0
  28. package/dist/types/StripeSubscriptionStatus.d.ts.map +1 -0
  29. package/dist/types/StripeSubscriptionStatus.js +11 -0
  30. package/dist/types/SubscriptionTier.d.ts +3 -0
  31. package/dist/types/SubscriptionTier.d.ts.map +1 -0
  32. package/dist/types/SubscriptionTier.js +1 -0
  33. package/dist/types/index.d.ts +2 -1
  34. package/dist/types/index.d.ts.map +1 -1
  35. package/dist/types/index.js +2 -1
  36. package/package.json +3 -2
  37. package/dist/sdk/endpoints/private/user/getBillingPortalUrl.d.ts +0 -13
  38. package/dist/sdk/endpoints/private/user/getBillingPortalUrl.d.ts.map +0 -1
  39. package/dist/sdk/endpoints/private/user/getBillingPortalUrl.js +0 -14
  40. package/dist/types/PolarSubscriptionStatus.d.ts +0 -4
  41. package/dist/types/PolarSubscriptionStatus.d.ts.map +0 -1
  42. package/dist/types/PolarSubscriptionStatus.js +0 -3
@@ -1,3 +1,4 @@
1
+ import type { SubscriptionTier } from './types';
1
2
  export type MarcoEnvironment = 'production' | 'staging' | 'development';
2
3
  export declare const MARCO_ENV: MarcoEnvironment;
3
4
  type MarcoPublicConfig = {
@@ -27,6 +28,17 @@ type MarcoPublicConfig = {
27
28
  tenantId: string;
28
29
  };
29
30
  };
31
+ stripe: {
32
+ products: {
33
+ [key in SubscriptionTier]: {
34
+ id: string;
35
+ priceIds: {
36
+ monthly: string;
37
+ yearly: string;
38
+ };
39
+ };
40
+ };
41
+ };
30
42
  workOS: {
31
43
  clientId: string;
32
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"marcoPublicConfig.d.ts","sourceRoot":"","sources":["../src/marcoPublicConfig.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,SAAS,GAAG,aAAa,CAAA;AAEvE,eAAO,MAAM,SAAS,kBAGP,CAAA;AAEf,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE;QACL,GAAG,EAAE;YACH,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;QACD,GAAG,EAAE;YACH,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;QACD,GAAG,EAAE;YACH,OAAO,EAAE,MAAM,CAAA;YACf,UAAU,EAAE,MAAM,CAAA;SACnB,CAAA;QACD,EAAE,EAAE;YACF,KAAK,EAAE,MAAM,CAAA;YACb,IAAI,EAAE,MAAM,CAAA;YACZ,GAAG,EAAE,MAAM,CAAA;SACZ,CAAA;KACF,CAAA;IACD,KAAK,EAAE;QACL,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM,CAAA;SACjB,CAAA;QACD,OAAO,EAAE;YACP,QAAQ,EAAE,MAAM,CAAA;YAChB,QAAQ,EAAE,MAAM,CAAA;SACjB,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;CACF,CAAA;AAkGD,eAAO,MAAM,iBAAiB,SAAS,gBAAgB,sBAAmC,CAAA"}
1
+ {"version":3,"file":"marcoPublicConfig.d.ts","sourceRoot":"","sources":["../src/marcoPublicConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE/C,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,SAAS,GAAG,aAAa,CAAA;AAEvE,eAAO,MAAM,SAAS,kBAGP,CAAA;AAEf,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE;QACL,GAAG,EAAE;YACH,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;QACD,GAAG,EAAE;YACH,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;QACD,GAAG,EAAE;YACH,OAAO,EAAE,MAAM,CAAA;YACf,UAAU,EAAE,MAAM,CAAA;SACnB,CAAA;QACD,EAAE,EAAE;YACF,KAAK,EAAE,MAAM,CAAA;YACb,IAAI,EAAE,MAAM,CAAA;YACZ,GAAG,EAAE,MAAM,CAAA;SACZ,CAAA;KACF,CAAA;IACD,KAAK,EAAE;QACL,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM,CAAA;SACjB,CAAA;QACD,OAAO,EAAE;YACP,QAAQ,EAAE,MAAM,CAAA;YAChB,QAAQ,EAAE,MAAM,CAAA;SACjB,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,QAAQ,EAAE;aACP,GAAG,IAAI,gBAAgB,GAAG;gBACzB,EAAE,EAAE,MAAM,CAAA;gBACV,QAAQ,EAAE;oBACR,OAAO,EAAE,MAAM,CAAA;oBACf,MAAM,EAAE,MAAM,CAAA;iBACf,CAAA;aACF;SACF,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;CACF,CAAA;AAmID,eAAO,MAAM,iBAAiB,SAAS,gBAAgB,sBAAmC,CAAA"}
@@ -29,6 +29,17 @@ const configMap = {
29
29
  tenantId: '33fe2afe-644d-4fe2-a264-c4f2c34fa2cf',
30
30
  },
31
31
  },
32
+ stripe: {
33
+ products: {
34
+ tier1: {
35
+ id: 'prod_TJW6TuhbdtnvMq',
36
+ priceIds: {
37
+ monthly: 'price_1SMt4h1m1XCLGhl4Qm46GQ3t',
38
+ yearly: 'price_1SMt5e1m1XCLGhl4nmyuoWqu',
39
+ },
40
+ },
41
+ },
42
+ },
32
43
  workOS: {
33
44
  clientId: 'client_01J51ET6KV4GBGMGHY0PJ9VGP2',
34
45
  },
@@ -60,6 +71,17 @@ const configMap = {
60
71
  tenantId: '33fe2afe-644d-4fe2-a264-c4f2c34fa2cf',
61
72
  },
62
73
  },
74
+ stripe: {
75
+ products: {
76
+ tier1: {
77
+ id: 'prod_TJW8qBSheqSNKz',
78
+ priceIds: {
79
+ monthly: 'price_1SMt5vP4o4KWHCwtGb0oqK6q',
80
+ yearly: 'price_1SMt5vP4o4KWHCwtS2DHx3eX',
81
+ },
82
+ },
83
+ },
84
+ },
63
85
  workOS: {
64
86
  clientId: 'client_01J51ET6RT5WCS3NNQYBB7FAE7',
65
87
  },
@@ -91,6 +113,17 @@ const configMap = {
91
113
  tenantId: '33fe2afe-644d-4fe2-a264-c4f2c34fa2cf',
92
114
  },
93
115
  },
116
+ stripe: {
117
+ products: {
118
+ tier1: {
119
+ id: 'prod_TJW6TuhbdtnvMq',
120
+ priceIds: {
121
+ monthly: 'price_1SMt4h1m1XCLGhl4Qm46GQ3t',
122
+ yearly: 'price_1SMt5e1m1XCLGhl4nmyuoWqu',
123
+ },
124
+ },
125
+ },
126
+ },
94
127
  workOS: {
95
128
  clientId: 'client_01J51ET6KV4GBGMGHY0PJ9VGP2',
96
129
  },
@@ -1,3 +1,5 @@
1
+ import { type StripeUserData } from './stripe';
2
+ export type { StripeUserData };
1
3
  export type { Account, AccountAlias, AccountLabel, Contact, Draft, DraftAttachment, DraftBody, Thread, ThreadMessage, ThreadMessageAttachment, ThreadMessageRecipient, User, UserPushNotificationToken, UserView, } from './models';
2
4
  export { mutatorSchemas } from './mutators';
3
5
  export declare const marcoSchemas: {
@@ -137,6 +139,46 @@ export declare const marcoSchemas: {
137
139
  readonly updatedAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
138
140
  readonly userId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
139
141
  }, undefined>;
142
+ stripeUserDataSchema: import("valibot").NullableSchema<import("valibot").ObjectSchema<{
143
+ readonly customer: import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
144
+ readonly deleted: import("valibot").OptionalSchema<import("valibot").NeverSchema<undefined>, undefined>;
145
+ readonly email: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
146
+ readonly id: import("valibot").StringSchema<undefined>;
147
+ readonly name: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
148
+ readonly object: import("valibot").LiteralSchema<"customer", undefined>;
149
+ }, undefined>, import("valibot").ObjectSchema<{
150
+ readonly deleted: import("valibot").LiteralSchema<true, undefined>;
151
+ readonly id: import("valibot").StringSchema<undefined>;
152
+ readonly object: import("valibot").LiteralSchema<"customer", undefined>;
153
+ }, undefined>], undefined>;
154
+ readonly product: import("valibot").NullableSchema<import("valibot").ObjectSchema<{
155
+ readonly description: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
156
+ readonly id: import("valibot").StringSchema<undefined>;
157
+ readonly name: import("valibot").StringSchema<undefined>;
158
+ readonly object: import("valibot").LiteralSchema<"product", undefined>;
159
+ }, undefined>, undefined>;
160
+ readonly subscription: import("valibot").NullableSchema<import("valibot").ObjectSchema<{
161
+ readonly cancelAtPeriodEnd: import("valibot").BooleanSchema<undefined>;
162
+ readonly discounts: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
163
+ readonly coupon: import("valibot").ObjectSchema<{
164
+ readonly amountOff: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
165
+ readonly id: import("valibot").StringSchema<undefined>;
166
+ readonly name: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
167
+ readonly percentOff: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
168
+ }, undefined>;
169
+ readonly end: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
170
+ readonly id: import("valibot").StringSchema<undefined>;
171
+ readonly start: import("valibot").NumberSchema<undefined>;
172
+ }, undefined>, undefined>;
173
+ readonly id: import("valibot").StringSchema<undefined>;
174
+ readonly object: import("valibot").LiteralSchema<"subscription", undefined>;
175
+ readonly startDate: import("valibot").NumberSchema<undefined>;
176
+ readonly status: import("valibot").PicklistSchema<[import("stripe").Stripe.Subscription.Status, ...import("stripe").Stripe.Subscription.Status[]], undefined>;
177
+ readonly trialEnd: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
178
+ readonly trialStart: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
179
+ }, undefined>, undefined>;
180
+ readonly subscriptionTier: import("valibot").NullableSchema<import("valibot").PicklistSchema<readonly ["tier1"], undefined>, undefined>;
181
+ }, undefined>, undefined>;
140
182
  threadFullSchema: import("valibot").ObjectSchema<{
141
183
  readonly messages: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
142
184
  readonly accountId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
@@ -261,8 +303,6 @@ export declare const marcoSchemas: {
261
303
  userSchema: import("valibot").ObjectSchema<{
262
304
  readonly id: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
263
305
  readonly name: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
264
- readonly polarCustomerId: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
265
- readonly polarSubscriptionStatus: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").PicklistSchema<[import("@polar-sh/sdk/models/components/subscriptionstatus.js").SubscriptionStatus, ...import("@polar-sh/sdk/models/components/subscriptionstatus.js").SubscriptionStatus[]], undefined>, undefined>, undefined>;
266
306
  readonly profilePicture: import("valibot").NullableSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
267
307
  readonly pushNotificationTokens: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
268
308
  readonly createdAt: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
@@ -270,6 +310,46 @@ export declare const marcoSchemas: {
270
310
  readonly token: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
271
311
  readonly userId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
272
312
  }, undefined>, undefined>;
313
+ readonly stripe: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").ObjectSchema<{
314
+ readonly customer: import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
315
+ readonly deleted: import("valibot").OptionalSchema<import("valibot").NeverSchema<undefined>, undefined>;
316
+ readonly email: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
317
+ readonly id: import("valibot").StringSchema<undefined>;
318
+ readonly name: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
319
+ readonly object: import("valibot").LiteralSchema<"customer", undefined>;
320
+ }, undefined>, import("valibot").ObjectSchema<{
321
+ readonly deleted: import("valibot").LiteralSchema<true, undefined>;
322
+ readonly id: import("valibot").StringSchema<undefined>;
323
+ readonly object: import("valibot").LiteralSchema<"customer", undefined>;
324
+ }, undefined>], undefined>;
325
+ readonly product: import("valibot").NullableSchema<import("valibot").ObjectSchema<{
326
+ readonly description: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
327
+ readonly id: import("valibot").StringSchema<undefined>;
328
+ readonly name: import("valibot").StringSchema<undefined>;
329
+ readonly object: import("valibot").LiteralSchema<"product", undefined>;
330
+ }, undefined>, undefined>;
331
+ readonly subscription: import("valibot").NullableSchema<import("valibot").ObjectSchema<{
332
+ readonly cancelAtPeriodEnd: import("valibot").BooleanSchema<undefined>;
333
+ readonly discounts: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
334
+ readonly coupon: import("valibot").ObjectSchema<{
335
+ readonly amountOff: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
336
+ readonly id: import("valibot").StringSchema<undefined>;
337
+ readonly name: import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>;
338
+ readonly percentOff: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
339
+ }, undefined>;
340
+ readonly end: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
341
+ readonly id: import("valibot").StringSchema<undefined>;
342
+ readonly start: import("valibot").NumberSchema<undefined>;
343
+ }, undefined>, undefined>;
344
+ readonly id: import("valibot").StringSchema<undefined>;
345
+ readonly object: import("valibot").LiteralSchema<"subscription", undefined>;
346
+ readonly startDate: import("valibot").NumberSchema<undefined>;
347
+ readonly status: import("valibot").PicklistSchema<[import("stripe").Stripe.Subscription.Status, ...import("stripe").Stripe.Subscription.Status[]], undefined>;
348
+ readonly trialEnd: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
349
+ readonly trialStart: import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
350
+ }, undefined>, undefined>;
351
+ readonly subscriptionTier: import("valibot").NullableSchema<import("valibot").PicklistSchema<readonly ["tier1"], undefined>, undefined>;
352
+ }, undefined>, undefined>, undefined>;
273
353
  readonly undoSendEnabled: import("valibot").BooleanSchema<undefined>;
274
354
  readonly views: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
275
355
  readonly aliasEmails: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AA8BA,YAAY,EACV,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,KAAK,EACL,eAAe,EACf,SAAS,EACT,MAAM,EACN,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,IAAI,EACJ,yBAAyB,EACzB,QAAQ,GACT,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BxB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,UAAU,CAAA;AAGpE,YAAY,EAAE,cAAc,EAAE,CAAA;AAE9B,YAAY,EACV,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,KAAK,EACL,eAAe,EACf,SAAS,EACT,MAAM,EACN,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,IAAI,EACJ,yBAAyB,EACzB,QAAQ,GACT,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BxB,CAAA"}
@@ -9,6 +9,7 @@ import { number } from './number';
9
9
  import { oauth } from './oauth';
10
10
  import { pushNotifications } from './pushNotifications';
11
11
  import { string } from './string';
12
+ import { stripeUserDataSchema } from './stripe';
12
13
  import { websocket } from './websocket';
13
14
  export { mutatorSchemas } from './mutators';
14
15
  export const marcoSchemas = {
@@ -25,6 +26,7 @@ export const marcoSchemas = {
25
26
  draftAttachmentSchema,
26
27
  draftBodySchema,
27
28
  draftSchema,
29
+ stripeUserDataSchema,
28
30
  threadFullSchema,
29
31
  threadListSchema,
30
32
  threadMessageAttachmentSchema,
@@ -14,8 +14,6 @@ export declare const userPushNotificationTokenSchema: v.ObjectSchema<{
14
14
  export declare const userSchema: v.ObjectSchema<{
15
15
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
16
16
  readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
17
- readonly polarCustomerId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
18
- readonly polarSubscriptionStatus: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<[import("@polar-sh/sdk/models/components/subscriptionstatus.js").SubscriptionStatus, ...import("@polar-sh/sdk/models/components/subscriptionstatus.js").SubscriptionStatus[]], undefined>, undefined>, undefined>;
19
17
  readonly profilePicture: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
20
18
  readonly pushNotificationTokens: v.ArraySchema<v.ObjectSchema<{
21
19
  readonly createdAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
@@ -23,6 +21,46 @@ export declare const userSchema: v.ObjectSchema<{
23
21
  readonly token: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
24
22
  readonly userId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
25
23
  }, undefined>, undefined>;
24
+ readonly stripe: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
25
+ readonly customer: v.UnionSchema<[v.ObjectSchema<{
26
+ readonly deleted: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
27
+ readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
28
+ readonly id: v.StringSchema<undefined>;
29
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
30
+ readonly object: v.LiteralSchema<"customer", undefined>;
31
+ }, undefined>, v.ObjectSchema<{
32
+ readonly deleted: v.LiteralSchema<true, undefined>;
33
+ readonly id: v.StringSchema<undefined>;
34
+ readonly object: v.LiteralSchema<"customer", undefined>;
35
+ }, undefined>], undefined>;
36
+ readonly product: v.NullableSchema<v.ObjectSchema<{
37
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
38
+ readonly id: v.StringSchema<undefined>;
39
+ readonly name: v.StringSchema<undefined>;
40
+ readonly object: v.LiteralSchema<"product", undefined>;
41
+ }, undefined>, undefined>;
42
+ readonly subscription: v.NullableSchema<v.ObjectSchema<{
43
+ readonly cancelAtPeriodEnd: v.BooleanSchema<undefined>;
44
+ readonly discounts: v.ArraySchema<v.ObjectSchema<{
45
+ readonly coupon: v.ObjectSchema<{
46
+ readonly amountOff: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
47
+ readonly id: v.StringSchema<undefined>;
48
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
49
+ readonly percentOff: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
50
+ }, undefined>;
51
+ readonly end: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
52
+ readonly id: v.StringSchema<undefined>;
53
+ readonly start: v.NumberSchema<undefined>;
54
+ }, undefined>, undefined>;
55
+ readonly id: v.StringSchema<undefined>;
56
+ readonly object: v.LiteralSchema<"subscription", undefined>;
57
+ readonly startDate: v.NumberSchema<undefined>;
58
+ readonly status: v.PicklistSchema<[import("stripe").Stripe.Subscription.Status, ...import("stripe").Stripe.Subscription.Status[]], undefined>;
59
+ readonly trialEnd: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
60
+ readonly trialStart: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
61
+ }, undefined>, undefined>;
62
+ readonly subscriptionTier: v.NullableSchema<v.PicklistSchema<readonly ["tier1"], undefined>, undefined>;
63
+ }, undefined>, undefined>, undefined>;
26
64
  readonly undoSendEnabled: v.BooleanSchema<undefined>;
27
65
  readonly views: v.ArraySchema<v.ObjectSchema<{
28
66
  readonly aliasEmails: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/schemas/models/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAM5B,eAAO,MAAM,cAAc;;;;;aAKzB,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;aAK1C,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;aASrB,CAAA;AAEF,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,UAAU,CAAC,CAAA;AACnD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,cAAc,CAAC,CAAA;AAC3D,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,CAAA"}
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/schemas/models/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAO5B,eAAO,MAAM,cAAc;;;;;aAKzB,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;aAK1C,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAQrB,CAAA;AAEF,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,UAAU,CAAC,CAAA;AACnD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,cAAc,CAAC,CAAA;AAC3D,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,CAAA"}
@@ -1,7 +1,8 @@
1
1
  import * as v from 'valibot';
2
2
  import { number } from '../../schemas/number';
3
3
  import { string } from '../../schemas/string';
4
- import { POLAR_SUBSCRIPTION_STATUSES, USER_SETTINGS_CUSTOM_VIEW_ICONS } from '../../types';
4
+ import { stripeUserDataSchema } from '../../schemas/stripe';
5
+ import { USER_SETTINGS_CUSTOM_VIEW_ICONS } from '../../types';
5
6
  export const userViewSchema = v.object({
6
7
  aliasEmails: v.array(string.required()),
7
8
  icon: v.picklist(USER_SETTINGS_CUSTOM_VIEW_ICONS),
@@ -17,10 +18,9 @@ export const userPushNotificationTokenSchema = v.object({
17
18
  export const userSchema = v.object({
18
19
  id: string.required(),
19
20
  name: string.nullable(),
20
- polarCustomerId: v.optional(v.nullable(v.string())),
21
- polarSubscriptionStatus: v.optional(v.nullable(v.picklist(POLAR_SUBSCRIPTION_STATUSES))),
22
21
  profilePicture: string.nullable(),
23
22
  pushNotificationTokens: v.array(userPushNotificationTokenSchema),
23
+ stripe: v.optional(stripeUserDataSchema),
24
24
  undoSendEnabled: v.boolean(),
25
25
  views: v.array(userViewSchema),
26
26
  });
@@ -0,0 +1,44 @@
1
+ import type Stripe from 'stripe';
2
+ import * as v from 'valibot';
3
+ export declare const stripeUserDataSchema: v.NullableSchema<v.ObjectSchema<{
4
+ readonly customer: v.UnionSchema<[v.ObjectSchema<{
5
+ readonly deleted: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
6
+ readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
7
+ readonly id: v.StringSchema<undefined>;
8
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
9
+ readonly object: v.LiteralSchema<"customer", undefined>;
10
+ }, undefined>, v.ObjectSchema<{
11
+ readonly deleted: v.LiteralSchema<true, undefined>;
12
+ readonly id: v.StringSchema<undefined>;
13
+ readonly object: v.LiteralSchema<"customer", undefined>;
14
+ }, undefined>], undefined>;
15
+ readonly product: v.NullableSchema<v.ObjectSchema<{
16
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
17
+ readonly id: v.StringSchema<undefined>;
18
+ readonly name: v.StringSchema<undefined>;
19
+ readonly object: v.LiteralSchema<"product", undefined>;
20
+ }, undefined>, undefined>;
21
+ readonly subscription: v.NullableSchema<v.ObjectSchema<{
22
+ readonly cancelAtPeriodEnd: v.BooleanSchema<undefined>;
23
+ readonly discounts: v.ArraySchema<v.ObjectSchema<{
24
+ readonly coupon: v.ObjectSchema<{
25
+ readonly amountOff: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
26
+ readonly id: v.StringSchema<undefined>;
27
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
28
+ readonly percentOff: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
29
+ }, undefined>;
30
+ readonly end: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
31
+ readonly id: v.StringSchema<undefined>;
32
+ readonly start: v.NumberSchema<undefined>;
33
+ }, undefined>, undefined>;
34
+ readonly id: v.StringSchema<undefined>;
35
+ readonly object: v.LiteralSchema<"subscription", undefined>;
36
+ readonly startDate: v.NumberSchema<undefined>;
37
+ readonly status: v.PicklistSchema<[Stripe.Subscription.Status, ...Stripe.Subscription.Status[]], undefined>;
38
+ readonly trialEnd: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
39
+ readonly trialStart: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
40
+ }, undefined>, undefined>;
41
+ readonly subscriptionTier: v.NullableSchema<v.PicklistSchema<readonly ["tier1"], undefined>, undefined>;
42
+ }, undefined>, undefined>;
43
+ export type StripeUserData = v.InferOutput<typeof stripeUserDataSchema>;
44
+ //# sourceMappingURL=stripe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripe.d.ts","sourceRoot":"","sources":["../../src/schemas/stripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAwE5B,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAOhC,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
@@ -0,0 +1,48 @@
1
+ import * as v from 'valibot';
2
+ import { STRIPE_SUBSCRIPTION_STATUSES, SUBSCRIPTION_TIERS } from '../types';
3
+ const stripeCustomerSchema = v.object({
4
+ deleted: v.optional(v.never()),
5
+ email: v.nullable(v.string()),
6
+ id: v.string(),
7
+ name: v.nullable(v.string()),
8
+ object: v.literal('customer'),
9
+ });
10
+ const stripeDeletedCustomerSchema = v.object({
11
+ deleted: v.literal(true),
12
+ id: v.string(),
13
+ object: v.literal('customer'),
14
+ });
15
+ const stripeProductSchema = v.object({
16
+ description: v.nullable(v.string()),
17
+ id: v.string(),
18
+ name: v.string(),
19
+ object: v.literal('product'),
20
+ });
21
+ const stripeCouponSchema = v.object({
22
+ amountOff: v.nullable(v.number()),
23
+ id: v.string(),
24
+ name: v.nullable(v.string()),
25
+ percentOff: v.nullable(v.number()),
26
+ });
27
+ const stripeDiscountSchema = v.object({
28
+ coupon: stripeCouponSchema,
29
+ end: v.nullable(v.number()),
30
+ id: v.string(),
31
+ start: v.number(),
32
+ });
33
+ const stripeSubscriptionSchema = v.object({
34
+ cancelAtPeriodEnd: v.boolean(),
35
+ discounts: v.array(stripeDiscountSchema),
36
+ id: v.string(),
37
+ object: v.literal('subscription'),
38
+ startDate: v.number(),
39
+ status: v.picklist(STRIPE_SUBSCRIPTION_STATUSES),
40
+ trialEnd: v.nullable(v.number()),
41
+ trialStart: v.nullable(v.number()),
42
+ });
43
+ export const stripeUserDataSchema = v.nullable(v.object({
44
+ customer: v.union([stripeCustomerSchema, stripeDeletedCustomerSchema]),
45
+ product: v.nullable(stripeProductSchema),
46
+ subscription: v.nullable(stripeSubscriptionSchema),
47
+ subscriptionTier: v.nullable(v.picklist(SUBSCRIPTION_TIERS)),
48
+ }));
@@ -67,25 +67,39 @@ export declare const endpoints: {
67
67
  user: typeof import("./private/mutations/user");
68
68
  };
69
69
  user: {
70
- deleteUser: EndpointConfig<"/v1/pv/user", GenericSchema | undefined, GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
70
+ createCheckoutSession: EndpointConfig<"/v1/pv/user/create-checkout-session", import("valibot").ObjectSchema<{
71
+ readonly cancelUrl: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
72
+ readonly priceId: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
73
+ readonly successUrl: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
74
+ }, undefined>, GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
71
75
  readonly data: import("valibot").ObjectSchema<{
72
76
  readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
73
77
  }, undefined>;
74
78
  readonly status: import("valibot").LiteralSchema<401, undefined>;
75
79
  }, undefined>, import("valibot").ObjectSchema<{
76
- readonly status: import("valibot").LiteralSchema<204, undefined>;
77
- }, undefined>], undefined>>;
78
- getBillingPortalUrl: EndpointConfig<"/v1/pv/user/billing-portal-url", GenericSchema | undefined, GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
79
80
  readonly data: import("valibot").ObjectSchema<{
80
- readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
81
+ readonly code: import("valibot").LiteralSchema<"VALIDATION_FAILED", undefined>;
82
+ readonly issues: import("valibot").ObjectSchema<{
83
+ readonly nested: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>, undefined>, undefined>;
84
+ readonly other: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
85
+ readonly root: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
86
+ }, undefined>;
81
87
  }, undefined>;
82
- readonly status: import("valibot").LiteralSchema<401, undefined>;
88
+ readonly status: import("valibot").LiteralSchema<400, undefined>;
83
89
  }, undefined>, import("valibot").ObjectSchema<{
84
90
  readonly data: import("valibot").ObjectSchema<{
85
91
  readonly url: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").UrlAction<string, undefined>]>;
86
92
  }, undefined>;
87
93
  readonly status: import("valibot").LiteralSchema<200, undefined>;
88
94
  }, undefined>], undefined>>;
95
+ deleteUser: EndpointConfig<"/v1/pv/user", GenericSchema | undefined, GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
96
+ readonly data: import("valibot").ObjectSchema<{
97
+ readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
98
+ }, undefined>;
99
+ readonly status: import("valibot").LiteralSchema<401, undefined>;
100
+ }, undefined>, import("valibot").ObjectSchema<{
101
+ readonly status: import("valibot").LiteralSchema<204, undefined>;
102
+ }, undefined>], undefined>>;
89
103
  uploadProfilePicture: EndpointConfig<"/v1/pv/user/profile-picture", import("valibot").BlobSchema<undefined>, GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
90
104
  readonly data: import("valibot").ObjectSchema<{
91
105
  readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/endpoints/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAA;AAWtE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/endpoints/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAA;AAWtE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGM,CAAA"}
@@ -64,25 +64,39 @@ export declare const privateGroup: {
64
64
  user: typeof import("./mutations/user");
65
65
  };
66
66
  user: {
67
- deleteUser: import("../../..").EndpointConfig<"/v1/pv/user", import("valibot").GenericSchema | undefined, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
67
+ createCheckoutSession: import("../../..").EndpointConfig<"/v1/pv/user/create-checkout-session", import("valibot").ObjectSchema<{
68
+ readonly cancelUrl: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
69
+ readonly priceId: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
70
+ readonly successUrl: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
71
+ }, undefined>, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
68
72
  readonly data: import("valibot").ObjectSchema<{
69
73
  readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
70
74
  }, undefined>;
71
75
  readonly status: import("valibot").LiteralSchema<401, undefined>;
72
76
  }, undefined>, import("valibot").ObjectSchema<{
73
- readonly status: import("valibot").LiteralSchema<204, undefined>;
74
- }, undefined>], undefined>>;
75
- getBillingPortalUrl: import("../../..").EndpointConfig<"/v1/pv/user/billing-portal-url", import("valibot").GenericSchema | undefined, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
76
77
  readonly data: import("valibot").ObjectSchema<{
77
- readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
78
+ readonly code: import("valibot").LiteralSchema<"VALIDATION_FAILED", undefined>;
79
+ readonly issues: import("valibot").ObjectSchema<{
80
+ readonly nested: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>, undefined>, undefined>;
81
+ readonly other: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
82
+ readonly root: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
83
+ }, undefined>;
78
84
  }, undefined>;
79
- readonly status: import("valibot").LiteralSchema<401, undefined>;
85
+ readonly status: import("valibot").LiteralSchema<400, undefined>;
80
86
  }, undefined>, import("valibot").ObjectSchema<{
81
87
  readonly data: import("valibot").ObjectSchema<{
82
88
  readonly url: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").UrlAction<string, undefined>]>;
83
89
  }, undefined>;
84
90
  readonly status: import("valibot").LiteralSchema<200, undefined>;
85
91
  }, undefined>], undefined>>;
92
+ deleteUser: import("../../..").EndpointConfig<"/v1/pv/user", import("valibot").GenericSchema | undefined, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
93
+ readonly data: import("valibot").ObjectSchema<{
94
+ readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
95
+ }, undefined>;
96
+ readonly status: import("valibot").LiteralSchema<401, undefined>;
97
+ }, undefined>, import("valibot").ObjectSchema<{
98
+ readonly status: import("valibot").LiteralSchema<204, undefined>;
99
+ }, undefined>], undefined>>;
86
100
  uploadProfilePicture: import("../../..").EndpointConfig<"/v1/pv/user/profile-picture", import("valibot").BlobSchema<undefined>, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
87
101
  readonly data: import("valibot").ObjectSchema<{
88
102
  readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdk/endpoints/private/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMxB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sdk/endpoints/private/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMxB,CAAA"}
@@ -13,8 +13,6 @@ export declare const getUser: import("../../../../..").EndpointConfig<"/v1/pv/mo
13
13
  readonly data: v.ObjectSchema<{
14
14
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
15
15
  readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
16
- readonly polarCustomerId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
17
- readonly polarSubscriptionStatus: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<[import("@polar-sh/sdk/models/components/subscriptionstatus.js").SubscriptionStatus, ...import("@polar-sh/sdk/models/components/subscriptionstatus.js").SubscriptionStatus[]], undefined>, undefined>, undefined>;
18
16
  readonly profilePicture: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
19
17
  readonly pushNotificationTokens: v.ArraySchema<v.ObjectSchema<{
20
18
  readonly createdAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
@@ -22,6 +20,46 @@ export declare const getUser: import("../../../../..").EndpointConfig<"/v1/pv/mo
22
20
  readonly token: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
23
21
  readonly userId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
24
22
  }, undefined>, undefined>;
23
+ readonly stripe: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
24
+ readonly customer: v.UnionSchema<[v.ObjectSchema<{
25
+ readonly deleted: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
26
+ readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
27
+ readonly id: v.StringSchema<undefined>;
28
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
29
+ readonly object: v.LiteralSchema<"customer", undefined>;
30
+ }, undefined>, v.ObjectSchema<{
31
+ readonly deleted: v.LiteralSchema<true, undefined>;
32
+ readonly id: v.StringSchema<undefined>;
33
+ readonly object: v.LiteralSchema<"customer", undefined>;
34
+ }, undefined>], undefined>;
35
+ readonly product: v.NullableSchema<v.ObjectSchema<{
36
+ readonly description: v.NullableSchema<v.StringSchema<undefined>, undefined>;
37
+ readonly id: v.StringSchema<undefined>;
38
+ readonly name: v.StringSchema<undefined>;
39
+ readonly object: v.LiteralSchema<"product", undefined>;
40
+ }, undefined>, undefined>;
41
+ readonly subscription: v.NullableSchema<v.ObjectSchema<{
42
+ readonly cancelAtPeriodEnd: v.BooleanSchema<undefined>;
43
+ readonly discounts: v.ArraySchema<v.ObjectSchema<{
44
+ readonly coupon: v.ObjectSchema<{
45
+ readonly amountOff: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
46
+ readonly id: v.StringSchema<undefined>;
47
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
48
+ readonly percentOff: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
49
+ }, undefined>;
50
+ readonly end: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
51
+ readonly id: v.StringSchema<undefined>;
52
+ readonly start: v.NumberSchema<undefined>;
53
+ }, undefined>, undefined>;
54
+ readonly id: v.StringSchema<undefined>;
55
+ readonly object: v.LiteralSchema<"subscription", undefined>;
56
+ readonly startDate: v.NumberSchema<undefined>;
57
+ readonly status: v.PicklistSchema<[import("stripe").Stripe.Subscription.Status, ...import("stripe").Stripe.Subscription.Status[]], undefined>;
58
+ readonly trialEnd: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
59
+ readonly trialStart: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
60
+ }, undefined>, undefined>;
61
+ readonly subscriptionTier: v.NullableSchema<v.PicklistSchema<readonly ["tier1"], undefined>, undefined>;
62
+ }, undefined>, undefined>, undefined>;
25
63
  readonly undoSendEnabled: v.BooleanSchema<undefined>;
26
64
  readonly views: v.ArraySchema<v.ObjectSchema<{
27
65
  readonly aliasEmails: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"getUser.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/models/user/getUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAM5B,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAWlB,CAAA"}
1
+ {"version":3,"file":"getUser.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/models/user/getUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAM5B,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAWlB,CAAA"}
@@ -0,0 +1,27 @@
1
+ import * as v from 'valibot';
2
+ export declare const createCheckoutSession: import("../../../..").EndpointConfig<"/v1/pv/user/create-checkout-session", v.ObjectSchema<{
3
+ readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
4
+ readonly priceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
5
+ readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6
+ }, undefined>, v.GenericSchema | undefined, v.UnionSchema<[v.ObjectSchema<{
7
+ readonly data: v.ObjectSchema<{
8
+ readonly code: v.LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
9
+ }, undefined>;
10
+ readonly status: v.LiteralSchema<401, undefined>;
11
+ }, undefined>, v.ObjectSchema<{
12
+ readonly data: v.ObjectSchema<{
13
+ readonly code: v.LiteralSchema<"VALIDATION_FAILED", undefined>;
14
+ readonly issues: v.ObjectSchema<{
15
+ readonly nested: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>, undefined>;
16
+ readonly other: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
17
+ readonly root: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
18
+ }, undefined>;
19
+ }, undefined>;
20
+ readonly status: v.LiteralSchema<400, undefined>;
21
+ }, undefined>, v.ObjectSchema<{
22
+ readonly data: v.ObjectSchema<{
23
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
24
+ }, undefined>;
25
+ readonly status: v.LiteralSchema<200, undefined>;
26
+ }, undefined>], undefined>>;
27
+ //# sourceMappingURL=createCheckoutSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCheckoutSession.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/endpoints/private/user/createCheckoutSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAK5B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;2BAgBhC,CAAA"}
@@ -0,0 +1,20 @@
1
+ import * as v from 'valibot';
2
+ import { createEndpoint } from '../../../../sdk/endpoints/createEndpointConfig';
3
+ import { authFailedErrorSchema, validationFailedErrorSchema } from '../../../../sdk/validation/errors';
4
+ export const createCheckoutSession = createEndpoint({
5
+ body: v.object({
6
+ cancelUrl: v.pipe(v.string(), v.minLength(1)),
7
+ priceId: v.pipe(v.string(), v.minLength(1)),
8
+ successUrl: v.pipe(v.string(), v.minLength(1)),
9
+ }),
10
+ method: 'POST',
11
+ path: '/v1/pv/user/create-checkout-session',
12
+ response: v.union([
13
+ authFailedErrorSchema,
14
+ validationFailedErrorSchema,
15
+ v.object({
16
+ data: v.object({ url: v.pipe(v.string(), v.url()) }),
17
+ status: v.literal(200),
18
+ }),
19
+ ]),
20
+ });
@@ -1,23 +1,37 @@
1
1
  export declare const user: {
2
- deleteUser: import("../../../..").EndpointConfig<"/v1/pv/user", import("valibot").GenericSchema | undefined, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
2
+ createCheckoutSession: import("../../../..").EndpointConfig<"/v1/pv/user/create-checkout-session", import("valibot").ObjectSchema<{
3
+ readonly cancelUrl: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
4
+ readonly priceId: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
5
+ readonly successUrl: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
6
+ }, undefined>, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
3
7
  readonly data: import("valibot").ObjectSchema<{
4
8
  readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
5
9
  }, undefined>;
6
10
  readonly status: import("valibot").LiteralSchema<401, undefined>;
7
11
  }, undefined>, import("valibot").ObjectSchema<{
8
- readonly status: import("valibot").LiteralSchema<204, undefined>;
9
- }, undefined>], undefined>>;
10
- getBillingPortalUrl: import("../../../..").EndpointConfig<"/v1/pv/user/billing-portal-url", import("valibot").GenericSchema | undefined, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
11
12
  readonly data: import("valibot").ObjectSchema<{
12
- readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
13
+ readonly code: import("valibot").LiteralSchema<"VALIDATION_FAILED", undefined>;
14
+ readonly issues: import("valibot").ObjectSchema<{
15
+ readonly nested: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>, undefined>, undefined>;
16
+ readonly other: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
17
+ readonly root: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
18
+ }, undefined>;
13
19
  }, undefined>;
14
- readonly status: import("valibot").LiteralSchema<401, undefined>;
20
+ readonly status: import("valibot").LiteralSchema<400, undefined>;
15
21
  }, undefined>, import("valibot").ObjectSchema<{
16
22
  readonly data: import("valibot").ObjectSchema<{
17
23
  readonly url: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").UrlAction<string, undefined>]>;
18
24
  }, undefined>;
19
25
  readonly status: import("valibot").LiteralSchema<200, undefined>;
20
26
  }, undefined>], undefined>>;
27
+ deleteUser: import("../../../..").EndpointConfig<"/v1/pv/user", import("valibot").GenericSchema | undefined, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
28
+ readonly data: import("valibot").ObjectSchema<{
29
+ readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
30
+ }, undefined>;
31
+ readonly status: import("valibot").LiteralSchema<401, undefined>;
32
+ }, undefined>, import("valibot").ObjectSchema<{
33
+ readonly status: import("valibot").LiteralSchema<204, undefined>;
34
+ }, undefined>], undefined>>;
21
35
  uploadProfilePicture: import("../../../..").EndpointConfig<"/v1/pv/user/profile-picture", import("valibot").BlobSchema<undefined>, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
22
36
  readonly data: import("valibot").ObjectSchema<{
23
37
  readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/endpoints/private/user/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/endpoints/private/user/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhB,CAAA"}
@@ -1,8 +1,8 @@
1
+ import { createCheckoutSession } from './createCheckoutSession';
1
2
  import { deleteUser } from './deleteUser';
2
- import { getBillingPortalUrl } from './getBillingPortalUrl';
3
3
  import { uploadProfilePicture } from './uploadProfilePicture';
4
4
  export const user = {
5
+ createCheckoutSession,
5
6
  deleteUser,
6
- getBillingPortalUrl,
7
7
  uploadProfilePicture,
8
8
  };
@@ -66,25 +66,39 @@ export declare const marcoSDK: {
66
66
  user: typeof import("./endpoints/private/mutations/user");
67
67
  };
68
68
  user: {
69
- deleteUser: import("..").EndpointConfig<"/v1/pv/user", import("valibot").GenericSchema | undefined, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
69
+ createCheckoutSession: import("..").EndpointConfig<"/v1/pv/user/create-checkout-session", import("valibot").ObjectSchema<{
70
+ readonly cancelUrl: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
71
+ readonly priceId: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
72
+ readonly successUrl: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
73
+ }, undefined>, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
70
74
  readonly data: import("valibot").ObjectSchema<{
71
75
  readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
72
76
  }, undefined>;
73
77
  readonly status: import("valibot").LiteralSchema<401, undefined>;
74
78
  }, undefined>, import("valibot").ObjectSchema<{
75
- readonly status: import("valibot").LiteralSchema<204, undefined>;
76
- }, undefined>], undefined>>;
77
- getBillingPortalUrl: import("..").EndpointConfig<"/v1/pv/user/billing-portal-url", import("valibot").GenericSchema | undefined, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
78
79
  readonly data: import("valibot").ObjectSchema<{
79
- readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
80
+ readonly code: import("valibot").LiteralSchema<"VALIDATION_FAILED", undefined>;
81
+ readonly issues: import("valibot").ObjectSchema<{
82
+ readonly nested: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>, undefined>, undefined>;
83
+ readonly other: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
84
+ readonly root: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
85
+ }, undefined>;
80
86
  }, undefined>;
81
- readonly status: import("valibot").LiteralSchema<401, undefined>;
87
+ readonly status: import("valibot").LiteralSchema<400, undefined>;
82
88
  }, undefined>, import("valibot").ObjectSchema<{
83
89
  readonly data: import("valibot").ObjectSchema<{
84
90
  readonly url: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").UrlAction<string, undefined>]>;
85
91
  }, undefined>;
86
92
  readonly status: import("valibot").LiteralSchema<200, undefined>;
87
93
  }, undefined>], undefined>>;
94
+ deleteUser: import("..").EndpointConfig<"/v1/pv/user", import("valibot").GenericSchema | undefined, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
95
+ readonly data: import("valibot").ObjectSchema<{
96
+ readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
97
+ }, undefined>;
98
+ readonly status: import("valibot").LiteralSchema<401, undefined>;
99
+ }, undefined>, import("valibot").ObjectSchema<{
100
+ readonly status: import("valibot").LiteralSchema<204, undefined>;
101
+ }, undefined>], undefined>>;
88
102
  uploadProfilePicture: import("..").EndpointConfig<"/v1/pv/user/profile-picture", import("valibot").BlobSchema<undefined>, import("valibot").GenericSchema | undefined, import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
89
103
  readonly data: import("valibot").ObjectSchema<{
90
104
  readonly code: import("valibot").LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGpB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGpB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type Stripe from 'stripe';
2
+ export declare const STRIPE_SUBSCRIPTION_STATUSES: [Stripe.Subscription.Status, ...Stripe.Subscription.Status[]];
3
+ export type StripeSubscriptionStatus = Stripe.Subscription.Status;
4
+ //# sourceMappingURL=StripeSubscriptionStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StripeSubscriptionStatus.d.ts","sourceRoot":"","sources":["../../src/types/StripeSubscriptionStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAahC,eAAO,MAAM,4BAA4B,EAAe,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAA;AAErH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAA"}
@@ -0,0 +1,11 @@
1
+ const statuses = [
2
+ 'active',
3
+ 'canceled',
4
+ 'incomplete',
5
+ 'incomplete_expired',
6
+ 'past_due',
7
+ 'paused',
8
+ 'trialing',
9
+ 'unpaid',
10
+ ];
11
+ export const STRIPE_SUBSCRIPTION_STATUSES = statuses;
@@ -0,0 +1,3 @@
1
+ export declare const SUBSCRIPTION_TIERS: readonly ["tier1"];
2
+ export type SubscriptionTier = (typeof SUBSCRIPTION_TIERS)[number];
3
+ //# sourceMappingURL=SubscriptionTier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscriptionTier.d.ts","sourceRoot":"","sources":["../../src/types/SubscriptionTier.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,oBAAqB,CAAA;AAEpD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export const SUBSCRIPTION_TIERS = ['tier1'];
@@ -11,7 +11,8 @@ export * from './MarcoPlatform';
11
11
  export * from './MessageRecipientType';
12
12
  export * from './OAuthProvider';
13
13
  export * from './PokeEvent';
14
- export * from './PolarSubscriptionStatus';
15
14
  export * from './SDKError';
15
+ export * from './StripeSubscriptionStatus';
16
+ export * from './SubscriptionTier';
16
17
  export * from './UserSettings';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA"}
@@ -11,6 +11,7 @@ export * from './MarcoPlatform';
11
11
  export * from './MessageRecipientType';
12
12
  export * from './OAuthProvider';
13
13
  export * from './PokeEvent';
14
- export * from './PolarSubscriptionStatus';
15
14
  export * from './SDKError';
15
+ export * from './StripeSubscriptionStatus';
16
+ export * from './SubscriptionTier';
16
17
  export * from './UserSettings';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcoappio/marco-config",
3
- "version": "2.0.552",
3
+ "version": "2.0.554",
4
4
  "author": "team@marcoapp.io",
5
5
  "main": "dist/index.js",
6
6
  "repository": "git@github.com:marcoappio/marco-config.git",
@@ -27,7 +27,8 @@
27
27
  "dependencies": {
28
28
  "@orama/stemmers": "3.1.16",
29
29
  "@orama/stopwords": "3.1.16",
30
- "@polar-sh/sdk": "0.42.2",
30
+ "stripe": "20.3.0",
31
+ "type-fest": "5.4.2",
31
32
  "valibot": "1.1.0"
32
33
  },
33
34
  "devDependencies": {
@@ -1,13 +0,0 @@
1
- import * as v from 'valibot';
2
- export declare const getBillingPortalUrl: import("../../../..").EndpointConfig<"/v1/pv/user/billing-portal-url", v.GenericSchema | undefined, v.GenericSchema | undefined, v.UnionSchema<[v.ObjectSchema<{
3
- readonly data: v.ObjectSchema<{
4
- readonly code: v.LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
5
- }, undefined>;
6
- readonly status: v.LiteralSchema<401, undefined>;
7
- }, undefined>, v.ObjectSchema<{
8
- readonly data: v.ObjectSchema<{
9
- readonly url: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
10
- }, undefined>;
11
- readonly status: v.LiteralSchema<200, undefined>;
12
- }, undefined>], undefined>>;
13
- //# sourceMappingURL=getBillingPortalUrl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getBillingPortalUrl.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/endpoints/private/user/getBillingPortalUrl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAK5B,eAAO,MAAM,mBAAmB;;;;;;;;;;2BAU9B,CAAA"}
@@ -1,14 +0,0 @@
1
- import * as v from 'valibot';
2
- import { createEndpoint } from '../../../../sdk/endpoints/createEndpointConfig';
3
- import { authFailedErrorSchema } from '../../../../sdk/validation/errors';
4
- export const getBillingPortalUrl = createEndpoint({
5
- method: 'GET',
6
- path: '/v1/pv/user/billing-portal-url',
7
- response: v.union([
8
- authFailedErrorSchema,
9
- v.object({
10
- data: v.object({ url: v.pipe(v.string(), v.url()) }),
11
- status: v.literal(200),
12
- }),
13
- ]),
14
- });
@@ -1,4 +0,0 @@
1
- import { type SubscriptionStatus as PolarSubscriptionStatusType } from '@polar-sh/sdk/models/components/subscriptionstatus.js';
2
- export declare const POLAR_SUBSCRIPTION_STATUSES: [PolarSubscriptionStatusType, ...PolarSubscriptionStatusType[]];
3
- export type PolarSubscriptionStatus = PolarSubscriptionStatusType;
4
- //# sourceMappingURL=PolarSubscriptionStatus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PolarSubscriptionStatus.d.ts","sourceRoot":"","sources":["../../src/types/PolarSubscriptionStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,IAAI,2BAA2B,EAEvD,MAAM,uDAAuD,CAAA;AAI9D,eAAO,MAAM,2BAA2B,EAAe,CAAC,2BAA2B,EAAE,GAAG,2BAA2B,EAAE,CAAC,CAAA;AAEtH,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,CAAA"}
@@ -1,3 +0,0 @@
1
- import { SubscriptionStatus, } from '@polar-sh/sdk/models/components/subscriptionstatus.js';
2
- const statuses = Object.values(SubscriptionStatus);
3
- export const POLAR_SUBSCRIPTION_STATUSES = statuses;