@helyx/bot 0.6.3 → 1.0.1
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Report applied global module availability state through the hosted control interface.
|
|
8
|
+
|
|
9
|
+
## 1.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- Replace the accumulated development migration chains with independently owned
|
|
14
|
+
day-zero baselines for the Clean Sweep release. Existing installations must use
|
|
15
|
+
the documented backup-and-reset protocol before installing this release.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @helyx/database@2.0.0
|
|
21
|
+
- @helyx/platform@1.0.0
|
|
22
|
+
|
|
3
23
|
## 0.6.3
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/control-server.js
CHANGED
|
@@ -1048,7 +1048,7 @@ export class BotControlService {
|
|
|
1048
1048
|
return module;
|
|
1049
1049
|
}
|
|
1050
1050
|
listAvailabilityModules() {
|
|
1051
|
-
return availabilityCatalogue(this.#availabilityModules, this.#statusModules);
|
|
1051
|
+
return availabilityCatalogue(this.#availabilityModules, this.#statusModules, moduleAvailabilityService(this.#services));
|
|
1052
1052
|
}
|
|
1053
1053
|
async #requireModuleAvailable(moduleIdValue) {
|
|
1054
1054
|
const availability = moduleAvailabilityService(this.#services);
|
|
@@ -10,11 +10,19 @@ export interface AvailabilityModuleCatalogue {
|
|
|
10
10
|
modules: AvailabilityModuleDefinition[];
|
|
11
11
|
statusCatalogueDigest?: string;
|
|
12
12
|
statusModules?: AvailabilityModuleDefinition[];
|
|
13
|
+
runtimeStates?: AvailabilityModuleRuntimeState[];
|
|
14
|
+
}
|
|
15
|
+
export interface AvailabilityModuleRuntimeState {
|
|
16
|
+
moduleId: string;
|
|
17
|
+
globallyDisabled: boolean;
|
|
18
|
+
revision: string;
|
|
19
|
+
generation: string;
|
|
20
|
+
updatedAt: string | null;
|
|
13
21
|
}
|
|
14
22
|
export declare function availabilityCatalogueDefinitions(modules: readonly ModuleDefinition[]): AvailabilityModuleDefinition[];
|
|
15
23
|
export declare function statusCatalogueDefinitions(modules: readonly ModuleDefinition[]): AvailabilityModuleDefinition[];
|
|
16
24
|
export declare function availabilityCatalogueSnapshot(definitions: readonly AvailabilityModuleDefinition[], statusDefinitions?: readonly AvailabilityModuleDefinition[]): AvailabilityModuleCatalogue;
|
|
17
|
-
export declare function availabilityCatalogue(definitions: readonly AvailabilityModuleDefinition[], statusDefinitions?: readonly AvailabilityModuleDefinition[]): Promise<AvailabilityModuleCatalogue>;
|
|
25
|
+
export declare function availabilityCatalogue(definitions: readonly AvailabilityModuleDefinition[], statusDefinitions?: readonly AvailabilityModuleDefinition[], runtime?: ModuleAvailabilityService): Promise<AvailabilityModuleCatalogue>;
|
|
18
26
|
export declare function moduleAvailabilityService(services: ServiceAccess): ModuleAvailabilityService | undefined;
|
|
19
27
|
export declare function moduleAvailabilityStates(services: ServiceAccess, moduleIds: readonly string[]): Promise<ModuleAvailabilityState[]>;
|
|
20
28
|
export declare function dashboardModuleStatus(globallyDisabled: ReadonlySet<string>, moduleId: string, installation: {
|
|
@@ -35,8 +35,20 @@ export function availabilityCatalogueSnapshot(definitions, statusDefinitions = d
|
|
|
35
35
|
statusModules,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
export function availabilityCatalogue(definitions, statusDefinitions = definitions) {
|
|
39
|
-
|
|
38
|
+
export function availabilityCatalogue(definitions, statusDefinitions = definitions, runtime) {
|
|
39
|
+
const catalogue = availabilityCatalogueSnapshot(definitions, statusDefinitions);
|
|
40
|
+
if (!runtime)
|
|
41
|
+
return Promise.resolve(catalogue);
|
|
42
|
+
return Promise.all(definitions.map(({ id }) => runtime.get(id))).then((states) => ({
|
|
43
|
+
...catalogue,
|
|
44
|
+
runtimeStates: states.map((state) => ({
|
|
45
|
+
moduleId: state.moduleId,
|
|
46
|
+
globallyDisabled: state.globallyDisabled,
|
|
47
|
+
revision: state.revision.toString(),
|
|
48
|
+
generation: state.generation.toString(),
|
|
49
|
+
updatedAt: state.updatedAt?.toISOString() ?? null,
|
|
50
|
+
})),
|
|
51
|
+
}));
|
|
40
52
|
}
|
|
41
53
|
export function moduleAvailabilityService(services) {
|
|
42
54
|
if (!services.has(HELYX_SERVICE_NAMES.moduleAvailability))
|
package/dist/shard-supervisor.js
CHANGED
|
@@ -277,8 +277,9 @@ export async function startShardSupervisor(environment, processEnvironment, work
|
|
|
277
277
|
commandModules = modules;
|
|
278
278
|
const availabilityModules = availabilityCatalogueDefinitions(modules);
|
|
279
279
|
const statusModules = statusCatalogueDefinitions(featureModules);
|
|
280
|
+
let runtimeAvailability;
|
|
280
281
|
const availabilityService = {
|
|
281
|
-
listAvailabilityModules: () => availabilityCatalogue(availabilityModules, statusModules),
|
|
282
|
+
listAvailabilityModules: () => availabilityCatalogue(availabilityModules, statusModules, runtimeAvailability),
|
|
282
283
|
};
|
|
283
284
|
const initialiseLeader = async () => {
|
|
284
285
|
await runLeaderStartup(database, environment, modulePackages, modules, logger);
|
|
@@ -286,6 +287,7 @@ export async function startShardSupervisor(environment, processEnvironment, work
|
|
|
286
287
|
privacyDatabase = await createPrivacyDatabase(environment, database);
|
|
287
288
|
assertStartupLeaseHealthy();
|
|
288
289
|
const services = new Map(createPlatformServices(database, publicModules, platformServiceOptions(environment, publicModules)));
|
|
290
|
+
runtimeAvailability = services.get(HELYX_SERVICE_NAMES.moduleAvailability);
|
|
289
291
|
if (numericWriteBehind)
|
|
290
292
|
services.set(HELYX_SERVICE_NAMES.numericWriteBehind, numericWriteBehind);
|
|
291
293
|
privacyService = new BotControlService(database, [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helyx/bot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Production Discord runtime for the modular Helyx platform.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"helyx",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"@helyx/config": ">=1.0.0 <2.0.0",
|
|
54
54
|
"@helyx/control-protocol": ">=0.4.0 <0.5.0",
|
|
55
55
|
"@helyx/core": ">=0.1.0 <0.2.0",
|
|
56
|
-
"@helyx/database": ">=
|
|
56
|
+
"@helyx/database": ">=2.0.0 <3.0.0",
|
|
57
57
|
"@helyx/framework": ">=0.1.0 <0.2.0",
|
|
58
58
|
"@helyx/module-manifest": ">=0.9.0 <0.10.0",
|
|
59
|
-
"@helyx/platform": ">=0.
|
|
59
|
+
"@helyx/platform": ">=1.0.0 <2.0.0",
|
|
60
60
|
"@helyx/sdk": ">=0.11.0 <0.12.0",
|
|
61
61
|
"@helyx/status-client": ">=0.1.0 <0.2.0",
|
|
62
62
|
"@helyx/verification-contracts": ">=0.3.0 <0.4.0",
|