@toa.io/norm 1.0.0-alpha.318 → 1.0.0-alpha.319

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.319](https://github.com/toa-io/toa/compare/v1.0.0-alpha.318...v1.0.0-alpha.319) (2026-09-27)
7
+
8
+ **Note:** Version bump only for package @toa.io/norm
9
+
10
+
11
+
12
+
13
+
6
14
  # [1.0.0-alpha.318](https://github.com/toa-io/toa/compare/v1.0.0-alpha.317...v1.0.0-alpha.318) (2026-09-23)
7
15
 
8
16
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/norm",
3
- "version": "1.0.0-alpha.318",
3
+ "version": "1.0.0-alpha.319",
4
4
  "type": "module",
5
5
  "description": "Toa declarations normalization and validation",
6
6
  "author": "temich <tema.gurtovoy@gmail.com>",
@@ -21,12 +21,12 @@
21
21
  "test": "echo \"Error: run tests from root\" && exit 1"
22
22
  },
23
23
  "dependencies": {
24
- "@toa.io/core": "1.0.0-alpha.315",
25
- "@toa.io/definitions": "1.0.0-alpha.318",
24
+ "@toa.io/core": "1.0.0-alpha.319",
25
+ "@toa.io/definitions": "1.0.0-alpha.319",
26
26
  "@toa.io/generic": "1.0.0-alpha.311",
27
- "@toa.io/prototype": "1.0.0-alpha.315",
27
+ "@toa.io/prototype": "1.0.0-alpha.319",
28
28
  "@toa.io/schemas": "1.0.0-alpha.311",
29
29
  "fast-glob": "3.3.3"
30
30
  },
31
- "gitHead": "82895af77cf22e8529925ba97193d73ee2139297"
31
+ "gitHead": "ee4901f2bc12c33fc2098a62f2af0c29838a2c2c"
32
32
  }
@@ -152,7 +152,7 @@ properties:
152
152
  unmanaged,
153
153
  ]
154
154
  scope:
155
- enum: [object, objects, changeset, stream, none]
155
+ enum: [entry, entries, changeset, stream, none]
156
156
  concurrency:
157
157
  enum: [none, retry]
158
158
  once:
@@ -198,7 +198,7 @@ properties:
198
198
  then:
199
199
  properties:
200
200
  scope:
201
- enum: [object, objects]
201
+ enum: [entry, entries]
202
202
  if: # not query: false
203
203
  not:
204
204
  properties:
@@ -207,12 +207,12 @@ properties:
207
207
  required: [query]
208
208
  then:
209
209
  required: [concurrency]
210
- - if: # transition and scope=objects
210
+ - if: # transition and scope=entries
211
211
  properties:
212
212
  type:
213
213
  const: transition
214
214
  scope:
215
- const: objects
215
+ const: entries
216
216
  then:
217
217
  properties:
218
218
  query:
@@ -245,7 +245,7 @@ properties:
245
245
  type:
246
246
  const: transition
247
247
  scope:
248
- const: objects
248
+ const: entries
249
249
  then:
250
250
  properties:
251
251
  # the reply is recorded, and over a set it is unbounded
@@ -258,7 +258,7 @@ properties:
258
258
  then:
259
259
  properties:
260
260
  scope:
261
- enum: [object, objects, stream, none]
261
+ enum: [entry, entries, stream, none]
262
262
  query:
263
263
  not:
264
264
  const: false
@@ -287,7 +287,7 @@ properties:
287
287
  then:
288
288
  properties:
289
289
  scope:
290
- enum: [object, objects, stream, none]
290
+ enum: [entry, entries, stream, none]
291
291
  - if: # takes a stream
292
292
  required: [stream]
293
293
  then:
@@ -44,12 +44,12 @@ describe('operations', () => {
44
44
 
45
45
  it('should scope an effect to none unless it says otherwise', async () => {
46
46
  manifest.operations.affect = { type: 'effect' }
47
- manifest.operations.reach = { type: 'effect', scope: 'objects' }
47
+ manifest.operations.reach = { type: 'effect', scope: 'entries' }
48
48
 
49
49
  await normalize(manifest)
50
50
 
51
51
  assert.deepStrictEqual(manifest.operations.affect.scope, 'none')
52
- assert.deepStrictEqual(manifest.operations.reach.scope, 'objects')
52
+ assert.deepStrictEqual(manifest.operations.reach.scope, 'entries')
53
53
  })
54
54
  })
55
55
 
@@ -16,14 +16,14 @@ export const ok = {
16
16
  operations: {
17
17
  get: {
18
18
  type: 'observation',
19
- scope: 'objects',
19
+ scope: 'entries',
20
20
  bridge: 'whatever',
21
21
  bindings: ['@toa.io/bindings.amqp']
22
22
  },
23
23
  add: {
24
24
  type: 'transition',
25
25
  concurrency: 'none',
26
- scope: 'object',
26
+ scope: 'entry',
27
27
  bridge: 'whatever',
28
28
  bindings: ['@toa.io/bindings.amqp']
29
29
  },
@@ -260,6 +260,13 @@ describe('operations', () => {
260
260
  )
261
261
  })
262
262
 
263
+ it('should refuse the names the scopes had before `entry` and `entries`', async () => {
264
+ for (const scope of ['object', 'objects']) {
265
+ manifest.operations.get.scope = scope
266
+ await assert.rejects(validate(manifest), (error) => /allowed values/.test(error.message))
267
+ }
268
+ })
269
+
263
270
  it('should allow only changeset for assignments', async () => {
264
271
  manifest.operations.set.scope = 'changeset'
265
272
  await assert.doesNotReject(validate(manifest))