@donotdev/core 0.1.47 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/functions/index.js +13 -11
- package/i18n/locales/lazy/auth_ar.json +1 -1
- package/i18n/locales/lazy/auth_da.json +1 -1
- package/i18n/locales/lazy/auth_de.json +1 -1
- package/i18n/locales/lazy/auth_en.json +1 -1
- package/i18n/locales/lazy/auth_es.json +1 -1
- package/i18n/locales/lazy/auth_fr.json +1 -1
- package/i18n/locales/lazy/auth_it.json +1 -1
- package/i18n/locales/lazy/auth_ja.json +1 -1
- package/i18n/locales/lazy/auth_ko.json +1 -1
- package/i18n/locales/lazy/auth_nl.json +1 -1
- package/i18n/locales/lazy/auth_pt.json +1 -1
- package/i18n/locales/lazy/auth_zh.json +1 -1
- package/i18n/locales/lazy/cookies_ar.json +4 -1
- package/i18n/locales/lazy/cookies_da.json +4 -1
- package/i18n/locales/lazy/cookies_de.json +4 -1
- package/i18n/locales/lazy/cookies_en.json +4 -1
- package/i18n/locales/lazy/cookies_es.json +4 -1
- package/i18n/locales/lazy/cookies_fr.json +4 -1
- package/i18n/locales/lazy/cookies_it.json +4 -1
- package/i18n/locales/lazy/cookies_ja.json +4 -1
- package/i18n/locales/lazy/cookies_ko.json +4 -1
- package/i18n/locales/lazy/cookies_nl.json +4 -1
- package/i18n/locales/lazy/cookies_pt.json +4 -1
- package/i18n/locales/lazy/cookies_zh.json +4 -1
- package/index.d.ts +953 -128
- package/index.js +6 -6
- package/next/index.d.ts +7 -0
- package/next/index.js +59 -57
- package/package.json +24 -24
- package/server.d.ts +858 -108
- package/server.js +1 -1
- package/symbol-index.json +1 -0
- package/vite/index.d.ts +7 -0
- package/vite/index.js +71 -69
package/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import * as v from 'valibot';
|
|
3
3
|
import { InitOptions, TFunction } from 'i18next';
|
|
4
4
|
import { FieldValues } from 'react-hook-form';
|
|
@@ -3926,54 +3926,126 @@ declare const DEFAULT_SUBSCRIPTION: SubscriptionClaims;
|
|
|
3926
3926
|
* @fileoverview Schema Definitions for Billing and Subscription Management
|
|
3927
3927
|
* @description Single source of truth for all billing-related data validation. Defines Valibot schemas for billing, subscriptions, checkout sessions, and related data structures.
|
|
3928
3928
|
*
|
|
3929
|
-
* @version 0.
|
|
3929
|
+
* @version 0.2.0
|
|
3930
3930
|
* @since 0.0.1
|
|
3931
3931
|
* @author AMBROISE PARK Consulting
|
|
3932
3932
|
*/
|
|
3933
3933
|
|
|
3934
3934
|
/**
|
|
3935
|
-
*
|
|
3936
|
-
* Uses constants for enum values to ensure consistency
|
|
3935
|
+
* Maximum line items per checkout request (framework limit).
|
|
3937
3936
|
*
|
|
3938
|
-
* @version 0.
|
|
3937
|
+
* @version 0.2.0
|
|
3938
|
+
* @since 0.2.0
|
|
3939
|
+
* @author AMBROISE PARK Consulting
|
|
3940
|
+
*/
|
|
3941
|
+
declare const MAX_CHECKOUT_LINE_ITEMS = 100;
|
|
3942
|
+
/**
|
|
3943
|
+
* One requested line: what the client wants, never what it costs.
|
|
3944
|
+
* Names and prices are resolved on the server.
|
|
3945
|
+
*
|
|
3946
|
+
* @version 0.2.0
|
|
3947
|
+
* @since 0.2.0
|
|
3948
|
+
* @author AMBROISE PARK Consulting
|
|
3949
|
+
*/
|
|
3950
|
+
declare const CheckoutLineItemInputSchema: v.ObjectSchema<{
|
|
3951
|
+
/** App product ID. For StripePayment/StripeSubscription: the billing config key. */
|
|
3952
|
+
readonly productId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
3953
|
+
readonly quantity: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10000, undefined>]>;
|
|
3954
|
+
}, undefined>;
|
|
3955
|
+
/**
|
|
3956
|
+
* Schema for creating a checkout session request.
|
|
3957
|
+
* The client sends what it wants (config key + line items); the server derives
|
|
3958
|
+
* prices, mode and user from the back config and the auth context.
|
|
3959
|
+
*
|
|
3960
|
+
* 0.1.x requests keep working unchanged: the key may come from
|
|
3961
|
+
* `metadata.billingConfigKey`, `lineItems` defaults to the single product, and
|
|
3962
|
+
* the 0.1.x fields (`priceId`, `unitAmount` + `productName`, `currency`, `mode`)
|
|
3963
|
+
* are kept and honoured for StripePayment/StripeSubscription items exactly as in
|
|
3964
|
+
* 0.1.x (priceId checked against the back config, dynamic amounts capped by
|
|
3965
|
+
* `maxUnitAmount`). StripeOrder ignores them. `userId` is never trusted by the
|
|
3966
|
+
* framework providers: they pass the authenticated user.
|
|
3967
|
+
* The output is always normalized (`billingConfigKey` + `lineItems` set).
|
|
3968
|
+
*
|
|
3969
|
+
* @version 0.2.0
|
|
3939
3970
|
* @since 0.0.1
|
|
3940
3971
|
* @author AMBROISE PARK Consulting
|
|
3941
3972
|
*/
|
|
3942
3973
|
declare const CreateCheckoutSessionRequestSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3974
|
+
/** Key in the app's StripeBackConfig */
|
|
3975
|
+
readonly billingConfigKey: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
3976
|
+
readonly lineItems: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
3977
|
+
/** App product ID. For StripePayment/StripeSubscription: the billing config key. */
|
|
3978
|
+
readonly productId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
3979
|
+
readonly quantity: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10000, undefined>]>;
|
|
3980
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
3981
|
+
productId: string;
|
|
3982
|
+
quantity: number;
|
|
3983
|
+
}[], 1, "At least one line item is required">, v.MaxLengthAction<{
|
|
3984
|
+
productId: string;
|
|
3985
|
+
quantity: number;
|
|
3986
|
+
}[], 100, "At most 100 line items">]>, undefined>;
|
|
3987
|
+
readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3988
|
+
readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3989
|
+
readonly customerEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
3990
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
3991
|
+
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
3992
|
+
/** 0.1.x: ignored by the framework providers (they pass the authenticated user) */
|
|
3943
3993
|
readonly userId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3944
3994
|
readonly productId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3945
|
-
/** Stripe price ID (
|
|
3995
|
+
/** 0.1.x: Stripe price ID (must match the back config priceId when it has one) */
|
|
3946
3996
|
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3947
|
-
/**
|
|
3997
|
+
/** 0.1.x: amount in cents (dynamic pricing, capped by the back config `maxUnitAmount`) */
|
|
3948
3998
|
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
3949
|
-
/**
|
|
3999
|
+
/** 0.1.x: product name shown on Stripe checkout (dynamic pricing) */
|
|
3950
4000
|
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
3951
|
-
/**
|
|
4001
|
+
/** 0.1.x: currency code (dynamic pricing), defaults to the back config currency */
|
|
3952
4002
|
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, undefined>;
|
|
3953
|
-
readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3954
|
-
readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3955
|
-
readonly customerEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
3956
4003
|
readonly userEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
3957
|
-
|
|
3958
|
-
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4004
|
+
/** 0.1.x: Stripe mode. Omitted: derived from the back config item type. */
|
|
3959
4005
|
readonly mode: v.OptionalSchema<v.PicklistSchema<["payment", "subscription"], undefined>, undefined>;
|
|
3960
|
-
}, undefined>, v.
|
|
4006
|
+
}, undefined>, v.RawTransformAction<{
|
|
4007
|
+
billingConfigKey?: string | undefined;
|
|
4008
|
+
lineItems?: {
|
|
4009
|
+
productId: string;
|
|
4010
|
+
quantity: number;
|
|
4011
|
+
}[] | undefined;
|
|
4012
|
+
successUrl: string;
|
|
4013
|
+
cancelUrl: string;
|
|
4014
|
+
customerEmail?: string | undefined;
|
|
4015
|
+
metadata?: {
|
|
4016
|
+
[x: string]: string;
|
|
4017
|
+
} | undefined;
|
|
4018
|
+
allowPromotionCodes?: boolean | undefined;
|
|
3961
4019
|
userId?: string | undefined;
|
|
3962
4020
|
productId?: string | undefined;
|
|
3963
4021
|
priceId?: string | undefined;
|
|
3964
4022
|
unitAmount?: number | undefined;
|
|
3965
4023
|
productName?: string | undefined;
|
|
3966
4024
|
currency?: string | undefined;
|
|
4025
|
+
userEmail?: string | undefined;
|
|
4026
|
+
mode?: "payment" | "subscription" | undefined;
|
|
4027
|
+
}, {
|
|
4028
|
+
billingConfigKey: string;
|
|
4029
|
+
lineItems: {
|
|
4030
|
+
productId: string;
|
|
4031
|
+
quantity: number;
|
|
4032
|
+
}[];
|
|
3967
4033
|
successUrl: string;
|
|
3968
4034
|
cancelUrl: string;
|
|
3969
4035
|
customerEmail?: string | undefined;
|
|
3970
|
-
userEmail?: string | undefined;
|
|
3971
4036
|
metadata?: {
|
|
3972
4037
|
[x: string]: string;
|
|
3973
4038
|
} | undefined;
|
|
3974
4039
|
allowPromotionCodes?: boolean | undefined;
|
|
4040
|
+
userId?: string | undefined;
|
|
4041
|
+
productId?: string | undefined;
|
|
4042
|
+
priceId?: string | undefined;
|
|
4043
|
+
unitAmount?: number | undefined;
|
|
4044
|
+
productName?: string | undefined;
|
|
4045
|
+
currency?: string | undefined;
|
|
4046
|
+
userEmail?: string | undefined;
|
|
3975
4047
|
mode?: "payment" | "subscription" | undefined;
|
|
3976
|
-
}
|
|
4048
|
+
}>]>;
|
|
3977
4049
|
/**
|
|
3978
4050
|
* Schema for creating a checkout session response
|
|
3979
4051
|
*
|
|
@@ -4048,13 +4120,21 @@ declare const CheckoutSessionMetadataSchema: v.LooseObjectSchema<{
|
|
|
4048
4120
|
readonly productType: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4049
4121
|
}, undefined>;
|
|
4050
4122
|
/**
|
|
4051
|
-
* Create checkout session request type
|
|
4123
|
+
* Create checkout session request type (normalized: `billingConfigKey` and `lineItems` set)
|
|
4052
4124
|
*
|
|
4053
|
-
* @version 0.
|
|
4125
|
+
* @version 0.2.0
|
|
4054
4126
|
* @since 0.0.1
|
|
4055
4127
|
* @author AMBROISE PARK Consulting
|
|
4056
4128
|
*/
|
|
4057
4129
|
type CreateCheckoutSessionRequest = v.InferOutput<typeof CreateCheckoutSessionRequestSchema>;
|
|
4130
|
+
/**
|
|
4131
|
+
* Create checkout session request as sent by a client (before normalization)
|
|
4132
|
+
*
|
|
4133
|
+
* @version 0.2.0
|
|
4134
|
+
* @since 0.2.0
|
|
4135
|
+
* @author AMBROISE PARK Consulting
|
|
4136
|
+
*/
|
|
4137
|
+
type CreateCheckoutSessionRequestInput = v.InferInput<typeof CreateCheckoutSessionRequestSchema>;
|
|
4058
4138
|
/**
|
|
4059
4139
|
* Create checkout session response type
|
|
4060
4140
|
*
|
|
@@ -4134,47 +4214,88 @@ type ProductDeclaration = v.InferOutput<typeof ProductDeclarationSchema> & {
|
|
|
4134
4214
|
onPaymentFailed?: (userId: string, metadata: any) => Promise<void>;
|
|
4135
4215
|
};
|
|
4136
4216
|
/**
|
|
4137
|
-
* Validate create checkout session request
|
|
4217
|
+
* Validate (and normalize) a create checkout session request
|
|
4138
4218
|
*
|
|
4139
|
-
* @version 0.
|
|
4219
|
+
* @version 0.2.0
|
|
4140
4220
|
* @since 0.0.1
|
|
4141
4221
|
* @author AMBROISE PARK Consulting
|
|
4142
4222
|
*/
|
|
4143
4223
|
declare function validateCreateCheckoutSessionRequest(data: unknown): v.SafeParseResult<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
4224
|
+
/** Key in the app's StripeBackConfig */
|
|
4225
|
+
readonly billingConfigKey: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4226
|
+
readonly lineItems: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
4227
|
+
/** App product ID. For StripePayment/StripeSubscription: the billing config key. */
|
|
4228
|
+
readonly productId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
4229
|
+
readonly quantity: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10000, undefined>]>;
|
|
4230
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
4231
|
+
productId: string;
|
|
4232
|
+
quantity: number;
|
|
4233
|
+
}[], 1, "At least one line item is required">, v.MaxLengthAction<{
|
|
4234
|
+
productId: string;
|
|
4235
|
+
quantity: number;
|
|
4236
|
+
}[], 100, "At most 100 line items">]>, undefined>;
|
|
4237
|
+
readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
4238
|
+
readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
4239
|
+
readonly customerEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
4240
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
4241
|
+
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4242
|
+
/** 0.1.x: ignored by the framework providers (they pass the authenticated user) */
|
|
4144
4243
|
readonly userId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4145
4244
|
readonly productId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4146
|
-
/** Stripe price ID (
|
|
4245
|
+
/** 0.1.x: Stripe price ID (must match the back config priceId when it has one) */
|
|
4147
4246
|
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4148
|
-
/**
|
|
4247
|
+
/** 0.1.x: amount in cents (dynamic pricing, capped by the back config `maxUnitAmount`) */
|
|
4149
4248
|
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4150
|
-
/**
|
|
4249
|
+
/** 0.1.x: product name shown on Stripe checkout (dynamic pricing) */
|
|
4151
4250
|
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4152
|
-
/**
|
|
4251
|
+
/** 0.1.x: currency code (dynamic pricing), defaults to the back config currency */
|
|
4153
4252
|
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, undefined>;
|
|
4154
|
-
readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
4155
|
-
readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
4156
|
-
readonly customerEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
4157
4253
|
readonly userEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
4158
|
-
|
|
4159
|
-
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4254
|
+
/** 0.1.x: Stripe mode. Omitted: derived from the back config item type. */
|
|
4160
4255
|
readonly mode: v.OptionalSchema<v.PicklistSchema<["payment", "subscription"], undefined>, undefined>;
|
|
4161
|
-
}, undefined>, v.
|
|
4256
|
+
}, undefined>, v.RawTransformAction<{
|
|
4257
|
+
billingConfigKey?: string | undefined;
|
|
4258
|
+
lineItems?: {
|
|
4259
|
+
productId: string;
|
|
4260
|
+
quantity: number;
|
|
4261
|
+
}[] | undefined;
|
|
4262
|
+
successUrl: string;
|
|
4263
|
+
cancelUrl: string;
|
|
4264
|
+
customerEmail?: string | undefined;
|
|
4265
|
+
metadata?: {
|
|
4266
|
+
[x: string]: string;
|
|
4267
|
+
} | undefined;
|
|
4268
|
+
allowPromotionCodes?: boolean | undefined;
|
|
4162
4269
|
userId?: string | undefined;
|
|
4163
4270
|
productId?: string | undefined;
|
|
4164
4271
|
priceId?: string | undefined;
|
|
4165
4272
|
unitAmount?: number | undefined;
|
|
4166
4273
|
productName?: string | undefined;
|
|
4167
4274
|
currency?: string | undefined;
|
|
4275
|
+
userEmail?: string | undefined;
|
|
4276
|
+
mode?: "payment" | "subscription" | undefined;
|
|
4277
|
+
}, {
|
|
4278
|
+
billingConfigKey: string;
|
|
4279
|
+
lineItems: {
|
|
4280
|
+
productId: string;
|
|
4281
|
+
quantity: number;
|
|
4282
|
+
}[];
|
|
4168
4283
|
successUrl: string;
|
|
4169
4284
|
cancelUrl: string;
|
|
4170
4285
|
customerEmail?: string | undefined;
|
|
4171
|
-
userEmail?: string | undefined;
|
|
4172
4286
|
metadata?: {
|
|
4173
4287
|
[x: string]: string;
|
|
4174
4288
|
} | undefined;
|
|
4175
4289
|
allowPromotionCodes?: boolean | undefined;
|
|
4290
|
+
userId?: string | undefined;
|
|
4291
|
+
productId?: string | undefined;
|
|
4292
|
+
priceId?: string | undefined;
|
|
4293
|
+
unitAmount?: number | undefined;
|
|
4294
|
+
productName?: string | undefined;
|
|
4295
|
+
currency?: string | undefined;
|
|
4296
|
+
userEmail?: string | undefined;
|
|
4176
4297
|
mode?: "payment" | "subscription" | undefined;
|
|
4177
|
-
}
|
|
4298
|
+
}>]>>;
|
|
4178
4299
|
/**
|
|
4179
4300
|
* Validate create checkout session response
|
|
4180
4301
|
*
|
|
@@ -4392,32 +4513,144 @@ declare const StripeFrontConfigSchema: v.RecordSchema<v.StringSchema<undefined>,
|
|
|
4392
4513
|
readonly productName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4393
4514
|
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4394
4515
|
}, undefined>, undefined>;
|
|
4516
|
+
/**
|
|
4517
|
+
* Tax handling for StripeOrder. Unit amounts are always excl. VAT
|
|
4518
|
+
* (`tax_behavior: 'exclusive'`).
|
|
4519
|
+
* - `manual`: Stripe Tax Rate IDs applied to every line
|
|
4520
|
+
* - `automatic`: Stripe Tax computes the tax (reverse charge from the buyer's tax ID)
|
|
4521
|
+
*
|
|
4522
|
+
* @version 0.2.0
|
|
4523
|
+
* @since 0.2.0
|
|
4524
|
+
* @author AMBROISE PARK Consulting
|
|
4525
|
+
*/
|
|
4526
|
+
declare const StripeOrderTaxSchema: v.VariantSchema<"mode", [v.ObjectSchema<{
|
|
4527
|
+
readonly mode: v.LiteralSchema<"manual", undefined>;
|
|
4528
|
+
readonly taxRateIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
4529
|
+
}, undefined>, v.ObjectSchema<{
|
|
4530
|
+
readonly mode: v.LiteralSchema<"automatic", undefined>;
|
|
4531
|
+
}, undefined>], undefined>;
|
|
4532
|
+
/**
|
|
4533
|
+
* Maximum shipping rates per Checkout Session (Stripe `shipping_options` limit).
|
|
4534
|
+
*
|
|
4535
|
+
* @version 0.2.0
|
|
4536
|
+
* @since 0.2.0
|
|
4537
|
+
* @author AMBROISE PARK Consulting
|
|
4538
|
+
*/
|
|
4539
|
+
declare const MAX_SHIPPING_RATE_IDS = 5;
|
|
4540
|
+
/**
|
|
4541
|
+
* Shipping collection for StripeOrder.
|
|
4542
|
+
*
|
|
4543
|
+
* @version 0.2.0
|
|
4544
|
+
* @since 0.2.0
|
|
4545
|
+
* @author AMBROISE PARK Consulting
|
|
4546
|
+
*/
|
|
4547
|
+
declare const StripeOrderShippingSchema: v.ObjectSchema<{
|
|
4548
|
+
/** Uppercase ISO 3166-1 alpha-2 country codes the order can ship to (e.g. `FR`) */
|
|
4549
|
+
readonly allowedCountries: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "allowedCountries: uppercase ISO 3166-1 alpha-2 code expected (e.g. FR)">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
4550
|
+
/** Stripe Shipping Rate IDs offered at checkout (Stripe allows at most 5) */
|
|
4551
|
+
readonly shippingRateIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 5, "shippingRateIds: at most 5 (Stripe limit)">]>, undefined>;
|
|
4552
|
+
}, undefined>;
|
|
4553
|
+
/**
|
|
4554
|
+
* Back-config item for a multi-line, one-time order priced on the server
|
|
4555
|
+
* (`resolveLineItems` hook, TypeScript only).
|
|
4556
|
+
*
|
|
4557
|
+
* @version 0.2.0
|
|
4558
|
+
* @since 0.2.0
|
|
4559
|
+
* @author AMBROISE PARK Consulting
|
|
4560
|
+
*/
|
|
4561
|
+
declare const StripeOrderBackSchema: v.ObjectSchema<{
|
|
4562
|
+
readonly type: v.LiteralSchema<"StripeOrder", undefined>;
|
|
4563
|
+
readonly name: v.StringSchema<undefined>;
|
|
4564
|
+
/** ISO 4217 currency of every resolved line */
|
|
4565
|
+
readonly currency: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, undefined>]>;
|
|
4566
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4567
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
4568
|
+
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4569
|
+
readonly tax: v.VariantSchema<"mode", [v.ObjectSchema<{
|
|
4570
|
+
readonly mode: v.LiteralSchema<"manual", undefined>;
|
|
4571
|
+
readonly taxRateIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
4572
|
+
}, undefined>, v.ObjectSchema<{
|
|
4573
|
+
readonly mode: v.LiteralSchema<"automatic", undefined>;
|
|
4574
|
+
}, undefined>], undefined>;
|
|
4575
|
+
/** Collect the buyer's tax ID (VAT number) */
|
|
4576
|
+
readonly taxIdCollection: v.PicklistSchema<["disabled", "optional", "required"], undefined>;
|
|
4577
|
+
readonly billingAddressCollection: v.PicklistSchema<["auto", "required"], undefined>;
|
|
4578
|
+
readonly shipping: v.OptionalSchema<v.ObjectSchema<{
|
|
4579
|
+
/** Uppercase ISO 3166-1 alpha-2 country codes the order can ship to (e.g. `FR`) */
|
|
4580
|
+
readonly allowedCountries: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "allowedCountries: uppercase ISO 3166-1 alpha-2 code expected (e.g. FR)">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
4581
|
+
/** Stripe Shipping Rate IDs offered at checkout (Stripe allows at most 5) */
|
|
4582
|
+
readonly shippingRateIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 5, "shippingRateIds: at most 5 (Stripe limit)">]>, undefined>;
|
|
4583
|
+
}, undefined>, undefined>;
|
|
4584
|
+
readonly customerCreation: v.PicklistSchema<["always", "if_required"], undefined>;
|
|
4585
|
+
/** Generate a post-payment Stripe invoice */
|
|
4586
|
+
readonly invoiceCreation: v.BooleanSchema<undefined>;
|
|
4587
|
+
/** Stripe Payment Method Configuration ID (card, SEPA debit...). Omit to use the account default. */
|
|
4588
|
+
readonly paymentMethodConfiguration: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4589
|
+
}, undefined>;
|
|
4395
4590
|
/**
|
|
4396
4591
|
* Schema for backend billing configuration (with hooks)
|
|
4397
4592
|
*
|
|
4398
|
-
* @version 0.
|
|
4593
|
+
* @version 0.2.0
|
|
4399
4594
|
* @since 0.0.1
|
|
4400
4595
|
* @author AMBROISE PARK Consulting
|
|
4401
4596
|
*/
|
|
4402
|
-
declare const StripeBackConfigSchema: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
4403
|
-
readonly type: v.PicklistSchema<["StripePayment", "StripeSubscription"], undefined>;
|
|
4597
|
+
declare const StripeBackConfigSchema: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
4404
4598
|
readonly name: v.StringSchema<undefined>;
|
|
4405
4599
|
readonly price: v.NumberSchema<undefined>;
|
|
4406
4600
|
readonly currency: v.StringSchema<undefined>;
|
|
4407
|
-
/** Stripe price ID (fixed pricing). Optional for dynamic pricing products. */
|
|
4408
4601
|
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4409
|
-
/** Default amount in cents (dynamic pricing). */
|
|
4410
4602
|
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4411
|
-
/** Product name for Stripe checkout (dynamic pricing). */
|
|
4412
4603
|
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4413
|
-
/** Maximum allowed unit amount in cents. Security cap. */
|
|
4414
4604
|
readonly maxUnitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4415
4605
|
readonly tier: v.StringSchema<undefined>;
|
|
4416
4606
|
readonly duration: v.StringSchema<undefined>;
|
|
4417
4607
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4418
4608
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
4419
4609
|
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4420
|
-
|
|
4610
|
+
readonly type: v.LiteralSchema<"StripePayment", undefined>;
|
|
4611
|
+
}, undefined>, v.ObjectSchema<{
|
|
4612
|
+
readonly name: v.StringSchema<undefined>;
|
|
4613
|
+
readonly price: v.NumberSchema<undefined>;
|
|
4614
|
+
readonly currency: v.StringSchema<undefined>;
|
|
4615
|
+
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4616
|
+
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4617
|
+
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4618
|
+
readonly maxUnitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4619
|
+
readonly tier: v.StringSchema<undefined>;
|
|
4620
|
+
readonly duration: v.StringSchema<undefined>;
|
|
4621
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4622
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
4623
|
+
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4624
|
+
readonly type: v.LiteralSchema<"StripeSubscription", undefined>;
|
|
4625
|
+
}, undefined>, v.ObjectSchema<{
|
|
4626
|
+
readonly type: v.LiteralSchema<"StripeOrder", undefined>;
|
|
4627
|
+
readonly name: v.StringSchema<undefined>;
|
|
4628
|
+
/** ISO 4217 currency of every resolved line */
|
|
4629
|
+
readonly currency: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, undefined>]>;
|
|
4630
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4631
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
4632
|
+
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4633
|
+
readonly tax: v.VariantSchema<"mode", [v.ObjectSchema<{
|
|
4634
|
+
readonly mode: v.LiteralSchema<"manual", undefined>;
|
|
4635
|
+
readonly taxRateIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
4636
|
+
}, undefined>, v.ObjectSchema<{
|
|
4637
|
+
readonly mode: v.LiteralSchema<"automatic", undefined>;
|
|
4638
|
+
}, undefined>], undefined>;
|
|
4639
|
+
/** Collect the buyer's tax ID (VAT number) */
|
|
4640
|
+
readonly taxIdCollection: v.PicklistSchema<["disabled", "optional", "required"], undefined>;
|
|
4641
|
+
readonly billingAddressCollection: v.PicklistSchema<["auto", "required"], undefined>;
|
|
4642
|
+
readonly shipping: v.OptionalSchema<v.ObjectSchema<{
|
|
4643
|
+
/** Uppercase ISO 3166-1 alpha-2 country codes the order can ship to (e.g. `FR`) */
|
|
4644
|
+
readonly allowedCountries: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "allowedCountries: uppercase ISO 3166-1 alpha-2 code expected (e.g. FR)">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
|
|
4645
|
+
/** Stripe Shipping Rate IDs offered at checkout (Stripe allows at most 5) */
|
|
4646
|
+
readonly shippingRateIds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.MaxLengthAction<string[], 5, "shippingRateIds: at most 5 (Stripe limit)">]>, undefined>;
|
|
4647
|
+
}, undefined>, undefined>;
|
|
4648
|
+
readonly customerCreation: v.PicklistSchema<["always", "if_required"], undefined>;
|
|
4649
|
+
/** Generate a post-payment Stripe invoice */
|
|
4650
|
+
readonly invoiceCreation: v.BooleanSchema<undefined>;
|
|
4651
|
+
/** Stripe Payment Method Configuration ID (card, SEPA debit...). Omit to use the account default. */
|
|
4652
|
+
readonly paymentMethodConfiguration: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4653
|
+
}, undefined>], undefined>, undefined>;
|
|
4421
4654
|
/**
|
|
4422
4655
|
* Helper to validate frontend config at runtime
|
|
4423
4656
|
*
|
|
@@ -4447,7 +4680,6 @@ declare function validateStripeFrontConfig(config: unknown): {
|
|
|
4447
4680
|
*/
|
|
4448
4681
|
declare function validateStripeBackConfig(config: unknown): {
|
|
4449
4682
|
[x: string]: {
|
|
4450
|
-
type: "StripePayment" | "StripeSubscription";
|
|
4451
4683
|
name: string;
|
|
4452
4684
|
price: number;
|
|
4453
4685
|
currency: string;
|
|
@@ -4462,6 +4694,47 @@ declare function validateStripeBackConfig(config: unknown): {
|
|
|
4462
4694
|
[x: string]: string;
|
|
4463
4695
|
} | undefined;
|
|
4464
4696
|
allowPromotionCodes?: boolean | undefined;
|
|
4697
|
+
type: "StripePayment";
|
|
4698
|
+
} | {
|
|
4699
|
+
name: string;
|
|
4700
|
+
price: number;
|
|
4701
|
+
currency: string;
|
|
4702
|
+
priceId?: string | undefined;
|
|
4703
|
+
unitAmount?: number | undefined;
|
|
4704
|
+
productName?: string | undefined;
|
|
4705
|
+
maxUnitAmount?: number | undefined;
|
|
4706
|
+
tier: string;
|
|
4707
|
+
duration: string;
|
|
4708
|
+
description?: string | undefined;
|
|
4709
|
+
metadata?: {
|
|
4710
|
+
[x: string]: string;
|
|
4711
|
+
} | undefined;
|
|
4712
|
+
allowPromotionCodes?: boolean | undefined;
|
|
4713
|
+
type: "StripeSubscription";
|
|
4714
|
+
} | {
|
|
4715
|
+
type: "StripeOrder";
|
|
4716
|
+
name: string;
|
|
4717
|
+
currency: string;
|
|
4718
|
+
description?: string | undefined;
|
|
4719
|
+
metadata?: {
|
|
4720
|
+
[x: string]: string;
|
|
4721
|
+
} | undefined;
|
|
4722
|
+
allowPromotionCodes?: boolean | undefined;
|
|
4723
|
+
tax: {
|
|
4724
|
+
mode: "manual";
|
|
4725
|
+
taxRateIds: string[];
|
|
4726
|
+
} | {
|
|
4727
|
+
mode: "automatic";
|
|
4728
|
+
};
|
|
4729
|
+
taxIdCollection: "optional" | "required" | "disabled";
|
|
4730
|
+
billingAddressCollection: "required" | "auto";
|
|
4731
|
+
shipping?: {
|
|
4732
|
+
allowedCountries: string[];
|
|
4733
|
+
shippingRateIds?: string[] | undefined;
|
|
4734
|
+
} | undefined;
|
|
4735
|
+
customerCreation: "always" | "if_required";
|
|
4736
|
+
invoiceCreation: boolean;
|
|
4737
|
+
paymentMethodConfiguration?: string | undefined;
|
|
4465
4738
|
};
|
|
4466
4739
|
};
|
|
4467
4740
|
/**
|
|
@@ -4475,40 +4748,81 @@ declare function validateBillingSchemas(): {
|
|
|
4475
4748
|
success: boolean;
|
|
4476
4749
|
results: {
|
|
4477
4750
|
createCheckoutSessionRequest: v.SafeParseResult<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
4751
|
+
/** Key in the app's StripeBackConfig */
|
|
4752
|
+
readonly billingConfigKey: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4753
|
+
readonly lineItems: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
4754
|
+
/** App product ID. For StripePayment/StripeSubscription: the billing config key. */
|
|
4755
|
+
readonly productId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 200, undefined>]>;
|
|
4756
|
+
readonly quantity: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 10000, undefined>]>;
|
|
4757
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
4758
|
+
productId: string;
|
|
4759
|
+
quantity: number;
|
|
4760
|
+
}[], 1, "At least one line item is required">, v.MaxLengthAction<{
|
|
4761
|
+
productId: string;
|
|
4762
|
+
quantity: number;
|
|
4763
|
+
}[], 100, "At most 100 line items">]>, undefined>;
|
|
4764
|
+
readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
4765
|
+
readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
4766
|
+
readonly customerEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
4767
|
+
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
4768
|
+
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4769
|
+
/** 0.1.x: ignored by the framework providers (they pass the authenticated user) */
|
|
4478
4770
|
readonly userId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4479
4771
|
readonly productId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4480
|
-
/** Stripe price ID (
|
|
4772
|
+
/** 0.1.x: Stripe price ID (must match the back config priceId when it has one) */
|
|
4481
4773
|
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4482
|
-
/**
|
|
4774
|
+
/** 0.1.x: amount in cents (dynamic pricing, capped by the back config `maxUnitAmount`) */
|
|
4483
4775
|
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4484
|
-
/**
|
|
4776
|
+
/** 0.1.x: product name shown on Stripe checkout (dynamic pricing) */
|
|
4485
4777
|
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4486
|
-
/**
|
|
4778
|
+
/** 0.1.x: currency code (dynamic pricing), defaults to the back config currency */
|
|
4487
4779
|
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, undefined>;
|
|
4488
|
-
readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
4489
|
-
readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
4490
|
-
readonly customerEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
4491
4780
|
readonly userEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
4492
|
-
|
|
4493
|
-
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
4781
|
+
/** 0.1.x: Stripe mode. Omitted: derived from the back config item type. */
|
|
4494
4782
|
readonly mode: v.OptionalSchema<v.PicklistSchema<["payment", "subscription"], undefined>, undefined>;
|
|
4495
|
-
}, undefined>, v.
|
|
4783
|
+
}, undefined>, v.RawTransformAction<{
|
|
4784
|
+
billingConfigKey?: string | undefined;
|
|
4785
|
+
lineItems?: {
|
|
4786
|
+
productId: string;
|
|
4787
|
+
quantity: number;
|
|
4788
|
+
}[] | undefined;
|
|
4789
|
+
successUrl: string;
|
|
4790
|
+
cancelUrl: string;
|
|
4791
|
+
customerEmail?: string | undefined;
|
|
4792
|
+
metadata?: {
|
|
4793
|
+
[x: string]: string;
|
|
4794
|
+
} | undefined;
|
|
4795
|
+
allowPromotionCodes?: boolean | undefined;
|
|
4496
4796
|
userId?: string | undefined;
|
|
4497
4797
|
productId?: string | undefined;
|
|
4498
4798
|
priceId?: string | undefined;
|
|
4499
4799
|
unitAmount?: number | undefined;
|
|
4500
4800
|
productName?: string | undefined;
|
|
4501
4801
|
currency?: string | undefined;
|
|
4802
|
+
userEmail?: string | undefined;
|
|
4803
|
+
mode?: "payment" | "subscription" | undefined;
|
|
4804
|
+
}, {
|
|
4805
|
+
billingConfigKey: string;
|
|
4806
|
+
lineItems: {
|
|
4807
|
+
productId: string;
|
|
4808
|
+
quantity: number;
|
|
4809
|
+
}[];
|
|
4502
4810
|
successUrl: string;
|
|
4503
4811
|
cancelUrl: string;
|
|
4504
4812
|
customerEmail?: string | undefined;
|
|
4505
|
-
userEmail?: string | undefined;
|
|
4506
4813
|
metadata?: {
|
|
4507
4814
|
[x: string]: string;
|
|
4508
4815
|
} | undefined;
|
|
4509
4816
|
allowPromotionCodes?: boolean | undefined;
|
|
4817
|
+
userId?: string | undefined;
|
|
4818
|
+
productId?: string | undefined;
|
|
4819
|
+
priceId?: string | undefined;
|
|
4820
|
+
unitAmount?: number | undefined;
|
|
4821
|
+
productName?: string | undefined;
|
|
4822
|
+
currency?: string | undefined;
|
|
4823
|
+
userEmail?: string | undefined;
|
|
4510
4824
|
mode?: "payment" | "subscription" | undefined;
|
|
4511
|
-
}
|
|
4825
|
+
}>]>>;
|
|
4512
4826
|
createCheckoutSessionResponse: v.SafeParseResult<v.ObjectSchema<{
|
|
4513
4827
|
readonly sessionId: v.StringSchema<undefined>;
|
|
4514
4828
|
readonly sessionUrl: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
|
|
@@ -4804,6 +5118,9 @@ type BillingErrorCode = 'unknown' | 'unauthenticated' | 'invalid_request' | 'str
|
|
|
4804
5118
|
/**
|
|
4805
5119
|
* Stripe checkout session creation request
|
|
4806
5120
|
*
|
|
5121
|
+
* 0.1.x request shape, still accepted. New code sends
|
|
5122
|
+
* `CreateCheckoutSessionRequestInput` (`billingConfigKey`, plus `lineItems` for StripeOrder).
|
|
5123
|
+
*
|
|
4807
5124
|
* @version 0.1.0
|
|
4808
5125
|
* @since 0.0.1
|
|
4809
5126
|
* @author AMBROISE PARK Consulting
|
|
@@ -5181,48 +5498,265 @@ interface StripePrice {
|
|
|
5181
5498
|
lookup_key?: string;
|
|
5182
5499
|
}
|
|
5183
5500
|
/**
|
|
5184
|
-
* Result of a beforeCheckout hook invocation.
|
|
5185
|
-
*
|
|
5501
|
+
* Result of a beforeCheckout hook invocation. Blocks or allows checkout.
|
|
5502
|
+
* StripeOrder prices come from `resolveLineItems`, never from here.
|
|
5503
|
+
*
|
|
5504
|
+
* @version 0.2.0
|
|
5505
|
+
* @since 0.0.1
|
|
5506
|
+
* @author AMBROISE PARK Consulting
|
|
5186
5507
|
*/
|
|
5187
5508
|
interface BeforeCheckoutResult {
|
|
5188
5509
|
/** Whether checkout is allowed to proceed */
|
|
5189
5510
|
allowed: boolean;
|
|
5190
5511
|
/** Reason for blocking (shown in error response) */
|
|
5191
5512
|
reason?: string;
|
|
5192
|
-
/**
|
|
5193
|
-
|
|
5513
|
+
/**
|
|
5514
|
+
* 0.1.x dynamic pricing only (request `unitAmount` + `productName`, no
|
|
5515
|
+
* `priceId`): replaces the amount/name before session creation. The amount
|
|
5516
|
+
* stays capped by the back config `maxUnitAmount`. Ignored otherwise.
|
|
5517
|
+
* @deprecated Prefer StripeOrder `resolveLineItems` for server-priced lines.
|
|
5518
|
+
*/
|
|
5519
|
+
overrides?: {
|
|
5520
|
+
unitAmount?: number;
|
|
5521
|
+
productName?: string;
|
|
5522
|
+
};
|
|
5194
5523
|
}
|
|
5524
|
+
/**
|
|
5525
|
+
* Second argument of a `beforeCheckout` hook: the normalized request plus the
|
|
5526
|
+
* 0.1.x checkout options, so 0.1.x guards (`options.mode === 'subscription'`,
|
|
5527
|
+
* `options.priceId`) keep working.
|
|
5528
|
+
*
|
|
5529
|
+
* @version 0.2.0
|
|
5530
|
+
* @since 0.2.0
|
|
5531
|
+
* @author AMBROISE PARK Consulting
|
|
5532
|
+
*/
|
|
5533
|
+
type BeforeCheckoutOptions = Omit<CreateCheckoutSessionRequest, 'userId' | 'mode' | 'priceId' | 'metadata' | 'allowPromotionCodes'> & {
|
|
5534
|
+
/** Authenticated user ID (never the client value) */
|
|
5535
|
+
userId: string;
|
|
5536
|
+
/** Stripe mode of the session (request `mode`, else derived from the item type; StripeOrder: `payment`) */
|
|
5537
|
+
mode: CheckoutMode;
|
|
5538
|
+
/** Stripe price charged (request priceId, else the back config priceId). Undefined for dynamic pricing and StripeOrder. */
|
|
5539
|
+
priceId?: string;
|
|
5540
|
+
/** Request metadata as sent (before sanitization; 0.1.x behaviour) */
|
|
5541
|
+
metadata: Record<string, string>;
|
|
5542
|
+
/** Request value, default `true` (0.1.x behaviour) */
|
|
5543
|
+
allowPromotionCodes: boolean;
|
|
5544
|
+
};
|
|
5195
5545
|
/**
|
|
5196
5546
|
* Hook called before Stripe checkout session creation.
|
|
5197
|
-
* Use for ownership checks
|
|
5547
|
+
* Use for ownership checks and status validation.
|
|
5548
|
+
*
|
|
5549
|
+
* @example
|
|
5550
|
+
* ```typescript
|
|
5551
|
+
* const beforeCheckout: BeforeCheckoutHook = async (userId, options) =>
|
|
5552
|
+
* options.mode === 'subscription' && options.billingConfigKey !== 'pro_monthly'
|
|
5553
|
+
* ? { allowed: false, reason: 'Unknown plan' }
|
|
5554
|
+
* : { allowed: true };
|
|
5555
|
+
* ```
|
|
5198
5556
|
*
|
|
5199
5557
|
* @param userId - Authenticated user ID
|
|
5200
|
-
* @param options -
|
|
5558
|
+
* @param options - Normalized request + 0.1.x checkout options (`mode`, `priceId`, `unitAmount`, `currency`...)
|
|
5201
5559
|
* @param metadata - Request metadata (sanitized)
|
|
5202
|
-
* @returns Whether to allow checkout, optional reason
|
|
5560
|
+
* @returns Whether to allow checkout, optional reason (and 0.1.x dynamic-pricing overrides)
|
|
5561
|
+
*
|
|
5562
|
+
* @version 0.2.0
|
|
5563
|
+
* @since 0.0.1
|
|
5564
|
+
* @author AMBROISE PARK Consulting
|
|
5203
5565
|
*/
|
|
5204
|
-
type BeforeCheckoutHook = (userId: string, options:
|
|
5566
|
+
type BeforeCheckoutHook = (userId: string, options: BeforeCheckoutOptions, metadata: Record<string, string>) => Promise<BeforeCheckoutResult>;
|
|
5205
5567
|
/**
|
|
5206
|
-
*
|
|
5568
|
+
* One requested checkout line (client input).
|
|
5207
5569
|
*
|
|
5208
|
-
* @version 0.
|
|
5570
|
+
* @version 0.2.0
|
|
5571
|
+
* @since 0.2.0
|
|
5572
|
+
* @author AMBROISE PARK Consulting
|
|
5573
|
+
*/
|
|
5574
|
+
type CheckoutLineItemInput = v.InferOutput<typeof CheckoutLineItemInputSchema>;
|
|
5575
|
+
/**
|
|
5576
|
+
* One line priced by the app's `resolveLineItems` hook.
|
|
5577
|
+
*
|
|
5578
|
+
* @version 0.2.0
|
|
5579
|
+
* @since 0.2.0
|
|
5580
|
+
* @author AMBROISE PARK Consulting
|
|
5581
|
+
*/
|
|
5582
|
+
interface ResolvedLineItem {
|
|
5583
|
+
/** App product ID, copied to the Stripe product metadata and returned in `onOrderPaid` */
|
|
5584
|
+
productId: string;
|
|
5585
|
+
/** Name shown on the Stripe checkout page and invoice */
|
|
5586
|
+
name: string;
|
|
5587
|
+
description?: string;
|
|
5588
|
+
/** Unit price excl. VAT, in the smallest currency unit (cents) */
|
|
5589
|
+
unitAmount: number;
|
|
5590
|
+
quantity: number;
|
|
5591
|
+
}
|
|
5592
|
+
/**
|
|
5593
|
+
* Output of `resolveLineItems`: the server-side order and its priced lines.
|
|
5594
|
+
*
|
|
5595
|
+
* @version 0.2.0
|
|
5596
|
+
* @since 0.2.0
|
|
5597
|
+
* @author AMBROISE PARK Consulting
|
|
5598
|
+
*/
|
|
5599
|
+
interface ResolvedOrder {
|
|
5600
|
+
/** App order ID (created by the hook, e.g. a pending order row) */
|
|
5601
|
+
orderId: string;
|
|
5602
|
+
lineItems: ResolvedLineItem[];
|
|
5603
|
+
/** Per-order session options decided by the server (omit to use the back config). */
|
|
5604
|
+
session?: ResolvedOrderSession;
|
|
5605
|
+
}
|
|
5606
|
+
/**
|
|
5607
|
+
* Checkout session options a StripeOrder decides per order in `resolveLineItems`
|
|
5608
|
+
* (they depend on the buyer or the order, not on the back config).
|
|
5609
|
+
*
|
|
5610
|
+
* @version 0.2.0
|
|
5611
|
+
* @since 0.2.0
|
|
5612
|
+
* @author AMBROISE PARK Consulting
|
|
5613
|
+
*/
|
|
5614
|
+
interface ResolvedOrderSession {
|
|
5615
|
+
/**
|
|
5616
|
+
* Manual tax only: Tax Rate IDs applied to every line of this order instead of
|
|
5617
|
+
* `tax.taxRateIds` (each must be exclusive). `[]` = no tax (e.g. EU B2B reverse charge).
|
|
5618
|
+
*/
|
|
5619
|
+
taxRateIds?: string[];
|
|
5620
|
+
/** Payment methods offered for this order. Replaces `paymentMethodConfiguration`. */
|
|
5621
|
+
paymentMethodTypes?: Array<'card' | 'sepa_debit'>;
|
|
5622
|
+
/** Session expiry, Unix seconds. Stripe: 30 minutes to 24 hours after creation. */
|
|
5623
|
+
expiresAt?: number;
|
|
5624
|
+
/** Footer printed on the post-payment invoice (e.g. a legal mention). Needs `invoiceCreation`. */
|
|
5625
|
+
invoiceFooter?: string;
|
|
5626
|
+
}
|
|
5627
|
+
/**
|
|
5628
|
+
* Context passed to `resolveLineItems`.
|
|
5629
|
+
*
|
|
5630
|
+
* @version 0.2.0
|
|
5631
|
+
* @since 0.2.0
|
|
5632
|
+
* @author AMBROISE PARK Consulting
|
|
5633
|
+
*/
|
|
5634
|
+
interface ResolveLineItemsContext {
|
|
5635
|
+
userId: string;
|
|
5636
|
+
billingConfigKey: string;
|
|
5637
|
+
/** Request metadata (sanitized) */
|
|
5638
|
+
metadata: Record<string, string>;
|
|
5639
|
+
}
|
|
5640
|
+
/**
|
|
5641
|
+
* Postal address as reported by Stripe.
|
|
5642
|
+
*
|
|
5643
|
+
* @version 0.2.0
|
|
5644
|
+
* @since 0.2.0
|
|
5645
|
+
* @author AMBROISE PARK Consulting
|
|
5646
|
+
*/
|
|
5647
|
+
interface CheckoutAddress {
|
|
5648
|
+
line1: string | null;
|
|
5649
|
+
line2: string | null;
|
|
5650
|
+
postalCode: string | null;
|
|
5651
|
+
city: string | null;
|
|
5652
|
+
state: string | null;
|
|
5653
|
+
/** ISO 3166-1 alpha-2 */
|
|
5654
|
+
country: string | null;
|
|
5655
|
+
}
|
|
5656
|
+
/**
|
|
5657
|
+
* Provider-neutral snapshot of a completed/expired Stripe Checkout Session,
|
|
5658
|
+
* passed to order hooks.
|
|
5659
|
+
*
|
|
5660
|
+
* @version 0.2.0
|
|
5661
|
+
* @since 0.2.0
|
|
5662
|
+
* @author AMBROISE PARK Consulting
|
|
5663
|
+
*/
|
|
5664
|
+
interface CheckoutSessionSnapshot {
|
|
5665
|
+
id: string;
|
|
5666
|
+
/** 'paid' | 'unpaid' | 'no_payment_required' */
|
|
5667
|
+
paymentStatus: string;
|
|
5668
|
+
currency: string | null;
|
|
5669
|
+
/** Amounts in the smallest currency unit */
|
|
5670
|
+
amountSubtotal: number | null;
|
|
5671
|
+
amountTax: number | null;
|
|
5672
|
+
amountShipping: number | null;
|
|
5673
|
+
amountDiscount: number | null;
|
|
5674
|
+
amountTotal: number | null;
|
|
5675
|
+
customerId: string | null;
|
|
5676
|
+
customer: {
|
|
5677
|
+
email: string | null;
|
|
5678
|
+
name: string | null;
|
|
5679
|
+
phone: string | null;
|
|
5680
|
+
/** Business name, when collected */
|
|
5681
|
+
businessName: string | null;
|
|
5682
|
+
address: CheckoutAddress | null;
|
|
5683
|
+
taxIds: Array<{
|
|
5684
|
+
type: string;
|
|
5685
|
+
value: string | null;
|
|
5686
|
+
}>;
|
|
5687
|
+
/** 'none' | 'exempt' | 'reverse' */
|
|
5688
|
+
taxExempt: string | null;
|
|
5689
|
+
} | null;
|
|
5690
|
+
shipping: {
|
|
5691
|
+
name: string;
|
|
5692
|
+
address: CheckoutAddress;
|
|
5693
|
+
} | null;
|
|
5694
|
+
invoiceId: string | null;
|
|
5695
|
+
paymentIntentId: string | null;
|
|
5696
|
+
metadata: Record<string, string>;
|
|
5697
|
+
}
|
|
5698
|
+
/**
|
|
5699
|
+
* One paid line, read back from Stripe (amounts as charged).
|
|
5700
|
+
*
|
|
5701
|
+
* @version 0.2.0
|
|
5702
|
+
* @since 0.2.0
|
|
5703
|
+
* @author AMBROISE PARK Consulting
|
|
5704
|
+
*/
|
|
5705
|
+
interface PaidLineItem {
|
|
5706
|
+
productId: string;
|
|
5707
|
+
name: string;
|
|
5708
|
+
quantity: number;
|
|
5709
|
+
/** Amounts in the smallest currency unit */
|
|
5710
|
+
amountSubtotal: number;
|
|
5711
|
+
amountDiscount: number;
|
|
5712
|
+
amountTax: number;
|
|
5713
|
+
amountTotal: number;
|
|
5714
|
+
}
|
|
5715
|
+
/**
|
|
5716
|
+
* Context passed to order webhook hooks.
|
|
5717
|
+
*
|
|
5718
|
+
* @version 0.2.0
|
|
5719
|
+
* @since 0.2.0
|
|
5720
|
+
* @author AMBROISE PARK Consulting
|
|
5721
|
+
*/
|
|
5722
|
+
interface OrderHookContext {
|
|
5723
|
+
userId: string;
|
|
5724
|
+
orderId: string;
|
|
5725
|
+
billingConfigKey: string;
|
|
5726
|
+
/**
|
|
5727
|
+
* Stripe event ID. Delivery is at-least-once: the same event can reach a hook
|
|
5728
|
+
* again (retry after a failed or unrecorded run). Key side effects on
|
|
5729
|
+
* `orderId` (or `eventId`) so a replay is a no-op.
|
|
5730
|
+
*/
|
|
5731
|
+
eventId: string;
|
|
5732
|
+
}
|
|
5733
|
+
/**
|
|
5734
|
+
* Client checkout options (useStripeBilling `checkout`).
|
|
5735
|
+
*
|
|
5736
|
+
* @version 0.2.0
|
|
5209
5737
|
* @since 0.0.1
|
|
5210
5738
|
* @author AMBROISE PARK Consulting
|
|
5211
5739
|
*/
|
|
5212
5740
|
interface CheckoutOptions {
|
|
5213
|
-
/**
|
|
5214
|
-
|
|
5215
|
-
/**
|
|
5216
|
-
|
|
5217
|
-
/** Product name for Stripe checkout (dynamic pricing mode) */
|
|
5218
|
-
productName?: string;
|
|
5219
|
-
/** Currency code, defaults to 'eur' (dynamic pricing mode) */
|
|
5220
|
-
currency?: string;
|
|
5221
|
-
mode: 'payment' | 'subscription';
|
|
5741
|
+
/** Key in the app's StripeBackConfig. 0.1.x callers may pass it as `metadata.billingConfigKey`. */
|
|
5742
|
+
billingConfigKey?: string;
|
|
5743
|
+
/** Requested lines. Defaults to `[{ productId: billingConfigKey, quantity: 1 }]` (single product / subscription). */
|
|
5744
|
+
lineItems?: CheckoutLineItemInput[];
|
|
5222
5745
|
successUrl?: string;
|
|
5223
5746
|
cancelUrl?: string;
|
|
5224
5747
|
metadata?: Record<string, string>;
|
|
5748
|
+
/** Single-price items: show the promotion code field (default true). StripeOrder: set in the back config. */
|
|
5225
5749
|
allowPromotionCodes?: boolean;
|
|
5750
|
+
/** Stripe price ID (single-price items). Must match the back config priceId when it has one; defaults to it. */
|
|
5751
|
+
priceId?: string;
|
|
5752
|
+
/** Dynamic pricing amount in cents (with `productName`, no `priceId`). Capped by the back config `maxUnitAmount`. */
|
|
5753
|
+
unitAmount?: number;
|
|
5754
|
+
/** Product name for dynamic pricing. */
|
|
5755
|
+
productName?: string;
|
|
5756
|
+
/** Currency for dynamic pricing (default 'eur'). */
|
|
5757
|
+
currency?: string;
|
|
5758
|
+
/** Stripe mode for single-price items. Defaults to the back config item type. */
|
|
5759
|
+
mode?: CheckoutMode;
|
|
5226
5760
|
}
|
|
5227
5761
|
/**
|
|
5228
5762
|
* Billing API type - complete interface for useStripeBilling hook
|
|
@@ -5269,42 +5803,82 @@ interface BillingAPI {
|
|
|
5269
5803
|
* @author AMBROISE PARK Consulting
|
|
5270
5804
|
*/
|
|
5271
5805
|
type StripeFrontConfig = v.InferOutput<typeof StripeFrontConfigSchema>;
|
|
5806
|
+
type StripeBackConfigItemData = v.InferOutput<typeof StripeBackConfigSchema>[string];
|
|
5807
|
+
/**
|
|
5808
|
+
* Hooks shared by every back-config item.
|
|
5809
|
+
*/
|
|
5810
|
+
interface StripeBackItemCommonHooks {
|
|
5811
|
+
/** Called before Stripe checkout session creation. Can block checkout. */
|
|
5812
|
+
beforeCheckout?: BeforeCheckoutHook;
|
|
5813
|
+
}
|
|
5814
|
+
/**
|
|
5815
|
+
* One-time payment item (single Stripe price) granting a tier.
|
|
5816
|
+
* The tier is granted once the payment is settled: at checkout completion when
|
|
5817
|
+
* `payment_status` is `paid` / `no_payment_required`, else on
|
|
5818
|
+
* `checkout.session.async_payment_succeeded` (e.g. SEPA debit).
|
|
5819
|
+
* Hooks run at least once per Stripe event and may run again for the same
|
|
5820
|
+
* purchase: make them idempotent. Their errors are logged, not retried.
|
|
5821
|
+
*
|
|
5822
|
+
* @version 0.2.0
|
|
5823
|
+
* @since 0.2.0
|
|
5824
|
+
* @author AMBROISE PARK Consulting
|
|
5825
|
+
*/
|
|
5826
|
+
type StripePaymentBackItem = Extract<StripeBackConfigItemData, {
|
|
5827
|
+
type: 'StripePayment';
|
|
5828
|
+
}> & StripeBackItemCommonHooks & {
|
|
5829
|
+
onPurchaseSuccess?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5830
|
+
onPurchaseFailure?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5831
|
+
};
|
|
5832
|
+
/**
|
|
5833
|
+
* Recurring subscription item (single Stripe price) granting a tier.
|
|
5834
|
+
* Granted once the first payment is settled (same rule as StripePayment).
|
|
5835
|
+
* Hooks run at least once per Stripe event and may run again for the same
|
|
5836
|
+
* event: make them idempotent. Their errors are logged, not retried.
|
|
5837
|
+
*
|
|
5838
|
+
* @version 0.2.0
|
|
5839
|
+
* @since 0.2.0
|
|
5840
|
+
* @author AMBROISE PARK Consulting
|
|
5841
|
+
*/
|
|
5842
|
+
type StripeSubscriptionBackItem = Extract<StripeBackConfigItemData, {
|
|
5843
|
+
type: 'StripeSubscription';
|
|
5844
|
+
}> & StripeBackItemCommonHooks & {
|
|
5845
|
+
onSubscriptionCreated?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5846
|
+
onSubscriptionRenewed?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5847
|
+
onSubscriptionCancelled?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5848
|
+
onPaymentFailed?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5849
|
+
};
|
|
5850
|
+
/**
|
|
5851
|
+
* Multi-line, one-time order priced on the server.
|
|
5852
|
+
* Order hooks are delivered at least once and must be idempotent on
|
|
5853
|
+
* `ctx.orderId` / `ctx.eventId`: a hook re-runs when it threw (the webhook
|
|
5854
|
+
* answers non-2xx and Stripe retries) and also after it succeeded when the
|
|
5855
|
+
* framework could not record the event as processed. A store write cannot be
|
|
5856
|
+
* atomic with an arbitrary hook, so exactly-once is not possible.
|
|
5857
|
+
*
|
|
5858
|
+
* @version 0.2.0
|
|
5859
|
+
* @since 0.2.0
|
|
5860
|
+
* @author AMBROISE PARK Consulting
|
|
5861
|
+
*/
|
|
5862
|
+
type StripeOrderBackItem = Extract<StripeBackConfigItemData, {
|
|
5863
|
+
type: 'StripeOrder';
|
|
5864
|
+
}> & StripeBackItemCommonHooks & {
|
|
5865
|
+
/** Resolve requested lines to names and unit prices (excl. VAT) and create the app order. */
|
|
5866
|
+
resolveLineItems: (items: CheckoutLineItemInput[], ctx: ResolveLineItemsContext) => Promise<ResolvedOrder>;
|
|
5867
|
+
/** Payment confirmed (card at completion, or async method such as SEPA debit later). */
|
|
5868
|
+
onOrderPaid: (session: CheckoutSessionSnapshot, lineItems: PaidLineItem[], ctx: OrderHookContext) => Promise<void>;
|
|
5869
|
+
/** Async payment (e.g. SEPA debit) failed after checkout completion. */
|
|
5870
|
+
onOrderPaymentFailed?: (session: CheckoutSessionSnapshot, ctx: OrderHookContext) => Promise<void>;
|
|
5871
|
+
/** Checkout session expired without payment. */
|
|
5872
|
+
onOrderExpired?: (session: CheckoutSessionSnapshot, ctx: OrderHookContext) => Promise<void>;
|
|
5873
|
+
};
|
|
5272
5874
|
/**
|
|
5273
5875
|
* Backend billing configuration type with hooks
|
|
5274
5876
|
*
|
|
5275
|
-
* @version 0.
|
|
5877
|
+
* @version 0.2.0
|
|
5276
5878
|
* @since 0.0.1
|
|
5277
5879
|
* @author AMBROISE PARK Consulting
|
|
5278
5880
|
*/
|
|
5279
|
-
type StripeBackConfig =
|
|
5280
|
-
[key: string]: {
|
|
5281
|
-
type: 'StripePayment' | 'StripeSubscription';
|
|
5282
|
-
name: string;
|
|
5283
|
-
price: number;
|
|
5284
|
-
currency: string;
|
|
5285
|
-
/** Stripe price ID (fixed pricing). Optional for dynamic pricing products. */
|
|
5286
|
-
priceId?: string;
|
|
5287
|
-
/** Default amount in cents (dynamic pricing). */
|
|
5288
|
-
unitAmount?: number;
|
|
5289
|
-
/** Product name for Stripe checkout (dynamic pricing). */
|
|
5290
|
-
productName?: string;
|
|
5291
|
-
/** Maximum allowed unit amount in cents. Security cap for client-provided amounts. */
|
|
5292
|
-
maxUnitAmount?: number;
|
|
5293
|
-
tier: string;
|
|
5294
|
-
duration: string;
|
|
5295
|
-
description?: string;
|
|
5296
|
-
metadata?: Record<string, string>;
|
|
5297
|
-
allowPromotionCodes?: boolean;
|
|
5298
|
-
onPurchaseSuccess?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5299
|
-
onPurchaseFailure?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5300
|
-
onSubscriptionCreated?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5301
|
-
onSubscriptionRenewed?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5302
|
-
onSubscriptionCancelled?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5303
|
-
onPaymentFailed?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5304
|
-
/** Hook called before Stripe checkout session creation. Can block or override pricing. */
|
|
5305
|
-
beforeCheckout?: BeforeCheckoutHook;
|
|
5306
|
-
};
|
|
5307
|
-
};
|
|
5881
|
+
type StripeBackConfig = Record<string, StripePaymentBackItem | StripeSubscriptionBackItem | StripeOrderBackItem>;
|
|
5308
5882
|
/**
|
|
5309
5883
|
* Stripe configuration interface
|
|
5310
5884
|
*
|
|
@@ -5339,6 +5913,89 @@ interface StripeConfig {
|
|
|
5339
5913
|
};
|
|
5340
5914
|
};
|
|
5341
5915
|
}
|
|
5916
|
+
/**
|
|
5917
|
+
* Auth operations the server billing code needs: read a user's custom claims
|
|
5918
|
+
* and write them back (subscription tier lives in the claims).
|
|
5919
|
+
*
|
|
5920
|
+
* @version 0.1.0
|
|
5921
|
+
* @since 0.5.0
|
|
5922
|
+
* @author AMBROISE PARK Consulting
|
|
5923
|
+
*/
|
|
5924
|
+
interface BillingAuthProvider {
|
|
5925
|
+
getUser(userId: string): Promise<{
|
|
5926
|
+
customClaims?: Record<string, unknown>;
|
|
5927
|
+
}>;
|
|
5928
|
+
setCustomUserClaims(userId: string, claims: Record<string, unknown>): Promise<void>;
|
|
5929
|
+
}
|
|
5930
|
+
/**
|
|
5931
|
+
* Subscription fields written to a user by the webhook and subscription helpers
|
|
5932
|
+
* (the stored record, {@link SubscriptionData}, adds userId and updatedAt).
|
|
5933
|
+
*
|
|
5934
|
+
* @version 0.1.0
|
|
5935
|
+
* @since 0.5.0
|
|
5936
|
+
* @author AMBROISE PARK Consulting
|
|
5937
|
+
*/
|
|
5938
|
+
interface SubscriptionUpdate {
|
|
5939
|
+
tier: string;
|
|
5940
|
+
status: 'active' | 'canceled' | 'past_due' | 'trialing' | 'incomplete';
|
|
5941
|
+
subscriptionEnd: string | null;
|
|
5942
|
+
cancelAtPeriodEnd?: boolean;
|
|
5943
|
+
subscriptionId?: string | null;
|
|
5944
|
+
customerId?: string;
|
|
5945
|
+
}
|
|
5946
|
+
/**
|
|
5947
|
+
* Writes a subscription update for a user.
|
|
5948
|
+
*
|
|
5949
|
+
* @version 0.1.0
|
|
5950
|
+
* @since 0.5.0
|
|
5951
|
+
* @author AMBROISE PARK Consulting
|
|
5952
|
+
*/
|
|
5953
|
+
type UpdateSubscriptionFn = (userId: string, data: SubscriptionUpdate, authProvider: BillingAuthProvider) => Promise<void>;
|
|
5954
|
+
/**
|
|
5955
|
+
* Checkout Session created by a provider.
|
|
5956
|
+
*
|
|
5957
|
+
* @version 0.1.0
|
|
5958
|
+
* @since 0.5.0
|
|
5959
|
+
* @author AMBROISE PARK Consulting
|
|
5960
|
+
*/
|
|
5961
|
+
interface CheckoutSessionResult {
|
|
5962
|
+
id: string;
|
|
5963
|
+
url: string | null;
|
|
5964
|
+
}
|
|
5965
|
+
/**
|
|
5966
|
+
* 0.1.x single-price session params, sent to a {@link StripeCheckoutProvider}.
|
|
5967
|
+
*
|
|
5968
|
+
* @version 0.2.0
|
|
5969
|
+
* @since 0.5.0
|
|
5970
|
+
* @author AMBROISE PARK Consulting
|
|
5971
|
+
*/
|
|
5972
|
+
interface CheckoutSessionParams {
|
|
5973
|
+
priceId?: string;
|
|
5974
|
+
/** Amount in cents (dynamic pricing mode) */
|
|
5975
|
+
unitAmount?: number;
|
|
5976
|
+
/** Product name for Stripe checkout (dynamic pricing mode) */
|
|
5977
|
+
productName?: string;
|
|
5978
|
+
/** Currency code, defaults to 'eur' */
|
|
5979
|
+
currency?: string;
|
|
5980
|
+
customerEmail?: string;
|
|
5981
|
+
metadata: Record<string, string>;
|
|
5982
|
+
allowPromotionCodes: boolean;
|
|
5983
|
+
successUrl: string;
|
|
5984
|
+
cancelUrl: string;
|
|
5985
|
+
mode?: 'payment' | 'subscription';
|
|
5986
|
+
}
|
|
5987
|
+
/**
|
|
5988
|
+
* 0.1.x provider interface for Stripe checkout operations. Supports
|
|
5989
|
+
* StripePayment/StripeSubscription items only; StripeOrder needs the full-session
|
|
5990
|
+
* provider of @donotdev/functions (StripeSessionProvider).
|
|
5991
|
+
*
|
|
5992
|
+
* @version 0.1.0
|
|
5993
|
+
* @since 0.5.0
|
|
5994
|
+
* @author AMBROISE PARK Consulting
|
|
5995
|
+
*/
|
|
5996
|
+
interface StripeCheckoutProvider {
|
|
5997
|
+
createCheckoutSession(params: CheckoutSessionParams): Promise<CheckoutSessionResult>;
|
|
5998
|
+
}
|
|
5342
5999
|
|
|
5343
6000
|
/**
|
|
5344
6001
|
* @fileoverview Authentication Types
|
|
@@ -6083,6 +6740,38 @@ interface AuthProvider {
|
|
|
6083
6740
|
* @param remember - true for persistent session, false for session-only
|
|
6084
6741
|
*/
|
|
6085
6742
|
setRememberMe?(remember: boolean): Promise<void>;
|
|
6743
|
+
/**
|
|
6744
|
+
* Signed-in state read synchronously from the request cookies, without the auth
|
|
6745
|
+
* service. Lets the server render, and the client's hydration pass, show the real
|
|
6746
|
+
* signed-in state before the provider has initialised.
|
|
6747
|
+
* Display only: never an authorisation decision (the cookie is not verified).
|
|
6748
|
+
* Implemented by providers that keep their session in cookies (Supabase via
|
|
6749
|
+
* `createBrowserClient`); absent otherwise.
|
|
6750
|
+
*
|
|
6751
|
+
* @param cookieHeader - The request's `Cookie` header (`a=1; b=2`)
|
|
6752
|
+
* @returns The snapshot (`user: null` = signed out), or `null` when the cookies
|
|
6753
|
+
* cannot tell
|
|
6754
|
+
*/
|
|
6755
|
+
readSessionSnapshot?(cookieHeader: string): AuthSessionSnapshot | null;
|
|
6756
|
+
}
|
|
6757
|
+
/**
|
|
6758
|
+
* Signed-in state known from the request cookies, before the auth provider has
|
|
6759
|
+
* initialised (see AuthProvider.readSessionSnapshot). Display only.
|
|
6760
|
+
*
|
|
6761
|
+
* @version 0.1.0
|
|
6762
|
+
* @since 0.1.50
|
|
6763
|
+
* @author AMBROISE PARK Consulting
|
|
6764
|
+
*/
|
|
6765
|
+
interface AuthSessionSnapshot {
|
|
6766
|
+
/** The signed-in user, or `null` when signed out */
|
|
6767
|
+
user: AuthUser | null;
|
|
6768
|
+
/**
|
|
6769
|
+
* The session's access token while it is still valid, else absent. Server render
|
|
6770
|
+
* only: lets CRUD reads run as the visitor (ICrudAdapter.forAccessToken), so the
|
|
6771
|
+
* HTML carries the visitor's own data. The database verifies the token; the
|
|
6772
|
+
* framework never trusts it for anything else.
|
|
6773
|
+
*/
|
|
6774
|
+
accessToken?: string;
|
|
6086
6775
|
}
|
|
6087
6776
|
/**
|
|
6088
6777
|
* Information about a token including its status and expiration
|
|
@@ -8052,7 +8741,13 @@ interface PaginatedQueryResult<T> {
|
|
|
8052
8741
|
*/
|
|
8053
8742
|
interface CrudListQuery<T> {
|
|
8054
8743
|
readonly queryKey: readonly ['crud', string, 'query', string];
|
|
8055
|
-
|
|
8744
|
+
/**
|
|
8745
|
+
* Receives TanStack's query context; `client` (the request's QueryClient on the
|
|
8746
|
+
* server) selects a request-scoped adapter when one is bound.
|
|
8747
|
+
*/
|
|
8748
|
+
readonly queryFn: (context: {
|
|
8749
|
+
client: object;
|
|
8750
|
+
}) => Promise<PaginatedQueryResult<T>>;
|
|
8056
8751
|
readonly staleTime: number;
|
|
8057
8752
|
}
|
|
8058
8753
|
/**
|
|
@@ -8119,6 +8814,13 @@ interface ICrudAdapter {
|
|
|
8119
8814
|
* **Firestore:** Rules are row-level only — field-level filtering needs FunctionsAdapter.
|
|
8120
8815
|
*/
|
|
8121
8816
|
readonly dbLevelSecurity?: boolean;
|
|
8817
|
+
/**
|
|
8818
|
+
* A view of this adapter whose reads run as the holder of `accessToken` (the
|
|
8819
|
+
* visitor's session during the server render). Only for adapters whose backend
|
|
8820
|
+
* verifies the token itself (`dbLevelSecurity`), so a forged token reads nothing.
|
|
8821
|
+
* Absent: the server render does not prefetch signed-in visitors' data.
|
|
8822
|
+
*/
|
|
8823
|
+
forAccessToken?(accessToken: string): ICrudAdapter;
|
|
8122
8824
|
/** Fetch a single document by ID. Returns null if not found. */
|
|
8123
8825
|
get<T>(collection: string, id: string, schema?: dndevSchema<unknown>, options?: CrudOperationOptions): Promise<T | null>;
|
|
8124
8826
|
/** Create a new document with auto-generated ID. Returns the ID + parsed data. */
|
|
@@ -14154,6 +14856,51 @@ declare function hasProvider(key: keyof DndevProviders): boolean;
|
|
|
14154
14856
|
*/
|
|
14155
14857
|
declare function resetProviders(): void;
|
|
14156
14858
|
|
|
14859
|
+
/**
|
|
14860
|
+
* @fileoverview Request language resolution
|
|
14861
|
+
* @description One rule for the language of a render, shared by the server (cookie
|
|
14862
|
+
* header + Accept-Language) and the browser (document.cookie + navigator.languages),
|
|
14863
|
+
* so a server-rendered page and its hydration pick the same language.
|
|
14864
|
+
*
|
|
14865
|
+
* Order: the visitor's stored choice (language cookie) > their browser languages >
|
|
14866
|
+
* the app's fallback language.
|
|
14867
|
+
*
|
|
14868
|
+
* @version 0.1.0
|
|
14869
|
+
* @since 0.1.50
|
|
14870
|
+
* @author AMBROISE PARK Consulting
|
|
14871
|
+
*/
|
|
14872
|
+
/**
|
|
14873
|
+
* Cookie holding the visitor's language (BCP-47 code). Written by the language store
|
|
14874
|
+
* on every resolution and change; read by the server to render in that language.
|
|
14875
|
+
* Functional cookie (interface preference), no consent required.
|
|
14876
|
+
*/
|
|
14877
|
+
declare const LANGUAGE_COOKIE = "dndev-lang";
|
|
14878
|
+
/**
|
|
14879
|
+
* Value of one cookie in a `Cookie` header string (`a=1; b=2`).
|
|
14880
|
+
*
|
|
14881
|
+
* @returns The decoded value, or `null` when the cookie is absent
|
|
14882
|
+
*/
|
|
14883
|
+
declare function readCookieValue(cookieHeader: string | null | undefined, name: string): string | null;
|
|
14884
|
+
/**
|
|
14885
|
+
* Language codes of an `Accept-Language` header, most preferred first
|
|
14886
|
+
* (`fr-FR,fr;q=0.9,en;q=0.8` → `['fr-FR', 'fr', 'en']`).
|
|
14887
|
+
*/
|
|
14888
|
+
declare function parseAcceptLanguage(header: string | null | undefined): string[];
|
|
14889
|
+
/**
|
|
14890
|
+
* The language to render in.
|
|
14891
|
+
*
|
|
14892
|
+
* @param supported - Language codes the app ships
|
|
14893
|
+
* @param fallback - App fallback language (used when nothing else matches)
|
|
14894
|
+
* @param stored - The visitor's stored choice (language cookie), if any
|
|
14895
|
+
* @param preferred - The visitor's browser languages, most preferred first
|
|
14896
|
+
*/
|
|
14897
|
+
declare function resolveLanguage({ supported, fallback, stored, preferred, }: {
|
|
14898
|
+
supported: readonly string[];
|
|
14899
|
+
fallback: string;
|
|
14900
|
+
stored?: string | null;
|
|
14901
|
+
preferred?: readonly string[];
|
|
14902
|
+
}): string;
|
|
14903
|
+
|
|
14157
14904
|
/**
|
|
14158
14905
|
* Get or create a singleton backed by `globalThis.__DNDEV_SINGLETONS__`.
|
|
14159
14906
|
*
|
|
@@ -14867,7 +15614,6 @@ declare function parseServerCookie(cookieHeader: string | undefined, name: strin
|
|
|
14867
15614
|
* @since 0.0.1
|
|
14868
15615
|
* @author AMBROISE PARK Consulting
|
|
14869
15616
|
*/
|
|
14870
|
-
//# sourceMappingURL=index.d.ts.map
|
|
14871
15617
|
|
|
14872
15618
|
type index_d_AuthHardening = AuthHardening;
|
|
14873
15619
|
declare const index_d_AuthHardening: typeof AuthHardening;
|
|
@@ -14888,6 +15634,7 @@ type index_d_ErrorHandlerFunction = ErrorHandlerFunction;
|
|
|
14888
15634
|
type index_d_FilterVisibleFieldsOptions = FilterVisibleFieldsOptions;
|
|
14889
15635
|
type index_d_GetVisibleFieldsOptions = GetVisibleFieldsOptions;
|
|
14890
15636
|
type index_d_HandleErrorOptions = HandleErrorOptions;
|
|
15637
|
+
declare const index_d_LANGUAGE_COOKIE: typeof LANGUAGE_COOKIE;
|
|
14891
15638
|
type index_d_LockoutResult = LockoutResult;
|
|
14892
15639
|
type index_d_SingletonManager = SingletonManager;
|
|
14893
15640
|
declare const index_d_SingletonManager: typeof SingletonManager;
|
|
@@ -14941,11 +15688,14 @@ declare const index_d_lazyImport: typeof lazyImport;
|
|
|
14941
15688
|
declare const index_d_mapToDoNotDevError: typeof mapToDoNotDevError;
|
|
14942
15689
|
declare const index_d_maybeTranslate: typeof maybeTranslate;
|
|
14943
15690
|
declare const index_d_normalizeToISOString: typeof normalizeToISOString;
|
|
15691
|
+
declare const index_d_parseAcceptLanguage: typeof parseAcceptLanguage;
|
|
14944
15692
|
declare const index_d_parseDate: typeof parseDate;
|
|
14945
15693
|
declare const index_d_parseDateToNoonUTC: typeof parseDateToNoonUTC;
|
|
14946
15694
|
declare const index_d_parseISODate: typeof parseISODate;
|
|
14947
15695
|
declare const index_d_parseServerCookie: typeof parseServerCookie;
|
|
15696
|
+
declare const index_d_readCookieValue: typeof readCookieValue;
|
|
14948
15697
|
declare const index_d_resetProviders: typeof resetProviders;
|
|
15698
|
+
declare const index_d_resolveLanguage: typeof resolveLanguage;
|
|
14949
15699
|
declare const index_d_safeValidate: typeof safeValidate;
|
|
14950
15700
|
declare const index_d_sanitizeHref: typeof sanitizeHref;
|
|
14951
15701
|
declare const index_d_showNotification: typeof showNotification;
|
|
@@ -14971,7 +15721,7 @@ declare const index_d_wrapAuthError: typeof wrapAuthError;
|
|
|
14971
15721
|
declare const index_d_wrapCrudError: typeof wrapCrudError;
|
|
14972
15722
|
declare const index_d_wrapStorageError: typeof wrapStorageError;
|
|
14973
15723
|
declare namespace index_d {
|
|
14974
|
-
export { index_d_AuthHardening as AuthHardening, index_d_CURRENCY_MAP as CURRENCY_MAP, index_d_ConditionBuilder as ConditionBuilder, index_d_DEFAULT_CRUD_TIMEOUT as DEFAULT_CRUD_TIMEOUT, index_d_DEFAULT_ERROR_MESSAGES as DEFAULT_ERROR_MESSAGES, index_d_DEFAULT_UPLOAD_TIMEOUT as DEFAULT_UPLOAD_TIMEOUT, index_d_DoNotDevError as DoNotDevError, index_d_SingletonManager as SingletonManager, index_d_addMonths as addMonths, index_d_addYears as addYears, index_d_calculateSubscriptionEndDate as calculateSubscriptionEndDate, index_d_captureErrorToSentry as captureErrorToSentry, index_d_clearGlobalSingleton as clearGlobalSingleton, index_d_commonErrorCodeMappings as commonErrorCodeMappings, index_d_compactToISOString as compactToISOString, index_d_configureProviders as configureProviders, index_d_createAsyncSingleton as createAsyncSingleton, index_d_createErrorHandler as createErrorHandler, index_d_createMetadata as createMetadata, index_d_createMethodProxy as createMethodProxy, index_d_createSingleton as createSingleton, index_d_createSingletonWithParams as createSingletonWithParams, index_d_detectErrorSource as detectErrorSource, index_d_ensureSpreadable as ensureSpreadable, index_d_evaluateCondition as evaluateCondition, index_d_evaluateFieldConditions as evaluateFieldConditions, index_d_filterVisibleFields as filterVisibleFields, index_d_formatCurrency as formatCurrency, index_d_formatDate as formatDate, index_d_formatRelativeTime as formatRelativeTime, index_d_generateCodeChallenge as generateCodeChallenge, index_d_generateCodeVerifier as generateCodeVerifier, index_d_generateFirestoreRuleCondition as generateFirestoreRuleCondition, index_d_generatePKCEPair as generatePKCEPair, index_d_generateUUID as generateUUID, index_d_getConditionDependencies as getConditionDependencies, index_d_getCurrencyLocale as getCurrencyLocale, index_d_getCurrencySymbol as getCurrencySymbol, index_d_getCurrentTimestamp as getCurrentTimestamp, index_d_getGlobalSingleton as getGlobalSingleton, index_d_getListCardFieldNames as getListCardFieldNames, index_d_getProvider as getProvider, index_d_getRoleFromClaims as getRoleFromClaims, index_d_getVisibleFields as getVisibleFields, index_d_getWeekFromISOString as getWeekFromISOString, index_d_handleError as handleError, index_d_hasProvider as hasProvider, index_d_hasRestrictedVisibility as hasRestrictedVisibility, index_d_hasRoleAccess as hasRoleAccess, index_d_hasTierAccess as hasTierAccess, index_d_isCompactDateString as isCompactDateString, index_d_isFieldVisible as isFieldVisible, index_d_isPKCESupported as isPKCESupported, index_d_isoToCompactString as isoToCompactString, index_d_lazyImport as lazyImport, index_d_mapToDoNotDevError as mapToDoNotDevError, index_d_maybeTranslate as maybeTranslate, index_d_normalizeToISOString as normalizeToISOString, index_d_parseDate as parseDate, index_d_parseDateToNoonUTC as parseDateToNoonUTC, index_d_parseISODate as parseISODate, index_d_parseServerCookie as parseServerCookie, index_d_resetProviders as resetProviders, index_d_safeValidate as safeValidate, index_d_sanitizeHref as sanitizeHref, index_d_showNotification as showNotification, index_d_timestampToISOString as timestampToISOString, index_d_toDateOnly as toDateOnly, index_d_toISOString as toISOString, index_d_translateArray as translateArray, index_d_translateArrayRange as translateArrayRange, index_d_translateArrayWithIndices as translateArrayWithIndices, index_d_translateObjectArray as translateObjectArray, index_d_updateMetadata as updateMetadata, index_d_validateCodeChallenge as validateCodeChallenge, index_d_validateCodeVerifier as validateCodeVerifier, index_d_validateEnvVar as validateEnvVar, index_d_validateMetadata as validateMetadata, index_d_validateUrl as validateUrl, index_d_validateWithSchema as validateWithSchema, index_d_when as when, index_d_withErrorHandling as withErrorHandling, index_d_withGracefulDegradation as withGracefulDegradation, index_d_withTimeout as withTimeout, index_d_wrapAuthError as wrapAuthError, index_d_wrapCrudError as wrapCrudError, index_d_wrapStorageError as wrapStorageError };
|
|
15724
|
+
export { index_d_AuthHardening as AuthHardening, index_d_CURRENCY_MAP as CURRENCY_MAP, index_d_ConditionBuilder as ConditionBuilder, index_d_DEFAULT_CRUD_TIMEOUT as DEFAULT_CRUD_TIMEOUT, index_d_DEFAULT_ERROR_MESSAGES as DEFAULT_ERROR_MESSAGES, index_d_DEFAULT_UPLOAD_TIMEOUT as DEFAULT_UPLOAD_TIMEOUT, index_d_DoNotDevError as DoNotDevError, index_d_LANGUAGE_COOKIE as LANGUAGE_COOKIE, index_d_SingletonManager as SingletonManager, index_d_addMonths as addMonths, index_d_addYears as addYears, index_d_calculateSubscriptionEndDate as calculateSubscriptionEndDate, index_d_captureErrorToSentry as captureErrorToSentry, index_d_clearGlobalSingleton as clearGlobalSingleton, index_d_commonErrorCodeMappings as commonErrorCodeMappings, index_d_compactToISOString as compactToISOString, index_d_configureProviders as configureProviders, index_d_createAsyncSingleton as createAsyncSingleton, index_d_createErrorHandler as createErrorHandler, index_d_createMetadata as createMetadata, index_d_createMethodProxy as createMethodProxy, index_d_createSingleton as createSingleton, index_d_createSingletonWithParams as createSingletonWithParams, index_d_detectErrorSource as detectErrorSource, index_d_ensureSpreadable as ensureSpreadable, index_d_evaluateCondition as evaluateCondition, index_d_evaluateFieldConditions as evaluateFieldConditions, index_d_filterVisibleFields as filterVisibleFields, index_d_formatCurrency as formatCurrency, index_d_formatDate as formatDate, index_d_formatRelativeTime as formatRelativeTime, index_d_generateCodeChallenge as generateCodeChallenge, index_d_generateCodeVerifier as generateCodeVerifier, index_d_generateFirestoreRuleCondition as generateFirestoreRuleCondition, index_d_generatePKCEPair as generatePKCEPair, index_d_generateUUID as generateUUID, index_d_getConditionDependencies as getConditionDependencies, index_d_getCurrencyLocale as getCurrencyLocale, index_d_getCurrencySymbol as getCurrencySymbol, index_d_getCurrentTimestamp as getCurrentTimestamp, index_d_getGlobalSingleton as getGlobalSingleton, index_d_getListCardFieldNames as getListCardFieldNames, index_d_getProvider as getProvider, index_d_getRoleFromClaims as getRoleFromClaims, index_d_getVisibleFields as getVisibleFields, index_d_getWeekFromISOString as getWeekFromISOString, index_d_handleError as handleError, index_d_hasProvider as hasProvider, index_d_hasRestrictedVisibility as hasRestrictedVisibility, index_d_hasRoleAccess as hasRoleAccess, index_d_hasTierAccess as hasTierAccess, index_d_isCompactDateString as isCompactDateString, index_d_isFieldVisible as isFieldVisible, index_d_isPKCESupported as isPKCESupported, index_d_isoToCompactString as isoToCompactString, index_d_lazyImport as lazyImport, index_d_mapToDoNotDevError as mapToDoNotDevError, index_d_maybeTranslate as maybeTranslate, index_d_normalizeToISOString as normalizeToISOString, index_d_parseAcceptLanguage as parseAcceptLanguage, index_d_parseDate as parseDate, index_d_parseDateToNoonUTC as parseDateToNoonUTC, index_d_parseISODate as parseISODate, index_d_parseServerCookie as parseServerCookie, index_d_readCookieValue as readCookieValue, index_d_resetProviders as resetProviders, index_d_resolveLanguage as resolveLanguage, index_d_safeValidate as safeValidate, index_d_sanitizeHref as sanitizeHref, index_d_showNotification as showNotification, index_d_timestampToISOString as timestampToISOString, index_d_toDateOnly as toDateOnly, index_d_toISOString as toISOString, index_d_translateArray as translateArray, index_d_translateArrayRange as translateArrayRange, index_d_translateArrayWithIndices as translateArrayWithIndices, index_d_translateObjectArray as translateObjectArray, index_d_updateMetadata as updateMetadata, index_d_validateCodeChallenge as validateCodeChallenge, index_d_validateCodeVerifier as validateCodeVerifier, index_d_validateEnvVar as validateEnvVar, index_d_validateMetadata as validateMetadata, index_d_validateUrl as validateUrl, index_d_validateWithSchema as validateWithSchema, index_d_when as when, index_d_withErrorHandling as withErrorHandling, index_d_withGracefulDegradation as withGracefulDegradation, index_d_withTimeout as withTimeout, index_d_wrapAuthError as wrapAuthError, index_d_wrapCrudError as wrapCrudError, index_d_wrapStorageError as wrapStorageError };
|
|
14975
15725
|
export type { index_d_AuthHardeningConfig as AuthHardeningConfig, index_d_CurrencyEntry as CurrencyEntry, index_d_DateFormatOptions as DateFormatOptions, index_d_DateFormatPreset as DateFormatPreset, index_d_ErrorHandlerConfig as ErrorHandlerConfig, index_d_ErrorHandlerFunction as ErrorHandlerFunction, index_d_FilterVisibleFieldsOptions as FilterVisibleFieldsOptions, index_d_GetVisibleFieldsOptions as GetVisibleFieldsOptions, index_d_HandleErrorOptions as HandleErrorOptions, index_d_LockoutResult as LockoutResult };
|
|
14976
15726
|
}
|
|
14977
15727
|
|
|
@@ -15887,5 +16637,5 @@ type ValidateResult<T> = {
|
|
|
15887
16637
|
declare function validateBlock(block: unknown, opts?: ValidateBlockOptions): ValidateResult<CanvasBlock>;
|
|
15888
16638
|
declare function validateEvent(event: unknown, widgetKind: string): ValidateResult<CanvasEvent>;
|
|
15889
16639
|
|
|
15890
|
-
export { AGGREGATE_FILTER_OPERATORS, AGGREGATE_OPERATIONS, AIChatRequestSchema, AIChatResponseSchema, AIMessageSchema, AIProviderConfigSchema, AIToolCallSchema, AIToolDefinitionSchema, AIUsageSchema, AI_ERROR_CODES, AI_MODELS, AI_PROVIDERS, AI_ROLES, AI_TIERS, AI_TOKEN_PRICING, AUTH_EVENTS, AUTH_PARTNERS, AUTH_PARTNER_STATE, AuthHardening, AuthUserSchema, BACKEND_GENERATED_FIELD_NAMES, BILLING_EVENTS, BREAKPOINT_RANGES, BREAKPOINT_THRESHOLDS, BulkAcrossCycleError, BulkCollisionError, BulkDeleteIdSchema, BulkInsertSchema, BulkNotImplementedError, BulkRequestSchema, BulkResponseSchema, BulkUpdateSchema, COMMON_TIER_CONFIGS, CONFIDENCE_LEVELS, CONSENT_CATEGORY, CONTEXTS, CRUD_OPERATORS, CURRENCY_MAP, CanvasBlockSchema, CanvasEventSchema, CanvasLifetimeSchema, CanvasWidgetMetadataSchema, CheckoutSessionMetadataSchema, ConditionBuilder, CreateCheckoutSessionRequestSchema, CreateCheckoutSessionResponseSchema, CustomClaimsSchema, DEFAULT_AI_CONFIG, DEFAULT_AI_MARKUP, DEFAULT_CRUD_TIMEOUT, DEFAULT_ENTITY_ACCESS, DEFAULT_ERROR_MESSAGES, DEFAULT_LAYOUT_PRESET, DEFAULT_STATUS_OPTIONS, DEFAULT_STATUS_VALUE, DEFAULT_SUBSCRIPTION, DEFAULT_UPLOAD_TIMEOUT, DENSITY, DoNotDevError, EDITABLE, EMAIL_ERROR_CODES, EMAIL_PROVIDERS, EMAIL_VERIFICATION_STATUS, ENTITY_HOOK_ERRORS, ENVIRONMENTS, ERROR_CODES, ERROR_SEVERITY, ERROR_SOURCE, EntityHookError, FEATURES, FEATURE_CONSENT_MATRIX, FEATURE_STATUS, FIELD_TYPES, FIREBASE_ERROR_MAP, FOOTER_MODE, GITHUB_PERMISSION_LEVELS, HIDDEN_STATUSES, LAYOUT_PRESET, LIST_SCHEMA_TYPE, OAUTH_EVENTS, OAUTH_PARTNERS, ORDER_DIRECTION, PARTNER_ICONS, PAYLOAD_EVENTS, PERMISSIONS, PLATFORMS, PWA_ASSET_TYPES, PWA_DISPLAY_MODES, ProductDeclarationSchema, ProductDeclarationsSchema, ProxiedImageUrlSchema, ROUTE_SOURCES, STORAGE_SCOPES, STORAGE_TYPES, STRIPE_EVENTS, STRIPE_MODES, SUBSCRIPTION_DURATIONS, SUBSCRIPTION_STATUS, SUBSCRIPTION_TIERS, SendEmailRequestSchema, SendEmailResponseSchema, index_d as ServerUtils, SingletonManager, StripeBackConfigSchema, StripeFrontConfigSchema, StripePaymentSchema, StripeSubscriptionSchema, SubscriptionClaimsSchema, SubscriptionDataSchema, TECHNICAL_FIELD_NAMES, USER_ROLES, UserSubscriptionSchema, VISIBILITY, WebhookEventSchema, addMonths, addYears, addressSchema, arraySchema, baseFields, booleanSchema, calculateSubscriptionEndDate, captureErrorToSentry, checkGitHubAccessSchema, clearGlobalSingleton, clearSchemaGenerators, clearScopeProviders, commonErrorCodeMappings, compactToISOString, configureProviders, createAsyncSingleton, createDefaultSubscriptionClaims, createDefaultUserProfile, createEntitySchema, createErrorHandler, createMetadata, createMethodProxy, createSchemas, createSingleton, createSingletonWithParams, dateSchema, defineEntity, deleteEntitySchema, detectBulkCollisions, detectErrorSource, disconnectOAuthSchema, emailSchema, enhanceSchema, ensureSpreadable, evaluateCondition, evaluateFieldConditions, exchangeTokenSchema, fileSchema, filesSchema, filterVisibleFields, formatCurrency, formatDate, formatRelativeTime, gdprConsentSchema, generateCodeChallenge, generateCodeVerifier, generateFirestoreRuleCondition, generatePKCEPair, generateUUID, geopointSchema, getBreakpointFromWidth, getBreakpointUtils, getCollectionName, getConditionDependencies, getConnectionsSchema, getCurrencyLocale, getCurrencySymbol, getCurrentTimestamp, getEntitySchema, getGlobalSingleton, getListCardFieldNames, getProvider, getRegisteredSchemaTypes, getRegisteredScopeProviders, getRoleFromClaims, getSchemaType, getScopeValue, getVisibleFields, getWeekFromISOString, getWidget, githubPermissionSchema, githubRepoConfigSchema, grantGitHubAccessSchema, handleError, hasCustomSchemaGenerator, hasMetadata, hasProvider, hasRestrictedVisibility, hasRoleAccess, hasScopeProvider, hasTierAccess, ibanSchema, isAuthPartnerId, isBackendGeneratedField, isBreakpoint, isCompactDateString, isFieldVisible, isFrameworkField, isOAuthPartnerId, isPKCESupported, isoToCompactString, lazyImport, listEntitiesSchema, listWidgets, mapSchema, mapToDoNotDevError, maybeTranslate, multiselectSchema, neverSchema, normalizeToISOString, numberSchema, overrideFeatures, overridePaymentModes, overridePermissions, overrideSubscriptionStatus, overrideSubscriptionTiers, overrideUserRoles, parseDate, parseDateToNoonUTC, parseISODate, parseServerCookie, passwordSchema, pictureSchema, picturesSchema, priceSchema, rangeOptions, referenceSchema, refreshTokenSchema, registerSchemaGenerator, registerScopeProvider, registerUniqueConstraintValidator, registerWidget, resetProviders, revokeGitHubAccessSchema, safeValidate, sanitizeHref, selectSchema, showNotification, stringSchema, switchSchema, telSchema, textSchema, timestampToISOString, toDateOnly, toISOString, translateArray, translateArrayRange, translateArrayWithIndices, translateObjectArray, unregisterScopeProvider, updateEntitySchema, updateMetadata, urlSchema, validateAIChatRequest, validateAIChatResponse, validateAuthPartners, validateAuthSchemas, validateAuthUser, validateBillingSchemas, validateBlock, validateCheckoutSessionMetadata, validateCodeChallenge, validateCodeVerifier, validateCreateCheckoutSessionRequest, validateCreateCheckoutSessionResponse, validateCustomClaims, validateDates, validateDocument, validateEnvVar, validateEvent, validateMetadata, validateOAuthPartners, validateSendEmailRequest, validateSendEmailResponse, validateStripeBackConfig, validateStripeFrontConfig, validateSubscriptionClaims, validateSubscriptionData, validateUniqueFields, validateUrl, validateUserSubscription, validateWebhookEvent, validateWithSchema, when, withErrorHandling, withGracefulDegradation, withTimeout, wrapAuthError, wrapCrudError, wrapStorageError };
|
|
15891
|
-
export type { AIAPI, AIChatRequest, AIChatResponse, AIConfig, AICostConfig, AICostEvent, AICostRecord, AICostResult, AIErrorCode, AIMessage, AIModelPricing, AIProvider, AIProviderConfig, AIRateLimitConfig, AIRouteConfig, AITierId, AIToolCall, AIToolDefinition, AIToolParameter, AIUsage, AccountLinkResult, AccountLinkingInfo, AdminCheckHookResult, AdminClaims, AggregateConfig, AggregateFilterOperator, AggregateOperation, AggregateRequest, AggregateResponse, AnyEntity, AnyFieldValue, AnyValibotSchema, ApiResponse, AppConfig, AppCookieCategories, AppMetadata, AppProvidersProps, AssetsPluginConfig, AttemptRecord, AuditEvent, AuditEventType, AuthAPI, AuthActions, AuthConfig, AuthContextValue, AuthCoreHookResult, AuthError, AuthEventData, AuthEventKey, AuthEventName, AuthHardeningConfig, AuthHardeningContext, AuthMethod, AuthPartner, AuthPartnerHookResult, AuthPartnerId, AuthPartnerResult, AuthPartnerState, AuthProvider, AuthProviderProps, AuthRedirectHookResult, AuthRedirectOperation, AuthRedirectOptions, AuthResult, AuthState, AuthStateStore, AuthStatus, AuthTokenHookResult, AuthUser, BackendGeneratedField, BaseActions, BaseCredentials, BaseDocument, BaseEntityFields, BasePartnerState, BaseState, BaseStoreActions, BaseStoreState, BaseUserProfile, BasicUserInfo, BeforeCheckoutHook, BeforeCheckoutResult, BillingAPI, BillingAdapter, BillingErrorCode, BillingEvent, BillingEventData, BillingEventKey, BillingEventName, BillingProvider, BillingProviderConfig, BillingRedirectOperation, Breakpoint, BreakpointUtils, BuiltInFieldType, BulkAcrossBatch, BulkAcrossResult, BulkCollisionReport, BulkOperations, BulkRequest, BulkResponse, BulkResult, BusinessEntity, CachedError, CanAPI, CanvasBlock, CanvasCallerAccess, CanvasEvent, CanvasLifetime, CanvasSurface, CanvasWidgetMetadata, CanvasWidgetProps, CheckGitHubAccessRequest, CheckoutMode, CheckoutOptions, CheckoutSessionMetadata, CollectionSubscriptionCallback, ColumnDef, CommonSubscriptionFeatures, CommonTranslations, ConditionBuilderLike, ConditionExpression, ConditionGroup, ConditionInput, ConditionNode, ConditionOperator, ConditionResult, ConditionalBehavior, ConfidenceLevel, ConnectOptions, ConsentAPI, ConsentActions, ConsentCategory, ConsentState, Context, CookieOptions, CreateCheckoutSessionRequest, CreateCheckoutSessionResponse, CreateEntityData, CreateEntityRequest, CreateEntityResponse, CrudAPI, CrudCardProps, CrudConfig, CrudCreateInput, CrudDocQuery, CrudListQuery, CrudOperationOptions, CrudOperator, CurrencyEntry, CustomClaims, CustomFieldOptionsMap, CustomSchemaGenerator, CustomStoreConfig, DateFormatOptions, DateFormatPreset, DateValue, DeleteEntityRequest, DeleteEntityResponse, Density, DnDevOverride, DnDevWrapper, DndevFrameworkConfig, DndevProviders, DndevStoreApi, DoNotDevCookieCategories, DocumentSubscriptionCallback, DynamicFormRule, Editable, EffectiveConnectionType, EmailConfig, EmailErrorCode, EmailProvider, EmailRouteConfig, EmailTemplate, EmailTemplateRegistry, EmailVerificationHookResult, EmailVerificationStatus, Entity, EntityAccessConfig, EntityAccessDefaults, EntityBrowseBaseProps, EntityCardListProps, EntityDisplayRendererProps, EntityField, EntityFieldMapDefault, EntityFormRendererProps, EntityHookErrors, EntityListProps, EntityMetadata, EntityOwnershipConfig, EntityOwnershipPublicCondition, EntityRecommendationsProps, EntityRecord, EntityRowFromFields, EntityTemplateProps, EntityTranslations, EnvironmentMode, ErrorCode, ErrorHandlerConfig, ErrorHandlerFunction, ErrorSeverity, ErrorSource, ExchangeTokenParams, ExchangeTokenRequest, ExchangeTokenResponse, FaviconConfig, Feature, FeatureAccessHookResult, FeatureConsentRequirement, FeatureHookResult, FeatureId, FeatureName, FeatureStatus, FeaturesConfig, FeaturesPluginConfig, FeaturesRequiringAnyConsent, FeaturesRequiringConsent, FeaturesWithoutConsent, FieldCondition, FieldType, FieldTypeToValue, FileAsset, FilterVisibleFieldsOptions, FirebaseCallOptions, FirebaseConfig, FirestoreTimestamp, FirestoreUniqueConstraintValidator, FooterConfig, FooterMode, FooterZoneConfig, FormConfig, FormStep, FunctionCallConfig, FunctionCallContext, FunctionCallOptions, FunctionCallResult, FunctionClient, FunctionClientFactoryOptions, FunctionDefaults, FunctionEndpoint, FunctionError, FunctionLoader, FunctionMemory, FunctionMeta, FunctionPlatform, FunctionResponse, FunctionSchema, FunctionSchemas, FunctionSystem, FunctionTrigger, FunctionsConfig, GetCustomClaimsResponse, GetEntityData, GetEntityRequest, GetEntityResponse, GetUserAuthStatusResponse, GetVisibleFieldsOptions, GitHubPermission, GitHubRepoConfig, GrantGitHubAccessRequest, GroupByDefinition, HandleErrorOptions, HeaderZoneConfig, I18nConfig, I18nPluginConfig, I18nProviderProps, ICallableProvider, ICrudAdapter, ID, INetworkManager, IServerAuthAdapter, IStorageAdapter, IStorageManager, IStorageStrategy, InferEntityRow, Invoice, InvoiceItem, LanguageData, LanguageInfo, LayoutConfig, LayoutPreset, LegalCompanyInfo, LegalConfig, LegalContactInfo, LegalDirectorInfo, LegalHostingInfo, LegalJurisdictionInfo, LegalSectionsConfig, LegalWebsiteInfo, ListCardLayout, ListEntitiesRequest, ListEntitiesResponse, ListEntityData, ListOptions, ListResponse, ListSchemaType, LoadingActions, LoadingState, LockoutResult, MergedBarConfig, MergedEntityFieldMap, MetricDefinition, MobileBehaviorConfig, ModalActions, ModalState, MutableMergedEntityFieldMap, MutationResponse, NavigationRoute, NetworkCheckConfig, NetworkConnectionType, NetworkReconnectCallback, NetworkState, NetworkStatus, NetworkStatusHookResult, OAuthAPI, OAuthApiRequestOptions, OAuthCallbackHookResult, OAuthConnection, OAuthConnectionInfo, OAuthConnectionRequest, OAuthConnectionStatus, OAuthCredentials, OAuthEventData, OAuthEventKey, OAuthEventName, OAuthPartner, OAuthPartnerHookResult, OAuthPartnerId, OAuthPartnerResult, OAuthPartnerState, OAuthPurpose, OAuthRedirectOperation, OAuthRefreshRequest, OAuthRefreshResponse, OAuthResult, OAuthStoreActions, OAuthStoreState, Observable, OperationSchemas, OrderByClause, OrderDirection, PWAAssetType, PWADisplayMode, PWAPluginConfig, PageAuth, PageMeta, PaginatedQueryResult, PaginationOptions, PartnerConnectionState, PartnerIconId, PartnerId, PartnerResult, PartnerType, PayloadCacheEventData, PayloadDocument, PayloadDocumentEventData, PayloadEventKey, PayloadEventName, PayloadGlobalEventData, PayloadMediaEventData, PayloadPageRegenerationEventData, PayloadRequest, PayloadUserEventData, PaymentEventData, PaymentMethod, PaymentMethodType, PaymentMode, Permission, Picture, Platform, PresetConfig, PresetRegistry, ProcessPaymentSuccessRequest, ProcessPaymentSuccessResponse, ProductDeclaration, ProviderInstances, QueryConfig, QueryOptions, QueryOrderBy, QueryWhereClause, RateLimitBackend, RateLimitConfig, RateLimitManager, RateLimitResult, RateLimitState, RateLimiter, ReadCallback, RedirectOperation, RedirectOverlayActions, RedirectOverlayConfig, RedirectOverlayPhase, RedirectOverlayState, Reference, RefreshSubscriptionRequest, RefreshSubscriptionResponse, RegisteredWidgetBase, RemoveCustomClaimsResponse, ResolvedLayoutConfig, RevokeGitHubAccessRequest, RouteMeta, RouteSource, RoutesPluginConfig, SEOConfig, SchemaMetadata, SchemaWithVisibility, ScopeConfig, ScopeProviderFn, SecurityContext, SecurityEntityConfig, SelectOption, SendEmailRequest, SendEmailResponse, SeoMeta, ServerRateLimitConfig, ServerRateLimitResult, ServerUserRecord, SetCustomClaimsResponse, SidebarZoneConfig, SignUpMetadata, SlotContent, StatusField, StorageOptions, StorageScope, StorageType, Store, StripeBackConfig, StripeCheckoutRequest, StripeCheckoutResponse, StripeCheckoutSessionEventData, StripeConfig, StripeCustomer, StripeCustomerEventData, StripeEventData, StripeEventKey, StripeEventName, StripeFrontConfig, StripeInvoice, StripeInvoiceEventData, StripePayment, StripePaymentIntentEventData, StripePaymentMethod, StripePrice, StripeProduct, StripeProvider, StripeSubscription, StripeSubscriptionData, StripeWebhookEvent, StripeWebhookEventData, Subscription, SubscriptionClaims, SubscriptionConfig, SubscriptionData, SubscriptionDuration, SubscriptionEventData, SubscriptionHookResult, SubscriptionInfo, SubscriptionStatus, SubscriptionTier, SupportedLanguage, TechnicalField, ThemeActions, ThemeInfo, ThemeMode, ThemeState, ThemesPluginConfig, TierAccessHookResult, Timestamp, TokenInfo, TokenResponse, TokenState, TokenStatus, TranslationOptions, TranslationResource, TypedBaseFields, UIFieldOptions, UniqueConstraintValidator, UniqueKeyDefinition, UnsubscribeFn, UpdateEntityData, UpdateEntityRequest, UpdateEntityResponse, UploadOptions, UploadProgressCallback, UploadResult, UseFunctionsCallResult, UseFunctionsMutationOptions, UseFunctionsMutationResult, UseFunctionsQueryOptions, UseFunctionsQueryResult, UseTranslationOptionsEnhanced, UserContext, UserProfile, UserProviderData, UserRole, UserSubscription, ValidateBlockOptions, ValidateResult, ValidationRules, ValueTypeForField, VerifiedToken, Visibility, WebhookEvent, WebhookEventData, WhereClause, WhereOperator, WidgetDef, WithMetadata, dndevSchema };
|
|
16640
|
+
export { AGGREGATE_FILTER_OPERATORS, AGGREGATE_OPERATIONS, AIChatRequestSchema, AIChatResponseSchema, AIMessageSchema, AIProviderConfigSchema, AIToolCallSchema, AIToolDefinitionSchema, AIUsageSchema, AI_ERROR_CODES, AI_MODELS, AI_PROVIDERS, AI_ROLES, AI_TIERS, AI_TOKEN_PRICING, AUTH_EVENTS, AUTH_PARTNERS, AUTH_PARTNER_STATE, AuthHardening, AuthUserSchema, BACKEND_GENERATED_FIELD_NAMES, BILLING_EVENTS, BREAKPOINT_RANGES, BREAKPOINT_THRESHOLDS, BulkAcrossCycleError, BulkCollisionError, BulkDeleteIdSchema, BulkInsertSchema, BulkNotImplementedError, BulkRequestSchema, BulkResponseSchema, BulkUpdateSchema, COMMON_TIER_CONFIGS, CONFIDENCE_LEVELS, CONSENT_CATEGORY, CONTEXTS, CRUD_OPERATORS, CURRENCY_MAP, CanvasBlockSchema, CanvasEventSchema, CanvasLifetimeSchema, CanvasWidgetMetadataSchema, CheckoutLineItemInputSchema, CheckoutSessionMetadataSchema, ConditionBuilder, CreateCheckoutSessionRequestSchema, CreateCheckoutSessionResponseSchema, CustomClaimsSchema, DEFAULT_AI_CONFIG, DEFAULT_AI_MARKUP, DEFAULT_CRUD_TIMEOUT, DEFAULT_ENTITY_ACCESS, DEFAULT_ERROR_MESSAGES, DEFAULT_LAYOUT_PRESET, DEFAULT_STATUS_OPTIONS, DEFAULT_STATUS_VALUE, DEFAULT_SUBSCRIPTION, DEFAULT_UPLOAD_TIMEOUT, DENSITY, DoNotDevError, EDITABLE, EMAIL_ERROR_CODES, EMAIL_PROVIDERS, EMAIL_VERIFICATION_STATUS, ENTITY_HOOK_ERRORS, ENVIRONMENTS, ERROR_CODES, ERROR_SEVERITY, ERROR_SOURCE, EntityHookError, FEATURES, FEATURE_CONSENT_MATRIX, FEATURE_STATUS, FIELD_TYPES, FIREBASE_ERROR_MAP, FOOTER_MODE, GITHUB_PERMISSION_LEVELS, HIDDEN_STATUSES, LANGUAGE_COOKIE, LAYOUT_PRESET, LIST_SCHEMA_TYPE, MAX_CHECKOUT_LINE_ITEMS, MAX_SHIPPING_RATE_IDS, OAUTH_EVENTS, OAUTH_PARTNERS, ORDER_DIRECTION, PARTNER_ICONS, PAYLOAD_EVENTS, PERMISSIONS, PLATFORMS, PWA_ASSET_TYPES, PWA_DISPLAY_MODES, ProductDeclarationSchema, ProductDeclarationsSchema, ProxiedImageUrlSchema, ROUTE_SOURCES, STORAGE_SCOPES, STORAGE_TYPES, STRIPE_EVENTS, STRIPE_MODES, SUBSCRIPTION_DURATIONS, SUBSCRIPTION_STATUS, SUBSCRIPTION_TIERS, SendEmailRequestSchema, SendEmailResponseSchema, index_d as ServerUtils, SingletonManager, StripeBackConfigSchema, StripeFrontConfigSchema, StripeOrderBackSchema, StripeOrderShippingSchema, StripeOrderTaxSchema, StripePaymentSchema, StripeSubscriptionSchema, SubscriptionClaimsSchema, SubscriptionDataSchema, TECHNICAL_FIELD_NAMES, USER_ROLES, UserSubscriptionSchema, VISIBILITY, WebhookEventSchema, addMonths, addYears, addressSchema, arraySchema, baseFields, booleanSchema, calculateSubscriptionEndDate, captureErrorToSentry, checkGitHubAccessSchema, clearGlobalSingleton, clearSchemaGenerators, clearScopeProviders, commonErrorCodeMappings, compactToISOString, configureProviders, createAsyncSingleton, createDefaultSubscriptionClaims, createDefaultUserProfile, createEntitySchema, createErrorHandler, createMetadata, createMethodProxy, createSchemas, createSingleton, createSingletonWithParams, dateSchema, defineEntity, deleteEntitySchema, detectBulkCollisions, detectErrorSource, disconnectOAuthSchema, emailSchema, enhanceSchema, ensureSpreadable, evaluateCondition, evaluateFieldConditions, exchangeTokenSchema, fileSchema, filesSchema, filterVisibleFields, formatCurrency, formatDate, formatRelativeTime, gdprConsentSchema, generateCodeChallenge, generateCodeVerifier, generateFirestoreRuleCondition, generatePKCEPair, generateUUID, geopointSchema, getBreakpointFromWidth, getBreakpointUtils, getCollectionName, getConditionDependencies, getConnectionsSchema, getCurrencyLocale, getCurrencySymbol, getCurrentTimestamp, getEntitySchema, getGlobalSingleton, getListCardFieldNames, getProvider, getRegisteredSchemaTypes, getRegisteredScopeProviders, getRoleFromClaims, getSchemaType, getScopeValue, getVisibleFields, getWeekFromISOString, getWidget, githubPermissionSchema, githubRepoConfigSchema, grantGitHubAccessSchema, handleError, hasCustomSchemaGenerator, hasMetadata, hasProvider, hasRestrictedVisibility, hasRoleAccess, hasScopeProvider, hasTierAccess, ibanSchema, isAuthPartnerId, isBackendGeneratedField, isBreakpoint, isCompactDateString, isFieldVisible, isFrameworkField, isOAuthPartnerId, isPKCESupported, isoToCompactString, lazyImport, listEntitiesSchema, listWidgets, mapSchema, mapToDoNotDevError, maybeTranslate, multiselectSchema, neverSchema, normalizeToISOString, numberSchema, overrideFeatures, overridePaymentModes, overridePermissions, overrideSubscriptionStatus, overrideSubscriptionTiers, overrideUserRoles, parseAcceptLanguage, parseDate, parseDateToNoonUTC, parseISODate, parseServerCookie, passwordSchema, pictureSchema, picturesSchema, priceSchema, rangeOptions, readCookieValue, referenceSchema, refreshTokenSchema, registerSchemaGenerator, registerScopeProvider, registerUniqueConstraintValidator, registerWidget, resetProviders, resolveLanguage, revokeGitHubAccessSchema, safeValidate, sanitizeHref, selectSchema, showNotification, stringSchema, switchSchema, telSchema, textSchema, timestampToISOString, toDateOnly, toISOString, translateArray, translateArrayRange, translateArrayWithIndices, translateObjectArray, unregisterScopeProvider, updateEntitySchema, updateMetadata, urlSchema, validateAIChatRequest, validateAIChatResponse, validateAuthPartners, validateAuthSchemas, validateAuthUser, validateBillingSchemas, validateBlock, validateCheckoutSessionMetadata, validateCodeChallenge, validateCodeVerifier, validateCreateCheckoutSessionRequest, validateCreateCheckoutSessionResponse, validateCustomClaims, validateDates, validateDocument, validateEnvVar, validateEvent, validateMetadata, validateOAuthPartners, validateSendEmailRequest, validateSendEmailResponse, validateStripeBackConfig, validateStripeFrontConfig, validateSubscriptionClaims, validateSubscriptionData, validateUniqueFields, validateUrl, validateUserSubscription, validateWebhookEvent, validateWithSchema, when, withErrorHandling, withGracefulDegradation, withTimeout, wrapAuthError, wrapCrudError, wrapStorageError };
|
|
16641
|
+
export type { AIAPI, AIChatRequest, AIChatResponse, AIConfig, AICostConfig, AICostEvent, AICostRecord, AICostResult, AIErrorCode, AIMessage, AIModelPricing, AIProvider, AIProviderConfig, AIRateLimitConfig, AIRouteConfig, AITierId, AIToolCall, AIToolDefinition, AIToolParameter, AIUsage, AccountLinkResult, AccountLinkingInfo, AdminCheckHookResult, AdminClaims, AggregateConfig, AggregateFilterOperator, AggregateOperation, AggregateRequest, AggregateResponse, AnyEntity, AnyFieldValue, AnyValibotSchema, ApiResponse, AppConfig, AppCookieCategories, AppMetadata, AppProvidersProps, AssetsPluginConfig, AttemptRecord, AuditEvent, AuditEventType, AuthAPI, AuthActions, AuthConfig, AuthContextValue, AuthCoreHookResult, AuthError, AuthEventData, AuthEventKey, AuthEventName, AuthHardeningConfig, AuthHardeningContext, AuthMethod, AuthPartner, AuthPartnerHookResult, AuthPartnerId, AuthPartnerResult, AuthPartnerState, AuthProvider, AuthProviderProps, AuthRedirectHookResult, AuthRedirectOperation, AuthRedirectOptions, AuthResult, AuthSessionSnapshot, AuthState, AuthStateStore, AuthStatus, AuthTokenHookResult, AuthUser, BackendGeneratedField, BaseActions, BaseCredentials, BaseDocument, BaseEntityFields, BasePartnerState, BaseState, BaseStoreActions, BaseStoreState, BaseUserProfile, BasicUserInfo, BeforeCheckoutHook, BeforeCheckoutOptions, BeforeCheckoutResult, BillingAPI, BillingAdapter, BillingAuthProvider, BillingErrorCode, BillingEvent, BillingEventData, BillingEventKey, BillingEventName, BillingProvider, BillingProviderConfig, BillingRedirectOperation, Breakpoint, BreakpointUtils, BuiltInFieldType, BulkAcrossBatch, BulkAcrossResult, BulkCollisionReport, BulkOperations, BulkRequest, BulkResponse, BulkResult, BusinessEntity, CachedError, CanAPI, CanvasBlock, CanvasCallerAccess, CanvasEvent, CanvasLifetime, CanvasSurface, CanvasWidgetMetadata, CanvasWidgetProps, CheckGitHubAccessRequest, CheckoutAddress, CheckoutLineItemInput, CheckoutMode, CheckoutOptions, CheckoutSessionMetadata, CheckoutSessionParams, CheckoutSessionResult, CheckoutSessionSnapshot, CollectionSubscriptionCallback, ColumnDef, CommonSubscriptionFeatures, CommonTranslations, ConditionBuilderLike, ConditionExpression, ConditionGroup, ConditionInput, ConditionNode, ConditionOperator, ConditionResult, ConditionalBehavior, ConfidenceLevel, ConnectOptions, ConsentAPI, ConsentActions, ConsentCategory, ConsentState, Context, CookieOptions, CreateCheckoutSessionRequest, CreateCheckoutSessionRequestInput, CreateCheckoutSessionResponse, CreateEntityData, CreateEntityRequest, CreateEntityResponse, CrudAPI, CrudCardProps, CrudConfig, CrudCreateInput, CrudDocQuery, CrudListQuery, CrudOperationOptions, CrudOperator, CurrencyEntry, CustomClaims, CustomFieldOptionsMap, CustomSchemaGenerator, CustomStoreConfig, DateFormatOptions, DateFormatPreset, DateValue, DeleteEntityRequest, DeleteEntityResponse, Density, DnDevOverride, DnDevWrapper, DndevFrameworkConfig, DndevProviders, DndevStoreApi, DoNotDevCookieCategories, DocumentSubscriptionCallback, DynamicFormRule, Editable, EffectiveConnectionType, EmailConfig, EmailErrorCode, EmailProvider, EmailRouteConfig, EmailTemplate, EmailTemplateRegistry, EmailVerificationHookResult, EmailVerificationStatus, Entity, EntityAccessConfig, EntityAccessDefaults, EntityBrowseBaseProps, EntityCardListProps, EntityDisplayRendererProps, EntityField, EntityFieldMapDefault, EntityFormRendererProps, EntityHookErrors, EntityListProps, EntityMetadata, EntityOwnershipConfig, EntityOwnershipPublicCondition, EntityRecommendationsProps, EntityRecord, EntityRowFromFields, EntityTemplateProps, EntityTranslations, EnvironmentMode, ErrorCode, ErrorHandlerConfig, ErrorHandlerFunction, ErrorSeverity, ErrorSource, ExchangeTokenParams, ExchangeTokenRequest, ExchangeTokenResponse, FaviconConfig, Feature, FeatureAccessHookResult, FeatureConsentRequirement, FeatureHookResult, FeatureId, FeatureName, FeatureStatus, FeaturesConfig, FeaturesPluginConfig, FeaturesRequiringAnyConsent, FeaturesRequiringConsent, FeaturesWithoutConsent, FieldCondition, FieldType, FieldTypeToValue, FileAsset, FilterVisibleFieldsOptions, FirebaseCallOptions, FirebaseConfig, FirestoreTimestamp, FirestoreUniqueConstraintValidator, FooterConfig, FooterMode, FooterZoneConfig, FormConfig, FormStep, FunctionCallConfig, FunctionCallContext, FunctionCallOptions, FunctionCallResult, FunctionClient, FunctionClientFactoryOptions, FunctionDefaults, FunctionEndpoint, FunctionError, FunctionLoader, FunctionMemory, FunctionMeta, FunctionPlatform, FunctionResponse, FunctionSchema, FunctionSchemas, FunctionSystem, FunctionTrigger, FunctionsConfig, GetCustomClaimsResponse, GetEntityData, GetEntityRequest, GetEntityResponse, GetUserAuthStatusResponse, GetVisibleFieldsOptions, GitHubPermission, GitHubRepoConfig, GrantGitHubAccessRequest, GroupByDefinition, HandleErrorOptions, HeaderZoneConfig, I18nConfig, I18nPluginConfig, I18nProviderProps, ICallableProvider, ICrudAdapter, ID, INetworkManager, IServerAuthAdapter, IStorageAdapter, IStorageManager, IStorageStrategy, InferEntityRow, Invoice, InvoiceItem, LanguageData, LanguageInfo, LayoutConfig, LayoutPreset, LegalCompanyInfo, LegalConfig, LegalContactInfo, LegalDirectorInfo, LegalHostingInfo, LegalJurisdictionInfo, LegalSectionsConfig, LegalWebsiteInfo, ListCardLayout, ListEntitiesRequest, ListEntitiesResponse, ListEntityData, ListOptions, ListResponse, ListSchemaType, LoadingActions, LoadingState, LockoutResult, MergedBarConfig, MergedEntityFieldMap, MetricDefinition, MobileBehaviorConfig, ModalActions, ModalState, MutableMergedEntityFieldMap, MutationResponse, NavigationRoute, NetworkCheckConfig, NetworkConnectionType, NetworkReconnectCallback, NetworkState, NetworkStatus, NetworkStatusHookResult, OAuthAPI, OAuthApiRequestOptions, OAuthCallbackHookResult, OAuthConnection, OAuthConnectionInfo, OAuthConnectionRequest, OAuthConnectionStatus, OAuthCredentials, OAuthEventData, OAuthEventKey, OAuthEventName, OAuthPartner, OAuthPartnerHookResult, OAuthPartnerId, OAuthPartnerResult, OAuthPartnerState, OAuthPurpose, OAuthRedirectOperation, OAuthRefreshRequest, OAuthRefreshResponse, OAuthResult, OAuthStoreActions, OAuthStoreState, Observable, OperationSchemas, OrderByClause, OrderDirection, OrderHookContext, PWAAssetType, PWADisplayMode, PWAPluginConfig, PageAuth, PageMeta, PaginatedQueryResult, PaginationOptions, PaidLineItem, PartnerConnectionState, PartnerIconId, PartnerId, PartnerResult, PartnerType, PayloadCacheEventData, PayloadDocument, PayloadDocumentEventData, PayloadEventKey, PayloadEventName, PayloadGlobalEventData, PayloadMediaEventData, PayloadPageRegenerationEventData, PayloadRequest, PayloadUserEventData, PaymentEventData, PaymentMethod, PaymentMethodType, PaymentMode, Permission, Picture, Platform, PresetConfig, PresetRegistry, ProcessPaymentSuccessRequest, ProcessPaymentSuccessResponse, ProductDeclaration, ProviderInstances, QueryConfig, QueryOptions, QueryOrderBy, QueryWhereClause, RateLimitBackend, RateLimitConfig, RateLimitManager, RateLimitResult, RateLimitState, RateLimiter, ReadCallback, RedirectOperation, RedirectOverlayActions, RedirectOverlayConfig, RedirectOverlayPhase, RedirectOverlayState, Reference, RefreshSubscriptionRequest, RefreshSubscriptionResponse, RegisteredWidgetBase, RemoveCustomClaimsResponse, ResolveLineItemsContext, ResolvedLayoutConfig, ResolvedLineItem, ResolvedOrder, ResolvedOrderSession, RevokeGitHubAccessRequest, RouteMeta, RouteSource, RoutesPluginConfig, SEOConfig, SchemaMetadata, SchemaWithVisibility, ScopeConfig, ScopeProviderFn, SecurityContext, SecurityEntityConfig, SelectOption, SendEmailRequest, SendEmailResponse, SeoMeta, ServerRateLimitConfig, ServerRateLimitResult, ServerUserRecord, SetCustomClaimsResponse, SidebarZoneConfig, SignUpMetadata, SlotContent, StatusField, StorageOptions, StorageScope, StorageType, Store, StripeBackConfig, StripeCheckoutProvider, StripeCheckoutRequest, StripeCheckoutResponse, StripeCheckoutSessionEventData, StripeConfig, StripeCustomer, StripeCustomerEventData, StripeEventData, StripeEventKey, StripeEventName, StripeFrontConfig, StripeInvoice, StripeInvoiceEventData, StripeOrderBackItem, StripePayment, StripePaymentBackItem, StripePaymentIntentEventData, StripePaymentMethod, StripePrice, StripeProduct, StripeProvider, StripeSubscription, StripeSubscriptionBackItem, StripeSubscriptionData, StripeWebhookEvent, StripeWebhookEventData, Subscription, SubscriptionClaims, SubscriptionConfig, SubscriptionData, SubscriptionDuration, SubscriptionEventData, SubscriptionHookResult, SubscriptionInfo, SubscriptionStatus, SubscriptionTier, SubscriptionUpdate, SupportedLanguage, TechnicalField, ThemeActions, ThemeInfo, ThemeMode, ThemeState, ThemesPluginConfig, TierAccessHookResult, Timestamp, TokenInfo, TokenResponse, TokenState, TokenStatus, TranslationOptions, TranslationResource, TypedBaseFields, UIFieldOptions, UniqueConstraintValidator, UniqueKeyDefinition, UnsubscribeFn, UpdateEntityData, UpdateEntityRequest, UpdateEntityResponse, UpdateSubscriptionFn, UploadOptions, UploadProgressCallback, UploadResult, UseFunctionsCallResult, UseFunctionsMutationOptions, UseFunctionsMutationResult, UseFunctionsQueryOptions, UseFunctionsQueryResult, UseTranslationOptionsEnhanced, UserContext, UserProfile, UserProviderData, UserRole, UserSubscription, ValidateBlockOptions, ValidateResult, ValidationRules, ValueTypeForField, VerifiedToken, Visibility, WebhookEvent, WebhookEventData, WhereClause, WhereOperator, WidgetDef, WithMetadata, dndevSchema };
|