@izak0s/spacebring-api 10.2.0 → 10.4.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,22 @@ 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 an attachment upload
1889
+ *
1890
+ * Create an upload for a file to attach to a guide, of any type 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 in `attachments[].key` when creating or updating a guide within an hour; a file that is not attached by then is discarded. The file is served as a download under the declared name.
1891
+ */
1892
+ async createAttachment(attachment, options) {
1893
+ return unwrapProp(await client.POST("/guides/v1/attachments", { body: { attachment }, signal: options?.signal }), "attachment", "POST /guides/v1/attachments");
1894
+ },
1895
+ /**
1896
+ * Create a media upload
1897
+ *
1898
+ * 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.
1899
+ */
1900
+ async createMedia(media, options) {
1901
+ return unwrapProp(await client.POST("/guides/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /guides/v1/media");
1810
1902
  }
1811
1903
  };
1812
1904
  }
@@ -2033,6 +2125,14 @@ function createResources(client, defaults) {
2033
2125
  async update(resourceId, resource, options) {
2034
2126
  return unwrap(await client.PATCH("/resources/v1/{resourceId}", { params: { path: { resourceId } }, body: { resource }, signal: options?.signal }), "PATCH /resources/v1/{resourceId}");
2035
2127
  },
2128
+ /**
2129
+ * Create a media upload
2130
+ *
2131
+ * 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.
2132
+ */
2133
+ async createMedia(media, options) {
2134
+ return unwrapProp(await client.POST("/resources/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /resources/v1/media");
2135
+ },
2036
2136
  /**
2037
2137
  * Check resource availability
2038
2138
  *
@@ -2292,6 +2392,14 @@ function createShop(client, defaults) {
2292
2392
  */
2293
2393
  async delete(productId, options) {
2294
2394
  return unwrap(await client.DELETE("/shop/products/v1/{productId}", { params: { path: { productId } }, signal: options?.signal }), "DELETE /shop/products/v1/{productId}");
2395
+ },
2396
+ /**
2397
+ * Create a media upload
2398
+ *
2399
+ * 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.
2400
+ */
2401
+ async createMedia(media, options) {
2402
+ return unwrapProp(await client.POST("/shop/products/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /shop/products/v1/media");
2295
2403
  }
2296
2404
  }
2297
2405
  };
@@ -2429,6 +2537,14 @@ function createSupport(client, defaults) {
2429
2537
  async create(ticket, options) {
2430
2538
  return unwrap(await client.POST("/support/tickets/v1", { body: { ticket }, signal: options?.signal }), "POST /support/tickets/v1");
2431
2539
  },
2540
+ /**
2541
+ * Create a ticket media upload
2542
+ *
2543
+ * Create a media upload for a ticket comment attachment, a file of any type 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 `activity.attachments[0].key` when creating a ticket comment within 25 minutes; a file that is not attached by then is discarded.
2544
+ */
2545
+ async createMedia(media, options) {
2546
+ return unwrapProp(await client.POST("/support/tickets/v1/media", { body: { media }, signal: options?.signal }), "media", "POST /support/tickets/v1/media");
2547
+ },
2432
2548
  /**
2433
2549
  * Update a ticket's assignee
2434
2550
  *
@@ -2469,7 +2585,7 @@ function createSupport(client, defaults) {
2469
2585
  /**
2470
2586
  * Create a ticket comment
2471
2587
  *
2472
- * Create a support ticket comment.
2588
+ * Create a support ticket comment. To attach a file, create a media upload first, send the file, then pass its key as `activity.attachments[0].key`; a 409 response means the file has not been received yet, so retry shortly.
2473
2589
  */
2474
2590
  async create(activity, options) {
2475
2591
  return unwrapProp(await client.POST("/support/tickets/v1/comment", { body: { activity }, signal: options?.signal }), "activity", "POST /support/tickets/v1/comment");
@@ -2847,6 +2963,7 @@ function createResources2(client, defaults) {
2847
2963
  altCurrencies: createAltcurrencies(client, defaults),
2848
2964
  benefits: createBenefits(client, defaults),
2849
2965
  billing: createBilling(client, defaults),
2966
+ checkIns: createCheckins(client, defaults),
2850
2967
  community: createCommunity(client, defaults),
2851
2968
  contracts: createContracts(client, defaults),
2852
2969
  discounts: createDiscounts(client, defaults),