add schema, client methods

This commit is contained in:
Shawn Erquhart
2024-11-12 18:39:18 -05:00
parent c8d6ecf16b
commit a10040f52e
11 changed files with 1862 additions and 1072 deletions

View File

@@ -39,110 +39,609 @@ export declare const internal: FilterApi<
export declare const components: {
polar: {
init: {
seedProducts: FunctionReference<
lib: {
getBenefit: FunctionReference<
"query",
"internal",
{ id: string },
{
createdAt: string;
deletable: boolean;
description: string;
id: string;
modifiedAt: string | null;
organizationId: string;
properties: Record<string, any>;
selectable: boolean;
type?: string;
} | null
>;
getBenefitGrant: FunctionReference<
"query",
"internal",
{ id: string },
{
benefitId: string;
createdAt: string;
grantedAt: string | null;
id: string;
isGranted: boolean;
isRevoked: boolean;
modifiedAt: string | null;
orderId: string | null;
properties: Record<string, any>;
revokedAt: string | null;
subscriptionId: string | null;
userId: string;
} | null
>;
getOrder: FunctionReference<
"query",
"internal",
{ id: string },
{
amount: number;
billingReason: string;
checkoutId: string | null;
createdAt: string;
currency: string;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
productId: string | null;
productPriceId: string;
subscriptionId: string | null;
taxAmount: number;
userId: string | null;
} | null
>;
getProduct: FunctionReference<
"query",
"internal",
{ id: string },
{
createdAt: string;
description: string | null;
id: string;
isArchived: boolean;
isRecurring: boolean;
medias: Array<{
checksumEtag: string | null;
checksumSha256Base64: string | null;
checksumSha256Hex: string | null;
createdAt: string;
id: string;
isUploaded: boolean;
lastModifiedAt: string | null;
mimeType: string;
name: string;
organizationId: string;
path: string;
publicUrl: string;
service?: string;
size: number;
sizeReadable: string;
storageVersion: string | null;
version: string | null;
}>;
modifiedAt: string | null;
name: string;
organizationId: string;
prices: Array<{
amountType?: string;
createdAt: string;
id: string;
isArchived: boolean;
modifiedAt: string | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: string;
type?: string;
}>;
} | null
>;
getSubscription: FunctionReference<
"query",
"internal",
{ id: string },
{
amount: number | null;
cancelAtPeriodEnd: boolean;
checkoutId: string | null;
createdAt: string;
currency: string | null;
currentPeriodEnd: string | null;
currentPeriodStart: string;
endedAt: string | null;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
priceId: string;
productId: string;
recurringInterval: string;
startedAt: string | null;
status: string;
userId: string;
} | null
>;
insertBenefit: FunctionReference<
"mutation",
"internal",
{
benefit: {
createdAt: string;
deletable: boolean;
description: string;
id: string;
modifiedAt: string | null;
organizationId: string;
properties: Record<string, any>;
selectable: boolean;
type?: string;
};
},
any
>;
insertBenefitGrant: FunctionReference<
"mutation",
"internal",
{
benefitGrant: {
benefitId: string;
createdAt: string;
grantedAt: string | null;
id: string;
isGranted: boolean;
isRevoked: boolean;
modifiedAt: string | null;
orderId: string | null;
properties: Record<string, any>;
revokedAt: string | null;
subscriptionId: string | null;
userId: string;
};
},
any
>;
insertOrder: FunctionReference<
"mutation",
"internal",
{
order: {
amount: number;
billingReason: string;
checkoutId: string | null;
createdAt: string;
currency: string;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
productId: string | null;
productPriceId: string;
subscriptionId: string | null;
taxAmount: number;
userId: string | null;
};
},
any
>;
insertProduct: FunctionReference<
"mutation",
"internal",
{
product: {
createdAt: string;
description: string | null;
id: string;
isArchived: boolean;
isRecurring: boolean;
medias: Array<{
checksumEtag: string | null;
checksumSha256Base64: string | null;
checksumSha256Hex: string | null;
createdAt: string;
id: string;
isUploaded: boolean;
lastModifiedAt: string | null;
mimeType: string;
name: string;
organizationId: string;
path: string;
publicUrl: string;
service?: string;
size: number;
sizeReadable: string;
storageVersion: string | null;
version: string | null;
}>;
modifiedAt: string | null;
name: string;
organizationId: string;
prices: Array<{
amountType?: string;
createdAt: string;
id: string;
isArchived: boolean;
modifiedAt: string | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: string;
type?: string;
}>;
};
},
any
>;
insertSubscription: FunctionReference<
"mutation",
"internal",
{
subscription: {
amount: number | null;
cancelAtPeriodEnd: boolean;
checkoutId: string | null;
createdAt: string;
currency: string | null;
currentPeriodEnd: string | null;
currentPeriodStart: string;
endedAt: string | null;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
priceId: string;
productId: string;
recurringInterval: string;
startedAt: string | null;
status: string;
userId: string;
};
},
any
>;
listBenefits: FunctionReference<
"query",
"internal",
any,
Array<{
createdAt: string;
deletable: boolean;
description: string;
id: string;
modifiedAt: string | null;
organizationId: string;
properties: Record<string, any>;
selectable: boolean;
type?: string;
}>
>;
listPlans: FunctionReference<
"query",
"internal",
{ includeArchived: boolean },
Array<{
_creationTime: number;
_id: string;
createdAt: string;
description: string | null;
id: string;
isArchived: boolean;
isRecurring: boolean;
medias: Array<{
checksumEtag: string | null;
checksumSha256Base64: string | null;
checksumSha256Hex: string | null;
createdAt: string;
id: string;
isUploaded: boolean;
lastModifiedAt: string | null;
mimeType: string;
name: string;
organizationId: string;
path: string;
publicUrl: string;
service?: string;
size: number;
sizeReadable: string;
storageVersion: string | null;
version: string | null;
}>;
modifiedAt: string | null;
name: string;
organizationId: string;
prices: Array<{
amountType?: string;
createdAt: string;
id: string;
isArchived: boolean;
modifiedAt: string | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: string;
type?: string;
}>;
}>
>;
listUserBenefitGrants: FunctionReference<
"query",
"internal",
{ userId: string },
Array<{
benefitId: string;
createdAt: string;
grantedAt: string | null;
id: string;
isGranted: boolean;
isRevoked: boolean;
modifiedAt: string | null;
orderId: string | null;
properties: Record<string, any>;
revokedAt: string | null;
subscriptionId: string | null;
userId: string;
}>
>;
listUserSubscriptions: FunctionReference<
"query",
"internal",
{ userId: string },
Array<{
_creationTime: number;
_id: string;
amount: number | null;
cancelAtPeriodEnd: boolean;
checkoutId: string | null;
createdAt: string;
currency: string | null;
currentPeriodEnd: string | null;
currentPeriodStart: string;
endedAt: string | null;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
priceId: string;
product?: {
_creationTime: number;
_id: string;
createdAt: string;
description: string | null;
id: string;
isArchived: boolean;
isRecurring: boolean;
medias: Array<{
checksumEtag: string | null;
checksumSha256Base64: string | null;
checksumSha256Hex: string | null;
createdAt: string;
id: string;
isUploaded: boolean;
lastModifiedAt: string | null;
mimeType: string;
name: string;
organizationId: string;
path: string;
publicUrl: string;
service?: string;
size: number;
sizeReadable: string;
storageVersion: string | null;
version: string | null;
}>;
modifiedAt: string | null;
name: string;
organizationId: string;
prices: Array<{
amountType?: string;
createdAt: string;
id: string;
isArchived: boolean;
modifiedAt: string | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: string;
type?: string;
}>;
};
productId: string;
recurringInterval: string;
startedAt: string | null;
status: string;
userId: string;
}>
>;
pullProducts: FunctionReference<
"action",
"internal",
{ polarAccessToken: string; polarOrganizationId: string },
any
>;
};
lib: {
createUser: FunctionReference<
updateBenefit: FunctionReference<
"mutation",
"internal",
{ userId: string },
any
>;
deleteUserSubscription: FunctionReference<
"mutation",
"internal",
{ userId: string },
any
>;
getOnboardingCheckoutUrl: FunctionReference<
"action",
"internal",
{
polarAccessToken: string;
successUrl: string;
userEmail?: string;
userId: string;
},
any
>;
getPlanByKey: FunctionReference<
"query",
"internal",
{ key: "free" | "pro" },
any
>;
getProOnboardingCheckoutUrl: FunctionReference<
"action",
"internal",
{
interval: "month" | "year";
polarAccessToken: string;
successUrl: string;
userId: string;
},
any
>;
getUser: FunctionReference<
"query",
"internal",
{ userId: string },
null | {
polarId?: string;
subscription?: {
cancelAtPeriodEnd?: boolean;
currency: "usd" | "eur";
currentPeriodEnd?: number;
currentPeriodStart?: number;
interval: "month" | "year";
localUserId: string;
planId: string;
polarId: string;
polarPriceId: string;
status: string;
benefit: {
createdAt: string;
deletable: boolean;
description: string;
id: string;
modifiedAt: string | null;
organizationId: string;
properties: Record<string, any>;
selectable: boolean;
type?: string;
};
subscriptionIsPending?: boolean;
subscriptionPendingId?: string;
userId: string;
}
>;
getUserByLocalId: FunctionReference<
"query",
"internal",
{ localUserId: string },
},
any
>;
listPlans: FunctionReference<"query", "internal", {}, any>;
replaceSubscription: FunctionReference<
updateBenefitGrant: FunctionReference<
"mutation",
"internal",
{
input: {
cancelAtPeriodEnd?: boolean;
currency: "usd" | "eur";
currentPeriodEnd?: number;
currentPeriodStart: number;
interval: "month" | "year";
benefitGrant: {
benefitId: string;
createdAt: string;
grantedAt: string | null;
id: string;
isGranted: boolean;
isRevoked: boolean;
modifiedAt: string | null;
orderId: string | null;
properties: Record<string, any>;
revokedAt: string | null;
subscriptionId: string | null;
userId: string;
};
},
any
>;
updateOrder: FunctionReference<
"mutation",
"internal",
{
order: {
amount: number;
billingReason: string;
checkoutId: string | null;
createdAt: string;
currency: string;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
productId: string | null;
productPriceId: string;
subscriptionId: string | null;
taxAmount: number;
userId: string | null;
};
},
any
>;
updateProduct: FunctionReference<
"mutation",
"internal",
{
product: {
createdAt: string;
description: string | null;
id: string;
isArchived: boolean;
isRecurring: boolean;
medias: Array<{
checksumEtag: string | null;
checksumSha256Base64: string | null;
checksumSha256Hex: string | null;
createdAt: string;
id: string;
isUploaded: boolean;
lastModifiedAt: string | null;
mimeType: string;
name: string;
organizationId: string;
path: string;
publicUrl: string;
service?: string;
size: number;
sizeReadable: string;
storageVersion: string | null;
version: string | null;
}>;
modifiedAt: string | null;
name: string;
organizationId: string;
prices: Array<{
amountType?: string;
createdAt: string;
id: string;
isArchived: boolean;
modifiedAt: string | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: string;
type?: string;
}>;
};
},
any
>;
updateProducts: FunctionReference<
"mutation",
"internal",
{
polarAccessToken: string;
products: Array<{
createdAt: string;
description: string | null;
id: string;
isArchived: boolean;
isRecurring: boolean;
medias: Array<{
checksumEtag: string | null;
checksumSha256Base64: string | null;
checksumSha256Hex: string | null;
createdAt: string;
id: string;
isUploaded: boolean;
lastModifiedAt: string | null;
mimeType: string;
name: string;
organizationId: string;
path: string;
publicUrl: string;
service?: string;
size: number;
sizeReadable: string;
storageVersion: string | null;
version: string | null;
}>;
modifiedAt: string | null;
name: string;
organizationId: string;
prices: Array<{
amountType?: string;
createdAt: string;
id: string;
isArchived: boolean;
modifiedAt: string | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: string;
type?: string;
}>;
}>;
},
any
>;
updateSubscription: FunctionReference<
"mutation",
"internal",
{
subscription: {
amount: number | null;
cancelAtPeriodEnd: boolean;
checkoutId: string | null;
createdAt: string;
currency: string | null;
currentPeriodEnd: string | null;
currentPeriodStart: string;
endedAt: string | null;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
priceId: string;
productId: string;
recurringInterval: string;
startedAt: string | null;
status: string;
userId: string;
};
localUserId: string;
subscriptionPolarId: string;
},
any
>;
setSubscriptionPending: FunctionReference<
"mutation",
"internal",
{ userId: string },
any
>;
};
};
};