@connectedxm/admin 1.0.4 → 1.0.6

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
@@ -209,6 +209,7 @@ __export(src_exports, {
209
209
  CreateGroupTranslation: () => CreateGroupTranslation,
210
210
  CreateImage: () => CreateImage,
211
211
  CreateImport: () => CreateImport,
212
+ CreateIntegration: () => CreateIntegration,
212
213
  CreateInterest: () => CreateInterest,
213
214
  CreateInvoice: () => CreateInvoice,
214
215
  CreateInvoiceLineItem: () => CreateInvoiceLineItem,
@@ -287,6 +288,7 @@ __export(src_exports, {
287
288
  DeleteGroupRequest: () => DeleteGroupRequest,
288
289
  DeleteGroupTranslation: () => DeleteGroupTranslation,
289
290
  DeleteImage: () => DeleteImage,
291
+ DeleteIntegration: () => DeleteIntegration,
290
292
  DeleteInterest: () => DeleteInterest,
291
293
  DeleteInvoice: () => DeleteInvoice,
292
294
  DeleteInvoiceLineItem: () => DeleteInvoiceLineItem,
@@ -655,6 +657,8 @@ __export(src_exports, {
655
657
  GetImport: () => GetImport,
656
658
  GetImportItems: () => GetImportItems,
657
659
  GetImports: () => GetImports,
660
+ GetIntegration: () => GetIntegration,
661
+ GetIntegrations: () => GetIntegrations,
658
662
  GetInterest: () => GetInterest,
659
663
  GetInterestAccounts: () => GetInterestAccounts,
660
664
  GetInterestActivities: () => GetInterestActivities,
@@ -755,6 +759,8 @@ __export(src_exports, {
755
759
  IMPORTS_QUERY_KEY: () => IMPORTS_QUERY_KEY,
756
760
  IMPORT_ITEMS_QUERY_KEY: () => IMPORT_ITEMS_QUERY_KEY,
757
761
  IMPORT_QUERY_KEY: () => IMPORT_QUERY_KEY,
762
+ INTEGRATIONS_QUERY_KEY: () => INTEGRATIONS_QUERY_KEY,
763
+ INTEGRATION_QUERY_KEY: () => INTEGRATION_QUERY_KEY,
758
764
  INTERESTS_QUERY_KEY: () => INTERESTS_QUERY_KEY,
759
765
  INTEREST_ACCOUNTS_QUERY_KEY: () => INTEREST_ACCOUNTS_QUERY_KEY,
760
766
  INTEREST_ACTIVITIES_QUERY_KEY: () => INTEREST_ACTIVITIES_QUERY_KEY,
@@ -773,6 +779,7 @@ __export(src_exports, {
773
779
  ImpersonateAccount: () => ImpersonateAccount,
774
780
  ImportItemStatus: () => ImportItemStatus,
775
781
  ImportType: () => ImportType,
782
+ IntegrationType: () => IntegrationType,
776
783
  InvoiceStatus: () => InvoiceStatus,
777
784
  LEVELS_QUERY_KEY: () => LEVELS_QUERY_KEY,
778
785
  LEVEL_ACCOUNTS_QUERY_KEY: () => LEVEL_ACCOUNTS_QUERY_KEY,
@@ -1070,6 +1077,8 @@ __export(src_exports, {
1070
1077
  SET_IMAGE_QUERY_DATA: () => SET_IMAGE_QUERY_DATA,
1071
1078
  SET_IMAGE_USAGE_QUERY_DATA: () => SET_IMAGE_USAGE_QUERY_DATA,
1072
1079
  SET_IMPORT_QUERY_DATA: () => SET_IMPORT_QUERY_DATA,
1080
+ SET_INTEGRATIONS_QUERY_DATA: () => SET_INTEGRATIONS_QUERY_DATA,
1081
+ SET_INTEGRATION_QUERY_DATA: () => SET_INTEGRATION_QUERY_DATA,
1073
1082
  SET_INTERESTS_QUERY_DATA: () => SET_INTERESTS_QUERY_DATA,
1074
1083
  SET_INTEREST_ACCOUNTS_QUERY_DATA: () => SET_INTEREST_ACCOUNTS_QUERY_DATA,
1075
1084
  SET_INTEREST_ACTIVITIES_QUERY_DATA: () => SET_INTEREST_ACTIVITIES_QUERY_DATA,
@@ -1260,6 +1269,7 @@ __export(src_exports, {
1260
1269
  UpdateGroup: () => UpdateGroup,
1261
1270
  UpdateGroupTranslation: () => UpdateGroupTranslation,
1262
1271
  UpdateImage: () => UpdateImage,
1272
+ UpdateIntegration: () => UpdateIntegration,
1263
1273
  UpdateInterest: () => UpdateInterest,
1264
1274
  UpdateInvoice: () => UpdateInvoice,
1265
1275
  UpdateInvoiceLineItem: () => UpdateInvoiceLineItem,
@@ -1406,6 +1416,7 @@ __export(src_exports, {
1406
1416
  useCreateGroupTranslation: () => useCreateGroupTranslation,
1407
1417
  useCreateImage: () => useCreateImage,
1408
1418
  useCreateImport: () => useCreateImport,
1419
+ useCreateIntegration: () => useCreateIntegration,
1409
1420
  useCreateInterest: () => useCreateInterest,
1410
1421
  useCreateInvoice: () => useCreateInvoice,
1411
1422
  useCreateInvoiceLineItem: () => useCreateInvoiceLineItem,
@@ -1481,6 +1492,7 @@ __export(src_exports, {
1481
1492
  useDeleteGroupRequest: () => useDeleteGroupRequest,
1482
1493
  useDeleteGroupTranslation: () => useDeleteGroupTranslation,
1483
1494
  useDeleteImage: () => useDeleteImage,
1495
+ useDeleteIntegration: () => useDeleteIntegration,
1484
1496
  useDeleteInterest: () => useDeleteInterest,
1485
1497
  useDeleteInvoice: () => useDeleteInvoice,
1486
1498
  useDeleteInvoiceLineItem: () => useDeleteInvoiceLineItem,
@@ -1701,6 +1713,8 @@ __export(src_exports, {
1701
1713
  useGetImport: () => useGetImport,
1702
1714
  useGetImportItems: () => useGetImportItems,
1703
1715
  useGetImports: () => useGetImports,
1716
+ useGetIntegration: () => useGetIntegration,
1717
+ useGetIntegrations: () => useGetIntegrations,
1704
1718
  useGetInterest: () => useGetInterest,
1705
1719
  useGetInterestAccounts: () => useGetInterestAccounts,
1706
1720
  useGetInterestActivities: () => useGetInterestActivities,
@@ -1915,6 +1929,7 @@ __export(src_exports, {
1915
1929
  useUpdateGroup: () => useUpdateGroup,
1916
1930
  useUpdateGroupTranslation: () => useUpdateGroupTranslation,
1917
1931
  useUpdateImage: () => useUpdateImage,
1932
+ useUpdateIntegration: () => useUpdateIntegration,
1918
1933
  useUpdateInterest: () => useUpdateInterest,
1919
1934
  useUpdateInvoice: () => useUpdateInvoice,
1920
1935
  useUpdateInvoiceLineItem: () => useUpdateInvoiceLineItem,
@@ -10323,6 +10338,10 @@ var ImportItemStatus = /* @__PURE__ */ ((ImportItemStatus2) => {
10323
10338
  ImportItemStatus2["failed"] = "failed";
10324
10339
  return ImportItemStatus2;
10325
10340
  })(ImportItemStatus || {});
10341
+ var IntegrationType = /* @__PURE__ */ ((IntegrationType2) => {
10342
+ IntegrationType2["snagtag"] = "snagtag";
10343
+ return IntegrationType2;
10344
+ })(IntegrationType || {});
10326
10345
  var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
10327
10346
  InvoiceStatus2["draft"] = "draft";
10328
10347
  InvoiceStatus2["sent"] = "sent";
@@ -11550,6 +11569,72 @@ var useGetLevelAccounts = (levelId = "", params = {}, options = {}) => {
11550
11569
  );
11551
11570
  };
11552
11571
 
11572
+ // src/queries/organization/integrations/useGetIntegrations.ts
11573
+ var INTEGRATIONS_QUERY_KEY = () => ["INTEGRATIONS"];
11574
+ var SET_INTEGRATIONS_QUERY_DATA = (client, keyParams, response) => {
11575
+ client.setQueryData(INTEGRATIONS_QUERY_KEY(...keyParams), response);
11576
+ };
11577
+ var GetIntegrations = async ({
11578
+ pageParam,
11579
+ pageSize,
11580
+ orderBy,
11581
+ search,
11582
+ adminApiParams
11583
+ }) => {
11584
+ const adminApi = await GetAdminAPI(adminApiParams);
11585
+ const { data } = await adminApi.get(`/organization/integrations`, {
11586
+ params: {
11587
+ page: pageParam || void 0,
11588
+ pageSize: pageSize || void 0,
11589
+ orderBy: orderBy || void 0,
11590
+ search: search || void 0
11591
+ }
11592
+ });
11593
+ return data;
11594
+ };
11595
+ var useGetIntegrations = (params = {}, options = {}) => {
11596
+ return useConnectedInfiniteQuery(
11597
+ INTEGRATIONS_QUERY_KEY(),
11598
+ (params2) => GetIntegrations(params2),
11599
+ params,
11600
+ options,
11601
+ "org"
11602
+ );
11603
+ };
11604
+
11605
+ // src/queries/organization/integrations/useGetIntegration.ts
11606
+ var INTEGRATION_QUERY_KEY = (integrationId) => [
11607
+ ...INTEGRATIONS_QUERY_KEY(),
11608
+ integrationId
11609
+ ];
11610
+ var SET_INTEGRATION_QUERY_DATA = (client, keyParams, response) => {
11611
+ client.setQueryData(INTEGRATION_QUERY_KEY(...keyParams), response);
11612
+ };
11613
+ var GetIntegration = async ({
11614
+ integrationId,
11615
+ adminApiParams
11616
+ }) => {
11617
+ const adminApi = await GetAdminAPI(adminApiParams);
11618
+ const { data } = await adminApi.get(
11619
+ `/organization/integrations/${integrationId}`
11620
+ );
11621
+ return data;
11622
+ };
11623
+ var useGetIntegration = (integrationId = "", options = {}) => {
11624
+ return useConnectedSingleQuery(
11625
+ INTEGRATION_QUERY_KEY(integrationId),
11626
+ (params) => GetIntegration({
11627
+ integrationId,
11628
+ ...params
11629
+ }),
11630
+ {
11631
+ ...options,
11632
+ enabled: !!integrationId && (options.enabled ?? true)
11633
+ },
11634
+ "org"
11635
+ );
11636
+ };
11637
+
11553
11638
  // src/queries/organization/useGetOrganization.ts
11554
11639
  var ORGANIZATION_QUERY_KEY = () => ["ORGANIZATION"];
11555
11640
  var SET_ORGANIZATION_QUERY_DATA = (client, keyParams, response) => {
@@ -22314,6 +22399,81 @@ var useUpdateLevel = (options = {}) => {
22314
22399
  });
22315
22400
  };
22316
22401
 
22402
+ // src/mutations/organization/integrations/useCreateIntegration.ts
22403
+ var CreateIntegration = async ({
22404
+ integration,
22405
+ adminApiParams,
22406
+ queryClient
22407
+ }) => {
22408
+ const connectedXM = await GetAdminAPI(adminApiParams);
22409
+ const { data } = await connectedXM.post(
22410
+ `/organization/integrations`,
22411
+ integration
22412
+ );
22413
+ if (queryClient && data.status === "ok") {
22414
+ queryClient.invalidateQueries({ queryKey: INTEGRATIONS_QUERY_KEY() });
22415
+ SET_INTEGRATION_QUERY_DATA(queryClient, [data.data?.id], data);
22416
+ }
22417
+ return data;
22418
+ };
22419
+ var useCreateIntegration = (options = {}) => {
22420
+ return useConnectedMutation(CreateIntegration, options, {
22421
+ domain: "org",
22422
+ type: "create"
22423
+ });
22424
+ };
22425
+
22426
+ // src/mutations/organization/integrations/useDeleteIntegration.ts
22427
+ var DeleteIntegration = async ({
22428
+ integrationId,
22429
+ adminApiParams,
22430
+ queryClient
22431
+ }) => {
22432
+ const connectedXM = await GetAdminAPI(adminApiParams);
22433
+ const { data } = await connectedXM.delete(
22434
+ `/organization/integrations/${integrationId}`
22435
+ );
22436
+ if (queryClient && data.status === "ok") {
22437
+ queryClient.invalidateQueries({ queryKey: INTEGRATIONS_QUERY_KEY() });
22438
+ queryClient.removeQueries({
22439
+ queryKey: INTEGRATION_QUERY_KEY(integrationId)
22440
+ });
22441
+ }
22442
+ return data;
22443
+ };
22444
+ var useDeleteIntegration = (options = {}) => {
22445
+ return useConnectedMutation(DeleteIntegration, options, {
22446
+ domain: "org",
22447
+ type: "del"
22448
+ });
22449
+ };
22450
+
22451
+ // src/mutations/organization/integrations/useUpdateIntegration.ts
22452
+ var UpdateIntegration = async ({
22453
+ integrationId,
22454
+ integration,
22455
+ adminApiParams,
22456
+ queryClient
22457
+ }) => {
22458
+ if (!integrationId) throw new Error("Integration ID undefined");
22459
+ const connectedXM = await GetAdminAPI(adminApiParams);
22460
+ const { data } = await connectedXM.put(
22461
+ `/organization/integrations/${integrationId}`,
22462
+ integration
22463
+ );
22464
+ if (queryClient && data.status === "ok") {
22465
+ queryClient.invalidateQueries({ queryKey: INTEGRATIONS_QUERY_KEY() });
22466
+ SET_INTEGRATION_QUERY_DATA(queryClient, [integrationId], data);
22467
+ }
22468
+ return data;
22469
+ };
22470
+ var useUpdateIntegration = (options = {}) => {
22471
+ return useConnectedMutation(UpdateIntegration, options, {
22472
+ domain: "org",
22473
+ type: "update"
22474
+ });
22475
+ };
22476
+
22317
22477
  // src/mutations/organization/modules/useAddOrganizationModuleActionTier.ts
22318
22478
  var AddOrganizationModuleActionTier = async ({
22319
22479
  moduleType,
@@ -24431,6 +24591,7 @@ var useUpdateVideo = (options = {}) => {
24431
24591
  CreateGroupTranslation,
24432
24592
  CreateImage,
24433
24593
  CreateImport,
24594
+ CreateIntegration,
24434
24595
  CreateInterest,
24435
24596
  CreateInvoice,
24436
24597
  CreateInvoiceLineItem,
@@ -24509,6 +24670,7 @@ var useUpdateVideo = (options = {}) => {
24509
24670
  DeleteGroupRequest,
24510
24671
  DeleteGroupTranslation,
24511
24672
  DeleteImage,
24673
+ DeleteIntegration,
24512
24674
  DeleteInterest,
24513
24675
  DeleteInvoice,
24514
24676
  DeleteInvoiceLineItem,
@@ -24877,6 +25039,8 @@ var useUpdateVideo = (options = {}) => {
24877
25039
  GetImport,
24878
25040
  GetImportItems,
24879
25041
  GetImports,
25042
+ GetIntegration,
25043
+ GetIntegrations,
24880
25044
  GetInterest,
24881
25045
  GetInterestAccounts,
24882
25046
  GetInterestActivities,
@@ -24977,6 +25141,8 @@ var useUpdateVideo = (options = {}) => {
24977
25141
  IMPORTS_QUERY_KEY,
24978
25142
  IMPORT_ITEMS_QUERY_KEY,
24979
25143
  IMPORT_QUERY_KEY,
25144
+ INTEGRATIONS_QUERY_KEY,
25145
+ INTEGRATION_QUERY_KEY,
24980
25146
  INTERESTS_QUERY_KEY,
24981
25147
  INTEREST_ACCOUNTS_QUERY_KEY,
24982
25148
  INTEREST_ACTIVITIES_QUERY_KEY,
@@ -24995,6 +25161,7 @@ var useUpdateVideo = (options = {}) => {
24995
25161
  ImpersonateAccount,
24996
25162
  ImportItemStatus,
24997
25163
  ImportType,
25164
+ IntegrationType,
24998
25165
  InvoiceStatus,
24999
25166
  LEVELS_QUERY_KEY,
25000
25167
  LEVEL_ACCOUNTS_QUERY_KEY,
@@ -25292,6 +25459,8 @@ var useUpdateVideo = (options = {}) => {
25292
25459
  SET_IMAGE_QUERY_DATA,
25293
25460
  SET_IMAGE_USAGE_QUERY_DATA,
25294
25461
  SET_IMPORT_QUERY_DATA,
25462
+ SET_INTEGRATIONS_QUERY_DATA,
25463
+ SET_INTEGRATION_QUERY_DATA,
25295
25464
  SET_INTERESTS_QUERY_DATA,
25296
25465
  SET_INTEREST_ACCOUNTS_QUERY_DATA,
25297
25466
  SET_INTEREST_ACTIVITIES_QUERY_DATA,
@@ -25482,6 +25651,7 @@ var useUpdateVideo = (options = {}) => {
25482
25651
  UpdateGroup,
25483
25652
  UpdateGroupTranslation,
25484
25653
  UpdateImage,
25654
+ UpdateIntegration,
25485
25655
  UpdateInterest,
25486
25656
  UpdateInvoice,
25487
25657
  UpdateInvoiceLineItem,
@@ -25628,6 +25798,7 @@ var useUpdateVideo = (options = {}) => {
25628
25798
  useCreateGroupTranslation,
25629
25799
  useCreateImage,
25630
25800
  useCreateImport,
25801
+ useCreateIntegration,
25631
25802
  useCreateInterest,
25632
25803
  useCreateInvoice,
25633
25804
  useCreateInvoiceLineItem,
@@ -25703,6 +25874,7 @@ var useUpdateVideo = (options = {}) => {
25703
25874
  useDeleteGroupRequest,
25704
25875
  useDeleteGroupTranslation,
25705
25876
  useDeleteImage,
25877
+ useDeleteIntegration,
25706
25878
  useDeleteInterest,
25707
25879
  useDeleteInvoice,
25708
25880
  useDeleteInvoiceLineItem,
@@ -25923,6 +26095,8 @@ var useUpdateVideo = (options = {}) => {
25923
26095
  useGetImport,
25924
26096
  useGetImportItems,
25925
26097
  useGetImports,
26098
+ useGetIntegration,
26099
+ useGetIntegrations,
25926
26100
  useGetInterest,
25927
26101
  useGetInterestAccounts,
25928
26102
  useGetInterestActivities,
@@ -26137,6 +26311,7 @@ var useUpdateVideo = (options = {}) => {
26137
26311
  useUpdateGroup,
26138
26312
  useUpdateGroupTranslation,
26139
26313
  useUpdateImage,
26314
+ useUpdateIntegration,
26140
26315
  useUpdateInterest,
26141
26316
  useUpdateInvoice,
26142
26317
  useUpdateInvoiceLineItem,
package/dist/index.mjs CHANGED
@@ -8378,6 +8378,10 @@ var ImportItemStatus = /* @__PURE__ */ ((ImportItemStatus2) => {
8378
8378
  ImportItemStatus2["failed"] = "failed";
8379
8379
  return ImportItemStatus2;
8380
8380
  })(ImportItemStatus || {});
8381
+ var IntegrationType = /* @__PURE__ */ ((IntegrationType2) => {
8382
+ IntegrationType2["snagtag"] = "snagtag";
8383
+ return IntegrationType2;
8384
+ })(IntegrationType || {});
8381
8385
  var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
8382
8386
  InvoiceStatus2["draft"] = "draft";
8383
8387
  InvoiceStatus2["sent"] = "sent";
@@ -9605,6 +9609,72 @@ var useGetLevelAccounts = (levelId = "", params = {}, options = {}) => {
9605
9609
  );
9606
9610
  };
9607
9611
 
9612
+ // src/queries/organization/integrations/useGetIntegrations.ts
9613
+ var INTEGRATIONS_QUERY_KEY = () => ["INTEGRATIONS"];
9614
+ var SET_INTEGRATIONS_QUERY_DATA = (client, keyParams, response) => {
9615
+ client.setQueryData(INTEGRATIONS_QUERY_KEY(...keyParams), response);
9616
+ };
9617
+ var GetIntegrations = async ({
9618
+ pageParam,
9619
+ pageSize,
9620
+ orderBy,
9621
+ search,
9622
+ adminApiParams
9623
+ }) => {
9624
+ const adminApi = await GetAdminAPI(adminApiParams);
9625
+ const { data } = await adminApi.get(`/organization/integrations`, {
9626
+ params: {
9627
+ page: pageParam || void 0,
9628
+ pageSize: pageSize || void 0,
9629
+ orderBy: orderBy || void 0,
9630
+ search: search || void 0
9631
+ }
9632
+ });
9633
+ return data;
9634
+ };
9635
+ var useGetIntegrations = (params = {}, options = {}) => {
9636
+ return useConnectedInfiniteQuery(
9637
+ INTEGRATIONS_QUERY_KEY(),
9638
+ (params2) => GetIntegrations(params2),
9639
+ params,
9640
+ options,
9641
+ "org"
9642
+ );
9643
+ };
9644
+
9645
+ // src/queries/organization/integrations/useGetIntegration.ts
9646
+ var INTEGRATION_QUERY_KEY = (integrationId) => [
9647
+ ...INTEGRATIONS_QUERY_KEY(),
9648
+ integrationId
9649
+ ];
9650
+ var SET_INTEGRATION_QUERY_DATA = (client, keyParams, response) => {
9651
+ client.setQueryData(INTEGRATION_QUERY_KEY(...keyParams), response);
9652
+ };
9653
+ var GetIntegration = async ({
9654
+ integrationId,
9655
+ adminApiParams
9656
+ }) => {
9657
+ const adminApi = await GetAdminAPI(adminApiParams);
9658
+ const { data } = await adminApi.get(
9659
+ `/organization/integrations/${integrationId}`
9660
+ );
9661
+ return data;
9662
+ };
9663
+ var useGetIntegration = (integrationId = "", options = {}) => {
9664
+ return useConnectedSingleQuery(
9665
+ INTEGRATION_QUERY_KEY(integrationId),
9666
+ (params) => GetIntegration({
9667
+ integrationId,
9668
+ ...params
9669
+ }),
9670
+ {
9671
+ ...options,
9672
+ enabled: !!integrationId && (options.enabled ?? true)
9673
+ },
9674
+ "org"
9675
+ );
9676
+ };
9677
+
9608
9678
  // src/queries/organization/useGetOrganization.ts
9609
9679
  var ORGANIZATION_QUERY_KEY = () => ["ORGANIZATION"];
9610
9680
  var SET_ORGANIZATION_QUERY_DATA = (client, keyParams, response) => {
@@ -20372,6 +20442,81 @@ var useUpdateLevel = (options = {}) => {
20372
20442
  });
20373
20443
  };
20374
20444
 
20445
+ // src/mutations/organization/integrations/useCreateIntegration.ts
20446
+ var CreateIntegration = async ({
20447
+ integration,
20448
+ adminApiParams,
20449
+ queryClient
20450
+ }) => {
20451
+ const connectedXM = await GetAdminAPI(adminApiParams);
20452
+ const { data } = await connectedXM.post(
20453
+ `/organization/integrations`,
20454
+ integration
20455
+ );
20456
+ if (queryClient && data.status === "ok") {
20457
+ queryClient.invalidateQueries({ queryKey: INTEGRATIONS_QUERY_KEY() });
20458
+ SET_INTEGRATION_QUERY_DATA(queryClient, [data.data?.id], data);
20459
+ }
20460
+ return data;
20461
+ };
20462
+ var useCreateIntegration = (options = {}) => {
20463
+ return useConnectedMutation(CreateIntegration, options, {
20464
+ domain: "org",
20465
+ type: "create"
20466
+ });
20467
+ };
20468
+
20469
+ // src/mutations/organization/integrations/useDeleteIntegration.ts
20470
+ var DeleteIntegration = async ({
20471
+ integrationId,
20472
+ adminApiParams,
20473
+ queryClient
20474
+ }) => {
20475
+ const connectedXM = await GetAdminAPI(adminApiParams);
20476
+ const { data } = await connectedXM.delete(
20477
+ `/organization/integrations/${integrationId}`
20478
+ );
20479
+ if (queryClient && data.status === "ok") {
20480
+ queryClient.invalidateQueries({ queryKey: INTEGRATIONS_QUERY_KEY() });
20481
+ queryClient.removeQueries({
20482
+ queryKey: INTEGRATION_QUERY_KEY(integrationId)
20483
+ });
20484
+ }
20485
+ return data;
20486
+ };
20487
+ var useDeleteIntegration = (options = {}) => {
20488
+ return useConnectedMutation(DeleteIntegration, options, {
20489
+ domain: "org",
20490
+ type: "del"
20491
+ });
20492
+ };
20493
+
20494
+ // src/mutations/organization/integrations/useUpdateIntegration.ts
20495
+ var UpdateIntegration = async ({
20496
+ integrationId,
20497
+ integration,
20498
+ adminApiParams,
20499
+ queryClient
20500
+ }) => {
20501
+ if (!integrationId) throw new Error("Integration ID undefined");
20502
+ const connectedXM = await GetAdminAPI(adminApiParams);
20503
+ const { data } = await connectedXM.put(
20504
+ `/organization/integrations/${integrationId}`,
20505
+ integration
20506
+ );
20507
+ if (queryClient && data.status === "ok") {
20508
+ queryClient.invalidateQueries({ queryKey: INTEGRATIONS_QUERY_KEY() });
20509
+ SET_INTEGRATION_QUERY_DATA(queryClient, [integrationId], data);
20510
+ }
20511
+ return data;
20512
+ };
20513
+ var useUpdateIntegration = (options = {}) => {
20514
+ return useConnectedMutation(UpdateIntegration, options, {
20515
+ domain: "org",
20516
+ type: "update"
20517
+ });
20518
+ };
20519
+
20375
20520
  // src/mutations/organization/modules/useAddOrganizationModuleActionTier.ts
20376
20521
  var AddOrganizationModuleActionTier = async ({
20377
20522
  moduleType,
@@ -22488,6 +22633,7 @@ export {
22488
22633
  CreateGroupTranslation,
22489
22634
  CreateImage,
22490
22635
  CreateImport,
22636
+ CreateIntegration,
22491
22637
  CreateInterest,
22492
22638
  CreateInvoice,
22493
22639
  CreateInvoiceLineItem,
@@ -22566,6 +22712,7 @@ export {
22566
22712
  DeleteGroupRequest,
22567
22713
  DeleteGroupTranslation,
22568
22714
  DeleteImage,
22715
+ DeleteIntegration,
22569
22716
  DeleteInterest,
22570
22717
  DeleteInvoice,
22571
22718
  DeleteInvoiceLineItem,
@@ -22934,6 +23081,8 @@ export {
22934
23081
  GetImport,
22935
23082
  GetImportItems,
22936
23083
  GetImports,
23084
+ GetIntegration,
23085
+ GetIntegrations,
22937
23086
  GetInterest,
22938
23087
  GetInterestAccounts,
22939
23088
  GetInterestActivities,
@@ -23034,6 +23183,8 @@ export {
23034
23183
  IMPORTS_QUERY_KEY,
23035
23184
  IMPORT_ITEMS_QUERY_KEY,
23036
23185
  IMPORT_QUERY_KEY,
23186
+ INTEGRATIONS_QUERY_KEY,
23187
+ INTEGRATION_QUERY_KEY,
23037
23188
  INTERESTS_QUERY_KEY,
23038
23189
  INTEREST_ACCOUNTS_QUERY_KEY,
23039
23190
  INTEREST_ACTIVITIES_QUERY_KEY,
@@ -23052,6 +23203,7 @@ export {
23052
23203
  ImpersonateAccount,
23053
23204
  ImportItemStatus,
23054
23205
  ImportType,
23206
+ IntegrationType,
23055
23207
  InvoiceStatus,
23056
23208
  LEVELS_QUERY_KEY,
23057
23209
  LEVEL_ACCOUNTS_QUERY_KEY,
@@ -23349,6 +23501,8 @@ export {
23349
23501
  SET_IMAGE_QUERY_DATA,
23350
23502
  SET_IMAGE_USAGE_QUERY_DATA,
23351
23503
  SET_IMPORT_QUERY_DATA,
23504
+ SET_INTEGRATIONS_QUERY_DATA,
23505
+ SET_INTEGRATION_QUERY_DATA,
23352
23506
  SET_INTERESTS_QUERY_DATA,
23353
23507
  SET_INTEREST_ACCOUNTS_QUERY_DATA,
23354
23508
  SET_INTEREST_ACTIVITIES_QUERY_DATA,
@@ -23539,6 +23693,7 @@ export {
23539
23693
  UpdateGroup,
23540
23694
  UpdateGroupTranslation,
23541
23695
  UpdateImage,
23696
+ UpdateIntegration,
23542
23697
  UpdateInterest,
23543
23698
  UpdateInvoice,
23544
23699
  UpdateInvoiceLineItem,
@@ -23685,6 +23840,7 @@ export {
23685
23840
  useCreateGroupTranslation,
23686
23841
  useCreateImage,
23687
23842
  useCreateImport,
23843
+ useCreateIntegration,
23688
23844
  useCreateInterest,
23689
23845
  useCreateInvoice,
23690
23846
  useCreateInvoiceLineItem,
@@ -23760,6 +23916,7 @@ export {
23760
23916
  useDeleteGroupRequest,
23761
23917
  useDeleteGroupTranslation,
23762
23918
  useDeleteImage,
23919
+ useDeleteIntegration,
23763
23920
  useDeleteInterest,
23764
23921
  useDeleteInvoice,
23765
23922
  useDeleteInvoiceLineItem,
@@ -23980,6 +24137,8 @@ export {
23980
24137
  useGetImport,
23981
24138
  useGetImportItems,
23982
24139
  useGetImports,
24140
+ useGetIntegration,
24141
+ useGetIntegrations,
23983
24142
  useGetInterest,
23984
24143
  useGetInterestAccounts,
23985
24144
  useGetInterestActivities,
@@ -24194,6 +24353,7 @@ export {
24194
24353
  useUpdateGroup,
24195
24354
  useUpdateGroupTranslation,
24196
24355
  useUpdateImage,
24356
+ useUpdateIntegration,
24197
24357
  useUpdateInterest,
24198
24358
  useUpdateInvoice,
24199
24359
  useUpdateInvoiceLineItem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "repository": {