Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions src/component/_generated/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
"internal",
{
product: {
benefits: Array<{
createdAt: string;
deletable: boolean;
description: string;
id: string;
metadata?: Record<string, any>;
modifiedAt: string | null;
organizationId: string;
properties?: any;
selectable: boolean;
type: string;
}>;
createdAt: string;
description: string | null;
id: string;
Expand Down Expand Up @@ -59,18 +71,28 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
organizationId: string;
prices: Array<{
amountType?: string;
capAmount?: number | null;
createdAt: string;
id: string;
isArchived: boolean;
maximumAmount?: number | null;
meter?: { id: string; name: string };
meterId?: string;
minimumAmount?: number | null;
modifiedAt: string | null;
presetAmount?: number | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: "day" | "week" | "month" | "year" | null;
seatTiers?: Array<{
maxSeats: number | null;
minSeats: number;
pricePerSeat: number;
}>;
source?: "catalog" | "ad_hoc";
type?: string;
unitAmount?: string;
}>;
recurringInterval?: "day" | "week" | "month" | "year" | null;
};
Expand Down Expand Up @@ -128,6 +150,18 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
modifiedAt: string | null;
priceId?: string;
product: {
benefits: Array<{
createdAt: string;
deletable: boolean;
description: string;
id: string;
metadata?: Record<string, any>;
modifiedAt: string | null;
organizationId: string;
properties?: any;
selectable: boolean;
type: string;
}>;
createdAt: string;
description: string | null;
id: string;
Expand Down Expand Up @@ -158,18 +192,28 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
organizationId: string;
prices: Array<{
amountType?: string;
capAmount?: number | null;
createdAt: string;
id: string;
isArchived: boolean;
maximumAmount?: number | null;
meter?: { id: string; name: string };
meterId?: string;
minimumAmount?: number | null;
modifiedAt: string | null;
presetAmount?: number | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: "day" | "week" | "month" | "year" | null;
seatTiers?: Array<{
maxSeats: number | null;
minSeats: number;
pricePerSeat: number;
}>;
source?: "catalog" | "ad_hoc";
type?: string;
unitAmount?: string;
}>;
recurringInterval?: "day" | "week" | "month" | "year" | null;
};
Expand All @@ -192,6 +236,18 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
"internal",
{ id: string },
{
benefits: Array<{
createdAt: string;
deletable: boolean;
description: string;
id: string;
metadata?: Record<string, any>;
modifiedAt: string | null;
organizationId: string;
properties?: any;
selectable: boolean;
type: string;
}>;
createdAt: string;
description: string | null;
id: string;
Expand Down Expand Up @@ -222,18 +278,28 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
organizationId: string;
prices: Array<{
amountType?: string;
capAmount?: number | null;
createdAt: string;
id: string;
isArchived: boolean;
maximumAmount?: number | null;
meter?: { id: string; name: string };
meterId?: string;
minimumAmount?: number | null;
modifiedAt: string | null;
presetAmount?: number | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: "day" | "week" | "month" | "year" | null;
seatTiers?: Array<{
maxSeats: number | null;
minSeats: number;
pricePerSeat: number;
}>;
source?: "catalog" | "ad_hoc";
type?: string;
unitAmount?: string;
}>;
recurringInterval?: "day" | "week" | "month" | "year" | null;
} | null,
Expand Down Expand Up @@ -305,6 +371,18 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
"internal",
{ includeArchived?: boolean },
Array<{
benefits: Array<{
createdAt: string;
deletable: boolean;
description: string;
id: string;
metadata?: Record<string, any>;
modifiedAt: string | null;
organizationId: string;
properties?: any;
selectable: boolean;
type: string;
}>;
createdAt: string;
description: string | null;
id: string;
Expand Down Expand Up @@ -336,18 +414,28 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
priceAmount?: number;
prices: Array<{
amountType?: string;
capAmount?: number | null;
createdAt: string;
id: string;
isArchived: boolean;
maximumAmount?: number | null;
meter?: { id: string; name: string };
meterId?: string;
minimumAmount?: number | null;
modifiedAt: string | null;
presetAmount?: number | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: "day" | "week" | "month" | "year" | null;
seatTiers?: Array<{
maxSeats: number | null;
minSeats: number;
pricePerSeat: number;
}>;
source?: "catalog" | "ad_hoc";
type?: string;
unitAmount?: string;
}>;
recurringInterval?: "day" | "week" | "month" | "year" | null;
}>,
Expand All @@ -374,6 +462,18 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
modifiedAt: string | null;
priceId?: string;
product: {
benefits: Array<{
createdAt: string;
deletable: boolean;
description: string;
id: string;
metadata?: Record<string, any>;
modifiedAt: string | null;
organizationId: string;
properties?: any;
selectable: boolean;
type: string;
}>;
createdAt: string;
description: string | null;
id: string;
Expand Down Expand Up @@ -404,18 +504,28 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
organizationId: string;
prices: Array<{
amountType?: string;
capAmount?: number | null;
createdAt: string;
id: string;
isArchived: boolean;
maximumAmount?: number | null;
meter?: { id: string; name: string };
meterId?: string;
minimumAmount?: number | null;
modifiedAt: string | null;
presetAmount?: number | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: "day" | "week" | "month" | "year" | null;
seatTiers?: Array<{
maxSeats: number | null;
minSeats: number;
pricePerSeat: number;
}>;
source?: "catalog" | "ad_hoc";
type?: string;
unitAmount?: string;
}>;
recurringInterval?: "day" | "week" | "month" | "year" | null;
} | null;
Expand All @@ -438,6 +548,18 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
"internal",
{
product: {
benefits: Array<{
createdAt: string;
deletable: boolean;
description: string;
id: string;
metadata?: Record<string, any>;
modifiedAt: string | null;
organizationId: string;
properties?: any;
selectable: boolean;
type: string;
}>;
createdAt: string;
description: string | null;
id: string;
Expand Down Expand Up @@ -468,18 +590,28 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
organizationId: string;
prices: Array<{
amountType?: string;
capAmount?: number | null;
createdAt: string;
id: string;
isArchived: boolean;
maximumAmount?: number | null;
meter?: { id: string; name: string };
meterId?: string;
minimumAmount?: number | null;
modifiedAt: string | null;
presetAmount?: number | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: "day" | "week" | "month" | "year" | null;
seatTiers?: Array<{
maxSeats: number | null;
minSeats: number;
pricePerSeat: number;
}>;
source?: "catalog" | "ad_hoc";
type?: string;
unitAmount?: string;
}>;
recurringInterval?: "day" | "week" | "month" | "year" | null;
};
Expand All @@ -493,6 +625,18 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
{
polarAccessToken: string;
products: Array<{
benefits: Array<{
createdAt: string;
deletable: boolean;
description: string;
id: string;
metadata?: Record<string, any>;
modifiedAt: string | null;
organizationId: string;
properties?: any;
selectable: boolean;
type: string;
}>;
createdAt: string;
description: string | null;
id: string;
Expand Down Expand Up @@ -523,18 +667,28 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
organizationId: string;
prices: Array<{
amountType?: string;
capAmount?: number | null;
createdAt: string;
id: string;
isArchived: boolean;
maximumAmount?: number | null;
meter?: { id: string; name: string };
meterId?: string;
minimumAmount?: number | null;
modifiedAt: string | null;
presetAmount?: number | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: "day" | "week" | "month" | "year" | null;
seatTiers?: Array<{
maxSeats: number | null;
minSeats: number;
pricePerSeat: number;
}>;
source?: "catalog" | "ad_hoc";
type?: string;
unitAmount?: string;
}>;
recurringInterval?: "day" | "week" | "month" | "year" | null;
}>;
Expand Down
35 changes: 35 additions & 0 deletions src/component/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,44 @@ export default defineSchema(
priceAmount: v.optional(v.number()),
type: v.optional(v.string()),
recurringInterval: v.optional(vRecurringInterval),
source: v.optional(
v.union(v.literal("catalog"), v.literal("ad_hoc")),
),
maximumAmount: v.optional(v.union(v.number(), v.null())),
minimumAmount: v.optional(v.union(v.number(), v.null())),
presetAmount: v.optional(v.union(v.number(), v.null())),
seatTiers: v.optional(
v.array(
v.object({
minSeats: v.number(),
maxSeats: v.union(v.number(), v.null()),
pricePerSeat: v.number(),
}),
),
),
unitAmount: v.optional(v.string()),
capAmount: v.optional(v.union(v.number(), v.null())),
meterId: v.optional(v.string()),
meter: v.optional(
v.object({
id: v.string(),
name: v.string(),
}),
),
}),
),
benefits: v.array(
v.object({
id: v.string(),
createdAt: v.string(),
modifiedAt: v.union(v.string(), v.null()),
type: v.string(),
description: v.string(),
selectable: v.boolean(),
deletable: v.boolean(),
organizationId: v.string(),
metadata: v.optional(v.record(v.string(), v.any())),
properties: v.optional(v.any()),
}),
),
medias: v.array(
Expand Down
Loading