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.
Files changed (146) hide show
  1. package/README.md +552 -0
  2. package/dist/cjs/base-client.d.ts +65 -0
  3. package/dist/cjs/base-client.js +167 -0
  4. package/dist/cjs/base-client.js.map +1 -0
  5. package/dist/cjs/client.d.ts +58 -0
  6. package/dist/cjs/client.js +54 -0
  7. package/dist/cjs/client.js.map +1 -0
  8. package/dist/cjs/constants.d.ts +17 -0
  9. package/dist/cjs/constants.js +21 -0
  10. package/dist/cjs/constants.js.map +1 -0
  11. package/dist/cjs/errors.d.ts +89 -0
  12. package/dist/cjs/errors.js +141 -0
  13. package/dist/cjs/errors.js.map +1 -0
  14. package/dist/cjs/index.d.ts +26 -0
  15. package/dist/cjs/index.js +49 -0
  16. package/dist/cjs/index.js.map +1 -0
  17. package/dist/cjs/resources/account.d.ts +25 -0
  18. package/dist/cjs/resources/account.js +39 -0
  19. package/dist/cjs/resources/account.js.map +1 -0
  20. package/dist/cjs/resources/api-keys.d.ts +14 -0
  21. package/dist/cjs/resources/api-keys.js +26 -0
  22. package/dist/cjs/resources/api-keys.js.map +1 -0
  23. package/dist/cjs/resources/index.d.ts +7 -0
  24. package/dist/cjs/resources/index.js +18 -0
  25. package/dist/cjs/resources/index.js.map +1 -0
  26. package/dist/cjs/resources/listings.d.ts +70 -0
  27. package/dist/cjs/resources/listings.js +161 -0
  28. package/dist/cjs/resources/listings.js.map +1 -0
  29. package/dist/cjs/resources/orders.d.ts +11 -0
  30. package/dist/cjs/resources/orders.js +36 -0
  31. package/dist/cjs/resources/orders.js.map +1 -0
  32. package/dist/cjs/resources/signup.d.ts +16 -0
  33. package/dist/cjs/resources/signup.js +21 -0
  34. package/dist/cjs/resources/signup.js.map +1 -0
  35. package/dist/cjs/resources/stores.d.ts +31 -0
  36. package/dist/cjs/resources/stores.js +67 -0
  37. package/dist/cjs/resources/stores.js.map +1 -0
  38. package/dist/cjs/resources/stripe.d.ts +15 -0
  39. package/dist/cjs/resources/stripe.js +25 -0
  40. package/dist/cjs/resources/stripe.js.map +1 -0
  41. package/dist/cjs/resources/webhooks.d.ts +15 -0
  42. package/dist/cjs/resources/webhooks.js +55 -0
  43. package/dist/cjs/resources/webhooks.js.map +1 -0
  44. package/dist/cjs/types/account.d.ts +47 -0
  45. package/dist/cjs/types/account.js +6 -0
  46. package/dist/cjs/types/account.js.map +1 -0
  47. package/dist/cjs/types/api-key.d.ts +18 -0
  48. package/dist/cjs/types/api-key.js +6 -0
  49. package/dist/cjs/types/api-key.js.map +1 -0
  50. package/dist/cjs/types/index.d.ts +10 -0
  51. package/dist/cjs/types/index.js +10 -0
  52. package/dist/cjs/types/index.js.map +1 -0
  53. package/dist/cjs/types/listing.d.ts +177 -0
  54. package/dist/cjs/types/listing.js +6 -0
  55. package/dist/cjs/types/listing.js.map +1 -0
  56. package/dist/cjs/types/order.d.ts +42 -0
  57. package/dist/cjs/types/order.js +6 -0
  58. package/dist/cjs/types/order.js.map +1 -0
  59. package/dist/cjs/types/shared.d.ts +87 -0
  60. package/dist/cjs/types/shared.js +41 -0
  61. package/dist/cjs/types/shared.js.map +1 -0
  62. package/dist/cjs/types/signup.d.ts +24 -0
  63. package/dist/cjs/types/signup.js +6 -0
  64. package/dist/cjs/types/signup.js.map +1 -0
  65. package/dist/cjs/types/store.d.ts +70 -0
  66. package/dist/cjs/types/store.js +6 -0
  67. package/dist/cjs/types/store.js.map +1 -0
  68. package/dist/cjs/types/stripe.d.ts +12 -0
  69. package/dist/cjs/types/stripe.js +6 -0
  70. package/dist/cjs/types/stripe.js.map +1 -0
  71. package/dist/cjs/types/webhook.d.ts +88 -0
  72. package/dist/cjs/types/webhook.js +6 -0
  73. package/dist/cjs/types/webhook.js.map +1 -0
  74. package/dist/esm/base-client.d.ts +65 -0
  75. package/dist/esm/base-client.js +159 -0
  76. package/dist/esm/base-client.js.map +1 -0
  77. package/dist/esm/client.d.ts +58 -0
  78. package/dist/esm/client.js +50 -0
  79. package/dist/esm/client.js.map +1 -0
  80. package/dist/esm/constants.d.ts +17 -0
  81. package/dist/esm/constants.js +18 -0
  82. package/dist/esm/constants.js.map +1 -0
  83. package/dist/esm/errors.d.ts +89 -0
  84. package/dist/esm/errors.js +124 -0
  85. package/dist/esm/errors.js.map +1 -0
  86. package/dist/esm/index.d.ts +26 -0
  87. package/dist/esm/index.js +20 -0
  88. package/dist/esm/index.js.map +1 -0
  89. package/dist/esm/resources/account.d.ts +25 -0
  90. package/dist/esm/resources/account.js +35 -0
  91. package/dist/esm/resources/account.js.map +1 -0
  92. package/dist/esm/resources/api-keys.d.ts +14 -0
  93. package/dist/esm/resources/api-keys.js +21 -0
  94. package/dist/esm/resources/api-keys.js.map +1 -0
  95. package/dist/esm/resources/index.d.ts +7 -0
  96. package/dist/esm/resources/index.js +8 -0
  97. package/dist/esm/resources/index.js.map +1 -0
  98. package/dist/esm/resources/listings.d.ts +70 -0
  99. package/dist/esm/resources/listings.js +156 -0
  100. package/dist/esm/resources/listings.js.map +1 -0
  101. package/dist/esm/resources/orders.d.ts +11 -0
  102. package/dist/esm/resources/orders.js +31 -0
  103. package/dist/esm/resources/orders.js.map +1 -0
  104. package/dist/esm/resources/signup.d.ts +16 -0
  105. package/dist/esm/resources/signup.js +17 -0
  106. package/dist/esm/resources/signup.js.map +1 -0
  107. package/dist/esm/resources/stores.d.ts +31 -0
  108. package/dist/esm/resources/stores.js +63 -0
  109. package/dist/esm/resources/stores.js.map +1 -0
  110. package/dist/esm/resources/stripe.d.ts +15 -0
  111. package/dist/esm/resources/stripe.js +21 -0
  112. package/dist/esm/resources/stripe.js.map +1 -0
  113. package/dist/esm/resources/webhooks.d.ts +15 -0
  114. package/dist/esm/resources/webhooks.js +49 -0
  115. package/dist/esm/resources/webhooks.js.map +1 -0
  116. package/dist/esm/types/account.d.ts +47 -0
  117. package/dist/esm/types/account.js +5 -0
  118. package/dist/esm/types/account.js.map +1 -0
  119. package/dist/esm/types/api-key.d.ts +18 -0
  120. package/dist/esm/types/api-key.js +5 -0
  121. package/dist/esm/types/api-key.js.map +1 -0
  122. package/dist/esm/types/index.d.ts +10 -0
  123. package/dist/esm/types/index.js +2 -0
  124. package/dist/esm/types/index.js.map +1 -0
  125. package/dist/esm/types/listing.d.ts +177 -0
  126. package/dist/esm/types/listing.js +5 -0
  127. package/dist/esm/types/listing.js.map +1 -0
  128. package/dist/esm/types/order.d.ts +42 -0
  129. package/dist/esm/types/order.js +5 -0
  130. package/dist/esm/types/order.js.map +1 -0
  131. package/dist/esm/types/shared.d.ts +87 -0
  132. package/dist/esm/types/shared.js +38 -0
  133. package/dist/esm/types/shared.js.map +1 -0
  134. package/dist/esm/types/signup.d.ts +24 -0
  135. package/dist/esm/types/signup.js +5 -0
  136. package/dist/esm/types/signup.js.map +1 -0
  137. package/dist/esm/types/store.d.ts +70 -0
  138. package/dist/esm/types/store.js +5 -0
  139. package/dist/esm/types/store.js.map +1 -0
  140. package/dist/esm/types/stripe.d.ts +12 -0
  141. package/dist/esm/types/stripe.js +5 -0
  142. package/dist/esm/types/stripe.js.map +1 -0
  143. package/dist/esm/types/webhook.d.ts +88 -0
  144. package/dist/esm/types/webhook.js +5 -0
  145. package/dist/esm/types/webhook.js.map +1 -0
  146. package/package.json +136 -0
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Stripe resource — POST /v1/account/stripe-key, POST /v1/account/stripe/connect, DELETE /v1/account/stripe.
3
+ */
4
+ import type { BaseClient } from '../base-client';
5
+ import type { AccountResponse } from '../types/account';
6
+ import type { StripeConnectSessionResponse } from '../types/stripe';
7
+ export declare class StripeResource {
8
+ private readonly _client;
9
+ constructor(_client: BaseClient);
10
+ setKey(params: {
11
+ secretKey: string;
12
+ }): Promise<AccountResponse>;
13
+ connect(): Promise<StripeConnectSessionResponse>;
14
+ disconnect(): Promise<AccountResponse>;
15
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /**
3
+ * Stripe resource — POST /v1/account/stripe-key, POST /v1/account/stripe/connect, DELETE /v1/account/stripe.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.StripeResource = void 0;
7
+ class StripeResource {
8
+ constructor(_client) {
9
+ this._client = _client;
10
+ }
11
+ async setKey(params) {
12
+ const response = await this._client.post('/v1/account/stripe-key', { secret_key: params.secretKey });
13
+ return (await response.json());
14
+ }
15
+ async connect() {
16
+ const response = await this._client.post('/v1/account/stripe/connect');
17
+ return (await response.json());
18
+ }
19
+ async disconnect() {
20
+ const response = await this._client.delete('/v1/account/stripe');
21
+ return (await response.json());
22
+ }
23
+ }
24
+ exports.StripeResource = StripeResource;
25
+ //# sourceMappingURL=stripe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripe.js","sourceRoot":"","sources":["../../../src/resources/stripe.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAMH,MAAa,cAAc;IACzB,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD,KAAK,CAAC,MAAM,CAAC,MAA6B;QACxC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACrG,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAoB,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QACvE,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAiC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACjE,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAoB,CAAC;IACpD,CAAC;CACF;AAjBD,wCAiBC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Webhooks resource — CRUD + events + test for /v1/webhooks.
3
+ */
4
+ import type { BaseClient, CursorPage } from '../base-client';
5
+ import type { WebhookResponse, CreateWebhookParams, UpdateWebhookParams, WebhookEventResponse, ListWebhookEventsParams, WebhookTestResponse } from '../types/webhook';
6
+ export declare class WebhooksResource {
7
+ private readonly _client;
8
+ constructor(_client: BaseClient);
9
+ create(params: CreateWebhookParams): Promise<WebhookResponse>;
10
+ list(): Promise<WebhookResponse[]>;
11
+ update(webhookId: string, params: UpdateWebhookParams): Promise<WebhookResponse>;
12
+ delete(webhookId: string): Promise<void>;
13
+ listEvents(webhookId: string, params?: ListWebhookEventsParams): Promise<CursorPage<WebhookEventResponse>>;
14
+ test(webhookId: string): Promise<WebhookTestResponse>;
15
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /**
3
+ * Webhooks resource — CRUD + events + test for /v1/webhooks.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WebhooksResource = void 0;
7
+ class WebhooksResource {
8
+ constructor(_client) {
9
+ this._client = _client;
10
+ }
11
+ async create(params) {
12
+ const body = { name: params.name, url: params.url };
13
+ if (params.events !== undefined)
14
+ body['events'] = params.events;
15
+ const response = await this._client.post('/v1/webhooks', body);
16
+ return (await response.json());
17
+ }
18
+ async list() {
19
+ var _a;
20
+ const response = await this._client.get('/v1/webhooks');
21
+ const body = (await response.json());
22
+ return ((_a = body.data) !== null && _a !== void 0 ? _a : []);
23
+ }
24
+ async update(webhookId, params) {
25
+ const body = {};
26
+ if (params.name !== undefined)
27
+ body['name'] = params.name;
28
+ if (params.url !== undefined)
29
+ body['url'] = params.url;
30
+ if (params.events !== undefined)
31
+ body['events'] = params.events;
32
+ if (params.enabled !== undefined)
33
+ body['enabled'] = params.enabled;
34
+ const response = await this._client.put(`/v1/webhooks/${webhookId}`, body);
35
+ return (await response.json());
36
+ }
37
+ async delete(webhookId) {
38
+ await this._client.delete(`/v1/webhooks/${webhookId}`);
39
+ }
40
+ async listEvents(webhookId, params = {}) {
41
+ var _a;
42
+ const queryParams = { limit: (_a = params.limit) !== null && _a !== void 0 ? _a : 20 };
43
+ if (params.status !== undefined)
44
+ queryParams['status'] = params.status;
45
+ if (params.cursor !== undefined)
46
+ queryParams['cursor'] = params.cursor;
47
+ return this._client.getPage(`/v1/webhooks/${webhookId}/events`, queryParams, (item) => item);
48
+ }
49
+ async test(webhookId) {
50
+ const response = await this._client.post(`/v1/webhooks/${webhookId}/test`);
51
+ return (await response.json());
52
+ }
53
+ }
54
+ exports.WebhooksResource = WebhooksResource;
55
+ //# sourceMappingURL=webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../../src/resources/webhooks.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAYH,MAAa,gBAAgB;IAC3B,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,MAAM,IAAI,GAA4B,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC;QAC7E,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;YAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QAChE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QAC/D,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAoB,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,IAAI;;QACR,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAyB,CAAC;QAC7D,OAAO,CAAC,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAsB,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB,EAAE,MAA2B;QACzD,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;QAC1D,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC;QACvD,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;YAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QAChE,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;YAAE,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;QAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAoB,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB;QAC5B,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,SAAS,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,SAAiB,EAAE,SAAkC,EAAE;;QACtE,MAAM,WAAW,GAA8C,EAAE,KAAK,EAAE,MAAA,MAAM,CAAC,KAAK,mCAAI,EAAE,EAAE,CAAC;QAC7F,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;YAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QACvE,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;YAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAuB,gBAAgB,SAAS,SAAS,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAA4B,CAAC,CAAC;IAC7I,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,SAAiB;QAC1B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,SAAS,OAAO,CAAC,CAAC;QAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAwB,CAAC;IACxD,CAAC;CACF;AAzCD,4CAyCC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Account response types.
3
+ */
4
+ import type { AccountReadiness } from './shared';
5
+ /** Aggregate statistics for an account. */
6
+ export interface AccountStats {
7
+ /** Total revenue in the smallest currency unit across all orders. */
8
+ total_revenue: number;
9
+ /** Total number of orders across all listings. */
10
+ total_orders: number;
11
+ /** Total number of listings on the account. */
12
+ total_listings: number;
13
+ }
14
+ /** Full account object returned by the ListBee API. */
15
+ export interface AccountResponse {
16
+ /** Object type discriminator. Always "account". */
17
+ object: 'account';
18
+ /** Unique account identifier. */
19
+ id: string;
20
+ /** Account email address. */
21
+ email: string;
22
+ /** Current plan tier. */
23
+ plan: string;
24
+ /** Transaction fee rate as a decimal string (e.g. "0.10" = 10%). */
25
+ fee_rate: string;
26
+ /** Three-letter ISO currency code, uppercase. Set during onboarding. */
27
+ currency: string | null;
28
+ /**
29
+ * Google Analytics 4 Measurement ID (e.g. "G-XXXXXXXXXX").
30
+ * Used to track conversions on checkout pages.
31
+ */
32
+ ga_measurement_id: string | null;
33
+ /** Aggregate statistics for this account. */
34
+ stats: AccountStats;
35
+ /** Account operational readiness. */
36
+ readiness: AccountReadiness;
37
+ /** ISO 8601 timestamp of when the account was created. */
38
+ created_at: string;
39
+ }
40
+ /** Parameters for updating account settings. */
41
+ export interface UpdateAccountParams {
42
+ /**
43
+ * Google Analytics 4 Measurement ID (e.g. "G-XXXXXXXXXX").
44
+ * Pass null to clear the existing value.
45
+ */
46
+ ga_measurement_id?: string | null;
47
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Account response types.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/types/account.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * API key response types.
3
+ */
4
+ /** Full API key object returned by the ListBee API. */
5
+ export interface ApiKeyResponse {
6
+ /** Object type discriminator. Always "api_key". */
7
+ object: 'api_key';
8
+ /** Unique API key identifier. */
9
+ id: string;
10
+ /** Human-readable label. */
11
+ name: string;
12
+ /** First 8 characters of the key value. */
13
+ prefix: string;
14
+ /** Full key value — only populated on create, null in list. */
15
+ key: string | null;
16
+ /** ISO 8601 timestamp of when the key was created. */
17
+ created_at: string;
18
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * API key response types.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=api-key.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-key.js","sourceRoot":"","sources":["../../../src/types/api-key.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,10 @@
1
+ export type { AccountReadiness, ListingReadiness, ReadinessAction, ListResponse } from './shared';
2
+ export { ContentType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
3
+ export type { AccountResponse, UpdateAccountParams, AccountStats } from './account';
4
+ export type { BlurMode, CreateListingParams, FaqItem, ListingResponse, ListingStatus, Review, UpdateListingParams, } from './listing';
5
+ export type { ApiKeyResponse } from './api-key';
6
+ export type { OrderResponse, ListOrdersParams } from './order';
7
+ export type { SignupResponse, VerifyResponse } from './signup';
8
+ export type { StripeConnectSessionResponse } from './stripe';
9
+ export type { WebhookResponse, CreateWebhookParams, UpdateWebhookParams, WebhookEventResponse, ListWebhookEventsParams, WebhookTestResponse, } from './webhook';
10
+ export type { StoreResponse, StoreListResponse, DomainResponse, DomainStatus, CreateStoreParams, UpdateStoreParams } from './store';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.ContentType = void 0;
4
+ var shared_1 = require("./shared");
5
+ Object.defineProperty(exports, "ContentType", { enumerable: true, get: function () { return shared_1.ContentType; } });
6
+ Object.defineProperty(exports, "OrderStatus", { enumerable: true, get: function () { return shared_1.OrderStatus; } });
7
+ Object.defineProperty(exports, "WebhookEventType", { enumerable: true, get: function () { return shared_1.WebhookEventType; } });
8
+ Object.defineProperty(exports, "ActionKind", { enumerable: true, get: function () { return shared_1.ActionKind; } });
9
+ Object.defineProperty(exports, "ActionCode", { enumerable: true, get: function () { return shared_1.ActionCode; } });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AACA,mCAA8F;AAArF,qGAAA,WAAW,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA"}
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Listing response types.
3
+ */
4
+ import type { ListingReadiness } from './shared';
5
+ /** A single buyer review card displayed on the listing product page. */
6
+ export interface Review {
7
+ /** Reviewer display name. */
8
+ name: string;
9
+ /** Star rating (1–5). */
10
+ rating: number;
11
+ /** Review body text. */
12
+ content: string;
13
+ }
14
+ /** A single FAQ accordion item displayed on the listing product page. */
15
+ export interface FaqItem {
16
+ /** Question text. */
17
+ q: string;
18
+ /** Answer text. */
19
+ a: string;
20
+ }
21
+ /** Cover image blur mode. */
22
+ export type BlurMode = 'auto' | 'true' | 'false';
23
+ /** Listing status. */
24
+ export type ListingStatus = 'active' | 'paused' | 'draft';
25
+ /** Full listing object returned by the ListBee API. */
26
+ export interface ListingResponse {
27
+ /** Object type discriminator. Always "listing". */
28
+ object: 'listing';
29
+ /** Unique listing identifier. */
30
+ id: string;
31
+ /** URL slug used on the product page. */
32
+ slug: string;
33
+ /** Product name shown on the product page. */
34
+ name: string;
35
+ /** Longer product description, plain text. */
36
+ description: string | null;
37
+ /** Short line shown below the product name. */
38
+ tagline: string | null;
39
+ /** Bullet-point feature badges shown on the product page. */
40
+ highlights: string[];
41
+ /** Buy button text. Defaults to "Buy Now" when not set. */
42
+ cta: string | null;
43
+ /** Price in the smallest currency unit (e.g. 2900 = $29.00). */
44
+ price: number;
45
+ /** Auto-detected from the content value at creation. */
46
+ content_type: string;
47
+ /** true if content was successfully fetched and stored. */
48
+ has_content: boolean;
49
+ /** true if a cover image exists (uploaded or auto-generated). */
50
+ has_cover: boolean;
51
+ /** Strikethrough price in smallest currency unit. */
52
+ compare_at_price: number | null;
53
+ /** Short promotional badges shown on the product page. */
54
+ badges: string[];
55
+ /** Cover image blur mode. */
56
+ cover_blur: BlurMode;
57
+ /** Seller-provided aggregate star rating (1–5). */
58
+ rating: number | null;
59
+ /** Seller-provided review or purchase count shown alongside the rating. */
60
+ rating_count: number | null;
61
+ /** Featured review cards shown on the product page. */
62
+ reviews: Review[];
63
+ /** FAQ accordion items shown on the product page. */
64
+ faqs: FaqItem[];
65
+ /** Arbitrary key-value pairs forwarded in webhook events. */
66
+ metadata: Record<string, unknown> | null;
67
+ /**
68
+ * UTM source tag attached to checkout links (e.g. "twitter").
69
+ * Null means use account defaults.
70
+ */
71
+ utm_source: string | null;
72
+ /**
73
+ * UTM medium tag attached to checkout links (e.g. "social").
74
+ * Null means use account defaults.
75
+ */
76
+ utm_medium: string | null;
77
+ /**
78
+ * UTM campaign tag attached to checkout links (e.g. "launch-week").
79
+ * Null means use account defaults.
80
+ */
81
+ utm_campaign: string | null;
82
+ /** Current listing status. */
83
+ status: ListingStatus;
84
+ /** Full product page URL — share this with buyers. */
85
+ url: string | null;
86
+ /** Monetization readiness. */
87
+ readiness: ListingReadiness;
88
+ /** ISO 8601 timestamp of when the listing was created. */
89
+ created_at: string;
90
+ }
91
+ /** Parameters for creating a listing. */
92
+ export interface CreateListingParams {
93
+ /** Product name shown on the product page. */
94
+ name: string;
95
+ /** Price in the smallest currency unit (e.g. 2900 = $29.00). */
96
+ price: number;
97
+ /** File URL, redirect URL, or plain text to deliver after purchase. */
98
+ content: string;
99
+ /** Store to create this listing in. Required when account has multiple stores. */
100
+ store_id?: string;
101
+ /** Longer product description, plain text. */
102
+ description?: string;
103
+ /** Short line shown below the product name. */
104
+ tagline?: string;
105
+ /** Bullet-point feature badges shown on the product page. */
106
+ highlights?: string[];
107
+ /** Buy button text. Defaults to "Buy Now" when not set. */
108
+ cta?: string;
109
+ /** URL of a cover image to fetch and store. */
110
+ cover_url?: string;
111
+ /** Arbitrary key-value pairs forwarded in webhook events. */
112
+ metadata?: Record<string, unknown>;
113
+ /** Strikethrough price in smallest currency unit. */
114
+ compare_at_price?: number;
115
+ /** Short promotional badges shown on the product page. */
116
+ badges?: string[];
117
+ /**
118
+ * Cover blur mode — "auto", "true", or "false".
119
+ * Only sent when different from "auto".
120
+ */
121
+ cover_blur?: BlurMode;
122
+ /** Seller-provided aggregate star rating (1–5). */
123
+ rating?: number;
124
+ /** Seller-provided review or purchase count. */
125
+ rating_count?: number;
126
+ /** Featured review cards shown on the product page. */
127
+ reviews?: Review[];
128
+ /** FAQ accordion items shown on the product page. */
129
+ faqs?: FaqItem[];
130
+ /** UTM source tag attached to checkout links. Null means use account defaults. */
131
+ utm_source?: string | null;
132
+ /** UTM medium tag attached to checkout links. Null means use account defaults. */
133
+ utm_medium?: string | null;
134
+ /** UTM campaign tag attached to checkout links. Null means use account defaults. */
135
+ utm_campaign?: string | null;
136
+ /** Request timeout in milliseconds. Defaults to LISTING_CREATE_TIMEOUT_MS (120s). */
137
+ timeoutMs?: number;
138
+ }
139
+ /** Parameters for updating a listing. */
140
+ export interface UpdateListingParams {
141
+ /** Product name shown on the product page. */
142
+ name?: string;
143
+ /** Price in the smallest currency unit (e.g. 2900 = $29.00). */
144
+ price?: number;
145
+ /** Longer product description, plain text. */
146
+ description?: string;
147
+ /** Short line shown below the product name. */
148
+ tagline?: string;
149
+ /** Bullet-point feature badges shown on the product page. */
150
+ highlights?: string[];
151
+ /** Buy button text. */
152
+ cta?: string;
153
+ /** URL of a cover image to fetch and store. */
154
+ cover_url?: string;
155
+ /** Arbitrary key-value pairs forwarded in webhook events. */
156
+ metadata?: Record<string, unknown>;
157
+ /** Strikethrough price in smallest currency unit. */
158
+ compare_at_price?: number;
159
+ /** Short promotional badges shown on the product page. */
160
+ badges?: string[];
161
+ /** Cover blur mode — "auto", "true", or "false". */
162
+ cover_blur?: BlurMode;
163
+ /** Seller-provided aggregate star rating (1–5). */
164
+ rating?: number;
165
+ /** Seller-provided review or purchase count. */
166
+ rating_count?: number;
167
+ /** Featured review cards shown on the product page. */
168
+ reviews?: Review[];
169
+ /** FAQ accordion items shown on the product page. */
170
+ faqs?: FaqItem[];
171
+ /** UTM source tag attached to checkout links. Null means use account defaults. */
172
+ utm_source?: string | null;
173
+ /** UTM medium tag attached to checkout links. Null means use account defaults. */
174
+ utm_medium?: string | null;
175
+ /** UTM campaign tag attached to checkout links. Null means use account defaults. */
176
+ utm_campaign?: string | null;
177
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Listing response types.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=listing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listing.js","sourceRoot":"","sources":["../../../src/types/listing.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Order response types.
3
+ */
4
+ import type { OrderStatus } from './shared';
5
+ /** Full order object returned by the ListBee API. */
6
+ export interface OrderResponse {
7
+ /** Object type discriminator. Always "order". */
8
+ object: 'order';
9
+ /** Unique order identifier. */
10
+ id: string;
11
+ /** ID of the listing that was purchased. */
12
+ listing_id: string;
13
+ /** Buyer's email address. */
14
+ buyer_email: string;
15
+ /** Amount in smallest currency unit (e.g. 2900 = $29.00). */
16
+ amount: number;
17
+ /** Three-letter ISO 4217 currency code, uppercase. */
18
+ currency: string;
19
+ /** Stripe Checkout Session ID. */
20
+ stripe_session_id: string;
21
+ /** Stripe PaymentIntent ID. */
22
+ stripe_payment_intent_id: string;
23
+ /** Order status. */
24
+ status: OrderStatus;
25
+ /** ISO 8601 timestamp of when the order was created. */
26
+ created_at: string;
27
+ }
28
+ /** Parameters for listing orders. */
29
+ export interface ListOrdersParams {
30
+ /** Filter by order status. */
31
+ status?: OrderStatus;
32
+ /** Filter by listing slug. */
33
+ listing?: string;
34
+ /** Only orders created after this date (ISO 8601 string or Date). */
35
+ created_after?: string | Date;
36
+ /** Only orders created before this date (ISO 8601 string or Date). */
37
+ created_before?: string | Date;
38
+ /** Maximum items per page (1-100, default 20). */
39
+ limit?: number;
40
+ /** Pagination cursor from a previous response. */
41
+ cursor?: string;
42
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Order response types.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.js","sourceRoot":"","sources":["../../../src/types/order.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -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,41 @@
1
+ "use strict";
2
+ /**
3
+ * Shared types used across multiple resources.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.ContentType = void 0;
7
+ /** Content type — auto-detected from the content value at creation. */
8
+ exports.ContentType = {
9
+ FILE: 'file',
10
+ URL: 'url',
11
+ TEXT: 'text',
12
+ };
13
+ /** Order status. */
14
+ exports.OrderStatus = {
15
+ COMPLETED: 'completed',
16
+ };
17
+ /** Webhook event type. */
18
+ exports.WebhookEventType = {
19
+ ORDER_COMPLETED: 'order.completed',
20
+ ORDER_REFUNDED: 'order.refunded',
21
+ ORDER_DISPUTED: 'order.disputed',
22
+ ORDER_DISPUTE_CLOSED: 'order.dispute_closed',
23
+ LISTING_CREATED: 'listing.created',
24
+ LISTING_UPDATED: 'listing.updated',
25
+ LISTING_PAUSED: 'listing.paused',
26
+ LISTING_RESUMED: 'listing.resumed',
27
+ LISTING_DELETED: 'listing.deleted',
28
+ };
29
+ /** Readiness action kind. */
30
+ exports.ActionKind = {
31
+ API: 'api',
32
+ HUMAN: 'human',
33
+ };
34
+ /** Readiness action code. */
35
+ exports.ActionCode = {
36
+ SET_STRIPE_KEY: 'set_stripe_key',
37
+ CONNECT_STRIPE: 'connect_stripe',
38
+ ENABLE_CHARGES: 'enable_charges',
39
+ UPDATE_BILLING: 'update_billing',
40
+ };
41
+ //# 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;AAC1D,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX,oBAAoB;AACP,QAAA,WAAW,GAAG;IACzB,SAAS,EAAE,WAAW;CACd,CAAC;AAGX,0BAA0B;AACb,QAAA,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;AAChB,QAAA,UAAU,GAAG;IACxB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,6BAA6B;AAChB,QAAA,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,6 @@
1
+ "use strict";
2
+ /**
3
+ * Signup response types.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=signup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signup.js","sourceRoot":"","sources":["../../../src/types/signup.ts"],"names":[],"mappings":";AAAA;;GAEG"}