wirejs-resources 0.1.133-llm → 0.1.135-llm
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.
|
@@ -3,6 +3,7 @@ import { DistributedTable, PassThruParser } from './distributed-table.js';
|
|
|
3
3
|
import { overrides } from '../overrides.js';
|
|
4
4
|
const defineTable = (kvStore) => {
|
|
5
5
|
const ctor = overrides.DistributedTable || DistributedTable;
|
|
6
|
+
console.log('Creating key value store', ctor, ctor === DistributedTable);
|
|
6
7
|
return new ctor(kvStore, 'table', {
|
|
7
8
|
parse: (PassThruParser),
|
|
8
9
|
key: { partition: { field: "key", type: 'string' } },
|
|
@@ -11,6 +11,7 @@ export class Setting extends Resource {
|
|
|
11
11
|
this.details = (details || { private: false });
|
|
12
12
|
settings = settings || new (overrides.KeyValueStore || KeyValueStore)('wirejs', 'settings');
|
|
13
13
|
allSettings.set(this.absoluteId, this);
|
|
14
|
+
console.log('constructing settings', allSettings);
|
|
14
15
|
}
|
|
15
16
|
get isPrivate() {
|
|
16
17
|
return this.details.private;
|
|
@@ -4,11 +4,12 @@ import { Resource } from '../resource.js';
|
|
|
4
4
|
import { Setting } from '../resources/setting.js';
|
|
5
5
|
import { overrides } from '../overrides.js';
|
|
6
6
|
const channels = new Map();
|
|
7
|
-
|
|
7
|
+
let secret;
|
|
8
|
+
let _server;
|
|
9
|
+
const makeSecret = () => new (overrides.Setting || Setting)('wirejs', 'realtime-secret', {
|
|
8
10
|
private: true, init: 'random',
|
|
9
11
|
description: "Used to sign realtime subscription authorization. Should generally not be changed."
|
|
10
12
|
});
|
|
11
|
-
let _server;
|
|
12
13
|
const server = () => {
|
|
13
14
|
if (_server)
|
|
14
15
|
return _server;
|
|
@@ -62,6 +63,7 @@ const server = () => {
|
|
|
62
63
|
export class RealtimeService extends Resource {
|
|
63
64
|
constructor(scope, id) {
|
|
64
65
|
super(scope, id);
|
|
66
|
+
secret = secret || makeSecret();
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
67
69
|
* Ensures channel name will be supported by known, major cloud provers using
|