@marcoappio/marco-config 2.0.551 → 2.0.553

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 (72) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/schemas/index.d.ts +82 -25
  5. package/dist/schemas/index.d.ts.map +1 -1
  6. package/dist/schemas/index.js +2 -2
  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/mutators/mutatorSchemas.d.ts +0 -9
  11. package/dist/schemas/mutators/mutatorSchemas.d.ts.map +1 -1
  12. package/dist/schemas/mutators/mutatorSchemas.js +0 -6
  13. package/dist/schemas/stripe.d.ts +44 -0
  14. package/dist/schemas/stripe.d.ts.map +1 -0
  15. package/dist/schemas/stripe.js +48 -0
  16. package/dist/sdk/endpoints/index.d.ts +20 -6
  17. package/dist/sdk/endpoints/index.d.ts.map +1 -1
  18. package/dist/sdk/endpoints/private/index.d.ts +20 -6
  19. package/dist/sdk/endpoints/private/index.d.ts.map +1 -1
  20. package/dist/sdk/endpoints/private/models/thread/getThreadList.d.ts +0 -2
  21. package/dist/sdk/endpoints/private/models/thread/getThreadList.d.ts.map +1 -1
  22. package/dist/sdk/endpoints/private/models/thread/getThreadList.js +0 -1
  23. package/dist/sdk/endpoints/private/models/thread/getThreads.d.ts +0 -2
  24. package/dist/sdk/endpoints/private/models/thread/getThreads.d.ts.map +1 -1
  25. package/dist/sdk/endpoints/private/models/thread/getThreads.js +0 -1
  26. package/dist/sdk/endpoints/private/models/user/getUser.d.ts +40 -2
  27. package/dist/sdk/endpoints/private/models/user/getUser.d.ts.map +1 -1
  28. package/dist/sdk/endpoints/private/mutations/draft/index.d.ts +0 -1
  29. package/dist/sdk/endpoints/private/mutations/draft/index.d.ts.map +1 -1
  30. package/dist/sdk/endpoints/private/mutations/draft/index.js +0 -1
  31. package/dist/sdk/endpoints/private/user/createCheckoutSession.d.ts +27 -0
  32. package/dist/sdk/endpoints/private/user/createCheckoutSession.d.ts.map +1 -0
  33. package/dist/sdk/endpoints/private/user/createCheckoutSession.js +20 -0
  34. package/dist/sdk/endpoints/private/user/index.d.ts +20 -6
  35. package/dist/sdk/endpoints/private/user/index.d.ts.map +1 -1
  36. package/dist/sdk/endpoints/private/user/index.js +2 -2
  37. package/dist/sdk/index.d.ts +20 -6
  38. package/dist/sdk/index.d.ts.map +1 -1
  39. package/dist/types/StripeSubscriptionStatus.d.ts +4 -0
  40. package/dist/types/StripeSubscriptionStatus.d.ts.map +1 -0
  41. package/dist/types/StripeSubscriptionStatus.js +11 -0
  42. package/dist/types/SubscriptionTier.d.ts +3 -0
  43. package/dist/types/SubscriptionTier.d.ts.map +1 -0
  44. package/dist/types/SubscriptionTier.js +1 -0
  45. package/dist/types/index.d.ts +2 -1
  46. package/dist/types/index.d.ts.map +1 -1
  47. package/dist/types/index.js +2 -1
  48. package/dist/utils/index.d.ts +0 -1
  49. package/dist/utils/index.d.ts.map +1 -1
  50. package/dist/utils/index.js +0 -1
  51. package/package.json +3 -3
  52. package/dist/schemas/drafts.d.ts +0 -16
  53. package/dist/schemas/drafts.d.ts.map +0 -1
  54. package/dist/schemas/drafts.js +0 -12
  55. package/dist/sdk/endpoints/private/mutations/draft/setContent.d.ts +0 -43
  56. package/dist/sdk/endpoints/private/mutations/draft/setContent.d.ts.map +0 -1
  57. package/dist/sdk/endpoints/private/mutations/draft/setContent.js +0 -19
  58. package/dist/sdk/endpoints/private/user/getBillingPortalUrl.d.ts +0 -13
  59. package/dist/sdk/endpoints/private/user/getBillingPortalUrl.d.ts.map +0 -1
  60. package/dist/sdk/endpoints/private/user/getBillingPortalUrl.js +0 -14
  61. package/dist/types/PolarSubscriptionStatus.d.ts +0 -4
  62. package/dist/types/PolarSubscriptionStatus.d.ts.map +0 -1
  63. package/dist/types/PolarSubscriptionStatus.js +0 -3
  64. package/dist/utils/stringPatch/index.d.ts +0 -2
  65. package/dist/utils/stringPatch/index.d.ts.map +0 -1
  66. package/dist/utils/stringPatch/index.js +0 -1
  67. package/dist/utils/stringPatch/stringPatch.d.ts +0 -9
  68. package/dist/utils/stringPatch/stringPatch.d.ts.map +0 -1
  69. package/dist/utils/stringPatch/stringPatch.js +0 -36
  70. package/dist/utils/stringPatch/stringPatch.test.d.ts +0 -2
  71. package/dist/utils/stringPatch/stringPatch.test.d.ts.map +0 -1
  72. package/dist/utils/stringPatch/stringPatch.test.js +0 -101
package/dist/index.d.ts CHANGED
@@ -3,5 +3,5 @@ export { MARCO_ENV, MarcoEnvironment, marcoPublicConfig } from './marcoPublicCon
3
3
  export { type Account, type AccountAlias, type AccountLabel, type Contact, type Draft, type DraftAttachment, type DraftBody, marcoSchemas, type Thread, type ThreadMessage, type ThreadMessageAttachment, type ThreadMessageRecipient, type User, type UserPushNotificationToken, type UserView, } from './schemas';
4
4
  export { marcoSDK } from './sdk';
5
5
  export * from './types';
6
- export { accountUtils, labelUtils, stringPatch, threadsUtils } from './utils';
6
+ export { accountUtils, labelUtils, threadsUtils } from './utils';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,YAAY,EACZ,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,IAAI,EACT,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,GACd,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,YAAY,EACZ,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,IAAI,EACT,KAAK,yBAAyB,EAC9B,KAAK,QAAQ,GACd,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -3,4 +3,4 @@ export { MARCO_ENV, marcoPublicConfig } from './marcoPublicConfig';
3
3
  export { marcoSchemas, } from './schemas';
4
4
  export { marcoSDK } from './sdk';
5
5
  export * from './types';
6
- export { accountUtils, labelUtils, stringPatch, threadsUtils } from './utils';
6
+ export { accountUtils, labelUtils, threadsUtils } from './utils';
@@ -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: {
@@ -14,20 +16,6 @@ export declare const marcoSchemas: {
14
16
  boolean: {
15
17
  fromString: () => import("valibot").SchemaWithPipe<readonly [import("valibot").PicklistSchema<["true", "false"], undefined>, import("valibot").TransformAction<"true" | "false", boolean>, import("valibot").BooleanSchema<undefined>]>;
16
18
  };
17
- drafts: {
18
- contentPatch: {
19
- instruction: () => import("valibot").ObjectSchema<{
20
- readonly index: import("valibot").NumberSchema<undefined>;
21
- readonly type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"INSERTION", undefined>, import("valibot").LiteralSchema<"DELETION", undefined>], undefined>;
22
- readonly value: import("valibot").StringSchema<undefined>;
23
- }, undefined>;
24
- patch: () => import("valibot").ArraySchema<import("valibot").ObjectSchema<{
25
- readonly index: import("valibot").NumberSchema<undefined>;
26
- readonly type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"INSERTION", undefined>, import("valibot").LiteralSchema<"DELETION", undefined>], undefined>;
27
- readonly value: import("valibot").StringSchema<undefined>;
28
- }, undefined>, undefined>;
29
- };
30
- };
31
19
  emailAccount: {
32
20
  connectionConfigImapRaw: () => import("valibot").ObjectSchema<{
33
21
  readonly imapHost: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
@@ -151,6 +139,46 @@ export declare const marcoSchemas: {
151
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>;
152
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>;
153
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>;
154
182
  threadFullSchema: import("valibot").ObjectSchema<{
155
183
  readonly messages: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
156
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>;
@@ -275,8 +303,6 @@ export declare const marcoSchemas: {
275
303
  userSchema: import("valibot").ObjectSchema<{
276
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>;
277
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>;
278
- readonly polarCustomerId: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
279
- 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>;
280
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>;
281
307
  readonly pushNotificationTokens: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
282
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>;
@@ -284,6 +310,46 @@ export declare const marcoSchemas: {
284
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>;
285
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>;
286
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>;
287
353
  readonly undoSendEnabled: import("valibot").BooleanSchema<undefined>;
288
354
  readonly views: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
289
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>;
@@ -426,15 +492,6 @@ export declare const marcoSchemas: {
426
492
  readonly scheduledFor: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
427
493
  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>;
428
494
  }, undefined>], undefined>;
429
- setContent: import("valibot").ObjectSchema<{
430
- 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>;
431
- readonly patch: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
432
- readonly index: import("valibot").NumberSchema<undefined>;
433
- readonly type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"INSERTION", undefined>, import("valibot").LiteralSchema<"DELETION", undefined>], undefined>;
434
- readonly value: import("valibot").StringSchema<undefined>;
435
- }, undefined>, undefined>;
436
- 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>;
437
- }, undefined>;
438
495
  setEnvelope: import("valibot").ObjectSchema<{
439
496
  readonly envelope: Omit<import("valibot").ObjectSchema<{
440
497
  readonly bcc: import("valibot").ArraySchema<import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").RfcEmailAction<string, undefined>]>, undefined>, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AA+BA,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"}
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"}
@@ -1,7 +1,6 @@
1
1
  import { app } from './app';
2
2
  import { auth } from './auth';
3
3
  import { boolean } from './boolean';
4
- import { drafts } from './drafts';
5
4
  import { emailAccount } from './emailAccount';
6
5
  import { labels } from './labels';
7
6
  import { accountAliasSchema, accountLabelSchema, accountSchema, contactSchema, draftAttachmentSchema, draftBodySchema, draftSchema, threadFullSchema, threadListSchema, threadMessageAttachmentSchema, threadMessageRecipientSchema, threadMessageSchema, threadSchema, userPushNotificationTokenSchema, userSchema, userViewSchema, } from './models';
@@ -10,13 +9,13 @@ import { number } from './number';
10
9
  import { oauth } from './oauth';
11
10
  import { pushNotifications } from './pushNotifications';
12
11
  import { string } from './string';
12
+ import { stripeUserDataSchema } from './stripe';
13
13
  import { websocket } from './websocket';
14
14
  export { mutatorSchemas } from './mutators';
15
15
  export const marcoSchemas = {
16
16
  app,
17
17
  auth,
18
18
  boolean,
19
- drafts,
20
19
  emailAccount,
21
20
  labels,
22
21
  models: {
@@ -27,6 +26,7 @@ export const marcoSchemas = {
27
26
  draftAttachmentSchema,
28
27
  draftBodySchema,
29
28
  draftSchema,
29
+ stripeUserDataSchema,
30
30
  threadFullSchema,
31
31
  threadListSchema,
32
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
  });
@@ -126,15 +126,6 @@ export declare const mutatorSchemas: {
126
126
  readonly scheduledFor: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
127
127
  readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
128
128
  }, undefined>], undefined>;
129
- setContent: v.ObjectSchema<{
130
- readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
131
- readonly patch: v.ArraySchema<v.ObjectSchema<{
132
- readonly index: v.NumberSchema<undefined>;
133
- readonly type: v.UnionSchema<[v.LiteralSchema<"INSERTION", undefined>, v.LiteralSchema<"DELETION", undefined>], undefined>;
134
- readonly value: v.StringSchema<undefined>;
135
- }, undefined>, undefined>;
136
- readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
137
- }, undefined>;
138
129
  setEnvelope: v.ObjectSchema<{
139
130
  readonly envelope: Omit<v.ObjectSchema<{
140
131
  readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, undefined>, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"mutatorSchemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/mutators/mutatorSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA0F5B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2J1B,CAAA"}
1
+ {"version":3,"file":"mutatorSchemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/mutators/mutatorSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAyF5B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsJ1B,CAAA"}
@@ -1,7 +1,6 @@
1
1
  import * as v from 'valibot';
2
2
  import { marcoConstants } from '../../constants';
3
3
  import { DRAFT_ATTACHMENT_UPLOAD_STATUSES, DRAFT_STATUSES, DRAFT_TYPES, USER_SETTINGS_CUSTOM_VIEW_ICONS, } from '../../types';
4
- import { drafts } from '../drafts';
5
4
  import { socketTypeSchema } from '../emailAccount';
6
5
  import { number } from '../number';
7
6
  import { oauth } from '../oauth';
@@ -156,11 +155,6 @@ export const mutatorSchemas = {
156
155
  updatedAt: number.positiveInteger(),
157
156
  }),
158
157
  ]),
159
- setContent: v.object({
160
- id: string.required(),
161
- patch: drafts.contentPatch.patch(),
162
- updatedAt: number.positiveInteger(),
163
- }),
164
158
  setEnvelope: v.object({
165
159
  envelope: v.omit(draftBodySchema, ['content']),
166
160
  id: string.required(),
@@ -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").UrlAction<string, 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").UrlAction<string, 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").UrlAction<string, 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").UrlAction<string, 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"}
@@ -4,7 +4,6 @@ export declare const getThreadList: import("../../../../..").EndpointConfig<"/v1
4
4
  readonly labelIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
5
5
  readonly cursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
6
6
  readonly flagged: v.OptionalSchema<v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false"], undefined>, v.TransformAction<"true" | "false", boolean>, v.BooleanSchema<undefined>]>, undefined>;
7
- readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
8
7
  readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
9
8
  readonly messageIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
10
9
  readonly participants: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
@@ -15,7 +14,6 @@ export declare const getThreadList: import("../../../../..").EndpointConfig<"/v1
15
14
  readonly labelIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
16
15
  readonly cursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
17
16
  readonly flagged: v.OptionalSchema<v.SchemaWithPipe<readonly [v.PicklistSchema<["true", "false"], undefined>, v.TransformAction<"true" | "false", boolean>, v.BooleanSchema<undefined>]>, undefined>;
18
- readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
19
17
  readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.TransformAction<string, number>, v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
20
18
  readonly messageIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
21
19
  readonly participants: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"getThreadList.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/models/thread/getThreadList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAmC5B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAaxB,CAAA"}
1
+ {"version":3,"file":"getThreadList.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/endpoints/private/models/thread/getThreadList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAkC5B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAaxB,CAAA"}
@@ -6,7 +6,6 @@ import { authFailedErrorSchema, userNotFoundErrorSchema, validationFailedErrorSc
6
6
  const baseQuerySchema = {
7
7
  cursor: v.optional(v.string()),
8
8
  flagged: v.optional(marcoSchemas.boolean.fromString()),
9
- id: v.optional(v.string()),
10
9
  limit: v.optional(marcoSchemas.number.positiveIntegerFromString()),
11
10
  messageIds: v.optional(v.array(v.string())),
12
11
  participants: v.optional(v.array(v.string())),