@izak0s/spacebring-api 10.2.0 → 10.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.
package/dist/index.js CHANGED
@@ -1031,6 +1031,58 @@ function createBilling(client, defaults) {
1031
1031
  };
1032
1032
  }
1033
1033
 
1034
+ // src/generated/resources/checkIns.ts
1035
+ function createCheckins(client, defaults) {
1036
+ return {
1037
+ /**
1038
+ * Retrieve check-ins
1039
+ *
1040
+ * Retrieve the check-ins of a location, newest arrival first. With bearer token authentication, the user must be an administrator of the location.
1041
+ */
1042
+ async list(query, options) {
1043
+ return unwrap(await client.GET("/check_ins/v1", { params: { query }, signal: options?.signal }), "GET /check_ins/v1");
1044
+ },
1045
+ /**
1046
+ * Retrieve check-ins — iterates every item across all pages.
1047
+ *
1048
+ * Retrieve the check-ins of a location, newest arrival first. With bearer token authentication, the user must be an administrator of the location.
1049
+ */
1050
+ iterate(query, options) {
1051
+ return paginate(
1052
+ async (nextPageToken) => unwrap(await client.GET("/check_ins/v1", { params: { query: { ...query, nextPageToken } }, signal: options?.signal }), "GET /check_ins/v1"),
1053
+ "checkIns"
1054
+ );
1055
+ },
1056
+ /**
1057
+ * Get a check-in
1058
+ *
1059
+ * Get a check-in by its id. With bearer token authentication, the user must be an administrator of the check-in's location.
1060
+ *
1061
+ * @param checkInId The ID of the check-in.
1062
+ * @param options Request options (abort signal).
1063
+ */
1064
+ async get(checkInId, options) {
1065
+ return unwrapProp(await client.GET("/check_ins/v1/{checkInId}", { params: { path: { checkInId } }, signal: options?.signal }), "checkIn", "GET /check_ins/v1/{checkInId}");
1066
+ },
1067
+ /**
1068
+ * Check in
1069
+ *
1070
+ * Record an arrival for a booking, an event ticket, a visit, or a member's subscription. Identify what to check in with its check-in id, with the location and a six-digit code, or with the location and a customer ref to check a member in without a code. With bearer token authentication, the user must be an administrator of the location.
1071
+ */
1072
+ async checkIn(body, options) {
1073
+ return unwrapProp(await client.POST("/check_ins/v1/checkin", { body, signal: options?.signal }), "checkIn", "POST /check_ins/v1/checkin");
1074
+ },
1075
+ /**
1076
+ * Check out
1077
+ *
1078
+ * Record a departure on an open check-in. Identify it with its check-in id, or with the location and the six-digit code it was opened with. With bearer token authentication, the user must be an administrator of the location.
1079
+ */
1080
+ async checkOut(body, options) {
1081
+ return unwrapProp(await client.POST("/check_ins/v1/checkout", { body, signal: options?.signal }), "checkIn", "POST /check_ins/v1/checkout");
1082
+ }
1083
+ };
1084
+ }
1085
+
1034
1086
  // src/generated/resources/community.ts
1035
1087
  function createCommunity(client, defaults) {
1036
1088
  return {
@@ -1080,6 +1132,14 @@ function createCommunity(client, defaults) {
1080
1132
  */
1081
1133
  async update(id, company, options) {
1082
1134
  return unwrapProp(await client.PUT("/community/companies/v1/{id}", { params: { path: { id } }, body: { company }, signal: options?.signal }), "company", "PUT /community/companies/v1/{id}");
1135
+ },
1136
+ /**
1137
+ * Create a logo upload
1138
+ *
1139
+ * Create an upload for a company logo. The response carries a presigned URL: send the raw file bytes with a PUT request within a minute, using exactly the headers returned. Once the file is stored, pass the returned key as `logo.key` when creating or updating a company within an hour; a logo that is not attached by then is discarded.
1140
+ */
1141
+ async createMedia(media, options) {
1142
+ return unwrapProp(await client.POST("/community/companies/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /community/companies/v1/media");
1083
1143
  }
1084
1144
  },
1085
1145
  memberships: {
@@ -1310,7 +1370,7 @@ function createContracts(client, defaults) {
1310
1370
  /**
1311
1371
  * Create a template
1312
1372
  *
1313
- * Create a contract template from an uploaded file.
1373
+ * Create a contract template from a .docx file uploaded through the template upload endpoint.
1314
1374
  */
1315
1375
  async create(template, options) {
1316
1376
  return unwrapProp(await client.POST("/contracts/templates/v1", { body: { template }, signal: options?.signal }), "template", "POST /contracts/templates/v1");
@@ -1318,7 +1378,7 @@ function createContracts(client, defaults) {
1318
1378
  /**
1319
1379
  * Update a template
1320
1380
  *
1321
- * Update a contract template.
1381
+ * Update a contract template. A new file is uploaded through the template upload endpoint.
1322
1382
  *
1323
1383
  * @param templateId The id of the template.
1324
1384
  * @param template The `template` payload.
@@ -1338,6 +1398,14 @@ function createContracts(client, defaults) {
1338
1398
  async delete(templateId, options) {
1339
1399
  return unwrap(await client.DELETE("/contracts/templates/v1/{templateId}", { params: { path: { templateId } }, signal: options?.signal }), "DELETE /contracts/templates/v1/{templateId}");
1340
1400
  },
1401
+ /**
1402
+ * Create a template upload
1403
+ *
1404
+ * Create a media upload for a contract template file, a .docx document of up to 50 MB. The response carries a presigned URL: send the raw file bytes with a PUT request within a minute, using exactly the headers returned. Once the file is stored, pass the returned key as `template.file.key` when creating or updating a template within an hour; a file that is not attached by then is discarded.
1405
+ */
1406
+ async createMedia(media, options) {
1407
+ return unwrapProp(await client.POST("/contracts/templates/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /contracts/templates/v1/media");
1408
+ },
1341
1409
  /**
1342
1410
  * Duplicate a template
1343
1411
  *
@@ -1588,6 +1656,14 @@ function createEvents(client, defaults) {
1588
1656
  // src/generated/resources/feed.ts
1589
1657
  function createFeed(client, defaults) {
1590
1658
  return {
1659
+ /**
1660
+ * Create a media upload
1661
+ *
1662
+ * Create a media upload for an image or a video in a post. The response carries a presigned URL: send the raw file bytes with a PUT request within a minute, using exactly the headers returned. Once the file is stored, pass the returned key in `media[].key` when creating or updating a post within an hour; a file that is not attached by then is discarded. A video must declare its `width` and `height`; an image's dimensions are read from the file.
1663
+ */
1664
+ async createMedia(media, options) {
1665
+ return unwrapProp(await client.POST("/feed/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /feed/v1/media");
1666
+ },
1591
1667
  comments: {
1592
1668
  /**
1593
1669
  * Create a post comment
@@ -1807,6 +1883,14 @@ function createGuides(client, defaults) {
1807
1883
  */
1808
1884
  async delete(guideId, options) {
1809
1885
  return unwrap(await client.DELETE("/guides/v1/{guideId}", { params: { path: { guideId } }, signal: options?.signal }), "DELETE /guides/v1/{guideId}");
1886
+ },
1887
+ /**
1888
+ * Create a media upload
1889
+ *
1890
+ * Create a media upload for an image or a video in a guide. The response carries a presigned URL: send the raw file bytes with a PUT request within a minute, using exactly the headers returned. Once the file is stored, add the returned url to the guide `description` as a Markdown image, `![alt text](url)`, when creating or updating a guide within an hour; a file that is not attached by then is discarded. A video must declare its `width` and `height`; an image's dimensions are read from the file.
1891
+ */
1892
+ async createMedia(media, options) {
1893
+ return unwrapProp(await client.POST("/guides/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /guides/v1/media");
1810
1894
  }
1811
1895
  };
1812
1896
  }
@@ -2033,6 +2117,14 @@ function createResources(client, defaults) {
2033
2117
  async update(resourceId, resource, options) {
2034
2118
  return unwrap(await client.PATCH("/resources/v1/{resourceId}", { params: { path: { resourceId } }, body: { resource }, signal: options?.signal }), "PATCH /resources/v1/{resourceId}");
2035
2119
  },
2120
+ /**
2121
+ * Create a media upload
2122
+ *
2123
+ * Create a media upload for a resource photo. The response carries a presigned URL: send the raw file bytes with a PUT request within a minute, using exactly the headers returned. Once the file is stored, add the returned key to `media` when creating or updating a resource within an hour; an image that is not attached by then is discarded. A resource holds up to 10 photos, the first being its cover.
2124
+ */
2125
+ async createMedia(media, options) {
2126
+ return unwrapProp(await client.POST("/resources/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /resources/v1/media");
2127
+ },
2036
2128
  /**
2037
2129
  * Check resource availability
2038
2130
  *
@@ -2292,6 +2384,14 @@ function createShop(client, defaults) {
2292
2384
  */
2293
2385
  async delete(productId, options) {
2294
2386
  return unwrap(await client.DELETE("/shop/products/v1/{productId}", { params: { path: { productId } }, signal: options?.signal }), "DELETE /shop/products/v1/{productId}");
2387
+ },
2388
+ /**
2389
+ * Create a media upload
2390
+ *
2391
+ * Create a media upload for a product cover image. The response carries a presigned URL: send the raw file bytes with a PUT request within a minute, using exactly the headers returned. Once the file is stored, pass the returned key as `media[0].key` when creating or updating a product within an hour; an image that is not attached by then is discarded.
2392
+ */
2393
+ async createMedia(media, options) {
2394
+ return unwrapProp(await client.POST("/shop/products/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /shop/products/v1/media");
2295
2395
  }
2296
2396
  }
2297
2397
  };
@@ -2847,6 +2947,7 @@ function createResources2(client, defaults) {
2847
2947
  altCurrencies: createAltcurrencies(client, defaults),
2848
2948
  benefits: createBenefits(client, defaults),
2849
2949
  billing: createBilling(client, defaults),
2950
+ checkIns: createCheckins(client, defaults),
2850
2951
  community: createCommunity(client, defaults),
2851
2952
  contracts: createContracts(client, defaults),
2852
2953
  discounts: createDiscounts(client, defaults),