@connectedxm/admin 7.4.0 → 7.5.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
@@ -7378,6 +7378,57 @@ var useGetEventCouponPayments = (eventId = "", couponId = "", params = {}, optio
7378
7378
  );
7379
7379
  };
7380
7380
 
7381
+ // src/queries/events/coupons/useGetEventCouponTiers.ts
7382
+ var EVENT_COUPON_TIERS_QUERY_KEY = (allowed, eventId, couponId) => [
7383
+ ...EVENT_COUPON_QUERY_KEY(eventId, couponId),
7384
+ "TIERS",
7385
+ allowed ? "ALLOWED" : "DISALLOWED"
7386
+ ];
7387
+ var SET_EVENT_COUPON_TIERS_QUERY_DATA = (client, keyParams, response) => {
7388
+ client.setQueryData(EVENT_COUPON_TIERS_QUERY_KEY(...keyParams), response);
7389
+ };
7390
+ var GetEventCouponTiers = async ({
7391
+ allowed,
7392
+ eventId,
7393
+ couponId,
7394
+ pageParam,
7395
+ pageSize,
7396
+ orderBy,
7397
+ search,
7398
+ adminApiParams
7399
+ }) => {
7400
+ const adminApi = await GetAdminAPI(adminApiParams);
7401
+ const { data } = await adminApi.get(
7402
+ `/events/${eventId}/coupons/${couponId}/tiers`,
7403
+ {
7404
+ params: {
7405
+ allowed,
7406
+ page: pageParam || void 0,
7407
+ pageSize: pageSize || void 0,
7408
+ orderBy: orderBy || void 0,
7409
+ search: search || void 0
7410
+ }
7411
+ }
7412
+ );
7413
+ return data;
7414
+ };
7415
+ var useGetEventCouponTiers = (allowed, eventId = "", couponId = "", params = {}, options = {}) => {
7416
+ return useConnectedInfiniteQuery(
7417
+ EVENT_COUPON_TIERS_QUERY_KEY(allowed, eventId, couponId),
7418
+ (params2) => GetEventCouponTiers({
7419
+ ...params2,
7420
+ allowed,
7421
+ eventId,
7422
+ couponId
7423
+ }),
7424
+ params,
7425
+ {
7426
+ ...options,
7427
+ enabled: typeof allowed === "boolean" && !!eventId && !!couponId && (options.enabled ?? true)
7428
+ }
7429
+ );
7430
+ };
7431
+
7381
7432
  // src/queries/events/coupons/useGetEventCouponVariants.ts
7382
7433
  var EVENT_COUPON_VARIANTS_QUERY_KEY = (eventId, parentCouponId) => {
7383
7434
  const key = [...EVENT_QUERY_KEY(eventId), "COUPONS"];
@@ -26259,6 +26310,34 @@ var useRemoveEventCoHost = (options = {}) => {
26259
26310
  return useConnectedMutation(RemoveEventCoHost, options);
26260
26311
  };
26261
26312
 
26313
+ // src/mutations/events/coupons/useAddEventCouponTier.ts
26314
+ var AddEventCouponTier = async ({
26315
+ allowed,
26316
+ eventId,
26317
+ couponId,
26318
+ tierId,
26319
+ adminApiParams,
26320
+ queryClient
26321
+ }) => {
26322
+ const connectedXM = await GetAdminAPI(adminApiParams);
26323
+ const { data } = await connectedXM.post(
26324
+ `/events/${eventId}/coupons/${couponId}/tiers/${tierId}`,
26325
+ {
26326
+ allowed
26327
+ }
26328
+ );
26329
+ if (queryClient && data.status === "ok") {
26330
+ queryClient.invalidateQueries({
26331
+ queryKey: EVENT_COUPON_TIERS_QUERY_KEY(allowed, eventId, couponId)
26332
+ });
26333
+ SET_EVENT_COUPON_QUERY_DATA(queryClient, [eventId, couponId], data);
26334
+ }
26335
+ return data;
26336
+ };
26337
+ var useAddEventCouponTier = (options = {}) => {
26338
+ return useConnectedMutation(AddEventCouponTier, options);
26339
+ };
26340
+
26262
26341
  // src/mutations/events/coupons/useCreateEventCoupon.ts
26263
26342
  var CreateEventCoupon = async ({
26264
26343
  eventId,
@@ -26354,6 +26433,36 @@ var useDeleteEventCouponVariants = (options = {}) => {
26354
26433
  return useConnectedMutation(DeleteEventCouponVariants, options);
26355
26434
  };
26356
26435
 
26436
+ // src/mutations/events/coupons/useRemoveEventCouponTier.ts
26437
+ var RemoveEventCouponTier = async ({
26438
+ allowed,
26439
+ eventId,
26440
+ couponId,
26441
+ tierId,
26442
+ adminApiParams,
26443
+ queryClient
26444
+ }) => {
26445
+ const connectedXM = await GetAdminAPI(adminApiParams);
26446
+ const { data } = await connectedXM.delete(
26447
+ `/events/${eventId}/coupons/${couponId}/tiers/${tierId}`,
26448
+ {
26449
+ params: {
26450
+ allowed
26451
+ }
26452
+ }
26453
+ );
26454
+ if (queryClient && data.status === "ok") {
26455
+ queryClient.invalidateQueries({
26456
+ queryKey: EVENT_COUPON_TIERS_QUERY_KEY(allowed, eventId, couponId)
26457
+ });
26458
+ SET_EVENT_COUPON_QUERY_DATA(queryClient, [eventId, couponId], data);
26459
+ }
26460
+ return data;
26461
+ };
26462
+ var useRemoveEventCouponTier = (options = {}) => {
26463
+ return useConnectedMutation(RemoveEventCouponTier, options);
26464
+ };
26465
+
26357
26466
  // src/mutations/events/coupons/useSyncEventCouponToVariants.ts
26358
26467
  var SyncEventCouponToVariants = async ({
26359
26468
  eventId,
@@ -40119,6 +40228,7 @@ export {
40119
40228
  AddEventBenefit,
40120
40229
  AddEventBlockSession,
40121
40230
  AddEventCoHost,
40231
+ AddEventCouponTier,
40122
40232
  AddEventFollowupAddOn,
40123
40233
  AddEventFollowupPassType,
40124
40234
  AddEventFollowupQuestion,
@@ -40587,6 +40697,7 @@ export {
40587
40697
  EVENT_COUPON_PASSES_QUERY_KEY,
40588
40698
  EVENT_COUPON_PAYMENTS_QUERY_KEY,
40589
40699
  EVENT_COUPON_QUERY_KEY,
40700
+ EVENT_COUPON_TIERS_QUERY_KEY,
40590
40701
  EVENT_COUPON_VARIANTS_QUERY_KEY,
40591
40702
  EVENT_CO_HOSTS_QUERY_KEY,
40592
40703
  EVENT_DASHBOARD_QUESTIONS_QUERY_KEY,
@@ -40962,6 +41073,7 @@ export {
40962
41073
  GetEventCoupon,
40963
41074
  GetEventCouponPasses,
40964
41075
  GetEventCouponPayments,
41076
+ GetEventCouponTiers,
40965
41077
  GetEventCouponVariants,
40966
41078
  GetEventCoupons,
40967
41079
  GetEventDashboardQuestions,
@@ -41494,6 +41606,7 @@ export {
41494
41606
  RemoveEventBenefit,
41495
41607
  RemoveEventBlockSession,
41496
41608
  RemoveEventCoHost,
41609
+ RemoveEventCouponTier,
41497
41610
  RemoveEventFollowupAddOn,
41498
41611
  RemoveEventFollowupPassType,
41499
41612
  RemoveEventFollowupQuestion,
@@ -41738,6 +41851,7 @@ export {
41738
41851
  SET_EVENT_COUPON_PASSES_QUERY_DATA,
41739
41852
  SET_EVENT_COUPON_PAYMENTS_QUERY_DATA,
41740
41853
  SET_EVENT_COUPON_QUERY_DATA,
41854
+ SET_EVENT_COUPON_TIERS_QUERY_DATA,
41741
41855
  SET_EVENT_COUPON_VARIANTS_QUERY_DATA,
41742
41856
  SET_EVENT_CO_HOSTS_QUERY_DATA,
41743
41857
  SET_EVENT_DASHBOARD_QUESTIONS_QUERY_DATA,
@@ -42423,6 +42537,7 @@ export {
42423
42537
  useAddEventBenefit,
42424
42538
  useAddEventBlockSession,
42425
42539
  useAddEventCoHost,
42540
+ useAddEventCouponTier,
42426
42541
  useAddEventFollowupAddOn,
42427
42542
  useAddEventFollowupPassType,
42428
42543
  useAddEventFollowupQuestion,
@@ -42932,6 +43047,7 @@ export {
42932
43047
  useGetEventCoupon,
42933
43048
  useGetEventCouponPasses,
42934
43049
  useGetEventCouponPayments,
43050
+ useGetEventCouponTiers,
42935
43051
  useGetEventCouponVariants,
42936
43052
  useGetEventCoupons,
42937
43053
  useGetEventDashboardQuestions,
@@ -43346,6 +43462,7 @@ export {
43346
43462
  useRemoveEventBenefit,
43347
43463
  useRemoveEventBlockSession,
43348
43464
  useRemoveEventCoHost,
43465
+ useRemoveEventCouponTier,
43349
43466
  useRemoveEventFollowupAddOn,
43350
43467
  useRemoveEventFollowupPassType,
43351
43468
  useRemoveEventFollowupQuestion,
package/openapi.json CHANGED
@@ -24692,6 +24692,283 @@
24692
24692
  ]
24693
24693
  }
24694
24694
  },
24695
+ "/events/{eventId}/coupons/{couponId}/tiers": {
24696
+ "get": {
24697
+ "operationId": "GetEventCouponTiers",
24698
+ "summary": "Get Event Coupon Tiers",
24699
+ "description": "Get Event Coupon Tiers endpoint",
24700
+ "parameters": [
24701
+ {
24702
+ "in": "path",
24703
+ "name": "eventId",
24704
+ "schema": {
24705
+ "type": "string"
24706
+ },
24707
+ "description": "The event identifier",
24708
+ "required": true
24709
+ },
24710
+ {
24711
+ "in": "path",
24712
+ "name": "couponId",
24713
+ "schema": {
24714
+ "type": "string"
24715
+ },
24716
+ "description": "The coupon identifier",
24717
+ "required": true
24718
+ },
24719
+ {
24720
+ "in": "query",
24721
+ "name": "allowed",
24722
+ "schema": {
24723
+ "type": "boolean"
24724
+ },
24725
+ "description": "Filter by allowed",
24726
+ "required": true
24727
+ },
24728
+ {
24729
+ "in": "query",
24730
+ "name": "page",
24731
+ "schema": {
24732
+ "type": "integer",
24733
+ "minimum": 1,
24734
+ "default": 1
24735
+ },
24736
+ "description": "Page number",
24737
+ "required": false
24738
+ },
24739
+ {
24740
+ "in": "query",
24741
+ "name": "pageSize",
24742
+ "schema": {
24743
+ "type": "integer",
24744
+ "minimum": 1,
24745
+ "maximum": 100,
24746
+ "default": 25
24747
+ },
24748
+ "description": "Number of items per page",
24749
+ "required": false
24750
+ },
24751
+ {
24752
+ "in": "query",
24753
+ "name": "orderBy",
24754
+ "schema": {
24755
+ "type": "string"
24756
+ },
24757
+ "description": "Field to order by",
24758
+ "required": false
24759
+ },
24760
+ {
24761
+ "in": "query",
24762
+ "name": "search",
24763
+ "schema": {
24764
+ "type": "string"
24765
+ },
24766
+ "description": "Search query",
24767
+ "required": false
24768
+ }
24769
+ ],
24770
+ "responses": {
24771
+ "200": {
24772
+ "description": "Successful response",
24773
+ "content": {
24774
+ "application/json": {
24775
+ "schema": {
24776
+ "type": "object",
24777
+ "properties": {
24778
+ "status": {
24779
+ "type": "string",
24780
+ "enum": [
24781
+ "ok"
24782
+ ]
24783
+ },
24784
+ "message": {
24785
+ "type": "string",
24786
+ "example": "Success message."
24787
+ },
24788
+ "data": {
24789
+ "type": "array",
24790
+ "items": {
24791
+ "$ref": "#/components/schemas/Tier"
24792
+ }
24793
+ },
24794
+ "count": {
24795
+ "type": "integer",
24796
+ "example": 100
24797
+ }
24798
+ },
24799
+ "required": [
24800
+ "status",
24801
+ "message",
24802
+ "data"
24803
+ ]
24804
+ }
24805
+ }
24806
+ }
24807
+ }
24808
+ },
24809
+ "tags": [
24810
+ "Events::Coupons"
24811
+ ]
24812
+ }
24813
+ },
24814
+ "/events/{eventId}/coupons/{couponId}/tiers/{tierId}": {
24815
+ "post": {
24816
+ "operationId": "AddEventCouponTier",
24817
+ "summary": "Add Event Coupon Tier",
24818
+ "description": "Add Event Coupon Tier endpoint",
24819
+ "parameters": [
24820
+ {
24821
+ "in": "path",
24822
+ "name": "eventId",
24823
+ "schema": {
24824
+ "type": "string"
24825
+ },
24826
+ "description": "The event identifier",
24827
+ "required": true
24828
+ },
24829
+ {
24830
+ "in": "path",
24831
+ "name": "couponId",
24832
+ "schema": {
24833
+ "type": "string"
24834
+ },
24835
+ "description": "The coupon identifier",
24836
+ "required": true
24837
+ },
24838
+ {
24839
+ "in": "path",
24840
+ "name": "tierId",
24841
+ "schema": {
24842
+ "type": "string"
24843
+ },
24844
+ "description": "The tier identifier",
24845
+ "required": true
24846
+ },
24847
+ {
24848
+ "in": "query",
24849
+ "name": "allowed",
24850
+ "schema": {
24851
+ "type": "boolean"
24852
+ },
24853
+ "description": "Filter by allowed",
24854
+ "required": true
24855
+ }
24856
+ ],
24857
+ "responses": {
24858
+ "200": {
24859
+ "description": "Successful response",
24860
+ "content": {
24861
+ "application/json": {
24862
+ "schema": {
24863
+ "type": "object",
24864
+ "properties": {
24865
+ "status": {
24866
+ "type": "string",
24867
+ "enum": [
24868
+ "ok"
24869
+ ]
24870
+ },
24871
+ "message": {
24872
+ "type": "string",
24873
+ "example": "Success message."
24874
+ },
24875
+ "data": {
24876
+ "$ref": "#/components/schemas/Coupon"
24877
+ }
24878
+ },
24879
+ "required": [
24880
+ "status",
24881
+ "message",
24882
+ "data"
24883
+ ]
24884
+ }
24885
+ }
24886
+ }
24887
+ }
24888
+ },
24889
+ "tags": [
24890
+ "Events::Coupons"
24891
+ ]
24892
+ },
24893
+ "delete": {
24894
+ "operationId": "RemoveEventCouponTier",
24895
+ "summary": "Remove Event Coupon Tier",
24896
+ "description": "Remove Event Coupon Tier endpoint",
24897
+ "parameters": [
24898
+ {
24899
+ "in": "path",
24900
+ "name": "eventId",
24901
+ "schema": {
24902
+ "type": "string"
24903
+ },
24904
+ "description": "The event identifier",
24905
+ "required": true
24906
+ },
24907
+ {
24908
+ "in": "path",
24909
+ "name": "couponId",
24910
+ "schema": {
24911
+ "type": "string"
24912
+ },
24913
+ "description": "The coupon identifier",
24914
+ "required": true
24915
+ },
24916
+ {
24917
+ "in": "path",
24918
+ "name": "tierId",
24919
+ "schema": {
24920
+ "type": "string"
24921
+ },
24922
+ "description": "The tier identifier",
24923
+ "required": true
24924
+ },
24925
+ {
24926
+ "in": "query",
24927
+ "name": "allowed",
24928
+ "schema": {
24929
+ "type": "boolean"
24930
+ },
24931
+ "description": "Filter by allowed",
24932
+ "required": true
24933
+ }
24934
+ ],
24935
+ "responses": {
24936
+ "200": {
24937
+ "description": "Successful response",
24938
+ "content": {
24939
+ "application/json": {
24940
+ "schema": {
24941
+ "type": "object",
24942
+ "properties": {
24943
+ "status": {
24944
+ "type": "string",
24945
+ "enum": [
24946
+ "ok"
24947
+ ]
24948
+ },
24949
+ "message": {
24950
+ "type": "string",
24951
+ "example": "Success message."
24952
+ },
24953
+ "data": {
24954
+ "$ref": "#/components/schemas/Coupon"
24955
+ }
24956
+ },
24957
+ "required": [
24958
+ "status",
24959
+ "message",
24960
+ "data"
24961
+ ]
24962
+ }
24963
+ }
24964
+ }
24965
+ }
24966
+ },
24967
+ "tags": [
24968
+ "Events::Coupons"
24969
+ ]
24970
+ }
24971
+ },
24695
24972
  "/events/{eventId}/coupons/{couponId}/variants": {
24696
24973
  "post": {
24697
24974
  "operationId": "CreateEventCouponVariants",
@@ -96291,6 +96568,18 @@
96291
96568
  {
96292
96569
  "type": "object",
96293
96570
  "properties": {
96571
+ "allowedTiers": {
96572
+ "type": "array",
96573
+ "items": {
96574
+ "$ref": "#/components/schemas/BaseTier"
96575
+ }
96576
+ },
96577
+ "disallowedTiers": {
96578
+ "type": "array",
96579
+ "items": {
96580
+ "$ref": "#/components/schemas/BaseTier"
96581
+ }
96582
+ },
96294
96583
  "registration": {
96295
96584
  "allOf": [
96296
96585
  {
@@ -96346,6 +96635,8 @@
96346
96635
  }
96347
96636
  },
96348
96637
  "required": [
96638
+ "allowedTiers",
96639
+ "disallowedTiers",
96349
96640
  "registration",
96350
96641
  "lineItem",
96351
96642
  "parentCouponId",
@@ -100093,16 +100384,8 @@
100093
100384
  "type": "string",
100094
100385
  "nullable": true
100095
100386
  },
100096
- "transfer": {
100097
- "type": "object",
100098
- "properties": {
100099
- "id": {
100100
- "type": "string"
100101
- }
100102
- },
100103
- "required": [
100104
- "id"
100105
- ],
100387
+ "transferId": {
100388
+ "type": "string",
100106
100389
  "nullable": true
100107
100390
  },
100108
100391
  "responses": {
@@ -100177,7 +100460,7 @@
100177
100460
  "ticket",
100178
100461
  "location",
100179
100462
  "usedAt",
100180
- "transfer",
100463
+ "transferId",
100181
100464
  "responses",
100182
100465
  "status",
100183
100466
  "reservationId",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "7.4.0",
3
+ "version": "7.5.0",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "type": "module",