@connectedxm/admin 7.2.1 → 7.2.3

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
@@ -1868,6 +1868,45 @@ var useGetAccountRegistrations = (accountId = "", params = {}, options = {}) =>
1868
1868
  );
1869
1869
  };
1870
1870
 
1871
+ // src/queries/accounts/useGetAccountBookings.ts
1872
+ var ACCOUNT_BOOKINGS_QUERY_KEY = (accountId) => [
1873
+ ...ACCOUNT_QUERY_KEY(accountId),
1874
+ "BOOKINGS"
1875
+ ];
1876
+ var SET_ACCOUNT_BOOKINGS_QUERY_DATA = (client, keyParams, response) => {
1877
+ client.setQueryData(ACCOUNT_BOOKINGS_QUERY_KEY(...keyParams), response);
1878
+ };
1879
+ var GetAccountBookings = async ({
1880
+ accountId,
1881
+ pageParam,
1882
+ pageSize,
1883
+ orderBy,
1884
+ search,
1885
+ adminApiParams
1886
+ }) => {
1887
+ const adminApi = await GetAdminAPI(adminApiParams);
1888
+ const { data } = await adminApi.get(`/accounts/${accountId}/bookings`, {
1889
+ params: {
1890
+ page: pageParam || void 0,
1891
+ pageSize: pageSize || void 0,
1892
+ orderBy: orderBy || void 0,
1893
+ search: search || void 0
1894
+ }
1895
+ });
1896
+ return data;
1897
+ };
1898
+ var useGetAccountBookings = (accountId = "", params = {}, options = {}) => {
1899
+ return useConnectedInfiniteQuery(
1900
+ ACCOUNT_BOOKINGS_QUERY_KEY(accountId),
1901
+ (params2) => GetAccountBookings({ accountId, ...params2 }),
1902
+ params,
1903
+ {
1904
+ ...options,
1905
+ enabled: !!accountId && (options?.enabled ?? true)
1906
+ }
1907
+ );
1908
+ };
1909
+
1871
1910
  // src/queries/accounts/useGetAccountThreads.ts
1872
1911
  var ACCOUNT_THREADS_QUERY_KEY = (accountId) => {
1873
1912
  const keys = ["THREADS", "ACCOUNT", accountId];
@@ -23957,6 +23996,33 @@ var useCancelBooking = (options = {}) => {
23957
23996
  return useConnectedMutation(CancelBooking, options);
23958
23997
  };
23959
23998
 
23999
+ // src/mutations/bookings/useCheckInBooking.ts
24000
+ var CheckInBooking = async ({
24001
+ placeId,
24002
+ spaceId,
24003
+ bookingId,
24004
+ adminApiParams,
24005
+ queryClient
24006
+ }) => {
24007
+ const connectedXM = await GetAdminAPI(adminApiParams);
24008
+ const { data } = await connectedXM.post(
24009
+ `/bookings/places/${placeId}/spaces/${spaceId}/bookings/${bookingId}/checkin`
24010
+ );
24011
+ if (queryClient && data.status === "ok") {
24012
+ queryClient.invalidateQueries({
24013
+ queryKey: BOOKING_PLACE_BOOKINGS_QUERY_KEY(placeId)
24014
+ });
24015
+ queryClient.invalidateQueries({
24016
+ queryKey: BOOKING_SPACE_BOOKINGS_QUERY_KEY(placeId, spaceId)
24017
+ });
24018
+ SET_BOOKING_QUERY_DATA(queryClient, [bookingId], data);
24019
+ }
24020
+ return data;
24021
+ };
24022
+ var useCheckInBooking = (options = {}) => {
24023
+ return useConnectedMutation(CheckInBooking, options);
24024
+ };
24025
+
23960
24026
  // src/mutations/bookings/useCreateBooking.ts
23961
24027
  var CreateBooking = async ({
23962
24028
  placeId,
@@ -24039,6 +24105,33 @@ var useRemoveBookingSpaceTier = (options = {}) => {
24039
24105
  return useConnectedMutation(RemoveBookingSpaceTier, options);
24040
24106
  };
24041
24107
 
24108
+ // src/mutations/bookings/useUndoCheckInBooking.ts
24109
+ var UndoCheckInBooking = async ({
24110
+ placeId,
24111
+ spaceId,
24112
+ bookingId,
24113
+ adminApiParams,
24114
+ queryClient
24115
+ }) => {
24116
+ const connectedXM = await GetAdminAPI(adminApiParams);
24117
+ const { data } = await connectedXM.post(
24118
+ `/bookings/places/${placeId}/spaces/${spaceId}/bookings/${bookingId}/checkin/undo`
24119
+ );
24120
+ if (queryClient && data.status === "ok") {
24121
+ queryClient.invalidateQueries({
24122
+ queryKey: BOOKING_PLACE_BOOKINGS_QUERY_KEY(placeId)
24123
+ });
24124
+ queryClient.invalidateQueries({
24125
+ queryKey: BOOKING_SPACE_BOOKINGS_QUERY_KEY(placeId, spaceId)
24126
+ });
24127
+ SET_BOOKING_QUERY_DATA(queryClient, [bookingId], data);
24128
+ }
24129
+ return data;
24130
+ };
24131
+ var useUndoCheckInBooking = (options = {}) => {
24132
+ return useConnectedMutation(UndoCheckInBooking, options);
24133
+ };
24134
+
24042
24135
  // src/mutations/bookings/useUpdateBooking.ts
24043
24136
  var UpdateBooking = async ({
24044
24137
  placeId,
@@ -39838,6 +39931,7 @@ export {
39838
39931
  ACCOUNT_ACTIVITIES_QUERY_KEY,
39839
39932
  ACCOUNT_ADDRESSES_QUERY_KEY,
39840
39933
  ACCOUNT_ADDRESS_QUERY_KEY,
39934
+ ACCOUNT_BOOKINGS_QUERY_KEY,
39841
39935
  ACCOUNT_COMMENTS_QUERY_KEY,
39842
39936
  ACCOUNT_EMAILS_QUERY_KEY,
39843
39937
  ACCOUNT_EVENTS_QUERY_KEY,
@@ -40031,6 +40125,7 @@ export {
40031
40125
  CancelEventPass,
40032
40126
  CancelGroupInvitation,
40033
40127
  ChannelFormat,
40128
+ CheckInBooking,
40034
40129
  CheckinEventPass,
40035
40130
  CloneEvent,
40036
40131
  CloneEventSession,
@@ -40595,6 +40690,7 @@ export {
40595
40690
  GetAccountActivities,
40596
40691
  GetAccountAddress,
40597
40692
  GetAccountAddresses,
40693
+ GetAccountBookings,
40598
40694
  GetAccountComments,
40599
40695
  GetAccountEvents,
40600
40696
  GetAccountFollowers,
@@ -41369,6 +41465,7 @@ export {
41369
41465
  SET_ACCOUNTS_QUERY_DATA,
41370
41466
  SET_ACCOUNT_ACTIVITIES_QUERY_DATA,
41371
41467
  SET_ACCOUNT_ADDRESSES_QUERY_DATA,
41468
+ SET_ACCOUNT_BOOKINGS_QUERY_DATA,
41372
41469
  SET_ACCOUNT_COMMENTS_QUERY_DATA,
41373
41470
  SET_ACCOUNT_EMAILS_QUERY_DATA,
41374
41471
  SET_ACCOUNT_EVENTS_QUERY_DATA,
@@ -41971,6 +42068,7 @@ export {
41971
42068
  ToggleTaxIntegration,
41972
42069
  TransferEventPass,
41973
42070
  TransformPrice,
42071
+ UndoCheckInBooking,
41974
42072
  UndoCheckinEventPass,
41975
42073
  UpdateAccount,
41976
42074
  UpdateAccountAddress,
@@ -42256,6 +42354,7 @@ export {
42256
42354
  useCancelChannelContentPublishSchedule,
42257
42355
  useCancelEventPass,
42258
42356
  useCancelGroupInvitation,
42357
+ useCheckInBooking,
42259
42358
  useCheckinEventPass,
42260
42359
  useCloneEvent,
42261
42360
  useCloneEventSession,
@@ -42558,6 +42657,7 @@ export {
42558
42657
  useGetAccountActivities,
42559
42658
  useGetAccountAddress,
42560
42659
  useGetAccountAddresses,
42660
+ useGetAccountBookings,
42561
42661
  useGetAccountComments,
42562
42662
  useGetAccountEvents,
42563
42663
  useGetAccountFollowers,
@@ -43194,6 +43294,7 @@ export {
43194
43294
  useToggleOrganizationPaymentIntegration,
43195
43295
  useToggleTaxIntegration,
43196
43296
  useTransferEventPass,
43297
+ useUndoCheckInBooking,
43197
43298
  useUndoCheckinEventPass,
43198
43299
  useUpdateAccount,
43199
43300
  useUpdateAccountAddress,
package/openapi.json CHANGED
@@ -1875,6 +1875,107 @@
1875
1875
  ]
1876
1876
  }
1877
1877
  },
1878
+ "/accounts/{accountId}/bookings": {
1879
+ "get": {
1880
+ "operationId": "GetAccountBookings",
1881
+ "summary": "Get Account Bookings",
1882
+ "description": "Get Account Bookings endpoint",
1883
+ "parameters": [
1884
+ {
1885
+ "in": "path",
1886
+ "name": "accountId",
1887
+ "schema": {
1888
+ "type": "string"
1889
+ },
1890
+ "description": "The account identifier",
1891
+ "required": true
1892
+ },
1893
+ {
1894
+ "in": "query",
1895
+ "name": "page",
1896
+ "schema": {
1897
+ "type": "integer",
1898
+ "minimum": 1,
1899
+ "default": 1
1900
+ },
1901
+ "description": "Page number",
1902
+ "required": false
1903
+ },
1904
+ {
1905
+ "in": "query",
1906
+ "name": "pageSize",
1907
+ "schema": {
1908
+ "type": "integer",
1909
+ "minimum": 1,
1910
+ "maximum": 100,
1911
+ "default": 25
1912
+ },
1913
+ "description": "Number of items per page",
1914
+ "required": false
1915
+ },
1916
+ {
1917
+ "in": "query",
1918
+ "name": "orderBy",
1919
+ "schema": {
1920
+ "type": "string"
1921
+ },
1922
+ "description": "Field to order by",
1923
+ "required": false
1924
+ },
1925
+ {
1926
+ "in": "query",
1927
+ "name": "search",
1928
+ "schema": {
1929
+ "type": "string"
1930
+ },
1931
+ "description": "Search query",
1932
+ "required": false
1933
+ }
1934
+ ],
1935
+ "responses": {
1936
+ "200": {
1937
+ "description": "Successful response",
1938
+ "content": {
1939
+ "application/json": {
1940
+ "schema": {
1941
+ "type": "object",
1942
+ "properties": {
1943
+ "status": {
1944
+ "type": "string",
1945
+ "enum": [
1946
+ "ok"
1947
+ ]
1948
+ },
1949
+ "message": {
1950
+ "type": "string",
1951
+ "example": "Success message."
1952
+ },
1953
+ "data": {
1954
+ "type": "array",
1955
+ "items": {
1956
+ "$ref": "#/components/schemas/Booking"
1957
+ }
1958
+ },
1959
+ "count": {
1960
+ "type": "integer",
1961
+ "example": 100
1962
+ }
1963
+ },
1964
+ "required": [
1965
+ "status",
1966
+ "message",
1967
+ "data"
1968
+ ]
1969
+ }
1970
+ }
1971
+ }
1972
+ }
1973
+ },
1974
+ "tags": [
1975
+ "Accounts"
1976
+ ]
1977
+ }
1978
+ },
1878
1979
  "/accounts/{accountId}/comments": {
1879
1980
  "get": {
1880
1981
  "operationId": "GetAccountComments",
@@ -9420,6 +9521,148 @@
9420
9521
  ]
9421
9522
  }
9422
9523
  },
9524
+ "/bookings/places/{placeId}/spaces/{spaceId}/bookings/{bookingId}/checkin": {
9525
+ "post": {
9526
+ "operationId": "CheckInBooking",
9527
+ "summary": "Check In Booking",
9528
+ "description": "Check In Booking endpoint",
9529
+ "parameters": [
9530
+ {
9531
+ "in": "path",
9532
+ "name": "placeId",
9533
+ "schema": {
9534
+ "type": "string"
9535
+ },
9536
+ "description": "The place identifier",
9537
+ "required": true
9538
+ },
9539
+ {
9540
+ "in": "path",
9541
+ "name": "spaceId",
9542
+ "schema": {
9543
+ "type": "string"
9544
+ },
9545
+ "description": "The space identifier",
9546
+ "required": true
9547
+ },
9548
+ {
9549
+ "in": "path",
9550
+ "name": "bookingId",
9551
+ "schema": {
9552
+ "type": "string"
9553
+ },
9554
+ "description": "The booking identifier",
9555
+ "required": true
9556
+ }
9557
+ ],
9558
+ "responses": {
9559
+ "200": {
9560
+ "description": "Successful response",
9561
+ "content": {
9562
+ "application/json": {
9563
+ "schema": {
9564
+ "type": "object",
9565
+ "properties": {
9566
+ "status": {
9567
+ "type": "string",
9568
+ "enum": [
9569
+ "ok"
9570
+ ]
9571
+ },
9572
+ "message": {
9573
+ "type": "string",
9574
+ "example": "Success message."
9575
+ },
9576
+ "data": {
9577
+ "$ref": "#/components/schemas/Booking"
9578
+ }
9579
+ },
9580
+ "required": [
9581
+ "status",
9582
+ "message",
9583
+ "data"
9584
+ ]
9585
+ }
9586
+ }
9587
+ }
9588
+ }
9589
+ },
9590
+ "tags": [
9591
+ "Bookings"
9592
+ ]
9593
+ }
9594
+ },
9595
+ "/bookings/places/{placeId}/spaces/{spaceId}/bookings/{bookingId}/checkin/undo": {
9596
+ "post": {
9597
+ "operationId": "UndoCheckInBooking",
9598
+ "summary": "Undo Check In Booking",
9599
+ "description": "Undo Check In Booking endpoint",
9600
+ "parameters": [
9601
+ {
9602
+ "in": "path",
9603
+ "name": "placeId",
9604
+ "schema": {
9605
+ "type": "string"
9606
+ },
9607
+ "description": "The place identifier",
9608
+ "required": true
9609
+ },
9610
+ {
9611
+ "in": "path",
9612
+ "name": "spaceId",
9613
+ "schema": {
9614
+ "type": "string"
9615
+ },
9616
+ "description": "The space identifier",
9617
+ "required": true
9618
+ },
9619
+ {
9620
+ "in": "path",
9621
+ "name": "bookingId",
9622
+ "schema": {
9623
+ "type": "string"
9624
+ },
9625
+ "description": "The booking identifier",
9626
+ "required": true
9627
+ }
9628
+ ],
9629
+ "responses": {
9630
+ "200": {
9631
+ "description": "Successful response",
9632
+ "content": {
9633
+ "application/json": {
9634
+ "schema": {
9635
+ "type": "object",
9636
+ "properties": {
9637
+ "status": {
9638
+ "type": "string",
9639
+ "enum": [
9640
+ "ok"
9641
+ ]
9642
+ },
9643
+ "message": {
9644
+ "type": "string",
9645
+ "example": "Success message."
9646
+ },
9647
+ "data": {
9648
+ "$ref": "#/components/schemas/Booking"
9649
+ }
9650
+ },
9651
+ "required": [
9652
+ "status",
9653
+ "message",
9654
+ "data"
9655
+ ]
9656
+ }
9657
+ }
9658
+ }
9659
+ }
9660
+ },
9661
+ "tags": [
9662
+ "Bookings"
9663
+ ]
9664
+ }
9665
+ },
9423
9666
  "/bookings/places/{placeId}/spaces/{spaceId}/payments": {
9424
9667
  "get": {
9425
9668
  "operationId": "GetBookingSpacePayments",
@@ -108853,6 +109096,10 @@
108853
109096
  "duration": {
108854
109097
  "type": "number"
108855
109098
  },
109099
+ "checkedIn": {
109100
+ "type": "string",
109101
+ "nullable": true
109102
+ },
108856
109103
  "status": {
108857
109104
  "$ref": "#/components/schemas/PurchaseStatus"
108858
109105
  },
@@ -108870,6 +109117,7 @@
108870
109117
  "day",
108871
109118
  "time",
108872
109119
  "duration",
109120
+ "checkedIn",
108873
109121
  "status",
108874
109122
  "account",
108875
109123
  "space"
@@ -108902,6 +109150,9 @@
108902
109150
  "items": {
108903
109151
  "$ref": "#/components/schemas/BaseBookingQuestionResponse"
108904
109152
  }
109153
+ },
109154
+ "place": {
109155
+ "$ref": "#/components/schemas/BaseBookingPlace"
108905
109156
  }
108906
109157
  },
108907
109158
  "required": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "7.2.1",
3
+ "version": "7.2.3",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "type": "module",