@izak0s/spacebring-api 9.5.0 → 9.6.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.d.ts CHANGED
@@ -2048,6 +2048,26 @@ interface paths {
2048
2048
  patch: operations["patchResource"];
2049
2049
  trace?: never;
2050
2050
  };
2051
+ "/resources/v1/{resourceId}/availability": {
2052
+ parameters: {
2053
+ query?: never;
2054
+ header?: never;
2055
+ path?: never;
2056
+ cookie?: never;
2057
+ };
2058
+ get?: never;
2059
+ put?: never;
2060
+ /**
2061
+ * Check resource availability
2062
+ * @description Check whether a resource can be booked for a slot before creating the booking. The same rules as booking creation apply: capacity, the location and resource schedule, duration limits and the booking window. When the slot is unavailable, the response carries the code the booking would fail with. <h3>OAuth</h3>Required scopes: <code>resources.readonly</code> or <code>resources</code>
2063
+ */
2064
+ post: operations["getResourceAvailability"];
2065
+ delete?: never;
2066
+ options?: never;
2067
+ head?: never;
2068
+ patch?: never;
2069
+ trace?: never;
2070
+ };
2051
2071
  "/resources/bookings/v1": {
2052
2072
  parameters: {
2053
2073
  query?: never;
@@ -3792,7 +3812,7 @@ interface components {
3792
3812
  payments: {
3793
3813
  /**
3794
3814
  * Format: date-time
3795
- * @description ISO timestamp of the payment.
3815
+ * @description ISO timestamp of when the payment was recorded.
3796
3816
  */
3797
3817
  createDate: string;
3798
3818
  /** @description Payment dispute details. */
@@ -3824,6 +3844,11 @@ interface components {
3824
3844
  */
3825
3845
  type: "external" | "paymentGateway";
3826
3846
  };
3847
+ /**
3848
+ * Format: date-time
3849
+ * @description ISO timestamp of when the money was received. Absent until the payment succeeds. A payment gateway sets it when it approves the payment; an external payment takes the date the administrator recorded, defaulting to when they recorded it.
3850
+ */
3851
+ paymentDate?: string;
3827
3852
  /** @description Payment price details. */
3828
3853
  price: {
3829
3854
  money: {
@@ -4189,7 +4214,7 @@ interface components {
4189
4214
  payments: {
4190
4215
  /**
4191
4216
  * Format: date-time
4192
- * @description ISO timestamp of the payment.
4217
+ * @description ISO timestamp of when the payment was recorded.
4193
4218
  */
4194
4219
  createDate: string;
4195
4220
  /** @description Payment dispute details. */
@@ -4221,6 +4246,11 @@ interface components {
4221
4246
  */
4222
4247
  type: "external" | "paymentGateway";
4223
4248
  };
4249
+ /**
4250
+ * Format: date-time
4251
+ * @description ISO timestamp of when the money was received. Absent until the payment succeeds. A payment gateway sets it when it approves the payment; an external payment takes the date the administrator recorded, defaulting to when they recorded it.
4252
+ */
4253
+ paymentDate?: string;
4224
4254
  /** @description Payment price details. */
4225
4255
  price: {
4226
4256
  money: {
@@ -4583,7 +4613,7 @@ interface components {
4583
4613
  payments: {
4584
4614
  /**
4585
4615
  * Format: date-time
4586
- * @description ISO timestamp of the payment.
4616
+ * @description ISO timestamp of when the payment was recorded.
4587
4617
  */
4588
4618
  createDate: string;
4589
4619
  /** @description Payment dispute details. */
@@ -4615,6 +4645,11 @@ interface components {
4615
4645
  */
4616
4646
  type: "external" | "paymentGateway";
4617
4647
  };
4648
+ /**
4649
+ * Format: date-time
4650
+ * @description ISO timestamp of when the money was received. Absent until the payment succeeds. A payment gateway sets it when it approves the payment; an external payment takes the date the administrator recorded, defaulting to when they recorded it.
4651
+ */
4652
+ paymentDate?: string;
4618
4653
  /** @description Payment price details. */
4619
4654
  price: {
4620
4655
  money: {
@@ -5034,7 +5069,7 @@ interface components {
5034
5069
  invoicePayment: {
5035
5070
  /**
5036
5071
  * Format: date-time
5037
- * @description ISO timestamp of the payment.
5072
+ * @description ISO timestamp of when the payment was recorded.
5038
5073
  */
5039
5074
  createDate: string;
5040
5075
  /** @description Payment dispute details. */
@@ -5066,6 +5101,11 @@ interface components {
5066
5101
  */
5067
5102
  type: "external" | "paymentGateway";
5068
5103
  };
5104
+ /**
5105
+ * Format: date-time
5106
+ * @description ISO timestamp of when the money was received. Absent until the payment succeeds. A payment gateway sets it when it approves the payment; an external payment takes the date the administrator recorded, defaulting to when they recorded it.
5107
+ */
5108
+ paymentDate?: string;
5069
5109
  /** @description Payment price details. */
5070
5110
  price: {
5071
5111
  money: {
@@ -7099,6 +7139,8 @@ interface components {
7099
7139
  checkInRef?: string;
7100
7140
  /** @description Six-digit code the attendee enters on the Reception app to check in. Visible to the ticket owner and admins when check-in is enabled for the event. */
7101
7141
  code?: string;
7142
+ /** @description Note the attendee left when purchasing the ticket. Visible to the ticket owner and location admins only. */
7143
+ comment?: string;
7102
7144
  /**
7103
7145
  * Format: date-time
7104
7146
  * @description ISO timestamp of when the ticket was created.
@@ -10338,6 +10380,17 @@ interface components {
10338
10380
  };
10339
10381
  };
10340
10382
  };
10383
+ getResourceAvailability: {
10384
+ /** @description Whether the resource can be booked for the requested slot. */
10385
+ available: boolean;
10386
+ /** @description The first rule the slot breaks. Present only when available is false. */
10387
+ reason?: {
10388
+ /** @description The error code the booking would fail with, e.g. `bookingConflict` or `bookingScheduleConflict`. */
10389
+ code: string;
10390
+ /** @description The human-readable explanation of why the slot is unavailable. */
10391
+ message: string;
10392
+ };
10393
+ };
10341
10394
  getBookings: {
10342
10395
  /** @description List of bookings. */
10343
10396
  bookings: {
@@ -11314,6 +11367,37 @@ interface components {
11314
11367
  resourceRef: string;
11315
11368
  /** @description Number of seats reserved. */
11316
11369
  seats?: number;
11370
+ /** @description Where the booking was created. Visible to admins only. Absent on bookings made before it was recorded. */
11371
+ source?: {
11372
+ /** @description Set when `type` is `api`. */
11373
+ api?: {
11374
+ /** @description ID of the OAuth client the integration authenticated with. */
11375
+ clientId: string;
11376
+ };
11377
+ /** @description Set when `type` is `app`. */
11378
+ app?: Record<string, never>;
11379
+ /** @description Set when `type` is `googleCalendar`. */
11380
+ googleCalendar?: {
11381
+ /** @description ID of the Google Calendar the event was imported from. */
11382
+ calendarId?: string;
11383
+ /** @description ID of the Google Calendar event the booking mirrors. */
11384
+ eventId?: string;
11385
+ /** @description Link to the Google Calendar event. */
11386
+ eventLink?: string;
11387
+ };
11388
+ /** @description Set when `type` is `mcp`. */
11389
+ mcp?: {
11390
+ /** @description ID of the OAuth client the MCP client authenticated with. */
11391
+ clientId: string;
11392
+ };
11393
+ /** @description Set when `type` is `member`. */
11394
+ member?: Record<string, never>;
11395
+ /**
11396
+ * @description Where the booking was created: the admin app, the member app, an MCP client, a Google Calendar import, or a direct API integration. The matching property below carries the details.
11397
+ * @enum {string}
11398
+ */
11399
+ type: "api" | "app" | "googleCalendar" | "mcp" | "member";
11400
+ };
11317
11401
  /**
11318
11402
  * Format: date-time
11319
11403
  * @description ISO timestamp when the booking starts.
@@ -12336,6 +12420,37 @@ interface components {
12336
12420
  resourceRef: string;
12337
12421
  /** @description Number of seats reserved. */
12338
12422
  seats?: number;
12423
+ /** @description Where the booking was created. Visible to admins only. Absent on bookings made before it was recorded. */
12424
+ source?: {
12425
+ /** @description Set when `type` is `api`. */
12426
+ api?: {
12427
+ /** @description ID of the OAuth client the integration authenticated with. */
12428
+ clientId: string;
12429
+ };
12430
+ /** @description Set when `type` is `app`. */
12431
+ app?: Record<string, never>;
12432
+ /** @description Set when `type` is `googleCalendar`. */
12433
+ googleCalendar?: {
12434
+ /** @description ID of the Google Calendar the event was imported from. */
12435
+ calendarId?: string;
12436
+ /** @description ID of the Google Calendar event the booking mirrors. */
12437
+ eventId?: string;
12438
+ /** @description Link to the Google Calendar event. */
12439
+ eventLink?: string;
12440
+ };
12441
+ /** @description Set when `type` is `mcp`. */
12442
+ mcp?: {
12443
+ /** @description ID of the OAuth client the MCP client authenticated with. */
12444
+ clientId: string;
12445
+ };
12446
+ /** @description Set when `type` is `member`. */
12447
+ member?: Record<string, never>;
12448
+ /**
12449
+ * @description Where the booking was created: the admin app, the member app, an MCP client, a Google Calendar import, or a direct API integration. The matching property below carries the details.
12450
+ * @enum {string}
12451
+ */
12452
+ type: "api" | "app" | "googleCalendar" | "mcp" | "member";
12453
+ };
12339
12454
  /**
12340
12455
  * Format: date-time
12341
12456
  * @description ISO timestamp when the booking starts.
@@ -18929,6 +19044,11 @@ interface components {
18929
19044
  /** @description Payment gateway identifier, or external. */
18930
19045
  type: string;
18931
19046
  };
19047
+ /**
19048
+ * Format: date-time
19049
+ * @description ISO timestamp of when the money was received. Absent until the transaction succeeds. A payment gateway sets it when it approves the payment; an external payment takes the date the administrator recorded, defaulting to when they recorded it. Ordering and the createDate filters always follow createDate, not this field.
19050
+ */
19051
+ paymentDate?: string;
18932
19052
  /**
18933
19053
  * @deprecated
18934
19054
  * @description Deprecated. Use product instead.
@@ -19636,6 +19756,11 @@ interface components {
19636
19756
  /** @description Payment gateway identifier, or external. */
19637
19757
  type: string;
19638
19758
  };
19759
+ /**
19760
+ * Format: date-time
19761
+ * @description ISO timestamp of when the money was received. Absent until the transaction succeeds. A payment gateway sets it when it approves the payment; an external payment takes the date the administrator recorded, defaulting to when they recorded it. Ordering and the createDate filters always follow createDate, not this field.
19762
+ */
19763
+ paymentDate?: string;
19639
19764
  /**
19640
19765
  * @deprecated
19641
19766
  * @description Deprecated. Use product instead.
@@ -20343,6 +20468,11 @@ interface components {
20343
20468
  /** @description Payment gateway identifier, or external. */
20344
20469
  type: string;
20345
20470
  };
20471
+ /**
20472
+ * Format: date-time
20473
+ * @description ISO timestamp of when the money was received. Absent until the transaction succeeds. A payment gateway sets it when it approves the payment; an external payment takes the date the administrator recorded, defaulting to when they recorded it. Ordering and the createDate filters always follow createDate, not this field.
20474
+ */
20475
+ paymentDate?: string;
20346
20476
  /**
20347
20477
  * @deprecated
20348
20478
  * @description Deprecated. Use product instead.
@@ -21254,7 +21384,13 @@ interface components {
21254
21384
  /** @description Payment method details. */
21255
21385
  method: {
21256
21386
  /** @description External payment method, recorded outside the platform. */
21257
- external?: Record<string, never>;
21387
+ external?: {
21388
+ /**
21389
+ * Format: date-time
21390
+ * @description ISO timestamp of when the money was received. Defaults to now. Must not be in the future.
21391
+ */
21392
+ paymentDate?: string;
21393
+ };
21258
21394
  /** @description Payment gateway (card) payment method. */
21259
21395
  paymentGateway?: {
21260
21396
  /**
@@ -23462,6 +23598,28 @@ interface components {
23462
23598
  };
23463
23599
  };
23464
23600
  };
23601
+ getResourceAvailability: {
23602
+ content: {
23603
+ "application/json": {
23604
+ /**
23605
+ * Format: date-time
23606
+ * @description The end of the slot to check, in ISO 8601.
23607
+ */
23608
+ endDate: string;
23609
+ /** @description Set to true to check the entire resource instead of individual seats. Supported for office resources. */
23610
+ entire?: boolean;
23611
+ /** @description The number of seats to check. Required for seat-based resources such as hot desks, unless entire is true. */
23612
+ quantity?: number;
23613
+ /** @description RRULE lines describing a repeating slot, e.g. `RRULE:FREQ=WEEKLY;COUNT=10`. The DTSTART line is derived from startDate. The slot is unavailable as soon as any occurrence is. */
23614
+ recurrence?: string[];
23615
+ /**
23616
+ * Format: date-time
23617
+ * @description The start of the slot to check, in ISO 8601.
23618
+ */
23619
+ startDate: string;
23620
+ };
23621
+ };
23622
+ };
23465
23623
  createBooking: {
23466
23624
  content: {
23467
23625
  "application/json": {
@@ -24881,7 +25039,13 @@ interface components {
24881
25039
  /** @description Payment method details. */
24882
25040
  method: {
24883
25041
  /** @description External payment method, recorded outside the platform. */
24884
- external?: Record<string, never>;
25042
+ external?: {
25043
+ /**
25044
+ * Format: date-time
25045
+ * @description ISO timestamp of when the money was received. Defaults to now. Must not be in the future.
25046
+ */
25047
+ paymentDate?: string;
25048
+ };
24885
25049
  /** @description Payment gateway (card) payment method. */
24886
25050
  paymentGateway?: {
24887
25051
  /**
@@ -30149,6 +30313,41 @@ interface operations {
30149
30313
  };
30150
30314
  };
30151
30315
  };
30316
+ getResourceAvailability: {
30317
+ parameters: {
30318
+ query?: never;
30319
+ header?: {
30320
+ /** @description The id of the network. Required when using bearer token authentication */
30321
+ "spacebring-network-id"?: string;
30322
+ };
30323
+ path: {
30324
+ /** @description The id of the resource. */
30325
+ resourceId: string;
30326
+ };
30327
+ cookie?: never;
30328
+ };
30329
+ requestBody: components["requestBodies"]["getResourceAvailability"];
30330
+ responses: {
30331
+ /** @description OK */
30332
+ 200: {
30333
+ headers: {
30334
+ [name: string]: unknown;
30335
+ };
30336
+ content: {
30337
+ "application/json": components["schemas"]["getResourceAvailability"];
30338
+ };
30339
+ };
30340
+ /** @description Bad Request */
30341
+ 400: {
30342
+ headers: {
30343
+ [name: string]: unknown;
30344
+ };
30345
+ content: {
30346
+ "application/json": components["schemas"]["responseError"];
30347
+ };
30348
+ };
30349
+ };
30350
+ };
30152
30351
  getBookings: {
30153
30352
  parameters: {
30154
30353
  query?: {
@@ -32941,6 +33140,8 @@ type UpdateShopCategoryBody = NonNullable<NonNullable<operations["updateShopCate
32941
33140
  type Assignment = NonNullable<operations["getAssignments"]["responses"][200]["content"]["application/json"]["assignments"]>[number];
32942
33141
  /** A Booking entity as returned by the Spacebring API. */
32943
33142
  type Booking = NonNullable<operations["getBooking"]["responses"][200]["content"]["application/json"]["booking"]>;
33143
+ /** A GetResourceAvailability entity as returned by the Spacebring API. */
33144
+ type GetResourceAvailability = NonNullable<components["schemas"]["getResourceAvailability"]>;
32944
33145
  /** A Resource entity as returned by the Spacebring API. */
32945
33146
  type Resource = NonNullable<operations["getResource"]["responses"][200]["content"]["application/json"]["resource"]>;
32946
33147
  /** Query parameters for `sb.resources.assignments.list()`. */
@@ -33024,6 +33225,8 @@ type CreateAssignmentBody = NonNullable<NonNullable<operations["createAssignment
33024
33225
  type CreateBookingBody = NonNullable<operations["createBooking"]["requestBody"]>["content"]["application/json"];
33025
33226
  /** Request body for `sb.resources.create()`. */
33026
33227
  type CreateResourceBody = NonNullable<NonNullable<operations["createResource"]["requestBody"]>["content"]["application/json"]["resource"]>;
33228
+ /** Request body for `sb.resources.getResourceAvailability()`. */
33229
+ type GetResourceAvailabilityBody = NonNullable<operations["getResourceAvailability"]["requestBody"]>["content"]["application/json"];
33027
33230
  /** Request body for `sb.resources.assignments.update()`. */
33028
33231
  type PatchAssignmentBody = NonNullable<NonNullable<operations["patchAssignment"]["requestBody"]>["content"]["application/json"]["assignment"]>;
33029
33232
  /** Request body for `sb.resources.bookings.update()`. */
@@ -33827,6 +34030,7 @@ declare function createResources(client: Client<paths>, defaults: SpacebringDefa
33827
34030
  get(resourceId: string, options?: SpacebringRequestOptions): Promise<Resource>;
33828
34031
  create(resource: CreateResourceBody, options?: SpacebringRequestOptions): Promise<Resource>;
33829
34032
  update(resourceId: string, resource: PatchResourceBody, options?: SpacebringRequestOptions): Promise<undefined>;
34033
+ getResourceAvailability(resourceId: string, body: GetResourceAvailabilityBody, options?: SpacebringRequestOptions): Promise<GetResourceAvailability>;
33830
34034
  assignments: {
33831
34035
  list(query?: GetAssignmentsQuery, options?: SpacebringRequestOptions): Promise<{
33832
34036
  assignments: Assignment[];
@@ -34079,4 +34283,4 @@ declare class SpacebringError extends Error {
34079
34283
  });
34080
34284
  }
34081
34285
 
34082
- export { type Activity, type AddEventHostsBody, type AltCurrency, type Application, type ApplyBenefitBody, type Assignment, type Balance, type Benefit, type BenefitCategory, type Booking, type CheckInVisitBody, type CheckOutVisitBody, type Comment, type Company, type Contact, type Contract, type Coupon, type CreateAltCurrencyBody, type CreateAssignmentBody, type CreateBenefitBody, type CreateBenefitCategoryBody, type CreateBookingBody, type CreateCompanyBody, type CreateContactBody, type CreateContractBody, type CreateCouponBody, type CreateCreditNoteBody, type CreateCreditsTransactionBody, type CreateDayPassesTransactionBody, type CreateEventBody, type CreateEventMediaBody, type CreateFeedPostBody, type CreateFeedPostCommentBody, type CreateGuideBody, type CreateInvoiceBody, type CreateInvoiceItemBody, type CreateMembershipBody, type CreateMoneyTransactionBody, type CreatePackageBody, type CreatePlanBody, type CreateProductBody, type CreatePromocodeBody, type CreateRequestBody, type CreateResourceBody, type CreateShopCategoryBody, type CreateSubscriptionBody, type CreateSubscriptionItemBody, type CreateSupportTicketBody, type CreateSupportTicketCommentBody, type CreateTemplateBody, type CreateVisitBody, type CreditNote, type CreditScheduledTransaction, type CreditTransaction, type DayPassScheduledTransaction, type DayPassTransaction, type Event, type EventTicket, type GetAltCurrenciesQuery, type GetAssignmentsQuery, type GetBenefitApplicationsQuery, type GetBenefitCategoriesQuery, type GetBenefitsQuery, type GetBookingsQuery, type GetCompaniesQuery, type GetContactsQuery, type GetContractsQuery, type GetCouponsQuery, type GetCreditNotesQuery, type GetCreditsTransactionsQuery, type GetDayPassesTransactionsQuery, type GetDiscountRedemptionsQuery, type GetEventTicketsQuery, type GetEventsByOrganizationQuery, type GetFeedPostsQuery, type GetFloorsQuery, type GetGuidesQuery, type GetInvoicesQuery, type GetMembershipsDeletedQuery, type GetMembershipsQuery, type GetMoneyTransactionsQuery, type GetOrdersQuery, type GetPackagesQuery, type GetPlansQuery, type GetProductsQuery, type GetPromocodesQuery, type GetRegistrationsQuery, type GetRequestsQuery, type GetResourcesQuery, type GetScheduledCreditsTransactionsQuery, type GetScheduledDayPassesTransactionsQuery, type GetShopCategoriesQuery, type GetSubscriptionsQuery, type GetSupportTicketsQuery, type GetTemplatesQuery, type GetUpcomingInvoiceItemsQuery, type GetUpcomingInvoiceQuery, type GetVisitsQuery, type Guide, type Invoice, type InvoiceItem, type IssueContractBody, type IssueInvoiceBody, type Like, type ListInvoiceItemsQuery, type Location, type Media, type Membership, type MoneyTransaction, type Network, type Order, type Package, type PatchAssignmentBody, type PatchBookingBody, type PatchGuideBody, type PatchMoneyTransactionBody, type PatchPackageBody, type PatchResourceBody, type PayInvoiceBody, type Payment, type Plan, type Post, type PreviewCreditNoteBody, type Product, type Promocode, type Redemption, type Refund, type RefundMoneyTransactionBody, type Registration, type Request$1 as Request, type Resource, type ShopCategory, Spacebring, type SpacebringConfig, SpacebringError, type SpacebringErrorBody, type SpacebringRequestOptions, type SpacebringResources, type Subscription, type SupportTicket, type Template, type TerminateContractBody, type UpcomingItem, type UpdateAltCurrencyBody, type UpdateBenefitBody, type UpdateBenefitCategoryBody, type UpdateCompanyBody, type UpdateContractBody, type UpdateCouponBody, type UpdateCreditNoteBody, type UpdateEventBody, type UpdateEventTicketBody, type UpdateFeedPostBody, type UpdateInvoiceBody, type UpdateInvoiceItemBody, type UpdateMembershipBody, type UpdatePlanBody, type UpdateProductBody, type UpdateShopCategoryBody, type UpdateSubscriptionBody, type UpdateSubscriptionItemBody, type UpdateSupportTicketAssigneeBody, type UpdateSupportTicketCommentBody, type UpdateSupportTicketStatusBody, type UpdateSupportTicketTypeBody, type UpdateTemplateBody, type UpdateVisitBody, type Visit, type components, type operations, type paths };
34286
+ export { type Activity, type AddEventHostsBody, type AltCurrency, type Application, type ApplyBenefitBody, type Assignment, type Balance, type Benefit, type BenefitCategory, type Booking, type CheckInVisitBody, type CheckOutVisitBody, type Comment, type Company, type Contact, type Contract, type Coupon, type CreateAltCurrencyBody, type CreateAssignmentBody, type CreateBenefitBody, type CreateBenefitCategoryBody, type CreateBookingBody, type CreateCompanyBody, type CreateContactBody, type CreateContractBody, type CreateCouponBody, type CreateCreditNoteBody, type CreateCreditsTransactionBody, type CreateDayPassesTransactionBody, type CreateEventBody, type CreateEventMediaBody, type CreateFeedPostBody, type CreateFeedPostCommentBody, type CreateGuideBody, type CreateInvoiceBody, type CreateInvoiceItemBody, type CreateMembershipBody, type CreateMoneyTransactionBody, type CreatePackageBody, type CreatePlanBody, type CreateProductBody, type CreatePromocodeBody, type CreateRequestBody, type CreateResourceBody, type CreateShopCategoryBody, type CreateSubscriptionBody, type CreateSubscriptionItemBody, type CreateSupportTicketBody, type CreateSupportTicketCommentBody, type CreateTemplateBody, type CreateVisitBody, type CreditNote, type CreditScheduledTransaction, type CreditTransaction, type DayPassScheduledTransaction, type DayPassTransaction, type Event, type EventTicket, type GetAltCurrenciesQuery, type GetAssignmentsQuery, type GetBenefitApplicationsQuery, type GetBenefitCategoriesQuery, type GetBenefitsQuery, type GetBookingsQuery, type GetCompaniesQuery, type GetContactsQuery, type GetContractsQuery, type GetCouponsQuery, type GetCreditNotesQuery, type GetCreditsTransactionsQuery, type GetDayPassesTransactionsQuery, type GetDiscountRedemptionsQuery, type GetEventTicketsQuery, type GetEventsByOrganizationQuery, type GetFeedPostsQuery, type GetFloorsQuery, type GetGuidesQuery, type GetInvoicesQuery, type GetMembershipsDeletedQuery, type GetMembershipsQuery, type GetMoneyTransactionsQuery, type GetOrdersQuery, type GetPackagesQuery, type GetPlansQuery, type GetProductsQuery, type GetPromocodesQuery, type GetRegistrationsQuery, type GetRequestsQuery, type GetResourceAvailability, type GetResourceAvailabilityBody, type GetResourcesQuery, type GetScheduledCreditsTransactionsQuery, type GetScheduledDayPassesTransactionsQuery, type GetShopCategoriesQuery, type GetSubscriptionsQuery, type GetSupportTicketsQuery, type GetTemplatesQuery, type GetUpcomingInvoiceItemsQuery, type GetUpcomingInvoiceQuery, type GetVisitsQuery, type Guide, type Invoice, type InvoiceItem, type IssueContractBody, type IssueInvoiceBody, type Like, type ListInvoiceItemsQuery, type Location, type Media, type Membership, type MoneyTransaction, type Network, type Order, type Package, type PatchAssignmentBody, type PatchBookingBody, type PatchGuideBody, type PatchMoneyTransactionBody, type PatchPackageBody, type PatchResourceBody, type PayInvoiceBody, type Payment, type Plan, type Post, type PreviewCreditNoteBody, type Product, type Promocode, type Redemption, type Refund, type RefundMoneyTransactionBody, type Registration, type Request$1 as Request, type Resource, type ShopCategory, Spacebring, type SpacebringConfig, SpacebringError, type SpacebringErrorBody, type SpacebringRequestOptions, type SpacebringResources, type Subscription, type SupportTicket, type Template, type TerminateContractBody, type UpcomingItem, type UpdateAltCurrencyBody, type UpdateBenefitBody, type UpdateBenefitCategoryBody, type UpdateCompanyBody, type UpdateContractBody, type UpdateCouponBody, type UpdateCreditNoteBody, type UpdateEventBody, type UpdateEventTicketBody, type UpdateFeedPostBody, type UpdateInvoiceBody, type UpdateInvoiceItemBody, type UpdateMembershipBody, type UpdatePlanBody, type UpdateProductBody, type UpdateShopCategoryBody, type UpdateSubscriptionBody, type UpdateSubscriptionItemBody, type UpdateSupportTicketAssigneeBody, type UpdateSupportTicketCommentBody, type UpdateSupportTicketStatusBody, type UpdateSupportTicketTypeBody, type UpdateTemplateBody, type UpdateVisitBody, type Visit, type components, type operations, type paths };
package/dist/index.js CHANGED
@@ -2025,6 +2025,18 @@ function createResources(client, defaults) {
2025
2025
  async update(resourceId, resource, options) {
2026
2026
  return unwrap(await client.PATCH("/resources/v1/{resourceId}", { params: { path: { resourceId } }, body: { resource }, signal: options?.signal }), "PATCH /resources/v1/{resourceId}");
2027
2027
  },
2028
+ /**
2029
+ * Check resource availability
2030
+ *
2031
+ * Check whether a resource can be booked for a slot before creating the booking. The same rules as booking creation apply: capacity, the location and resource schedule, duration limits and the booking window. When the slot is unavailable, the response carries the code the booking would fail with.
2032
+ *
2033
+ * @param resourceId The id of the resource.
2034
+ * @param body Request body.
2035
+ * @param options Request options (abort signal).
2036
+ */
2037
+ async getResourceAvailability(resourceId, body, options) {
2038
+ return unwrap(await client.POST("/resources/v1/{resourceId}/availability", { params: { path: { resourceId } }, body, signal: options?.signal }), "POST /resources/v1/{resourceId}/availability");
2039
+ },
2028
2040
  assignments: {
2029
2041
  /**
2030
2042
  * Retrieve resource assignments