@connectedxm/admin 3.2.2 → 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),
@@ -16213,6 +16142,79 @@ var useSearchOrganization = (search, filters, options = {}) => {
16213
16142
  );
16214
16143
  };
16215
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
+
16216
16218
  // src/queries/reports/useGetCustomReports.ts
16217
16219
  var CUSTOM_REPORTS_QUERY_KEY = (filters = {}) => [
16218
16220
  "CUSTOM_REPORTS",
@@ -19653,34 +19655,6 @@ var useDeleteAccountLead = (options = {}) => {
19653
19655
  });
19654
19656
  };
19655
19657
 
19656
- // src/mutations/account/useDeleteAccountPushDevice.ts
19657
- var DeleteAccountPushDevice = async ({
19658
- accountId,
19659
- pushDeviceId,
19660
- adminApiParams,
19661
- queryClient
19662
- }) => {
19663
- const connectedXM = await GetAdminAPI(adminApiParams);
19664
- const { data } = await connectedXM.delete(
19665
- `/accounts/${accountId}/push-devices/${pushDeviceId}`
19666
- );
19667
- if (queryClient && data.status === "ok") {
19668
- queryClient.invalidateQueries({
19669
- queryKey: ACCOUNT_PUSH_DEVICES_QUERY_KEY(accountId)
19670
- });
19671
- queryClient.invalidateQueries({
19672
- queryKey: ACCOUNT_PUSH_DEVICE_QUERY_KEY(accountId, pushDeviceId)
19673
- });
19674
- }
19675
- return data;
19676
- };
19677
- var useDeleteAccountPushDevice = (options = {}) => {
19678
- return useConnectedMutation(DeleteAccountPushDevice, options, {
19679
- domain: "accounts",
19680
- type: "update"
19681
- });
19682
- };
19683
-
19684
19658
  // src/mutations/account/useExportAccount.ts
19685
19659
  var ExportAccount = async ({
19686
19660
  accountId,
@@ -34106,6 +34080,33 @@ var useUpdatePayment = (options = {}) => {
34106
34080
  });
34107
34081
  };
34108
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
+
34109
34110
  // src/mutations/reports/useAddCustomReportUser.ts
34110
34111
  var AddCustomReportUser = async ({
34111
34112
  reportId,
@@ -37013,8 +37014,6 @@ export {
37013
37014
  ACCOUNT_LIKES_QUERY_KEY,
37014
37015
  ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_KEY,
37015
37016
  ACCOUNT_PAYMENTS_QUERY_KEY,
37016
- ACCOUNT_PUSH_DEVICES_QUERY_KEY,
37017
- ACCOUNT_PUSH_DEVICE_QUERY_KEY,
37018
37017
  ACCOUNT_QUERY_KEY,
37019
37018
  ACCOUNT_SUBSCRIPTIONS_QUERY_KEY,
37020
37019
  ACCOUNT_THREADS_QUERY_KEY,
@@ -37308,7 +37307,6 @@ export {
37308
37307
  DeleteAccountAddress,
37309
37308
  DeleteAccountInvitation,
37310
37309
  DeleteAccountLead,
37311
- DeleteAccountPushDevice,
37312
37310
  DeleteActivity,
37313
37311
  DeleteAdvertisement,
37314
37312
  DeleteAnnouncement,
@@ -37421,6 +37419,7 @@ export {
37421
37419
  DeleteOrganizationTeamMember,
37422
37420
  DeleteOrganizationUser,
37423
37421
  DeleteOrganizationWebhook,
37422
+ DeletePushDevice,
37424
37423
  DeleteSelfApiKey,
37425
37424
  DeleteSeries,
37426
37425
  DeleteStreamInput,
@@ -37710,8 +37709,6 @@ export {
37710
37709
  GetAccountLikes,
37711
37710
  GetAccountNotificationPreferences,
37712
37711
  GetAccountPayments,
37713
- GetAccountPushDevice,
37714
- GetAccountPushDevices,
37715
37712
  GetAccountSubscriptions,
37716
37713
  GetAccountThreads,
37717
37714
  GetAccountTiers,
@@ -38067,6 +38064,8 @@ export {
38067
38064
  GetOrganizationWebhooks,
38068
38065
  GetPayment,
38069
38066
  GetPayments,
38067
+ GetPushDevice,
38068
+ GetPushDevices,
38070
38069
  GetReport,
38071
38070
  GetReports,
38072
38071
  GetSelf,
@@ -38220,6 +38219,8 @@ export {
38220
38219
  OrganizationTriggerType,
38221
38220
  PAYMENTS_QUERY_KEY,
38222
38221
  PAYMENT_QUERY_KEY,
38222
+ PUSH_DEVICES_QUERY_KEY,
38223
+ PUSH_DEVICE_QUERY_KEY,
38223
38224
  PageType,
38224
38225
  PassTypeAccessLevel,
38225
38226
  PassTypeVisibility,
@@ -38333,7 +38334,6 @@ export {
38333
38334
  SET_ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_DATA,
38334
38335
  SET_ACCOUNT_PAYMENTS_QUERY_DATA,
38335
38336
  SET_ACCOUNT_PUSH_DEVICES_QUERY_DATA,
38336
- SET_ACCOUNT_PUSH_DEVICE_QUERY_DATA,
38337
38337
  SET_ACCOUNT_QUERY_DATA,
38338
38338
  SET_ACCOUNT_SUBSCRIPTIONS_QUERY_DATA,
38339
38339
  SET_ACCOUNT_THREADS_QUERY_DATA,
@@ -38681,6 +38681,7 @@ export {
38681
38681
  SET_PASS_TYPE_COUPONS_QUERY_DATA,
38682
38682
  SET_PAYMENTS_QUERY_DATA,
38683
38683
  SET_PAYMENT_QUERY_DATA,
38684
+ SET_PUSH_DEVICE_QUERY_DATA,
38684
38685
  SET_REPORTS_QUERY_DATA,
38685
38686
  SET_REPORT_QUERY_DATA,
38686
38687
  SET_SEARCH_ORGANIZATION_QUERY_DATA,
@@ -39220,7 +39221,6 @@ export {
39220
39221
  useDeleteAccountAddress,
39221
39222
  useDeleteAccountInvitation,
39222
39223
  useDeleteAccountLead,
39223
- useDeleteAccountPushDevice,
39224
39224
  useDeleteActivity,
39225
39225
  useDeleteAdvertisement,
39226
39226
  useDeleteAnnouncement,
@@ -39333,6 +39333,7 @@ export {
39333
39333
  useDeleteOrganizationTeamMember,
39334
39334
  useDeleteOrganizationUser,
39335
39335
  useDeleteOrganizationWebhook,
39336
+ useDeletePushDevice,
39336
39337
  useDeleteSelfApiKey,
39337
39338
  useDeleteSeries,
39338
39339
  useDeleteStreamInput,
@@ -39388,8 +39389,6 @@ export {
39388
39389
  useGetAccountLikes,
39389
39390
  useGetAccountNotificationPreferences,
39390
39391
  useGetAccountPayments,
39391
- useGetAccountPushDevice,
39392
- useGetAccountPushDevices,
39393
39392
  useGetAccountSubscriptions,
39394
39393
  useGetAccountThreads,
39395
39394
  useGetAccountTiers,
@@ -39741,6 +39740,8 @@ export {
39741
39740
  useGetOrganizationWebhooks,
39742
39741
  useGetPayment,
39743
39742
  useGetPayments,
39743
+ useGetPushDevice,
39744
+ useGetPushDevices,
39744
39745
  useGetReport,
39745
39746
  useGetReports,
39746
39747
  useGetSelf,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "3.2.2",
3
+ "version": "3.2.3",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "type": "module",