@mu-cabin/opms-permission 0.8.31 → 0.8.32

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.cjs CHANGED
@@ -205,11 +205,11 @@ function findFirstEnableNode(data) {
205
205
  return null;
206
206
  }
207
207
  function handlePermissionTree(data, key) {
208
- const orgNoAuthMap = {};
208
+ const noAuthMap = {};
209
209
  function processNode(node) {
210
210
  const processedChildren = node.children?.map((child) => processNode(child)).filter((child) => child !== null);
211
211
  if (node.disabled) {
212
- orgNoAuthMap[node[key]] = { ...node, children: [] };
212
+ noAuthMap[node[key]] = { ...node, children: [] };
213
213
  if (!processedChildren?.length) {
214
214
  return null;
215
215
  }
@@ -219,10 +219,10 @@ function handlePermissionTree(data, key) {
219
219
  children: processedChildren || []
220
220
  };
221
221
  }
222
- const orgTree = data.map((node) => processNode(node)).filter((node) => node !== null);
222
+ const tree = data.map((node) => processNode(node)).filter((node) => node !== null);
223
223
  return {
224
- orgTree,
225
- orgNoAuthMap
224
+ tree,
225
+ noAuthMap
226
226
  };
227
227
  }
228
228
 
@@ -490,13 +490,13 @@ var Permission = class {
490
490
  storage.setItem(USER_ORG_KEY, orgTreeData);
491
491
  }
492
492
  const data = handlePermissionTree(orgTreeData, "orgId");
493
- const { orgNoAuthMap } = data;
494
- let { orgTree } = data;
495
- if (orgTree.length === 1 && orgTree[0].orgType === "HEAD" && orgTree[0].disabled) {
496
- orgTree = orgTree[0].children || [];
493
+ const { noAuthMap } = data;
494
+ let { tree } = data;
495
+ if (tree.length === 1 && tree[0].orgType === "HEAD" && tree[0].disabled) {
496
+ tree = tree[0].children || [];
497
497
  }
498
498
  this._orgTree = orgTreeData;
499
- return { orgTree: orgTreeData, orgNoAuthMap, authOrgTree: orgTree };
499
+ return { orgTree: orgTreeData, orgNoAuthMap: noAuthMap, authOrgTree: tree };
500
500
  } catch (error) {
501
501
  console.log(error);
502
502
  return null;
package/dist/index.mjs CHANGED
@@ -166,11 +166,11 @@ function findFirstEnableNode(data) {
166
166
  return null;
167
167
  }
168
168
  function handlePermissionTree(data, key) {
169
- const orgNoAuthMap = {};
169
+ const noAuthMap = {};
170
170
  function processNode(node) {
171
171
  const processedChildren = node.children?.map((child) => processNode(child)).filter((child) => child !== null);
172
172
  if (node.disabled) {
173
- orgNoAuthMap[node[key]] = { ...node, children: [] };
173
+ noAuthMap[node[key]] = { ...node, children: [] };
174
174
  if (!processedChildren?.length) {
175
175
  return null;
176
176
  }
@@ -180,10 +180,10 @@ function handlePermissionTree(data, key) {
180
180
  children: processedChildren || []
181
181
  };
182
182
  }
183
- const orgTree = data.map((node) => processNode(node)).filter((node) => node !== null);
183
+ const tree = data.map((node) => processNode(node)).filter((node) => node !== null);
184
184
  return {
185
- orgTree,
186
- orgNoAuthMap
185
+ tree,
186
+ noAuthMap
187
187
  };
188
188
  }
189
189
 
@@ -451,13 +451,13 @@ var Permission = class {
451
451
  storage.setItem(USER_ORG_KEY, orgTreeData);
452
452
  }
453
453
  const data = handlePermissionTree(orgTreeData, "orgId");
454
- const { orgNoAuthMap } = data;
455
- let { orgTree } = data;
456
- if (orgTree.length === 1 && orgTree[0].orgType === "HEAD" && orgTree[0].disabled) {
457
- orgTree = orgTree[0].children || [];
454
+ const { noAuthMap } = data;
455
+ let { tree } = data;
456
+ if (tree.length === 1 && tree[0].orgType === "HEAD" && tree[0].disabled) {
457
+ tree = tree[0].children || [];
458
458
  }
459
459
  this._orgTree = orgTreeData;
460
- return { orgTree: orgTreeData, orgNoAuthMap, authOrgTree: orgTree };
460
+ return { orgTree: orgTreeData, orgNoAuthMap: noAuthMap, authOrgTree: tree };
461
461
  } catch (error) {
462
462
  console.log(error);
463
463
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mu-cabin/opms-permission",
3
- "version": "0.8.31",
3
+ "version": "0.8.32",
4
4
  "description": "Frontend SDK for OPMS permission and auth management.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",