@izak0s/spacebring-api 3.1.0 → 3.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/README.md +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +166 -7
- package/dist/index.d.ts +166 -7
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1959,6 +1959,26 @@ interface paths {
|
|
|
1959
1959
|
patch?: never;
|
|
1960
1960
|
trace?: never;
|
|
1961
1961
|
};
|
|
1962
|
+
"/resources/v1/assignments": {
|
|
1963
|
+
parameters: {
|
|
1964
|
+
query?: never;
|
|
1965
|
+
header?: never;
|
|
1966
|
+
path?: never;
|
|
1967
|
+
cookie?: never;
|
|
1968
|
+
};
|
|
1969
|
+
/**
|
|
1970
|
+
* Retrieve resource assignments
|
|
1971
|
+
* @description Retrieve resource assignments in the location. An assignment links a resource, or a number of seats in it, to a company or a member for the duration of a subscription. <h3>OAuth</h3>Required scopes: <code>resources.readonly</code> or <code>resources</code>
|
|
1972
|
+
*/
|
|
1973
|
+
get: operations["getAssignments"];
|
|
1974
|
+
put?: never;
|
|
1975
|
+
post?: never;
|
|
1976
|
+
delete?: never;
|
|
1977
|
+
options?: never;
|
|
1978
|
+
head?: never;
|
|
1979
|
+
patch?: never;
|
|
1980
|
+
trace?: never;
|
|
1981
|
+
};
|
|
1962
1982
|
"/resources/v1/{id}": {
|
|
1963
1983
|
parameters: {
|
|
1964
1984
|
query?: never;
|
|
@@ -8395,6 +8415,11 @@ interface components {
|
|
|
8395
8415
|
};
|
|
8396
8416
|
/** @description Assigned quantity when the resource is partially assigned. */
|
|
8397
8417
|
quantity?: number;
|
|
8418
|
+
/**
|
|
8419
|
+
* Format: uuid
|
|
8420
|
+
* @description UUID of the resource the assignment belongs to.
|
|
8421
|
+
*/
|
|
8422
|
+
resourceRef: string;
|
|
8398
8423
|
/** @description Subscription backing this assignment. */
|
|
8399
8424
|
subscription: {
|
|
8400
8425
|
/** @description ISO timestamp when the assignment ends. */
|
|
@@ -8453,6 +8478,16 @@ interface components {
|
|
|
8453
8478
|
*/
|
|
8454
8479
|
interval: "zeroMinutes" | "fiveMinutes" | "tenMinutes" | "fifteenMinutes";
|
|
8455
8480
|
};
|
|
8481
|
+
/** @description Child resources when this is a parent resource. Bookings on a child resource also block the parent. */
|
|
8482
|
+
children: {
|
|
8483
|
+
/**
|
|
8484
|
+
* Format: uuid
|
|
8485
|
+
* @description Id of the child resource.
|
|
8486
|
+
*/
|
|
8487
|
+
id: string;
|
|
8488
|
+
/** @description Title of the child resource. */
|
|
8489
|
+
title: string;
|
|
8490
|
+
}[];
|
|
8456
8491
|
/** @description Confirmation email settings. */
|
|
8457
8492
|
confirmationEmail: {
|
|
8458
8493
|
/** @description Send confirmation when an admin creates a booking. */
|
|
@@ -8875,6 +8910,69 @@ interface components {
|
|
|
8875
8910
|
*/
|
|
8876
8911
|
visibility: "admins" | "exclusiveMembers" | "members" | "networkMembers" | "public";
|
|
8877
8912
|
};
|
|
8913
|
+
getAssignments: {
|
|
8914
|
+
/** @description List of resource assignments in the location. */
|
|
8915
|
+
assignments: {
|
|
8916
|
+
/** @description Company assigned to the resource. */
|
|
8917
|
+
company?: {
|
|
8918
|
+
/**
|
|
8919
|
+
* Format: uuid
|
|
8920
|
+
* @description Company id.
|
|
8921
|
+
*/
|
|
8922
|
+
id: string;
|
|
8923
|
+
/** @description Company name. */
|
|
8924
|
+
title: string;
|
|
8925
|
+
};
|
|
8926
|
+
/** @description Whether the assignment grants access to the entire resource. */
|
|
8927
|
+
entire: boolean;
|
|
8928
|
+
/**
|
|
8929
|
+
* Format: uuid
|
|
8930
|
+
* @description Assignment id.
|
|
8931
|
+
*/
|
|
8932
|
+
id?: string;
|
|
8933
|
+
/** @description Membership linked to the assignment. */
|
|
8934
|
+
membership?: {
|
|
8935
|
+
/**
|
|
8936
|
+
* Format: uuid
|
|
8937
|
+
* @description Membership id.
|
|
8938
|
+
*/
|
|
8939
|
+
id: string;
|
|
8940
|
+
};
|
|
8941
|
+
/** @description Assigned quantity when the resource is partially assigned. */
|
|
8942
|
+
quantity?: number;
|
|
8943
|
+
/**
|
|
8944
|
+
* Format: uuid
|
|
8945
|
+
* @description UUID of the resource the assignment belongs to.
|
|
8946
|
+
*/
|
|
8947
|
+
resourceRef: string;
|
|
8948
|
+
/** @description Subscription backing this assignment. */
|
|
8949
|
+
subscription: {
|
|
8950
|
+
/** @description ISO timestamp when the assignment ends. */
|
|
8951
|
+
endDate?: string;
|
|
8952
|
+
/**
|
|
8953
|
+
* Format: uuid
|
|
8954
|
+
* @description Subscription id.
|
|
8955
|
+
*/
|
|
8956
|
+
id: string;
|
|
8957
|
+
/** @description ISO timestamp when the assignment starts. */
|
|
8958
|
+
startDate: string;
|
|
8959
|
+
};
|
|
8960
|
+
/** @description User assigned to the resource. */
|
|
8961
|
+
user?: {
|
|
8962
|
+
/** @description User email. */
|
|
8963
|
+
email?: string | null;
|
|
8964
|
+
/**
|
|
8965
|
+
* Format: uuid
|
|
8966
|
+
* @description User id.
|
|
8967
|
+
*/
|
|
8968
|
+
id: string;
|
|
8969
|
+
/** @description User first name. */
|
|
8970
|
+
name?: string | null;
|
|
8971
|
+
/** @description User last name. */
|
|
8972
|
+
surname?: string | null;
|
|
8973
|
+
};
|
|
8974
|
+
}[];
|
|
8975
|
+
};
|
|
8878
8976
|
payment: {
|
|
8879
8977
|
/** @description The amount of the payment */
|
|
8880
8978
|
amount?: number;
|
|
@@ -14712,7 +14810,7 @@ interface components {
|
|
|
14712
14810
|
* @description Event application type. purchase: paid signup (requires price). none: free/RSVP-style.
|
|
14713
14811
|
* @enum {string}
|
|
14714
14812
|
*/
|
|
14715
|
-
applicationType
|
|
14813
|
+
applicationType: "purchase" | "none";
|
|
14716
14814
|
/** @description Confirmation email settings. */
|
|
14717
14815
|
confirmationEmail?: {
|
|
14718
14816
|
/** @description Whether a confirmation email is sent after registration. */
|
|
@@ -14807,7 +14905,7 @@ interface components {
|
|
|
14807
14905
|
* @description Event application type. purchase: paid signup (requires price). none: free/RSVP-style.
|
|
14808
14906
|
* @enum {string}
|
|
14809
14907
|
*/
|
|
14810
|
-
applicationType
|
|
14908
|
+
applicationType: "purchase" | "none";
|
|
14811
14909
|
/** @description Confirmation email settings. */
|
|
14812
14910
|
confirmationEmail?: {
|
|
14813
14911
|
/** @description Whether a confirmation email is sent after registration. */
|
|
@@ -15504,13 +15602,13 @@ interface components {
|
|
|
15504
15602
|
/** @description Whether dynamic pricing is enabled. */
|
|
15505
15603
|
enabled: boolean;
|
|
15506
15604
|
};
|
|
15507
|
-
/** @description Google Calendar integration settings. */
|
|
15605
|
+
/** @description Google Calendar integration settings. Pass null to disconnect the calendar from the resource. */
|
|
15508
15606
|
googleCalendar?: {
|
|
15509
15607
|
/** @description Google Calendar id. */
|
|
15510
15608
|
id: string;
|
|
15511
15609
|
/** @description Whether two-way sync is enabled. */
|
|
15512
15610
|
twoWaySyncEnabled: boolean;
|
|
15513
|
-
};
|
|
15611
|
+
} | null;
|
|
15514
15612
|
/**
|
|
15515
15613
|
* Format: uuid
|
|
15516
15614
|
* @description Optional client-provided resource id.
|
|
@@ -15836,13 +15934,13 @@ interface components {
|
|
|
15836
15934
|
/** @description Whether dynamic pricing is enabled. */
|
|
15837
15935
|
enabled: boolean;
|
|
15838
15936
|
};
|
|
15839
|
-
/** @description Google Calendar integration settings. */
|
|
15937
|
+
/** @description Google Calendar integration settings. Pass null to disconnect the calendar from the resource. */
|
|
15840
15938
|
googleCalendar?: {
|
|
15841
15939
|
/** @description Google Calendar id. */
|
|
15842
15940
|
id: string;
|
|
15843
15941
|
/** @description Whether two-way sync is enabled. */
|
|
15844
15942
|
twoWaySyncEnabled: boolean;
|
|
15845
|
-
};
|
|
15943
|
+
} | null;
|
|
15846
15944
|
/** @description Kisi access group reference. */
|
|
15847
15945
|
kisiGroupRef?: number | null;
|
|
15848
15946
|
/** @description Images to attach when creating the resource. */
|
|
@@ -22179,6 +22277,59 @@ interface operations {
|
|
|
22179
22277
|
};
|
|
22180
22278
|
};
|
|
22181
22279
|
};
|
|
22280
|
+
getAssignments: {
|
|
22281
|
+
parameters: {
|
|
22282
|
+
query: {
|
|
22283
|
+
/** @description UUID of the location whose resource assignments to list. */
|
|
22284
|
+
locationRef: string;
|
|
22285
|
+
};
|
|
22286
|
+
header?: {
|
|
22287
|
+
/** @description The id of the network. Required when using bearer token authentication */
|
|
22288
|
+
"spacebring-network-id"?: string;
|
|
22289
|
+
};
|
|
22290
|
+
path?: never;
|
|
22291
|
+
cookie?: never;
|
|
22292
|
+
};
|
|
22293
|
+
requestBody?: never;
|
|
22294
|
+
responses: {
|
|
22295
|
+
/** @description OK */
|
|
22296
|
+
200: {
|
|
22297
|
+
headers: {
|
|
22298
|
+
[name: string]: unknown;
|
|
22299
|
+
};
|
|
22300
|
+
content: {
|
|
22301
|
+
"application/json": components["schemas"]["getAssignments"];
|
|
22302
|
+
};
|
|
22303
|
+
};
|
|
22304
|
+
/** @description Bad Request */
|
|
22305
|
+
400: {
|
|
22306
|
+
headers: {
|
|
22307
|
+
[name: string]: unknown;
|
|
22308
|
+
};
|
|
22309
|
+
content: {
|
|
22310
|
+
"application/json": components["schemas"]["responseError"];
|
|
22311
|
+
};
|
|
22312
|
+
};
|
|
22313
|
+
/** @description Forbidden */
|
|
22314
|
+
403: {
|
|
22315
|
+
headers: {
|
|
22316
|
+
[name: string]: unknown;
|
|
22317
|
+
};
|
|
22318
|
+
content: {
|
|
22319
|
+
"application/json": components["schemas"]["responseError"];
|
|
22320
|
+
};
|
|
22321
|
+
};
|
|
22322
|
+
/** @description Not Found */
|
|
22323
|
+
404: {
|
|
22324
|
+
headers: {
|
|
22325
|
+
[name: string]: unknown;
|
|
22326
|
+
};
|
|
22327
|
+
content: {
|
|
22328
|
+
"application/json": components["schemas"]["responseError"];
|
|
22329
|
+
};
|
|
22330
|
+
};
|
|
22331
|
+
};
|
|
22332
|
+
};
|
|
22182
22333
|
getResource: {
|
|
22183
22334
|
parameters: {
|
|
22184
22335
|
query?: never;
|
|
@@ -24782,10 +24933,17 @@ type UpdateProductBody = NonNullable<NonNullable<operations["updateProduct"]["re
|
|
|
24782
24933
|
/** Request body for `sb.shop.categories.update()`. */
|
|
24783
24934
|
type UpdateShopCategoryBody = NonNullable<NonNullable<operations["updateShopCategory"]["requestBody"]>["content"]["application/json"]["category"]>;
|
|
24784
24935
|
|
|
24936
|
+
/** A Assignment entity as returned by the Spacebring API. */
|
|
24937
|
+
type Assignment = NonNullable<operations["getAssignments"]["responses"][200]["content"]["application/json"]["assignments"]>[number];
|
|
24785
24938
|
/** A Booking entity as returned by the Spacebring API. */
|
|
24786
24939
|
type Booking = NonNullable<components["schemas"]["booking"]>;
|
|
24787
24940
|
/** A Resource entity as returned by the Spacebring API. */
|
|
24788
24941
|
type Resource = NonNullable<components["schemas"]["resource"]>;
|
|
24942
|
+
/** Query parameters for `sb.resources.getAssignments()`. */
|
|
24943
|
+
interface GetAssignmentsQuery {
|
|
24944
|
+
/** UUID of the location whose resource assignments to list. */
|
|
24945
|
+
locationRef: string;
|
|
24946
|
+
}
|
|
24789
24947
|
/** Query parameters for `sb.resources.bookings.list()`. */
|
|
24790
24948
|
interface GetBookingsQuery {
|
|
24791
24949
|
/** The id of the resource. Required if `locationRef` is not passed. */
|
|
@@ -25610,6 +25768,7 @@ declare function createResources(client: Client<paths>, defaults: SpacebringDefa
|
|
|
25610
25768
|
get(id: string, options?: SpacebringRequestOptions): Promise<Resource>;
|
|
25611
25769
|
create(resource: CreateResourceBody, options?: SpacebringRequestOptions): Promise<Resource>;
|
|
25612
25770
|
update(id: string, resource: PatchResourceBody, options?: SpacebringRequestOptions): Promise<undefined>;
|
|
25771
|
+
getAssignments(query: GetAssignmentsQuery, options?: SpacebringRequestOptions): Promise<Assignment[]>;
|
|
25613
25772
|
bookings: {
|
|
25614
25773
|
list(query?: GetBookingsQuery, options?: SpacebringRequestOptions): Promise<{
|
|
25615
25774
|
bookings?: Booking[];
|
|
@@ -25835,4 +25994,4 @@ declare class SpacebringError extends Error {
|
|
|
25835
25994
|
});
|
|
25836
25995
|
}
|
|
25837
25996
|
|
|
25838
|
-
export { type Activity, type AddEventHostsBody, type AltCurrency, type Application, type ApplyBenefitBody, 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 CreateBenefitBody, type CreateBenefitCategoryBody, type CreateBookingBody, type CreateCompanyBody, type CreateContactBody, type CreateContractBody, type CreateCouponBody, type CreateCreditNoteBody, type CreateCreditsTransactionBody, type CreateDayPassesTransactionBody, type CreateEventBody, type CreateFeedPostBody, type CreateFeedPostCommentBody, type CreateGuideBody, type CreateInvoiceBody, type CreateInvoiceItemBody, type CreateMembershipBody, 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 CreditTransaction, type DayPassTransaction, type Event, type EventTicket, type GetAltCurrenciesQuery, 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 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 Membership, type MoneyTransaction, type Network, type Order, type Package, type PatchGuideBody, type PatchPackageBody, type PatchResourceBody, type PayInvoiceBody, type Payment, type Plan, type Post, type PreviewCreditNoteBody, type Product, type Promocode, type Redemption, type Registration, type Request$1 as Request, type Resource, type ScheduledTransaction, 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 UpdateSupportTicketStatusBody, type UpdateSupportTicketTypeBody, type UpdateTemplateBody, type UpdateVisitBody, type Visit, type components, type operations, type paths };
|
|
25997
|
+
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 CreateBenefitBody, type CreateBenefitCategoryBody, type CreateBookingBody, type CreateCompanyBody, type CreateContactBody, type CreateContractBody, type CreateCouponBody, type CreateCreditNoteBody, type CreateCreditsTransactionBody, type CreateDayPassesTransactionBody, type CreateEventBody, type CreateFeedPostBody, type CreateFeedPostCommentBody, type CreateGuideBody, type CreateInvoiceBody, type CreateInvoiceItemBody, type CreateMembershipBody, 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 CreditTransaction, 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 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 Membership, type MoneyTransaction, type Network, type Order, type Package, type PatchGuideBody, type PatchPackageBody, type PatchResourceBody, type PayInvoiceBody, type Payment, type Plan, type Post, type PreviewCreditNoteBody, type Product, type Promocode, type Redemption, type Registration, type Request$1 as Request, type Resource, type ScheduledTransaction, 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 UpdateSupportTicketStatusBody, type UpdateSupportTicketTypeBody, type UpdateTemplateBody, type UpdateVisitBody, type Visit, type components, type operations, type paths };
|
package/dist/index.d.ts
CHANGED
|
@@ -1959,6 +1959,26 @@ interface paths {
|
|
|
1959
1959
|
patch?: never;
|
|
1960
1960
|
trace?: never;
|
|
1961
1961
|
};
|
|
1962
|
+
"/resources/v1/assignments": {
|
|
1963
|
+
parameters: {
|
|
1964
|
+
query?: never;
|
|
1965
|
+
header?: never;
|
|
1966
|
+
path?: never;
|
|
1967
|
+
cookie?: never;
|
|
1968
|
+
};
|
|
1969
|
+
/**
|
|
1970
|
+
* Retrieve resource assignments
|
|
1971
|
+
* @description Retrieve resource assignments in the location. An assignment links a resource, or a number of seats in it, to a company or a member for the duration of a subscription. <h3>OAuth</h3>Required scopes: <code>resources.readonly</code> or <code>resources</code>
|
|
1972
|
+
*/
|
|
1973
|
+
get: operations["getAssignments"];
|
|
1974
|
+
put?: never;
|
|
1975
|
+
post?: never;
|
|
1976
|
+
delete?: never;
|
|
1977
|
+
options?: never;
|
|
1978
|
+
head?: never;
|
|
1979
|
+
patch?: never;
|
|
1980
|
+
trace?: never;
|
|
1981
|
+
};
|
|
1962
1982
|
"/resources/v1/{id}": {
|
|
1963
1983
|
parameters: {
|
|
1964
1984
|
query?: never;
|
|
@@ -8395,6 +8415,11 @@ interface components {
|
|
|
8395
8415
|
};
|
|
8396
8416
|
/** @description Assigned quantity when the resource is partially assigned. */
|
|
8397
8417
|
quantity?: number;
|
|
8418
|
+
/**
|
|
8419
|
+
* Format: uuid
|
|
8420
|
+
* @description UUID of the resource the assignment belongs to.
|
|
8421
|
+
*/
|
|
8422
|
+
resourceRef: string;
|
|
8398
8423
|
/** @description Subscription backing this assignment. */
|
|
8399
8424
|
subscription: {
|
|
8400
8425
|
/** @description ISO timestamp when the assignment ends. */
|
|
@@ -8453,6 +8478,16 @@ interface components {
|
|
|
8453
8478
|
*/
|
|
8454
8479
|
interval: "zeroMinutes" | "fiveMinutes" | "tenMinutes" | "fifteenMinutes";
|
|
8455
8480
|
};
|
|
8481
|
+
/** @description Child resources when this is a parent resource. Bookings on a child resource also block the parent. */
|
|
8482
|
+
children: {
|
|
8483
|
+
/**
|
|
8484
|
+
* Format: uuid
|
|
8485
|
+
* @description Id of the child resource.
|
|
8486
|
+
*/
|
|
8487
|
+
id: string;
|
|
8488
|
+
/** @description Title of the child resource. */
|
|
8489
|
+
title: string;
|
|
8490
|
+
}[];
|
|
8456
8491
|
/** @description Confirmation email settings. */
|
|
8457
8492
|
confirmationEmail: {
|
|
8458
8493
|
/** @description Send confirmation when an admin creates a booking. */
|
|
@@ -8875,6 +8910,69 @@ interface components {
|
|
|
8875
8910
|
*/
|
|
8876
8911
|
visibility: "admins" | "exclusiveMembers" | "members" | "networkMembers" | "public";
|
|
8877
8912
|
};
|
|
8913
|
+
getAssignments: {
|
|
8914
|
+
/** @description List of resource assignments in the location. */
|
|
8915
|
+
assignments: {
|
|
8916
|
+
/** @description Company assigned to the resource. */
|
|
8917
|
+
company?: {
|
|
8918
|
+
/**
|
|
8919
|
+
* Format: uuid
|
|
8920
|
+
* @description Company id.
|
|
8921
|
+
*/
|
|
8922
|
+
id: string;
|
|
8923
|
+
/** @description Company name. */
|
|
8924
|
+
title: string;
|
|
8925
|
+
};
|
|
8926
|
+
/** @description Whether the assignment grants access to the entire resource. */
|
|
8927
|
+
entire: boolean;
|
|
8928
|
+
/**
|
|
8929
|
+
* Format: uuid
|
|
8930
|
+
* @description Assignment id.
|
|
8931
|
+
*/
|
|
8932
|
+
id?: string;
|
|
8933
|
+
/** @description Membership linked to the assignment. */
|
|
8934
|
+
membership?: {
|
|
8935
|
+
/**
|
|
8936
|
+
* Format: uuid
|
|
8937
|
+
* @description Membership id.
|
|
8938
|
+
*/
|
|
8939
|
+
id: string;
|
|
8940
|
+
};
|
|
8941
|
+
/** @description Assigned quantity when the resource is partially assigned. */
|
|
8942
|
+
quantity?: number;
|
|
8943
|
+
/**
|
|
8944
|
+
* Format: uuid
|
|
8945
|
+
* @description UUID of the resource the assignment belongs to.
|
|
8946
|
+
*/
|
|
8947
|
+
resourceRef: string;
|
|
8948
|
+
/** @description Subscription backing this assignment. */
|
|
8949
|
+
subscription: {
|
|
8950
|
+
/** @description ISO timestamp when the assignment ends. */
|
|
8951
|
+
endDate?: string;
|
|
8952
|
+
/**
|
|
8953
|
+
* Format: uuid
|
|
8954
|
+
* @description Subscription id.
|
|
8955
|
+
*/
|
|
8956
|
+
id: string;
|
|
8957
|
+
/** @description ISO timestamp when the assignment starts. */
|
|
8958
|
+
startDate: string;
|
|
8959
|
+
};
|
|
8960
|
+
/** @description User assigned to the resource. */
|
|
8961
|
+
user?: {
|
|
8962
|
+
/** @description User email. */
|
|
8963
|
+
email?: string | null;
|
|
8964
|
+
/**
|
|
8965
|
+
* Format: uuid
|
|
8966
|
+
* @description User id.
|
|
8967
|
+
*/
|
|
8968
|
+
id: string;
|
|
8969
|
+
/** @description User first name. */
|
|
8970
|
+
name?: string | null;
|
|
8971
|
+
/** @description User last name. */
|
|
8972
|
+
surname?: string | null;
|
|
8973
|
+
};
|
|
8974
|
+
}[];
|
|
8975
|
+
};
|
|
8878
8976
|
payment: {
|
|
8879
8977
|
/** @description The amount of the payment */
|
|
8880
8978
|
amount?: number;
|
|
@@ -14712,7 +14810,7 @@ interface components {
|
|
|
14712
14810
|
* @description Event application type. purchase: paid signup (requires price). none: free/RSVP-style.
|
|
14713
14811
|
* @enum {string}
|
|
14714
14812
|
*/
|
|
14715
|
-
applicationType
|
|
14813
|
+
applicationType: "purchase" | "none";
|
|
14716
14814
|
/** @description Confirmation email settings. */
|
|
14717
14815
|
confirmationEmail?: {
|
|
14718
14816
|
/** @description Whether a confirmation email is sent after registration. */
|
|
@@ -14807,7 +14905,7 @@ interface components {
|
|
|
14807
14905
|
* @description Event application type. purchase: paid signup (requires price). none: free/RSVP-style.
|
|
14808
14906
|
* @enum {string}
|
|
14809
14907
|
*/
|
|
14810
|
-
applicationType
|
|
14908
|
+
applicationType: "purchase" | "none";
|
|
14811
14909
|
/** @description Confirmation email settings. */
|
|
14812
14910
|
confirmationEmail?: {
|
|
14813
14911
|
/** @description Whether a confirmation email is sent after registration. */
|
|
@@ -15504,13 +15602,13 @@ interface components {
|
|
|
15504
15602
|
/** @description Whether dynamic pricing is enabled. */
|
|
15505
15603
|
enabled: boolean;
|
|
15506
15604
|
};
|
|
15507
|
-
/** @description Google Calendar integration settings. */
|
|
15605
|
+
/** @description Google Calendar integration settings. Pass null to disconnect the calendar from the resource. */
|
|
15508
15606
|
googleCalendar?: {
|
|
15509
15607
|
/** @description Google Calendar id. */
|
|
15510
15608
|
id: string;
|
|
15511
15609
|
/** @description Whether two-way sync is enabled. */
|
|
15512
15610
|
twoWaySyncEnabled: boolean;
|
|
15513
|
-
};
|
|
15611
|
+
} | null;
|
|
15514
15612
|
/**
|
|
15515
15613
|
* Format: uuid
|
|
15516
15614
|
* @description Optional client-provided resource id.
|
|
@@ -15836,13 +15934,13 @@ interface components {
|
|
|
15836
15934
|
/** @description Whether dynamic pricing is enabled. */
|
|
15837
15935
|
enabled: boolean;
|
|
15838
15936
|
};
|
|
15839
|
-
/** @description Google Calendar integration settings. */
|
|
15937
|
+
/** @description Google Calendar integration settings. Pass null to disconnect the calendar from the resource. */
|
|
15840
15938
|
googleCalendar?: {
|
|
15841
15939
|
/** @description Google Calendar id. */
|
|
15842
15940
|
id: string;
|
|
15843
15941
|
/** @description Whether two-way sync is enabled. */
|
|
15844
15942
|
twoWaySyncEnabled: boolean;
|
|
15845
|
-
};
|
|
15943
|
+
} | null;
|
|
15846
15944
|
/** @description Kisi access group reference. */
|
|
15847
15945
|
kisiGroupRef?: number | null;
|
|
15848
15946
|
/** @description Images to attach when creating the resource. */
|
|
@@ -22179,6 +22277,59 @@ interface operations {
|
|
|
22179
22277
|
};
|
|
22180
22278
|
};
|
|
22181
22279
|
};
|
|
22280
|
+
getAssignments: {
|
|
22281
|
+
parameters: {
|
|
22282
|
+
query: {
|
|
22283
|
+
/** @description UUID of the location whose resource assignments to list. */
|
|
22284
|
+
locationRef: string;
|
|
22285
|
+
};
|
|
22286
|
+
header?: {
|
|
22287
|
+
/** @description The id of the network. Required when using bearer token authentication */
|
|
22288
|
+
"spacebring-network-id"?: string;
|
|
22289
|
+
};
|
|
22290
|
+
path?: never;
|
|
22291
|
+
cookie?: never;
|
|
22292
|
+
};
|
|
22293
|
+
requestBody?: never;
|
|
22294
|
+
responses: {
|
|
22295
|
+
/** @description OK */
|
|
22296
|
+
200: {
|
|
22297
|
+
headers: {
|
|
22298
|
+
[name: string]: unknown;
|
|
22299
|
+
};
|
|
22300
|
+
content: {
|
|
22301
|
+
"application/json": components["schemas"]["getAssignments"];
|
|
22302
|
+
};
|
|
22303
|
+
};
|
|
22304
|
+
/** @description Bad Request */
|
|
22305
|
+
400: {
|
|
22306
|
+
headers: {
|
|
22307
|
+
[name: string]: unknown;
|
|
22308
|
+
};
|
|
22309
|
+
content: {
|
|
22310
|
+
"application/json": components["schemas"]["responseError"];
|
|
22311
|
+
};
|
|
22312
|
+
};
|
|
22313
|
+
/** @description Forbidden */
|
|
22314
|
+
403: {
|
|
22315
|
+
headers: {
|
|
22316
|
+
[name: string]: unknown;
|
|
22317
|
+
};
|
|
22318
|
+
content: {
|
|
22319
|
+
"application/json": components["schemas"]["responseError"];
|
|
22320
|
+
};
|
|
22321
|
+
};
|
|
22322
|
+
/** @description Not Found */
|
|
22323
|
+
404: {
|
|
22324
|
+
headers: {
|
|
22325
|
+
[name: string]: unknown;
|
|
22326
|
+
};
|
|
22327
|
+
content: {
|
|
22328
|
+
"application/json": components["schemas"]["responseError"];
|
|
22329
|
+
};
|
|
22330
|
+
};
|
|
22331
|
+
};
|
|
22332
|
+
};
|
|
22182
22333
|
getResource: {
|
|
22183
22334
|
parameters: {
|
|
22184
22335
|
query?: never;
|
|
@@ -24782,10 +24933,17 @@ type UpdateProductBody = NonNullable<NonNullable<operations["updateProduct"]["re
|
|
|
24782
24933
|
/** Request body for `sb.shop.categories.update()`. */
|
|
24783
24934
|
type UpdateShopCategoryBody = NonNullable<NonNullable<operations["updateShopCategory"]["requestBody"]>["content"]["application/json"]["category"]>;
|
|
24784
24935
|
|
|
24936
|
+
/** A Assignment entity as returned by the Spacebring API. */
|
|
24937
|
+
type Assignment = NonNullable<operations["getAssignments"]["responses"][200]["content"]["application/json"]["assignments"]>[number];
|
|
24785
24938
|
/** A Booking entity as returned by the Spacebring API. */
|
|
24786
24939
|
type Booking = NonNullable<components["schemas"]["booking"]>;
|
|
24787
24940
|
/** A Resource entity as returned by the Spacebring API. */
|
|
24788
24941
|
type Resource = NonNullable<components["schemas"]["resource"]>;
|
|
24942
|
+
/** Query parameters for `sb.resources.getAssignments()`. */
|
|
24943
|
+
interface GetAssignmentsQuery {
|
|
24944
|
+
/** UUID of the location whose resource assignments to list. */
|
|
24945
|
+
locationRef: string;
|
|
24946
|
+
}
|
|
24789
24947
|
/** Query parameters for `sb.resources.bookings.list()`. */
|
|
24790
24948
|
interface GetBookingsQuery {
|
|
24791
24949
|
/** The id of the resource. Required if `locationRef` is not passed. */
|
|
@@ -25610,6 +25768,7 @@ declare function createResources(client: Client<paths>, defaults: SpacebringDefa
|
|
|
25610
25768
|
get(id: string, options?: SpacebringRequestOptions): Promise<Resource>;
|
|
25611
25769
|
create(resource: CreateResourceBody, options?: SpacebringRequestOptions): Promise<Resource>;
|
|
25612
25770
|
update(id: string, resource: PatchResourceBody, options?: SpacebringRequestOptions): Promise<undefined>;
|
|
25771
|
+
getAssignments(query: GetAssignmentsQuery, options?: SpacebringRequestOptions): Promise<Assignment[]>;
|
|
25613
25772
|
bookings: {
|
|
25614
25773
|
list(query?: GetBookingsQuery, options?: SpacebringRequestOptions): Promise<{
|
|
25615
25774
|
bookings?: Booking[];
|
|
@@ -25835,4 +25994,4 @@ declare class SpacebringError extends Error {
|
|
|
25835
25994
|
});
|
|
25836
25995
|
}
|
|
25837
25996
|
|
|
25838
|
-
export { type Activity, type AddEventHostsBody, type AltCurrency, type Application, type ApplyBenefitBody, 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 CreateBenefitBody, type CreateBenefitCategoryBody, type CreateBookingBody, type CreateCompanyBody, type CreateContactBody, type CreateContractBody, type CreateCouponBody, type CreateCreditNoteBody, type CreateCreditsTransactionBody, type CreateDayPassesTransactionBody, type CreateEventBody, type CreateFeedPostBody, type CreateFeedPostCommentBody, type CreateGuideBody, type CreateInvoiceBody, type CreateInvoiceItemBody, type CreateMembershipBody, 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 CreditTransaction, type DayPassTransaction, type Event, type EventTicket, type GetAltCurrenciesQuery, 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 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 Membership, type MoneyTransaction, type Network, type Order, type Package, type PatchGuideBody, type PatchPackageBody, type PatchResourceBody, type PayInvoiceBody, type Payment, type Plan, type Post, type PreviewCreditNoteBody, type Product, type Promocode, type Redemption, type Registration, type Request$1 as Request, type Resource, type ScheduledTransaction, 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 UpdateSupportTicketStatusBody, type UpdateSupportTicketTypeBody, type UpdateTemplateBody, type UpdateVisitBody, type Visit, type components, type operations, type paths };
|
|
25997
|
+
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 CreateBenefitBody, type CreateBenefitCategoryBody, type CreateBookingBody, type CreateCompanyBody, type CreateContactBody, type CreateContractBody, type CreateCouponBody, type CreateCreditNoteBody, type CreateCreditsTransactionBody, type CreateDayPassesTransactionBody, type CreateEventBody, type CreateFeedPostBody, type CreateFeedPostCommentBody, type CreateGuideBody, type CreateInvoiceBody, type CreateInvoiceItemBody, type CreateMembershipBody, 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 CreditTransaction, 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 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 Membership, type MoneyTransaction, type Network, type Order, type Package, type PatchGuideBody, type PatchPackageBody, type PatchResourceBody, type PayInvoiceBody, type Payment, type Plan, type Post, type PreviewCreditNoteBody, type Product, type Promocode, type Redemption, type Registration, type Request$1 as Request, type Resource, type ScheduledTransaction, 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 UpdateSupportTicketStatusBody, type UpdateSupportTicketTypeBody, type UpdateTemplateBody, type UpdateVisitBody, type Visit, type components, type operations, type paths };
|
package/dist/index.js
CHANGED
|
@@ -2015,6 +2015,14 @@ function createResources(client, defaults) {
|
|
|
2015
2015
|
async update(id, resource, options) {
|
|
2016
2016
|
return unwrap(await client.PATCH("/resources/v1/{id}", { params: { path: { id } }, body: { resource }, signal: options?.signal }), "PATCH /resources/v1/{id}");
|
|
2017
2017
|
},
|
|
2018
|
+
/**
|
|
2019
|
+
* Retrieve resource assignments
|
|
2020
|
+
*
|
|
2021
|
+
* Retrieve resource assignments in the location. An assignment links a resource, or a number of seats in it, to a company or a member for the duration of a subscription.
|
|
2022
|
+
*/
|
|
2023
|
+
async getAssignments(query, options) {
|
|
2024
|
+
return unwrapProp(await client.GET("/resources/v1/assignments", { params: { query }, signal: options?.signal }), "assignments", "GET /resources/v1/assignments");
|
|
2025
|
+
},
|
|
2018
2026
|
bookings: {
|
|
2019
2027
|
/**
|
|
2020
2028
|
* Retrieve bookings
|