@things-factory/id-rule-base 7.0.10 → 7.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/id-rule-base",
3
- "version": "7.0.10",
3
+ "version": "7.0.12",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -34,5 +34,5 @@
34
34
  "@things-factory/shell": "^7.0.10",
35
35
  "ses": "^1.5.0"
36
36
  },
37
- "gitHead": "9da4e145880a6d637db60f03116d5bbfdb6f4cfc"
37
+ "gitHead": "43e5d6fb4073a9ddd082a514ba1e9a53e62616bb"
38
38
  }
@@ -29,7 +29,7 @@ export async function generateId({ domain, type, seed }) {
29
29
 
30
30
  let evalFunc
31
31
  try {
32
- evalFunc = compartment.evaluate(`(async (domain, seed) => {
32
+ evalFunc = compartment.evaluate(`(async (domain, seed, getNext) => {
33
33
  ${rule.rule}
34
34
  })`)
35
35
  } catch (err) {
@@ -37,8 +37,9 @@ export async function generateId({ domain, type, seed }) {
37
37
  }
38
38
 
39
39
  const nextId = await evalFunc(domain, {
40
- ...seed
41
- })
40
+ ...seed,
41
+ },
42
+ getNext)
42
43
 
43
44
  return nextId
44
45
  }