@went.tf/discord-bot-framework 2.0.0 → 2.2.0

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.
Files changed (65) hide show
  1. package/README.md +113 -35
  2. package/build/.tsbuildinfo +1 -1
  3. package/build/commands/build-application-commands-body.d.ts +13 -2
  4. package/build/commands/build-application-commands-body.d.ts.map +1 -1
  5. package/build/commands/build-application-commands-body.js +42 -2
  6. package/build/commands/build-application-commands-body.js.map +1 -1
  7. package/build/commands/schema/application-command-leaf-option.schema.d.ts +9 -9
  8. package/build/commands/schema/application-command-leaf-option.schema.js +9 -9
  9. package/build/commands/schema/application-command-leaf-option.schema.js.map +1 -1
  10. package/build/commands/schema/application-command-leaf-option.schema.json +36 -9
  11. package/build/commands/schema/application-command-subcommand-group.schema.d.ts +1 -1
  12. package/build/commands/schema/application-command-subcommand-group.schema.js +1 -1
  13. package/build/commands/schema/application-command-subcommand-group.schema.js.map +1 -1
  14. package/build/commands/schema/application-command-subcommand-group.schema.json +4 -1
  15. package/build/commands/schema/application-command-subcommand.schema.d.ts +1 -1
  16. package/build/commands/schema/application-command-subcommand.schema.js +1 -1
  17. package/build/commands/schema/application-command-subcommand.schema.js.map +1 -1
  18. package/build/commands/schema/application-command-subcommand.schema.json +4 -1
  19. package/build/commands/schema/application-command-type.schema.d.ts +2 -2
  20. package/build/commands/schema/application-command-type.schema.d.ts.map +1 -1
  21. package/build/commands/schema/application-command-type.schema.js +2 -2
  22. package/build/commands/schema/application-command-type.schema.js.map +1 -1
  23. package/build/commands/schema/application-command-type.schema.json +5 -2
  24. package/build/commands/schema/application-integration-type.schema.d.ts +2 -2
  25. package/build/commands/schema/application-integration-type.schema.d.ts.map +1 -1
  26. package/build/commands/schema/application-integration-type.schema.js +2 -2
  27. package/build/commands/schema/application-integration-type.schema.js.map +1 -1
  28. package/build/commands/schema/application-integration-type.schema.json +4 -2
  29. package/build/commands/schema/channel-type.schema.d.ts +2 -2
  30. package/build/commands/schema/channel-type.schema.d.ts.map +1 -1
  31. package/build/commands/schema/channel-type.schema.js +6 -2
  32. package/build/commands/schema/channel-type.schema.js.map +1 -1
  33. package/build/commands/schema/channel-type.schema.json +12 -2
  34. package/build/commands/schema/chat-input-command.schema.d.ts +1 -1
  35. package/build/commands/schema/chat-input-command.schema.js +1 -1
  36. package/build/commands/schema/chat-input-command.schema.js.map +1 -1
  37. package/build/commands/schema/chat-input-command.schema.json +4 -1
  38. package/build/commands/schema/command-file-entry.schema.d.ts +16 -0
  39. package/build/commands/schema/command-file-entry.schema.d.ts.map +1 -0
  40. package/build/commands/schema/command-file-entry.schema.js +14 -0
  41. package/build/commands/schema/command-file-entry.schema.js.map +1 -0
  42. package/build/commands/schema/command-file-entry.schema.json +11 -0
  43. package/build/commands/schema/commands-file.schema.d.ts +38 -12
  44. package/build/commands/schema/commands-file.schema.d.ts.map +1 -1
  45. package/build/commands/schema/commands-file.schema.js +30 -10
  46. package/build/commands/schema/commands-file.schema.js.map +1 -1
  47. package/build/commands/schema/commands-file.schema.json +25 -10
  48. package/build/commands/schema/context-menu-command.schema.d.ts +1 -1
  49. package/build/commands/schema/context-menu-command.schema.js +1 -1
  50. package/build/commands/schema/context-menu-command.schema.js.map +1 -1
  51. package/build/commands/schema/context-menu-command.schema.json +3 -1
  52. package/build/commands/schema/enum-maps.d.ts +52 -0
  53. package/build/commands/schema/enum-maps.d.ts.map +1 -0
  54. package/build/commands/schema/enum-maps.js +54 -0
  55. package/build/commands/schema/enum-maps.js.map +1 -0
  56. package/build/commands/schema/index.d.ts +58 -4
  57. package/build/commands/schema/index.d.ts.map +1 -1
  58. package/build/commands/schema/index.js +76 -3
  59. package/build/commands/schema/index.js.map +1 -1
  60. package/build/commands/schema/interaction-context-type.schema.d.ts +2 -2
  61. package/build/commands/schema/interaction-context-type.schema.d.ts.map +1 -1
  62. package/build/commands/schema/interaction-context-type.schema.js +2 -2
  63. package/build/commands/schema/interaction-context-type.schema.js.map +1 -1
  64. package/build/commands/schema/interaction-context-type.schema.json +5 -2
  65. package/package.json +1 -1
@@ -7,6 +7,7 @@ import { applicationCommandTypeSchema } from './application-command-type.schema.
7
7
  import { applicationIntegrationTypeSchema } from './application-integration-type.schema.js';
8
8
  import { channelTypeSchema } from './channel-type.schema.js';
9
9
  import { chatInputCommandSchema } from './chat-input-command.schema.js';
10
+ import { commandFileEntrySchema } from './command-file-entry.schema.js';
10
11
  import { commandsFileSchema } from './commands-file.schema.js';
11
12
  import { contextMenuCommandSchema } from './context-menu-command.schema.js';
12
13
  import { contextMenuNameSchema } from './context-menu-name.schema.js';
@@ -14,7 +15,8 @@ import { defaultMemberPermissionsSchema } from './default-member-permissions.sch
14
15
  import { interactionContextTypeSchema } from './interaction-context-type.schema.js';
15
16
  import { optionNameSchema } from './option-name.schema.js';
16
17
  export { parseCommandsFile } from './parse-commands-file.js';
17
- export { applicationCommandTypeSchema, interactionContextTypeSchema, applicationIntegrationTypeSchema, channelTypeSchema, optionNameSchema, contextMenuNameSchema, applicationCommandOptionChoiceSchema, defaultMemberPermissionsSchema, applicationCommandLeafOptionSchema, applicationCommandSubcommandSchema, applicationCommandSubcommandGroupSchema, applicationCommandOptionSchema, chatInputCommandSchema, contextMenuCommandSchema, commandsFileSchema, };
18
+ export { APPLICATION_COMMAND_TYPE_MAP, APPLICATION_COMMAND_OPTION_TYPE_MAP, INTERACTION_CONTEXT_TYPE_MAP, APPLICATION_INTEGRATION_TYPE_MAP, CHANNEL_TYPE_MAP, resolveEnumValue, } from './enum-maps.js';
19
+ export { applicationCommandTypeSchema, interactionContextTypeSchema, applicationIntegrationTypeSchema, channelTypeSchema, optionNameSchema, contextMenuNameSchema, applicationCommandOptionChoiceSchema, defaultMemberPermissionsSchema, applicationCommandLeafOptionSchema, applicationCommandSubcommandSchema, applicationCommandSubcommandGroupSchema, applicationCommandOptionSchema, chatInputCommandSchema, contextMenuCommandSchema, commandFileEntrySchema, commandsFileSchema, };
18
20
  /** Every fragment this package ships, in an order safe to `ajv.addSchema()` sequentially. */
19
21
  const frameworkSchemas = [
20
22
  applicationCommandTypeSchema,
@@ -31,12 +33,76 @@ const frameworkSchemas = [
31
33
  applicationCommandOptionSchema,
32
34
  chatInputCommandSchema,
33
35
  contextMenuCommandSchema,
36
+ commandFileEntrySchema,
34
37
  commandsFileSchema,
35
38
  ];
39
+ const fragmentIdByFileName = new Map(frameworkSchemas.map((s) => [s.$id.split('/').pop(), s.$id]));
40
+ /**
41
+ * Rewrites a bot's own composed commands.schema.json, replacing any `$ref`
42
+ * that points at one of this package's fragments by a relative filesystem
43
+ * path (e.g. `"../node_modules/@went.tf/discord-bot-framework/build/commands/schema/chat-input-command.json"` -
44
+ * the form an editor can resolve for autocomplete) with that fragment's
45
+ * canonical `$id` (the form `registerFrameworkSchemas` registers, which ajv
46
+ * can actually resolve). Matched by filename alone, so it works regardless
47
+ * of how deep your own commands.schema.json sits relative to `node_modules`
48
+ * - you never need to get the exact `../` count "right" for ajv's sake, only
49
+ * for the editor's. `$ref`s that don't match a known fragment filename (e.g.
50
+ * your own `#/$defs/...` refs) are left untouched.
51
+ *
52
+ * Call this on the raw parsed schema before `ajv.compile()`, after
53
+ * `registerFrameworkSchemas(ajv)`:
54
+ *
55
+ * ```ts
56
+ * import myCommandsSchemaRaw from './commands.schema.json' with { type: 'json' };
57
+ * const myCommandsSchema = resolveCommandsSchemaRefs(myCommandsSchemaRaw);
58
+ * registerFrameworkSchemas(ajv);
59
+ * const validate = ajv.compile(myCommandsSchema);
60
+ * ```
61
+ */
62
+ export function resolveCommandsSchemaRefs(schema) {
63
+ return rewriteRefs(schema);
64
+ }
65
+ function rewriteRefs(node) {
66
+ if (Array.isArray(node)) {
67
+ return node.map(rewriteRefs);
68
+ }
69
+ if (node !== null && typeof node === 'object') {
70
+ const result = {};
71
+ for (const [key, value] of Object.entries(node)) {
72
+ if (key === '$ref' && typeof value === 'string') {
73
+ const fileName = value.split('/').pop();
74
+ result[key] = fragmentIdByFileName.get(fileName) ?? value;
75
+ }
76
+ else {
77
+ result[key] = rewriteRefs(value);
78
+ }
79
+ }
80
+ return result;
81
+ }
82
+ return node;
83
+ }
36
84
  /**
37
85
  * Registers every generic fragment this package ships onto a bot's own ajv
38
- * instance, so the bot's own composed commands.schema.json can `$ref` them
39
- * by `$id`. Call this before `ajv.compile()`-ing the bot's own schema.
86
+ * instance under its canonical `$id`, so the framework's own fragments can
87
+ * `$ref` each other. Call this before `ajv.compile()`-ing the bot's own
88
+ * schema, after passing that schema through `resolveCommandsSchemaRefs()`.
89
+ *
90
+ * A fragment's `$id` (e.g. `https://schema.went.tf/discord-bot-framework/chat-input-command.json`)
91
+ * is an opaque, never-fetched identifier - not a real filesystem location -
92
+ * so it's not something an editor (VS Code, JetBrains, ...) can resolve for
93
+ * autocomplete while you hand-edit commands.schema.json, and not something
94
+ * this package tries to make ajv resolve via real filesystem/URI math either
95
+ * (an earlier version of this function tried registering fragments under
96
+ * their real `file://` location for that purpose; confirmed broken for every
97
+ * pnpm install, not just local dev, because pnpm always symlinks packages
98
+ * from its `.pnpm` virtual store into `node_modules`, and Node's ESM loader
99
+ * resolves `import.meta.url` through that symlink to the real store path -
100
+ * a path a bot's own relative `$ref` can never independently compute).
101
+ * `resolveCommandsSchemaRefs()` is the actual fix: it rewrites a bot's own
102
+ * relative-path `$ref`s to the matching fragment's canonical `$id` by
103
+ * filename, sidestepping filesystem resolution for ajv entirely while
104
+ * leaving the human-facing JSON file itself untouched (still relative paths,
105
+ * for the editor).
40
106
  */
41
107
  export function registerFrameworkSchemas(ajv) {
42
108
  for (const schema of frameworkSchemas) {
@@ -45,4 +111,11 @@ export function registerFrameworkSchemas(ajv) {
45
111
  }
46
112
  }
47
113
  }
114
+ /** Normalizes either `CommandsFile` root shape down to the flat entries array. */
115
+ export function getCommandsFileEntries(commandsFile) {
116
+ if (Array.isArray(commandsFile)) {
117
+ return commandsFile;
118
+ }
119
+ return commandsFile.commands;
120
+ }
48
121
  //# sourceMappingURL=index.js.map
@@ -1 +1 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E,CAAC;QAChC,OAAO,YAA2C,CAAC;IACrD,CAAC;IACD,OAAQ,YAA0D,CAAC,QAAQ,CAAC;AAC9E,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export declare const interactionContextTypeSchema: {
2
2
  readonly $id: "https://schema.went.tf/discord-bot-framework/interaction-context-type.json";
3
- readonly description: "InteractionContextType (discord-api-types): 0 Guild, 1 BotDM, 2 PrivateChannel.";
4
- readonly enum: readonly [0, 1, 2];
3
+ readonly description: "InteractionContextType (discord-api-types): 0/GUILD, 1/BOT_DM, 2/PRIVATE_CHANNEL. Both the numeric value and its UPPER_SNAKE_CASE string alias (see enum-maps.ts) are always valid.";
4
+ readonly enum: readonly [0, 1, 2, "GUILD", "BOT_DM", "PRIVATE_CHANNEL"];
5
5
  };
6
6
  //# sourceMappingURL=interaction-context-type.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interaction-context-type.schema.d.ts","sourceRoot":"","sources":["../../../src/commands/schema/interaction-context-type.schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;;;CAI/B,CAAC"}
1
+ {"version":3,"file":"interaction-context-type.schema.d.ts","sourceRoot":"","sources":["../../../src/commands/schema/interaction-context-type.schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;;;CAK/B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export const interactionContextTypeSchema = {
2
2
  $id: 'https://schema.went.tf/discord-bot-framework/interaction-context-type.json',
3
- description: 'InteractionContextType (discord-api-types): 0 Guild, 1 BotDM, 2 PrivateChannel.',
4
- enum: [0, 1, 2],
3
+ description: 'InteractionContextType (discord-api-types): 0/GUILD, 1/BOT_DM, 2/PRIVATE_CHANNEL. Both the numeric value and its UPPER_SNAKE_CASE string alias (see enum-maps.ts) are always valid.',
4
+ enum: [0, 1, 2, 'GUILD', 'BOT_DM', 'PRIVATE_CHANNEL'],
5
5
  };
6
6
  //# sourceMappingURL=interaction-context-type.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interaction-context-type.schema.js","sourceRoot":"","sources":["../../../src/commands/schema/interaction-context-type.schema.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,GAAG,EAAE,4EAA4E;IACjF,WAAW,EAAE,iFAAiF;IAC9F,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CACP,CAAC"}
1
+ {"version":3,"file":"interaction-context-type.schema.js","sourceRoot":"","sources":["../../../src/commands/schema/interaction-context-type.schema.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,GAAG,EAAE,4EAA4E;IACjF,WAAW,EACT,qLAAqL;IACvL,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,CAAC;CAC7C,CAAC"}
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "$id": "https://schema.went.tf/discord-bot-framework/interaction-context-type.json",
3
- "description": "InteractionContextType (discord-api-types): 0 Guild, 1 BotDM, 2 PrivateChannel.",
3
+ "description": "InteractionContextType (discord-api-types): 0/GUILD, 1/BOT_DM, 2/PRIVATE_CHANNEL. Both the numeric value and its UPPER_SNAKE_CASE string alias (see enum-maps.ts) are always valid.",
4
4
  "enum": [
5
5
  0,
6
6
  1,
7
- 2
7
+ 2,
8
+ "GUILD",
9
+ "BOT_DM",
10
+ "PRIVATE_CHANNEL"
8
11
  ]
9
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@went.tf/discord-bot-framework",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Shared framework for building Discord bots with discord.js: logging, env validation, interaction dispatch, API client, and optional Postgres/i18next helpers",
5
5
  "author": "WentTheFox <mail@went.tf> (https://github.com/WentTheFox)",
6
6
  "license": "MIT",