@izak0s/spacebring-api 14.0.0 → 15.0.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 +1 -1
- package/dist/index.cjs +89 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1003 -65
- package/dist/index.d.ts +1003 -65
- package/dist/index.js +89 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ A fully-typed TypeScript client for the [Spacebring](https://www.spacebring.com)
|
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- **<!-- coverage -->
|
|
18
|
+
- **<!-- coverage -->218 operations across 22 resource groups<!-- /coverage -->** — the full Spacebring API surface
|
|
19
19
|
- **Auto-generated** from the official OpenAPI spec — types and facade regenerate anytime the spec changes
|
|
20
20
|
- **Nested, discoverable API** — `sb.billing.invoices.pay(id)`, `sb.visitors.visits.checkIn(body)`
|
|
21
21
|
- **Auto-pagination** — every paginated list endpoint has an `iterate()` async generator that walks `nextPageToken` for you
|
package/dist/index.cjs
CHANGED
|
@@ -695,6 +695,18 @@ function createBenefits(client, defaults) {
|
|
|
695
695
|
async createMedia(media, options) {
|
|
696
696
|
return unwrapProp(await client.POST("/benefits/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /benefits/v1/media");
|
|
697
697
|
},
|
|
698
|
+
/**
|
|
699
|
+
* Partially update a benefit
|
|
700
|
+
*
|
|
701
|
+
* Update the fields of a benefit that the request sets; omitted fields keep their current values.
|
|
702
|
+
*
|
|
703
|
+
* @param benefitId The id of the benefit
|
|
704
|
+
* @param benefit The `benefit` payload.
|
|
705
|
+
* @param options Request options (abort signal).
|
|
706
|
+
*/
|
|
707
|
+
async patch(benefitId, benefit, options) {
|
|
708
|
+
return unwrap(await client.PATCH("/benefits/v1/{benefitId}", { params: { path: { benefitId } }, body: { benefit }, signal: options?.signal }), "PATCH /benefits/v1/{benefitId}");
|
|
709
|
+
},
|
|
698
710
|
applications: {
|
|
699
711
|
/**
|
|
700
712
|
* Retrieve applications
|
|
@@ -845,6 +857,17 @@ function createBilling(client, defaults) {
|
|
|
845
857
|
*/
|
|
846
858
|
async preview(creditNote, options) {
|
|
847
859
|
return unwrapProp(await client.POST("/billing/credit_notes/v1/preview", { body: { creditNote }, signal: options?.signal }), "creditNote", "POST /billing/credit_notes/v1/preview");
|
|
860
|
+
},
|
|
861
|
+
/**
|
|
862
|
+
* Void a credit note
|
|
863
|
+
*
|
|
864
|
+
* Void a credit note permanently: the amount it took off the invoice is owed again. Only an issued credit note of type `prePayment` can be voided, while its invoice is still issued, unpaid and has no payment in progress.
|
|
865
|
+
*
|
|
866
|
+
* @param id The id of the credit note
|
|
867
|
+
* @param options Request options (abort signal).
|
|
868
|
+
*/
|
|
869
|
+
async void(id, options) {
|
|
870
|
+
return unwrapProp(await client.PUT("/billing/credit_notes/v1/{id}/void", { params: { path: { id } }, signal: options?.signal }), "creditNote", "PUT /billing/credit_notes/v1/{id}/void");
|
|
848
871
|
}
|
|
849
872
|
},
|
|
850
873
|
invoices: {
|
|
@@ -1613,6 +1636,18 @@ function createEvents(client, defaults) {
|
|
|
1613
1636
|
async createMedia(media, options) {
|
|
1614
1637
|
return unwrapProp(await client.POST("/events/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /events/v1/media");
|
|
1615
1638
|
},
|
|
1639
|
+
/**
|
|
1640
|
+
* Partially update an event
|
|
1641
|
+
*
|
|
1642
|
+
* Update the fields of an event that the request sets; omitted fields keep their current values.
|
|
1643
|
+
*
|
|
1644
|
+
* @param id The id of the event.
|
|
1645
|
+
* @param event The `event` payload.
|
|
1646
|
+
* @param options Request options (abort signal).
|
|
1647
|
+
*/
|
|
1648
|
+
async patch(id, event, options) {
|
|
1649
|
+
return unwrap(await client.PATCH("/events/v1/{id}", { params: { path: { id } }, body: { event }, signal: options?.signal }), "PATCH /events/v1/{id}");
|
|
1650
|
+
},
|
|
1616
1651
|
tickets: {
|
|
1617
1652
|
/**
|
|
1618
1653
|
* Retrieve tickets
|
|
@@ -1829,6 +1864,18 @@ function createFeed(client, defaults) {
|
|
|
1829
1864
|
*/
|
|
1830
1865
|
async getLikes(id, options) {
|
|
1831
1866
|
return unwrapProp(await client.GET("/feed/posts/v1/{id}/likes", { params: { path: { id } }, signal: options?.signal }), "likes", "GET /feed/posts/v1/{id}/likes");
|
|
1867
|
+
},
|
|
1868
|
+
/**
|
|
1869
|
+
* Partially update a post
|
|
1870
|
+
*
|
|
1871
|
+
* Update the fields of a feed post that the request sets; omitted fields keep their current values.
|
|
1872
|
+
*
|
|
1873
|
+
* @param id The id of the post.
|
|
1874
|
+
* @param post The `post` payload.
|
|
1875
|
+
* @param options Request options (abort signal).
|
|
1876
|
+
*/
|
|
1877
|
+
async patch(id, post, options) {
|
|
1878
|
+
return unwrap(await client.PATCH("/feed/posts/v1/{id}", { params: { path: { id } }, body: { post }, signal: options?.signal }), "PATCH /feed/posts/v1/{id}");
|
|
1832
1879
|
}
|
|
1833
1880
|
}
|
|
1834
1881
|
};
|
|
@@ -2165,6 +2212,15 @@ function createResources(client, defaults) {
|
|
|
2165
2212
|
async update(resourceId, resource, options) {
|
|
2166
2213
|
return unwrap(await client.PATCH("/resources/v1/{resourceId}", { params: { path: { resourceId } }, body: { resource }, signal: options?.signal }), "PATCH /resources/v1/{resourceId}");
|
|
2167
2214
|
},
|
|
2215
|
+
/**
|
|
2216
|
+
* Delete a resource
|
|
2217
|
+
*
|
|
2218
|
+
* @param resourceId The id of the resource.
|
|
2219
|
+
* @param options Request options (abort signal).
|
|
2220
|
+
*/
|
|
2221
|
+
async delete(resourceId, options) {
|
|
2222
|
+
return unwrap(await client.DELETE("/resources/v1/{resourceId}", { params: { path: { resourceId } }, signal: options?.signal }), "DELETE /resources/v1/{resourceId}");
|
|
2223
|
+
},
|
|
2168
2224
|
/**
|
|
2169
2225
|
* Create a media upload
|
|
2170
2226
|
*
|
|
@@ -2205,6 +2261,15 @@ function createResources(client, defaults) {
|
|
|
2205
2261
|
"assignments"
|
|
2206
2262
|
);
|
|
2207
2263
|
},
|
|
2264
|
+
/**
|
|
2265
|
+
* Get a resource assignment
|
|
2266
|
+
*
|
|
2267
|
+
* @param assignmentId The id of the assignment.
|
|
2268
|
+
* @param options Request options (abort signal).
|
|
2269
|
+
*/
|
|
2270
|
+
async get(assignmentId, options) {
|
|
2271
|
+
return unwrapProp(await client.GET("/resources/v1/assignments/{assignmentId}", { params: { path: { assignmentId } }, signal: options?.signal }), "assignment", "GET /resources/v1/assignments/{assignmentId}");
|
|
2272
|
+
},
|
|
2208
2273
|
/**
|
|
2209
2274
|
* Create a resource assignment
|
|
2210
2275
|
*
|
|
@@ -2224,6 +2289,17 @@ function createResources(client, defaults) {
|
|
|
2224
2289
|
*/
|
|
2225
2290
|
async update(assignmentId, assignment, options) {
|
|
2226
2291
|
return unwrap(await client.PATCH("/resources/v1/assignments/{assignmentId}", { params: { path: { assignmentId } }, body: { assignment }, signal: options?.signal }), "PATCH /resources/v1/assignments/{assignmentId}");
|
|
2292
|
+
},
|
|
2293
|
+
/**
|
|
2294
|
+
* Delete a resource assignment
|
|
2295
|
+
*
|
|
2296
|
+
* Delete a resource assignment. An assignment created by a subscription is removed with its subscription instead.
|
|
2297
|
+
*
|
|
2298
|
+
* @param assignmentId The id of the assignment.
|
|
2299
|
+
* @param options Request options (abort signal).
|
|
2300
|
+
*/
|
|
2301
|
+
async delete(assignmentId, options) {
|
|
2302
|
+
return unwrap(await client.DELETE("/resources/v1/assignments/{assignmentId}", { params: { path: { assignmentId } }, signal: options?.signal }), "DELETE /resources/v1/assignments/{assignmentId}");
|
|
2227
2303
|
}
|
|
2228
2304
|
},
|
|
2229
2305
|
bookings: {
|
|
@@ -2291,7 +2367,7 @@ function createShop(client, defaults) {
|
|
|
2291
2367
|
/**
|
|
2292
2368
|
* Retrieve categories
|
|
2293
2369
|
*
|
|
2294
|
-
* Retrieve
|
|
2370
|
+
* Retrieve the shop categories of a location, or of every location in the network.
|
|
2295
2371
|
*/
|
|
2296
2372
|
async list(query, options) {
|
|
2297
2373
|
return unwrapProp(await client.GET("/shop/categories/v1", { params: { query }, signal: options?.signal }), "categories", "GET /shop/categories/v1");
|
|
@@ -2440,6 +2516,18 @@ function createShop(client, defaults) {
|
|
|
2440
2516
|
*/
|
|
2441
2517
|
async createMedia(media, options) {
|
|
2442
2518
|
return unwrapProp(await client.POST("/shop/products/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /shop/products/v1/media");
|
|
2519
|
+
},
|
|
2520
|
+
/**
|
|
2521
|
+
* Partially update a product
|
|
2522
|
+
*
|
|
2523
|
+
* Update the fields of a product that the request sets; omitted fields keep their current values.
|
|
2524
|
+
*
|
|
2525
|
+
* @param productId The id of the product.
|
|
2526
|
+
* @param product The `product` payload.
|
|
2527
|
+
* @param options Request options (abort signal).
|
|
2528
|
+
*/
|
|
2529
|
+
async patch(productId, product, options) {
|
|
2530
|
+
return unwrap(await client.PATCH("/shop/products/v1/{productId}", { params: { path: { productId } }, body: { product }, signal: options?.signal }), "PATCH /shop/products/v1/{productId}");
|
|
2443
2531
|
}
|
|
2444
2532
|
}
|
|
2445
2533
|
};
|