@onflay/node 0.2.1 → 1.0.0-staging-20261206080029
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/CHANGELOG.md +74 -0
- package/README.md +211 -48
- package/dist/chunk-4RUPPDC2.mjs +121 -0
- package/dist/chunk-4RUPPDC2.mjs.map +1 -0
- package/dist/chunk-63KSRMJG.mjs +47 -0
- package/dist/chunk-63KSRMJG.mjs.map +1 -0
- package/dist/chunk-7LYAEZCT.mjs +197 -0
- package/dist/chunk-7LYAEZCT.mjs.map +1 -0
- package/dist/chunk-A3TRCKHK.mjs +60 -0
- package/dist/chunk-A3TRCKHK.mjs.map +1 -0
- package/dist/chunk-AFAU2FH2.js +47 -0
- package/dist/chunk-AFAU2FH2.js.map +1 -0
- package/dist/chunk-DBE2YZWE.mjs +38 -0
- package/dist/chunk-DBE2YZWE.mjs.map +1 -0
- package/dist/chunk-EOHFYWFQ.mjs +154 -0
- package/dist/chunk-EOHFYWFQ.mjs.map +1 -0
- package/dist/chunk-I2IVHBFA.js +197 -0
- package/dist/chunk-I2IVHBFA.js.map +1 -0
- package/dist/chunk-J4MYKTPN.mjs +37 -0
- package/dist/chunk-J4MYKTPN.mjs.map +1 -0
- package/dist/chunk-JQPANXLV.mjs +37 -0
- package/dist/chunk-JQPANXLV.mjs.map +1 -0
- package/dist/chunk-JXP6V2P2.mjs +1057 -0
- package/dist/chunk-JXP6V2P2.mjs.map +1 -0
- package/dist/chunk-M52GW7GQ.js +1057 -0
- package/dist/chunk-M52GW7GQ.js.map +1 -0
- package/dist/chunk-MMMUKAI6.js +37 -0
- package/dist/chunk-MMMUKAI6.js.map +1 -0
- package/dist/chunk-NSR4UQLV.js +87 -0
- package/dist/chunk-NSR4UQLV.js.map +1 -0
- package/dist/chunk-SUONZUVK.js +154 -0
- package/dist/chunk-SUONZUVK.js.map +1 -0
- package/dist/chunk-T26CPULH.js +121 -0
- package/dist/chunk-T26CPULH.js.map +1 -0
- package/dist/chunk-V2XJ4GZU.js +38 -0
- package/dist/chunk-V2XJ4GZU.js.map +1 -0
- package/dist/chunk-W6AEPYUG.js +37 -0
- package/dist/chunk-W6AEPYUG.js.map +1 -0
- package/dist/chunk-YHQ7XIC6.js +60 -0
- package/dist/chunk-YHQ7XIC6.js.map +1 -0
- package/dist/chunk-YSXUZYUY.mjs +87 -0
- package/dist/chunk-YSXUZYUY.mjs.map +1 -0
- package/dist/index-C1KFW_9r.d.mts +3989 -0
- package/dist/index-C1KFW_9r.d.ts +3989 -0
- package/dist/index.d.mts +918 -0
- package/dist/index.d.ts +918 -26
- package/dist/index.js +2990 -40
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2991 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/config.d.mts +59 -0
- package/dist/lib/config.d.ts +59 -0
- package/dist/lib/config.js +15 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/config.mjs +15 -0
- package/dist/lib/config.mjs.map +1 -0
- package/dist/lib/http.d.mts +51 -0
- package/dist/lib/http.d.ts +51 -0
- package/dist/lib/http.js +13 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/http.mjs +13 -0
- package/dist/lib/http.mjs.map +1 -0
- package/dist/lib/retries.d.mts +41 -0
- package/dist/lib/retries.d.ts +41 -0
- package/dist/lib/retries.js +16 -0
- package/dist/lib/retries.js.map +1 -0
- package/dist/lib/retries.mjs +16 -0
- package/dist/lib/retries.mjs.map +1 -0
- package/dist/lib/sdks.d.mts +61 -0
- package/dist/lib/sdks.d.ts +61 -0
- package/dist/lib/sdks.js +12 -0
- package/dist/lib/sdks.js.map +1 -0
- package/dist/lib/sdks.mjs +12 -0
- package/dist/lib/sdks.mjs.map +1 -0
- package/dist/models/components/index.d.mts +1 -0
- package/dist/models/components/index.d.ts +1 -0
- package/dist/models/components/index.js +1 -0
- package/dist/models/components/index.js.map +1 -0
- package/dist/models/components/index.mjs +1 -0
- package/dist/models/components/index.mjs.map +1 -0
- package/dist/models/errors/index.d.mts +161 -0
- package/dist/models/errors/index.d.ts +161 -0
- package/dist/models/errors/index.js +29 -0
- package/dist/models/errors/index.js.map +1 -0
- package/dist/models/errors/index.mjs +29 -0
- package/dist/models/errors/index.mjs.map +1 -0
- package/dist/models/operations/index.d.mts +769 -0
- package/dist/models/operations/index.d.ts +769 -0
- package/dist/models/operations/index.js +1 -0
- package/dist/models/operations/index.js.map +1 -0
- package/dist/models/operations/index.mjs +1 -0
- package/dist/models/operations/index.mjs.map +1 -0
- package/dist/types/index.d.mts +26 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/verify-tF2BsJK6.d.mts +325 -0
- package/dist/verify-tF2BsJK6.d.ts +325 -0
- package/dist/webhooks/express.d.mts +39 -0
- package/dist/webhooks/express.d.ts +39 -0
- package/dist/webhooks/express.js +10 -0
- package/dist/webhooks/express.js.map +1 -0
- package/dist/webhooks/express.mjs +10 -0
- package/dist/webhooks/express.mjs.map +1 -0
- package/dist/webhooks/hono.d.mts +33 -0
- package/dist/webhooks/hono.d.ts +33 -0
- package/dist/webhooks/hono.js +10 -0
- package/dist/webhooks/hono.js.map +1 -0
- package/dist/webhooks/hono.mjs +10 -0
- package/dist/webhooks/hono.mjs.map +1 -0
- package/dist/webhooks/index.d.mts +34 -0
- package/dist/webhooks/index.d.ts +34 -0
- package/dist/webhooks/index.js +75 -0
- package/dist/webhooks/index.js.map +1 -0
- package/dist/webhooks/index.mjs +75 -0
- package/dist/webhooks/index.mjs.map +1 -0
- package/dist/webhooks/next.d.mts +38 -0
- package/dist/webhooks/next.d.ts +38 -0
- package/dist/webhooks/next.js +10 -0
- package/dist/webhooks/next.js.map +1 -0
- package/dist/webhooks/next.mjs +10 -0
- package/dist/webhooks/next.mjs.map +1 -0
- package/package.json +273 -14
- package/dist/client.d.ts +0 -65
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -216
- package/dist/client.js.map +0 -1
- package/dist/errors.d.ts +0 -61
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -134
- package/dist/errors.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/onflay.d.ts +0 -42
- package/dist/onflay.d.ts.map +0 -1
- package/dist/onflay.js +0 -60
- package/dist/onflay.js.map +0 -1
- package/dist/pagination.d.ts +0 -19
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pagination.js +0 -61
- package/dist/pagination.js.map +0 -1
- package/dist/resources/checkout-sessions.d.ts +0 -11
- package/dist/resources/checkout-sessions.d.ts.map +0 -1
- package/dist/resources/checkout-sessions.js +0 -20
- package/dist/resources/checkout-sessions.js.map +0 -1
- package/dist/resources/customers.d.ts +0 -17
- package/dist/resources/customers.d.ts.map +0 -1
- package/dist/resources/customers.js +0 -39
- package/dist/resources/customers.js.map +0 -1
- package/dist/resources/payments.d.ts +0 -11
- package/dist/resources/payments.d.ts.map +0 -1
- package/dist/resources/payments.js +0 -27
- package/dist/resources/payments.js.map +0 -1
- package/dist/resources/prices.d.ts +0 -24
- package/dist/resources/prices.d.ts.map +0 -1
- package/dist/resources/prices.js +0 -46
- package/dist/resources/prices.js.map +0 -1
- package/dist/resources/products.d.ts +0 -18
- package/dist/resources/products.d.ts.map +0 -1
- package/dist/resources/products.js +0 -40
- package/dist/resources/products.js.map +0 -1
- package/dist/resources/subscriptions.d.ts +0 -39
- package/dist/resources/subscriptions.d.ts.map +0 -1
- package/dist/resources/subscriptions.js +0 -62
- package/dist/resources/subscriptions.js.map +0 -1
- package/dist/resources/usage.d.ts +0 -26
- package/dist/resources/usage.d.ts.map +0 -1
- package/dist/resources/usage.js +0 -43
- package/dist/resources/usage.js.map +0 -1
- package/dist/resources/webhook-endpoints.d.ts +0 -20
- package/dist/resources/webhook-endpoints.d.ts.map +0 -1
- package/dist/resources/webhook-endpoints.js +0 -47
- package/dist/resources/webhook-endpoints.js.map +0 -1
- package/dist/types/checkout-sessions.d.ts +0 -67
- package/dist/types/checkout-sessions.d.ts.map +0 -1
- package/dist/types/checkout-sessions.js +0 -3
- package/dist/types/checkout-sessions.js.map +0 -1
- package/dist/types/customers.d.ts +0 -28
- package/dist/types/customers.d.ts.map +0 -1
- package/dist/types/customers.js +0 -3
- package/dist/types/customers.js.map +0 -1
- package/dist/types/events.d.ts +0 -95
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/events.js +0 -24
- package/dist/types/events.js.map +0 -1
- package/dist/types/payments.d.ts +0 -25
- package/dist/types/payments.d.ts.map +0 -1
- package/dist/types/payments.js +0 -3
- package/dist/types/payments.js.map +0 -1
- package/dist/types/prices.d.ts +0 -57
- package/dist/types/prices.d.ts.map +0 -1
- package/dist/types/prices.js +0 -3
- package/dist/types/prices.js.map +0 -1
- package/dist/types/products.d.ts +0 -29
- package/dist/types/products.d.ts.map +0 -1
- package/dist/types/products.js +0 -3
- package/dist/types/products.js.map +0 -1
- package/dist/types/shared.d.ts +0 -34
- package/dist/types/shared.d.ts.map +0 -1
- package/dist/types/shared.js +0 -4
- package/dist/types/shared.js.map +0 -1
- package/dist/types/subscriptions.d.ts +0 -85
- package/dist/types/subscriptions.d.ts.map +0 -1
- package/dist/types/subscriptions.js +0 -3
- package/dist/types/subscriptions.js.map +0 -1
- package/dist/types/usage.d.ts +0 -35
- package/dist/types/usage.d.ts.map +0 -1
- package/dist/types/usage.js +0 -3
- package/dist/types/usage.js.map +0 -1
- package/dist/types/webhook-endpoints.d.ts +0 -48
- package/dist/types/webhook-endpoints.d.ts.map +0 -1
- package/dist/types/webhook-endpoints.js +0 -3
- package/dist/types/webhook-endpoints.js.map +0 -1
- package/dist/version.d.ts +0 -4
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -7
- package/dist/version.js.map +0 -1
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebhookEndpointsResource = void 0;
|
|
4
|
-
const pagination_1 = require("../pagination");
|
|
5
|
-
class WebhookEndpointsResource {
|
|
6
|
-
client;
|
|
7
|
-
constructor(client) {
|
|
8
|
-
this.client = client;
|
|
9
|
-
}
|
|
10
|
-
async create(params, options) {
|
|
11
|
-
return this.client.request('POST', '/v1/webhook-endpoints', {
|
|
12
|
-
body: params,
|
|
13
|
-
...(options?.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}),
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
async retrieve(endpointId) {
|
|
17
|
-
return this.client.request('GET', `/v1/webhook-endpoints/${encodeURIComponent(endpointId)}`);
|
|
18
|
-
}
|
|
19
|
-
async update(endpointId, params) {
|
|
20
|
-
return this.client.request('PATCH', `/v1/webhook-endpoints/${encodeURIComponent(endpointId)}`, { body: params });
|
|
21
|
-
}
|
|
22
|
-
async delete(endpointId) {
|
|
23
|
-
await this.client.request('DELETE', `/v1/webhook-endpoints/${encodeURIComponent(endpointId)}`);
|
|
24
|
-
}
|
|
25
|
-
async list() {
|
|
26
|
-
return this.client.request('GET', '/v1/webhook-endpoints');
|
|
27
|
-
}
|
|
28
|
-
/** List recent deliveries from `WebhookDelivery` (used by `onflay events …`). */
|
|
29
|
-
async listDeliveries(params = {}) {
|
|
30
|
-
return this.client.request('GET', '/v1/webhook-deliveries', { query: params });
|
|
31
|
-
}
|
|
32
|
-
listAllDeliveries(params = {}) {
|
|
33
|
-
return (0, pagination_1.autoPaginate)({
|
|
34
|
-
client: this.client,
|
|
35
|
-
path: '/v1/webhook-deliveries',
|
|
36
|
-
initialParams: params,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
async getDelivery(deliveryId) {
|
|
40
|
-
return this.client.request('GET', `/v1/webhook-deliveries/${encodeURIComponent(deliveryId)}`);
|
|
41
|
-
}
|
|
42
|
-
async resendDelivery(deliveryId) {
|
|
43
|
-
return this.client.request('POST', `/v1/webhook-deliveries/${encodeURIComponent(deliveryId)}/resend`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.WebhookEndpointsResource = WebhookEndpointsResource;
|
|
47
|
-
//# sourceMappingURL=webhook-endpoints.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webhook-endpoints.js","sourceRoot":"","sources":["../../src/resources/webhook-endpoints.ts"],"names":[],"mappings":";;;AACA,8CAA6C;AAW7C,MAAa,wBAAwB;IACN;IAA7B,YAA6B,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;IAAG,CAAC;IAErD,KAAK,CAAC,MAAM,CACV,MAAmC,EACnC,OAAqC;QAErC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,uBAAuB,EACvB;YACE,IAAI,EAAE,MAAM;YACZ,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/E,CACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,UAAkB;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,yBAAyB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAC1D,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CACV,UAAkB,EAClB,MAAmC;QAEnC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,OAAO,EACP,yBAAyB,kBAAkB,CAAC,UAAU,CAAC,EAAE,EACzD,EAAE,IAAI,EAAE,MAAM,EAAE,CACjB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,UAAkB;QAC7B,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACvB,QAAQ,EACR,yBAAyB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAC1D,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,uBAAuB,CACxB,CAAC;IACJ,CAAC;IAED,iFAAiF;IACjF,KAAK,CAAC,cAAc,CAClB,SAAsC,EAAE;QAExC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,wBAAwB,EACxB,EAAE,KAAK,EAAE,MAA+D,EAAE,CAC3E,CAAC;IACJ,CAAC;IAED,iBAAiB,CACf,SAAsD,EAAE;QAExD,OAAO,IAAA,yBAAY,EAAqD;YACtE,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,wBAAwB;YAC9B,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,UAAkB;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,0BAA0B,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAC3D,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,UAAkB;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,0BAA0B,kBAAkB,CAAC,UAAU,CAAC,SAAS,CAClE,CAAC;IACJ,CAAC;CACF;AAnFD,4DAmFC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { OnflayMetadata } from './shared';
|
|
2
|
-
export interface CheckoutLineItem {
|
|
3
|
-
priceId: string;
|
|
4
|
-
quantity?: number;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* One-time price override for a specific checkout session.
|
|
8
|
-
* Useful for B2B quotes, variable-service pricing, manual discounts, and
|
|
9
|
-
* dynamic packages without creating a persistent Price record.
|
|
10
|
-
*
|
|
11
|
-
* Requires an API key (`sk_live_*` / `sk_test_*`). The buyer-facing
|
|
12
|
-
* checkout URL does not accept custom prices.
|
|
13
|
-
*/
|
|
14
|
-
export interface CustomPriceInput {
|
|
15
|
-
/** Charge amount in cents (must be >= 50 to meet Stripe's minimum). */
|
|
16
|
-
readonly unitAmountInCents: number;
|
|
17
|
-
/**
|
|
18
|
-
* Currency code. Only `'usd'` is supported in the current release.
|
|
19
|
-
* Defaults to the listing's configured currency.
|
|
20
|
-
*/
|
|
21
|
-
readonly currency?: string;
|
|
22
|
-
/** Human-readable note shown in audit logs and the webhook payload. */
|
|
23
|
-
readonly description?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface OnflayCheckoutSession {
|
|
26
|
-
id: string;
|
|
27
|
-
object: 'checkout_session';
|
|
28
|
-
url: string;
|
|
29
|
-
status: 'open' | 'complete' | 'expired';
|
|
30
|
-
paymentStatus: 'unpaid' | 'paid' | 'no_payment_required';
|
|
31
|
-
customer?: string | null;
|
|
32
|
-
amountSubtotal?: number | null;
|
|
33
|
-
amountTotal?: number | null;
|
|
34
|
-
currency?: string;
|
|
35
|
-
metadata?: OnflayMetadata;
|
|
36
|
-
successUrl?: string;
|
|
37
|
-
cancelUrl?: string;
|
|
38
|
-
createdAt: string;
|
|
39
|
-
expiresAt?: string;
|
|
40
|
-
}
|
|
41
|
-
export interface CreateCheckoutSessionParams {
|
|
42
|
-
/** Backend-supported alias when targeting a single listing/variant. */
|
|
43
|
-
listingId?: string;
|
|
44
|
-
/** Variant identifier within the targeted listing, when applicable. */
|
|
45
|
-
variantId?: string;
|
|
46
|
-
/** Stripe-style line items keyed by `priceId`. */
|
|
47
|
-
lineItems?: CheckoutLineItem[];
|
|
48
|
-
customerEmail?: string;
|
|
49
|
-
customerId?: string;
|
|
50
|
-
successUrl: string;
|
|
51
|
-
cancelUrl: string;
|
|
52
|
-
metadata?: OnflayMetadata;
|
|
53
|
-
/** Optional discount or promotion code. */
|
|
54
|
-
promotionCode?: string;
|
|
55
|
-
/** Defaults to the platform's primary currency for the listing. */
|
|
56
|
-
currency?: string;
|
|
57
|
-
/**
|
|
58
|
-
* Override the price for this specific session.
|
|
59
|
-
* The override applies only to this checkout — no persistent Price is
|
|
60
|
-
* created. Validated server-side: amount must be >= 50 cents (USD only).
|
|
61
|
-
* Only accepted when creating a session via the authenticated SDK
|
|
62
|
-
* (Bearer API key). Providing this field on the public buyer-facing
|
|
63
|
-
* checkout endpoint returns a 403.
|
|
64
|
-
*/
|
|
65
|
-
customPrice?: CustomPriceInput;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=checkout-sessions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-sessions.d.ts","sourceRoot":"","sources":["../../src/types/checkout-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,kBAAkB,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACxC,aAAa,EAAE,QAAQ,GAAG,MAAM,GAAG,qBAAqB,CAAC;IACzD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,2BAA2B;IAC1C,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-sessions.js","sourceRoot":"","sources":["../../src/types/checkout-sessions.ts"],"names":[],"mappings":""}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { OnflayMetadata } from './shared';
|
|
2
|
-
export interface OnflayCustomer {
|
|
3
|
-
id: string;
|
|
4
|
-
object: 'customer';
|
|
5
|
-
email: string | null;
|
|
6
|
-
name: string | null;
|
|
7
|
-
countryCode: string | null;
|
|
8
|
-
metadata?: OnflayMetadata;
|
|
9
|
-
createdAt: string;
|
|
10
|
-
}
|
|
11
|
-
export interface CreateCustomerParams {
|
|
12
|
-
email: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
countryCode?: string;
|
|
15
|
-
metadata?: OnflayMetadata;
|
|
16
|
-
}
|
|
17
|
-
export interface UpdateCustomerParams {
|
|
18
|
-
email?: string;
|
|
19
|
-
name?: string | null;
|
|
20
|
-
countryCode?: string | null;
|
|
21
|
-
metadata?: OnflayMetadata;
|
|
22
|
-
}
|
|
23
|
-
export interface ListCustomersParams {
|
|
24
|
-
email?: string;
|
|
25
|
-
limit?: number;
|
|
26
|
-
cursor?: string;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=customers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/types/customers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types/customers.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customers.js","sourceRoot":"","sources":["../../src/types/customers.ts"],"names":[],"mappings":""}
|
package/dist/types/events.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { OnflaySubscription } from './subscriptions';
|
|
2
|
-
import type { OnflayMetadata } from './shared';
|
|
3
|
-
/**
|
|
4
|
-
* Public webhook event names. These are the values consumers should pin
|
|
5
|
-
* their handlers to. Adding a new value here is a breaking change for
|
|
6
|
-
* receivers that exhaustively `switch` on `event.type` — bump the SDK
|
|
7
|
-
* minor and call it out in the changelog.
|
|
8
|
-
*/
|
|
9
|
-
export declare const ONFLAY_EVENT_TYPES: readonly ["payment.completed", "payment.refunded", "payout.scheduled", "payout.completed", "payout.failed", "dispute.opened", "dispute.resolved", "subscription.created", "subscription.renewed", "subscription.canceled", "subscription.expired", "subscription.dunning"];
|
|
10
|
-
export type OnflayEventType = (typeof ONFLAY_EVENT_TYPES)[number];
|
|
11
|
-
export interface OnflayWebhookEnvelope<TData = unknown> {
|
|
12
|
-
/** Public event ID (`evt_...`). */
|
|
13
|
-
id: string;
|
|
14
|
-
type: OnflayEventType | string;
|
|
15
|
-
/** Unix seconds. */
|
|
16
|
-
createdAt: number;
|
|
17
|
-
/** `false` for sandbox, `true` for production. */
|
|
18
|
-
livemode: boolean;
|
|
19
|
-
/** Schema version of `data`. */
|
|
20
|
-
apiVersion: string;
|
|
21
|
-
data: TData;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Actual runtime shape of `event.data` for `payment.completed` and
|
|
25
|
-
* `payment.refunded` events. Matches the fields emitted by
|
|
26
|
-
* `TransactionCompletedPayload` in `@onflay/contracts`.
|
|
27
|
-
*
|
|
28
|
-
* Note: the `object` field is always `"payment"` and is injected by the
|
|
29
|
-
* webhook dispatch layer.
|
|
30
|
-
*/
|
|
31
|
-
export interface PaymentEventData {
|
|
32
|
-
object: 'payment';
|
|
33
|
-
transactionId: string;
|
|
34
|
-
creatorId: string;
|
|
35
|
-
customerId: string;
|
|
36
|
-
listingId: string;
|
|
37
|
-
listingType: string;
|
|
38
|
-
/** Pre-fee charged amount in cents. */
|
|
39
|
-
grossAmountInCents: number;
|
|
40
|
-
currency: string;
|
|
41
|
-
/**
|
|
42
|
-
* True when the checkout session was created with a developer-supplied
|
|
43
|
-
* `customPrice` override via the SDK.
|
|
44
|
-
*/
|
|
45
|
-
isCustomPrice?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Variant list price at the time of checkout. Only present when
|
|
48
|
-
* `isCustomPrice` is true.
|
|
49
|
-
*/
|
|
50
|
-
basePriceInCents?: number;
|
|
51
|
-
/** Developer note passed in `customPrice.description`, if any. */
|
|
52
|
-
customPriceDescription?: string;
|
|
53
|
-
}
|
|
54
|
-
export interface PaymentRefundedEventData {
|
|
55
|
-
object: 'payment';
|
|
56
|
-
transactionId: string;
|
|
57
|
-
refundId: string;
|
|
58
|
-
creatorId: string;
|
|
59
|
-
amountInCents: number;
|
|
60
|
-
isFullRefund: boolean;
|
|
61
|
-
currency: string;
|
|
62
|
-
}
|
|
63
|
-
export interface PayoutEventData {
|
|
64
|
-
payoutId: string;
|
|
65
|
-
creatorId: string;
|
|
66
|
-
amountInCents: number;
|
|
67
|
-
externalTransferId?: string;
|
|
68
|
-
scheduledFor?: string;
|
|
69
|
-
failureReason?: string;
|
|
70
|
-
metadata?: OnflayMetadata;
|
|
71
|
-
}
|
|
72
|
-
export interface DisputeEventData {
|
|
73
|
-
disputeId: string;
|
|
74
|
-
transactionId: string;
|
|
75
|
-
externalDisputeId?: string;
|
|
76
|
-
amountInCents: number;
|
|
77
|
-
resolution?: string;
|
|
78
|
-
metadata?: OnflayMetadata;
|
|
79
|
-
}
|
|
80
|
-
export interface SubscriptionEventData extends OnflaySubscription {
|
|
81
|
-
/** Sub-event detail surfaced by the dispatch listener (e.g. dunning attempt #). */
|
|
82
|
-
detail?: Record<string, unknown>;
|
|
83
|
-
}
|
|
84
|
-
export type OnflayEvent = (OnflayWebhookEnvelope<PaymentEventData> & {
|
|
85
|
-
type: 'payment.completed';
|
|
86
|
-
}) | (OnflayWebhookEnvelope<PaymentRefundedEventData> & {
|
|
87
|
-
type: 'payment.refunded';
|
|
88
|
-
}) | (OnflayWebhookEnvelope<PayoutEventData> & {
|
|
89
|
-
type: 'payout.scheduled' | 'payout.completed' | 'payout.failed';
|
|
90
|
-
}) | (OnflayWebhookEnvelope<DisputeEventData> & {
|
|
91
|
-
type: 'dispute.opened' | 'dispute.resolved';
|
|
92
|
-
}) | (OnflayWebhookEnvelope<SubscriptionEventData> & {
|
|
93
|
-
type: 'subscription.created' | 'subscription.renewed' | 'subscription.canceled' | 'subscription.expired' | 'subscription.dunning';
|
|
94
|
-
});
|
|
95
|
-
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,4QAarB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,WAAW,qBAAqB,CAAC,KAAK,GAAG,OAAO;IACpD,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC;IAC/B,oBAAoB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,QAAQ,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,KAAK,CAAC;CACb;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,SAAS,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MA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,MAAM,WAAW,GACnB,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC,GACzE,CAAC,qBAAqB,CAAC,wBAAwB,CAAC,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAC,GAChF,CAAC,qBAAqB,CAAC,eAAe,CAAC,GAAG;IACxC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,eAAe,CAAC;CACjE,CAAC,GACF,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,GAAG;IACzC,IAAI,EAAE,gBAAgB,GAAG,kBAAkB,CAAC;CAC7C,CAAC,GACF,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,GAAG;IAC9C,IAAI,EACA,sBAAsB,GACtB,sBAAsB,GACtB,uBAAuB,GACvB,sBAAsB,GACtB,sBAAsB,CAAC;CAC5B,CAAC,CAAC"}
|
package/dist/types/events.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ONFLAY_EVENT_TYPES = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Public webhook event names. These are the values consumers should pin
|
|
6
|
-
* their handlers to. Adding a new value here is a breaking change for
|
|
7
|
-
* receivers that exhaustively `switch` on `event.type` — bump the SDK
|
|
8
|
-
* minor and call it out in the changelog.
|
|
9
|
-
*/
|
|
10
|
-
exports.ONFLAY_EVENT_TYPES = [
|
|
11
|
-
'payment.completed',
|
|
12
|
-
'payment.refunded',
|
|
13
|
-
'payout.scheduled',
|
|
14
|
-
'payout.completed',
|
|
15
|
-
'payout.failed',
|
|
16
|
-
'dispute.opened',
|
|
17
|
-
'dispute.resolved',
|
|
18
|
-
'subscription.created',
|
|
19
|
-
'subscription.renewed',
|
|
20
|
-
'subscription.canceled',
|
|
21
|
-
'subscription.expired',
|
|
22
|
-
'subscription.dunning',
|
|
23
|
-
];
|
|
24
|
-
//# sourceMappingURL=events.js.map
|
package/dist/types/events.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":";;;AAGA;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG;IAChC,mBAAmB;IACnB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,kBAAkB;IAClB,sBAAsB;IACtB,sBAAsB;IACtB,uBAAuB;IACvB,sBAAsB;IACtB,sBAAsB;CACd,CAAC"}
|
package/dist/types/payments.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { OnflayMetadata } from './shared';
|
|
2
|
-
export type PaymentStatus = 'requires_payment' | 'processing' | 'succeeded' | 'refunded' | 'partially_refunded' | 'failed' | 'canceled';
|
|
3
|
-
export interface OnflayPayment {
|
|
4
|
-
id: string;
|
|
5
|
-
object: 'payment';
|
|
6
|
-
amount: number;
|
|
7
|
-
currency: string;
|
|
8
|
-
status: PaymentStatus;
|
|
9
|
-
customerId?: string | null;
|
|
10
|
-
description?: string | null;
|
|
11
|
-
metadata?: OnflayMetadata;
|
|
12
|
-
refundedAmount?: number;
|
|
13
|
-
createdAt: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ListPaymentsParams {
|
|
16
|
-
customerId?: string;
|
|
17
|
-
status?: PaymentStatus;
|
|
18
|
-
limit?: number;
|
|
19
|
-
cursor?: string;
|
|
20
|
-
/** ISO-8601 lower bound, inclusive. */
|
|
21
|
-
createdAfter?: string;
|
|
22
|
-
/** ISO-8601 upper bound, exclusive. */
|
|
23
|
-
createdBefore?: string;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=payments.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/types/payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,MAAM,aAAa,GACrB,kBAAkB,GAClB,YAAY,GACZ,WAAW,GACX,UAAU,GACV,oBAAoB,GACpB,QAAQ,GACR,UAAU,CAAC;AAEf,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
package/dist/types/payments.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../../src/types/payments.ts"],"names":[],"mappings":""}
|
package/dist/types/prices.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { OnflayMetadata } from './shared';
|
|
2
|
-
export type BillingScheme = 'flat' | 'tiered' | 'usage_based';
|
|
3
|
-
export type TiersMode = 'graduated' | 'volume';
|
|
4
|
-
export type RecurringInterval = 'day' | 'week' | 'month' | 'year';
|
|
5
|
-
export interface RecurringConfig {
|
|
6
|
-
interval: RecurringInterval;
|
|
7
|
-
intervalCount?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface PriceTierConfig {
|
|
10
|
-
/** Inclusive upper bound for this tier (`'inf'` for the catch-all). */
|
|
11
|
-
upTo: number | 'inf';
|
|
12
|
-
unitAmountInCents: number;
|
|
13
|
-
flatAmountInCents?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface OnflayPrice {
|
|
16
|
-
id: string;
|
|
17
|
-
object: 'price';
|
|
18
|
-
product: string;
|
|
19
|
-
currency: string;
|
|
20
|
-
active: boolean;
|
|
21
|
-
billingScheme: BillingScheme;
|
|
22
|
-
unitAmount: number | null;
|
|
23
|
-
recurring?: RecurringConfig | null;
|
|
24
|
-
tiersMode?: TiersMode | null;
|
|
25
|
-
tiers?: PriceTierConfig[];
|
|
26
|
-
metadata?: OnflayMetadata;
|
|
27
|
-
createdAt: string;
|
|
28
|
-
}
|
|
29
|
-
export interface CreatePriceParams {
|
|
30
|
-
productId: string;
|
|
31
|
-
currency: string;
|
|
32
|
-
/** Required for `billingScheme: 'flat'`. */
|
|
33
|
-
unitAmountInCents?: number;
|
|
34
|
-
billingScheme?: BillingScheme;
|
|
35
|
-
tiersMode?: TiersMode;
|
|
36
|
-
tiers?: PriceTierConfig[];
|
|
37
|
-
recurring?: RecurringConfig;
|
|
38
|
-
active?: boolean;
|
|
39
|
-
metadata?: OnflayMetadata;
|
|
40
|
-
}
|
|
41
|
-
export interface UpdatePriceParams {
|
|
42
|
-
/**
|
|
43
|
-
* Note: only mutable fields are accepted. Fields that affect billing
|
|
44
|
-
* (`unitAmountInCents`, `currency`, `recurring`, tiers) are immutable
|
|
45
|
-
* once a price is referenced by a subscription. Use the catalog
|
|
46
|
-
* `apply` flow or create a fresh price when those need to change.
|
|
47
|
-
*/
|
|
48
|
-
active?: boolean;
|
|
49
|
-
metadata?: OnflayMetadata;
|
|
50
|
-
}
|
|
51
|
-
export interface ListPricesParams {
|
|
52
|
-
productId?: string;
|
|
53
|
-
active?: boolean;
|
|
54
|
-
limit?: number;
|
|
55
|
-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,CAAC;IACjB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types/prices.js
DELETED
package/dist/types/prices.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prices.js","sourceRoot":"","sources":["../../src/types/prices.ts"],"names":[],"mappings":""}
|
package/dist/types/products.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { OnflayMetadata } from './shared';
|
|
2
|
-
export interface OnflayProduct {
|
|
3
|
-
id: string;
|
|
4
|
-
object: 'product';
|
|
5
|
-
name: string;
|
|
6
|
-
description?: string | null;
|
|
7
|
-
active: boolean;
|
|
8
|
-
metadata?: OnflayMetadata;
|
|
9
|
-
createdAt: string;
|
|
10
|
-
updatedAt: string;
|
|
11
|
-
}
|
|
12
|
-
export interface CreateProductParams {
|
|
13
|
-
name: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
active?: boolean;
|
|
16
|
-
metadata?: OnflayMetadata;
|
|
17
|
-
}
|
|
18
|
-
export interface UpdateProductParams {
|
|
19
|
-
name?: string;
|
|
20
|
-
description?: string | null;
|
|
21
|
-
active?: boolean;
|
|
22
|
-
metadata?: OnflayMetadata;
|
|
23
|
-
}
|
|
24
|
-
export interface ListProductsParams {
|
|
25
|
-
active?: boolean;
|
|
26
|
-
limit?: number;
|
|
27
|
-
cursor?: string;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=products.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/types/products.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types/products.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/types/products.ts"],"names":[],"mappings":""}
|
package/dist/types/shared.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** Common types shared across resources. */
|
|
2
|
-
export interface OnflayMetadata {
|
|
3
|
-
[key: string]: string | number | boolean | null;
|
|
4
|
-
}
|
|
5
|
-
export interface PaginationParams {
|
|
6
|
-
limit?: number;
|
|
7
|
-
cursor?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface PageMeta {
|
|
10
|
-
nextCursor: string | null;
|
|
11
|
-
hasMore?: boolean;
|
|
12
|
-
total?: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Canonical paginated list shape returned by collection endpoints. Resources
|
|
16
|
-
* may also return cursor-less arrays; helpers in `pagination.ts` smooth
|
|
17
|
-
* over both shapes.
|
|
18
|
-
*/
|
|
19
|
-
export interface PaginatedList<T> {
|
|
20
|
-
data: T[];
|
|
21
|
-
meta?: PageMeta;
|
|
22
|
-
nextCursor?: string | null;
|
|
23
|
-
hasMore?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface ListIterator<T> {
|
|
26
|
-
/**
|
|
27
|
-
* Async iterable that walks every page of the list, transparently
|
|
28
|
-
* paginating until the API reports no more results.
|
|
29
|
-
*/
|
|
30
|
-
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
31
|
-
/** Materialise the entire list. Use with care on large collections. */
|
|
32
|
-
toArray(): Promise<T[]>;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/types/shared.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B;;;OAGG;IACH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;IAC3C,uEAAuE;IACvE,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CACzB"}
|
package/dist/types/shared.js
DELETED
package/dist/types/shared.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/types/shared.ts"],"names":[],"mappings":";AAAA,4CAA4C"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { OnflayMetadata } from './shared';
|
|
2
|
-
export type SubscriptionStatus = 'incomplete' | 'incomplete_expired' | 'trialing' | 'active' | 'past_due' | 'canceled' | 'unpaid' | 'paused' | 'expired';
|
|
3
|
-
export interface SubscriptionItem {
|
|
4
|
-
id: string;
|
|
5
|
-
priceId: string;
|
|
6
|
-
quantity: number;
|
|
7
|
-
}
|
|
8
|
-
export interface OnflaySubscription {
|
|
9
|
-
id: string;
|
|
10
|
-
object: 'subscription';
|
|
11
|
-
status: SubscriptionStatus;
|
|
12
|
-
customerId: string;
|
|
13
|
-
items: SubscriptionItem[];
|
|
14
|
-
currentPeriodStart: string;
|
|
15
|
-
currentPeriodEnd: string;
|
|
16
|
-
cancelAtPeriodEnd: boolean;
|
|
17
|
-
trialEnd?: string | null;
|
|
18
|
-
canceledAt?: string | null;
|
|
19
|
-
metadata?: OnflayMetadata;
|
|
20
|
-
createdAt: string;
|
|
21
|
-
}
|
|
22
|
-
export interface CreateSubscriptionParams {
|
|
23
|
-
customerId: string;
|
|
24
|
-
items: {
|
|
25
|
-
priceId: string;
|
|
26
|
-
quantity?: number;
|
|
27
|
-
}[];
|
|
28
|
-
trialDays?: number;
|
|
29
|
-
metadata?: OnflayMetadata;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Behaviour for billing changes triggered by an in-place subscription
|
|
33
|
-
* update. Mirrors Stripe's proration model and is **the** canonical knob
|
|
34
|
-
* for tier upgrades/downgrades.
|
|
35
|
-
*
|
|
36
|
-
* - `create_prorations` (default for upgrades) — issue a prorated charge
|
|
37
|
-
* or credit immediately so the customer pays for what they got.
|
|
38
|
-
* - `none` — skip prorations entirely; the new price takes effect at the
|
|
39
|
-
* next renewal. Common for downgrades you want to "schedule".
|
|
40
|
-
* - `always_invoice` — run a prorated calculation and invoice it
|
|
41
|
-
* immediately (no draft/preview step).
|
|
42
|
-
*/
|
|
43
|
-
export type ProrationBehavior = 'create_prorations' | 'none' | 'always_invoice';
|
|
44
|
-
export interface UpdateSubscriptionParams {
|
|
45
|
-
/**
|
|
46
|
-
* Replacement set of items. Items not in the new list are removed; new
|
|
47
|
-
* `priceId`s are added. Quantities default to `1`. The CLI catalog
|
|
48
|
-
* upgrade pattern composes this with the immutable-price flow.
|
|
49
|
-
*/
|
|
50
|
-
items?: {
|
|
51
|
-
priceId: string;
|
|
52
|
-
quantity?: number;
|
|
53
|
-
}[];
|
|
54
|
-
/**
|
|
55
|
-
* If `true`, the subscription will not auto-renew at the next period
|
|
56
|
-
* boundary. The customer keeps access until `currentPeriodEnd`.
|
|
57
|
-
*/
|
|
58
|
-
cancelAtPeriodEnd?: boolean;
|
|
59
|
-
/** Defaults to `create_prorations`. */
|
|
60
|
-
prorationBehavior?: ProrationBehavior;
|
|
61
|
-
/**
|
|
62
|
-
* Optional explicit proration date (ISO-8601). When omitted, the
|
|
63
|
-
* server uses the request time. Useful for back-dated upgrades when
|
|
64
|
-
* you computed the proration externally.
|
|
65
|
-
*/
|
|
66
|
-
prorationDate?: string;
|
|
67
|
-
metadata?: OnflayMetadata;
|
|
68
|
-
}
|
|
69
|
-
export interface CancelSubscriptionParams {
|
|
70
|
-
/** When `true`, cancel at the end of the current period (default). */
|
|
71
|
-
cancelAtPeriodEnd?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* When `true` (and `cancelAtPeriodEnd: false`), prorate the unused portion
|
|
74
|
-
* of the period and refund the credit balance.
|
|
75
|
-
*/
|
|
76
|
-
prorate?: boolean;
|
|
77
|
-
reason?: string;
|
|
78
|
-
}
|
|
79
|
-
export interface ListSubscriptionsParams {
|
|
80
|
-
customerId?: string;
|
|
81
|
-
status?: SubscriptionStatus;
|
|
82
|
-
limit?: number;
|
|
83
|
-
cursor?: string;
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/types/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ,oBAAoB,GACpB,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,cAAc,CAAC;IAC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B;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/types/subscriptions.ts"],"names":[],"mappings":""}
|
package/dist/types/usage.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export type MeterAggregation = 'SUM' | 'MAX' | 'LAST';
|
|
2
|
-
export interface OnflayMeter {
|
|
3
|
-
id: string;
|
|
4
|
-
object: 'meter';
|
|
5
|
-
name: string;
|
|
6
|
-
eventName: string;
|
|
7
|
-
aggregation: MeterAggregation;
|
|
8
|
-
createdAt: string;
|
|
9
|
-
}
|
|
10
|
-
export interface CreateMeterParams {
|
|
11
|
-
name: string;
|
|
12
|
-
/** Developer-facing token used in subsequent `report()` calls. */
|
|
13
|
-
eventName: string;
|
|
14
|
-
aggregation?: MeterAggregation;
|
|
15
|
-
}
|
|
16
|
-
export interface ReportUsageParams {
|
|
17
|
-
subscriptionId: string;
|
|
18
|
-
/** Either the meter id (`meter_*`) or its configured `eventName`. */
|
|
19
|
-
meter: string;
|
|
20
|
-
quantity: number;
|
|
21
|
-
timestamp?: Date | string;
|
|
22
|
-
/**
|
|
23
|
-
* Required. Stable per logical event; the server uses it (combined
|
|
24
|
-
* with the resolved meter id) to deduplicate retries.
|
|
25
|
-
*/
|
|
26
|
-
idempotencyKey: string;
|
|
27
|
-
}
|
|
28
|
-
export interface ReportUsageResponse {
|
|
29
|
-
object: 'usage_record';
|
|
30
|
-
/** Indicates the report was accepted into the buffer (not yet flushed). */
|
|
31
|
-
accepted: boolean;
|
|
32
|
-
subscriptionId: string;
|
|
33
|
-
meterId: string;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=usage.d.ts.map
|