@dodopayments/hono 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +274 -0
- package/dist/checkout/checkout.d.ts +4 -0
- package/dist/checkout/checkout.d.ts.map +1 -0
- package/dist/customer-portal/customer-portal.d.ts +5 -0
- package/dist/customer-portal/customer-portal.d.ts.map +1 -0
- package/dist/index.cjs +3617 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3613 -0
- package/dist/index.js.map +1 -0
- package/dist/webhooks/webhooks.d.ts +4 -0
- package/dist/webhooks/webhooks.d.ts.map +1 -0
- package/package.json +57 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as hono from 'hono';
|
|
2
|
+
import { Context } from 'hono';
|
|
3
|
+
import { CheckoutHandlerConfig } from '@dodopayments/core/checkout';
|
|
4
|
+
import { ClientOptions } from 'dodopayments';
|
|
5
|
+
import { WebhookHandlerConfig } from '@dodopayments/core/webhook';
|
|
6
|
+
|
|
7
|
+
declare const Checkout: (config: CheckoutHandlerConfig) => (c: Context) => Promise<(Response & hono.TypedResponse<any, 400, "text">) | (Response & hono.TypedResponse<undefined, 302, "redirect">)>;
|
|
8
|
+
|
|
9
|
+
type CustomerPortalConfig = Pick<ClientOptions, "environment" | "bearerToken">;
|
|
10
|
+
declare const CustomerPortal: ({ bearerToken, environment, }: CustomerPortalConfig) => (c: Context) => Promise<(Response & hono.TypedResponse<undefined, 302, "redirect">) | (Response & hono.TypedResponse<"Missing customerId in query parameters", 400, "text">) | (Response & hono.TypedResponse<`Failed to create customer portal session: ${any}`, 500, "text">)>;
|
|
11
|
+
|
|
12
|
+
declare const Webhooks: ({ webhookKey, ...eventHandlers }: WebhookHandlerConfig) => (c: Context) => Promise<(Response & hono.TypedResponse<"Method not allowed. Use POST", 405, "text">) | (Response & hono.TypedResponse<string, 401, "text">) | (Response & hono.TypedResponse<"Error while verifying webhook", 500, "text">) | (Response & hono.TypedResponse<`Error parsing webhook payload: ${string}`, 400, "text">) | (Response & hono.TypedResponse<"", 200, "text">)>;
|
|
13
|
+
|
|
14
|
+
export { Checkout, CustomerPortal, Webhooks };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC"}
|