@toa.io/core 1.0.0-alpha.16 → 1.0.0-alpha.17

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.16",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "Toa Core",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -21,13 +21,13 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@rsql/parser": "1.2.4",
24
- "@toa.io/console": "1.0.0-alpha.16",
25
- "@toa.io/generic": "1.0.0-alpha.16",
26
- "@toa.io/yaml": "1.0.0-alpha.16",
24
+ "@toa.io/console": "1.0.0-alpha.17",
25
+ "@toa.io/generic": "1.0.0-alpha.17",
26
+ "@toa.io/yaml": "1.0.0-alpha.17",
27
27
  "error-value": "0.3.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "clone-deep": "4.0.1"
31
31
  },
32
- "gitHead": "6929dc2b2092a820b5fd023d99ec4249ccd115e4"
32
+ "gitHead": "40ea6c9695dc6b8dc434cad4eb413d7477238ac5"
33
33
  }
@@ -18,7 +18,7 @@ properties:
18
18
  minItems: 1
19
19
  items:
20
20
  type: string
21
- pattern: ^[^:]+?(:(asc|desc))?$
21
+ pattern: ^\w{1,32}(?::(?:asc|desc))?$
22
22
  projection:
23
23
  type: array
24
24
  uniqueItems: true
package/src/state.js CHANGED
@@ -8,16 +8,16 @@ const {
8
8
  } = require('./exceptions')
9
9
 
10
10
  class State {
11
- #dependent
11
+ #associated
12
12
  #storage
13
13
  #entity
14
14
  #emission
15
15
 
16
- constructor (storage, entity, emission, dependent) {
16
+ constructor (storage, entity, emission, associated) {
17
17
  this.#storage = storage
18
18
  this.#entity = entity
19
19
  this.#emission = emission
20
- this.#dependent = dependent === true
20
+ this.#associated = associated === true
21
21
  }
22
22
 
23
23
  init (id) {
@@ -28,7 +28,7 @@ class State {
28
28
  const record = await this.#storage.get(query)
29
29
 
30
30
  if (record === null) {
31
- if (this.#dependent && query.id !== undefined && query.version === undefined) {
31
+ if (this.#associated && query.id !== undefined && query.version === undefined) {
32
32
  return this.init(query.id)
33
33
  } else if (query.version !== undefined) throw new StatePreconditionException()
34
34
  }