@helyx/module-account-gate 1.0.11 → 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 CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ## 1.0.11
4
12
 
5
13
  ### 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
@@ -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
@@ -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.11";
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
@@ -2,7 +2,7 @@ export const ACCOUNT_GATE_IDENTITY = {
2
2
  packageName: "@helyx/module-account-gate",
3
3
  moduleId: "helyx.account-gate",
4
4
  name: "Access Control",
5
- version: "1.0.11",
5
+ version: "1.0.12",
6
6
  releaseStatus: "live",
7
7
  category: "safety",
8
8
  icon: "shield-check",
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
- name: "access-control",
122
- description: "Start or manage the server's Access Control checks",
123
- registration: "global",
124
- contexts: ["guild"],
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.11",
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": "preview_confirm",
689
+ "publicationMode": "validate_on_publish",
690
690
  "fields": [
691
691
  {
692
692
  "key": "question",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helyx/module-account-gate",
3
- "version": "1.0.11",
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.6.0 <0.7.0",
52
- "@helyx/sdk": ">=0.7.0 <0.8.0"
51
+ "@helyx/module-manifest": ">=0.7.0 <0.8.0",
52
+ "@helyx/sdk": ">=0.8.0 <0.9.0"
53
53
  }
54
54
  }