@peable.to/sdk 0.2.7 → 0.3.0
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/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContributionsResource = exports.WebhooksResource = exports.WEBHOOK_SIGNATURE_HEADER = exports.PeableSignatureVerificationError = exports.PeableApiError = exports.PeablePermissionError = exports.PeableInvalidRequestError = exports.PeableAuthenticationError = exports.PeableError = exports.DEFAULT_OXY_API_URL = exports.DEFAULT_GATEWAY_BASE_URL = exports.Peable = void 0;
|
|
3
|
+
exports.ContributionsResource = exports.WebhooksResource = exports.WEBHOOK_SIGNATURE_HEADER = exports.PeableSignatureVerificationError = exports.PeableApiError = exports.PeablePermissionError = exports.PeableInvalidRequestError = exports.PeableAuthenticationError = exports.PeableError = exports.DEFAULT_OXY_API_URL = exports.DEFAULT_GATEWAY_BASE_URL = exports.Peable = exports.PEABLE_BILLING_AUTHORITY_KEYS = void 0;
|
|
4
4
|
const billing_1 = require("./resources/billing");
|
|
5
|
+
/** Production Peable's pinned billing-authority public keys, by key id. */
|
|
6
|
+
var shared_types_1 = require("@peable.to/shared-types");
|
|
7
|
+
Object.defineProperty(exports, "PEABLE_BILLING_AUTHORITY_KEYS", { enumerable: true, get: function () { return shared_types_1.PEABLE_BILLING_AUTHORITY_KEYS; } });
|
|
5
8
|
// Server entry (`@peable.to/sdk`) — the merchant-authed SDK. Configured with a
|
|
6
9
|
// confidential `ApplicationCredential` (`{publicKey, secret}`), from which it
|
|
7
10
|
// mints and caches an Oxy service token, or with a caller-supplied
|
|
@@ -10,6 +10,13 @@ class BillingResource {
|
|
|
10
10
|
this.invoiceAuthorityKeys = invoiceAuthorityKeys;
|
|
11
11
|
this.taxQuoteAuthorityKeys = taxQuoteAuthorityKeys;
|
|
12
12
|
}
|
|
13
|
+
/** The rails this merchant's payers can choose between (card and other fiat
|
|
14
|
+
* providers, FairCoin), default first, with each rail's offers. Pass the
|
|
15
|
+
* payer's choice as `rail` to `ensureCustomer`; the customer's rail then
|
|
16
|
+
* carries its checkouts, subscriptions and invoices. */
|
|
17
|
+
listRails() {
|
|
18
|
+
return this.client.request('GET', '/v1/billing/rails');
|
|
19
|
+
}
|
|
13
20
|
ensureCustomer(params, options) {
|
|
14
21
|
return this.client.request('POST', '/v1/billing/customers', {
|
|
15
22
|
body: params,
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { BillingResource } from './resources/billing.js';
|
|
2
|
+
/** Production Peable's pinned billing-authority public keys, by key id. */
|
|
3
|
+
export { PEABLE_BILLING_AUTHORITY_KEYS } from '@peable.to/shared-types';
|
|
2
4
|
// Server entry (`@peable.to/sdk`) — the merchant-authed SDK. Configured with a
|
|
3
5
|
// confidential `ApplicationCredential` (`{publicKey, secret}`), from which it
|
|
4
6
|
// mints and caches an Oxy service token, or with a caller-supplied
|
|
@@ -7,6 +7,13 @@ export class BillingResource {
|
|
|
7
7
|
this.invoiceAuthorityKeys = invoiceAuthorityKeys;
|
|
8
8
|
this.taxQuoteAuthorityKeys = taxQuoteAuthorityKeys;
|
|
9
9
|
}
|
|
10
|
+
/** The rails this merchant's payers can choose between (card and other fiat
|
|
11
|
+
* providers, FairCoin), default first, with each rail's offers. Pass the
|
|
12
|
+
* payer's choice as `rail` to `ensureCustomer`; the customer's rail then
|
|
13
|
+
* carries its checkouts, subscriptions and invoices. */
|
|
14
|
+
listRails() {
|
|
15
|
+
return this.client.request('GET', '/v1/billing/rails');
|
|
16
|
+
}
|
|
10
17
|
ensureCustomer(params, options) {
|
|
11
18
|
return this.client.request('POST', '/v1/billing/customers', {
|
|
12
19
|
body: params,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BillingResource } from './resources/billing';
|
|
2
2
|
export type { BillingRequestOptions } from './resources/billing';
|
|
3
|
-
export type { CreateBillingTaxQuoteParams, BillingTaxQuote, BillingInvoiceAuthoritySource, BillingFinalInvoice, BillingFinalInvoiceAuthority, BillingFaircoinRenewalChoice, BillingFaircoinRenewalConsent, BillingFaircoinRenewalRevocation, BillingObservation, BillingCustomer, BillingHostedSession, BillingCheckoutSession, BillingCheckoutObservation, RetrieveBillingCheckoutOperationParams, BillingCheckoutOperationSource, BillingCheckoutOperationRecovery, BillingPaidInvoice, BillingInvoiceState, BillingSubscription, CreateBillingCheckoutParams, CreateBillingPortalParams, EnsureBillingCustomerParams, } from '@peable.to/shared-types';
|
|
3
|
+
export type { CreateBillingTaxQuoteParams, BillingTaxQuote, BillingInvoiceAuthoritySource, BillingFinalInvoice, BillingFinalInvoiceAuthority, BillingFaircoinRenewalChoice, BillingFaircoinRenewalConsent, BillingFaircoinRenewalRevocation, BillingObservation, BillingCustomer, BillingHostedSession, BillingCheckoutSession, BillingCheckoutObservation, RetrieveBillingCheckoutOperationParams, BillingCheckoutOperationSource, BillingCheckoutOperationRecovery, BillingPaidInvoice, BillingInvoiceState, BillingSubscription, CreateBillingCheckoutParams, CreateBillingPortalParams, EnsureBillingCustomerParams, BillingRail, BillingRailSettlement, BillingRailOffer, BillingRailOption, BillingRailList, } from '@peable.to/shared-types';
|
|
4
|
+
/** Production Peable's pinned billing-authority public keys, by key id. */
|
|
5
|
+
export { PEABLE_BILLING_AUTHORITY_KEYS } from '@peable.to/shared-types';
|
|
4
6
|
import { type PeableConfig } from './core/config';
|
|
5
7
|
import { PaymentIntentsResource } from './resources/paymentIntents';
|
|
6
8
|
import { PaymentLinksResource } from './resources/paymentLinks';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BillingTaxQuote, RetrieveBillingCheckoutOperationParams, BillingCheckoutOperationRecovery, CreateBillingTaxQuoteParams, BillingFinalInvoiceAuthority, BillingCustomer, BillingHostedSession, BillingCheckoutSession, BillingCheckoutObservation, BillingPaidInvoice, BillingInvoiceState, BillingSubscription, CreateBillingCheckoutParams, CreateBillingPortalParams, EnsureBillingCustomerParams } from '@peable.to/shared-types';
|
|
1
|
+
import type { BillingTaxQuote, RetrieveBillingCheckoutOperationParams, BillingCheckoutOperationRecovery, CreateBillingTaxQuoteParams, BillingFinalInvoiceAuthority, BillingCustomer, BillingRailList, BillingHostedSession, BillingCheckoutSession, BillingCheckoutObservation, BillingPaidInvoice, BillingInvoiceState, BillingSubscription, CreateBillingCheckoutParams, CreateBillingPortalParams, EnsureBillingCustomerParams } from '@peable.to/shared-types';
|
|
2
2
|
import type { RestClient } from '../core/client';
|
|
3
3
|
export interface BillingRequestOptions {
|
|
4
4
|
idempotencyKey: string;
|
|
@@ -9,6 +9,11 @@ export declare class BillingResource {
|
|
|
9
9
|
private readonly invoiceAuthorityKeys?;
|
|
10
10
|
private readonly taxQuoteAuthorityKeys?;
|
|
11
11
|
constructor(client: RestClient, invoiceAuthorityKeys?: Readonly<Record<string, string>> | undefined, taxQuoteAuthorityKeys?: Readonly<Record<string, string>> | undefined);
|
|
12
|
+
/** The rails this merchant's payers can choose between (card and other fiat
|
|
13
|
+
* providers, FairCoin), default first, with each rail's offers. Pass the
|
|
14
|
+
* payer's choice as `rail` to `ensureCustomer`; the customer's rail then
|
|
15
|
+
* carries its checkouts, subscriptions and invoices. */
|
|
16
|
+
listRails(): Promise<BillingRailList>;
|
|
12
17
|
ensureCustomer(params: EnsureBillingCustomerParams, options: BillingRequestOptions): Promise<BillingCustomer>;
|
|
13
18
|
/** Pass the complete signed taxQuote to opt into fiscal checkout. Peable validates
|
|
14
19
|
* its pinned authority and retains immutable evidence before creating a session.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peable.to/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Peable SDK — a Stripe-ergonomics TypeScript client over the Peable Gateway REST + realtime contract. Server entry (`@peable.to/sdk`) mints Oxy service tokens from an ApplicationCredential and exposes paymentIntents/paymentLinks/checkout.sessions/webhooks; browser entry (`@peable.to/sdk/checkout`) is the anonymous payer-side client core.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"prepublishOnly": "bun run clean && bun run build"
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@peable.to/shared-types": "0.
|
|
93
|
+
"@peable.to/shared-types": "0.4.0",
|
|
94
94
|
"qrcode-generator": "^2.0.4",
|
|
95
95
|
"socket.io-client": "^4.8.3",
|
|
96
96
|
"@peable.to/contracts": "0.1.0",
|