@izak0s/spacebring-api 13.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 +98 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1045 -71
- package/dist/index.d.ts +1045 -71
- package/dist/index.js +98 -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
|
};
|
|
@@ -1989,6 +2036,15 @@ function createPackages(client, defaults) {
|
|
|
1989
2036
|
"packages"
|
|
1990
2037
|
);
|
|
1991
2038
|
},
|
|
2039
|
+
/**
|
|
2040
|
+
* Retrieve a package
|
|
2041
|
+
*
|
|
2042
|
+
* @param packageId The id of the package.
|
|
2043
|
+
* @param options Request options (abort signal).
|
|
2044
|
+
*/
|
|
2045
|
+
async get(packageId, options) {
|
|
2046
|
+
return unwrapProp(await client.GET("/packages/v1/{packageId}", { params: { path: { packageId } }, signal: options?.signal }), "package", "GET /packages/v1/{packageId}");
|
|
2047
|
+
},
|
|
1992
2048
|
/** Create a package */
|
|
1993
2049
|
async create(packageBody, options) {
|
|
1994
2050
|
return unwrapProp(await client.POST("/packages/v1", { body: { package: packageBody }, signal: options?.signal }), "package", "POST /packages/v1");
|
|
@@ -2156,6 +2212,15 @@ function createResources(client, defaults) {
|
|
|
2156
2212
|
async update(resourceId, resource, options) {
|
|
2157
2213
|
return unwrap(await client.PATCH("/resources/v1/{resourceId}", { params: { path: { resourceId } }, body: { resource }, signal: options?.signal }), "PATCH /resources/v1/{resourceId}");
|
|
2158
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
|
+
},
|
|
2159
2224
|
/**
|
|
2160
2225
|
* Create a media upload
|
|
2161
2226
|
*
|
|
@@ -2196,6 +2261,15 @@ function createResources(client, defaults) {
|
|
|
2196
2261
|
"assignments"
|
|
2197
2262
|
);
|
|
2198
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
|
+
},
|
|
2199
2273
|
/**
|
|
2200
2274
|
* Create a resource assignment
|
|
2201
2275
|
*
|
|
@@ -2215,6 +2289,17 @@ function createResources(client, defaults) {
|
|
|
2215
2289
|
*/
|
|
2216
2290
|
async update(assignmentId, assignment, options) {
|
|
2217
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}");
|
|
2218
2303
|
}
|
|
2219
2304
|
},
|
|
2220
2305
|
bookings: {
|
|
@@ -2282,7 +2367,7 @@ function createShop(client, defaults) {
|
|
|
2282
2367
|
/**
|
|
2283
2368
|
* Retrieve categories
|
|
2284
2369
|
*
|
|
2285
|
-
* Retrieve
|
|
2370
|
+
* Retrieve the shop categories of a location, or of every location in the network.
|
|
2286
2371
|
*/
|
|
2287
2372
|
async list(query, options) {
|
|
2288
2373
|
return unwrapProp(await client.GET("/shop/categories/v1", { params: { query }, signal: options?.signal }), "categories", "GET /shop/categories/v1");
|
|
@@ -2431,6 +2516,18 @@ function createShop(client, defaults) {
|
|
|
2431
2516
|
*/
|
|
2432
2517
|
async createMedia(media, options) {
|
|
2433
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}");
|
|
2434
2531
|
}
|
|
2435
2532
|
}
|
|
2436
2533
|
};
|