@connectedxm/admin 2.7.6 → 2.8.1

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