listbee 0.6.1 → 0.6.2
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 +39 -10
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# listbee
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/listbee)
|
|
4
|
+
[](https://github.com/listbee-dev/listbee-typescript/actions/workflows/ci.yml)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
3
7
|
Official TypeScript SDK for the [ListBee API](https://listbee.so) — one API call to sell and deliver digital content.
|
|
4
8
|
|
|
5
9
|
- Zero runtime dependencies (native fetch, Node >= 18)
|
|
@@ -34,7 +38,9 @@ const listing = await client.listings.create({
|
|
|
34
38
|
});
|
|
35
39
|
|
|
36
40
|
await client.listings.setDeliverables(listing.id, {
|
|
37
|
-
|
|
41
|
+
deliverables: [
|
|
42
|
+
{ type: 'url', value: 'https://example.com/seo-playbook.pdf' },
|
|
43
|
+
],
|
|
38
44
|
});
|
|
39
45
|
|
|
40
46
|
const published = await client.listings.publish(listing.id);
|
|
@@ -67,7 +73,7 @@ The key is validated lazily — an `AuthenticationError` is raised only when you
|
|
|
67
73
|
| Resource | Methods |
|
|
68
74
|
|----------|---------|
|
|
69
75
|
| `listings` | `create`, `get`, `list`, `update`, `publish`, `setDeliverables`, `removeDeliverables`, `delete` |
|
|
70
|
-
| `orders` | `get`, `list`, `deliver`, `refund` |
|
|
76
|
+
| `orders` | `get`, `list`, `deliver`, `ship`, `refund` |
|
|
71
77
|
| `customers` | `get`, `list` |
|
|
72
78
|
| `files` | `upload` |
|
|
73
79
|
| `webhooks` | `create`, `get`, `list`, `update`, `delete`, `listEvents`, `retryEvent`, `test`, `verify` |
|
|
@@ -95,7 +101,9 @@ console.log(listing.id); // lst_r7kq2xy9m3pR5tW1
|
|
|
95
101
|
|
|
96
102
|
// Set deliverables (file, URL, or text)
|
|
97
103
|
await client.listings.setDeliverables(listing.id, {
|
|
98
|
-
|
|
104
|
+
deliverables: [
|
|
105
|
+
{ type: 'url', value: 'https://example.com/seo-playbook.pdf' },
|
|
106
|
+
],
|
|
99
107
|
});
|
|
100
108
|
|
|
101
109
|
// Publish
|
|
@@ -145,15 +153,26 @@ console.log(order.paid_at); // ISO 8601 timestamp
|
|
|
145
153
|
|
|
146
154
|
// Deliver — push content to the buyer (external fulfillment)
|
|
147
155
|
const fulfilled = await client.orders.deliver('ord_9xM4kP7nR2qT5wY1', {
|
|
148
|
-
|
|
149
|
-
|
|
156
|
+
deliverables: [
|
|
157
|
+
{ type: 'text', value: 'Your AI-generated report is ready.' },
|
|
158
|
+
],
|
|
150
159
|
});
|
|
151
160
|
console.log(fulfilled.status); // "fulfilled"
|
|
152
161
|
|
|
153
|
-
// Or
|
|
162
|
+
// Or deliver a file or URL
|
|
154
163
|
await client.orders.deliver('ord_9xM4kP7nR2qT5wY1', {
|
|
155
|
-
|
|
164
|
+
deliverables: [
|
|
165
|
+
{ type: 'url', value: 'https://example.com/report.pdf' },
|
|
166
|
+
],
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// Ship — add tracking for physical orders
|
|
170
|
+
const shipped = await client.orders.ship('ord_9xM4kP7nR2qT5wY1', {
|
|
171
|
+
carrier: 'USPS',
|
|
172
|
+
tracking_code: '9400111899223',
|
|
173
|
+
seller_note: 'Enjoy your purchase!',
|
|
156
174
|
});
|
|
175
|
+
console.log(shipped.status); // "fulfilled"
|
|
157
176
|
|
|
158
177
|
// Refund
|
|
159
178
|
const refunded = await client.orders.refund('ord_9xM4kP7nR2qT5wY1');
|
|
@@ -187,7 +206,11 @@ const file = await client.files.upload({
|
|
|
187
206
|
console.log(file.id); // use this ID in setDeliverables
|
|
188
207
|
|
|
189
208
|
// Then attach to a listing
|
|
190
|
-
await client.listings.setDeliverables(listing.id, {
|
|
209
|
+
await client.listings.setDeliverables(listing.id, {
|
|
210
|
+
deliverables: [
|
|
211
|
+
{ type: 'file', token: file.id },
|
|
212
|
+
],
|
|
213
|
+
});
|
|
191
214
|
```
|
|
192
215
|
|
|
193
216
|
### Webhooks
|
|
@@ -296,8 +319,9 @@ await client.listings.publish(listing.id);
|
|
|
296
319
|
|
|
297
320
|
// On order.paid webhook:
|
|
298
321
|
await client.orders.deliver(order.id, {
|
|
299
|
-
|
|
300
|
-
|
|
322
|
+
deliverables: [
|
|
323
|
+
{ type: 'text', value: generatedReport },
|
|
324
|
+
],
|
|
301
325
|
});
|
|
302
326
|
```
|
|
303
327
|
|
|
@@ -448,9 +472,14 @@ import {
|
|
|
448
472
|
|
|
449
473
|
Apache-2.0. See [LICENSE](LICENSE).
|
|
450
474
|
|
|
475
|
+
## Contributing
|
|
476
|
+
|
|
477
|
+
Bug reports and feature requests welcome — open an issue on [GitHub](https://github.com/listbee-dev/listbee-typescript/issues).
|
|
478
|
+
|
|
451
479
|
## Links
|
|
452
480
|
|
|
453
481
|
- [Documentation](https://docs.listbee.so)
|
|
454
482
|
- [API Reference](https://docs.listbee.so/api)
|
|
455
483
|
- [GitHub](https://github.com/listbee-dev/listbee-typescript)
|
|
456
484
|
- [npm](https://www.npmjs.com/package/listbee)
|
|
485
|
+
- [Changelog](https://github.com/listbee-dev/listbee-typescript/blob/main/CHANGELOG.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "listbee",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
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",
|
|
@@ -17,8 +17,14 @@
|
|
|
17
17
|
"types": "dist/cjs/index.d.ts",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"import": {
|
|
21
|
-
|
|
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
|
+
}
|
|
22
28
|
}
|
|
23
29
|
},
|
|
24
30
|
"files": [
|
|
@@ -38,6 +44,9 @@
|
|
|
38
44
|
"listbee",
|
|
39
45
|
"commerce",
|
|
40
46
|
"digital-products",
|
|
47
|
+
"payments",
|
|
48
|
+
"checkout",
|
|
49
|
+
"sell",
|
|
41
50
|
"api",
|
|
42
51
|
"sdk"
|
|
43
52
|
],
|