update and pin polar dependencies

This commit is contained in:
Shawn Erquhart
2025-04-22 17:23:22 -04:00
parent 3bbe315e0e
commit 49d1750e47
4 changed files with 6 additions and 7 deletions

View File

@@ -93,8 +93,8 @@
"types": "./dist/commonjs/client/index.d.ts",
"module": "./dist/esm/client/index.js",
"dependencies": {
"@polar-sh/checkout": "^0.1.10",
"@polar-sh/sdk": "^0.32.3",
"@polar-sh/checkout": "0.1.10",
"@polar-sh/sdk": "0.32.11",
"buffer": "^6.0.3",
"convex-helpers": "^0.1.63",
"remeda": "^2.20.2",

View File

@@ -129,7 +129,7 @@ export class Polar<
embedOrigin: origin,
successUrl,
...(productIds.length === 1
? { productId: productIds[0] }
? { products: productIds }
: { products: productIds }),
});
}
@@ -225,8 +225,8 @@ export class Polar<
await this.sdk.subscriptions.update({
id: subscription.id,
subscriptionUpdate: {
cancelAtPeriodEnd: revokeImmediately ? null : true,
revoke: revokeImmediately ? true : null,
cancelAtPeriodEnd: revokeImmediately ? undefined : true,
revoke: revokeImmediately ? true : undefined,
},
});
}

View File

@@ -82,7 +82,7 @@ export default defineSchema(
startedAt: v.union(v.string(), v.null()),
endedAt: v.union(v.string(), v.null()),
productId: v.string(),
priceId: v.string(),
priceId: v.optional(v.string()),
checkoutId: v.union(v.string(), v.null()),
metadata: v.record(v.string(), v.any()),
customerCancellationReason: v.optional(v.union(v.string(), v.null())),

View File

@@ -80,7 +80,6 @@ export const convertToDatabaseSubscription = (
createdAt: subscription.createdAt.toISOString(),
modifiedAt: subscription.modifiedAt?.toISOString() ?? null,
productId: subscription.productId,
priceId: subscription.priceId,
checkoutId: subscription.checkoutId,
amount: subscription.amount,
currency: subscription.currency,