prettier fix

This commit is contained in:
Danel Kungla
2025-09-19 17:22:36 +03:00
parent efa94b3322
commit 0c2cfe6d18
509 changed files with 17988 additions and 9920 deletions

View File

@@ -6,9 +6,9 @@ Make sure the app installs the `@kit/billing` package before using it.
```json
{
"name": "my-app",
"dependencies": {
"@kit/billing": "*"
}
"name": "my-app",
"dependencies": {
"@kit/billing": "*"
}
}
```
```

View File

@@ -25,21 +25,32 @@ export const LineItemSchema = z
.describe('Unique identifier for the line item. Defined by the Provider.')
.min(1),
name: z
.string().describe('Name of the line item. Displayed to the user.')
.string()
.describe('Name of the line item. Displayed to the user.')
.min(1),
description: z
.string().describe('Description of the line item. Displayed to the user and will replace the auto-generated description inferred' +
' from the line item. This is useful if you want to provide a more detailed description to the user.')
.string()
.describe(
'Description of the line item. Displayed to the user and will replace the auto-generated description inferred' +
' from the line item. This is useful if you want to provide a more detailed description to the user.',
)
.optional(),
cost: z
.number().describe('Cost of the line item. Displayed to the user.')
.number()
.describe('Cost of the line item. Displayed to the user.')
.min(0),
type: LineItemTypeSchema,
unit: z
.string().describe('Unit of the line item. Displayed to the user. Example "seat" or "GB"')
.string()
.describe(
'Unit of the line item. Displayed to the user. Example "seat" or "GB"',
)
.optional(),
setupFee: z
.number().describe(`Lemon Squeezy only: If true, in addition to the cost, a setup fee will be charged.`)
.number()
.describe(
`Lemon Squeezy only: If true, in addition to the cost, a setup fee will be charged.`,
)
.positive()
.optional(),
tiers: z
@@ -78,10 +89,12 @@ export const LineItemSchema = z
export const PlanSchema = z
.object({
id: z
.string().describe('Unique identifier for the plan. Defined by yourself.')
.string()
.describe('Unique identifier for the plan. Defined by yourself.')
.min(1),
name: z
.string().describe('Name of the plan. Displayed to the user.')
.string()
.describe('Name of the plan. Displayed to the user.')
.min(1),
interval: BillingIntervalSchema.optional(),
custom: z.boolean().default(false).optional(),
@@ -106,7 +119,10 @@ export const PlanSchema = z
},
),
trialDays: z
.number().describe('Number of days for the trial period. Leave empty for no trial.')
.number()
.describe(
'Number of days for the trial period. Leave empty for no trial.',
)
.positive()
.optional(),
paymentType: PaymentTypeSchema,
@@ -188,34 +204,43 @@ export const PlanSchema = z
const ProductSchema = z
.object({
id: z
.string().describe('Unique identifier for the product. Defined by th Provider.')
.string()
.describe('Unique identifier for the product. Defined by th Provider.')
.min(1),
name: z
.string().describe('Name of the product. Displayed to the user.')
.string()
.describe('Name of the product. Displayed to the user.')
.min(1),
description: z
.string().describe('Description of the product. Displayed to the user.')
.string()
.describe('Description of the product. Displayed to the user.')
.min(1),
currency: z
.string().describe('Currency code for the product. Displayed to the user.')
.string()
.describe('Currency code for the product. Displayed to the user.')
.min(3)
.max(3),
badge: z
.string().describe('Badge for the product. Displayed to the user. Example: "Popular"')
.string()
.describe(
'Badge for the product. Displayed to the user. Example: "Popular"',
)
.optional(),
features: z
.array(
z.string(),
).describe('Features of the product. Displayed to the user.')
.array(z.string())
.describe('Features of the product. Displayed to the user.')
.nonempty(),
enableDiscountField: z
.boolean().describe('Enable discount field for the product in the checkout.')
.boolean()
.describe('Enable discount field for the product in the checkout.')
.optional(),
highlighted: z
.boolean().describe('Highlight this product. Displayed to the user.')
.boolean()
.describe('Highlight this product. Displayed to the user.')
.optional(),
hidden: z
.boolean().describe('Hide this product from being displayed to users.')
.boolean()
.describe('Hide this product from being displayed to users.')
.optional(),
plans: z.array(PlanSchema),
})

View File

@@ -1,7 +1,11 @@
import { z } from 'zod';
export const ReportBillingUsageSchema = z.object({
id: z.string().describe('The id of the usage record. For Stripe a customer ID, for LS a subscription item ID.'),
id: z
.string()
.describe(
'The id of the usage record. For Stripe a customer ID, for LS a subscription item ID.',
),
eventName: z
.string()
.describe('The name of the event that triggered the usage')

View File

@@ -24,9 +24,7 @@ export interface IHandleWebhookEventParams {
// this method is called when an invoice is paid. We don't have a specific use case for this
// but it's extremely common for credit-based systems
onInvoicePaid: (
subscription: UpsertSubscriptionParams,
) => Promise<unknown>;
onInvoicePaid: (subscription: UpsertSubscriptionParams) => Promise<unknown>;
// generic handler for any event
onEvent?: (data: unknown) => Promise<unknown>;