@timardex/cluemart-shared 2.3.0 → 2.3.10

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.
@@ -24,7 +24,7 @@ import {
24
24
  } from "../chunk-5AAYX364.mjs";
25
25
  import "../chunk-RAYUJODN.mjs";
26
26
  import "../chunk-DQ7ZHIXW.mjs";
27
- import "../chunk-YTRRTC2S.mjs";
27
+ import "../chunk-UWMZ6VLV.mjs";
28
28
  import "../chunk-TKSBCN3N.mjs";
29
29
  import "../chunk-7DQBUZXY.mjs";
30
30
  import {
package/dist/index.cjs CHANGED
@@ -453,6 +453,8 @@ __export(index_exports, {
453
453
  useGetPrivateChats: () => useGetPrivateChats,
454
454
  useGetRelation: () => useGetRelation,
455
455
  useGetRelationByEventAndVendor: () => useGetRelationByEventAndVendor,
456
+ useGetRelationHistories: () => useGetRelationHistories,
457
+ useGetRelationHistory: () => useGetRelationHistory,
456
458
  useGetReportedChatUsers: () => useGetReportedChatUsers,
457
459
  useGetResourceActivity: () => useGetResourceActivity,
458
460
  useGetResourceConnections: () => useGetResourceConnections,
@@ -5762,8 +5764,27 @@ var RELATION_FIELDS_FRAGMENT = import_client11.gql`
5762
5764
  ${RELATION_DATES_FRAGMENT}
5763
5765
  `;
5764
5766
  var GET_RELATION = import_client11.gql`
5765
- query getRelation($_id: ID!, $futureOnly: Boolean = false) {
5766
- relation(_id: $_id, futureOnly: $futureOnly) {
5767
+ query getRelation($_id: ID!) {
5768
+ relation(_id: $_id) {
5769
+ ...RelationFields
5770
+ }
5771
+ }
5772
+ ${RELATION_FIELDS_FRAGMENT}
5773
+ `;
5774
+ var GET_RELATION_HISTORY = import_client11.gql`
5775
+ query getRelationHistory($_id: ID!) {
5776
+ relationHistory(_id: $_id) {
5777
+ ...RelationFields
5778
+ }
5779
+ }
5780
+ ${RELATION_FIELDS_FRAGMENT}
5781
+ `;
5782
+ var GET_RELATION_HISTORIES = import_client11.gql`
5783
+ query getRelationHistories(
5784
+ $resourceId: ID!
5785
+ $resourceType: ResourceTypeEnum!
5786
+ ) {
5787
+ relationHistories(resourceId: $resourceId, resourceType: $resourceType) {
5767
5788
  ...RelationFields
5768
5789
  }
5769
5790
  }
@@ -7138,20 +7159,37 @@ var useDeleteRelation = () => {
7138
7159
 
7139
7160
  // src/graphql/hooks/relation/hooksQuery.ts
7140
7161
  var import_client38 = require("@apollo/client");
7141
- var useGetRelation = (_id, options) => {
7162
+ var useGetRelation = (_id) => {
7142
7163
  const { loading, error, data, refetch } = (0, import_client38.useQuery)(GET_RELATION, {
7143
- // `relation(futureOnly)` is a projection-specific view of RelationType.
7144
- // If this writes into the normalized RelationType cache, a full-history
7145
- // read (e.g. the statistics screen's `futureOnly: false`) and this one can
7146
- // overwrite each other's `relationDates` for the same entity id. Keep it
7147
- // uncached.
7164
+ // `relation` returns only upcoming dates, which is a projection of
7165
+ // RelationType rather than the stored document. Keep it out of the
7166
+ // normalized cache so it cannot overwrite `relationDates` of the same
7167
+ // entity id for other readers.
7148
7168
  fetchPolicy: "no-cache",
7149
7169
  skip: !_id,
7150
- variables: _id ? { _id, futureOnly: options?.futureOnly ?? false } : void 0
7170
+ variables: _id ? { _id } : void 0
7151
7171
  });
7152
7172
  const relation = data?.relation;
7153
7173
  return { error, loading, refetch, relation };
7154
7174
  };
7175
+ var useGetRelationHistory = (_id) => {
7176
+ const { loading, error, data, refetch } = (0, import_client38.useQuery)(GET_RELATION_HISTORY, {
7177
+ fetchPolicy: "no-cache",
7178
+ skip: !_id,
7179
+ variables: _id ? { _id } : void 0
7180
+ });
7181
+ const relationHistory = data?.relationHistory;
7182
+ return { error, loading, refetch, relationHistory };
7183
+ };
7184
+ var useGetRelationHistories = (resourceId, resourceType) => {
7185
+ const { loading, error, data, refetch } = (0, import_client38.useQuery)(GET_RELATION_HISTORIES, {
7186
+ fetchPolicy: "no-cache",
7187
+ skip: !resourceId || !resourceType,
7188
+ variables: { resourceId, resourceType }
7189
+ });
7190
+ const relationHistories = data?.relationHistories || [];
7191
+ return { error, loading, refetch, relationHistories };
7192
+ };
7155
7193
  var useGetRelationByEventAndVendor = (eventId, vendorId) => {
7156
7194
  const { loading, error, data, refetch } = (0, import_client38.useQuery)(GET_RELATION_BY_EVENT_AND_VENDOR, {
7157
7195
  fetchPolicy: "network-only",
@@ -10754,6 +10792,8 @@ function canAccessAdminPath(roles, pathname) {
10754
10792
  useGetPrivateChats,
10755
10793
  useGetRelation,
10756
10794
  useGetRelationByEventAndVendor,
10795
+ useGetRelationHistories,
10796
+ useGetRelationHistory,
10757
10797
  useGetReportedChatUsers,
10758
10798
  useGetResourceActivity,
10759
10799
  useGetResourceConnections,