@connectedxm/admin 2.7.6 → 2.8.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.cjs CHANGED
@@ -303,6 +303,7 @@ __export(index_exports, {
303
303
  CreateOrganizationPaymentIntegration: () => CreateOrganizationPaymentIntegration,
304
304
  CreateOrganizationSideEffect: () => CreateOrganizationSideEffect,
305
305
  CreateOrganizationTeamMember: () => CreateOrganizationTeamMember,
306
+ CreateOrganizationWebhook: () => CreateOrganizationWebhook,
306
307
  CreateSelfApiKey: () => CreateSelfApiKey,
307
308
  CreateSeries: () => CreateSeries,
308
309
  CreateStreamInput: () => CreateStreamInput,
@@ -451,6 +452,7 @@ __export(index_exports, {
451
452
  DeleteOrganizationSideEffect: () => DeleteOrganizationSideEffect,
452
453
  DeleteOrganizationTeamMember: () => DeleteOrganizationTeamMember,
453
454
  DeleteOrganizationUser: () => DeleteOrganizationUser,
455
+ DeleteOrganizationWebhook: () => DeleteOrganizationWebhook,
454
456
  DeleteSelfApiKey: () => DeleteSelfApiKey,
455
457
  DeleteSeries: () => DeleteSeries,
456
458
  DeleteStreamInput: () => DeleteStreamInput,
@@ -1059,6 +1061,8 @@ __export(index_exports, {
1059
1061
  GetOrganizationTeamMembers: () => GetOrganizationTeamMembers,
1060
1062
  GetOrganizationTrigger: () => GetOrganizationTrigger,
1061
1063
  GetOrganizationUsers: () => GetOrganizationUsers,
1064
+ GetOrganizationWebhook: () => GetOrganizationWebhook,
1065
+ GetOrganizationWebhooks: () => GetOrganizationWebhooks,
1062
1066
  GetPayment: () => GetPayment,
1063
1067
  GetPayments: () => GetPayments,
1064
1068
  GetReport: () => GetReport,
@@ -1205,6 +1209,8 @@ __export(index_exports, {
1205
1209
  ORGANIZATION_TEAM_MEMBER_QUERY_KEY: () => ORGANIZATION_TEAM_MEMBER_QUERY_KEY,
1206
1210
  ORGANIZATION_TRIGGER_QUERY_KEY: () => ORGANIZATION_TRIGGER_QUERY_KEY,
1207
1211
  ORGANIZATION_USERS_QUERY_KEY: () => ORGANIZATION_USERS_QUERY_KEY,
1212
+ ORGANIZATION_WEBHOOKS_QUERY_KEY: () => ORGANIZATION_WEBHOOKS_QUERY_KEY,
1213
+ ORGANIZATION_WEBHOOK_QUERY_KEY: () => ORGANIZATION_WEBHOOK_QUERY_KEY,
1208
1214
  OrganizationActionType: () => OrganizationActionType,
1209
1215
  OrganizationModuleType: () => OrganizationModuleType,
1210
1216
  OrganizationTriggerType: () => OrganizationTriggerType,
@@ -1651,6 +1657,8 @@ __export(index_exports, {
1651
1657
  SET_ORGANIZATION_TEAM_MEMBER_QUERY_DATA: () => SET_ORGANIZATION_TEAM_MEMBER_QUERY_DATA,
1652
1658
  SET_ORGANIZATION_TRIGGER_QUERY_DATA: () => SET_ORGANIZATION_TRIGGER_QUERY_DATA,
1653
1659
  SET_ORGANIZATION_USERS_QUERY_DATA: () => SET_ORGANIZATION_USERS_QUERY_DATA,
1660
+ SET_ORGANIZATION_WEBHOOKS_QUERY_DATA: () => SET_ORGANIZATION_WEBHOOKS_QUERY_DATA,
1661
+ SET_ORGANIZATION_WEBHOOK_QUERY_DATA: () => SET_ORGANIZATION_WEBHOOK_QUERY_DATA,
1654
1662
  SET_PASS_TYPE_COUPONS_QUERY_DATA: () => SET_PASS_TYPE_COUPONS_QUERY_DATA,
1655
1663
  SET_PAYMENTS_QUERY_DATA: () => SET_PAYMENTS_QUERY_DATA,
1656
1664
  SET_PAYMENT_QUERY_DATA: () => SET_PAYMENT_QUERY_DATA,
@@ -1932,6 +1940,7 @@ __export(index_exports, {
1932
1940
  UpdateOrganizationPageTranslation: () => UpdateOrganizationPageTranslation,
1933
1941
  UpdateOrganizationTeamMember: () => UpdateOrganizationTeamMember,
1934
1942
  UpdateOrganizationTrigger: () => UpdateOrganizationTrigger,
1943
+ UpdateOrganizationWebhook: () => UpdateOrganizationWebhook,
1935
1944
  UpdatePayment: () => UpdatePayment,
1936
1945
  UpdateSelf: () => UpdateSelf,
1937
1946
  UpdateSeries: () => UpdateSeries,
@@ -1964,6 +1973,7 @@ __export(index_exports, {
1964
1973
  UserRole: () => UserRole,
1965
1974
  VIDEOS_QUERY_KEY: () => VIDEOS_QUERY_KEY,
1966
1975
  VIDEO_QUERY_KEY: () => VIDEO_QUERY_KEY,
1976
+ VerifyOrganizationWebhook: () => VerifyOrganizationWebhook,
1967
1977
  VideoSource: () => VideoSource,
1968
1978
  VideoStatus: () => VideoStatus,
1969
1979
  WidgetCategory: () => WidgetCategory,
@@ -2139,6 +2149,7 @@ __export(index_exports, {
2139
2149
  useCreateOrganizationPaymentIntegration: () => useCreateOrganizationPaymentIntegration,
2140
2150
  useCreateOrganizationSideEffect: () => useCreateOrganizationSideEffect,
2141
2151
  useCreateOrganizationTeamMember: () => useCreateOrganizationTeamMember,
2152
+ useCreateOrganizationWebhook: () => useCreateOrganizationWebhook,
2142
2153
  useCreateSelfApiKey: () => useCreateSelfApiKey,
2143
2154
  useCreateSeries: () => useCreateSeries,
2144
2155
  useCreateStreamInput: () => useCreateStreamInput,
@@ -2279,6 +2290,7 @@ __export(index_exports, {
2279
2290
  useDeleteOrganizationSideEffect: () => useDeleteOrganizationSideEffect,
2280
2291
  useDeleteOrganizationTeamMember: () => useDeleteOrganizationTeamMember,
2281
2292
  useDeleteOrganizationUser: () => useDeleteOrganizationUser,
2293
+ useDeleteOrganizationWebhook: () => useDeleteOrganizationWebhook,
2282
2294
  useDeleteSelfApiKey: () => useDeleteSelfApiKey,
2283
2295
  useDeleteSeries: () => useDeleteSeries,
2284
2296
  useDeleteStreamInput: () => useDeleteStreamInput,
@@ -2669,6 +2681,8 @@ __export(index_exports, {
2669
2681
  useGetOrganizationTeamMembers: () => useGetOrganizationTeamMembers,
2670
2682
  useGetOrganizationTrigger: () => useGetOrganizationTrigger,
2671
2683
  useGetOrganizationUsers: () => useGetOrganizationUsers,
2684
+ useGetOrganizationWebhook: () => useGetOrganizationWebhook,
2685
+ useGetOrganizationWebhooks: () => useGetOrganizationWebhooks,
2672
2686
  useGetPayment: () => useGetPayment,
2673
2687
  useGetPayments: () => useGetPayments,
2674
2688
  useGetReport: () => useGetReport,
@@ -2947,6 +2961,7 @@ __export(index_exports, {
2947
2961
  useUpdateOrganizationPageTranslation: () => useUpdateOrganizationPageTranslation,
2948
2962
  useUpdateOrganizationTeamMember: () => useUpdateOrganizationTeamMember,
2949
2963
  useUpdateOrganizationTrigger: () => useUpdateOrganizationTrigger,
2964
+ useUpdateOrganizationWebhook: () => useUpdateOrganizationWebhook,
2950
2965
  useUpdatePayment: () => useUpdatePayment,
2951
2966
  useUpdateSelf: () => useUpdateSelf,
2952
2967
  useUpdateSeries: () => useUpdateSeries,
@@ -2975,7 +2990,8 @@ __export(index_exports, {
2975
2990
  useUpdateTier: () => useUpdateTier,
2976
2991
  useUpdateUserImage: () => useUpdateUserImage,
2977
2992
  useUpdateVideo: () => useUpdateVideo,
2978
- useUploadFile: () => useUploadFile
2993
+ useUploadFile: () => useUploadFile,
2994
+ useVerifyOrganizationWebhook: () => useVerifyOrganizationWebhook
2979
2995
  });
2980
2996
  module.exports = __toCommonJS(index_exports);
2981
2997
 
@@ -18396,6 +18412,70 @@ var useGetOrganizationUsers = (params = {}, options = {}) => {
18396
18412
  );
18397
18413
  };
18398
18414
 
18415
+ // src/queries/organization/useGetOrganizationWebhooks.ts
18416
+ var ORGANIZATION_WEBHOOKS_QUERY_KEY = () => [
18417
+ ...ORGANIZATION_QUERY_KEY(),
18418
+ "WEBHOOKS"
18419
+ ];
18420
+ var SET_ORGANIZATION_WEBHOOKS_QUERY_DATA = (client, keyParams, response) => {
18421
+ client.setQueryData(ORGANIZATION_WEBHOOKS_QUERY_KEY(...keyParams), response);
18422
+ };
18423
+ var GetOrganizationWebhooks = async ({
18424
+ pageParam,
18425
+ pageSize,
18426
+ orderBy,
18427
+ search,
18428
+ adminApiParams
18429
+ }) => {
18430
+ const adminApi = await GetAdminAPI(adminApiParams);
18431
+ const { data } = await adminApi.get(`/organization/webhooks`, {
18432
+ params: {
18433
+ page: pageParam || void 0,
18434
+ pageSize: pageSize || void 0,
18435
+ orderBy: orderBy || void 0,
18436
+ search: search || void 0
18437
+ }
18438
+ });
18439
+ return data;
18440
+ };
18441
+ var useGetOrganizationWebhooks = (params = {}, options = {}) => {
18442
+ return useConnectedInfiniteQuery(
18443
+ ORGANIZATION_WEBHOOKS_QUERY_KEY(),
18444
+ (params2) => GetOrganizationWebhooks(params2),
18445
+ params,
18446
+ options,
18447
+ "org"
18448
+ );
18449
+ };
18450
+
18451
+ // src/queries/organization/useGetOrganizationWebhook.ts
18452
+ var ORGANIZATION_WEBHOOK_QUERY_KEY = (webhookId) => [
18453
+ ...ORGANIZATION_WEBHOOKS_QUERY_KEY(),
18454
+ webhookId
18455
+ ];
18456
+ var SET_ORGANIZATION_WEBHOOK_QUERY_DATA = (client, keyParams, response) => {
18457
+ client.setQueryData(ORGANIZATION_WEBHOOK_QUERY_KEY(...keyParams), response);
18458
+ };
18459
+ var GetOrganizationWebhook = async ({
18460
+ webhookId,
18461
+ adminApiParams
18462
+ }) => {
18463
+ const adminApi = await GetAdminAPI(adminApiParams);
18464
+ const { data } = await adminApi.get(`/organization/webhooks/${webhookId}`);
18465
+ return data;
18466
+ };
18467
+ var useGetOrganizationWebhook = (webhookId = "", options = {}) => {
18468
+ return useConnectedSingleQuery(
18469
+ ORGANIZATION_WEBHOOK_QUERY_KEY(webhookId),
18470
+ (params) => GetOrganizationWebhook({ ...params, webhookId }),
18471
+ {
18472
+ ...options,
18473
+ enabled: !!webhookId && (options.enabled ?? true)
18474
+ },
18475
+ "org"
18476
+ );
18477
+ };
18478
+
18399
18479
  // src/queries/organization/useSearchOrganization.ts
18400
18480
  var SEARCH_ORGANIZATION_QUERY_KEY = (search, filters) => [
18401
18481
  "SEARCH_ORGANIZATION",
@@ -35202,6 +35282,32 @@ var useCreateOrganizationTeamMember = (options = {}) => {
35202
35282
  });
35203
35283
  };
35204
35284
 
35285
+ // src/mutations/organization/useCreateOrganizationWebhook.ts
35286
+ var CreateOrganizationWebhook = async ({
35287
+ webhook,
35288
+ adminApiParams,
35289
+ queryClient
35290
+ }) => {
35291
+ const connectedXM = await GetAdminAPI(adminApiParams);
35292
+ const { data } = await connectedXM.post(
35293
+ `/organization/webhooks`,
35294
+ webhook
35295
+ );
35296
+ if (queryClient && data.status === "ok") {
35297
+ queryClient.invalidateQueries({
35298
+ queryKey: ORGANIZATION_WEBHOOKS_QUERY_KEY()
35299
+ });
35300
+ SET_ORGANIZATION_WEBHOOK_QUERY_DATA(queryClient, [data.data.id], data);
35301
+ }
35302
+ return data;
35303
+ };
35304
+ var useCreateOrganizationWebhook = (options = {}) => {
35305
+ return useConnectedMutation(CreateOrganizationWebhook, options, {
35306
+ domain: "org",
35307
+ type: "update"
35308
+ });
35309
+ };
35310
+
35205
35311
  // src/mutations/organization/useDeleteOrganizationDomain.ts
35206
35312
  var DeleteOrganizationDomain = async ({
35207
35313
  adminApiParams,
@@ -35272,6 +35378,33 @@ var useDeleteOrganizationUser = (options = {}) => {
35272
35378
  });
35273
35379
  };
35274
35380
 
35381
+ // src/mutations/organization/useDeleteOrganizationWebhook.ts
35382
+ var DeleteOrganizationWebhook = async ({
35383
+ webhookId,
35384
+ adminApiParams,
35385
+ queryClient
35386
+ }) => {
35387
+ const connectedXM = await GetAdminAPI(adminApiParams);
35388
+ const { data } = await connectedXM.delete(
35389
+ `/organization/webhooks/${webhookId}`
35390
+ );
35391
+ if (queryClient && data.status === "ok") {
35392
+ queryClient.invalidateQueries({
35393
+ queryKey: ORGANIZATION_WEBHOOKS_QUERY_KEY()
35394
+ });
35395
+ queryClient.removeQueries({
35396
+ queryKey: ORGANIZATION_WEBHOOK_QUERY_KEY(webhookId)
35397
+ });
35398
+ }
35399
+ return data;
35400
+ };
35401
+ var useDeleteOrganizationWebhook = (options = {}) => {
35402
+ return useConnectedMutation(DeleteOrganizationWebhook, options, {
35403
+ domain: "org",
35404
+ type: "update"
35405
+ });
35406
+ };
35407
+
35275
35408
  // src/mutations/organization/useRefundOrganizationPayment.ts
35276
35409
  var RefundOrganizationPayment = async ({
35277
35410
  paymentId,
@@ -35455,6 +35588,58 @@ var useUpdateOrganizationTeamMember = (options = {}) => {
35455
35588
  });
35456
35589
  };
35457
35590
 
35591
+ // src/mutations/organization/useUpdateOrganizationWebhook.ts
35592
+ var UpdateOrganizationWebhook = async ({
35593
+ webhookId,
35594
+ webhook,
35595
+ adminApiParams,
35596
+ queryClient
35597
+ }) => {
35598
+ const connectedXM = await GetAdminAPI(adminApiParams);
35599
+ const { data } = await connectedXM.put(
35600
+ `/organization/webhooks/${webhookId}`,
35601
+ webhook
35602
+ );
35603
+ if (queryClient && data.status === "ok") {
35604
+ queryClient.invalidateQueries({
35605
+ queryKey: ORGANIZATION_WEBHOOKS_QUERY_KEY()
35606
+ });
35607
+ SET_ORGANIZATION_WEBHOOK_QUERY_DATA(queryClient, [webhookId], data);
35608
+ }
35609
+ return data;
35610
+ };
35611
+ var useUpdateOrganizationWebhook = (options = {}) => {
35612
+ return useConnectedMutation(UpdateOrganizationWebhook, options, {
35613
+ domain: "org",
35614
+ type: "update"
35615
+ });
35616
+ };
35617
+
35618
+ // src/mutations/organization/useVerifyOrganizationWebhook.ts
35619
+ var VerifyOrganizationWebhook = async ({
35620
+ webhookId,
35621
+ adminApiParams,
35622
+ queryClient
35623
+ }) => {
35624
+ const connectedXM = await GetAdminAPI(adminApiParams);
35625
+ const { data } = await connectedXM.post(
35626
+ `/organization/webhooks/${webhookId}/verify`
35627
+ );
35628
+ if (queryClient && data.status === "ok") {
35629
+ queryClient.invalidateQueries({
35630
+ queryKey: ORGANIZATION_WEBHOOKS_QUERY_KEY()
35631
+ });
35632
+ SET_ORGANIZATION_WEBHOOK_QUERY_DATA(queryClient, [webhookId], data);
35633
+ }
35634
+ return data;
35635
+ };
35636
+ var useVerifyOrganizationWebhook = (options = {}) => {
35637
+ return useConnectedMutation(VerifyOrganizationWebhook, options, {
35638
+ domain: "org",
35639
+ type: "update"
35640
+ });
35641
+ };
35642
+
35458
35643
  // src/mutations/payments/useUpdatePayment.ts
35459
35644
  var UpdatePayment = async ({
35460
35645
  paymentId,
@@ -38542,6 +38727,7 @@ var useUpdateVideo = (options = {}) => {
38542
38727
  CreateOrganizationPaymentIntegration,
38543
38728
  CreateOrganizationSideEffect,
38544
38729
  CreateOrganizationTeamMember,
38730
+ CreateOrganizationWebhook,
38545
38731
  CreateSelfApiKey,
38546
38732
  CreateSeries,
38547
38733
  CreateStreamInput,
@@ -38690,6 +38876,7 @@ var useUpdateVideo = (options = {}) => {
38690
38876
  DeleteOrganizationSideEffect,
38691
38877
  DeleteOrganizationTeamMember,
38692
38878
  DeleteOrganizationUser,
38879
+ DeleteOrganizationWebhook,
38693
38880
  DeleteSelfApiKey,
38694
38881
  DeleteSeries,
38695
38882
  DeleteStreamInput,
@@ -39298,6 +39485,8 @@ var useUpdateVideo = (options = {}) => {
39298
39485
  GetOrganizationTeamMembers,
39299
39486
  GetOrganizationTrigger,
39300
39487
  GetOrganizationUsers,
39488
+ GetOrganizationWebhook,
39489
+ GetOrganizationWebhooks,
39301
39490
  GetPayment,
39302
39491
  GetPayments,
39303
39492
  GetReport,
@@ -39444,6 +39633,8 @@ var useUpdateVideo = (options = {}) => {
39444
39633
  ORGANIZATION_TEAM_MEMBER_QUERY_KEY,
39445
39634
  ORGANIZATION_TRIGGER_QUERY_KEY,
39446
39635
  ORGANIZATION_USERS_QUERY_KEY,
39636
+ ORGANIZATION_WEBHOOKS_QUERY_KEY,
39637
+ ORGANIZATION_WEBHOOK_QUERY_KEY,
39447
39638
  OrganizationActionType,
39448
39639
  OrganizationModuleType,
39449
39640
  OrganizationTriggerType,
@@ -39890,6 +40081,8 @@ var useUpdateVideo = (options = {}) => {
39890
40081
  SET_ORGANIZATION_TEAM_MEMBER_QUERY_DATA,
39891
40082
  SET_ORGANIZATION_TRIGGER_QUERY_DATA,
39892
40083
  SET_ORGANIZATION_USERS_QUERY_DATA,
40084
+ SET_ORGANIZATION_WEBHOOKS_QUERY_DATA,
40085
+ SET_ORGANIZATION_WEBHOOK_QUERY_DATA,
39893
40086
  SET_PASS_TYPE_COUPONS_QUERY_DATA,
39894
40087
  SET_PAYMENTS_QUERY_DATA,
39895
40088
  SET_PAYMENT_QUERY_DATA,
@@ -40171,6 +40364,7 @@ var useUpdateVideo = (options = {}) => {
40171
40364
  UpdateOrganizationPageTranslation,
40172
40365
  UpdateOrganizationTeamMember,
40173
40366
  UpdateOrganizationTrigger,
40367
+ UpdateOrganizationWebhook,
40174
40368
  UpdatePayment,
40175
40369
  UpdateSelf,
40176
40370
  UpdateSeries,
@@ -40203,6 +40397,7 @@ var useUpdateVideo = (options = {}) => {
40203
40397
  UserRole,
40204
40398
  VIDEOS_QUERY_KEY,
40205
40399
  VIDEO_QUERY_KEY,
40400
+ VerifyOrganizationWebhook,
40206
40401
  VideoSource,
40207
40402
  VideoStatus,
40208
40403
  WidgetCategory,
@@ -40378,6 +40573,7 @@ var useUpdateVideo = (options = {}) => {
40378
40573
  useCreateOrganizationPaymentIntegration,
40379
40574
  useCreateOrganizationSideEffect,
40380
40575
  useCreateOrganizationTeamMember,
40576
+ useCreateOrganizationWebhook,
40381
40577
  useCreateSelfApiKey,
40382
40578
  useCreateSeries,
40383
40579
  useCreateStreamInput,
@@ -40518,6 +40714,7 @@ var useUpdateVideo = (options = {}) => {
40518
40714
  useDeleteOrganizationSideEffect,
40519
40715
  useDeleteOrganizationTeamMember,
40520
40716
  useDeleteOrganizationUser,
40717
+ useDeleteOrganizationWebhook,
40521
40718
  useDeleteSelfApiKey,
40522
40719
  useDeleteSeries,
40523
40720
  useDeleteStreamInput,
@@ -40908,6 +41105,8 @@ var useUpdateVideo = (options = {}) => {
40908
41105
  useGetOrganizationTeamMembers,
40909
41106
  useGetOrganizationTrigger,
40910
41107
  useGetOrganizationUsers,
41108
+ useGetOrganizationWebhook,
41109
+ useGetOrganizationWebhooks,
40911
41110
  useGetPayment,
40912
41111
  useGetPayments,
40913
41112
  useGetReport,
@@ -41186,6 +41385,7 @@ var useUpdateVideo = (options = {}) => {
41186
41385
  useUpdateOrganizationPageTranslation,
41187
41386
  useUpdateOrganizationTeamMember,
41188
41387
  useUpdateOrganizationTrigger,
41388
+ useUpdateOrganizationWebhook,
41189
41389
  useUpdatePayment,
41190
41390
  useUpdateSelf,
41191
41391
  useUpdateSeries,
@@ -41214,5 +41414,6 @@ var useUpdateVideo = (options = {}) => {
41214
41414
  useUpdateTier,
41215
41415
  useUpdateUserImage,
41216
41416
  useUpdateVideo,
41217
- useUploadFile
41417
+ useUploadFile,
41418
+ useVerifyOrganizationWebhook
41218
41419
  });