Files
polar/example/convex/_generated/api.d.ts
Shawn Erquhart a9e591fe8d rework apis, add client components (#2)
* wip

* add static example app

* wip

* wip

* use relative path for jsx import

* wip

* working with single upgrade

* add premium plus upgrade cta

* make the ctas pricing page style

* update price tiles

* wip

* add current plan state

* wip

* working checkouts

* add free tier tile

* fix cta button arrows

* fix customer model

* add dummy manage subscription button

* improve subscription manage button

* fix current plan tile state

* revoke existing subscriptions when a new subscription is created

* support upgrade, downgrade, cancel

* add downgrade buttons

* wip

* implement upgrade/cancel functionality

* add downgrade confirmation

* add upgrade confirmation

* add billing settings panel

* wip

* wip

* split out pricing panel section

* fix manage button

* wip

* working

* wip

* differentiate premium plus

* fix price for current subscription

* add prices

* add interval toggle

* wip

* set default interval for change plan screen

* simplify

* add yearly pricing

* fix upgrade/downgrade

* prompt on delete

* wip - docs

* wip

* wip - docs

* wip

* wip

* wip

* wip

* wip

* update version
2025-02-25 13:01:41 -05:00

512 lines
15 KiB
TypeScript

/* eslint-disable */
/**
* Generated `api` utility.
*
* THIS CODE IS AUTOMATICALLY GENERATED.
*
* To regenerate, run `npx convex dev`.
* @module
*/
import type * as example from "../example.js";
import type * as http from "../http.js";
import type * as seed from "../seed.js";
import type {
ApiFromModules,
FilterApi,
FunctionReference,
} from "convex/server";
/**
* A utility for referencing Convex functions in your app's API.
*
* Usage:
* ```js
* const myFunctionReference = api.myModule.myFunction;
* ```
*/
declare const fullApi: ApiFromModules<{
example: typeof example;
http: typeof http;
seed: typeof seed;
}>;
declare const fullApiWithMounts: typeof fullApi;
export declare const api: FilterApi<
typeof fullApiWithMounts,
FunctionReference<any, "public">
>;
export declare const internal: FilterApi<
typeof fullApiWithMounts,
FunctionReference<any, "internal">
>;
export declare const components: {
polar: {
lib: {
createProduct: 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?: "month" | "year" | null;
type?: string;
}>;
recurringInterval?: "month" | "year" | null;
};
},
any
>;
createSubscription: FunctionReference<
"mutation",
"internal",
{
subscription: {
amount: number | null;
cancelAtPeriodEnd: boolean;
checkoutId: string | null;
createdAt: string;
currency: string | null;
currentPeriodEnd: string | null;
currentPeriodStart: string;
customerId: string;
endedAt: string | null;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
priceId: string;
productId: string;
recurringInterval: "month" | "year" | null;
startedAt: string | null;
status: string;
};
},
any
>;
getCurrentSubscription: FunctionReference<
"query",
"internal",
{ userId: string },
{
_creationTime: number;
_id: string;
amount: number | null;
cancelAtPeriodEnd: boolean;
checkoutId: string | null;
createdAt: string;
currency: string | null;
currentPeriodEnd: string | null;
currentPeriodStart: string;
customerId: 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?: "month" | "year" | null;
type?: string;
}>;
recurringInterval?: "month" | "year" | null;
};
productId: string;
recurringInterval: "month" | "year" | null;
startedAt: string | null;
status: string;
} | null
>;
getCustomerByUserId: FunctionReference<
"query",
"internal",
{ userId: string },
{
_creationTime: number;
_id: string;
id: string;
userId: string;
} | null
>;
getProduct: FunctionReference<
"query",
"internal",
{ id: string },
{
_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?: "month" | "year" | null;
type?: string;
}>;
recurringInterval?: "month" | "year" | null;
} | null
>;
getSubscription: FunctionReference<
"query",
"internal",
{ id: string },
{
_creationTime: number;
_id: string;
amount: number | null;
cancelAtPeriodEnd: boolean;
checkoutId: string | null;
createdAt: string;
currency: string | null;
currentPeriodEnd: string | null;
currentPeriodStart: string;
customerId: string;
endedAt: string | null;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
priceId: string;
productId: string;
recurringInterval: "month" | "year" | null;
startedAt: string | null;
status: string;
} | null
>;
insertCustomer: FunctionReference<
"mutation",
"internal",
{ id: string; userId: string },
string
>;
listCustomerSubscriptions: FunctionReference<
"query",
"internal",
{ customerId: string },
Array<{
_creationTime: number;
_id: string;
amount: number | null;
cancelAtPeriodEnd: boolean;
checkoutId: string | null;
createdAt: string;
currency: string | null;
currentPeriodEnd: string | null;
currentPeriodStart: string;
customerId: string;
endedAt: string | null;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
priceId: string;
productId: string;
recurringInterval: "month" | "year" | null;
startedAt: string | null;
status: string;
}>
>;
listProducts: FunctionReference<
"query",
"internal",
{ includeArchived?: boolean },
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;
priceAmount?: number;
prices: Array<{
amountType?: string;
createdAt: string;
id: string;
isArchived: boolean;
modifiedAt: string | null;
priceAmount?: number;
priceCurrency?: string;
productId: string;
recurringInterval?: "month" | "year" | null;
type?: string;
}>;
recurringInterval?: "month" | "year" | null;
}>
>;
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;
customerId: 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?: "month" | "year" | null;
type?: string;
}>;
recurringInterval?: "month" | "year" | null;
} | null;
productId: string;
recurringInterval: "month" | "year" | null;
startedAt: string | null;
status: string;
}>
>;
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?: "month" | "year" | null;
type?: string;
}>;
recurringInterval?: "month" | "year" | null;
};
},
any
>;
updateSubscription: FunctionReference<
"mutation",
"internal",
{
subscription: {
amount: number | null;
cancelAtPeriodEnd: boolean;
checkoutId: string | null;
createdAt: string;
currency: string | null;
currentPeriodEnd: string | null;
currentPeriodStart: string;
customerId: string;
endedAt: string | null;
id: string;
metadata: Record<string, any>;
modifiedAt: string | null;
priceId: string;
productId: string;
recurringInterval: "month" | "year" | null;
startedAt: string | null;
status: string;
};
},
any
>;
upsertCustomer: FunctionReference<
"mutation",
"internal",
{ customerId: string; userId: string },
string
>;
};
};
};