@toa.io/core 1.0.0-alpha.208 → 1.0.0-alpha.212

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": "@toa.io/core",
3
- "version": "1.0.0-alpha.208",
3
+ "version": "1.0.0-alpha.212",
4
4
  "description": "Toa Core",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -24,7 +24,8 @@
24
24
  "@toa.io/generic": "1.0.0-alpha.208",
25
25
  "@toa.io/yaml": "1.0.0-alpha.208",
26
26
  "error-value": "0.3.0",
27
- "openspan": "1.0.0-alpha.173"
27
+ "openspan": "1.0.0-alpha.173",
28
+ "uuid": "14.0.0"
28
29
  },
29
- "gitHead": "462bca87640cd5202af0b5d5219cf299bffa0301"
30
+ "gitHead": "d8aefb3b37df15be74bb63e1447f76c27e88d9be"
30
31
  }
package/src/connector.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict'
2
2
 
3
3
  const { console } = require('openspan')
4
- const { newid } = require('@toa.io/generic')
5
4
 
6
5
  /**
7
6
  * Abstract connections hierarchy
@@ -26,7 +25,7 @@ class Connector {
26
25
  connected = false
27
26
 
28
27
  constructor () {
29
- this.id = this.constructor.name + '#' + newid().substring(0, 8)
28
+ this.id = this.constructor.name + '#' + Math.random().toString(36).substring(2, 8)
30
29
  }
31
30
 
32
31
  /**
@@ -1,7 +1,8 @@
1
1
  'use strict'
2
2
 
3
- const { difference, newid } = require('@toa.io/generic')
3
+ const { difference } = require('@toa.io/generic')
4
4
  const { EntityContractException, EntityGuardException } = require('../exceptions')
5
+ const { newid } = require('./newid')
5
6
 
6
7
  class Entity {
7
8
  deleted = false
@@ -1,7 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const { newid } = require('@toa.io/generic')
4
-
3
+ const { newid } = require('./newid')
5
4
  const { Entity } = require('./entity')
6
5
  const { EntitySet } = require('./set')
7
6
  const { Changeset } = require('./changeset')
@@ -0,0 +1,11 @@
1
+ const uuid = require('uuid')
2
+
3
+ function newid () {
4
+ const buf = Buffer.alloc(16)
5
+
6
+ uuid.v7(undefined, buf)
7
+
8
+ return buf.toString('hex')
9
+ }
10
+
11
+ module.exports = { newid }