@connectedxm/admin 2.3.7 → 2.3.9

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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ description: adding new query functions to interface with a GET endpoint in the API
3
+ globs:
4
+ alwaysApply: false
5
+ ---
6
+ When creating a Query function to interact with a get or list endpoint in the API you should follow the same template.
7
+
8
+ Standard Parts of query file:
9
+ - a QueryKey Function
10
+ - a Setter function
11
+ - the function to interact with the api
12
+ - the react-query hook to use the function
13
+
14
+ Single Query Example: [useGetAccount.ts](mdc:src/queries/accounts/useGetAccount.ts)
15
+ Infinite Query Example: [useGetAccounts.ts](mdc:src/queries/accounts/useGetAccounts.ts)
package/dist/index.cjs CHANGED
@@ -51,6 +51,7 @@ __export(index_exports, {
51
51
  ACCOUNT_LIKES_QUERY_KEY: () => ACCOUNT_LIKES_QUERY_KEY,
52
52
  ACCOUNT_LOGINS_QUERY_KEY: () => ACCOUNT_LOGINS_QUERY_KEY,
53
53
  ACCOUNT_LOGIN_QUERY_KEY: () => ACCOUNT_LOGIN_QUERY_KEY,
54
+ ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_KEY: () => ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_KEY,
54
55
  ACCOUNT_PAYMENTS_QUERY_KEY: () => ACCOUNT_PAYMENTS_QUERY_KEY,
55
56
  ACCOUNT_PUSH_DEVICES_QUERY_KEY: () => ACCOUNT_PUSH_DEVICES_QUERY_KEY,
56
57
  ACCOUNT_PUSH_DEVICE_QUERY_KEY: () => ACCOUNT_PUSH_DEVICE_QUERY_KEY,
@@ -687,6 +688,7 @@ __export(index_exports, {
687
688
  GetAccountLikes: () => GetAccountLikes,
688
689
  GetAccountLogin: () => GetAccountLogin,
689
690
  GetAccountLogins: () => GetAccountLogins,
691
+ GetAccountNotificationPreferences: () => GetAccountNotificationPreferences,
690
692
  GetAccountPayments: () => GetAccountPayments,
691
693
  GetAccountPushDevice: () => GetAccountPushDevice,
692
694
  GetAccountPushDevices: () => GetAccountPushDevices,
@@ -1250,6 +1252,7 @@ __export(index_exports, {
1250
1252
  SET_ACCOUNT_LEAD_QUERY_DATA: () => SET_ACCOUNT_LEAD_QUERY_DATA,
1251
1253
  SET_ACCOUNT_LEVELS_QUERY_DATA: () => SET_ACCOUNT_LEVELS_QUERY_DATA,
1252
1254
  SET_ACCOUNT_LIKES_QUERY_DATA: () => SET_ACCOUNT_LIKES_QUERY_DATA,
1255
+ SET_ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_DATA: () => SET_ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_DATA,
1253
1256
  SET_ACCOUNT_PAYMENTS_QUERY_DATA: () => SET_ACCOUNT_PAYMENTS_QUERY_DATA,
1254
1257
  SET_ACCOUNT_PUSH_DEVICES_QUERY_DATA: () => SET_ACCOUNT_PUSH_DEVICES_QUERY_DATA,
1255
1258
  SET_ACCOUNT_PUSH_DEVICE_QUERY_DATA: () => SET_ACCOUNT_PUSH_DEVICE_QUERY_DATA,
@@ -2208,6 +2211,7 @@ __export(index_exports, {
2208
2211
  useGetAccountLikes: () => useGetAccountLikes,
2209
2212
  useGetAccountLogin: () => useGetAccountLogin,
2210
2213
  useGetAccountLogins: () => useGetAccountLogins,
2214
+ useGetAccountNotificationPreferences: () => useGetAccountNotificationPreferences,
2211
2215
  useGetAccountPayments: () => useGetAccountPayments,
2212
2216
  useGetAccountPushDevice: () => useGetAccountPushDevice,
2213
2217
  useGetAccountPushDevices: () => useGetAccountPushDevices,
@@ -3860,6 +3864,39 @@ var useGetAccountLogin = (accountId = "", username = "", options = {}) => {
3860
3864
  );
3861
3865
  };
3862
3866
 
3867
+ // src/queries/accounts/useGetAccountNotificationPreferences.ts
3868
+ var ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_KEY = (accountId) => [...ACCOUNT_QUERY_KEY(accountId), "notification-preferences"];
3869
+ var SET_ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_DATA = (client, keyParams, response) => {
3870
+ client.setQueryData(
3871
+ ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_KEY(...keyParams),
3872
+ response
3873
+ );
3874
+ };
3875
+ var GetAccountNotificationPreferences = async ({
3876
+ accountId = "",
3877
+ adminApiParams
3878
+ }) => {
3879
+ const adminApi = await GetAdminAPI(adminApiParams);
3880
+ const { data } = await adminApi.get(
3881
+ `/accounts/${accountId}/notification-preferences`
3882
+ );
3883
+ return data;
3884
+ };
3885
+ var useGetAccountNotificationPreferences = (accountId = "", options = {}) => {
3886
+ return useConnectedSingleQuery(
3887
+ ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_KEY(accountId),
3888
+ (params) => GetAccountNotificationPreferences({
3889
+ accountId: accountId || "unknown",
3890
+ ...params
3891
+ }),
3892
+ {
3893
+ ...options,
3894
+ enabled: !!accountId && (options?.enabled ?? true)
3895
+ },
3896
+ "accounts"
3897
+ );
3898
+ };
3899
+
3863
3900
  // src/queries/accounts/useGetAccountPayments.ts
3864
3901
  var ACCOUNT_PAYMENTS_QUERY_KEY = (accountId) => [
3865
3902
  ...ACCOUNT_QUERY_KEY(accountId),
@@ -4357,10 +4394,13 @@ var useGetAdvertisementViews = (advertisementId = "", params = {}, options = {})
4357
4394
  // src/queries/announcements/useGetAnnouncements.ts
4358
4395
  var ANNOUNCEMENTS_QUERY_KEY = (filters) => {
4359
4396
  const keys = ["ANNOUNCEMENTS"];
4397
+ if (filters?.verifiedAccounts) keys.push("VERIFIED_ACCOUNTS");
4360
4398
  if (filters?.eventId) keys.push(filters.eventId);
4361
4399
  if (filters?.groupId) keys.push(filters.groupId);
4362
4400
  if (filters?.tierId) keys.push(filters.tierId);
4401
+ if (filters?.channelId) keys.push(filters.channelId);
4363
4402
  if (filters?.accountId) keys.push(filters.accountId);
4403
+ if (filters?.sponsorshipLevelId) keys.push(filters.sponsorshipLevelId);
4364
4404
  return keys;
4365
4405
  };
4366
4406
  var SET_ANNOUNCEMENTS_QUERY_DATA = (client, keyParams, response) => {
@@ -17166,27 +17206,32 @@ var useGetOrganizationUsers = (params = {}, options = {}) => {
17166
17206
  };
17167
17207
 
17168
17208
  // src/queries/organization/useSearchOrganization.ts
17169
- var SEARCH_ORGANIZATION_QUERY_KEY = (search) => [
17209
+ var SEARCH_ORGANIZATION_QUERY_KEY = (search, filters) => [
17170
17210
  "SEARCH_ORGANIZATION",
17171
- search ?? ""
17211
+ search ?? "",
17212
+ ...filters ? [JSON.stringify(filters)] : []
17172
17213
  ];
17173
17214
  var SET_SEARCH_ORGANIZATION_QUERY_DATA = (client, keyParams, response) => {
17174
17215
  client.setQueryData(SEARCH_ORGANIZATION_QUERY_KEY(...keyParams), response);
17175
17216
  };
17176
17217
  var SearchOrganization = async ({
17177
17218
  search,
17219
+ filters,
17178
17220
  adminApiParams
17179
17221
  }) => {
17180
17222
  const adminApi = await GetAdminAPI(adminApiParams);
17181
17223
  const { data } = await adminApi.get(`/organization/search`, {
17182
- params: { search }
17224
+ params: {
17225
+ search,
17226
+ ...filters
17227
+ }
17183
17228
  });
17184
17229
  return data;
17185
17230
  };
17186
- var useSearchOrganization = (search, options = {}) => {
17231
+ var useSearchOrganization = (search, filters, options = {}) => {
17187
17232
  return useConnectedSingleQuery(
17188
- SEARCH_ORGANIZATION_QUERY_KEY(search),
17189
- (params) => SearchOrganization({ ...params, search }),
17233
+ SEARCH_ORGANIZATION_QUERY_KEY(search, filters),
17234
+ (params) => SearchOrganization({ ...params, search, filters }),
17190
17235
  {
17191
17236
  ...options,
17192
17237
  enabled: !!search && (options.enabled ?? true)
@@ -36259,6 +36304,7 @@ var useUpdateVideo = (options = {}) => {
36259
36304
  ACCOUNT_LIKES_QUERY_KEY,
36260
36305
  ACCOUNT_LOGINS_QUERY_KEY,
36261
36306
  ACCOUNT_LOGIN_QUERY_KEY,
36307
+ ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_KEY,
36262
36308
  ACCOUNT_PAYMENTS_QUERY_KEY,
36263
36309
  ACCOUNT_PUSH_DEVICES_QUERY_KEY,
36264
36310
  ACCOUNT_PUSH_DEVICE_QUERY_KEY,
@@ -36895,6 +36941,7 @@ var useUpdateVideo = (options = {}) => {
36895
36941
  GetAccountLikes,
36896
36942
  GetAccountLogin,
36897
36943
  GetAccountLogins,
36944
+ GetAccountNotificationPreferences,
36898
36945
  GetAccountPayments,
36899
36946
  GetAccountPushDevice,
36900
36947
  GetAccountPushDevices,
@@ -37458,6 +37505,7 @@ var useUpdateVideo = (options = {}) => {
37458
37505
  SET_ACCOUNT_LEAD_QUERY_DATA,
37459
37506
  SET_ACCOUNT_LEVELS_QUERY_DATA,
37460
37507
  SET_ACCOUNT_LIKES_QUERY_DATA,
37508
+ SET_ACCOUNT_NOTIFICATION_PREFERENCES_QUERY_DATA,
37461
37509
  SET_ACCOUNT_PAYMENTS_QUERY_DATA,
37462
37510
  SET_ACCOUNT_PUSH_DEVICES_QUERY_DATA,
37463
37511
  SET_ACCOUNT_PUSH_DEVICE_QUERY_DATA,
@@ -38416,6 +38464,7 @@ var useUpdateVideo = (options = {}) => {
38416
38464
  useGetAccountLikes,
38417
38465
  useGetAccountLogin,
38418
38466
  useGetAccountLogins,
38467
+ useGetAccountNotificationPreferences,
38419
38468
  useGetAccountPayments,
38420
38469
  useGetAccountPushDevice,
38421
38470
  useGetAccountPushDevices,