@connectedxm/admin 6.11.2 → 6.12.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
@@ -5739,6 +5739,48 @@ var useGetEventPass = (eventId = "", passId = "", options = {}) => {
5739
5739
  );
5740
5740
  };
5741
5741
 
5742
+ // src/queries/events/passes/attributes/useGetEventPassAttributes.ts
5743
+ var EVENT_PASS_ATTRIBUTES_QUERY_KEY = (eventId, passId) => [...EVENT_PASS_QUERY_KEY(eventId, passId), "ATTRIBUTES"];
5744
+ var SET_EVENT_PASS_ATTRIBUTES_QUERY_DATA = (client, keyParams, response) => {
5745
+ client.setQueryData(EVENT_PASS_ATTRIBUTES_QUERY_KEY(...keyParams), response);
5746
+ };
5747
+ var GetEventPassAttributes = async ({
5748
+ eventId,
5749
+ passId,
5750
+ pageParam,
5751
+ pageSize,
5752
+ orderBy,
5753
+ adminApiParams
5754
+ }) => {
5755
+ const adminApi = await GetAdminAPI(adminApiParams);
5756
+ const { data } = await adminApi.get(
5757
+ `/events/${eventId}/passes/${passId}/attributes`,
5758
+ {
5759
+ params: {
5760
+ page: pageParam || void 0,
5761
+ pageSize: pageSize || void 0,
5762
+ orderBy: orderBy || void 0
5763
+ }
5764
+ }
5765
+ );
5766
+ return data;
5767
+ };
5768
+ var useGetEventPassAttributes = (eventId = "", passId = "", params = {}, options = {}) => {
5769
+ return useConnectedInfiniteQuery(
5770
+ EVENT_PASS_ATTRIBUTES_QUERY_KEY(eventId, passId),
5771
+ (params2) => GetEventPassAttributes({
5772
+ ...params2,
5773
+ eventId,
5774
+ passId
5775
+ }),
5776
+ params,
5777
+ {
5778
+ ...options,
5779
+ enabled: !!eventId && !!passId && (options.enabled ?? true)
5780
+ }
5781
+ );
5782
+ };
5783
+
5742
5784
  // src/queries/events/passes/useGetEventPassAccesses.ts
5743
5785
  var EVENT_PASS_ACCESSES_QUERY_KEY = (eventId, passId) => [...EVENT_PASS_QUERY_KEY(eventId, passId), "SESSIONS"];
5744
5786
  var SET_EVENT_PASS_ACCESSES_QUERY_DATA = (client, keyParams, response) => {
@@ -6215,6 +6257,75 @@ var useGetEventPassAttendeePasses = (eventId = "", passId = "", status, params =
6215
6257
  );
6216
6258
  };
6217
6259
 
6260
+ // src/queries/events/attributes/useGetEventAttributes.ts
6261
+ var EVENT_ATTRIBUTES_QUERY_KEY = (eventId) => [
6262
+ ...EVENT_QUERY_KEY(eventId),
6263
+ "ATTRIBUTES"
6264
+ ];
6265
+ var SET_EVENT_ATTRIBUTES_QUERY_DATA = (client, keyParams, response) => {
6266
+ client.setQueryData(EVENT_ATTRIBUTES_QUERY_KEY(...keyParams), response);
6267
+ };
6268
+ var GetEventAttributes = async ({
6269
+ eventId,
6270
+ pageParam,
6271
+ pageSize,
6272
+ orderBy,
6273
+ search,
6274
+ adminApiParams
6275
+ }) => {
6276
+ const adminApi = await GetAdminAPI(adminApiParams);
6277
+ const { data } = await adminApi.get(`/events/${eventId}/attributes`, {
6278
+ params: {
6279
+ page: pageParam || void 0,
6280
+ pageSize: pageSize || void 0,
6281
+ orderBy: orderBy || void 0,
6282
+ search: search || void 0
6283
+ }
6284
+ });
6285
+ return data;
6286
+ };
6287
+ var useGetEventAttributes = (eventId = "", params = {}, options = {}) => {
6288
+ return useConnectedInfiniteQuery(
6289
+ EVENT_ATTRIBUTES_QUERY_KEY(eventId),
6290
+ (params2) => GetEventAttributes({
6291
+ ...params2,
6292
+ eventId
6293
+ }),
6294
+ params,
6295
+ {
6296
+ ...options,
6297
+ enabled: !!eventId && (options.enabled ?? true)
6298
+ }
6299
+ );
6300
+ };
6301
+
6302
+ // src/queries/events/attributes/useGetEventAttribute.ts
6303
+ var EVENT_ATTRIBUTE_QUERY_KEY = (eventId, attributeId) => [...EVENT_ATTRIBUTES_QUERY_KEY(eventId), attributeId];
6304
+ var SET_EVENT_ATTRIBUTE_QUERY_DATA = (client, keyParams, response) => {
6305
+ client.setQueryData(EVENT_ATTRIBUTE_QUERY_KEY(...keyParams), response);
6306
+ };
6307
+ var GetEventAttribute = async ({
6308
+ eventId,
6309
+ attributeId,
6310
+ adminApiParams
6311
+ }) => {
6312
+ const adminApi = await GetAdminAPI(adminApiParams);
6313
+ const { data } = await adminApi.get(
6314
+ `/events/${eventId}/attributes/${attributeId}`
6315
+ );
6316
+ return data;
6317
+ };
6318
+ var useGetEventAttribute = (eventId = "", attributeId = "", options = {}) => {
6319
+ return useConnectedSingleQuery(
6320
+ EVENT_ATTRIBUTE_QUERY_KEY(eventId, attributeId),
6321
+ (params) => GetEventAttribute({ eventId, attributeId, ...params }),
6322
+ {
6323
+ ...options,
6324
+ enabled: !!eventId && !!attributeId && (options?.enabled ?? true)
6325
+ }
6326
+ );
6327
+ };
6328
+
6218
6329
  // src/queries/events/blocks/useGetEventBlocks.ts
6219
6330
  var EVENT_BLOCKS_QUERY_KEY = (eventId) => [
6220
6331
  ...EVENT_QUERY_KEY(eventId),
@@ -24091,6 +24202,83 @@ var useUpdateEventAttendee = (options = {}) => {
24091
24202
  return useConnectedMutation(UpdateEventAttendee, options);
24092
24203
  };
24093
24204
 
24205
+ // src/mutations/events/attributes/useCreateEventAttribute.ts
24206
+ var CreateEventAttribute = async ({
24207
+ eventId,
24208
+ attribute,
24209
+ adminApiParams,
24210
+ queryClient
24211
+ }) => {
24212
+ const connectedXM = await GetAdminAPI(adminApiParams);
24213
+ const { data } = await connectedXM.post(`/events/${eventId}/attributes`, attribute);
24214
+ if (queryClient && data.status === "ok") {
24215
+ queryClient.invalidateQueries({
24216
+ queryKey: EVENT_ATTRIBUTES_QUERY_KEY(eventId)
24217
+ });
24218
+ SET_EVENT_ATTRIBUTE_QUERY_DATA(
24219
+ queryClient,
24220
+ [eventId, data.data.id],
24221
+ data
24222
+ );
24223
+ }
24224
+ return data;
24225
+ };
24226
+ var useCreateEventAttribute = (options = {}) => {
24227
+ return useConnectedMutation(CreateEventAttribute, options);
24228
+ };
24229
+
24230
+ // src/mutations/events/attributes/useDeleteEventAttribute.ts
24231
+ var DeleteEventAttribute = async ({
24232
+ eventId,
24233
+ attributeId,
24234
+ adminApiParams,
24235
+ queryClient
24236
+ }) => {
24237
+ const connectedXM = await GetAdminAPI(adminApiParams);
24238
+ const { data } = await connectedXM.delete(
24239
+ `/events/${eventId}/attributes/${attributeId}`
24240
+ );
24241
+ if (queryClient && data.status === "ok") {
24242
+ queryClient.invalidateQueries({
24243
+ queryKey: EVENT_ATTRIBUTES_QUERY_KEY(eventId)
24244
+ });
24245
+ queryClient.removeQueries({
24246
+ queryKey: EVENT_ATTRIBUTE_QUERY_KEY(eventId, attributeId)
24247
+ });
24248
+ }
24249
+ return data;
24250
+ };
24251
+ var useDeleteEventAttribute = (options = {}) => {
24252
+ return useConnectedMutation(DeleteEventAttribute, options);
24253
+ };
24254
+
24255
+ // src/mutations/events/attributes/useUpdateEventAttribute.ts
24256
+ var UpdateEventAttribute = async ({
24257
+ eventId,
24258
+ attributeId,
24259
+ attribute,
24260
+ adminApiParams,
24261
+ queryClient
24262
+ }) => {
24263
+ if (!attributeId) throw new Error("Attribute ID Undefined");
24264
+ const connectedXM = await GetAdminAPI(adminApiParams);
24265
+ const { data } = await connectedXM.put(`/events/${eventId}/attributes/${attributeId}`, attribute);
24266
+ if (queryClient && data.status === "ok") {
24267
+ queryClient.invalidateQueries({
24268
+ queryKey: EVENT_ATTRIBUTES_QUERY_KEY(eventId)
24269
+ });
24270
+ SET_EVENT_ATTRIBUTE_QUERY_DATA(
24271
+ queryClient,
24272
+ [eventId, attributeId || data.data?.id],
24273
+ data
24274
+ );
24275
+ }
24276
+ return data;
24277
+ };
24278
+ var useUpdateEventAttribute = (options = {}) => {
24279
+ return useConnectedMutation(UpdateEventAttribute, options);
24280
+ };
24281
+
24094
24282
  // src/mutations/events/benefits/useAddEventBenefit.ts
24095
24283
  var AddEventBenefit = async ({
24096
24284
  benefitId,
@@ -26675,6 +26863,51 @@ var useUpdateEventPassType = (options = {}) => {
26675
26863
  return useConnectedMutation(UpdateEventPassType, options);
26676
26864
  };
26677
26865
 
26866
+ // src/mutations/events/passes/attributes/useRemoveEventPassAttribute.ts
26867
+ var RemoveEventPassAttribute = async ({
26868
+ eventId,
26869
+ passId,
26870
+ attributeId,
26871
+ adminApiParams,
26872
+ queryClient
26873
+ }) => {
26874
+ const connectedXM = await GetAdminAPI(adminApiParams);
26875
+ const { data } = await connectedXM.delete(`/events/${eventId}/passes/${passId}/attributes/${attributeId}`);
26876
+ if (queryClient && data.status === "ok") {
26877
+ queryClient.invalidateQueries({
26878
+ queryKey: EVENT_PASS_ATTRIBUTES_QUERY_KEY(eventId, passId)
26879
+ });
26880
+ }
26881
+ return data;
26882
+ };
26883
+ var useRemoveEventPassAttribute = (options = {}) => {
26884
+ return useConnectedMutation(RemoveEventPassAttribute, options);
26885
+ };
26886
+
26887
+ // src/mutations/events/passes/attributes/useUpdateEventPassAttributes.ts
26888
+ var UpdateEventPassAttributes = async ({
26889
+ eventId,
26890
+ passId,
26891
+ values,
26892
+ adminApiParams,
26893
+ queryClient
26894
+ }) => {
26895
+ const connectedXM = await GetAdminAPI(adminApiParams);
26896
+ const { data } = await connectedXM.put(
26897
+ `/events/${eventId}/passes/${passId}/attributes`,
26898
+ values
26899
+ );
26900
+ if (queryClient && data.status === "ok") {
26901
+ queryClient.invalidateQueries({
26902
+ queryKey: EVENT_PASS_ATTRIBUTES_QUERY_KEY(eventId, passId)
26903
+ });
26904
+ }
26905
+ return data;
26906
+ };
26907
+ var useUpdateEventPassAttributes = (options = {}) => {
26908
+ return useConnectedMutation(UpdateEventPassAttributes, options);
26909
+ };
26910
+
26678
26911
  // src/mutations/events/passes/useAddEventPassAddOn.ts
26679
26912
  var AddEventPassAddOn = async ({
26680
26913
  addOnId,
@@ -37727,6 +37960,7 @@ export {
37727
37960
  CreateEventAddOn,
37728
37961
  CreateEventAttendee,
37729
37962
  CreateEventAttendeePackage,
37963
+ CreateEventAttribute,
37730
37964
  CreateEventBlock,
37731
37965
  CreateEventCoupon,
37732
37966
  CreateEventCouponVariants,
@@ -37851,6 +38085,7 @@ export {
37851
38085
  DeleteEventAddOnTranslation,
37852
38086
  DeleteEventAttendee,
37853
38087
  DeleteEventAttendeePackage,
38088
+ DeleteEventAttribute,
37854
38089
  DeleteEventBlock,
37855
38090
  DeleteEventCoupon,
37856
38091
  DeleteEventCouponVariants,
@@ -38000,6 +38235,8 @@ export {
38000
38235
  EVENT_ATTENDEE_QUERY_KEY,
38001
38236
  EVENT_ATTENDEE_RESERVATIONS_QUERY_KEY,
38002
38237
  EVENT_ATTENDEE_TRANSFER_LOGS_QUERY_KEY,
38238
+ EVENT_ATTRIBUTES_QUERY_KEY,
38239
+ EVENT_ATTRIBUTE_QUERY_KEY,
38003
38240
  EVENT_BLOCKS_QUERY_KEY,
38004
38241
  EVENT_BLOCK_QUERY_KEY,
38005
38242
  EVENT_BLOCK_SESSIONS_QUERY_KEY,
@@ -38048,6 +38285,7 @@ export {
38048
38285
  EVENT_PASS_ACCESSES_QUERY_KEY,
38049
38286
  EVENT_PASS_ADD_ONS_QUERY_KEY,
38050
38287
  EVENT_PASS_ATTENDEE_PASSES_QUERY_KEY,
38288
+ EVENT_PASS_ATTRIBUTES_QUERY_KEY,
38051
38289
  EVENT_PASS_MATCHES_QUERY_KEY,
38052
38290
  EVENT_PASS_PAYMENTS_QUERY_KEY,
38053
38291
  EVENT_PASS_QUERY_KEY,
@@ -38347,6 +38585,8 @@ export {
38347
38585
  GetEventAttendeeReservations,
38348
38586
  GetEventAttendeeTransfersLogs,
38349
38587
  GetEventAttendees,
38588
+ GetEventAttribute,
38589
+ GetEventAttributes,
38350
38590
  GetEventBlock,
38351
38591
  GetEventBlockSessions,
38352
38592
  GetEventBlocks,
@@ -38395,6 +38635,7 @@ export {
38395
38635
  GetEventPassAccesses,
38396
38636
  GetEventPassAddOns,
38397
38637
  GetEventPassAttendeePasses,
38638
+ GetEventPassAttributes,
38398
38639
  GetEventPassMatches,
38399
38640
  GetEventPassPayments,
38400
38641
  GetEventPassQuestionFollowups,
@@ -38882,6 +39123,7 @@ export {
38882
39123
  RemoveEventMediaItemPassType,
38883
39124
  RemoveEventPageImage,
38884
39125
  RemoveEventPassAddOn,
39126
+ RemoveEventPassAttribute,
38885
39127
  RemoveEventPassTypeAddOn,
38886
39128
  RemoveEventPassTypeGroupPassTier,
38887
39129
  RemoveEventPassTypeTier,
@@ -39086,6 +39328,8 @@ export {
39086
39328
  SET_EVENT_ATTENDEE_QUERY_DATA,
39087
39329
  SET_EVENT_ATTENDEE_RESERVATIONS_QUERY_DATA,
39088
39330
  SET_EVENT_ATTENDEE_TRANSFER_LOGS_QUERY_DATA,
39331
+ SET_EVENT_ATTRIBUTES_QUERY_DATA,
39332
+ SET_EVENT_ATTRIBUTE_QUERY_DATA,
39089
39333
  SET_EVENT_BLOCKS_QUERY_DATA,
39090
39334
  SET_EVENT_BLOCK_QUERY_DATA,
39091
39335
  SET_EVENT_BLOCK_SESSIONS_QUERY_DATA,
@@ -39133,6 +39377,7 @@ export {
39133
39377
  SET_EVENT_PASS_ACCESSES_QUERY_DATA,
39134
39378
  SET_EVENT_PASS_ADD_ONS_QUERY_DATA,
39135
39379
  SET_EVENT_PASS_ATTENDEE_PASSES_QUERY_DATA,
39380
+ SET_EVENT_PASS_ATTRIBUTES_QUERY_DATA,
39136
39381
  SET_EVENT_PASS_MATCHES_QUERY_DATA,
39137
39382
  SET_EVENT_PASS_PAYMENTS_QUERY_DATA,
39138
39383
  SET_EVENT_PASS_QUERY_DATA,
@@ -39594,6 +39839,7 @@ export {
39594
39839
  UpdateEventAddOnTranslation,
39595
39840
  UpdateEventAttendee,
39596
39841
  UpdateEventAttendeePackage,
39842
+ UpdateEventAttribute,
39597
39843
  UpdateEventBlock,
39598
39844
  UpdateEventCheckinCode,
39599
39845
  UpdateEventCoupon,
@@ -39614,6 +39860,7 @@ export {
39614
39860
  UpdateEventPage,
39615
39861
  UpdateEventPageTranslation,
39616
39862
  UpdateEventPass,
39863
+ UpdateEventPassAttributes,
39617
39864
  UpdateEventPassFollowupResponses,
39618
39865
  UpdateEventPassResponse,
39619
39866
  UpdateEventPassResponses,
@@ -39855,6 +40102,7 @@ export {
39855
40102
  useCreateEventAddOn,
39856
40103
  useCreateEventAttendee,
39857
40104
  useCreateEventAttendeePackage,
40105
+ useCreateEventAttribute,
39858
40106
  useCreateEventBlock,
39859
40107
  useCreateEventCoupon,
39860
40108
  useCreateEventCouponVariants,
@@ -39970,6 +40218,7 @@ export {
39970
40218
  useDeleteEventAddOnTranslation,
39971
40219
  useDeleteEventAttendee,
39972
40220
  useDeleteEventAttendeePackage,
40221
+ useDeleteEventAttribute,
39973
40222
  useDeleteEventBlock,
39974
40223
  useDeleteEventCoupon,
39975
40224
  useDeleteEventCouponVariants,
@@ -40219,6 +40468,8 @@ export {
40219
40468
  useGetEventAttendeeReservations,
40220
40469
  useGetEventAttendeeTransfersLogs,
40221
40470
  useGetEventAttendees,
40471
+ useGetEventAttribute,
40472
+ useGetEventAttributes,
40222
40473
  useGetEventBlock,
40223
40474
  useGetEventBlockSessions,
40224
40475
  useGetEventBlocks,
@@ -40267,6 +40518,7 @@ export {
40267
40518
  useGetEventPassAccesses,
40268
40519
  useGetEventPassAddOns,
40269
40520
  useGetEventPassAttendeePasses,
40521
+ useGetEventPassAttributes,
40270
40522
  useGetEventPassMatches,
40271
40523
  useGetEventPassPayments,
40272
40524
  useGetEventPassQuestionFollowups,
@@ -40638,6 +40890,7 @@ export {
40638
40890
  useRemoveEventMediaItemPassType,
40639
40891
  useRemoveEventPageImage,
40640
40892
  useRemoveEventPassAddOn,
40893
+ useRemoveEventPassAttribute,
40641
40894
  useRemoveEventPassTypeAddOn,
40642
40895
  useRemoveEventPassTypeGroupPassTier,
40643
40896
  useRemoveEventPassTypeTier,
@@ -40747,6 +41000,7 @@ export {
40747
41000
  useUpdateEventAddOnTranslation,
40748
41001
  useUpdateEventAttendee,
40749
41002
  useUpdateEventAttendeePackage,
41003
+ useUpdateEventAttribute,
40750
41004
  useUpdateEventBlock,
40751
41005
  useUpdateEventCheckinCode,
40752
41006
  useUpdateEventCoupon,
@@ -40767,6 +41021,7 @@ export {
40767
41021
  useUpdateEventPage,
40768
41022
  useUpdateEventPageTranslation,
40769
41023
  useUpdateEventPass,
41024
+ useUpdateEventPassAttributes,
40770
41025
  useUpdateEventPassFollowupResponses,
40771
41026
  useUpdateEventPassResponse,
40772
41027
  useUpdateEventPassResponses,