@connectedxm/client 0.5.18 → 0.5.20

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.mjs CHANGED
@@ -3382,28 +3382,24 @@ var useGetSelfEventRegistration = (eventId, options = {}) => {
3382
3382
  );
3383
3383
  };
3384
3384
 
3385
- // src/queries/self/registration/useGetSelfEventRegistrationCheckout.ts
3386
- var SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY = (eventId, registrationId) => [
3387
- ...SELF_EVENT_REGISTRATION_QUERY_KEY(eventId),
3388
- registrationId,
3389
- "CHECKOUT"
3390
- ];
3391
- var GetSelfEventRegistrationCheckout = async ({
3385
+ // src/queries/self/registration/useGetSelfEventRegistrationIntent.ts
3386
+ var SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY = (eventId, registrationId) => [...SELF_EVENT_REGISTRATION_QUERY_KEY(eventId), registrationId, "INTENT"];
3387
+ var GetSelfEventRegistrationIntent = async ({
3392
3388
  eventId,
3393
3389
  registrationId,
3394
3390
  clientApiParams
3395
3391
  }) => {
3396
3392
  const clientApi = await GetClientAPI(clientApiParams);
3397
3393
  const { data } = await clientApi.get(
3398
- `/self/events/${eventId}/registration/${registrationId}/draft/checkout`
3394
+ `/self/events/${eventId}/registration/${registrationId}/draft/intent`
3399
3395
  );
3400
3396
  return data;
3401
3397
  };
3402
- var useGetSelfEventRegistrationCheckout = (eventId, registrationId = "", options = {}) => {
3398
+ var useGetSelfEventRegistrationIntent = (eventId, registrationId = "", options = {}) => {
3403
3399
  const { authenticated } = useConnectedXM();
3404
3400
  return useConnectedSingleQuery_default(
3405
- SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(eventId, registrationId),
3406
- (params) => GetSelfEventRegistrationCheckout({ eventId, registrationId, ...params }),
3401
+ SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY(eventId, registrationId),
3402
+ (params) => GetSelfEventRegistrationIntent({ eventId, registrationId, ...params }),
3407
3403
  {
3408
3404
  staleTime: Infinity,
3409
3405
  retry: false,
@@ -3671,6 +3667,65 @@ var useGetSelfEventRegistrationStatus = (eventId, selfId, options = {}) => {
3671
3667
  );
3672
3668
  };
3673
3669
 
3670
+ // src/queries/self/registration/useGetSelfEventRegistrationPurchaseAddOnsIntent.ts
3671
+ var SELF_EVENT_REGISTRATION_PURCHASE_ADD_ONS_INTENT_QUERY_KEY = (eventId, registrationId, purchaseId, addOnIds) => {
3672
+ const key = [
3673
+ ...SELF_EVENT_REGISTRATION_PURCHASE_QUERY_KEY(
3674
+ eventId,
3675
+ registrationId,
3676
+ purchaseId
3677
+ ),
3678
+ "ADD_ONS_INTENT"
3679
+ ];
3680
+ if (addOnIds) {
3681
+ key.push(...addOnIds);
3682
+ }
3683
+ return key;
3684
+ };
3685
+ var GetSelfEventRegistrationPurchaseAddOnsIntent = async ({
3686
+ eventId,
3687
+ registrationId,
3688
+ purchaseId,
3689
+ addOnIds,
3690
+ clientApiParams
3691
+ }) => {
3692
+ const clientApi = await GetClientAPI(clientApiParams);
3693
+ const { data } = await clientApi.get(
3694
+ `/self/events/${eventId}/registration/${registrationId}/registered/purchases/${purchaseId}/addOns/intent`,
3695
+ {
3696
+ params: {
3697
+ addOnIds: addOnIds ? addOnIds.join(",") : ""
3698
+ }
3699
+ }
3700
+ );
3701
+ return data;
3702
+ };
3703
+ var useGetSelfEventRegistrationPurchaseAddOnsIntent = (eventId, registrationId, purchaseId, addOnIds, options = {}) => {
3704
+ const { authenticated } = useConnectedXM();
3705
+ return useConnectedSingleQuery_default(
3706
+ SELF_EVENT_REGISTRATION_PURCHASE_ADD_ONS_INTENT_QUERY_KEY(
3707
+ eventId,
3708
+ registrationId,
3709
+ purchaseId,
3710
+ addOnIds
3711
+ ),
3712
+ (params) => GetSelfEventRegistrationPurchaseAddOnsIntent({
3713
+ eventId,
3714
+ registrationId,
3715
+ purchaseId,
3716
+ addOnIds,
3717
+ ...params
3718
+ }),
3719
+ {
3720
+ staleTime: Infinity,
3721
+ retry: false,
3722
+ retryOnMount: false,
3723
+ ...options,
3724
+ enabled: !!authenticated && !!eventId && !!registrationId && !!purchaseId && !!addOnIds && (options?.enabled ?? true)
3725
+ }
3726
+ );
3727
+ };
3728
+
3674
3729
  // src/queries/self/subscriptions/useGetSelfSubscriptions.ts
3675
3730
  var SELF_SUBSCRIPTIONS_QUERY_KEY = (status) => {
3676
3731
  const key = [...SELF_QUERY_KEY(), "SUBSCRIPTIONS"];
@@ -4854,6 +4909,34 @@ var useGetInvoice = (invoiceId = "", options = {}) => {
4854
4909
  );
4855
4910
  };
4856
4911
 
4912
+ // src/queries/invoices/useGetInvoiceIntent.ts
4913
+ var SELF_INVOICE_INTENT_QUERY_KEY = (invoiceId) => [
4914
+ ...INVOICE_QUERY_KEY(invoiceId),
4915
+ "INTENT"
4916
+ ];
4917
+ var GetInvoiceIntent = async ({
4918
+ invoiceId,
4919
+ clientApiParams
4920
+ }) => {
4921
+ const clientApi = await GetClientAPI(clientApiParams);
4922
+ const { data } = await clientApi.get(`/invoices/${invoiceId}/intent`);
4923
+ return data;
4924
+ };
4925
+ var useGetInvoiceIntent = (invoiceId, options = {}) => {
4926
+ const { authenticated } = useConnectedXM();
4927
+ return useConnectedSingleQuery_default(
4928
+ SELF_INVOICE_INTENT_QUERY_KEY(invoiceId),
4929
+ (params) => GetInvoiceIntent({ invoiceId, ...params }),
4930
+ {
4931
+ staleTime: Infinity,
4932
+ retry: false,
4933
+ retryOnMount: false,
4934
+ ...options,
4935
+ enabled: !!authenticated && !!invoiceId && (options?.enabled ?? true)
4936
+ }
4937
+ );
4938
+ };
4939
+
4857
4940
  // src/queries/listings/useGetListings.ts
4858
4941
  var LISTINGS_QUERY_KEY = (past) => [
4859
4942
  ...SELF_QUERY_KEY(),
@@ -5681,29 +5764,37 @@ var useCreateEventLead = (options = {}) => {
5681
5764
  return useConnectedMutation(CreateEventLead, options);
5682
5765
  };
5683
5766
 
5684
- // src/mutations/invoices/useCaptureInvoicePayment.ts
5685
- var CaptureInvoicePayment = async ({
5686
- invoiceId,
5687
- intentId,
5767
+ // src/mutations/organization/useCapturePaymentIntent.ts
5768
+ var CapturePaymentIntent = async ({
5769
+ intent,
5688
5770
  clientApiParams,
5689
5771
  queryClient
5690
5772
  }) => {
5691
5773
  const clientApi = await GetClientAPI(clientApiParams);
5692
5774
  const { data } = await clientApi.post(
5693
- `/invoices/${invoiceId}/capture`,
5694
- {
5695
- intentId
5696
- }
5775
+ `/organization/intents/${intent.id}/capture`
5697
5776
  );
5698
5777
  if (queryClient && data.status === "ok") {
5699
- SET_INVOICE_QUERY_DATA(queryClient, [invoiceId], data, [
5700
- clientApiParams.locale
5701
- ]);
5778
+ if (intent.eventId && intent.registrationId) {
5779
+ queryClient.invalidateQueries({
5780
+ predicate: ({ queryKey }) => {
5781
+ if (queryKey[0] === "SELF" && queryKey[1] === "EVENT_REGISTRATION" || queryKey[0] === "SELF" && queryKey[1] === "EVENT" && queryKey[3] === "REGISTRATION") {
5782
+ return true;
5783
+ }
5784
+ return false;
5785
+ }
5786
+ });
5787
+ }
5788
+ if (intent.invoiceId) {
5789
+ queryClient.invalidateQueries({
5790
+ queryKey: INVOICE_QUERY_KEY(intent.invoiceId)
5791
+ });
5792
+ }
5702
5793
  }
5703
5794
  return data;
5704
5795
  };
5705
- var useCaptureInvoicePayment = (options = {}) => {
5706
- return useConnectedMutation_default(CaptureInvoicePayment, options);
5796
+ var useCapturePaymentIntent = (options = {}) => {
5797
+ return useConnectedMutation_default(CapturePaymentIntent, options);
5707
5798
  };
5708
5799
 
5709
5800
  // src/mutations/self/chat/useAddSelfChatChannelMember.ts
@@ -5924,7 +6015,7 @@ var SelectSelfEventRegistrationCoupon = async ({
5924
6015
  clientApiParams.locale
5925
6016
  ]);
5926
6017
  queryClient.removeQueries({
5927
- queryKey: SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(
6018
+ queryKey: SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY(
5928
6019
  eventId,
5929
6020
  registrationId
5930
6021
  )
@@ -5948,37 +6039,6 @@ var useSelectSelfEventRegistrationCoupon = (options = {}) => {
5948
6039
  return useConnectedMutation_default(SelectSelfEventRegistrationCoupon, options);
5949
6040
  };
5950
6041
 
5951
- // src/mutations/self/events/registration/draft/useCaptureSelfEventRegistrationPayment.ts
5952
- var CaptureSelfEventRegistrationPayment = async ({
5953
- eventId,
5954
- registrationId,
5955
- clientApiParams,
5956
- queryClient
5957
- }) => {
5958
- const clientApi = await GetClientAPI(clientApiParams);
5959
- const { data } = await clientApi.post(
5960
- `/self/events/${eventId}/registration/${registrationId}/draft/capture`
5961
- );
5962
- if (queryClient && data.status === "ok") {
5963
- SET_SELF_EVENT_REGISTRATION_QUERY_DATA(queryClient, [eventId], data, [
5964
- clientApiParams.locale
5965
- ]);
5966
- queryClient.invalidateQueries({
5967
- queryKey: SELF_EVENT_REGISTRATION_STATUS_QUERY_KEY(eventId)
5968
- });
5969
- ADD_SELF_RELATIONSHIP(
5970
- queryClient,
5971
- [clientApiParams.locale],
5972
- "events",
5973
- eventId
5974
- );
5975
- }
5976
- return data;
5977
- };
5978
- var useCaptureSelfEventRegistrationPayment = (options = {}) => {
5979
- return useConnectedMutation_default(CaptureSelfEventRegistrationPayment, options);
5980
- };
5981
-
5982
6042
  // src/mutations/self/events/registration/draft/useRemoveSelfEventRegistrationCoupon.ts
5983
6043
  var RemoveSelfEventRegistrationCoupon = async ({
5984
6044
  eventId,
@@ -5992,7 +6052,7 @@ var RemoveSelfEventRegistrationCoupon = async ({
5992
6052
  );
5993
6053
  if (queryClient && data.status === "ok") {
5994
6054
  queryClient.removeQueries({
5995
- queryKey: SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(
6055
+ queryKey: SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY(
5996
6056
  eventId,
5997
6057
  registrationId
5998
6058
  )
@@ -6033,7 +6093,7 @@ var RemoveSelfEventRegistrationPurchase = async ({
6033
6093
  );
6034
6094
  if (queryClient && data.status === "ok") {
6035
6095
  queryClient.removeQueries({
6036
- queryKey: SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(
6096
+ queryKey: SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY(
6037
6097
  eventId,
6038
6098
  registrationId
6039
6099
  )
@@ -6070,7 +6130,7 @@ var AddSelfEventRegistrationPurchase = async ({
6070
6130
  clientApiParams.locale
6071
6131
  ]);
6072
6132
  queryClient.removeQueries({
6073
- queryKey: SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(
6133
+ queryKey: SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY(
6074
6134
  eventId,
6075
6135
  registrationId
6076
6136
  )
@@ -6240,7 +6300,7 @@ var AddSelfEventRegistrationPurchaseAddOn = async ({
6240
6300
  clientApiParams.locale
6241
6301
  ]);
6242
6302
  queryClient.removeQueries({
6243
- queryKey: SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(
6303
+ queryKey: SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY(
6244
6304
  eventId,
6245
6305
  registrationId
6246
6306
  )
@@ -6273,7 +6333,7 @@ var RemoveSelfEventRegistrationPurchaseAddOn = async ({
6273
6333
  );
6274
6334
  if (queryClient && data.status === "ok") {
6275
6335
  queryClient.removeQueries({
6276
- queryKey: SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(
6336
+ queryKey: SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY(
6277
6337
  eventId,
6278
6338
  registrationId
6279
6339
  )
@@ -6312,7 +6372,7 @@ var SelectSelfEventRegistrationPurchaseReservation = async ({
6312
6372
  clientApiParams.locale
6313
6373
  ]);
6314
6374
  queryClient.removeQueries({
6315
- queryKey: SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(
6375
+ queryKey: SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY(
6316
6376
  eventId,
6317
6377
  registrationId
6318
6378
  )
@@ -6431,6 +6491,38 @@ var useTransferPurchase = (options = {}) => {
6431
6491
  return useConnectedMutation_default(TransferPurchase, options);
6432
6492
  };
6433
6493
 
6494
+ // src/mutations/self/events/registration/registered/useAddFreePurchaseAddOns.ts
6495
+ var AddFreePurchaseAddOns = async ({
6496
+ eventId,
6497
+ registrationId,
6498
+ purchaseId,
6499
+ addOnIds,
6500
+ clientApiParams,
6501
+ queryClient
6502
+ }) => {
6503
+ const clientApi = await GetClientAPI(clientApiParams);
6504
+ const { data } = await clientApi.post(
6505
+ `/self/events/${eventId}/registration/${registrationId}/registered/purchases/${purchaseId}/addOns/free`,
6506
+ {
6507
+ addOnIds
6508
+ }
6509
+ );
6510
+ if (queryClient && data.status === "ok") {
6511
+ queryClient.invalidateQueries({
6512
+ predicate: ({ queryKey }) => {
6513
+ if (queryKey[0] === "SELF" && queryKey[1] === "EVENT_REGISTRATION" || queryKey[0] === "SELF" && queryKey[1] === "EVENT" && queryKey[3] === "REGISTRATION") {
6514
+ return true;
6515
+ }
6516
+ return false;
6517
+ }
6518
+ });
6519
+ }
6520
+ return data;
6521
+ };
6522
+ var useAddFreePurchaseAddOns = (options = {}) => {
6523
+ return useConnectedMutation_default(AddFreePurchaseAddOns, options);
6524
+ };
6525
+
6434
6526
  // src/mutations/self/subscriptions/useCancelSubscription.ts
6435
6527
  var CancelSubscription = async ({
6436
6528
  subscriptionId,
@@ -8145,6 +8237,7 @@ export {
8145
8237
  AcceptGroupRequest,
8146
8238
  AcceptTransfer,
8147
8239
  AccountType,
8240
+ AddFreePurchaseAddOns,
8148
8241
  AddListingCoHost,
8149
8242
  AddListingSponsor,
8150
8243
  AddSelfChatChannelMember,
@@ -8168,8 +8261,7 @@ export {
8168
8261
  CancelGroupRequest,
8169
8262
  CancelSubscription,
8170
8263
  CancelTransfer,
8171
- CaptureInvoicePayment,
8172
- CaptureSelfEventRegistrationPayment,
8264
+ CapturePaymentIntent,
8173
8265
  ChannelFormat,
8174
8266
  CheckinListingRegistrationPurchase,
8175
8267
  CompleteEventActivation,
@@ -8298,6 +8390,7 @@ export {
8298
8390
  GetGroupsRequested,
8299
8391
  GetInterests,
8300
8392
  GetInvoice,
8393
+ GetInvoiceIntent,
8301
8394
  GetLevel,
8302
8395
  GetLevelSponsors,
8303
8396
  GetLevels,
@@ -8329,9 +8422,10 @@ export {
8329
8422
  GetSelfEventListingReport,
8330
8423
  GetSelfEventListings,
8331
8424
  GetSelfEventRegistration,
8332
- GetSelfEventRegistrationCheckout,
8425
+ GetSelfEventRegistrationIntent,
8333
8426
  GetSelfEventRegistrationPurchase,
8334
8427
  GetSelfEventRegistrationPurchaseAddOns,
8428
+ GetSelfEventRegistrationPurchaseAddOnsIntent,
8335
8429
  GetSelfEventRegistrationPurchaseReservationSections,
8336
8430
  GetSelfEventRegistrationPurchaseSections,
8337
8431
  GetSelfEventRegistrationStatus,
@@ -8420,7 +8514,8 @@ export {
8420
8514
  SELF_DELEGATES_QUERY_KEY,
8421
8515
  SELF_DELEGATE_OF_QUERY_KEY,
8422
8516
  SELF_EVENTS_QUERY_KEY,
8423
- SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY,
8517
+ SELF_EVENT_REGISTRATION_INTENT_QUERY_KEY,
8518
+ SELF_EVENT_REGISTRATION_PURCHASE_ADD_ONS_INTENT_QUERY_KEY,
8424
8519
  SELF_EVENT_REGISTRATION_PURCHASE_ADD_ONS_QUERY_KEY,
8425
8520
  SELF_EVENT_REGISTRATION_PURCHASE_QUERY_KEY,
8426
8521
  SELF_EVENT_REGISTRATION_PURCHASE_RESERVATION_SECTIONS_QUERY_KEY,
@@ -8432,6 +8527,7 @@ export {
8432
8527
  SELF_GROUP_MEMBERSHIPS_QUERY_KEY,
8433
8528
  SELF_GROUP_MEMBERSHIP_QUERY_KEY,
8434
8529
  SELF_INTERESTS_QUERY_KEY,
8530
+ SELF_INVOICE_INTENT_QUERY_KEY,
8435
8531
  SELF_NOTIFICATIONS_QUERY_KEY,
8436
8532
  SELF_NOTIFICATION_COUNT_QUERY_KEY,
8437
8533
  SELF_PENDING_TRANSFER_QUERY_KEY,
@@ -8594,6 +8690,7 @@ export {
8594
8690
  useAcceptGroupInvitation,
8595
8691
  useAcceptGroupRequest,
8596
8692
  useAcceptTransfer,
8693
+ useAddFreePurchaseAddOns,
8597
8694
  useAddListingCoHost,
8598
8695
  useAddListingSponsor,
8599
8696
  useAddSelfChatChannelMember,
@@ -8607,8 +8704,7 @@ export {
8607
8704
  useCancelGroupRequest,
8608
8705
  useCancelSubscription,
8609
8706
  useCancelTransfer,
8610
- useCaptureInvoicePayment,
8611
- useCaptureSelfEventRegistrationPayment,
8707
+ useCapturePaymentIntent,
8612
8708
  useCheckinListingRegistrationPurchase,
8613
8709
  useCompleteEventActivation,
8614
8710
  useConnectedInfiniteQuery,
@@ -8696,6 +8792,7 @@ export {
8696
8792
  useGetGroupsRequested,
8697
8793
  useGetInterests,
8698
8794
  useGetInvoice,
8795
+ useGetInvoiceIntent,
8699
8796
  useGetLevel,
8700
8797
  useGetLevelSponsors,
8701
8798
  useGetLevels,
@@ -8727,9 +8824,10 @@ export {
8727
8824
  useGetSelfEventListings,
8728
8825
  useGetSelfEventListingsRegistrations,
8729
8826
  useGetSelfEventRegistration,
8730
- useGetSelfEventRegistrationCheckout,
8827
+ useGetSelfEventRegistrationIntent,
8731
8828
  useGetSelfEventRegistrationPurchase,
8732
8829
  useGetSelfEventRegistrationPurchaseAddOns,
8830
+ useGetSelfEventRegistrationPurchaseAddOnsIntent,
8733
8831
  useGetSelfEventRegistrationPurchaseReservationSections,
8734
8832
  useGetSelfEventRegistrationPurchaseSections,
8735
8833
  useGetSelfEventRegistrationStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/client",
3
- "version": "0.5.18",
3
+ "version": "0.5.20",
4
4
  "description": "Client API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "repository": {