sendclap 0.4.0 → 0.5.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.d.ts +6 -3
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.d.ts +6 -3
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.5.0";
|
|
2
2
|
export interface ClientOptions {
|
|
3
3
|
/** Defaults to https://sendclap.com. */
|
|
4
4
|
baseUrl?: string;
|
|
@@ -73,12 +73,13 @@ export interface ValidateResult {
|
|
|
73
73
|
product?: ProductRef;
|
|
74
74
|
}
|
|
75
75
|
export interface CheckoutParams {
|
|
76
|
+
/** A `product` checkout for a subscription product comes back with `type: 'membership'`. */
|
|
76
77
|
type: 'tip' | 'product' | 'membership';
|
|
77
78
|
/** Tip amount in US dollars, 1 to 10000. */
|
|
78
79
|
amount?: number;
|
|
79
80
|
product_id?: number;
|
|
80
81
|
tier_id?: number;
|
|
81
|
-
/** Required for memberships. */
|
|
82
|
+
/** Required for memberships and subscription products (the server answers 400 `bad_request` without it). */
|
|
82
83
|
email?: string;
|
|
83
84
|
method?: 'card' | 'crypto';
|
|
84
85
|
message?: string;
|
|
@@ -205,13 +206,15 @@ export interface Product {
|
|
|
205
206
|
issues_license_key: boolean;
|
|
206
207
|
page: string;
|
|
207
208
|
x402: string | null;
|
|
209
|
+
/** `null` for a one-time product, `week`, `month` or `year` for a subscription product. */
|
|
210
|
+
interval: string | null;
|
|
208
211
|
}
|
|
209
212
|
export interface Membership {
|
|
210
213
|
id: number;
|
|
211
214
|
name: string;
|
|
212
215
|
description: string;
|
|
213
216
|
price: number;
|
|
214
|
-
currency: string;
|
|
217
|
+
currency: string; /** `week`, `month` or `year`. */
|
|
215
218
|
interval: string;
|
|
216
219
|
x402: string | null;
|
|
217
220
|
license_product_id: number | null;
|
package/dist/cjs/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.ApiClient = exports.LicenseClient = exports.NetworkError = exports.InstanceNotFoundError = exports.ActivationLimitError = exports.ExpiredLicenseError = exports.DisabledLicenseError = exports.InvalidLicenseError = exports.SendclapError = exports.VERSION = void 0;
|
|
39
39
|
exports.instanceName = instanceName;
|
|
40
|
-
exports.VERSION = '0.
|
|
40
|
+
exports.VERSION = '0.5.0';
|
|
41
41
|
const DEFAULT_BASE_URL = 'https://sendclap.com';
|
|
42
42
|
const DEFAULT_TIMEOUT_MS = 15000;
|
|
43
43
|
// ---------- errors ----------
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.5.0";
|
|
2
2
|
export interface ClientOptions {
|
|
3
3
|
/** Defaults to https://sendclap.com. */
|
|
4
4
|
baseUrl?: string;
|
|
@@ -73,12 +73,13 @@ export interface ValidateResult {
|
|
|
73
73
|
product?: ProductRef;
|
|
74
74
|
}
|
|
75
75
|
export interface CheckoutParams {
|
|
76
|
+
/** A `product` checkout for a subscription product comes back with `type: 'membership'`. */
|
|
76
77
|
type: 'tip' | 'product' | 'membership';
|
|
77
78
|
/** Tip amount in US dollars, 1 to 10000. */
|
|
78
79
|
amount?: number;
|
|
79
80
|
product_id?: number;
|
|
80
81
|
tier_id?: number;
|
|
81
|
-
/** Required for memberships. */
|
|
82
|
+
/** Required for memberships and subscription products (the server answers 400 `bad_request` without it). */
|
|
82
83
|
email?: string;
|
|
83
84
|
method?: 'card' | 'crypto';
|
|
84
85
|
message?: string;
|
|
@@ -205,13 +206,15 @@ export interface Product {
|
|
|
205
206
|
issues_license_key: boolean;
|
|
206
207
|
page: string;
|
|
207
208
|
x402: string | null;
|
|
209
|
+
/** `null` for a one-time product, `week`, `month` or `year` for a subscription product. */
|
|
210
|
+
interval: string | null;
|
|
208
211
|
}
|
|
209
212
|
export interface Membership {
|
|
210
213
|
id: number;
|
|
211
214
|
name: string;
|
|
212
215
|
description: string;
|
|
213
216
|
price: number;
|
|
214
|
-
currency: string;
|
|
217
|
+
currency: string; /** `week`, `month` or `year`. */
|
|
215
218
|
interval: string;
|
|
216
219
|
x402: string | null;
|
|
217
220
|
license_product_id: number | null;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Sendclap client for JavaScript and TypeScript: license checks for the apps you ship, and the creator REST API for your server.
|
|
2
2
|
// Zero dependencies; uses the global fetch (Node 18+, Bun, Deno, browsers, Electron).
|
|
3
|
-
export const VERSION = '0.
|
|
3
|
+
export const VERSION = '0.5.0';
|
|
4
4
|
const DEFAULT_BASE_URL = 'https://sendclap.com';
|
|
5
5
|
const DEFAULT_TIMEOUT_MS = 15000;
|
|
6
6
|
// ---------- errors ----------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sendclap",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Official Sendclap client: license key checks for the apps you ship and the creator REST API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": { "type": "git", "url": "git+https://github.com/backmeupplz/sendclap-sdk.git", "directory": "js" },
|