listbee 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/README.md +552 -0
- package/dist/cjs/base-client.d.ts +65 -0
- package/dist/cjs/base-client.js +167 -0
- package/dist/cjs/base-client.js.map +1 -0
- package/dist/cjs/client.d.ts +58 -0
- package/dist/cjs/client.js +54 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/constants.d.ts +17 -0
- package/dist/cjs/constants.js +21 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/errors.d.ts +89 -0
- package/dist/cjs/errors.js +141 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/index.d.ts +26 -0
- package/dist/cjs/index.js +49 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/resources/account.d.ts +25 -0
- package/dist/cjs/resources/account.js +39 -0
- package/dist/cjs/resources/account.js.map +1 -0
- package/dist/cjs/resources/api-keys.d.ts +14 -0
- package/dist/cjs/resources/api-keys.js +26 -0
- package/dist/cjs/resources/api-keys.js.map +1 -0
- package/dist/cjs/resources/index.d.ts +7 -0
- package/dist/cjs/resources/index.js +18 -0
- package/dist/cjs/resources/index.js.map +1 -0
- package/dist/cjs/resources/listings.d.ts +70 -0
- package/dist/cjs/resources/listings.js +161 -0
- package/dist/cjs/resources/listings.js.map +1 -0
- package/dist/cjs/resources/orders.d.ts +11 -0
- package/dist/cjs/resources/orders.js +36 -0
- package/dist/cjs/resources/orders.js.map +1 -0
- package/dist/cjs/resources/signup.d.ts +16 -0
- package/dist/cjs/resources/signup.js +21 -0
- package/dist/cjs/resources/signup.js.map +1 -0
- package/dist/cjs/resources/stores.d.ts +31 -0
- package/dist/cjs/resources/stores.js +67 -0
- package/dist/cjs/resources/stores.js.map +1 -0
- package/dist/cjs/resources/stripe.d.ts +15 -0
- package/dist/cjs/resources/stripe.js +25 -0
- package/dist/cjs/resources/stripe.js.map +1 -0
- package/dist/cjs/resources/webhooks.d.ts +15 -0
- package/dist/cjs/resources/webhooks.js +55 -0
- package/dist/cjs/resources/webhooks.js.map +1 -0
- package/dist/cjs/types/account.d.ts +47 -0
- package/dist/cjs/types/account.js +6 -0
- package/dist/cjs/types/account.js.map +1 -0
- package/dist/cjs/types/api-key.d.ts +18 -0
- package/dist/cjs/types/api-key.js +6 -0
- package/dist/cjs/types/api-key.js.map +1 -0
- package/dist/cjs/types/index.d.ts +10 -0
- package/dist/cjs/types/index.js +10 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/listing.d.ts +177 -0
- package/dist/cjs/types/listing.js +6 -0
- package/dist/cjs/types/listing.js.map +1 -0
- package/dist/cjs/types/order.d.ts +42 -0
- package/dist/cjs/types/order.js +6 -0
- package/dist/cjs/types/order.js.map +1 -0
- package/dist/cjs/types/shared.d.ts +87 -0
- package/dist/cjs/types/shared.js +41 -0
- package/dist/cjs/types/shared.js.map +1 -0
- package/dist/cjs/types/signup.d.ts +24 -0
- package/dist/cjs/types/signup.js +6 -0
- package/dist/cjs/types/signup.js.map +1 -0
- package/dist/cjs/types/store.d.ts +70 -0
- package/dist/cjs/types/store.js +6 -0
- package/dist/cjs/types/store.js.map +1 -0
- package/dist/cjs/types/stripe.d.ts +12 -0
- package/dist/cjs/types/stripe.js +6 -0
- package/dist/cjs/types/stripe.js.map +1 -0
- package/dist/cjs/types/webhook.d.ts +88 -0
- package/dist/cjs/types/webhook.js +6 -0
- package/dist/cjs/types/webhook.js.map +1 -0
- package/dist/esm/base-client.d.ts +65 -0
- package/dist/esm/base-client.js +159 -0
- package/dist/esm/base-client.js.map +1 -0
- package/dist/esm/client.d.ts +58 -0
- package/dist/esm/client.js +50 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/constants.d.ts +17 -0
- package/dist/esm/constants.js +18 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/errors.d.ts +89 -0
- package/dist/esm/errors.js +124 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/index.d.ts +26 -0
- package/dist/esm/index.js +20 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/resources/account.d.ts +25 -0
- package/dist/esm/resources/account.js +35 -0
- package/dist/esm/resources/account.js.map +1 -0
- package/dist/esm/resources/api-keys.d.ts +14 -0
- package/dist/esm/resources/api-keys.js +21 -0
- package/dist/esm/resources/api-keys.js.map +1 -0
- package/dist/esm/resources/index.d.ts +7 -0
- package/dist/esm/resources/index.js +8 -0
- package/dist/esm/resources/index.js.map +1 -0
- package/dist/esm/resources/listings.d.ts +70 -0
- package/dist/esm/resources/listings.js +156 -0
- package/dist/esm/resources/listings.js.map +1 -0
- package/dist/esm/resources/orders.d.ts +11 -0
- package/dist/esm/resources/orders.js +31 -0
- package/dist/esm/resources/orders.js.map +1 -0
- package/dist/esm/resources/signup.d.ts +16 -0
- package/dist/esm/resources/signup.js +17 -0
- package/dist/esm/resources/signup.js.map +1 -0
- package/dist/esm/resources/stores.d.ts +31 -0
- package/dist/esm/resources/stores.js +63 -0
- package/dist/esm/resources/stores.js.map +1 -0
- package/dist/esm/resources/stripe.d.ts +15 -0
- package/dist/esm/resources/stripe.js +21 -0
- package/dist/esm/resources/stripe.js.map +1 -0
- package/dist/esm/resources/webhooks.d.ts +15 -0
- package/dist/esm/resources/webhooks.js +49 -0
- package/dist/esm/resources/webhooks.js.map +1 -0
- package/dist/esm/types/account.d.ts +47 -0
- package/dist/esm/types/account.js +5 -0
- package/dist/esm/types/account.js.map +1 -0
- package/dist/esm/types/api-key.d.ts +18 -0
- package/dist/esm/types/api-key.js +5 -0
- package/dist/esm/types/api-key.js.map +1 -0
- package/dist/esm/types/index.d.ts +10 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/listing.d.ts +177 -0
- package/dist/esm/types/listing.js +5 -0
- package/dist/esm/types/listing.js.map +1 -0
- package/dist/esm/types/order.d.ts +42 -0
- package/dist/esm/types/order.js +5 -0
- package/dist/esm/types/order.js.map +1 -0
- package/dist/esm/types/shared.d.ts +87 -0
- package/dist/esm/types/shared.js +38 -0
- package/dist/esm/types/shared.js.map +1 -0
- package/dist/esm/types/signup.d.ts +24 -0
- package/dist/esm/types/signup.js +5 -0
- package/dist/esm/types/signup.js.map +1 -0
- package/dist/esm/types/store.d.ts +70 -0
- package/dist/esm/types/store.js +5 -0
- package/dist/esm/types/store.js.map +1 -0
- package/dist/esm/types/stripe.d.ts +12 -0
- package/dist/esm/types/stripe.js +5 -0
- package/dist/esm/types/stripe.js.map +1 -0
- package/dist/esm/types/webhook.d.ts +88 -0
- package/dist/esm/types/webhook.js +5 -0
- package/dist/esm/types/webhook.js.map +1 -0
- package/package.json +136 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types used across multiple resources.
|
|
3
|
+
*/
|
|
4
|
+
/** A single readiness action describing how to resolve an issue. */
|
|
5
|
+
export interface ReadinessAction {
|
|
6
|
+
/** Machine-readable action code. */
|
|
7
|
+
code: string;
|
|
8
|
+
/** Whether this action is resolved via the API or manually by the human. */
|
|
9
|
+
kind: 'api' | 'human';
|
|
10
|
+
/** Human-readable description of the action. */
|
|
11
|
+
message: string;
|
|
12
|
+
/** How to resolve this action. */
|
|
13
|
+
resolve: {
|
|
14
|
+
/** HTTP method for API actions. */
|
|
15
|
+
method: string;
|
|
16
|
+
/** API endpoint path for `kind: "api"` actions. */
|
|
17
|
+
endpoint: string | null;
|
|
18
|
+
/** External URL for `kind: "human"` actions. */
|
|
19
|
+
url: string | null;
|
|
20
|
+
/** Request parameters to include. */
|
|
21
|
+
params: Record<string, unknown> | null;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Account operational readiness. */
|
|
25
|
+
export interface AccountReadiness {
|
|
26
|
+
/** Whether the account can accept payments. */
|
|
27
|
+
operational: boolean;
|
|
28
|
+
/** List of actions required to become operational. */
|
|
29
|
+
actions: ReadinessAction[];
|
|
30
|
+
/** Code of the highest-priority action, or null if operational. */
|
|
31
|
+
next: string | null;
|
|
32
|
+
}
|
|
33
|
+
/** Listing monetization readiness. */
|
|
34
|
+
export interface ListingReadiness {
|
|
35
|
+
/** Whether buyers can complete a purchase on this listing. */
|
|
36
|
+
sellable: boolean;
|
|
37
|
+
/** List of actions required to become sellable. */
|
|
38
|
+
actions: ReadinessAction[];
|
|
39
|
+
/** Code of the highest-priority action, or null if sellable. */
|
|
40
|
+
next: string | null;
|
|
41
|
+
}
|
|
42
|
+
/** Paginated list response wrapper. */
|
|
43
|
+
export interface ListResponse<T> {
|
|
44
|
+
object: 'list';
|
|
45
|
+
data: T[];
|
|
46
|
+
has_more: boolean;
|
|
47
|
+
cursor: string | null;
|
|
48
|
+
}
|
|
49
|
+
/** Content type — auto-detected from the content value at creation. */
|
|
50
|
+
export declare const ContentType: {
|
|
51
|
+
readonly FILE: "file";
|
|
52
|
+
readonly URL: "url";
|
|
53
|
+
readonly TEXT: "text";
|
|
54
|
+
};
|
|
55
|
+
export type ContentType = (typeof ContentType)[keyof typeof ContentType];
|
|
56
|
+
/** Order status. */
|
|
57
|
+
export declare const OrderStatus: {
|
|
58
|
+
readonly COMPLETED: "completed";
|
|
59
|
+
};
|
|
60
|
+
export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
|
|
61
|
+
/** Webhook event type. */
|
|
62
|
+
export declare const WebhookEventType: {
|
|
63
|
+
readonly ORDER_COMPLETED: "order.completed";
|
|
64
|
+
readonly ORDER_REFUNDED: "order.refunded";
|
|
65
|
+
readonly ORDER_DISPUTED: "order.disputed";
|
|
66
|
+
readonly ORDER_DISPUTE_CLOSED: "order.dispute_closed";
|
|
67
|
+
readonly LISTING_CREATED: "listing.created";
|
|
68
|
+
readonly LISTING_UPDATED: "listing.updated";
|
|
69
|
+
readonly LISTING_PAUSED: "listing.paused";
|
|
70
|
+
readonly LISTING_RESUMED: "listing.resumed";
|
|
71
|
+
readonly LISTING_DELETED: "listing.deleted";
|
|
72
|
+
};
|
|
73
|
+
export type WebhookEventType = (typeof WebhookEventType)[keyof typeof WebhookEventType];
|
|
74
|
+
/** Readiness action kind. */
|
|
75
|
+
export declare const ActionKind: {
|
|
76
|
+
readonly API: "api";
|
|
77
|
+
readonly HUMAN: "human";
|
|
78
|
+
};
|
|
79
|
+
export type ActionKind = (typeof ActionKind)[keyof typeof ActionKind];
|
|
80
|
+
/** Readiness action code. */
|
|
81
|
+
export declare const ActionCode: {
|
|
82
|
+
readonly SET_STRIPE_KEY: "set_stripe_key";
|
|
83
|
+
readonly CONNECT_STRIPE: "connect_stripe";
|
|
84
|
+
readonly ENABLE_CHARGES: "enable_charges";
|
|
85
|
+
readonly UPDATE_BILLING: "update_billing";
|
|
86
|
+
};
|
|
87
|
+
export type ActionCode = (typeof ActionCode)[keyof typeof ActionCode];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types used across multiple resources.
|
|
3
|
+
*/
|
|
4
|
+
/** Content type — auto-detected from the content value at creation. */
|
|
5
|
+
export const ContentType = {
|
|
6
|
+
FILE: 'file',
|
|
7
|
+
URL: 'url',
|
|
8
|
+
TEXT: 'text',
|
|
9
|
+
};
|
|
10
|
+
/** Order status. */
|
|
11
|
+
export const OrderStatus = {
|
|
12
|
+
COMPLETED: 'completed',
|
|
13
|
+
};
|
|
14
|
+
/** Webhook event type. */
|
|
15
|
+
export const WebhookEventType = {
|
|
16
|
+
ORDER_COMPLETED: 'order.completed',
|
|
17
|
+
ORDER_REFUNDED: 'order.refunded',
|
|
18
|
+
ORDER_DISPUTED: 'order.disputed',
|
|
19
|
+
ORDER_DISPUTE_CLOSED: 'order.dispute_closed',
|
|
20
|
+
LISTING_CREATED: 'listing.created',
|
|
21
|
+
LISTING_UPDATED: 'listing.updated',
|
|
22
|
+
LISTING_PAUSED: 'listing.paused',
|
|
23
|
+
LISTING_RESUMED: 'listing.resumed',
|
|
24
|
+
LISTING_DELETED: 'listing.deleted',
|
|
25
|
+
};
|
|
26
|
+
/** Readiness action kind. */
|
|
27
|
+
export const ActionKind = {
|
|
28
|
+
API: 'api',
|
|
29
|
+
HUMAN: 'human',
|
|
30
|
+
};
|
|
31
|
+
/** Readiness action code. */
|
|
32
|
+
export const ActionCode = {
|
|
33
|
+
SET_STRIPE_KEY: 'set_stripe_key',
|
|
34
|
+
CONNECT_STRIPE: 'connect_stripe',
|
|
35
|
+
ENABLE_CHARGES: 'enable_charges',
|
|
36
|
+
UPDATE_BILLING: 'update_billing',
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/types/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmDH,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX,oBAAoB;AACpB,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE,WAAW;CACd,CAAC;AAGX,0BAA0B;AAC1B,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,oBAAoB,EAAE,sBAAsB;IAC5C,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,eAAe,EAAE,iBAAiB;IAClC,eAAe,EAAE,iBAAiB;CAC1B,CAAC;AAGX,6BAA6B;AAC7B,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,6BAA6B;AAC7B,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;CACxB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signup response types.
|
|
3
|
+
*/
|
|
4
|
+
import type { AccountResponse } from './account';
|
|
5
|
+
/** Response from the signup create endpoint. */
|
|
6
|
+
export interface SignupResponse {
|
|
7
|
+
/** Object type discriminator. Always "signup_session". */
|
|
8
|
+
object: 'signup_session';
|
|
9
|
+
/** Email the OTP was sent to. */
|
|
10
|
+
email: string;
|
|
11
|
+
/** Always "otp_sent". */
|
|
12
|
+
status: 'otp_sent';
|
|
13
|
+
/** Human-readable message. */
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
/** Response from the signup verify endpoint. */
|
|
17
|
+
export interface VerifyResponse {
|
|
18
|
+
/** Object type discriminator. Always "signup_result". */
|
|
19
|
+
object: 'signup_result';
|
|
20
|
+
/** The newly created account. */
|
|
21
|
+
account: AccountResponse;
|
|
22
|
+
/** Raw API key value — store this, it's only shown once. */
|
|
23
|
+
api_key: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signup.js","sourceRoot":"","sources":["../../../src/types/signup.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store and domain response types.
|
|
3
|
+
*/
|
|
4
|
+
/** Domain verification status. */
|
|
5
|
+
export type DomainStatus = 'pending' | 'verified' | 'stale';
|
|
6
|
+
/** Store object returned by the ListBee API. */
|
|
7
|
+
export interface StoreResponse {
|
|
8
|
+
/** Object type discriminator. Always "store". */
|
|
9
|
+
object: 'store';
|
|
10
|
+
/** Unique store identifier. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** URL-safe handle used in platform URLs. */
|
|
13
|
+
handle: string;
|
|
14
|
+
/** Store display name. Falls back to @handle if not set. */
|
|
15
|
+
name: string | null;
|
|
16
|
+
/** Resolved display name: name if set, otherwise @handle. */
|
|
17
|
+
display_name: string;
|
|
18
|
+
/** Short store bio. */
|
|
19
|
+
bio: string | null;
|
|
20
|
+
/** Social media URLs. */
|
|
21
|
+
social_links: string[];
|
|
22
|
+
/** True when the store has a payment provider configured. */
|
|
23
|
+
payment_connected: boolean;
|
|
24
|
+
/** Payment provider name or null if not configured. */
|
|
25
|
+
payment_provider: string | null;
|
|
26
|
+
/** Default currency code (ISO 4217, lowercase). Null until payment configured. */
|
|
27
|
+
currency: string | null;
|
|
28
|
+
/** Custom domain configured on this store. Null if not set. */
|
|
29
|
+
domain: string | null;
|
|
30
|
+
/** Domain verification status. Null if no domain configured. */
|
|
31
|
+
domain_status: DomainStatus | null;
|
|
32
|
+
/** Number of listings in this store. */
|
|
33
|
+
listing_count: number;
|
|
34
|
+
/** ISO 8601 timestamp of when the store was created. */
|
|
35
|
+
created_at: string;
|
|
36
|
+
}
|
|
37
|
+
/** Non-paginated list of stores. */
|
|
38
|
+
export interface StoreListResponse {
|
|
39
|
+
object: 'list';
|
|
40
|
+
data: StoreResponse[];
|
|
41
|
+
}
|
|
42
|
+
/** Custom domain object returned by the ListBee API. */
|
|
43
|
+
export interface DomainResponse {
|
|
44
|
+
/** Object type discriminator. Always "domain". */
|
|
45
|
+
object: 'domain';
|
|
46
|
+
/** The custom domain. */
|
|
47
|
+
domain: string;
|
|
48
|
+
/** Verification status: pending, verified, or stale. */
|
|
49
|
+
status: DomainStatus;
|
|
50
|
+
/** The CNAME target the domain must point to. */
|
|
51
|
+
cname_target: string;
|
|
52
|
+
/** Timestamp when domain was verified. Null if not yet verified. */
|
|
53
|
+
verified_at: string | null;
|
|
54
|
+
}
|
|
55
|
+
/** Parameters for creating a store. */
|
|
56
|
+
export interface CreateStoreParams {
|
|
57
|
+
/** URL-safe handle, unique globally. */
|
|
58
|
+
handle: string;
|
|
59
|
+
/** Optional display name. */
|
|
60
|
+
name?: string;
|
|
61
|
+
}
|
|
62
|
+
/** Parameters for updating a store. */
|
|
63
|
+
export interface UpdateStoreParams {
|
|
64
|
+
/** Store display name. */
|
|
65
|
+
name?: string;
|
|
66
|
+
/** Short store bio. */
|
|
67
|
+
bio?: string;
|
|
68
|
+
/** Social media URLs (HTTPS only, max 5). */
|
|
69
|
+
social_links?: string[];
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/types/store.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stripe resource response types.
|
|
3
|
+
*/
|
|
4
|
+
/** Response from the Stripe Connect session endpoint. */
|
|
5
|
+
export interface StripeConnectSessionResponse {
|
|
6
|
+
/** Object type discriminator. Always "stripe_connect_session". */
|
|
7
|
+
object: 'stripe_connect_session';
|
|
8
|
+
/** Stripe Connect onboarding URL — redirect the user here. */
|
|
9
|
+
url: string;
|
|
10
|
+
/** ISO 8601 timestamp when this session expires. */
|
|
11
|
+
expires_at: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe.js","sourceRoot":"","sources":["../../../src/types/stripe.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webhook response types.
|
|
3
|
+
*/
|
|
4
|
+
import type { WebhookEventType } from './shared';
|
|
5
|
+
/** Full webhook object returned by the ListBee API. */
|
|
6
|
+
export interface WebhookResponse {
|
|
7
|
+
/** Object type discriminator. Always "webhook". */
|
|
8
|
+
object: 'webhook';
|
|
9
|
+
/** Unique webhook identifier. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Display name. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** HTTPS endpoint URL. */
|
|
14
|
+
url: string;
|
|
15
|
+
/** HMAC signing secret for verifying payloads. */
|
|
16
|
+
secret: string;
|
|
17
|
+
/** Event types to subscribe to. Empty array = all events. */
|
|
18
|
+
events: WebhookEventType[];
|
|
19
|
+
/** Whether this webhook is currently active. */
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
/** ISO 8601 timestamp of when the webhook was created. */
|
|
22
|
+
created_at: string;
|
|
23
|
+
}
|
|
24
|
+
/** Parameters for creating a webhook. */
|
|
25
|
+
export interface CreateWebhookParams {
|
|
26
|
+
/** Display name. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** HTTPS endpoint URL. */
|
|
29
|
+
url: string;
|
|
30
|
+
/** Event types to subscribe to. Omit or empty = all events. */
|
|
31
|
+
events?: WebhookEventType[];
|
|
32
|
+
}
|
|
33
|
+
/** Parameters for updating a webhook. All fields optional. */
|
|
34
|
+
export interface UpdateWebhookParams {
|
|
35
|
+
/** Display name. */
|
|
36
|
+
name?: string;
|
|
37
|
+
/** HTTPS endpoint URL. */
|
|
38
|
+
url?: string;
|
|
39
|
+
/** Event types to subscribe to. */
|
|
40
|
+
events?: WebhookEventType[];
|
|
41
|
+
/** Whether this webhook is active. */
|
|
42
|
+
enabled?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/** A single webhook delivery event. */
|
|
45
|
+
export interface WebhookEventResponse {
|
|
46
|
+
/** Object type discriminator. Always "webhook_event". */
|
|
47
|
+
object: 'webhook_event';
|
|
48
|
+
/** Unique event identifier. */
|
|
49
|
+
id: string;
|
|
50
|
+
/** The event type that triggered this delivery. */
|
|
51
|
+
event_type: WebhookEventType;
|
|
52
|
+
/** Delivery status. */
|
|
53
|
+
status: 'pending' | 'delivered' | 'failed';
|
|
54
|
+
/** Number of delivery attempts so far. */
|
|
55
|
+
attempts: number;
|
|
56
|
+
/** Maximum delivery attempts before marking as failed. */
|
|
57
|
+
max_retries: number;
|
|
58
|
+
/** HTTP status code from the last delivery attempt. */
|
|
59
|
+
response_status: number | null;
|
|
60
|
+
/** Error message from the last failed delivery attempt. */
|
|
61
|
+
last_error: string | null;
|
|
62
|
+
/** ISO 8601 timestamp of when the event was created. */
|
|
63
|
+
created_at: string;
|
|
64
|
+
/** ISO 8601 timestamp of successful delivery. */
|
|
65
|
+
delivered_at: string | null;
|
|
66
|
+
}
|
|
67
|
+
/** Parameters for listing webhook events. */
|
|
68
|
+
export interface ListWebhookEventsParams {
|
|
69
|
+
/** Filter by delivery status. */
|
|
70
|
+
status?: 'pending' | 'delivered' | 'failed';
|
|
71
|
+
/** Maximum items per page (default 20). */
|
|
72
|
+
limit?: number;
|
|
73
|
+
/** Pagination cursor from a previous response. */
|
|
74
|
+
cursor?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Response from the webhook test endpoint. */
|
|
77
|
+
export interface WebhookTestResponse {
|
|
78
|
+
/** Object type discriminator. Always "webhook_test". */
|
|
79
|
+
object: 'webhook_test';
|
|
80
|
+
/** Whether the test delivery succeeded (endpoint returned 2xx). */
|
|
81
|
+
success: boolean;
|
|
82
|
+
/** HTTP status code from the endpoint. */
|
|
83
|
+
status_code: number | null;
|
|
84
|
+
/** Response body from the endpoint (truncated to 2000 chars). */
|
|
85
|
+
response_body: string | null;
|
|
86
|
+
/** Error message if delivery failed. */
|
|
87
|
+
error: string | null;
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../../src/types/webhook.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "listbee",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Official TypeScript SDK for the ListBee API — one API call to sell and deliver digital content.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://listbee.so",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "ListBee",
|
|
9
|
+
"email": "damian@listbee.so"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/listbee-dev/listbee-typescript.git"
|
|
14
|
+
},
|
|
15
|
+
"main": "dist/cjs/index.js",
|
|
16
|
+
"module": "dist/esm/index.js",
|
|
17
|
+
"types": "dist/cjs/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": {
|
|
21
|
+
"types": "./dist/esm/index.d.ts",
|
|
22
|
+
"default": "./dist/esm/index.js"
|
|
23
|
+
},
|
|
24
|
+
"require": {
|
|
25
|
+
"types": "./dist/cjs/index.d.ts",
|
|
26
|
+
"default": "./dist/cjs/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"./api-keys": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/esm/resources/api-keys.d.ts",
|
|
32
|
+
"default": "./dist/esm/resources/api-keys.js"
|
|
33
|
+
},
|
|
34
|
+
"require": {
|
|
35
|
+
"types": "./dist/cjs/resources/api-keys.d.ts",
|
|
36
|
+
"default": "./dist/cjs/resources/api-keys.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"./orders": {
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./dist/esm/resources/orders.d.ts",
|
|
42
|
+
"default": "./dist/esm/resources/orders.js"
|
|
43
|
+
},
|
|
44
|
+
"require": {
|
|
45
|
+
"types": "./dist/cjs/resources/orders.d.ts",
|
|
46
|
+
"default": "./dist/cjs/resources/orders.js"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"./signup": {
|
|
50
|
+
"import": {
|
|
51
|
+
"types": "./dist/esm/resources/signup.d.ts",
|
|
52
|
+
"default": "./dist/esm/resources/signup.js"
|
|
53
|
+
},
|
|
54
|
+
"require": {
|
|
55
|
+
"types": "./dist/cjs/resources/signup.d.ts",
|
|
56
|
+
"default": "./dist/cjs/resources/signup.js"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"./stripe": {
|
|
60
|
+
"import": {
|
|
61
|
+
"types": "./dist/esm/resources/stripe.d.ts",
|
|
62
|
+
"default": "./dist/esm/resources/stripe.js"
|
|
63
|
+
},
|
|
64
|
+
"require": {
|
|
65
|
+
"types": "./dist/cjs/resources/stripe.d.ts",
|
|
66
|
+
"default": "./dist/cjs/resources/stripe.js"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"./webhooks": {
|
|
70
|
+
"import": {
|
|
71
|
+
"types": "./dist/esm/resources/webhooks.d.ts",
|
|
72
|
+
"default": "./dist/esm/resources/webhooks.js"
|
|
73
|
+
},
|
|
74
|
+
"require": {
|
|
75
|
+
"types": "./dist/cjs/resources/webhooks.d.ts",
|
|
76
|
+
"default": "./dist/cjs/resources/webhooks.js"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"./errors": {
|
|
80
|
+
"import": {
|
|
81
|
+
"types": "./dist/esm/errors.d.ts",
|
|
82
|
+
"default": "./dist/esm/errors.js"
|
|
83
|
+
},
|
|
84
|
+
"require": {
|
|
85
|
+
"types": "./dist/cjs/errors.d.ts",
|
|
86
|
+
"default": "./dist/cjs/errors.js"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"./types": {
|
|
90
|
+
"import": {
|
|
91
|
+
"types": "./dist/esm/types/index.d.ts",
|
|
92
|
+
"default": "./dist/esm/types/index.js"
|
|
93
|
+
},
|
|
94
|
+
"require": {
|
|
95
|
+
"types": "./dist/cjs/types/index.d.ts",
|
|
96
|
+
"default": "./dist/cjs/types/index.js"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"files": [
|
|
101
|
+
"dist"
|
|
102
|
+
],
|
|
103
|
+
"scripts": {
|
|
104
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
105
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
106
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
107
|
+
"test": "vitest run",
|
|
108
|
+
"test:watch": "vitest",
|
|
109
|
+
"lint": "eslint src tests",
|
|
110
|
+
"clean": "rm -rf dist",
|
|
111
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
112
|
+
},
|
|
113
|
+
"keywords": [
|
|
114
|
+
"listbee",
|
|
115
|
+
"commerce",
|
|
116
|
+
"digital-products",
|
|
117
|
+
"api",
|
|
118
|
+
"sdk"
|
|
119
|
+
],
|
|
120
|
+
"engines": {
|
|
121
|
+
"node": ">=18.0.0"
|
|
122
|
+
},
|
|
123
|
+
"dependencies": {
|
|
124
|
+
"node-fetch": "^3.3.2"
|
|
125
|
+
},
|
|
126
|
+
"devDependencies": {
|
|
127
|
+
"@eslint/js": "^9.39.4",
|
|
128
|
+
"@types/node": "^18.0.0",
|
|
129
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
130
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
131
|
+
"eslint": "^9.0.0",
|
|
132
|
+
"typescript": "~5.4.0",
|
|
133
|
+
"typescript-eslint": "^8.57.2",
|
|
134
|
+
"vitest": "^3.0.0"
|
|
135
|
+
}
|
|
136
|
+
}
|