@toa.io/extensions.chronicles 1.0.0-alpha.336 → 1.0.0-alpha.337
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 +3 -3
- package/readme.md +26 -8
- package/transpiled/Factory.js +8 -1
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/settings.d.ts +6 -2
- package/transpiled/settings.js +20 -12
- package/transpiled/settings.js.map +1 -1
- package/transpiled/store.d.ts +2 -2
- package/transpiled/store.js +4 -4
- package/transpiled/store.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.chronicles",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.337",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Toa Chronicles: a log of a context, kept in ClickHouse",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@toa.io/core": "1.0.0-alpha.333",
|
|
35
|
-
"@toa.io/definitions": "1.0.0-alpha.
|
|
35
|
+
"@toa.io/definitions": "1.0.0-alpha.337",
|
|
36
36
|
"@toa.io/generic": "1.0.0-alpha.332",
|
|
37
37
|
"comq": "0.28.0",
|
|
38
38
|
"openspan": "1.0.0-alpha.330"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "8231e6803768e1d58ff76f078696fee71078e7e5"
|
|
41
41
|
}
|
package/readme.md
CHANGED
|
@@ -622,14 +622,14 @@ chronicles:
|
|
|
622
622
|
encounters: true
|
|
623
623
|
```
|
|
624
624
|
|
|
625
|
-
| |
|
|
626
|
-
| ------------ |
|
|
627
|
-
| `broker` | where the rows are published
|
|
628
|
-
| `store` | where they are read: the provider, and the address of its server
|
|
629
|
-
| `retention` | days a row of `events` and of `encounters` is kept; absent, kept
|
|
630
|
-
| `encounters` | the routes clients send to; absent, there are none
|
|
631
|
-
| `ip` | `full` keeps a client's whole address; absent, its network
|
|
632
|
-
| `resources` | what the service may take, as [`resources`](/migrations/262.md) is stated elsewhere
|
|
625
|
+
| | |
|
|
626
|
+
| ------------ | ------------------------------------------------------------------------------------------------ |
|
|
627
|
+
| `broker` | where the rows are published |
|
|
628
|
+
| `store` | where they are read: the provider, and the address of its server; absent, they are not read here |
|
|
629
|
+
| `retention` | days a row of `events` and of `encounters` is kept; absent, kept |
|
|
630
|
+
| `encounters` | the routes clients send to; absent, there are none |
|
|
631
|
+
| `ip` | `full` keeps a client's whole address; absent, its network |
|
|
632
|
+
| `resources` | what the service may take, as [`resources`](/migrations/262.md) is stated elsewhere |
|
|
633
633
|
|
|
634
634
|
```shell
|
|
635
635
|
$ toa conceal chronicles broker_username=… broker_password=… store_username=… store_password=…
|
|
@@ -637,6 +637,24 @@ $ toa conceal chronicles broker_username=… broker_password=… store_username=
|
|
|
637
637
|
|
|
638
638
|
The service `chronicles-relay` alone is given the secret.
|
|
639
639
|
|
|
640
|
+
### Writing without reading
|
|
641
|
+
|
|
642
|
+
A context that names no `store` writes the log and does not read it: it has none of the routes of
|
|
643
|
+
[Reading the log](#reading-the-log), nor their tools, and its secret holds the broker's user alone.
|
|
644
|
+
Its rows are read where a store's user may read their scope — by a platform that reads the
|
|
645
|
+
contexts it runs, say.
|
|
646
|
+
|
|
647
|
+
```yaml
|
|
648
|
+
# context.toa.yaml
|
|
649
|
+
chronicles:
|
|
650
|
+
broker: amqp://analytics.internal
|
|
651
|
+
encounters: true
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
```shell
|
|
655
|
+
$ toa conceal chronicles broker_username=… broker_password=…
|
|
656
|
+
```
|
|
657
|
+
|
|
640
658
|
The events the components declare travel where the context's `amqp` says, as every event does, and
|
|
641
659
|
the relay takes them from there. A fact and an encounter reach it as tasks. Each is acknowledged
|
|
642
660
|
once the broker has confirmed its row, so while the broker is away they wait where they are, and
|
package/transpiled/Factory.js
CHANGED
|
@@ -51,7 +51,14 @@ export class Factory {
|
|
|
51
51
|
return this.publisher;
|
|
52
52
|
}
|
|
53
53
|
read() {
|
|
54
|
-
this.store
|
|
54
|
+
if (this.store !== undefined)
|
|
55
|
+
return this.store;
|
|
56
|
+
const { store } = settings();
|
|
57
|
+
const user = credentials().store;
|
|
58
|
+
// the queries are deployed only where the annotation names a store
|
|
59
|
+
if (store === undefined || user === undefined)
|
|
60
|
+
throw new Error('Chronicles are written here and not read: the annotation names no store.');
|
|
61
|
+
this.store = provider(store, user, environment.scope());
|
|
55
62
|
return this.store;
|
|
56
63
|
}
|
|
57
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EACL,UAAU,EACV,SAAS,EACT,OAAO,EACP,KAAK,EACN,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAMrC;;;;GAIG;AACH,MAAM,OAAO,OAAO;IACD,IAAI,CAAiB;IAEtC,sFAAsF;IAC9E,SAAS,CAAuB;IAExC,6EAA6E;IACrE,KAAK,CAAsB;IAEnC,YAAmB,IAAqB;QACtC,IAAI,CAAC,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C,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,CAAC,CAAA;QAEvD,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;CACF;AAED,4FAA4F;AAC5F,SAAS,IAAI,CAAC,OAAgB;IAC5B,OAAO,OAAO,CAAC,SAAS,KAAK,SAAS,CAAA;AACxC,CAAC"}
|
package/transpiled/settings.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { Settings } from '@toa.io/definitions/extensions.chronicles';
|
|
2
2
|
/** Where the log is published and read, and what it is kept of, as the service is deployed with them. */
|
|
3
3
|
export declare function settings(): Settings;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* The users of the broker the rows are published to, and of the store they are read from where
|
|
6
|
+
* the log is read here.
|
|
7
|
+
*/
|
|
5
8
|
export declare function credentials(): Credentials;
|
|
6
9
|
export interface Credentials {
|
|
7
10
|
broker: User;
|
|
8
|
-
|
|
11
|
+
/** absent where the context writes the log and does not read it */
|
|
12
|
+
store?: User;
|
|
9
13
|
}
|
|
10
14
|
export interface User {
|
|
11
15
|
username: string;
|
package/transpiled/settings.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { environment } from '@toa.io/generic';
|
|
2
|
-
import { KEYS, SETTINGS } from '@toa.io/definitions/extensions.chronicles';
|
|
2
|
+
import { BROKER_KEYS, KEYS, SETTINGS, STORE_KEYS } from '@toa.io/definitions/extensions.chronicles';
|
|
3
3
|
/** Where the log is published and read, and what it is kept of, as the service is deployed with them. */
|
|
4
4
|
export function settings() {
|
|
5
5
|
const value = environment.get(SETTINGS);
|
|
@@ -9,17 +9,21 @@ export function settings() {
|
|
|
9
9
|
return DEV;
|
|
10
10
|
throw new Error(`${SETTINGS} is not set, so nothing says where the log is kept.`);
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* The users of the broker the rows are published to, and of the store they are read from where
|
|
14
|
+
* the log is read here.
|
|
15
|
+
*/
|
|
13
16
|
export function credentials() {
|
|
14
|
-
const [brokerUsername, brokerPassword
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
broker: { username:
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const [brokerUsername, brokerPassword] = BROKER_KEYS.map(variable);
|
|
18
|
+
const [storeUsername, storePassword] = STORE_KEYS.map(variable);
|
|
19
|
+
const reads = settings().store !== undefined;
|
|
20
|
+
if (brokerUsername !== undefined && brokerPassword !== undefined) {
|
|
21
|
+
const broker = { username: brokerUsername, password: brokerPassword };
|
|
22
|
+
if (storeUsername !== undefined && storePassword !== undefined)
|
|
23
|
+
return { broker, store: { username: storeUsername, password: storePassword } };
|
|
24
|
+
if (!reads)
|
|
25
|
+
return { broker };
|
|
26
|
+
}
|
|
23
27
|
// the development stack's broker, and the context's user of its store, as the reference setup
|
|
24
28
|
// makes one
|
|
25
29
|
if (dev())
|
|
@@ -27,7 +31,11 @@ export function credentials() {
|
|
|
27
31
|
broker: { username: 'developer', password: 'secret' },
|
|
28
32
|
store: { username: environment.scope(), password: 'secret' }
|
|
29
33
|
};
|
|
30
|
-
|
|
34
|
+
const keys = reads ? KEYS : BROKER_KEYS;
|
|
35
|
+
throw new Error(`${SETTINGS}_{${keys.join(',').toUpperCase()}} are not all set.`);
|
|
36
|
+
}
|
|
37
|
+
function variable(key) {
|
|
38
|
+
return environment.get(`${SETTINGS}_${key.toUpperCase()}`);
|
|
31
39
|
}
|
|
32
40
|
function dev() {
|
|
33
41
|
return environment.get('TOA_DEV') === '1';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../source/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../source/settings.ts"],"names":[],"mappings":"AAAA,O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EAAE,QAAQ,EAAE,QAAQ,EAAE;YACrD,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;SAC7D,CAAA;IAEH,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAA;IAEvC,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAA;AACnF,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IAC3B,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,QAAQ,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC5D,CAAC;AAcD,SAAS,GAAG;IACV,OAAO,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,CAAA;AAC3C,CAAC;AAED,gGAAgG;AAChG,mCAAmC;AACnC,MAAM,GAAG,GAAa;IACpB,MAAM,EAAE,wBAAwB;IAChC,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,wBAAwB,EAAE;IAChE,UAAU,EAAE,IAAI;IAChB,EAAE,EAAE,WAAW;IACf,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;CACf,CAAA"}
|
package/transpiled/store.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Provider } from './Provider.ts';
|
|
2
2
|
import type { User } from './settings.ts';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Store } from '@toa.io/definitions/extensions.chronicles';
|
|
4
4
|
/** The provider the annotation names, read as the context's user of it. */
|
|
5
|
-
export declare function provider(
|
|
5
|
+
export declare function provider(store: Store, user: User, scope: string): Provider;
|
package/transpiled/store.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ClickHouseProvider } from './clickhouse/Provider.js';
|
|
2
2
|
/** The provider the annotation names, read as the context's user of it. */
|
|
3
|
-
export function provider(
|
|
4
|
-
switch (
|
|
3
|
+
export function provider(store, user, scope) {
|
|
4
|
+
switch (store.provider) {
|
|
5
5
|
case 'clickhouse':
|
|
6
|
-
return new ClickHouseProvider(
|
|
6
|
+
return new ClickHouseProvider(store.url, user, scope);
|
|
7
7
|
default:
|
|
8
|
-
throw new Error(`Chronicles have no store '${String(
|
|
8
|
+
throw new Error(`Chronicles have no store '${String(store.provider)}'`);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=store.js.map
|
package/transpiled/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../source/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAK7D,2EAA2E;AAC3E,MAAM,UAAU,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../source/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAK7D,2EAA2E;AAC3E,MAAM,UAAU,QAAQ,CAAC,KAAY,EAAE,IAAU,EAAE,KAAa;IAC9D,QAAQ,KAAK,CAAC,QAAQ,EAAE,CAAC;QACvB,KAAK,YAAY;YACf,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;QACvD;YACE,MAAM,IAAI,KAAK,CAAC,6BAA6B,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IAC3E,CAAC;AACH,CAAC"}
|