@toa.io/extensions.origins 0.8.0-dev.2 → 0.8.0-dev.4

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/extensions.origins",
3
- "version": "0.8.0-dev.2",
3
+ "version": "0.8.0-dev.4",
4
4
  "description": "Toa Origins",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -19,15 +19,15 @@
19
19
  "test": "echo \"Error: run tests from root\" && exit 1"
20
20
  },
21
21
  "dependencies": {
22
- "@toa.io/core": "0.8.0-dev.2",
23
- "@toa.io/generic": "0.8.0-dev.2",
24
- "@toa.io/schemas": "0.8.0-dev.2",
25
- "@toa.io/yaml": "0.7.2-dev.3",
22
+ "@toa.io/core": "0.8.0-dev.4",
23
+ "@toa.io/generic": "0.8.0-dev.4",
24
+ "@toa.io/schemas": "0.8.0-dev.4",
25
+ "@toa.io/yaml": "0.7.2-dev.5",
26
26
  "comq": "0.6.0",
27
27
  "node-fetch": "2.6.7"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node-fetch": "2.6.2"
31
31
  },
32
- "gitHead": "85a6e6ce4f5d90af087507e3db65b94f32e9a818"
32
+ "gitHead": "3de648988a0bfb4b0217da0527db312f22ef7c54"
33
33
  }
package/readme.md CHANGED
@@ -36,7 +36,7 @@ origins:
36
36
 
37
37
  ## Manifest
38
38
 
39
- `origins` manifest is an object conforming declaring origin names as keys an origin URLs as values.
39
+ `origins` manifest is an object with origin names as keys an origin URLs as values.
40
40
  Component's `origins` manifest can be overridden by the Context `origins` annotation.
41
41
 
42
42
  ### Sharded Connections
@@ -100,7 +100,7 @@ async function transition (input, object, context) {
100
100
  }
101
101
  ```
102
102
 
103
- #### `null` origins
103
+ #### `null` manifest
104
104
 
105
105
  To enable the extension for a component that uses arbitrary URLs without any specific origins to
106
106
  declare, the Origins manifest should be set to `null`.
@@ -16,7 +16,9 @@ function uris (instances, annotations) {
16
16
  if (component === undefined) throw new Error(`Origins annotations error: component '${id}' is not found`)
17
17
 
18
18
  for (const origin of Object.keys(annotation)) {
19
- if (!(origin in component.manifest)) {
19
+ const properties = origin[0] === '.'
20
+
21
+ if (!properties && !(origin in component.manifest)) {
20
22
  throw new Error(`Origins annotations error: component '${id}' doesn't have '${origin}' origin`)
21
23
  }
22
24
  }
@@ -148,6 +148,21 @@ describe('amqp', () => {
148
148
  })
149
149
  })
150
150
 
151
+ describe('http', () => {
152
+ it('should not throw on properties', async () => {
153
+ const annotations = {
154
+ [component.locator.id]: {
155
+ '.http': {
156
+ null: true
157
+ },
158
+ [origin]: 'amqps://whatever'
159
+ }
160
+ }
161
+
162
+ expect(() => deployment(components, annotations)).not.toThrow()
163
+ })
164
+ })
165
+
151
166
  /**
152
167
  * @param {toa.deployment.dependency.Variable[]} variables
153
168
  * @param {string} name
@@ -1 +1,2 @@
1
- ~: uri
1
+ /^\./: <boolean>
2
+ /^[^.]/: uri