@helyx/module-account-gate 1.0.10 → 1.0.12
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 +19 -0
- package/dist/commands.d.ts +10 -0
- package/dist/commands.js +40 -0
- package/dist/contracts.d.ts +1 -1
- package/dist/contracts.js +1 -1
- package/dist/index.js +7 -36
- package/manifest.json +2 -2
- package/migrations/0007_privacy_suppression_trigger_privileges.sql +32 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [26b4c3e]
|
|
8
|
+
- @helyx/module-manifest@0.7.0
|
|
9
|
+
- @helyx/sdk@0.8.0
|
|
10
|
+
|
|
11
|
+
## 1.0.11
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Harden dashboard authentication, privacy execution, control routing, database transactions, and self-host configuration.
|
|
16
|
+
|
|
17
|
+
Add bounded multi-value record reads and use them to batch Polls and Reaction Roles dashboard queries. Improve dashboard presentation, Forms workflows, release safety, and operational tooling across hosted and self-hosted deployments.
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @helyx/sdk@0.7.0
|
|
21
|
+
|
|
3
22
|
## 1.0.10
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandContribution, CommandInteractionContext } from "@helyx/sdk";
|
|
2
|
+
type CommandHandler = (context: CommandInteractionContext) => Promise<void>;
|
|
3
|
+
export declare function accountGateCommands(handlers: {
|
|
4
|
+
start: CommandHandler;
|
|
5
|
+
reset: CommandHandler;
|
|
6
|
+
status: CommandHandler;
|
|
7
|
+
strict: CommandHandler;
|
|
8
|
+
}): readonly CommandContribution[];
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=commands.d.ts.map
|
package/dist/commands.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export function accountGateCommands(handlers) {
|
|
2
|
+
return [
|
|
3
|
+
{
|
|
4
|
+
name: "access-control",
|
|
5
|
+
description: "Start or manage the server's Access Control checks",
|
|
6
|
+
acknowledgement: "deferred-ephemeral",
|
|
7
|
+
registration: "global",
|
|
8
|
+
contexts: ["guild"],
|
|
9
|
+
integrationTypes: ["guild_install"],
|
|
10
|
+
subcommands: [
|
|
11
|
+
{
|
|
12
|
+
name: "start",
|
|
13
|
+
description: "Start or resume your Access Control check",
|
|
14
|
+
rateLimit: { scope: "user", limit: 5, windowSeconds: 60 },
|
|
15
|
+
execute: handlers.start,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "reset",
|
|
19
|
+
description: "Revoke your access and complete the gate again",
|
|
20
|
+
permissionId: "account-gate.reset",
|
|
21
|
+
rateLimit: { scope: "user", limit: 10, windowSeconds: 60 },
|
|
22
|
+
execute: handlers.reset,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "status",
|
|
26
|
+
description: "Show Access Control health and strict-mode status",
|
|
27
|
+
permissionId: "account-gate.manage",
|
|
28
|
+
execute: handlers.status,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "strict",
|
|
32
|
+
description: "Activate temporary strict mode",
|
|
33
|
+
permissionId: "account-gate.manage",
|
|
34
|
+
execute: handlers.strict,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=commands.js.map
|
package/dist/contracts.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const ACCOUNT_GATE_IDENTITY: {
|
|
|
2
2
|
readonly packageName: "@helyx/module-account-gate";
|
|
3
3
|
readonly moduleId: "helyx.account-gate";
|
|
4
4
|
readonly name: "Access Control";
|
|
5
|
-
readonly version: "1.0.
|
|
5
|
+
readonly version: "1.0.12";
|
|
6
6
|
readonly releaseStatus: "live";
|
|
7
7
|
readonly category: "safety";
|
|
8
8
|
readonly icon: "shield-check";
|
package/dist/contracts.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import { serverQuestionResource } from "./question-resource.js";
|
|
|
13
13
|
import { gatePanelResource, getGatePanelRuntime, hasPasswordGatePanel, } from "./panel-resource.js";
|
|
14
14
|
import { isAccountGateWorkSuppressed } from "./privacy.js";
|
|
15
15
|
import { applyChallengeAction, createAccountGateSessionState, parseAccountGateSessionState, rerollForAccessibility, } from "./workflow.js";
|
|
16
|
+
import { accountGateCommands } from "./commands.js";
|
|
16
17
|
const manifest = parseModuleManifest(JSON.parse(readFileSync(new URL("../manifest.json", import.meta.url), "utf8")));
|
|
17
18
|
const VIOLET = 0x7c3aed;
|
|
18
19
|
const GREEN = 0x16a34a;
|
|
@@ -116,42 +117,12 @@ export const accountGateModule = defineModule({
|
|
|
116
117
|
],
|
|
117
118
|
},
|
|
118
119
|
interactions: {
|
|
119
|
-
commands:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
integrationTypes: ["guild_install"],
|
|
126
|
-
subcommands: [
|
|
127
|
-
{
|
|
128
|
-
name: "start",
|
|
129
|
-
description: "Start or resume your Access Control check",
|
|
130
|
-
rateLimit: { scope: "user", limit: 5, windowSeconds: 60 },
|
|
131
|
-
execute: startCheck,
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: "reset",
|
|
135
|
-
description: "Revoke your access and complete the gate again",
|
|
136
|
-
permissionId: "account-gate.reset",
|
|
137
|
-
rateLimit: { scope: "user", limit: 10, windowSeconds: 60 },
|
|
138
|
-
execute: resetOwnAccess,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: "status",
|
|
142
|
-
description: "Show Access Control health and strict-mode status",
|
|
143
|
-
permissionId: "account-gate.manage",
|
|
144
|
-
execute: showStatus,
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "strict",
|
|
148
|
-
description: "Activate temporary strict mode",
|
|
149
|
-
permissionId: "account-gate.manage",
|
|
150
|
-
execute: activateStrictModeCommand,
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
},
|
|
154
|
-
],
|
|
120
|
+
commands: accountGateCommands({
|
|
121
|
+
start: startCheck,
|
|
122
|
+
reset: resetOwnAccess,
|
|
123
|
+
status: showStatus,
|
|
124
|
+
strict: activateStrictModeCommand,
|
|
125
|
+
}),
|
|
155
126
|
buttons: [
|
|
156
127
|
{
|
|
157
128
|
customId: ACCOUNT_GATE_COMPONENTS.start,
|
package/manifest.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"releaseStatus": "live",
|
|
4
4
|
"id": "helyx.account-gate",
|
|
5
5
|
"name": "Access Control",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.12",
|
|
7
7
|
"description": "Require new members to complete configurable Discord interaction checks before gaining access.",
|
|
8
8
|
"entry": "./dist/index.js",
|
|
9
9
|
"framework": "^0.1.0",
|
|
@@ -686,7 +686,7 @@
|
|
|
686
686
|
],
|
|
687
687
|
"operations": ["list", "read", "preview", "create", "update", "delete"],
|
|
688
688
|
"creationIntents": ["draft", "publish"],
|
|
689
|
-
"publicationMode": "
|
|
689
|
+
"publicationMode": "validate_on_publish",
|
|
690
690
|
"fields": [
|
|
691
691
|
{
|
|
692
692
|
"key": "question",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
-- Privacy erasure deletes Account Gate subject rows through a deliberately
|
|
2
|
+
-- column-scoped executor role. The deletion triggers must still be able to
|
|
3
|
+
-- write the suppression tombstone that prevents erased data being recreated.
|
|
4
|
+
CREATE OR REPLACE FUNCTION public.account_gate_install_privacy_suppression()
|
|
5
|
+
RETURNS trigger
|
|
6
|
+
LANGUAGE plpgsql
|
|
7
|
+
SECURITY DEFINER
|
|
8
|
+
SET search_path = pg_catalog, public
|
|
9
|
+
AS $$
|
|
10
|
+
BEGIN
|
|
11
|
+
INSERT INTO public.account_gate_privacy_suppressions (
|
|
12
|
+
suppression_id,
|
|
13
|
+
guild_id,
|
|
14
|
+
member_user_id,
|
|
15
|
+
suppressed_at,
|
|
16
|
+
created_at
|
|
17
|
+
)
|
|
18
|
+
VALUES (
|
|
19
|
+
OLD.guild_id || ':' || OLD.member_user_id,
|
|
20
|
+
OLD.guild_id,
|
|
21
|
+
OLD.member_user_id,
|
|
22
|
+
clock_timestamp(),
|
|
23
|
+
clock_timestamp()
|
|
24
|
+
)
|
|
25
|
+
ON CONFLICT (guild_id, member_user_id)
|
|
26
|
+
DO UPDATE SET suppressed_at = GREATEST(
|
|
27
|
+
public.account_gate_privacy_suppressions.suppressed_at,
|
|
28
|
+
EXCLUDED.suppressed_at
|
|
29
|
+
);
|
|
30
|
+
RETURN OLD;
|
|
31
|
+
END;
|
|
32
|
+
$$;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helyx/module-account-gate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Require configurable Discord interaction checks before new members gain access.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"helyx",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"build": "tsc -b"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@helyx/module-manifest": ">=0.
|
|
52
|
-
"@helyx/sdk": ">=0.
|
|
51
|
+
"@helyx/module-manifest": ">=0.7.0 <0.8.0",
|
|
52
|
+
"@helyx/sdk": ">=0.8.0 <0.9.0"
|
|
53
53
|
}
|
|
54
54
|
}
|