@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.js CHANGED
@@ -15419,6 +15419,70 @@ var useGetOrganizationUsers = (params = {}, options = {}) => {
15419
15419
  );
15420
15420
  };
15421
15421
 
15422
+ // src/queries/organization/useGetOrganizationWebhooks.ts
15423
+ var ORGANIZATION_WEBHOOKS_QUERY_KEY = () => [
15424
+ ...ORGANIZATION_QUERY_KEY(),
15425
+ "WEBHOOKS"
15426
+ ];
15427
+ var SET_ORGANIZATION_WEBHOOKS_QUERY_DATA = (client, keyParams, response) => {
15428
+ client.setQueryData(ORGANIZATION_WEBHOOKS_QUERY_KEY(...keyParams), response);
15429
+ };
15430
+ var GetOrganizationWebhooks = async ({
15431
+ pageParam,
15432
+ pageSize,
15433
+ orderBy,
15434
+ search,
15435
+ adminApiParams
15436
+ }) => {
15437
+ const adminApi = await GetAdminAPI(adminApiParams);
15438
+ const { data } = await adminApi.get(`/organization/webhooks`, {
15439
+ params: {
15440
+ page: pageParam || void 0,
15441
+ pageSize: pageSize || void 0,
15442
+ orderBy: orderBy || void 0,
15443
+ search: search || void 0
15444
+ }
15445
+ });
15446
+ return data;
15447
+ };
15448
+ var useGetOrganizationWebhooks = (params = {}, options = {}) => {
15449
+ return useConnectedInfiniteQuery(
15450
+ ORGANIZATION_WEBHOOKS_QUERY_KEY(),
15451
+ (params2) => GetOrganizationWebhooks(params2),
15452
+ params,
15453
+ options,
15454
+ "org"
15455
+ );
15456
+ };
15457
+
15458
+ // src/queries/organization/useGetOrganizationWebhook.ts
15459
+ var ORGANIZATION_WEBHOOK_QUERY_KEY = (webhookId) => [
15460
+ ...ORGANIZATION_WEBHOOKS_QUERY_KEY(),
15461
+ webhookId
15462
+ ];
15463
+ var SET_ORGANIZATION_WEBHOOK_QUERY_DATA = (client, keyParams, response) => {
15464
+ client.setQueryData(ORGANIZATION_WEBHOOK_QUERY_KEY(...keyParams), response);
15465
+ };
15466
+ var GetOrganizationWebhook = async ({
15467
+ webhookId,
15468
+ adminApiParams
15469
+ }) => {
15470
+ const adminApi = await GetAdminAPI(adminApiParams);
15471
+ const { data } = await adminApi.get(`/organization/webhooks/${webhookId}`);
15472
+ return data;
15473
+ };
15474
+ var useGetOrganizationWebhook = (webhookId = "", options = {}) => {
15475
+ return useConnectedSingleQuery(
15476
+ ORGANIZATION_WEBHOOK_QUERY_KEY(webhookId),
15477
+ (params) => GetOrganizationWebhook({ ...params, webhookId }),
15478
+ {
15479
+ ...options,
15480
+ enabled: !!webhookId && (options.enabled ?? true)
15481
+ },
15482
+ "org"
15483
+ );
15484
+ };
15485
+
15422
15486
  // src/queries/organization/useSearchOrganization.ts
15423
15487
  var SEARCH_ORGANIZATION_QUERY_KEY = (search, filters) => [
15424
15488
  "SEARCH_ORGANIZATION",
@@ -32228,6 +32292,32 @@ var useCreateOrganizationTeamMember = (options = {}) => {
32228
32292
  });
32229
32293
  };
32230
32294
 
32295
+ // src/mutations/organization/useCreateOrganizationWebhook.ts
32296
+ var CreateOrganizationWebhook = async ({
32297
+ webhook,
32298
+ adminApiParams,
32299
+ queryClient
32300
+ }) => {
32301
+ const connectedXM = await GetAdminAPI(adminApiParams);
32302
+ const { data } = await connectedXM.post(
32303
+ `/organization/webhooks`,
32304
+ webhook
32305
+ );
32306
+ if (queryClient && data.status === "ok") {
32307
+ queryClient.invalidateQueries({
32308
+ queryKey: ORGANIZATION_WEBHOOKS_QUERY_KEY()
32309
+ });
32310
+ SET_ORGANIZATION_WEBHOOK_QUERY_DATA(queryClient, [data.data.id], data);
32311
+ }
32312
+ return data;
32313
+ };
32314
+ var useCreateOrganizationWebhook = (options = {}) => {
32315
+ return useConnectedMutation(CreateOrganizationWebhook, options, {
32316
+ domain: "org",
32317
+ type: "update"
32318
+ });
32319
+ };
32320
+
32231
32321
  // src/mutations/organization/useDeleteOrganizationDomain.ts
32232
32322
  var DeleteOrganizationDomain = async ({
32233
32323
  adminApiParams,
@@ -32298,6 +32388,33 @@ var useDeleteOrganizationUser = (options = {}) => {
32298
32388
  });
32299
32389
  };
32300
32390
 
32391
+ // src/mutations/organization/useDeleteOrganizationWebhook.ts
32392
+ var DeleteOrganizationWebhook = async ({
32393
+ webhookId,
32394
+ adminApiParams,
32395
+ queryClient
32396
+ }) => {
32397
+ const connectedXM = await GetAdminAPI(adminApiParams);
32398
+ const { data } = await connectedXM.delete(
32399
+ `/organization/webhooks/${webhookId}`
32400
+ );
32401
+ if (queryClient && data.status === "ok") {
32402
+ queryClient.invalidateQueries({
32403
+ queryKey: ORGANIZATION_WEBHOOKS_QUERY_KEY()
32404
+ });
32405
+ queryClient.removeQueries({
32406
+ queryKey: ORGANIZATION_WEBHOOK_QUERY_KEY(webhookId)
32407
+ });
32408
+ }
32409
+ return data;
32410
+ };
32411
+ var useDeleteOrganizationWebhook = (options = {}) => {
32412
+ return useConnectedMutation(DeleteOrganizationWebhook, options, {
32413
+ domain: "org",
32414
+ type: "update"
32415
+ });
32416
+ };
32417
+
32301
32418
  // src/mutations/organization/useRefundOrganizationPayment.ts
32302
32419
  var RefundOrganizationPayment = async ({
32303
32420
  paymentId,
@@ -32481,6 +32598,58 @@ var useUpdateOrganizationTeamMember = (options = {}) => {
32481
32598
  });
32482
32599
  };
32483
32600
 
32601
+ // src/mutations/organization/useUpdateOrganizationWebhook.ts
32602
+ var UpdateOrganizationWebhook = async ({
32603
+ webhookId,
32604
+ webhook,
32605
+ adminApiParams,
32606
+ queryClient
32607
+ }) => {
32608
+ const connectedXM = await GetAdminAPI(adminApiParams);
32609
+ const { data } = await connectedXM.put(
32610
+ `/organization/webhooks/${webhookId}`,
32611
+ webhook
32612
+ );
32613
+ if (queryClient && data.status === "ok") {
32614
+ queryClient.invalidateQueries({
32615
+ queryKey: ORGANIZATION_WEBHOOKS_QUERY_KEY()
32616
+ });
32617
+ SET_ORGANIZATION_WEBHOOK_QUERY_DATA(queryClient, [webhookId], data);
32618
+ }
32619
+ return data;
32620
+ };
32621
+ var useUpdateOrganizationWebhook = (options = {}) => {
32622
+ return useConnectedMutation(UpdateOrganizationWebhook, options, {
32623
+ domain: "org",
32624
+ type: "update"
32625
+ });
32626
+ };
32627
+
32628
+ // src/mutations/organization/useVerifyOrganizationWebhook.ts
32629
+ var VerifyOrganizationWebhook = async ({
32630
+ webhookId,
32631
+ adminApiParams,
32632
+ queryClient
32633
+ }) => {
32634
+ const connectedXM = await GetAdminAPI(adminApiParams);
32635
+ const { data } = await connectedXM.post(
32636
+ `/organization/webhooks/${webhookId}/verify`
32637
+ );
32638
+ if (queryClient && data.status === "ok") {
32639
+ queryClient.invalidateQueries({
32640
+ queryKey: ORGANIZATION_WEBHOOKS_QUERY_KEY()
32641
+ });
32642
+ SET_ORGANIZATION_WEBHOOK_QUERY_DATA(queryClient, [webhookId], data);
32643
+ }
32644
+ return data;
32645
+ };
32646
+ var useVerifyOrganizationWebhook = (options = {}) => {
32647
+ return useConnectedMutation(VerifyOrganizationWebhook, options, {
32648
+ domain: "org",
32649
+ type: "update"
32650
+ });
32651
+ };
32652
+
32484
32653
  // src/mutations/payments/useUpdatePayment.ts
32485
32654
  var UpdatePayment = async ({
32486
32655
  paymentId,
@@ -35567,6 +35736,7 @@ export {
35567
35736
  CreateOrganizationPaymentIntegration,
35568
35737
  CreateOrganizationSideEffect,
35569
35738
  CreateOrganizationTeamMember,
35739
+ CreateOrganizationWebhook,
35570
35740
  CreateSelfApiKey,
35571
35741
  CreateSeries,
35572
35742
  CreateStreamInput,
@@ -35715,6 +35885,7 @@ export {
35715
35885
  DeleteOrganizationSideEffect,
35716
35886
  DeleteOrganizationTeamMember,
35717
35887
  DeleteOrganizationUser,
35888
+ DeleteOrganizationWebhook,
35718
35889
  DeleteSelfApiKey,
35719
35890
  DeleteSeries,
35720
35891
  DeleteStreamInput,
@@ -36323,6 +36494,8 @@ export {
36323
36494
  GetOrganizationTeamMembers,
36324
36495
  GetOrganizationTrigger,
36325
36496
  GetOrganizationUsers,
36497
+ GetOrganizationWebhook,
36498
+ GetOrganizationWebhooks,
36326
36499
  GetPayment,
36327
36500
  GetPayments,
36328
36501
  GetReport,
@@ -36469,6 +36642,8 @@ export {
36469
36642
  ORGANIZATION_TEAM_MEMBER_QUERY_KEY,
36470
36643
  ORGANIZATION_TRIGGER_QUERY_KEY,
36471
36644
  ORGANIZATION_USERS_QUERY_KEY,
36645
+ ORGANIZATION_WEBHOOKS_QUERY_KEY,
36646
+ ORGANIZATION_WEBHOOK_QUERY_KEY,
36472
36647
  OrganizationActionType,
36473
36648
  OrganizationModuleType,
36474
36649
  OrganizationTriggerType,
@@ -36915,6 +37090,8 @@ export {
36915
37090
  SET_ORGANIZATION_TEAM_MEMBER_QUERY_DATA,
36916
37091
  SET_ORGANIZATION_TRIGGER_QUERY_DATA,
36917
37092
  SET_ORGANIZATION_USERS_QUERY_DATA,
37093
+ SET_ORGANIZATION_WEBHOOKS_QUERY_DATA,
37094
+ SET_ORGANIZATION_WEBHOOK_QUERY_DATA,
36918
37095
  SET_PASS_TYPE_COUPONS_QUERY_DATA,
36919
37096
  SET_PAYMENTS_QUERY_DATA,
36920
37097
  SET_PAYMENT_QUERY_DATA,
@@ -37196,6 +37373,7 @@ export {
37196
37373
  UpdateOrganizationPageTranslation,
37197
37374
  UpdateOrganizationTeamMember,
37198
37375
  UpdateOrganizationTrigger,
37376
+ UpdateOrganizationWebhook,
37199
37377
  UpdatePayment,
37200
37378
  UpdateSelf,
37201
37379
  UpdateSeries,
@@ -37228,6 +37406,7 @@ export {
37228
37406
  UserRole,
37229
37407
  VIDEOS_QUERY_KEY,
37230
37408
  VIDEO_QUERY_KEY,
37409
+ VerifyOrganizationWebhook,
37231
37410
  VideoSource,
37232
37411
  VideoStatus,
37233
37412
  WidgetCategory,
@@ -37403,6 +37582,7 @@ export {
37403
37582
  useCreateOrganizationPaymentIntegration,
37404
37583
  useCreateOrganizationSideEffect,
37405
37584
  useCreateOrganizationTeamMember,
37585
+ useCreateOrganizationWebhook,
37406
37586
  useCreateSelfApiKey,
37407
37587
  useCreateSeries,
37408
37588
  useCreateStreamInput,
@@ -37543,6 +37723,7 @@ export {
37543
37723
  useDeleteOrganizationSideEffect,
37544
37724
  useDeleteOrganizationTeamMember,
37545
37725
  useDeleteOrganizationUser,
37726
+ useDeleteOrganizationWebhook,
37546
37727
  useDeleteSelfApiKey,
37547
37728
  useDeleteSeries,
37548
37729
  useDeleteStreamInput,
@@ -37933,6 +38114,8 @@ export {
37933
38114
  useGetOrganizationTeamMembers,
37934
38115
  useGetOrganizationTrigger,
37935
38116
  useGetOrganizationUsers,
38117
+ useGetOrganizationWebhook,
38118
+ useGetOrganizationWebhooks,
37936
38119
  useGetPayment,
37937
38120
  useGetPayments,
37938
38121
  useGetReport,
@@ -38211,6 +38394,7 @@ export {
38211
38394
  useUpdateOrganizationPageTranslation,
38212
38395
  useUpdateOrganizationTeamMember,
38213
38396
  useUpdateOrganizationTrigger,
38397
+ useUpdateOrganizationWebhook,
38214
38398
  useUpdatePayment,
38215
38399
  useUpdateSelf,
38216
38400
  useUpdateSeries,
@@ -38239,5 +38423,6 @@ export {
38239
38423
  useUpdateTier,
38240
38424
  useUpdateUserImage,
38241
38425
  useUpdateVideo,
38242
- useUploadFile
38426
+ useUploadFile,
38427
+ useVerifyOrganizationWebhook
38243
38428
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "2.7.6",
3
+ "version": "2.8.0",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "type": "module",