@availity/mui-spaces 1.0.31 → 1.1.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.1.0](https://github.com/Availity/element/compare/@availity/mui-spaces@1.0.31...@availity/mui-spaces@1.1.0) (2025-09-25)
6
+
7
+
8
+ ### Features
9
+
10
+ * **mui-spaces:** add operationName support ([f33f02b](https://github.com/Availity/element/commit/f33f02b2ef3cacee17a48a86849e2b4c96fac722))
11
+
5
12
  ## [1.0.31](https://github.com/Availity/element/compare/@availity/mui-spaces@1.0.30...@availity/mui-spaces@1.0.31) (2025-09-22)
6
13
 
7
14
  ## [1.0.30](https://github.com/Availity/element/compare/@availity/mui-spaces@1.0.29...@availity/mui-spaces@1.0.30) (2025-08-21)
package/dist/index.d.mts CHANGED
@@ -85,6 +85,13 @@ type SpacesProps = {
85
85
  /** Override the default variables used in the thanos query. Default: { types: [PAYERSPACE] }.
86
86
  * If the spaces provider should contain configurations of a type other than PAYERSPACE, you must override this prop */
87
87
  variables?: object;
88
+ /**
89
+ * Name for the GraphQL operation, used for debugging and monitoring.
90
+ *
91
+ * Format: `{ValueStream || PayerName}{AbbreviatedAppName}{Description}{Type}` (PascalCase)
92
+ * @example "OnbPsFavoritesQuery"
93
+ */
94
+ operationName?: string;
88
95
  /** The Client ID obtained from APIConnect. */
89
96
  clientId?: string;
90
97
  /** Children can be a react child or render prop. */
@@ -101,14 +108,14 @@ type SpacesProps = {
101
108
  * Useful for if you already have the spaces in your app and don't want the spaces provider to have to fetch them again. */
102
109
  spaces?: Space[];
103
110
  };
104
- type UseSpaces = (...ids: string[]) => (Space)[] | undefined;
111
+ type UseSpaces = (...ids: string[]) => Space[] | undefined;
105
112
 
106
113
  declare const INITIAL_STATE: {
107
114
  loading: boolean;
108
115
  };
109
116
  declare const SpacesContext: react.Context<SpacesContextType>;
110
117
  declare const useSpacesContext: () => SpacesContextType;
111
- declare const Spaces: ({ query, variables, clientId, children, payerIds, spaceIds, spaces: spacesFromProps, }: SpacesProps) => JSX.Element;
118
+ declare const Spaces: ({ query, variables, operationName, clientId, children, payerIds, spaceIds, spaces: spacesFromProps, }: SpacesProps) => JSX.Element;
112
119
  declare const useSpaces: UseSpaces;
113
120
 
114
121
  type SpacesLinkVariants = 'card' | 'list' | 'default' | undefined;
package/dist/index.d.ts CHANGED
@@ -85,6 +85,13 @@ type SpacesProps = {
85
85
  /** Override the default variables used in the thanos query. Default: { types: [PAYERSPACE] }.
86
86
  * If the spaces provider should contain configurations of a type other than PAYERSPACE, you must override this prop */
87
87
  variables?: object;
88
+ /**
89
+ * Name for the GraphQL operation, used for debugging and monitoring.
90
+ *
91
+ * Format: `{ValueStream || PayerName}{AbbreviatedAppName}{Description}{Type}` (PascalCase)
92
+ * @example "OnbPsFavoritesQuery"
93
+ */
94
+ operationName?: string;
88
95
  /** The Client ID obtained from APIConnect. */
89
96
  clientId?: string;
90
97
  /** Children can be a react child or render prop. */
@@ -101,14 +108,14 @@ type SpacesProps = {
101
108
  * Useful for if you already have the spaces in your app and don't want the spaces provider to have to fetch them again. */
102
109
  spaces?: Space[];
103
110
  };
104
- type UseSpaces = (...ids: string[]) => (Space)[] | undefined;
111
+ type UseSpaces = (...ids: string[]) => Space[] | undefined;
105
112
 
106
113
  declare const INITIAL_STATE: {
107
114
  loading: boolean;
108
115
  };
109
116
  declare const SpacesContext: react.Context<SpacesContextType>;
110
117
  declare const useSpacesContext: () => SpacesContextType;
111
- declare const Spaces: ({ query, variables, clientId, children, payerIds, spaceIds, spaces: spacesFromProps, }: SpacesProps) => JSX.Element;
118
+ declare const Spaces: ({ query, variables, operationName, clientId, children, payerIds, spaceIds, spaces: spacesFromProps, }: SpacesProps) => JSX.Element;
112
119
  declare const useSpaces: UseSpaces;
113
120
 
114
121
  type SpacesLinkVariants = 'card' | 'list' | 'default' | undefined;
package/dist/index.js CHANGED
@@ -118,7 +118,7 @@ var spacesReducer = (state, action) => {
118
118
  const { type } = action;
119
119
  return actions[type](state, action);
120
120
  };
121
- var fetchSpaces = (_0) => __async(null, [_0], function* ({ query, clientId, variables }) {
121
+ var fetchSpaces = (_0) => __async(null, [_0], function* ({ query, clientId, variables, operationName }) {
122
122
  const headers = {};
123
123
  if (clientId) {
124
124
  headers["X-Client-ID"] = clientId;
@@ -130,7 +130,8 @@ var fetchSpaces = (_0) => __async(null, [_0], function* ({ query, clientId, vari
130
130
  } = yield import_api_axios.avWebQLApi.create(
131
131
  {
132
132
  query,
133
- variables: __spreadValues({}, variables)
133
+ variables: __spreadValues({}, variables),
134
+ operationName: operationName || "PuiSpacesCmpAnonymousOperation"
134
135
  },
135
136
  { headers: __spreadValues({}, headers) }
136
137
  );
@@ -148,15 +149,16 @@ var fetchAllSpaces = (_0) => __async(null, [_0], function* ({
148
149
  query,
149
150
  clientId,
150
151
  variables,
151
- _spaces = []
152
+ _spaces = [],
153
+ operationName
152
154
  }) {
153
- const { items, currentPage, hasNextPage } = yield fetchSpaces({ query, clientId, variables });
155
+ const { items, currentPage, hasNextPage } = yield fetchSpaces({ query, clientId, variables, operationName });
154
156
  _spaces.push(...items);
155
157
  if (hasNextPage) {
156
158
  const vars = __spreadProps(__spreadValues({}, variables), {
157
159
  page: currentPage + 1
158
160
  });
159
- return fetchAllSpaces({ query, clientId, variables: vars, _spaces });
161
+ return fetchAllSpaces({ query, clientId, variables: vars, _spaces, operationName });
160
162
  }
161
163
  return _spaces;
162
164
  });
@@ -582,6 +584,7 @@ var useSpacesContext = () => (0, import_react3.useContext)(SpacesContext);
582
584
  var Spaces = ({
583
585
  query = configurationFindMany_default,
584
586
  variables = { types: ["PAYERSPACE"] },
587
+ operationName,
585
588
  clientId,
586
589
  children,
587
590
  payerIds,
@@ -637,12 +640,12 @@ var Spaces = ({
637
640
  queries: [
638
641
  {
639
642
  queryKey: ["id", spaceIdVars],
640
- queryFn: () => fetchAllSpaces({ query, clientId, variables: spaceIdVars }),
643
+ queryFn: () => fetchAllSpaces({ query, clientId, variables: spaceIdVars, operationName }),
641
644
  enabled: spaceIdsToQuery.size > 0
642
645
  },
643
646
  {
644
647
  queryKey: ["id", payerIdVars],
645
- queryFn: () => fetchAllSpaces({ query, clientId, variables: payerIdVars }),
648
+ queryFn: () => fetchAllSpaces({ query, clientId, variables: payerIdVars, operationName }),
646
649
  enabled: payerIdsToQuery.size > 0
647
650
  }
648
651
  ]
package/dist/index.mjs CHANGED
@@ -76,7 +76,7 @@ var spacesReducer = (state, action) => {
76
76
  const { type } = action;
77
77
  return actions[type](state, action);
78
78
  };
79
- var fetchSpaces = (_0) => __async(null, [_0], function* ({ query, clientId, variables }) {
79
+ var fetchSpaces = (_0) => __async(null, [_0], function* ({ query, clientId, variables, operationName }) {
80
80
  const headers = {};
81
81
  if (clientId) {
82
82
  headers["X-Client-ID"] = clientId;
@@ -88,7 +88,8 @@ var fetchSpaces = (_0) => __async(null, [_0], function* ({ query, clientId, vari
88
88
  } = yield avWebQLApi.create(
89
89
  {
90
90
  query,
91
- variables: __spreadValues({}, variables)
91
+ variables: __spreadValues({}, variables),
92
+ operationName: operationName || "PuiSpacesCmpAnonymousOperation"
92
93
  },
93
94
  { headers: __spreadValues({}, headers) }
94
95
  );
@@ -106,15 +107,16 @@ var fetchAllSpaces = (_0) => __async(null, [_0], function* ({
106
107
  query,
107
108
  clientId,
108
109
  variables,
109
- _spaces = []
110
+ _spaces = [],
111
+ operationName
110
112
  }) {
111
- const { items, currentPage, hasNextPage } = yield fetchSpaces({ query, clientId, variables });
113
+ const { items, currentPage, hasNextPage } = yield fetchSpaces({ query, clientId, variables, operationName });
112
114
  _spaces.push(...items);
113
115
  if (hasNextPage) {
114
116
  const vars = __spreadProps(__spreadValues({}, variables), {
115
117
  page: currentPage + 1
116
118
  });
117
- return fetchAllSpaces({ query, clientId, variables: vars, _spaces });
119
+ return fetchAllSpaces({ query, clientId, variables: vars, _spaces, operationName });
118
120
  }
119
121
  return _spaces;
120
122
  });
@@ -540,6 +542,7 @@ var useSpacesContext = () => useContext2(SpacesContext);
540
542
  var Spaces = ({
541
543
  query = configurationFindMany_default,
542
544
  variables = { types: ["PAYERSPACE"] },
545
+ operationName,
543
546
  clientId,
544
547
  children,
545
548
  payerIds,
@@ -595,12 +598,12 @@ var Spaces = ({
595
598
  queries: [
596
599
  {
597
600
  queryKey: ["id", spaceIdVars],
598
- queryFn: () => fetchAllSpaces({ query, clientId, variables: spaceIdVars }),
601
+ queryFn: () => fetchAllSpaces({ query, clientId, variables: spaceIdVars, operationName }),
599
602
  enabled: spaceIdsToQuery.size > 0
600
603
  },
601
604
  {
602
605
  queryKey: ["id", payerIdVars],
603
- queryFn: () => fetchAllSpaces({ query, clientId, variables: payerIdVars }),
606
+ queryFn: () => fetchAllSpaces({ query, clientId, variables: payerIdVars, operationName }),
604
607
  enabled: payerIdsToQuery.size > 0
605
608
  }
606
609
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-spaces",
3
- "version": "1.0.31",
3
+ "version": "1.1.0",
4
4
  "description": "Availity MUI Spaces Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -17,6 +17,7 @@ export const useSpacesContext = () => useContext(SpacesContext);
17
17
  export const Spaces = ({
18
18
  query = configurationFindMany,
19
19
  variables = { types: ['PAYERSPACE'] },
20
+ operationName,
20
21
  clientId,
21
22
  children,
22
23
  payerIds,
@@ -82,12 +83,12 @@ export const Spaces = ({
82
83
  queries: [
83
84
  {
84
85
  queryKey: ['id', spaceIdVars],
85
- queryFn: () => fetchAllSpaces({ query, clientId, variables: spaceIdVars }),
86
+ queryFn: () => fetchAllSpaces({ query, clientId, variables: spaceIdVars, operationName }),
86
87
  enabled: spaceIdsToQuery.size > 0,
87
88
  },
88
89
  {
89
90
  queryKey: ['id', payerIdVars],
90
- queryFn: () => fetchAllSpaces({ query, clientId, variables: payerIdVars }),
91
+ queryFn: () => fetchAllSpaces({ query, clientId, variables: payerIdVars, operationName }),
91
92
  enabled: payerIdsToQuery.size > 0,
92
93
  },
93
94
  ],
@@ -28,7 +28,7 @@ export const spacesReducer = (state: SpacesContextType, action: SpacesReducerAct
28
28
  return actions[type](state, action);
29
29
  };
30
30
 
31
- export const fetchSpaces = async ({ query, clientId, variables }: FetchSpacesProps) => {
31
+ export const fetchSpaces = async ({ query, clientId, variables, operationName }: FetchSpacesProps) => {
32
32
  const headers: Record<string, string> = {};
33
33
 
34
34
  if (clientId) {
@@ -43,6 +43,7 @@ export const fetchSpaces = async ({ query, clientId, variables }: FetchSpacesPro
43
43
  {
44
44
  query,
45
45
  variables: { ...variables },
46
+ operationName: operationName || 'PuiSpacesCmpAnonymousOperation',
46
47
  },
47
48
  { headers: { ...headers } }
48
49
  );
@@ -64,8 +65,9 @@ export const fetchAllSpaces = async ({
64
65
  clientId,
65
66
  variables,
66
67
  _spaces = [],
68
+ operationName,
67
69
  }: FetchAllSpacesProps): Promise<Space[]> => {
68
- const { items, currentPage, hasNextPage } = await fetchSpaces({ query, clientId, variables });
70
+ const { items, currentPage, hasNextPage } = await fetchSpaces({ query, clientId, variables, operationName });
69
71
 
70
72
  _spaces.push(...items);
71
73
 
@@ -74,7 +76,7 @@ export const fetchAllSpaces = async ({
74
76
  ...variables,
75
77
  page: currentPage + 1,
76
78
  };
77
- return fetchAllSpaces({ query, clientId, variables: vars, _spaces });
79
+ return fetchAllSpaces({ query, clientId, variables: vars, _spaces, operationName });
78
80
  }
79
81
 
80
82
  return _spaces;
@@ -66,6 +66,13 @@ export type FetchSpacesProps = {
66
66
  variables?: object;
67
67
  /** The page sent to the avWebQL endpoint. */
68
68
  page?: string;
69
+ /**
70
+ * Name for the GraphQL operation, used for debugging and monitoring.
71
+ *
72
+ * Format: `{ValueStream || PayerName}{AbbreviatedAppName}{Description}{Type}` (PascalCase)
73
+ * @example "OnbPsFavoritesQuery"
74
+ */
75
+ operationName?: string;
69
76
  };
70
77
 
71
78
  export type FetchAllSpacesProps = {
@@ -77,6 +84,13 @@ export type FetchAllSpacesProps = {
77
84
  variables?: Record<string, any>;
78
85
  /** Array of spaces to be passed into the Spaces provider. */
79
86
  _spaces?: Space[];
87
+ /**
88
+ * Name for the GraphQL operation, used for debugging and monitoring.
89
+ *
90
+ * Format: `{ValueStream || PayerName}{AbbreviatedAppName}{Description}{Type}` (PascalCase)
91
+ * @example "OnbPsFavoritesQuery"
92
+ */
93
+ operationName?: string;
80
94
  };
81
95
 
82
96
  export type SpacesContextType = {
@@ -116,6 +130,13 @@ export type SpacesProps = {
116
130
  /** Override the default variables used in the thanos query. Default: { types: [PAYERSPACE] }.
117
131
  * If the spaces provider should contain configurations of a type other than PAYERSPACE, you must override this prop */
118
132
  variables?: object;
133
+ /**
134
+ * Name for the GraphQL operation, used for debugging and monitoring.
135
+ *
136
+ * Format: `{ValueStream || PayerName}{AbbreviatedAppName}{Description}{Type}` (PascalCase)
137
+ * @example "OnbPsFavoritesQuery"
138
+ */
139
+ operationName?: string;
119
140
  /** The Client ID obtained from APIConnect. */
120
141
  clientId?: string;
121
142
  /** Children can be a react child or render prop. */
@@ -133,4 +154,4 @@ export type SpacesProps = {
133
154
  spaces?: Space[];
134
155
  };
135
156
 
136
- export type UseSpaces = (...ids: string[]) => (Space)[] | undefined;
157
+ export type UseSpaces = (...ids: string[]) => Space[] | undefined;