@toa.io/extensions.origins 1.0.0-alpha.8 → 1.0.0-alpha.86

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.
Files changed (39) hide show
  1. package/package.json +10 -8
  2. package/readme.md +39 -3
  3. package/source/Factory.ts +13 -18
  4. package/source/protocols/amqp/aspect.js +7 -23
  5. package/source/protocols/http/.aspect/permissions.js +3 -8
  6. package/source/protocols/http/aspect.js +5 -12
  7. package/source/protocols/index.ts +5 -6
  8. package/source/protocols/pubsub/Aspect.ts +88 -0
  9. package/source/protocols/pubsub/Origin.ts +10 -0
  10. package/source/protocols/pubsub/Topic.ts +23 -0
  11. package/source/protocols/pubsub/index.ts +8 -0
  12. package/transpiled/Factory.d.ts +2 -3
  13. package/transpiled/Factory.js +12 -15
  14. package/transpiled/Factory.js.map +1 -1
  15. package/transpiled/protocols/amqp/aspect.d.ts +2 -2
  16. package/transpiled/protocols/amqp/aspect.js +7 -21
  17. package/transpiled/protocols/amqp/aspect.js.map +1 -1
  18. package/transpiled/protocols/http/.aspect/permissions.d.ts +1 -2
  19. package/transpiled/protocols/http/.aspect/permissions.js +1 -5
  20. package/transpiled/protocols/http/.aspect/permissions.js.map +1 -1
  21. package/transpiled/protocols/http/aspect.d.ts +2 -3
  22. package/transpiled/protocols/http/aspect.js +5 -10
  23. package/transpiled/protocols/http/aspect.js.map +1 -1
  24. package/transpiled/protocols/index.d.ts +3 -3
  25. package/transpiled/protocols/index.js +3 -2
  26. package/transpiled/protocols/index.js.map +1 -1
  27. package/transpiled/protocols/pubsub/Aspect.d.ts +13 -0
  28. package/transpiled/protocols/pubsub/Aspect.js +70 -0
  29. package/transpiled/protocols/pubsub/Aspect.js.map +1 -0
  30. package/transpiled/protocols/pubsub/Origin.d.ts +8 -0
  31. package/transpiled/protocols/pubsub/Origin.js +3 -0
  32. package/transpiled/protocols/pubsub/Origin.js.map +1 -0
  33. package/transpiled/protocols/pubsub/Topic.d.ts +8 -0
  34. package/transpiled/protocols/pubsub/Topic.js +19 -0
  35. package/transpiled/protocols/pubsub/Topic.js.map +1 -0
  36. package/transpiled/protocols/pubsub/index.d.ts +7 -0
  37. package/transpiled/protocols/pubsub/index.js +8 -0
  38. package/transpiled/protocols/pubsub/index.js.map +1 -0
  39. package/transpiled/tsconfig.tsbuildinfo +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/extensions.origins",
3
- "version": "1.0.0-alpha.8",
3
+ "version": "1.0.0-alpha.86",
4
4
  "description": "Toa Origins",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -17,12 +17,14 @@
17
17
  "main": "transpiled/index.js",
18
18
  "types": "transpiled/index.d.ts",
19
19
  "dependencies": {
20
- "@toa.io/core": "1.0.0-alpha.8",
21
- "@toa.io/generic": "1.0.0-alpha.8",
22
- "@toa.io/pointer": "1.0.0-alpha.8",
23
- "@toa.io/schemas": "1.0.0-alpha.8",
24
- "comq": "0.10.1",
25
- "msgpackr": "1.10.1"
20
+ "@google-cloud/pubsub": "4.3.3",
21
+ "@toa.io/core": "1.0.0-alpha.86",
22
+ "@toa.io/generic": "1.0.0-alpha.63",
23
+ "@toa.io/pointer": "1.0.0-alpha.63",
24
+ "@toa.io/schemas": "1.0.0-alpha.63",
25
+ "comq": "0.12.0",
26
+ "msgpackr": "1.10.1",
27
+ "openspan": "1.0.0-alpha.86"
26
28
  },
27
29
  "scripts": {
28
30
  "transpile": "tsc"
@@ -31,5 +33,5 @@
31
33
  "preset": "ts-jest",
32
34
  "testEnvironment": "node"
33
35
  },
34
- "gitHead": "2ee18835c8214600e1d354251fa632913bff38c3"
36
+ "gitHead": "9379190c388da1327a70f23e0b6f3ae47f0724fb"
35
37
  }
package/readme.md CHANGED
@@ -62,11 +62,47 @@ async function transition (input, object, context) {
62
62
  Uses [ComQ](https://github.com/toa-io/comq), thus, provides interface of `comq.IO` restricted
63
63
  to `emit` and `request` methods.
64
64
 
65
+ ## Google Pub/Sub Aspect
66
+
67
+ [Google Pub/Sub](https://cloud.google.com/pubsub) client.
68
+
69
+ ```javascript
70
+ async function transition (input, object, context) {
71
+ await context.pubsub.publish('topic', { message: 'Hello, World!' })
72
+ }
73
+ ```
74
+
75
+ Messages are batched with a maximum delay of 1 second.
76
+
77
+ ### Pub/Sub credentials
78
+
79
+ Google Pub/Sub [URL](#context-annotation) must follow the following format:
80
+
81
+ ```yaml
82
+ my-topic: pubsub://{emulator_host?}/projects/{project}/topics/{topic}
83
+ ```
84
+
85
+ ```javascript
86
+ await context.pubsub.topic.publish({ message: 'Hello, World!' })
87
+ ```
88
+
89
+ > Messages are published using JSON serialization.
90
+
91
+ For each `project`,
92
+ a secret `TOA_ORIGINS_PUBSUB__{project}`
93
+ with [ADC](https://cloud.google.com/docs/authentication/application-default-credentials) must be
94
+ deployed.
95
+
96
+ ```shell
97
+ $ kubectl create secret generic toa-origins-pubsub
98
+ $ kubectl patch secret toa-origins-pubsub -p '{"data": {"project-name": "'"$(cat adc.json | base64)"'"}}'
99
+ ```
100
+
65
101
  ## Manifest
66
102
 
67
103
  `origins` manifest is a [Pointer](/libraries/pointer) with origin names as keys.
68
104
  Its values can be overridden by the context [annotation](#context-annotation).
69
- If the value is `null`, then it _must_ be overriden.
105
+ If the value is `null`, then it _must_ be overridden.
70
106
 
71
107
  ### `null` manifest
72
108
 
@@ -90,7 +126,7 @@ origins:
90
126
  queues: amqps://amqp.azure.com
91
127
  ```
92
128
 
93
- ### HTTP URL Permissions
129
+ ### HTTP URL permissions
94
130
 
95
131
  The rules for arbitrary HTTP requests are stored in the `http` property of the corresponding
96
132
  component as an object.
@@ -106,7 +142,7 @@ In cases where a URL matches multiple rules, denial takes priority.
106
142
  # context.toa.yaml
107
143
  origins:
108
144
  dummies.dummy:
109
- http:
145
+ .http:
110
146
  /^https?:\/\/api.domain.com/: true
111
147
  /^http:\/\/sandbox.domain.com/@staging: true # `staging` environment
112
148
  /.*hackers.*/: false # deny
package/source/Factory.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { decode } from 'msgpackr'
2
2
  import { resolve, type URIMap } from '@toa.io/pointer'
3
- import { memo } from '@toa.io/generic'
4
3
  import { type Protocol, protocols } from './protocols'
5
4
  import { ENV_PREFIX, ID_PREFIX, PROPERTIES_SUFFIX } from './extension'
6
5
  import type { Properties } from './annotation'
@@ -14,31 +13,29 @@ export class Factory implements extensions.Factory {
14
13
 
15
14
  private createAspect (locator: Locator, manifest: Manifest, protocol: Protocol):
16
15
  extensions.Aspect {
17
- const resolver = this.resolver(locator, manifest, protocol)
16
+ const declaration = this.resolve(locator, manifest, protocol)
18
17
 
19
- return protocol.create(resolver)
18
+ return protocol.create(declaration)
20
19
  }
21
20
 
22
- private resolver (locator: Locator, manifest: Manifest, protocol: Protocol): Resolver {
23
- return memo(async (): Promise<Configuration> => {
24
- const uris = await this.getURIs(locator, manifest)
25
- const allProperties = this.getProperties(locator)
21
+ private resolve (locator: Locator, manifest: Manifest, protocol: Protocol): Declaration {
22
+ const uris = this.getURIs(locator, manifest)
23
+ const allProperties = this.getProperties(locator)
26
24
 
27
- const origins = this.filterOrigins(uris, protocol.protocols)
28
- const properties = allProperties['.' + protocol.id as keyof Properties] ?? {}
25
+ const origins = this.filterOrigins(uris, protocol.protocols)
26
+ const properties = allProperties['.' + protocol.id as keyof Properties] ?? {}
29
27
 
30
- return { origins, properties }
31
- })
28
+ return { origins, properties }
32
29
  }
33
30
 
34
- private async getURIs (locator: Locator, manifest: Manifest): Promise<URIMap> {
31
+ private getURIs (locator: Locator, manifest: Manifest): URIMap {
35
32
  const map: URIMap = {}
36
33
 
37
34
  if (manifest === null) return map
38
35
 
39
36
  for (const [name, value] of Object.entries(manifest))
40
37
  try {
41
- map[name] = await this.readOrigin(locator, name)
38
+ map[name] = this.readOrigin(locator, name)
42
39
  } catch {
43
40
  // eslint-disable-next-line max-depth
44
41
  if (value === null) throw new Error(`Origin value ${name} is not defined`)
@@ -62,10 +59,10 @@ export class Factory implements extensions.Factory {
62
59
  return filtered
63
60
  }
64
61
 
65
- private async readOrigin (locator: Locator, name: string): Promise<string[]> {
62
+ private readOrigin (locator: Locator, name: string): string[] {
66
63
  const id = ID_PREFIX + locator.label
67
64
 
68
- return await resolve(id, name)
65
+ return resolve(id, name)
69
66
  }
70
67
 
71
68
  private getProperties (locator: Locator): Properties {
@@ -80,9 +77,7 @@ export class Factory implements extensions.Factory {
80
77
  }
81
78
  }
82
79
 
83
- export interface Configuration {
80
+ export interface Declaration {
84
81
  origins: URIMap
85
82
  properties: Record<string, boolean>
86
83
  }
87
-
88
- export type Resolver = () => Promise<Configuration>
@@ -7,20 +7,17 @@ const protocol = require('./index')
7
7
  class Aspect extends Connector {
8
8
  name = protocol.id
9
9
 
10
- #resolve
11
-
12
- /** @type {Record<string, Partial<comq.IO>>} */
10
+ #declarations
13
11
  #origins = {}
14
12
 
15
- constructor (resolve) {
13
+ constructor (origins) {
16
14
  super()
17
15
 
18
- this.#resolve = resolve
16
+ this.#declarations = origins
19
17
  }
20
18
 
21
19
  async open () {
22
- const cfg = await this.#resolve()
23
- const promises = Object.entries(cfg.origins).map(this.#open)
20
+ const promises = Object.entries(this.#declarations).map(this.#open)
24
21
 
25
22
  await Promise.all(promises)
26
23
  }
@@ -42,7 +39,7 @@ class Aspect extends Connector {
42
39
  #open = async ([origin, references]) => {
43
40
  const io = await assert(...references)
44
41
 
45
- this.#origins[origin] = restrict(io)
42
+ this.#origins[origin] = io
46
43
  }
47
44
 
48
45
  #close = async (io) => {
@@ -50,21 +47,8 @@ class Aspect extends Connector {
50
47
  }
51
48
  }
52
49
 
53
- /**
54
- * @param {comq.IO} io
55
- * @return {Partial<comq.IO>}
56
- */
57
- function restrict (io) {
58
- // noinspection JSUnresolvedReference
59
- return {
60
- request: (...args) => io.request(...args),
61
- emit: (...args) => io.emit(...args),
62
- close: () => io.close()
63
- }
64
- }
65
-
66
- function create (resolve) {
67
- return new Aspect(resolve)
50
+ function create (declaration) {
51
+ return new Aspect(declaration.origins)
68
52
  }
69
53
 
70
54
  exports.create = create
@@ -12,16 +12,11 @@ class Permissions extends Connector {
12
12
 
13
13
  #resolve
14
14
 
15
- constructor (resolve) {
15
+ constructor (properties) {
16
16
  super()
17
17
 
18
- this.#resolve = resolve
19
- }
20
-
21
- async open () {
22
- const { properties } = await this.#resolve()
23
-
24
- if (properties !== undefined) this.#parse(properties)
18
+ if (properties !== undefined)
19
+ this.#parse(properties)
25
20
  }
26
21
 
27
22
  test (url) {
@@ -11,25 +11,18 @@ class Aspect extends Connector {
11
11
  /** @readonly */
12
12
  name = protocol.id
13
13
 
14
- #resolve
15
14
  #origins
16
15
  #permissions
17
16
 
18
- constructor (resolve, permissions) {
17
+ constructor (origins, permissions) {
19
18
  super()
20
19
 
21
- this.#resolve = resolve
20
+ this.#origins = origins
22
21
  this.#permissions = permissions
23
22
 
24
23
  this.depends(permissions)
25
24
  }
26
25
 
27
- async open () {
28
- const { origins } = await this.#resolve()
29
-
30
- this.#origins = origins
31
- }
32
-
33
26
  async invoke (name, path, request, options) {
34
27
  let origin = this.#origins[name]
35
28
 
@@ -98,10 +91,10 @@ function isAbsoluteURL (path) {
98
91
 
99
92
  const PLACEHOLDER = /\*/g
100
93
 
101
- function create (resolve) {
102
- const permissions = new Permissions(resolve)
94
+ function create (declaration) {
95
+ const permissions = new Permissions(declaration.properties)
103
96
 
104
- return new Aspect(resolve, permissions)
97
+ return new Aspect(declaration.origins, permissions)
105
98
  }
106
99
 
107
100
  exports.create = create
@@ -1,16 +1,15 @@
1
- 'use strict'
2
-
3
- import { type Resolver } from '../Factory'
4
1
  import amqp from './amqp'
5
2
  import http from './http'
3
+ import pubsub from './pubsub'
4
+ import type { Declaration } from '../Factory'
6
5
  import type { extensions } from '@toa.io/core'
7
6
 
8
- export const protocols: Protocol[] = [http, amqp]
7
+ export const protocols: Protocol[] = [http, amqp, pubsub]
9
8
 
10
9
  export interface Protocol {
11
10
  id: ProtocolID
12
11
  protocols: string[]
13
- create: (resolver: Resolver) => extensions.Aspect
12
+ create: (declaration: Declaration) => extensions.Aspect
14
13
  }
15
14
 
16
- export type ProtocolID = 'http' | 'amqp'
15
+ export type ProtocolID = 'http' | 'amqp' | 'pubsub'
@@ -0,0 +1,88 @@
1
+ import assert from 'node:assert'
2
+ import { console } from 'openspan'
3
+ import { Connector } from '@toa.io/core'
4
+ import { PubSub } from '@google-cloud/pubsub'
5
+ import { Topic } from './Topic'
6
+ import type { Origin } from './Origin'
7
+ import type { extensions } from '@toa.io/core'
8
+ import type { Declaration } from '../../Factory'
9
+
10
+ class Aspect extends Connector implements extensions.Aspect {
11
+ public readonly name = 'pubsub'
12
+
13
+ private readonly topics: Record<string, Topic>
14
+
15
+ public constructor (topics: Record<string, Topic>) {
16
+ super()
17
+
18
+ this.topics = topics
19
+
20
+ const values = Object.values(topics)
21
+
22
+ if (values.length > 0)
23
+ this.depends(values)
24
+ }
25
+
26
+ public async invoke (method: Method, topic: string, message: unknown): Promise<string> {
27
+ assert(topic in this.topics, `Pub/Sub topic ${topic} is not defined`)
28
+
29
+ return await this.topics[topic][method](message)
30
+ }
31
+ }
32
+
33
+ type Method = 'publish'
34
+
35
+ export function create (declaration: Declaration): Aspect {
36
+ const origins = toOrigins(declaration)
37
+ const topics = toTopics(origins)
38
+
39
+ return new Aspect(topics)
40
+ }
41
+
42
+ function toOrigins (declaration: Declaration): Record<string, Origin> {
43
+ const origins: Record<string, Origin> = {}
44
+
45
+ for (const [name, references] of Object.entries(declaration.origins))
46
+ origins[name] = toOrigin(references[0])
47
+
48
+ return origins
49
+ }
50
+
51
+ function toOrigin (reference: string): Origin {
52
+ const url = new URL(reference)
53
+ const [, , project, , topic] = url.pathname.split('/')
54
+ const suffix = project.replaceAll('-', '_').toUpperCase()
55
+ const json = process.env['TOA_ORIGINS_PUBSUB__' + suffix]
56
+ const credentials = json !== undefined ? JSON.parse(json) : undefined
57
+
58
+ return {
59
+ endpoint: url.host,
60
+ credentials,
61
+ project,
62
+ topic
63
+ }
64
+ }
65
+
66
+ function toTopics (origins: Record<string, Origin>): Record<string, Topic> {
67
+ const pubsub: Record<string, PubSub> = {}
68
+ const topics: Record<string, Topic> = {}
69
+
70
+ for (const [name, origin] of Object.entries(origins)) {
71
+ if (!(origin.project in pubsub))
72
+ pubsub[origin.project] = createPubSub(origin)
73
+
74
+ topics[name] = new Topic(pubsub[origin.project], origin)
75
+ }
76
+
77
+ return topics
78
+ }
79
+
80
+ function createPubSub (origin: Origin): PubSub {
81
+ console.info('Using Pub/Sub', { project: origin.project, client: origin.credentials?.client_id ?? 'unauthenticated' })
82
+
83
+ return new PubSub({
84
+ projectId: origin.project,
85
+ apiEndpoint: origin.endpoint,
86
+ credentials: origin.credentials
87
+ })
88
+ }
@@ -0,0 +1,10 @@
1
+ import type { ClientConfig } from '@google-cloud/pubsub'
2
+
3
+ export interface Origin {
4
+ readonly project: string
5
+ readonly topic: string
6
+ readonly endpoint?: string
7
+ readonly credentials?: Credentials
8
+ }
9
+
10
+ export type Credentials = ClientConfig['credentials']
@@ -0,0 +1,23 @@
1
+ import { Connector } from '@toa.io/core'
2
+ import type { Origin } from './Origin'
3
+ import type { PublishOptions, PubSub } from '@google-cloud/pubsub'
4
+
5
+ export class Topic extends Connector {
6
+ private readonly publisher
7
+
8
+ public constructor (pubsub: PubSub, origin: Origin) {
9
+ super()
10
+
11
+ const name = `projects/${origin.project}/topics/${origin.topic}`
12
+
13
+ this.publisher = pubsub.topic(name, OPTIONS)
14
+ }
15
+
16
+ public async publish (payload: unknown): Promise<string> {
17
+ const data = Buffer.from(JSON.stringify(payload))
18
+
19
+ return this.publisher.publishMessage({ data })
20
+ }
21
+ }
22
+
23
+ const OPTIONS: PublishOptions = { batching: { maxMessages: 100, maxMilliseconds: 1000 } }
@@ -0,0 +1,8 @@
1
+ import { create } from './Aspect'
2
+ import type { Protocol } from '../index'
3
+
4
+ export = {
5
+ id: 'pubsub',
6
+ protocols: ['pubsub:'],
7
+ create
8
+ } satisfies Protocol
@@ -4,14 +4,13 @@ import type { Manifest } from './manifest';
4
4
  export declare class Factory implements extensions.Factory {
5
5
  aspect(locator: Locator, manifest: Manifest): extensions.Aspect[];
6
6
  private createAspect;
7
- private resolver;
7
+ private resolve;
8
8
  private getURIs;
9
9
  private filterOrigins;
10
10
  private readOrigin;
11
11
  private getProperties;
12
12
  }
13
- export interface Configuration {
13
+ export interface Declaration {
14
14
  origins: URIMap;
15
15
  properties: Record<string, boolean>;
16
16
  }
17
- export type Resolver = () => Promise<Configuration>;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Factory = void 0;
4
4
  const msgpackr_1 = require("msgpackr");
5
5
  const pointer_1 = require("@toa.io/pointer");
6
- const generic_1 = require("@toa.io/generic");
7
6
  const protocols_1 = require("./protocols");
8
7
  const extension_1 = require("./extension");
9
8
  class Factory {
@@ -11,25 +10,23 @@ class Factory {
11
10
  return protocols_1.protocols.map((protocol) => this.createAspect(locator, manifest, protocol));
12
11
  }
13
12
  createAspect(locator, manifest, protocol) {
14
- const resolver = this.resolver(locator, manifest, protocol);
15
- return protocol.create(resolver);
13
+ const declaration = this.resolve(locator, manifest, protocol);
14
+ return protocol.create(declaration);
16
15
  }
17
- resolver(locator, manifest, protocol) {
18
- return (0, generic_1.memo)(async () => {
19
- const uris = await this.getURIs(locator, manifest);
20
- const allProperties = this.getProperties(locator);
21
- const origins = this.filterOrigins(uris, protocol.protocols);
22
- const properties = allProperties['.' + protocol.id] ?? {};
23
- return { origins, properties };
24
- });
16
+ resolve(locator, manifest, protocol) {
17
+ const uris = this.getURIs(locator, manifest);
18
+ const allProperties = this.getProperties(locator);
19
+ const origins = this.filterOrigins(uris, protocol.protocols);
20
+ const properties = allProperties['.' + protocol.id] ?? {};
21
+ return { origins, properties };
25
22
  }
26
- async getURIs(locator, manifest) {
23
+ getURIs(locator, manifest) {
27
24
  const map = {};
28
25
  if (manifest === null)
29
26
  return map;
30
27
  for (const [name, value] of Object.entries(manifest))
31
28
  try {
32
- map[name] = await this.readOrigin(locator, name);
29
+ map[name] = this.readOrigin(locator, name);
33
30
  }
34
31
  catch {
35
32
  // eslint-disable-next-line max-depth
@@ -48,9 +45,9 @@ class Factory {
48
45
  }
49
46
  return filtered;
50
47
  }
51
- async readOrigin(locator, name) {
48
+ readOrigin(locator, name) {
52
49
  const id = extension_1.ID_PREFIX + locator.label;
53
- return await (0, pointer_1.resolve)(id, name);
50
+ return (0, pointer_1.resolve)(id, name);
54
51
  }
55
52
  getProperties(locator) {
56
53
  const variable = extension_1.ENV_PREFIX + locator.uppercase + extension_1.PROPERTIES_SUFFIX;
@@ -1 +1 @@
1
- {"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":";;;AAAA,uCAAiC;AACjC,6CAAsD;AACtD,6CAAsC;AACtC,2CAAsD;AACtD,2CAAsE;AAKtE,MAAa,OAAO;IACX,MAAM,CAAE,OAAgB,EAAE,QAAkB;QACjD,OAAO,qBAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAA;IACpF,CAAC;IAEO,YAAY,CAAE,OAAgB,EAAE,QAAkB,EAAE,QAAkB;QAE5E,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAE3D,OAAO,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAClC,CAAC;IAEO,QAAQ,CAAE,OAAgB,EAAE,QAAkB,EAAE,QAAkB;QACxE,OAAO,IAAA,cAAI,EAAC,KAAK,IAA4B,EAAE;YAC7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;YAClD,MAAM,aAAa,GAAG,IAAI,CAAC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,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;YAElC,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAClC,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAA;QAC/B,CAAC;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAEO,UAAU,CAAE,OAAgB,EAAE,IAAY;QAChD,MAAM,EAAE,GAAG,qBAAS,GAAG,OAAO,CAAC,KAAK,CAAA;QAEpC,OAAO,IAAA,iBAAO,EAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IAC1B,CAAC;IAEO,aAAa,CAAE,OAAgB;QACrC,MAAM,QAAQ,GAAG,sBAAU,GAAG,OAAO,CAAC,SAAS,GAAG,6BAAiB,CAAA;QACnE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAEnC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,EAAE,CAAA;QAElC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;QAE3C,OAAO,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAA;IACvB,CAAC;CACF;AArED,0BAqEC"}
@@ -1,6 +1,6 @@
1
- export function create(resolve: any): Aspect;
1
+ export function create(declaration: any): Aspect;
2
2
  declare class Aspect extends Connector {
3
- constructor(resolve: any);
3
+ constructor(origins: any);
4
4
  name: "amqp";
5
5
  open(): Promise<void>;
6
6
  close(): Promise<void>;
@@ -4,16 +4,14 @@ const { Connector } = require('@toa.io/core');
4
4
  const protocol = require('./index');
5
5
  class Aspect extends Connector {
6
6
  name = protocol.id;
7
- #resolve;
8
- /** @type {Record<string, Partial<comq.IO>>} */
7
+ #declarations;
9
8
  #origins = {};
10
- constructor(resolve) {
9
+ constructor(origins) {
11
10
  super();
12
- this.#resolve = resolve;
11
+ this.#declarations = origins;
13
12
  }
14
13
  async open() {
15
- const cfg = await this.#resolve();
16
- const promises = Object.entries(cfg.origins).map(this.#open);
14
+ const promises = Object.entries(this.#declarations).map(this.#open);
17
15
  await Promise.all(promises);
18
16
  }
19
17
  async close() {
@@ -28,26 +26,14 @@ class Aspect extends Connector {
28
26
  }
29
27
  #open = async ([origin, references]) => {
30
28
  const io = await assert(...references);
31
- this.#origins[origin] = restrict(io);
29
+ this.#origins[origin] = io;
32
30
  };
33
31
  #close = async (io) => {
34
32
  await io.close();
35
33
  };
36
34
  }
37
- /**
38
- * @param {comq.IO} io
39
- * @return {Partial<comq.IO>}
40
- */
41
- function restrict(io) {
42
- // noinspection JSUnresolvedReference
43
- return {
44
- request: (...args) => io.request(...args),
45
- emit: (...args) => io.emit(...args),
46
- close: () => io.close()
47
- };
48
- }
49
- function create(resolve) {
50
- return new Aspect(resolve);
35
+ function create(declaration) {
36
+ return new Aspect(declaration.origins);
51
37
  }
52
38
  exports.create = create;
53
39
  //# sourceMappingURL=aspect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aspect.js","sourceRoot":"","sources":["../../../source/protocols/amqp/aspect.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAClC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;AAC7C,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAEnC,MAAM,MAAO,SAAQ,SAAS;IAC5B,IAAI,GAAG,QAAQ,CAAC,EAAE,CAAA;IAElB,QAAQ,CAAA;IAER,+CAA+C;IAC/C,QAAQ,GAAG,EAAE,CAAA;IAEb,YAAa,OAAO;QAClB,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IACzB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;QACjC,MAAM,QAAQ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C,GAAG,CAAC,QAAQ,CAAC,CAAA;IAC7B,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;QACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,WAAW,MAAM,gBAAgB,MAAM,gBAAgB,CAAC,CAAA;QAC1E,CAAC;QAED,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC/C,CAAC;IAED,KAAK,GAAG,KAAK,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,EAAE;QACrC,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,UAAU,CAAC,CAAA;QAEtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,CAAA;IAC5B,CAAC,CAAA;IAED,MAAM,GAAG,KAAK,EAAE,EAAE,EAAE,EAAE;QACpB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAA;IAClB,CAAC,CAAA;CACF;AAED,SAAS,MAAM,CAAE,WAAW;IAC1B,OAAO,IAAI,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;AACxC,CAAC;AAED,OAAO,CAAC,MAAM,GAAG,MAAM,CAAA"}
@@ -1,6 +1,5 @@
1
1
  export class Permissions extends Connector {
2
- constructor(resolve: any);
3
- open(): Promise<void>;
2
+ constructor(properties: any);
4
3
  test(url: any): boolean;
5
4
  #private;
6
5
  }
@@ -7,12 +7,8 @@ class Permissions extends Connector {
7
7
  /** @type {RegExp[]} */
8
8
  #denials = [];
9
9
  #resolve;
10
- constructor(resolve) {
10
+ constructor(properties) {
11
11
  super();
12
- this.#resolve = resolve;
13
- }
14
- async open() {
15
- const { properties } = await this.#resolve();
16
12
  if (properties !== undefined)
17
13
  this.#parse(properties);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CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;YAChD,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,CAAA;YAEpC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAE,KAAK,EAAE,IAAI;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAA;QAErD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACnB,CAAC;CACF;AAED,MAAM,UAAU,GAAG,yBAAyB,CAAA;AAE5C,OAAO,CAAC,WAAW,GAAG,WAAW,CAAA"}
@@ -1,9 +1,8 @@
1
- export function create(resolve: any): Aspect;
1
+ export function create(declaration: any): Aspect;
2
2
  declare class Aspect extends Connector {
3
- constructor(resolve: any, permissions: any);
3
+ constructor(origins: any, permissions: any);
4
4
  /** @readonly */
5
5
  readonly name: "http";
6
- open(): Promise<void>;
7
6
  invoke(name: any, path: any, request: any, options: any): Promise<any>;
8
7
  #private;
9
8
  }