@raideno/convex-stripe 0.1.0 → 0.1.2

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 (68) hide show
  1. package/dist/index.d.ts +0 -2
  2. package/dist/index.js +1 -0
  3. package/dist/server/actions/index.d.ts +4 -0
  4. package/dist/server/actions/pay.d.ts +579 -0
  5. package/dist/server/actions/portal.d.ts +26 -0
  6. package/dist/server/actions/setup.d.ts +19 -0
  7. package/dist/server/actions/subscribe.d.ts +44 -0
  8. package/dist/server/helpers.d.ts +28 -0
  9. package/dist/server/index.d.ts +589 -0
  10. package/dist/server/logger.d.ts +8 -0
  11. package/dist/server/redirects/index.d.ts +47 -0
  12. package/dist/server/redirects/pay.d.ts +5 -0
  13. package/dist/server/redirects/portal.d.ts +3 -0
  14. package/dist/server/redirects/subscribe.d.ts +3 -0
  15. package/dist/server/redirects/types.d.ts +9 -0
  16. package/dist/server/schema/checkout-session.d.ts +256 -0
  17. package/dist/server/schema/coupon.d.ts +112 -0
  18. package/dist/server/schema/customer.d.ts +366 -0
  19. package/dist/server/schema/index.d.ts +3511 -0
  20. package/dist/server/schema/invoice.d.ts +314 -0
  21. package/dist/server/schema/payment-intent.d.ts +311 -0
  22. package/dist/server/schema/payout.d.ts +140 -0
  23. package/dist/server/schema/price.d.ts +148 -0
  24. package/dist/server/schema/product.d.ts +132 -0
  25. package/dist/server/schema/promotion-code.d.ts +266 -0
  26. package/dist/server/schema/refund.d.ts +92 -0
  27. package/dist/server/schema/review.d.ts +152 -0
  28. package/dist/server/schema/subscription.d.ts +4 -0
  29. package/dist/server/store/index.d.ts +582 -0
  30. package/dist/server/store/operations/delete-by-id.d.ts +3 -0
  31. package/dist/server/store/operations/index.d.ts +5 -0
  32. package/dist/server/store/operations/select-all.d.ts +3 -0
  33. package/dist/server/store/operations/select-by-id.d.ts +4 -0
  34. package/dist/server/store/operations/select-one.d.ts +3 -0
  35. package/dist/server/store/operations/upsert.d.ts +4 -0
  36. package/dist/server/store/types.d.ts +70 -0
  37. package/dist/server/sync/all.d.ts +5 -0
  38. package/dist/server/sync/checkouts-session.handler.d.ts +5 -0
  39. package/dist/server/sync/coupons.handler.d.ts +5 -0
  40. package/dist/server/sync/customers.handler.d.ts +5 -0
  41. package/dist/server/sync/invoices.handler.d.ts +5 -0
  42. package/dist/server/sync/payment-intent.handler.d.ts +5 -0
  43. package/dist/server/sync/payouts.handler.d.ts +5 -0
  44. package/dist/server/sync/prices.handler.d.ts +5 -0
  45. package/dist/server/sync/products.handler.d.ts +5 -0
  46. package/dist/server/sync/promotion-codes.handler.d.ts +5 -0
  47. package/dist/server/sync/refunds.handler.d.ts +5 -0
  48. package/dist/server/sync/reviews.handler.d.ts +5 -0
  49. package/dist/server/sync/subscription.d.ts +12 -0
  50. package/dist/server/sync/subscriptions.handler.d.ts +5 -0
  51. package/dist/server/types.d.ts +29 -0
  52. package/dist/server/webhooks/checkouts-session.handler.d.ts +2 -0
  53. package/dist/server/webhooks/coupons.handler.d.ts +2 -0
  54. package/dist/server/webhooks/customers.handler.d.ts +2 -0
  55. package/dist/server/webhooks/index.d.ts +2 -0
  56. package/dist/server/webhooks/invoices.handler.d.ts +2 -0
  57. package/dist/server/webhooks/payment-intents.handler.d.ts +2 -0
  58. package/dist/server/webhooks/payouts.handler.d.ts +2 -0
  59. package/dist/server/webhooks/prices.handler.d.ts +2 -0
  60. package/dist/server/webhooks/products.handler.d.ts +2 -0
  61. package/dist/server/webhooks/promotion-codes.handler.d.ts +2 -0
  62. package/dist/server/webhooks/refunds.handler.d.ts +2 -0
  63. package/dist/server/webhooks/reviews.handler.d.ts +2 -0
  64. package/dist/server/webhooks/subscription.handler.d.ts +2 -0
  65. package/dist/server/webhooks/types.d.ts +11 -0
  66. package/dist/server.d.ts +2 -3790
  67. package/dist/server.js +3812 -1239
  68. package/package.json +9 -8
@@ -0,0 +1,47 @@
1
+ import { InferArgs, InternalConfiguration } from '../types';
2
+ import { RedirectHandler } from './types';
3
+ export declare function backendBaseUrl(configuration: InternalConfiguration): string;
4
+ export declare function toBase64Url(input: ArrayBuffer | string): string;
5
+ export declare function fromBase64Url(input: string): Uint8Array;
6
+ export declare function signData(secret: string, data: string): Promise<ArrayBuffer>;
7
+ export declare function timingSafeEqual(a: ArrayBufferLike, b: ArrayBufferLike): Promise<boolean>;
8
+ export interface ReturnPayload<T> {
9
+ origin: ReturnOrigin;
10
+ data?: T;
11
+ exp: number;
12
+ targetUrl: string;
13
+ }
14
+ export declare const DEFAULT_TTL_MS: number;
15
+ export declare function buildSignedReturnUrl<O extends ReturnOrigin>({ configuration, origin, targetUrl, ttlMs, data, }: {
16
+ configuration: InternalConfiguration;
17
+ origin: O;
18
+ targetUrl: string;
19
+ ttlMs?: number;
20
+ data: ReturnDataMap[O];
21
+ }): Promise<string>;
22
+ export declare function decodeSignedPayload<O extends ReturnOrigin>({ secret, data, signature, }: {
23
+ origin: O;
24
+ secret: string;
25
+ data: string;
26
+ signature: string;
27
+ }): Promise<{
28
+ error?: string;
29
+ data?: ReturnPayload<ReturnDataMap[O]>;
30
+ }>;
31
+ export declare const REDIRECT_HANDLERS: readonly [RedirectHandler<readonly ["portal-return"], {
32
+ entityId: import('convex/values').VString<string, "required">;
33
+ }>, RedirectHandler<readonly ["subscribe-cancel", "subscribe-success", "subscribe-return"], {
34
+ entityId: import('convex/values').VString<string, "required">;
35
+ }>, RedirectHandler<readonly ["pay-cancel", "pay-success", "pay-return"], {
36
+ entityId: import('convex/values').VString<string, "required">;
37
+ customerId: import('convex/values').VString<string, "required">;
38
+ referenceId: import('convex/values').VString<string, "required">;
39
+ }>];
40
+ type AllRedirectHandlers = (typeof REDIRECT_HANDLERS)[number];
41
+ type ReturnDataMap = {
42
+ [H in AllRedirectHandlers as H["origins"][number]]: H extends RedirectHandler<any, infer S> ? InferArgs<S> : never;
43
+ };
44
+ export declare const RETURN_ORIGINS: ("pay-cancel" | "pay-success" | "pay-return" | "portal-return" | "subscribe-cancel" | "subscribe-success" | "subscribe-return")[];
45
+ export type ReturnOrigin = (typeof RETURN_ORIGINS)[number];
46
+ export declare const buildRedirectImplementation: (configuration: InternalConfiguration) => import('convex/server').PublicHttpAction;
47
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const PayReturnImplementation: import('./types').RedirectHandler<readonly ["pay-cancel", "pay-success", "pay-return"], {
2
+ entityId: import('convex/values').VString<string, "required">;
3
+ customerId: import('convex/values').VString<string, "required">;
4
+ referenceId: import('convex/values').VString<string, "required">;
5
+ }>;
@@ -0,0 +1,3 @@
1
+ export declare const PortalReturnImplementation: import('./types').RedirectHandler<readonly ["portal-return"], {
2
+ entityId: import('convex/values').VString<string, "required">;
3
+ }>;
@@ -0,0 +1,3 @@
1
+ export declare const SubscribeReturnImplementation: import('./types').RedirectHandler<readonly ["subscribe-cancel", "subscribe-success", "subscribe-return"], {
2
+ entityId: import('convex/values').VString<string, "required">;
3
+ }>;
@@ -0,0 +1,9 @@
1
+ import { GenericActionCtx } from 'convex/server';
2
+ import { StripeDataModel } from '../schema';
3
+ import { ArgSchema, InferArgs, InternalConfiguration } from '../types';
4
+ export type RedirectHandler<TOrigins extends readonly string[], S extends ArgSchema = {}> = {
5
+ origins: TOrigins;
6
+ data?: S;
7
+ handle: (origin: TOrigins[number], context: GenericActionCtx<StripeDataModel>, data: InferArgs<S>, configuration: InternalConfiguration) => Promise<void>;
8
+ };
9
+ export declare function defineRedirectHandler<const T extends readonly string[], S extends ArgSchema = {}>(handler: RedirectHandler<T, S>): RedirectHandler<T, S>;
@@ -0,0 +1,256 @@
1
+ import { default as Stripe } from 'stripe';
2
+ export declare const CheckoutSessionStripeToConvex: (session: Stripe.Checkout.Session) => {
3
+ subscription?: string | null | undefined;
4
+ client_reference_id?: string | null | undefined;
5
+ currency?: string | null | undefined;
6
+ customer?: string | null | undefined;
7
+ customer_email?: string | null | undefined;
8
+ line_items?: any[] | null | undefined;
9
+ metadata?: Record<string, string | number | null> | null | undefined;
10
+ payment_intent?: string | null | undefined;
11
+ return_url?: string | null | undefined;
12
+ success_url?: string | null | undefined;
13
+ ui_mode?: "custom" | "embedded" | "hosted" | null | undefined;
14
+ url?: string | null | undefined;
15
+ adaptive_pricing?: any;
16
+ after_expiration?: any;
17
+ allow_promotion_codes?: boolean | null | undefined;
18
+ amount_subtotal?: number | null | undefined;
19
+ amount_total?: number | null | undefined;
20
+ billing_address_collection?: "required" | "auto" | null | undefined;
21
+ cancel_url?: string | null | undefined;
22
+ client_secret?: string | null | undefined;
23
+ collected_information?: any;
24
+ consent?: any;
25
+ consent_collection?: any;
26
+ currency_conversion?: any;
27
+ customer_creation?: "always" | "if_required" | null | undefined;
28
+ customer_details?: any;
29
+ discounts?: any[] | null | undefined;
30
+ invoice?: string | null | undefined;
31
+ invoice_creation?: any;
32
+ locale?: string | null | undefined;
33
+ optional_items?: any[] | null | undefined;
34
+ origin_context?: "mobile_app" | "web" | null | undefined;
35
+ payment_link?: string | null | undefined;
36
+ payment_method_collection?: "always" | "if_required" | null | undefined;
37
+ payment_method_configuration_details?: any;
38
+ payment_method_options?: any;
39
+ permissions?: any;
40
+ phone_number_collection?: any;
41
+ presentment_details?: any;
42
+ recovered_from?: string | null | undefined;
43
+ redirect_on_completion?: "always" | "if_required" | "never" | null | undefined;
44
+ saved_payment_method_options?: any;
45
+ setup_intent?: string | null | undefined;
46
+ shipping_address_collection?: any;
47
+ shipping_cost?: any;
48
+ submit_type?: "auto" | "book" | "donate" | "pay" | "subscribe" | null | undefined;
49
+ tax_id_collection?: any;
50
+ total_details?: any;
51
+ wallet_options?: any;
52
+ object: string;
53
+ id: string;
54
+ automatic_tax: any;
55
+ mode: "payment" | "setup" | "subscription";
56
+ payment_status: "no_payment_required" | "paid" | "unpaid";
57
+ status: "complete" | "expired" | "open" | null;
58
+ created: number;
59
+ custom_fields: any[];
60
+ custom_text: any;
61
+ expires_at: number;
62
+ livemode: boolean;
63
+ payment_method_types: string[];
64
+ shipping_options: any[];
65
+ };
66
+ export declare const CheckoutSessionSchema: {
67
+ id: import('convex/values').VString<string, "required">;
68
+ automatic_tax: import('convex/values').VAny<any, "required", string>;
69
+ client_reference_id: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
70
+ currency: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
71
+ customer: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
72
+ customer_email: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
73
+ line_items: import('convex/values').VUnion<any[] | null | undefined, [import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
74
+ metadata: import('convex/values').VUnion<Record<string, string | number | null> | null | undefined, [import('convex/values').VRecord<Record<string, string | number | null>, import('convex/values').VString<string, "required">, import('convex/values').VUnion<string | number | null, [import('convex/values').VString<string, "required">, import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "required", never>, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
75
+ mode: import('convex/values').VUnion<"payment" | "setup" | "subscription", [import('convex/values').VLiteral<"payment", "required">, import('convex/values').VLiteral<"setup", "required">, import('convex/values').VLiteral<"subscription", "required">], "required", never>;
76
+ payment_intent: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
77
+ payment_status: import('convex/values').VUnion<"no_payment_required" | "paid" | "unpaid", [import('convex/values').VLiteral<"no_payment_required", "required">, import('convex/values').VLiteral<"paid", "required">, import('convex/values').VLiteral<"unpaid", "required">], "required", never>;
78
+ return_url: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
79
+ status: import('convex/values').VUnion<"complete" | "expired" | "open" | null, [import('convex/values').VLiteral<"complete", "required">, import('convex/values').VLiteral<"expired", "required">, import('convex/values').VLiteral<"open", "required">, import('convex/values').VNull<null, "required">], "required", never>;
80
+ success_url: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
81
+ ui_mode: import('convex/values').VUnion<"custom" | "embedded" | "hosted" | null | undefined, [import('convex/values').VLiteral<"custom", "required">, import('convex/values').VLiteral<"embedded", "required">, import('convex/values').VLiteral<"hosted", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
82
+ url: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
83
+ object: import('convex/values').VString<string, "required">;
84
+ adaptive_pricing: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
85
+ after_expiration: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
86
+ allow_promotion_codes: import('convex/values').VUnion<boolean | null | undefined, [import('convex/values').VBoolean<boolean, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
87
+ amount_subtotal: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
88
+ amount_total: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
89
+ billing_address_collection: import('convex/values').VUnion<"required" | "auto" | null | undefined, [import('convex/values').VLiteral<"auto", "required">, import('convex/values').VLiteral<"required", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
90
+ cancel_url: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
91
+ client_secret: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
92
+ collected_information: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
93
+ consent: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
94
+ consent_collection: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
95
+ created: import('convex/values').VFloat64<number, "required">;
96
+ currency_conversion: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
97
+ custom_fields: import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">;
98
+ custom_text: import('convex/values').VAny<any, "required", string>;
99
+ customer_creation: import('convex/values').VUnion<"always" | "if_required" | null | undefined, [import('convex/values').VLiteral<"always", "required">, import('convex/values').VLiteral<"if_required", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
100
+ customer_details: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
101
+ discounts: import('convex/values').VUnion<any[] | null | undefined, [import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
102
+ expires_at: import('convex/values').VFloat64<number, "required">;
103
+ invoice: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
104
+ invoice_creation: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
105
+ livemode: import('convex/values').VBoolean<boolean, "required">;
106
+ locale: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
107
+ optional_items: import('convex/values').VUnion<any[] | null | undefined, [import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
108
+ origin_context: import('convex/values').VUnion<"mobile_app" | "web" | null | undefined, [import('convex/values').VLiteral<"mobile_app", "required">, import('convex/values').VLiteral<"web", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
109
+ payment_link: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
110
+ payment_method_collection: import('convex/values').VUnion<"always" | "if_required" | null | undefined, [import('convex/values').VLiteral<"always", "required">, import('convex/values').VLiteral<"if_required", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
111
+ payment_method_configuration_details: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
112
+ payment_method_options: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
113
+ payment_method_types: import('convex/values').VArray<string[], import('convex/values').VString<string, "required">, "required">;
114
+ permissions: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
115
+ phone_number_collection: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
116
+ presentment_details: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
117
+ recovered_from: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
118
+ redirect_on_completion: import('convex/values').VUnion<"always" | "if_required" | "never" | null | undefined, [import('convex/values').VLiteral<"always", "required">, import('convex/values').VLiteral<"if_required", "required">, import('convex/values').VLiteral<"never", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
119
+ saved_payment_method_options: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
120
+ setup_intent: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
121
+ shipping_address_collection: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
122
+ shipping_cost: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
123
+ shipping_options: import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">;
124
+ submit_type: import('convex/values').VUnion<"auto" | "book" | "donate" | "pay" | "subscribe" | null | undefined, [import('convex/values').VLiteral<"auto", "required">, import('convex/values').VLiteral<"book", "required">, import('convex/values').VLiteral<"donate", "required">, import('convex/values').VLiteral<"pay", "required">, import('convex/values').VLiteral<"subscribe", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
125
+ subscription: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
126
+ tax_id_collection: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
127
+ total_details: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
128
+ wallet_options: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
129
+ };
130
+ export declare const CheckoutSessionObject: import('convex/values').VObject<{
131
+ subscription?: string | null | undefined;
132
+ client_reference_id?: string | null | undefined;
133
+ currency?: string | null | undefined;
134
+ customer?: string | null | undefined;
135
+ customer_email?: string | null | undefined;
136
+ line_items?: any[] | null | undefined;
137
+ metadata?: Record<string, string | number | null> | null | undefined;
138
+ payment_intent?: string | null | undefined;
139
+ return_url?: string | null | undefined;
140
+ success_url?: string | null | undefined;
141
+ ui_mode?: "custom" | "embedded" | "hosted" | null | undefined;
142
+ url?: string | null | undefined;
143
+ adaptive_pricing?: any;
144
+ after_expiration?: any;
145
+ allow_promotion_codes?: boolean | null | undefined;
146
+ amount_subtotal?: number | null | undefined;
147
+ amount_total?: number | null | undefined;
148
+ billing_address_collection?: "required" | "auto" | null | undefined;
149
+ cancel_url?: string | null | undefined;
150
+ client_secret?: string | null | undefined;
151
+ collected_information?: any;
152
+ consent?: any;
153
+ consent_collection?: any;
154
+ currency_conversion?: any;
155
+ customer_creation?: "always" | "if_required" | null | undefined;
156
+ customer_details?: any;
157
+ discounts?: any[] | null | undefined;
158
+ invoice?: string | null | undefined;
159
+ invoice_creation?: any;
160
+ locale?: string | null | undefined;
161
+ optional_items?: any[] | null | undefined;
162
+ origin_context?: "mobile_app" | "web" | null | undefined;
163
+ payment_link?: string | null | undefined;
164
+ payment_method_collection?: "always" | "if_required" | null | undefined;
165
+ payment_method_configuration_details?: any;
166
+ payment_method_options?: any;
167
+ permissions?: any;
168
+ phone_number_collection?: any;
169
+ presentment_details?: any;
170
+ recovered_from?: string | null | undefined;
171
+ redirect_on_completion?: "always" | "if_required" | "never" | null | undefined;
172
+ saved_payment_method_options?: any;
173
+ setup_intent?: string | null | undefined;
174
+ shipping_address_collection?: any;
175
+ shipping_cost?: any;
176
+ submit_type?: "auto" | "book" | "donate" | "pay" | "subscribe" | null | undefined;
177
+ tax_id_collection?: any;
178
+ total_details?: any;
179
+ wallet_options?: any;
180
+ object: string;
181
+ id: string;
182
+ automatic_tax: any;
183
+ mode: "payment" | "setup" | "subscription";
184
+ payment_status: "no_payment_required" | "paid" | "unpaid";
185
+ status: "complete" | "expired" | "open" | null;
186
+ created: number;
187
+ custom_fields: any[];
188
+ custom_text: any;
189
+ expires_at: number;
190
+ livemode: boolean;
191
+ payment_method_types: string[];
192
+ shipping_options: any[];
193
+ }, {
194
+ id: import('convex/values').VString<string, "required">;
195
+ automatic_tax: import('convex/values').VAny<any, "required", string>;
196
+ client_reference_id: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
197
+ currency: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
198
+ customer: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
199
+ customer_email: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
200
+ line_items: import('convex/values').VUnion<any[] | null | undefined, [import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
201
+ metadata: import('convex/values').VUnion<Record<string, string | number | null> | null | undefined, [import('convex/values').VRecord<Record<string, string | number | null>, import('convex/values').VString<string, "required">, import('convex/values').VUnion<string | number | null, [import('convex/values').VString<string, "required">, import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "required", never>, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
202
+ mode: import('convex/values').VUnion<"payment" | "setup" | "subscription", [import('convex/values').VLiteral<"payment", "required">, import('convex/values').VLiteral<"setup", "required">, import('convex/values').VLiteral<"subscription", "required">], "required", never>;
203
+ payment_intent: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
204
+ payment_status: import('convex/values').VUnion<"no_payment_required" | "paid" | "unpaid", [import('convex/values').VLiteral<"no_payment_required", "required">, import('convex/values').VLiteral<"paid", "required">, import('convex/values').VLiteral<"unpaid", "required">], "required", never>;
205
+ return_url: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
206
+ status: import('convex/values').VUnion<"complete" | "expired" | "open" | null, [import('convex/values').VLiteral<"complete", "required">, import('convex/values').VLiteral<"expired", "required">, import('convex/values').VLiteral<"open", "required">, import('convex/values').VNull<null, "required">], "required", never>;
207
+ success_url: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
208
+ ui_mode: import('convex/values').VUnion<"custom" | "embedded" | "hosted" | null | undefined, [import('convex/values').VLiteral<"custom", "required">, import('convex/values').VLiteral<"embedded", "required">, import('convex/values').VLiteral<"hosted", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
209
+ url: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
210
+ object: import('convex/values').VString<string, "required">;
211
+ adaptive_pricing: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
212
+ after_expiration: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
213
+ allow_promotion_codes: import('convex/values').VUnion<boolean | null | undefined, [import('convex/values').VBoolean<boolean, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
214
+ amount_subtotal: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
215
+ amount_total: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
216
+ billing_address_collection: import('convex/values').VUnion<"required" | "auto" | null | undefined, [import('convex/values').VLiteral<"auto", "required">, import('convex/values').VLiteral<"required", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
217
+ cancel_url: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
218
+ client_secret: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
219
+ collected_information: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
220
+ consent: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
221
+ consent_collection: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
222
+ created: import('convex/values').VFloat64<number, "required">;
223
+ currency_conversion: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
224
+ custom_fields: import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">;
225
+ custom_text: import('convex/values').VAny<any, "required", string>;
226
+ customer_creation: import('convex/values').VUnion<"always" | "if_required" | null | undefined, [import('convex/values').VLiteral<"always", "required">, import('convex/values').VLiteral<"if_required", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
227
+ customer_details: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
228
+ discounts: import('convex/values').VUnion<any[] | null | undefined, [import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
229
+ expires_at: import('convex/values').VFloat64<number, "required">;
230
+ invoice: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
231
+ invoice_creation: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
232
+ livemode: import('convex/values').VBoolean<boolean, "required">;
233
+ locale: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
234
+ optional_items: import('convex/values').VUnion<any[] | null | undefined, [import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
235
+ origin_context: import('convex/values').VUnion<"mobile_app" | "web" | null | undefined, [import('convex/values').VLiteral<"mobile_app", "required">, import('convex/values').VLiteral<"web", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
236
+ payment_link: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
237
+ payment_method_collection: import('convex/values').VUnion<"always" | "if_required" | null | undefined, [import('convex/values').VLiteral<"always", "required">, import('convex/values').VLiteral<"if_required", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
238
+ payment_method_configuration_details: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
239
+ payment_method_options: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
240
+ payment_method_types: import('convex/values').VArray<string[], import('convex/values').VString<string, "required">, "required">;
241
+ permissions: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
242
+ phone_number_collection: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
243
+ presentment_details: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
244
+ recovered_from: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
245
+ redirect_on_completion: import('convex/values').VUnion<"always" | "if_required" | "never" | null | undefined, [import('convex/values').VLiteral<"always", "required">, import('convex/values').VLiteral<"if_required", "required">, import('convex/values').VLiteral<"never", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
246
+ saved_payment_method_options: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
247
+ setup_intent: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
248
+ shipping_address_collection: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
249
+ shipping_cost: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
250
+ shipping_options: import('convex/values').VArray<any[], import('convex/values').VAny<any, "required", string>, "required">;
251
+ submit_type: import('convex/values').VUnion<"auto" | "book" | "donate" | "pay" | "subscribe" | null | undefined, [import('convex/values').VLiteral<"auto", "required">, import('convex/values').VLiteral<"book", "required">, import('convex/values').VLiteral<"donate", "required">, import('convex/values').VLiteral<"pay", "required">, import('convex/values').VLiteral<"subscribe", "required">, import('convex/values').VNull<null, "required">], "optional", never>;
252
+ subscription: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
253
+ tax_id_collection: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
254
+ total_details: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
255
+ wallet_options: import('convex/values').VUnion<any, [import('convex/values').VAny<any, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
256
+ }, "required", "object" | "id" | "subscription" | "automatic_tax" | "client_reference_id" | "currency" | "customer" | "customer_email" | "line_items" | "metadata" | "mode" | "payment_intent" | "payment_status" | "return_url" | "status" | "success_url" | "ui_mode" | "url" | "adaptive_pricing" | "after_expiration" | "allow_promotion_codes" | "amount_subtotal" | "amount_total" | "billing_address_collection" | "cancel_url" | "client_secret" | "collected_information" | "consent" | "consent_collection" | "created" | "currency_conversion" | "custom_fields" | "custom_text" | "customer_creation" | "customer_details" | "discounts" | "expires_at" | "invoice" | "invoice_creation" | "livemode" | "locale" | "optional_items" | "origin_context" | "payment_link" | "payment_method_collection" | "payment_method_configuration_details" | "payment_method_options" | "payment_method_types" | "permissions" | "phone_number_collection" | "presentment_details" | "recovered_from" | "redirect_on_completion" | "saved_payment_method_options" | "setup_intent" | "shipping_address_collection" | "shipping_cost" | "shipping_options" | "submit_type" | "tax_id_collection" | "total_details" | "wallet_options" | `automatic_tax.${string}` | `metadata.${string}` | `adaptive_pricing.${string}` | `after_expiration.${string}` | `collected_information.${string}` | `consent.${string}` | `consent_collection.${string}` | `currency_conversion.${string}` | `custom_text.${string}` | `customer_details.${string}` | `invoice_creation.${string}` | `payment_method_configuration_details.${string}` | `payment_method_options.${string}` | `permissions.${string}` | `phone_number_collection.${string}` | `presentment_details.${string}` | `saved_payment_method_options.${string}` | `shipping_address_collection.${string}` | `shipping_cost.${string}` | `tax_id_collection.${string}` | `total_details.${string}` | `wallet_options.${string}`>;
@@ -0,0 +1,112 @@
1
+ import { default as Stripe } from 'stripe';
2
+ export declare const CouponStripeToConvex: (coupon: Stripe.Coupon) => {
3
+ currency?: string | null | undefined;
4
+ metadata?: Record<string, string | number | null> | null | undefined;
5
+ amount_off?: number | null | undefined;
6
+ name?: string | null | undefined;
7
+ percent_off?: number | null | undefined;
8
+ applies_to?: {
9
+ products: string[];
10
+ } | null | undefined;
11
+ currency_options?: Record<string, {
12
+ amount_off: number;
13
+ }> | null | undefined;
14
+ duration_in_months?: number | null | undefined;
15
+ max_redemptions?: number | null | undefined;
16
+ redeem_by?: number | null | undefined;
17
+ object: string;
18
+ id: string;
19
+ created: number;
20
+ livemode: boolean;
21
+ duration: "forever" | "once" | "repeating";
22
+ times_redeemed: number;
23
+ valid: boolean;
24
+ };
25
+ export declare const CouponSchema: {
26
+ id: import('convex/values').VString<string, "required">;
27
+ amount_off: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
28
+ currency: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
29
+ duration: import('convex/values').VUnion<"forever" | "once" | "repeating", [import('convex/values').VLiteral<"forever", "required">, import('convex/values').VLiteral<"once", "required">, import('convex/values').VLiteral<"repeating", "required">], "required", never>;
30
+ metadata: import('convex/values').VUnion<Record<string, string | number | null> | null | undefined, [import('convex/values').VRecord<Record<string, string | number | null>, import('convex/values').VString<string, "required">, import('convex/values').VUnion<string | number | null, [import('convex/values').VString<string, "required">, import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "required", never>, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
31
+ name: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
32
+ percent_off: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
33
+ object: import('convex/values').VString<string, "required">;
34
+ applies_to: import('convex/values').VUnion<{
35
+ products: string[];
36
+ } | null | undefined, [import('convex/values').VObject<{
37
+ products: string[];
38
+ }, {
39
+ products: import('convex/values').VArray<string[], import('convex/values').VString<string, "required">, "required">;
40
+ }, "required", "products">, import('convex/values').VNull<null, "required">], "optional", "products">;
41
+ created: import('convex/values').VFloat64<number, "required">;
42
+ currency_options: import('convex/values').VUnion<Record<string, {
43
+ amount_off: number;
44
+ }> | null | undefined, [import('convex/values').VRecord<Record<string, {
45
+ amount_off: number;
46
+ }>, import('convex/values').VString<string, "required">, import('convex/values').VObject<{
47
+ amount_off: number;
48
+ }, {
49
+ amount_off: import('convex/values').VFloat64<number, "required">;
50
+ }, "required", "amount_off">, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
51
+ duration_in_months: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
52
+ livemode: import('convex/values').VBoolean<boolean, "required">;
53
+ max_redemptions: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
54
+ redeem_by: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
55
+ times_redeemed: import('convex/values').VFloat64<number, "required">;
56
+ valid: import('convex/values').VBoolean<boolean, "required">;
57
+ };
58
+ export declare const CouponObject: import('convex/values').VObject<{
59
+ currency?: string | null | undefined;
60
+ metadata?: Record<string, string | number | null> | null | undefined;
61
+ amount_off?: number | null | undefined;
62
+ name?: string | null | undefined;
63
+ percent_off?: number | null | undefined;
64
+ applies_to?: {
65
+ products: string[];
66
+ } | null | undefined;
67
+ currency_options?: Record<string, {
68
+ amount_off: number;
69
+ }> | null | undefined;
70
+ duration_in_months?: number | null | undefined;
71
+ max_redemptions?: number | null | undefined;
72
+ redeem_by?: number | null | undefined;
73
+ object: string;
74
+ id: string;
75
+ created: number;
76
+ livemode: boolean;
77
+ duration: "forever" | "once" | "repeating";
78
+ times_redeemed: number;
79
+ valid: boolean;
80
+ }, {
81
+ id: import('convex/values').VString<string, "required">;
82
+ amount_off: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
83
+ currency: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
84
+ duration: import('convex/values').VUnion<"forever" | "once" | "repeating", [import('convex/values').VLiteral<"forever", "required">, import('convex/values').VLiteral<"once", "required">, import('convex/values').VLiteral<"repeating", "required">], "required", never>;
85
+ metadata: import('convex/values').VUnion<Record<string, string | number | null> | null | undefined, [import('convex/values').VRecord<Record<string, string | number | null>, import('convex/values').VString<string, "required">, import('convex/values').VUnion<string | number | null, [import('convex/values').VString<string, "required">, import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "required", never>, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
86
+ name: import('convex/values').VUnion<string | null | undefined, [import('convex/values').VString<string, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
87
+ percent_off: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
88
+ object: import('convex/values').VString<string, "required">;
89
+ applies_to: import('convex/values').VUnion<{
90
+ products: string[];
91
+ } | null | undefined, [import('convex/values').VObject<{
92
+ products: string[];
93
+ }, {
94
+ products: import('convex/values').VArray<string[], import('convex/values').VString<string, "required">, "required">;
95
+ }, "required", "products">, import('convex/values').VNull<null, "required">], "optional", "products">;
96
+ created: import('convex/values').VFloat64<number, "required">;
97
+ currency_options: import('convex/values').VUnion<Record<string, {
98
+ amount_off: number;
99
+ }> | null | undefined, [import('convex/values').VRecord<Record<string, {
100
+ amount_off: number;
101
+ }>, import('convex/values').VString<string, "required">, import('convex/values').VObject<{
102
+ amount_off: number;
103
+ }, {
104
+ amount_off: import('convex/values').VFloat64<number, "required">;
105
+ }, "required", "amount_off">, "required", string>, import('convex/values').VNull<null, "required">], "optional", string>;
106
+ duration_in_months: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
107
+ livemode: import('convex/values').VBoolean<boolean, "required">;
108
+ max_redemptions: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
109
+ redeem_by: import('convex/values').VUnion<number | null | undefined, [import('convex/values').VFloat64<number, "required">, import('convex/values').VNull<null, "required">], "optional", never>;
110
+ times_redeemed: import('convex/values').VFloat64<number, "required">;
111
+ valid: import('convex/values').VBoolean<boolean, "required">;
112
+ }, "required", "object" | "id" | "currency" | "metadata" | "created" | "livemode" | `metadata.${string}` | "amount_off" | "duration" | "name" | "percent_off" | "applies_to" | "currency_options" | "duration_in_months" | "max_redemptions" | "redeem_by" | "times_redeemed" | "valid" | "applies_to.products" | `currency_options.${string}`>;