@toa.io/extensions.origins 0.8.0-dev.3 → 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.3",
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.3",
23
- "@toa.io/generic": "0.8.0-dev.3",
24
- "@toa.io/schemas": "0.8.0-dev.3",
25
- "@toa.io/yaml": "0.7.2-dev.4",
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": "d72b4c2362e928dba56f4743cc956aa5486f82a4"
32
+ "gitHead": "3de648988a0bfb4b0217da0527db312f22ef7c54"
33
33
  }
@@ -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