@toa.io/extensions.realtime 1.0.0-alpha.304 → 1.0.0-alpha.306

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.
@@ -46,4 +46,7 @@ stash: ~
46
46
  exposition:
47
47
  /:key:
48
48
  auth:id: key
49
- GET: create
49
+ GET:
50
+ endpoint: create
51
+ # an effect: opening a stream is not a read, and `GET` is the method a client opens one with
52
+ io:readonly: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/extensions.realtime",
3
- "version": "1.0.0-alpha.304",
3
+ "version": "1.0.0-alpha.306",
4
4
  "type": "module",
5
5
  "description": "Toa Realtime",
6
6
  "author": "temich <tema.gurtovoy@gmail.com>",
@@ -26,14 +26,14 @@
26
26
  "!**/.env*"
27
27
  ],
28
28
  "dependencies": {
29
- "@toa.io/core": "1.0.0-alpha.304",
30
- "@toa.io/definitions": "1.0.0-alpha.304",
29
+ "@toa.io/core": "1.0.0-alpha.306",
30
+ "@toa.io/definitions": "1.0.0-alpha.306",
31
31
  "@toa.io/generic": "1.0.0-alpha.304",
32
- "openspan": "1.0.0-alpha.304"
32
+ "openspan": "1.0.0-alpha.305"
33
33
  },
34
34
  "scripts": {
35
35
  "transpile": "npx tsc && npx tsc -p ./components/realtime.streams",
36
36
  "features": "TSX_TSCONFIG_PATH=features/steps/tsconfig.json NODE_OPTIONS=--import=tsx cucumber-js"
37
37
  },
38
- "gitHead": "a95a5a5a64922b11b23142d4acbcee1331ed31aa"
38
+ "gitHead": "0693d180a8053a7d07dca879dac2a3c4784d6d45"
39
39
  }
package/readme.md CHANGED
@@ -106,10 +106,14 @@ Realtime extension, and are
106
106
  accessible via the `/realtime/streams/:key/` resource with
107
107
  the [`auth:id: key`](/extensions/exposition/documentation/access.md#id) authorization rule.
108
108
 
109
+ Opening a stream is not a read, and `GET` is the method a client opens one with, so the route
110
+ declares [`io:readonly: false`](/extensions/exposition/documentation/io.md#readonly).
111
+
109
112
  Refer to the [Exposition extension](/extensions/exposition) for more details:
110
113
 
111
114
  - [Multipart responses](/extensions/exposition/documentation/protocol.md#multipart-types)
112
115
  - [Access authorization](/extensions/exposition/documentation/access.md)
116
+ - [Readonly chains](/documentation/readonly.md)
113
117
 
114
118
  ## Resources management
115
119
 
@@ -1,9 +1,9 @@
1
+ import { type Connector } from '@toa.io/core';
1
2
  import type { extensions } from '@toa.io/core/types';
2
- import { Realtime } from './Realtime.ts';
3
3
  export declare class Factory implements extensions.Factory {
4
4
  private readonly host;
5
5
  constructor(host: Host);
6
- service(): Realtime;
6
+ service(): Connector;
7
7
  private discovery;
8
8
  }
9
9
  export type Host = extensions.Host;
@@ -7,13 +7,16 @@ export class Factory {
7
7
  constructor(host) {
8
8
  this.host = host;
9
9
  }
10
+ // a halt takes the whole of it: a stream it would keep open has nothing to carry
10
11
  service() {
11
- const routes = new Routes(this.host);
12
- const composition = new Composition(this.host);
13
- const realtime = new Realtime(routes, async () => await this.discovery());
14
- realtime.depends(routes);
15
- realtime.depends(composition);
16
- return realtime;
12
+ return this.host.gate(async () => {
13
+ const routes = new Routes(this.host);
14
+ const composition = new Composition(this.host);
15
+ const realtime = new Realtime(routes, async () => await this.discovery());
16
+ realtime.depends(routes);
17
+ realtime.depends(composition);
18
+ return realtime;
19
+ });
17
20
  }
18
21
  async discovery() {
19
22
  const locator = new Locator('streams', 'realtime');
@@ -1 +1 @@
1
- {"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,OAAO,OAAO;IACD,IAAI,CAAM;IAE3B,YAAmB,IAAU;QAC3B,IAAI,CAAC,I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