mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-11-24 07:33:12 +09:00
Move exp_reports to ES modules and declare its permissions
Same changes the other packages got in #475 and #476. The permissions move from definePermission calls into the plugin declaration, with the Permissions augmentation in messages.ts so the web build sees it. "type": "module", .js entrypoints and imports, webpack.config.cjs, and the tap tests use import with --type-strip-only. The web plugin now uses a default export function instead of the deprecated BaseWebPlugin class, like exp_roles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9ddb7b362b
commit
12ac7052a1
11 files changed
+91
-83
No files matched your search
+36
-34
@@ -1,5 +1,5 @@
|
||||
import * as lib from "@clusterio/lib";
|
||||
import * as messages from "./messages";
|
||||
import * as messages from "./messages.js";
|
||||
|
||||
declare module "@clusterio/lib" {
|
||||
export interface ControllerConfigFields {
|
||||
@@ -8,37 +8,6 @@ declare module "@clusterio/lib" {
|
||||
}
|
||||
}
|
||||
|
||||
lib.definePermission({
|
||||
name: "exp_reports.report.get",
|
||||
title: "Get Reports",
|
||||
description: "Retrieve a specific report by id.",
|
||||
grantByDefault: true,
|
||||
});
|
||||
lib.definePermission({
|
||||
name: "exp_reports.report.list",
|
||||
title: "List Reports",
|
||||
description: "List the reports against every player, or against one player.",
|
||||
grantByDefault: true,
|
||||
});
|
||||
lib.definePermission({
|
||||
name: "exp_reports.report.subscribe",
|
||||
title: "Subscribe to Report Updates",
|
||||
description: "Receive updates when reports are made or deleted.",
|
||||
grantByDefault: true,
|
||||
});
|
||||
lib.definePermission({
|
||||
name: "exp_reports.report.create",
|
||||
title: "Create Reports",
|
||||
description: "Report a player.",
|
||||
grantByDefault: false,
|
||||
});
|
||||
lib.definePermission({
|
||||
name: "exp_reports.report.delete",
|
||||
title: "Delete Reports",
|
||||
description: "Delete reports made against a player.",
|
||||
grantByDefault: false,
|
||||
});
|
||||
|
||||
export const plugin: lib.PluginDeclaration = {
|
||||
name: "exp_reports",
|
||||
title: "ExpGaming - Reports",
|
||||
@@ -58,9 +27,42 @@ export const plugin: lib.PluginDeclaration = {
|
||||
messages.ReportDeleteRequest,
|
||||
],
|
||||
|
||||
instanceEntrypoint: "./dist/node/instance",
|
||||
permissions: [
|
||||
{
|
||||
name: "exp_reports.report.get",
|
||||
title: "Get Reports",
|
||||
description: "Retrieve a specific report by id.",
|
||||
grantByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "exp_reports.report.list",
|
||||
title: "List Reports",
|
||||
description: "List the reports against every player, or against one player.",
|
||||
grantByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "exp_reports.report.subscribe",
|
||||
title: "Subscribe to Report Updates",
|
||||
description: "Receive updates when reports are made or deleted.",
|
||||
grantByDefault: true,
|
||||
},
|
||||
{
|
||||
name: "exp_reports.report.create",
|
||||
title: "Create Reports",
|
||||
description: "Report a player.",
|
||||
grantByDefault: false,
|
||||
},
|
||||
{
|
||||
name: "exp_reports.report.delete",
|
||||
title: "Delete Reports",
|
||||
description: "Delete reports made against a player.",
|
||||
grantByDefault: false,
|
||||
},
|
||||
],
|
||||
|
||||
controllerEntrypoint: "./dist/node/controller",
|
||||
instanceEntrypoint: "./dist/node/instance.js",
|
||||
|
||||
controllerEntrypoint: "./dist/node/controller.js",
|
||||
controllerConfigFields: {
|
||||
"exp_reports.discord_webhook_url": {
|
||||
title: "Discord Webhook URL",
|
||||
|
||||
Reference in new issue
Block a user