@aeriajs/entrypoint 0.0.155 → 0.0.157

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
@@ -84,6 +84,16 @@ const getAvailableRoles = async () => {
84
84
  }
85
85
  const collections = await (0, exports.getCollections)();
86
86
  const availableRoles = [];
87
+ if ('user' in collections) {
88
+ const collection = typeof collections.user === 'function'
89
+ ? collections.user()
90
+ : collections.user;
91
+ if ('roles' in collection.description.properties
92
+ && 'items' in collection.description.properties.roles
93
+ && 'enum' in collection.description.properties.roles.items) {
94
+ availableRoles.push(...collection.description.properties.roles.items.enum);
95
+ }
96
+ }
87
97
  for (const collectionName in collections) {
88
98
  const candidate = collections[collectionName];
89
99
  const collection = typeof candidate === 'function'
package/dist/index.mjs CHANGED
@@ -64,6 +64,12 @@ export const getAvailableRoles = async () => {
64
64
  }
65
65
  const collections = await getCollections();
66
66
  const availableRoles = [];
67
+ if ("user" in collections) {
68
+ const collection = typeof collections.user === "function" ? collections.user() : collections.user;
69
+ if ("roles" in collection.description.properties && "items" in collection.description.properties.roles && "enum" in collection.description.properties.roles.items) {
70
+ availableRoles.push(...collection.description.properties.roles.items.enum);
71
+ }
72
+ }
67
73
  for (const collectionName in collections) {
68
74
  const candidate = collections[collectionName];
69
75
  const collection = typeof candidate === "function" ? candidate() : candidate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/entrypoint",
3
- "version": "0.0.155",
3
+ "version": "0.0.157",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -26,8 +26,8 @@
26
26
  "@aeriajs/types": "link:../types"
27
27
  },
28
28
  "peerDependencies": {
29
- "@aeriajs/common": "^0.0.150",
30
- "@aeriajs/types": "^0.0.128"
29
+ "@aeriajs/common": "^0.0.151",
30
+ "@aeriajs/types": "^0.0.129"
31
31
  },
32
32
  "scripts": {
33
33
  "test": "vitest run",