listbee 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.
@@ -14,8 +14,8 @@ export { SignupResource } from './resources/signup';
14
14
  export { StripeResource } from './resources/stripe';
15
15
  export { StoresResource } from './resources/stores';
16
16
  export { WebhooksResource } from './resources/webhooks';
17
- export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, FulfillmentStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
18
- export type { AccountReadiness, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress, } from './types/shared';
17
+ export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
18
+ export type { AccountReadiness, DeliverableResponse, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress, } from './types/shared';
19
19
  export type { AccountResponse, UpdateAccountParams, AccountStats } from './types/account';
20
20
  export type { BlurMode, CreateListingParams, FaqItem, ListingResponse, ListingStatus, Review, UpdateListingParams, } from './types/listing';
21
21
  export type { ApiKeyResponse } from './types/api-key';
package/dist/cjs/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * ListBee TypeScript SDK — public exports.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.FulfillmentStatus = exports.OrderStatus = exports.CheckoutFieldType = exports.FulfillmentMode = exports.DeliverableType = exports.ContentType = exports.WebhooksResource = exports.StoresResource = exports.StripeResource = exports.SignupResource = exports.OrdersResource = exports.ApiKeysResource = exports.ListingsResource = exports.AccountResource = exports.WebhookVerificationError = exports.ValidationError = exports.RateLimitError = exports.NotFoundError = exports.ListBeeError = exports.InternalServerError = exports.ConflictError = exports.AuthenticationError = exports.APITimeoutError = exports.APIStatusError = exports.APIConnectionError = exports.CursorPage = exports.ListBee = void 0;
6
+ exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.CheckoutFieldType = exports.FulfillmentMode = exports.DeliverableType = exports.ContentType = exports.WebhooksResource = exports.StoresResource = exports.StripeResource = exports.SignupResource = exports.OrdersResource = exports.ApiKeysResource = exports.ListingsResource = exports.AccountResource = exports.WebhookVerificationError = exports.ValidationError = exports.RateLimitError = exports.NotFoundError = exports.ListBeeError = exports.InternalServerError = exports.ConflictError = exports.AuthenticationError = exports.APITimeoutError = exports.APIStatusError = exports.APIConnectionError = exports.CursorPage = exports.ListBee = void 0;
7
7
  // Client
8
8
  var client_1 = require("./client");
9
9
  Object.defineProperty(exports, "ListBee", { enumerable: true, get: function () { return client_1.ListBee; } });
@@ -46,7 +46,6 @@ Object.defineProperty(exports, "DeliverableType", { enumerable: true, get: funct
46
46
  Object.defineProperty(exports, "FulfillmentMode", { enumerable: true, get: function () { return shared_1.FulfillmentMode; } });
47
47
  Object.defineProperty(exports, "CheckoutFieldType", { enumerable: true, get: function () { return shared_1.CheckoutFieldType; } });
48
48
  Object.defineProperty(exports, "OrderStatus", { enumerable: true, get: function () { return shared_1.OrderStatus; } });
49
- Object.defineProperty(exports, "FulfillmentStatus", { enumerable: true, get: function () { return shared_1.FulfillmentStatus; } });
50
49
  Object.defineProperty(exports, "WebhookEventType", { enumerable: true, get: function () { return shared_1.WebhookEventType; } });
51
50
  Object.defineProperty(exports, "ActionKind", { enumerable: true, get: function () { return shared_1.ActionKind; } });
52
51
  Object.defineProperty(exports, "ActionCode", { enumerable: true, get: function () { return shared_1.ActionCode; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,SAAS;AACT,mCAAmC;AAA1B,iGAAA,OAAO,OAAA;AAEhB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AAGnB,SAAS;AACT,mCAYkB;AAXhB,4GAAA,kBAAkB,OAAA;AAClB,wGAAA,cAAc,OAAA;AACd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AAa,OAAA;AACb,wGAAA,cAAc,OAAA;AACd,yGAAA,eAAe,OAAA;AACf,kHAAA,wBAAwB,OAAA;AAG1B,YAAY;AACZ,+CAAsD;AAA7C,0GAAA,eAAe,OAAA;AACxB,iDAAwD;AAA/C,4GAAA,gBAAgB,OAAA;AACzB,iDAAuD;AAA9C,2GAAA,eAAe,OAAA;AACxB,6CAAoD;AAA3C,wGAAA,cAAc,OAAA;AACvB,6CAAoD;AAA3C,wGAAA,cAAc,OAAA;AACvB,6CAAoD;AAA3C,wGAAA,cAAc,OAAA;AACvB,6CAAoD;AAA3C,wGAAA,cAAc,OAAA;AACvB,iDAAwD;AAA/C,4GAAA,gBAAgB,OAAA;AAEzB,yBAAyB;AACzB,yCAAyJ;AAAhJ,qGAAA,WAAW,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA"}
@@ -22,16 +22,16 @@ export declare class OrdersResource {
22
22
  */
23
23
  list(params?: ListOrdersParams): Promise<CursorPage<OrderResponse>>;
24
24
  /**
25
- * Fulfill an order — push digital content to the buyer.
25
+ * Fulfill an order — attach a deliverable and transition to FULFILLED.
26
26
  *
27
27
  * For external fulfillment listings, this allows your app to push
28
28
  * generated content back to ListBee for delivery.
29
29
  *
30
30
  * @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
31
- * @param params - Fulfillment parameters (content, content_type, content_url).
31
+ * @param params - Fulfillment parameters including the required deliverable ID.
32
32
  * @returns The updated OrderResponse.
33
33
  */
34
- fulfill(orderId: string, params?: FulfillOrderParams): Promise<OrderResponse>;
34
+ fulfill(orderId: string, params: FulfillOrderParams): Promise<OrderResponse>;
35
35
  /**
36
36
  * Mark an order as shipped with tracking information.
37
37
  *
@@ -45,23 +45,19 @@ class OrdersResource {
45
45
  return this._client.getPage('/v1/orders', queryParams, (item) => item);
46
46
  }
47
47
  /**
48
- * Fulfill an order — push digital content to the buyer.
48
+ * Fulfill an order — attach a deliverable and transition to FULFILLED.
49
49
  *
50
50
  * For external fulfillment listings, this allows your app to push
51
51
  * generated content back to ListBee for delivery.
52
52
  *
53
53
  * @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
54
- * @param params - Fulfillment parameters (content, content_type, content_url).
54
+ * @param params - Fulfillment parameters including the required deliverable ID.
55
55
  * @returns The updated OrderResponse.
56
56
  */
57
- async fulfill(orderId, params = {}) {
58
- const body = {};
59
- if (params.content !== undefined)
60
- body['content'] = params.content;
61
- if (params.content_type !== undefined)
62
- body['content_type'] = params.content_type;
63
- if (params.content_url !== undefined)
64
- body['content_url'] = params.content_url;
57
+ async fulfill(orderId, params) {
58
+ const body = {
59
+ deliverable: params.deliverable,
60
+ };
65
61
  const response = await this._client.post(`/v1/orders/${orderId}/fulfill`, body);
66
62
  return (await response.json());
67
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"orders.js","sourceRoot":"","sources":["../../../src/resources/orders.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,MAAa,cAAc;IACzB,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CAAC,OAAe;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QACjE,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAC,SAA2B,EAAE;;QACtC,MAAM,WAAW,GAA8C;YAC7D,KAAK,EAAE,MAAA,MAAM,CAAC,KAAK,mCAAI,EAAE;SAC1B,CAAC;QACF,IAAI,MAAM,CAAC,MAAM,KAAK,S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I,EAAE,CAAkB,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,OAAe,EAAE,MAAuB;QACjD,MAAM,IAAI,GAA4B;YACpC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,aAAa,EAAE,MAAM,CAAC,aAAa;SACpC,CAAC;QACF,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS;YAAE,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;QAE/E,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,OAAO,OAAO,EAAE,IAAI,CAAC,CAAC;QAC7E,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;IAClD,CAAC;CACF;AAzED,wCAyEC"}
@@ -1,5 +1,5 @@
1
- export type { AccountReadiness, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress } from './shared';
2
- export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, FulfillmentStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
1
+ export type { AccountReadiness, DeliverableResponse, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress } from './shared';
2
+ export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
3
3
  export type { AccountResponse, UpdateAccountParams, AccountStats } from './account';
4
4
  export type { BlurMode, CreateListingParams, FaqItem, ListingResponse, ListingStatus, Review, UpdateListingParams, } from './listing';
5
5
  export type { ApiKeyResponse } from './api-key';
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.FulfillmentStatus = exports.OrderStatus = exports.CheckoutFieldType = exports.FulfillmentMode = exports.DeliverableType = exports.ContentType = void 0;
3
+ exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.CheckoutFieldType = exports.FulfillmentMode = exports.DeliverableType = exports.ContentType = void 0;
4
4
  var shared_1 = require("./shared");
5
5
  Object.defineProperty(exports, "ContentType", { enumerable: true, get: function () { return shared_1.ContentType; } });
6
6
  Object.defineProperty(exports, "DeliverableType", { enumerable: true, get: function () { return shared_1.DeliverableType; } });
7
7
  Object.defineProperty(exports, "FulfillmentMode", { enumerable: true, get: function () { return shared_1.FulfillmentMode; } });
8
8
  Object.defineProperty(exports, "CheckoutFieldType", { enumerable: true, get: function () { return shared_1.CheckoutFieldType; } });
9
9
  Object.defineProperty(exports, "OrderStatus", { enumerable: true, get: function () { return shared_1.OrderStatus; } });
10
- Object.defineProperty(exports, "FulfillmentStatus", { enumerable: true, get: function () { return shared_1.FulfillmentStatus; } });
11
10
  Object.defineProperty(exports, "WebhookEventType", { enumerable: true, get: function () { return shared_1.WebhookEventType; } });
12
11
  Object.defineProperty(exports, "ActionKind", { enumerable: true, get: function () { return shared_1.ActionKind; } });
13
12
  Object.defineProperty(exports, "ActionCode", { enumerable: true, get: function () { return shared_1.ActionCode; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AACA,mCAAsK;AAA7J,qGAAA,WAAW,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AACA,mCAAmJ;AAA1I,qGAAA,WAAW,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,0GAAA,gBAAgB,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Listing response types.
3
3
  */
4
- import type { CheckoutField, DeliverableType, FulfillmentMode, ListingReadiness } from './shared';
4
+ import type { CheckoutField, DeliverableResponse, FulfillmentMode, ListingReadiness } from './shared';
5
5
  /** A single buyer review card displayed on the listing product page. */
6
6
  export interface Review {
7
7
  /** Reviewer display name. */
@@ -42,10 +42,8 @@ export interface ListingResponse {
42
42
  cta: string | null;
43
43
  /** Price in the smallest currency unit (e.g. 2900 = $29.00). */
44
44
  price: number;
45
- /** Auto-detected deliverable type (file, url, text, or null for external fulfillment). */
46
- deliverable_type: DeliverableType | null;
47
- /** true if a deliverable was successfully fetched and stored. */
48
- has_deliverable: boolean;
45
+ /** Deliverable associated with this listing, or null for external fulfillment. */
46
+ deliverable: DeliverableResponse | null;
49
47
  /** Fulfillment mode — "managed" (ListBee delivers) or "external" (you deliver). */
50
48
  fulfillment: FulfillmentMode;
51
49
  /** Checkout schema — custom fields collected at checkout (max 10). */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Order response types.
3
3
  */
4
- import type { FulfillmentStatus, OrderStatus, ShippingAddress } from './shared';
4
+ import type { DeliverableResponse, OrderStatus, ShippingAddress } from './shared';
5
5
  /** Full order object returned by the ListBee API. */
6
6
  export interface OrderResponse {
7
7
  /** Object type discriminator. Always "order". */
@@ -24,8 +24,8 @@ export interface OrderResponse {
24
24
  checkout_data: Record<string, unknown> | null;
25
25
  /** Shipping address collected at checkout. */
26
26
  shipping_address: ShippingAddress | null;
27
- /** Fulfillment status for this order. */
28
- fulfillment_status: FulfillmentStatus | null;
27
+ /** Deliverable associated with this order (managed fulfillment only). */
28
+ deliverable: DeliverableResponse | null;
29
29
  /** Shipping carrier name (e.g. "UPS", "FedEx"). */
30
30
  carrier: string | null;
31
31
  /** Shipping tracking code. */
@@ -36,6 +36,8 @@ export interface OrderResponse {
36
36
  paid_at: string | null;
37
37
  /** ISO 8601 timestamp of when the order was fulfilled. */
38
38
  fulfilled_at: string | null;
39
+ /** ISO 8601 timestamp of when the order was shipped. */
40
+ shipped_at: string | null;
39
41
  /** ISO 8601 timestamp of when the order was created. */
40
42
  created_at: string;
41
43
  }
@@ -56,12 +58,11 @@ export interface ListOrdersParams {
56
58
  }
57
59
  /** Parameters for fulfilling an order. */
58
60
  export interface FulfillOrderParams {
59
- /** Digital content to deliver (plain text or file content). */
60
- content?: string;
61
- /** Content type for the deliverable. */
62
- content_type?: string;
63
- /** URL to deliver to the buyer. */
64
- content_url?: string;
61
+ /**
62
+ * ID of the deliverable to attach to this order.
63
+ * Auto-detected from the listing's deliverable. Required for external listings.
64
+ */
65
+ deliverable: string;
65
66
  }
66
67
  /** Parameters for shipping an order. */
67
68
  export interface ShipOrderParams {
@@ -46,6 +46,15 @@ export interface ListResponse<T> {
46
46
  has_more: boolean;
47
47
  cursor: string | null;
48
48
  }
49
+ /** Deliverable object returned as part of a listing or order. */
50
+ export interface DeliverableResponse {
51
+ /** Object type discriminator. Always "deliverable". */
52
+ object: 'deliverable';
53
+ /** Deliverable type — auto-detected from the content at creation. */
54
+ type: 'file' | 'url' | 'text';
55
+ /** true if the deliverable content has been successfully fetched and stored. */
56
+ has_content: boolean;
57
+ }
49
58
  /** Deliverable type — auto-detected from the content value at creation. */
50
59
  export declare const DeliverableType: {
51
60
  readonly FILE: "file";
@@ -117,13 +126,6 @@ export declare const OrderStatus: {
117
126
  readonly FAILED: "failed";
118
127
  };
119
128
  export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
120
- /** Order fulfillment status. */
121
- export declare const FulfillmentStatus: {
122
- readonly PENDING: "pending";
123
- readonly SHIPPED: "shipped";
124
- readonly FULFILLED: "fulfilled";
125
- };
126
- export type FulfillmentStatus = (typeof FulfillmentStatus)[keyof typeof FulfillmentStatus];
127
129
  /** Webhook event type. */
128
130
  export declare const WebhookEventType: {
129
131
  readonly ORDER_PAID: "order.paid";
@@ -3,7 +3,7 @@
3
3
  * Shared types used across multiple resources.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.FulfillmentStatus = exports.OrderStatus = exports.CheckoutFieldType = exports.FulfillmentMode = exports.ContentType = exports.DeliverableType = void 0;
6
+ exports.ActionCode = exports.ActionKind = exports.WebhookEventType = exports.OrderStatus = exports.CheckoutFieldType = exports.FulfillmentMode = exports.ContentType = exports.DeliverableType = void 0;
7
7
  /** Deliverable type — auto-detected from the content value at creation. */
8
8
  exports.DeliverableType = {
9
9
  FILE: 'file',
@@ -35,12 +35,6 @@ exports.OrderStatus = {
35
35
  CANCELED: 'canceled',
36
36
  FAILED: 'failed',
37
37
  };
38
- /** Order fulfillment status. */
39
- exports.FulfillmentStatus = {
40
- PENDING: 'pending',
41
- SHIPPED: 'shipped',
42
- FULFILLED: 'fulfilled',
43
- };
44
38
  /** Webhook event type. */
45
39
  exports.WebhookEventType = {
46
40
  ORDER_PAID: 'order.paid',
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/types/shared.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAmDH,2EAA2E;AAC9D,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX;;;GAGG;AACU,QAAA,WAAW,GAAG,uBAAe,CAAC;AAM3C,sCAAsC;AACzB,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAGX,kDAAkD;AACrC,QAAA,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAiCX,oBAAoB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SAAS;IAClB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAGX,kDAAkD;AACrC,QAAA,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAiCX,oBAAoB;AACP,QAAA,WAAW,GAAG;IACzB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;CACR,CAAC;AAGX,0BAA0B;AACb,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EAAE,YAAY;IACxB,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,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;IAChC,iBAAiB,EAAE,mBAAmB;CAC9B,CAAC"}
@@ -14,8 +14,8 @@ export { SignupResource } from './resources/signup';
14
14
  export { StripeResource } from './resources/stripe';
15
15
  export { StoresResource } from './resources/stores';
16
16
  export { WebhooksResource } from './resources/webhooks';
17
- export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, FulfillmentStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
18
- export type { AccountReadiness, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress, } from './types/shared';
17
+ export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
18
+ export type { AccountReadiness, DeliverableResponse, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress, } from './types/shared';
19
19
  export type { AccountResponse, UpdateAccountParams, AccountStats } from './types/account';
20
20
  export type { BlurMode, CreateListingParams, FaqItem, ListingResponse, ListingStatus, Review, UpdateListingParams, } from './types/listing';
21
21
  export type { ApiKeyResponse } from './types/api-key';
package/dist/esm/index.js CHANGED
@@ -16,5 +16,5 @@ export { StripeResource } from './resources/stripe';
16
16
  export { StoresResource } from './resources/stores';
17
17
  export { WebhooksResource } from './resources/webhooks';
18
18
  // Enums (runtime values)
19
- export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, FulfillmentStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
19
+ export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './types/shared';
20
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,SAAS;AACT,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,eAAe,EACf,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAElB,YAAY;AACZ,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACx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,EAAE,MAAM,sBAAsB,CAAC;AAExD,yBAAyB;AACzB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
@@ -22,16 +22,16 @@ export declare class OrdersResource {
22
22
  */
23
23
  list(params?: ListOrdersParams): Promise<CursorPage<OrderResponse>>;
24
24
  /**
25
- * Fulfill an order — push digital content to the buyer.
25
+ * Fulfill an order — attach a deliverable and transition to FULFILLED.
26
26
  *
27
27
  * For external fulfillment listings, this allows your app to push
28
28
  * generated content back to ListBee for delivery.
29
29
  *
30
30
  * @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
31
- * @param params - Fulfillment parameters (content, content_type, content_url).
31
+ * @param params - Fulfillment parameters including the required deliverable ID.
32
32
  * @returns The updated OrderResponse.
33
33
  */
34
- fulfill(orderId: string, params?: FulfillOrderParams): Promise<OrderResponse>;
34
+ fulfill(orderId: string, params: FulfillOrderParams): Promise<OrderResponse>;
35
35
  /**
36
36
  * Mark an order as shipped with tracking information.
37
37
  *
@@ -41,23 +41,19 @@ export class OrdersResource {
41
41
  return this._client.getPage('/v1/orders', queryParams, (item) => item);
42
42
  }
43
43
  /**
44
- * Fulfill an order — push digital content to the buyer.
44
+ * Fulfill an order — attach a deliverable and transition to FULFILLED.
45
45
  *
46
46
  * For external fulfillment listings, this allows your app to push
47
47
  * generated content back to ListBee for delivery.
48
48
  *
49
49
  * @param orderId - The order ID (e.g. "ord_9xM4kP7nR2qT5wY1").
50
- * @param params - Fulfillment parameters (content, content_type, content_url).
50
+ * @param params - Fulfillment parameters including the required deliverable ID.
51
51
  * @returns The updated OrderResponse.
52
52
  */
53
- async fulfill(orderId, params = {}) {
54
- const body = {};
55
- if (params.content !== undefined)
56
- body['content'] = params.content;
57
- if (params.content_type !== undefined)
58
- body['content_type'] = params.content_type;
59
- if (params.content_url !== undefined)
60
- body['content_url'] = params.content_url;
53
+ async fulfill(orderId, params) {
54
+ const body = {
55
+ deliverable: params.deliverable,
56
+ };
61
57
  const response = await this._client.post(`/v1/orders/${orderId}/fulfill`, body);
62
58
  return (await response.json());
63
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"orders.js","sourceRoot":"","sources":["../../../src/resources/orders.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,OAAO,cAAc;IACzB,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CAAC,OAAe;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;QACjE,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;IAClD,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAC,SAA2B,EAAE;QACtC,MAAM,WAAW,GAA8C;YAC7D,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;SAC1B,CAAC;QACF,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;YAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QACvE,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;YAAE,WAAW,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;QAC1E,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvC,WAAW,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,aAAa,YAAY,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAClI,CAAC;QACD,IAAI,MAAM,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;YACxC,WAAW,CAAC,gBAAgB,CAAC,GAAG,MAA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1,5 @@
1
- export type { AccountReadiness, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress } from './shared';
2
- export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, FulfillmentStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
1
+ export type { AccountReadiness, DeliverableResponse, ListingReadiness, ReadinessAction, ListResponse, CheckoutField, ShippingAddress } from './shared';
2
+ export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
3
3
  export type { AccountResponse, UpdateAccountParams, AccountStats } from './account';
4
4
  export type { BlurMode, CreateListingParams, FaqItem, ListingResponse, ListingStatus, Review, UpdateListingParams, } from './listing';
5
5
  export type { ApiKeyResponse } from './api-key';
@@ -1,2 +1,2 @@
1
- export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, FulfillmentStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
1
+ export { ContentType, DeliverableType, FulfillmentMode, CheckoutFieldType, OrderStatus, WebhookEventType, ActionKind, ActionCode } from './shared';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Listing response types.
3
3
  */
4
- import type { CheckoutField, DeliverableType, FulfillmentMode, ListingReadiness } from './shared';
4
+ import type { CheckoutField, DeliverableResponse, FulfillmentMode, ListingReadiness } from './shared';
5
5
  /** A single buyer review card displayed on the listing product page. */
6
6
  export interface Review {
7
7
  /** Reviewer display name. */
@@ -42,10 +42,8 @@ export interface ListingResponse {
42
42
  cta: string | null;
43
43
  /** Price in the smallest currency unit (e.g. 2900 = $29.00). */
44
44
  price: number;
45
- /** Auto-detected deliverable type (file, url, text, or null for external fulfillment). */
46
- deliverable_type: DeliverableType | null;
47
- /** true if a deliverable was successfully fetched and stored. */
48
- has_deliverable: boolean;
45
+ /** Deliverable associated with this listing, or null for external fulfillment. */
46
+ deliverable: DeliverableResponse | null;
49
47
  /** Fulfillment mode — "managed" (ListBee delivers) or "external" (you deliver). */
50
48
  fulfillment: FulfillmentMode;
51
49
  /** Checkout schema — custom fields collected at checkout (max 10). */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Order response types.
3
3
  */
4
- import type { FulfillmentStatus, OrderStatus, ShippingAddress } from './shared';
4
+ import type { DeliverableResponse, OrderStatus, ShippingAddress } from './shared';
5
5
  /** Full order object returned by the ListBee API. */
6
6
  export interface OrderResponse {
7
7
  /** Object type discriminator. Always "order". */
@@ -24,8 +24,8 @@ export interface OrderResponse {
24
24
  checkout_data: Record<string, unknown> | null;
25
25
  /** Shipping address collected at checkout. */
26
26
  shipping_address: ShippingAddress | null;
27
- /** Fulfillment status for this order. */
28
- fulfillment_status: FulfillmentStatus | null;
27
+ /** Deliverable associated with this order (managed fulfillment only). */
28
+ deliverable: DeliverableResponse | null;
29
29
  /** Shipping carrier name (e.g. "UPS", "FedEx"). */
30
30
  carrier: string | null;
31
31
  /** Shipping tracking code. */
@@ -36,6 +36,8 @@ export interface OrderResponse {
36
36
  paid_at: string | null;
37
37
  /** ISO 8601 timestamp of when the order was fulfilled. */
38
38
  fulfilled_at: string | null;
39
+ /** ISO 8601 timestamp of when the order was shipped. */
40
+ shipped_at: string | null;
39
41
  /** ISO 8601 timestamp of when the order was created. */
40
42
  created_at: string;
41
43
  }
@@ -56,12 +58,11 @@ export interface ListOrdersParams {
56
58
  }
57
59
  /** Parameters for fulfilling an order. */
58
60
  export interface FulfillOrderParams {
59
- /** Digital content to deliver (plain text or file content). */
60
- content?: string;
61
- /** Content type for the deliverable. */
62
- content_type?: string;
63
- /** URL to deliver to the buyer. */
64
- content_url?: string;
61
+ /**
62
+ * ID of the deliverable to attach to this order.
63
+ * Auto-detected from the listing's deliverable. Required for external listings.
64
+ */
65
+ deliverable: string;
65
66
  }
66
67
  /** Parameters for shipping an order. */
67
68
  export interface ShipOrderParams {
@@ -46,6 +46,15 @@ export interface ListResponse<T> {
46
46
  has_more: boolean;
47
47
  cursor: string | null;
48
48
  }
49
+ /** Deliverable object returned as part of a listing or order. */
50
+ export interface DeliverableResponse {
51
+ /** Object type discriminator. Always "deliverable". */
52
+ object: 'deliverable';
53
+ /** Deliverable type — auto-detected from the content at creation. */
54
+ type: 'file' | 'url' | 'text';
55
+ /** true if the deliverable content has been successfully fetched and stored. */
56
+ has_content: boolean;
57
+ }
49
58
  /** Deliverable type — auto-detected from the content value at creation. */
50
59
  export declare const DeliverableType: {
51
60
  readonly FILE: "file";
@@ -117,13 +126,6 @@ export declare const OrderStatus: {
117
126
  readonly FAILED: "failed";
118
127
  };
119
128
  export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
120
- /** Order fulfillment status. */
121
- export declare const FulfillmentStatus: {
122
- readonly PENDING: "pending";
123
- readonly SHIPPED: "shipped";
124
- readonly FULFILLED: "fulfilled";
125
- };
126
- export type FulfillmentStatus = (typeof FulfillmentStatus)[keyof typeof FulfillmentStatus];
127
129
  /** Webhook event type. */
128
130
  export declare const WebhookEventType: {
129
131
  readonly ORDER_PAID: "order.paid";
@@ -32,12 +32,6 @@ export const OrderStatus = {
32
32
  CANCELED: 'canceled',
33
33
  FAILED: 'failed',
34
34
  };
35
- /** Order fulfillment status. */
36
- export const FulfillmentStatus = {
37
- PENDING: 'pending',
38
- SHIPPED: 'shipped',
39
- FULFILLED: 'fulfilled',
40
- };
41
35
  /** Webhook event type. */
42
36
  export const WebhookEventType = {
43
37
  ORDER_PAID: 'order.paid',
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/types/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmDH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAM3C,sCAAsC;AACtC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAGX,kDAAkD;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAiCX,oBAAoB;AACpB,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;CACR,CAAC;AAGX,gCAAgC;AAChC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CACd,CAAC;AAGX,0BAA0B;AAC1B,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,YAAY;IACxB,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,oBAAoB,EAAE,sBAAsB;IAC5C,e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,gBAAgB,GAAG;IAC9B,UAAU,EAAE,YAAY;IACxB,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,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;IAChC,iBAAiB,EAAE,mBAAmB;CAC9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listbee",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Official TypeScript SDK for the ListBee API — one API call to sell and deliver digital content.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://listbee.so",