mirror of
https://github.com/LukeHagar/polar.git
synced 2025-12-06 04:20:58 +00:00
511 lines
16 KiB
TypeScript
511 lines
16 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;
|
|
}>;
|
|
metadata?: Record<string, any>;
|
|
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;
|
|
customerCancellationComment?: string | null;
|
|
customerCancellationReason?: string | null;
|
|
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 },
|
|
{
|
|
amount: number | null;
|
|
cancelAtPeriodEnd: boolean;
|
|
checkoutId: string | null;
|
|
createdAt: string;
|
|
currency: string | null;
|
|
currentPeriodEnd: string | null;
|
|
currentPeriodStart: string;
|
|
customerCancellationComment?: string | null;
|
|
customerCancellationReason?: string | null;
|
|
customerId: string;
|
|
endedAt: string | null;
|
|
id: string;
|
|
metadata: Record<string, any>;
|
|
modifiedAt: string | null;
|
|
priceId: string;
|
|
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;
|
|
}>;
|
|
metadata?: Record<string, any>;
|
|
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 },
|
|
{ id: string; metadata?: Record<string, any>; userId: string } | 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;
|
|
}>;
|
|
metadata?: Record<string, any>;
|
|
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 },
|
|
{
|
|
amount: number | null;
|
|
cancelAtPeriodEnd: boolean;
|
|
checkoutId: string | null;
|
|
createdAt: string;
|
|
currency: string | null;
|
|
currentPeriodEnd: string | null;
|
|
currentPeriodStart: string;
|
|
customerCancellationComment?: string | null;
|
|
customerCancellationReason?: string | null;
|
|
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; metadata?: Record<string, any>; userId: string },
|
|
string
|
|
>;
|
|
listCustomerSubscriptions: FunctionReference<
|
|
"query",
|
|
"internal",
|
|
{ customerId: string },
|
|
Array<{
|
|
amount: number | null;
|
|
cancelAtPeriodEnd: boolean;
|
|
checkoutId: string | null;
|
|
createdAt: string;
|
|
currency: string | null;
|
|
currentPeriodEnd: string | null;
|
|
currentPeriodStart: string;
|
|
customerCancellationComment?: string | null;
|
|
customerCancellationReason?: string | null;
|
|
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;
|
|
}>;
|
|
metadata?: Record<string, any>;
|
|
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<{
|
|
amount: number | null;
|
|
cancelAtPeriodEnd: boolean;
|
|
checkoutId: string | null;
|
|
createdAt: string;
|
|
currency: string | null;
|
|
currentPeriodEnd: string | null;
|
|
currentPeriodStart: string;
|
|
customerCancellationComment?: string | null;
|
|
customerCancellationReason?: string | null;
|
|
customerId: string;
|
|
endedAt: string | null;
|
|
id: string;
|
|
metadata: Record<string, any>;
|
|
modifiedAt: string | null;
|
|
priceId: string;
|
|
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;
|
|
}>;
|
|
metadata?: Record<string, any>;
|
|
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;
|
|
}>;
|
|
metadata?: Record<string, any>;
|
|
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;
|
|
customerCancellationComment?: string | null;
|
|
customerCancellationReason?: string | null;
|
|
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",
|
|
{ id: string; metadata?: Record<string, any>; userId: string },
|
|
string
|
|
>;
|
|
};
|
|
};
|
|
};
|