@aeriajs/builtins 0.0.167 → 0.0.169

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.
@@ -71,6 +71,9 @@ const describe = async (contextOrPayload) => {
71
71
  const collection = typeof candidate === 'function'
72
72
  ? candidate()
73
73
  : candidate;
74
+ if (!(0, core_1.isValidCollection)(collection)) {
75
+ throw new Error(`The "${collectionName}" symbol exported from the entrypoint doesn't seem like a valid collection. Make sure only collections are exported from the "import('.').collections".`);
76
+ }
74
77
  const { description: rawDescription } = collection;
75
78
  const description = await (0, core_1.preloadDescription)(rawDescription);
76
79
  descriptions[description.$id] = description;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- import { createContext, preloadDescription, getEndpoints } from "@aeriajs/core";
2
+ import { createContext, preloadDescription, getEndpoints, isValidCollection } from "@aeriajs/core";
3
3
  import { getCollections, getAvailableRoles } from "@aeriajs/entrypoint";
4
4
  import { Result, ACError } from "@aeriajs/types";
5
5
  import { serialize, endpointError } from "@aeriajs/common";
@@ -64,6 +64,9 @@ export const describe = async (contextOrPayload) => {
64
64
  for (const collectionName in retrievedCollections) {
65
65
  const candidate = retrievedCollections[collectionName];
66
66
  const collection = typeof candidate === "function" ? candidate() : candidate;
67
+ if (!isValidCollection(collection)) {
68
+ throw new Error(`The "${collectionName}" symbol exported from the entrypoint doesn't seem like a valid collection. Make sure only collections are exported from the "import('.').collections".`);
69
+ }
67
70
  const { description: rawDescription } = collection;
68
71
  const description = await preloadDescription(rawDescription);
69
72
  descriptions[description.$id] = description;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeriajs/builtins",
3
- "version": "0.0.167",
3
+ "version": "0.0.169",
4
4
  "description": "## Installation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -45,11 +45,11 @@
45
45
  "mongodb": "^6.5.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@aeriajs/core": "^0.0.167",
49
- "@aeriajs/common": "^0.0.103",
50
- "@aeriajs/entrypoint": "^0.0.105",
48
+ "@aeriajs/core": "^0.0.169",
49
+ "@aeriajs/common": "^0.0.104",
50
+ "@aeriajs/entrypoint": "^0.0.106",
51
51
  "@aeriajs/types": "^0.0.87",
52
- "@aeriajs/validation": "^0.0.106"
52
+ "@aeriajs/validation": "^0.0.107"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "echo skipping",