@connectedxm/admin 3.2.1 → 3.2.3

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
@@ -973,77 +973,6 @@ var useGetAccountPayments = (accountId = "", params = {}, options = {}) => {
973
973
  );
974
974
  };
975
975
 
976
- // src/queries/accounts/useGetAccountPushDevices.ts
977
- var ACCOUNT_PUSH_DEVICES_QUERY_KEY = (accountId) => {
978
- const key = [...ACCOUNT_QUERY_KEY(accountId), "PUSH_DEVICES"];
979
- return key;
980
- };
981
- var SET_ACCOUNT_PUSH_DEVICES_QUERY_DATA = (client, keyParams, response) => {
982
- client.setQueryData(ACCOUNT_PUSH_DEVICES_QUERY_KEY(...keyParams), response);
983
- };
984
- var GetAccountPushDevices = async ({
985
- accountId,
986
- pageParam,
987
- pageSize,
988
- orderBy,
989
- search,
990
- adminApiParams
991
- }) => {
992
- const adminApi = await GetAdminAPI(adminApiParams);
993
- const { data } = await adminApi.get(`/accounts/${accountId}/push-devices`, {
994
- params: {
995
- page: pageParam || void 0,
996
- pageSize: pageSize || void 0,
997
- orderBy: orderBy || void 0,
998
- search: search || void 0
999
- }
1000
- });
1001
- return data;
1002
- };
1003
- var useGetAccountPushDevices = (accountId = "", params = {}, options = {}) => {
1004
- return useConnectedInfiniteQuery(
1005
- ACCOUNT_PUSH_DEVICES_QUERY_KEY(accountId),
1006
- (params2) => GetAccountPushDevices({
1007
- ...params2,
1008
- accountId
1009
- }),
1010
- params,
1011
- {
1012
- ...options,
1013
- enabled: !!accountId && (options?.enabled ?? true)
1014
- },
1015
- "accounts"
1016
- );
1017
- };
1018
-
1019
- // src/queries/accounts/useGetAccountPushDevice.ts
1020
- var ACCOUNT_PUSH_DEVICE_QUERY_KEY = (accountId, pushDeviceId) => [...ACCOUNT_PUSH_DEVICES_QUERY_KEY(accountId), pushDeviceId];
1021
- var SET_ACCOUNT_PUSH_DEVICE_QUERY_DATA = (client, keyParams, response) => {
1022
- client.setQueryData(ACCOUNT_PUSH_DEVICE_QUERY_KEY(...keyParams), response);
1023
- };
1024
- var GetAccountPushDevice = async ({
1025
- accountId = "",
1026
- pushDeviceId = "",
1027
- adminApiParams
1028
- }) => {
1029
- const adminApi = await GetAdminAPI(adminApiParams);
1030
- const { data } = await adminApi.get(
1031
- `/accounts/${accountId}/push-devices/${pushDeviceId}`
1032
- );
1033
- return data;
1034
- };
1035
- var useGetAccountPushDevice = (accountId = "", pushDeviceId = "", options = {}) => {
1036
- return useConnectedSingleQuery(
1037
- ACCOUNT_PUSH_DEVICE_QUERY_KEY(accountId, pushDeviceId),
1038
- (params) => GetAccountPushDevice({ accountId, pushDeviceId, ...params }),
1039
- {
1040
- ...options,
1041
- enabled: !!accountId && !!pushDeviceId && (options?.enabled ?? true)
1042
- },
1043
- "accounts"
1044
- );
1045
- };
1046
-
1047
976
  // src/queries/accounts/useGetAccountSubscriptions.ts
1048
977
  var ACCOUNT_SUBSCRIPTIONS_QUERY_KEY = (accountId) => [
1049
978
  ...ACCOUNT_QUERY_KEY(accountId),
@@ -13076,11 +13005,6 @@ var AccountAccess = /* @__PURE__ */ ((AccountAccess2) => {
13076
13005
  AccountAccess2["BANNED"] = "BANNED";
13077
13006
  return AccountAccess2;
13078
13007
  })(AccountAccess || {});
13079
- var PushDeviceAppType = /* @__PURE__ */ ((PushDeviceAppType2) => {
13080
- PushDeviceAppType2["EVENTXM"] = "EVENTXM";
13081
- PushDeviceAppType2["COMMUNITYXM"] = "COMMUNITYXM";
13082
- return PushDeviceAppType2;
13083
- })(PushDeviceAppType || {});
13084
13008
  var PushService = /* @__PURE__ */ ((PushService2) => {
13085
13009
  PushService2["apn"] = "apn";
13086
13010
  PushService2["firebase"] = "firebase";
@@ -16218,6 +16142,79 @@ var useSearchOrganization = (search, filters, options = {}) => {
16218
16142
  );
16219
16143
  };
16220
16144
 
16145
+ // src/queries/push-devices/useGetPushDevices.ts
16146
+ var PUSH_DEVICES_QUERY_KEY = (accountId) => {
16147
+ const key = ["PUSH_DEVICES"];
16148
+ if (accountId) key.push(accountId);
16149
+ return key;
16150
+ };
16151
+ var SET_ACCOUNT_PUSH_DEVICES_QUERY_DATA = (client, keyParams, response) => {
16152
+ client.setQueryData(PUSH_DEVICES_QUERY_KEY(...keyParams), response);
16153
+ };
16154
+ var GetPushDevices = async ({
16155
+ accountId,
16156
+ pageParam,
16157
+ pageSize,
16158
+ orderBy,
16159
+ search,
16160
+ adminApiParams
16161
+ }) => {
16162
+ const adminApi = await GetAdminAPI(adminApiParams);
16163
+ const { data } = await adminApi.get(`/push-devices`, {
16164
+ params: {
16165
+ page: pageParam || void 0,
16166
+ pageSize: pageSize || void 0,
16167
+ orderBy: orderBy || void 0,
16168
+ search: search || void 0,
16169
+ accountId: accountId || void 0
16170
+ }
16171
+ });
16172
+ return data;
16173
+ };
16174
+ var useGetPushDevices = (accountId = "", params = {}, options = {}) => {
16175
+ return useConnectedInfiniteQuery(
16176
+ PUSH_DEVICES_QUERY_KEY(accountId),
16177
+ (params2) => GetPushDevices({
16178
+ ...params2,
16179
+ accountId
16180
+ }),
16181
+ params,
16182
+ {
16183
+ ...options,
16184
+ enabled: options?.enabled ?? true
16185
+ },
16186
+ "accounts"
16187
+ );
16188
+ };
16189
+
16190
+ // src/queries/push-devices/useGetPushDevice.ts
16191
+ var PUSH_DEVICE_QUERY_KEY = (pushDeviceId) => [
16192
+ ...PUSH_DEVICES_QUERY_KEY(),
16193
+ pushDeviceId
16194
+ ];
16195
+ var SET_PUSH_DEVICE_QUERY_DATA = (client, keyParams, response) => {
16196
+ client.setQueryData(PUSH_DEVICE_QUERY_KEY(...keyParams), response);
16197
+ };
16198
+ var GetPushDevice = async ({
16199
+ pushDeviceId = "",
16200
+ adminApiParams
16201
+ }) => {
16202
+ const adminApi = await GetAdminAPI(adminApiParams);
16203
+ const { data } = await adminApi.get(`/push-devices/${pushDeviceId}`);
16204
+ return data;
16205
+ };
16206
+ var useGetPushDevice = (pushDeviceId = "", options = {}) => {
16207
+ return useConnectedSingleQuery(
16208
+ PUSH_DEVICE_QUERY_KEY(pushDeviceId),
16209
+ (params) => GetPushDevice({ pushDeviceId, ...params }),
16210
+ {
16211
+ ...options,
16212
+ enabled: !!pushDeviceId && (options?.enabled ?? true)
16213
+ },
16214
+ "accounts"
16215
+ );
16216
+ };
16217
+
16221
16218
  // src/queries/reports/useGetCustomReports.ts
16222
16219
  var CUSTOM_REPORTS_QUERY_KEY = (filters = {}) => [
16223
16220
  "CUSTOM_REPORTS",
@@ -19658,34 +19655,6 @@ var useDeleteAccountLead = (options = {}) => {
19658
19655
  });
19659
19656
  };
19660
19657
 
19661
- // src/mutations/account/useDeleteAccountPushDevice.ts
19662
- var DeleteAccountPushDevice = async ({
19663
- accountId,
19664
- pushDeviceId,
19665
- adminApiParams,
19666
- queryClient
19667
- }) => {
19668
- const connectedXM = await GetAdminAPI(adminApiParams);
19669
- const { data } = await connectedXM.delete(
19670
- `/accounts/${accountId}/push-devices/${pushDeviceId}`
19671
- );
19672
- if (queryClient && data.status === "ok") {
19673
- queryClient.invalidateQueries({
19674
- queryKey: ACCOUNT_PUSH_DEVICES_QUERY_KEY(accountId)
19675
- });
19676
- queryClient.invalidateQueries({
19677
- queryKey: ACCOUNT_PUSH_DEVICE_QUERY_KEY(accountId, pushDeviceId)
19678
- });
19679
- }
19680
- return data;
19681
- };
19682
- var useDeleteAccountPushDevice = (options = {}) => {
19683
- return useConnectedMutation(DeleteAccountPushDevice, options, {
19684
- domain: "accounts",
19685
- type: "update"
19686
- });
19687
- };
19688
-
19689
19658
  // src/mutations/account/useExportAccount.ts
19690
19659
  var ExportAccount = async ({
19691
19660
  accountId,
@@ -34111,6 +34080,33 @@ var useUpdatePayment = (options = {}) => {
34111
34080
  });
34112
34081
  };
34113
34082
 
34083
+ // src/mutations/push-devices/useDeletePushDevice.ts
34084
+ var DeletePushDevice = async ({
34085
+ pushDeviceId,
34086
+ adminApiParams,
34087
+ queryClient
34088
+ }) => {
34089
+ const connectedXM = await GetAdminAPI(adminApiParams);
34090
+ const { data } = await connectedXM.delete(
34091
+ `/push-devices/${pushDeviceId}`
34092
+ );
34093
+ if (queryClient && data.status === "ok") {
34094
+ queryClient.invalidateQueries({
34095
+ queryKey: PUSH_DEVICES_QUERY_KEY()
34096
+ });
34097
+ queryClient.removeQueries({
34098
+ queryKey: PUSH_DEVICE_QUERY_KEY(pushDeviceId)
34099
+ });
34100
+ }
34101
+ return data;
34102
+ };
34103
+ var useDeletePushDevice = (options = {}) => {
34104
+ return useConnectedMutation(DeletePushDevice, options, {
34105
+ domain: "accounts",
34106
+ type: "update"
34107
+ });
34108
+ };
34109
+
34114
34110
  // src/mutations/reports/useAddCustomReportUser.ts
34115
34111
  var AddCustomReportUser = async ({
34116
34112
  reportId,
@@ -37018,8 +37014,6 @@ export {
37018
37014
  ACCOUNT_LIKES_QUERY_KEY,
37019
37015
  ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_KEY,
37020
37016
  ACCOUNT_PAYMENTS_QUERY_KEY,
37021
- ACCOUNT_PUSH_DEVICES_QUERY_KEY,
37022
- ACCOUNT_PUSH_DEVICE_QUERY_KEY,
37023
37017
  ACCOUNT_QUERY_KEY,
37024
37018
  ACCOUNT_SUBSCRIPTIONS_QUERY_KEY,
37025
37019
  ACCOUNT_THREADS_QUERY_KEY,
@@ -37313,7 +37307,6 @@ export {
37313
37307
  DeleteAccountAddress,
37314
37308
  DeleteAccountInvitation,
37315
37309
  DeleteAccountLead,
37316
- DeleteAccountPushDevice,
37317
37310
  DeleteActivity,
37318
37311
  DeleteAdvertisement,
37319
37312
  DeleteAnnouncement,
@@ -37426,6 +37419,7 @@ export {
37426
37419
  DeleteOrganizationTeamMember,
37427
37420
  DeleteOrganizationUser,
37428
37421
  DeleteOrganizationWebhook,
37422
+ DeletePushDevice,
37429
37423
  DeleteSelfApiKey,
37430
37424
  DeleteSeries,
37431
37425
  DeleteStreamInput,
@@ -37715,8 +37709,6 @@ export {
37715
37709
  GetAccountLikes,
37716
37710
  GetAccountNotificationPreferences,
37717
37711
  GetAccountPayments,
37718
- GetAccountPushDevice,
37719
- GetAccountPushDevices,
37720
37712
  GetAccountSubscriptions,
37721
37713
  GetAccountThreads,
37722
37714
  GetAccountTiers,
@@ -38072,6 +38064,8 @@ export {
38072
38064
  GetOrganizationWebhooks,
38073
38065
  GetPayment,
38074
38066
  GetPayments,
38067
+ GetPushDevice,
38068
+ GetPushDevices,
38075
38069
  GetReport,
38076
38070
  GetReports,
38077
38071
  GetSelf,
@@ -38225,6 +38219,8 @@ export {
38225
38219
  OrganizationTriggerType,
38226
38220
  PAYMENTS_QUERY_KEY,
38227
38221
  PAYMENT_QUERY_KEY,
38222
+ PUSH_DEVICES_QUERY_KEY,
38223
+ PUSH_DEVICE_QUERY_KEY,
38228
38224
  PageType,
38229
38225
  PassTypeAccessLevel,
38230
38226
  PassTypeVisibility,
@@ -38232,7 +38228,6 @@ export {
38232
38228
  PaymentLineItemType,
38233
38229
  PaymentType,
38234
38230
  PurchaseStatus,
38235
- PushDeviceAppType,
38236
38231
  PushService,
38237
38232
  REPORTS_QUERY_KEY,
38238
38233
  REPORT_QUERY_KEY,
@@ -38339,7 +38334,6 @@ export {
38339
38334
  SET_ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_DATA,
38340
38335
  SET_ACCOUNT_PAYMENTS_QUERY_DATA,
38341
38336
  SET_ACCOUNT_PUSH_DEVICES_QUERY_DATA,
38342
- SET_ACCOUNT_PUSH_DEVICE_QUERY_DATA,
38343
38337
  SET_ACCOUNT_QUERY_DATA,
38344
38338
  SET_ACCOUNT_SUBSCRIPTIONS_QUERY_DATA,
38345
38339
  SET_ACCOUNT_THREADS_QUERY_DATA,
@@ -38687,6 +38681,7 @@ export {
38687
38681
  SET_PASS_TYPE_COUPONS_QUERY_DATA,
38688
38682
  SET_PAYMENTS_QUERY_DATA,
38689
38683
  SET_PAYMENT_QUERY_DATA,
38684
+ SET_PUSH_DEVICE_QUERY_DATA,
38690
38685
  SET_REPORTS_QUERY_DATA,
38691
38686
  SET_REPORT_QUERY_DATA,
38692
38687
  SET_SEARCH_ORGANIZATION_QUERY_DATA,
@@ -39226,7 +39221,6 @@ export {
39226
39221
  useDeleteAccountAddress,
39227
39222
  useDeleteAccountInvitation,
39228
39223
  useDeleteAccountLead,
39229
- useDeleteAccountPushDevice,
39230
39224
  useDeleteActivity,
39231
39225
  useDeleteAdvertisement,
39232
39226
  useDeleteAnnouncement,
@@ -39339,6 +39333,7 @@ export {
39339
39333
  useDeleteOrganizationTeamMember,
39340
39334
  useDeleteOrganizationUser,
39341
39335
  useDeleteOrganizationWebhook,
39336
+ useDeletePushDevice,
39342
39337
  useDeleteSelfApiKey,
39343
39338
  useDeleteSeries,
39344
39339
  useDeleteStreamInput,
@@ -39394,8 +39389,6 @@ export {
39394
39389
  useGetAccountLikes,
39395
39390
  useGetAccountNotificationPreferences,
39396
39391
  useGetAccountPayments,
39397
- useGetAccountPushDevice,
39398
- useGetAccountPushDevices,
39399
39392
  useGetAccountSubscriptions,
39400
39393
  useGetAccountThreads,
39401
39394
  useGetAccountTiers,
@@ -39747,6 +39740,8 @@ export {
39747
39740
  useGetOrganizationWebhooks,
39748
39741
  useGetPayment,
39749
39742
  useGetPayments,
39743
+ useGetPushDevice,
39744
+ useGetPushDevices,
39750
39745
  useGetReport,
39751
39746
  useGetReports,
39752
39747
  useGetSelf,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "type": "module",