aurival 0.2.1 → 0.4.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.
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Discord-shaped `Embed` and `Button` builders (AMENDMENT-05). Mirrors
3
+ * python's builders field for field; the wire shape and every cap sentence
4
+ * are contractual (`caps.ts`) and must not drift between the two SDKs.
5
+ *
6
+ * Two ways in: a builder chain (`new Embed().addField(...)`), validated as
7
+ * each piece is added, or a plain object literal, accepted anywhere a
8
+ * builder is (the way `mentions` already accepts a raw `{ user }`) and
9
+ * validated to the exact same sentences by `serialiseEmbeds`/
10
+ * `serialiseButtons` before it ever reaches the wire — a plain object is
11
+ * never a bypass.
12
+ *
13
+ * Decoding off the wire (`fromJSON`, used by `embedsFromWire`/
14
+ * `buttonsFromWire` in events.ts) is deliberately tolerant and never
15
+ * throws — the caps are an outbound (client -> server) contract, not an
16
+ * inbound one, and a message already stored by the server is assumed valid.
17
+ */
18
+ export interface EmbedFieldValue {
19
+ name: string;
20
+ value: string;
21
+ inline: boolean;
22
+ }
23
+ export interface EmbedAuthorValue {
24
+ name: string;
25
+ icon?: string;
26
+ }
27
+ export interface EmbedThumbnailValue {
28
+ url: string;
29
+ }
30
+ export interface EmbedImageValue {
31
+ url: string;
32
+ }
33
+ export interface EmbedFooterValue {
34
+ text: string;
35
+ }
36
+ export interface EmbedInit {
37
+ title?: string;
38
+ description?: string;
39
+ color?: string;
40
+ }
41
+ /**
42
+ * `Embed().addField(...)` builder. Every mutation is validated immediately
43
+ * (the cap sentence, thrown as a plain `Error`); `toJSON()` emits the wire
44
+ * shape, omitting absent keys and omitting `fields` when empty.
45
+ */
46
+ export declare class Embed {
47
+ #private;
48
+ title?: string;
49
+ description?: string;
50
+ color?: string;
51
+ author?: EmbedAuthorValue;
52
+ thumbnail?: EmbedThumbnailValue;
53
+ image?: EmbedImageValue;
54
+ fields: EmbedFieldValue[];
55
+ footer?: EmbedFooterValue;
56
+ timestamp?: string;
57
+ constructor(init?: EmbedInit);
58
+ /** Refuses the 7th field on ONE embed — the whole-message cap (summed across embeds) is enforced by `serialiseEmbeds`. */
59
+ addField(name: string, value: string, inline?: boolean): this;
60
+ setAuthor(name: string, icon?: string): this;
61
+ setThumbnail(url: string): this;
62
+ setImage(url: string): this;
63
+ setFooter(text: string): this;
64
+ /** A `Date` becomes UTC RFC3339 (`Z`); a string is assumed already in that form. */
65
+ setTimestamp(value: Date | string): this;
66
+ toJSON(): Record<string, unknown>;
67
+ /**
68
+ * Tolerant decode — never throws, never validates. Used both for wire
69
+ * messages (already server-validated) and to normalise a plain object
70
+ * literal before `serialiseEmbeds` validates it for real. Unknown
71
+ * top-level keys are preserved so a round trip is lossless.
72
+ */
73
+ static fromJSON(data: unknown): Embed;
74
+ }
75
+ export interface ButtonInit {
76
+ label: string;
77
+ id?: string;
78
+ style?: string;
79
+ }
80
+ /** `new Button({ label: 'Pacific' })` — `id` defaults to a slug of `label`, `style` defaults to `'primary'`. */
81
+ export declare class Button {
82
+ label: string;
83
+ id: string;
84
+ style: string;
85
+ constructor(init: ButtonInit);
86
+ toJSON(): Record<string, unknown>;
87
+ /** Tolerant decode — never throws. See `Embed.fromJSON` for why. */
88
+ static fromJSON(data: unknown): Button;
89
+ }
90
+ export interface ButtonUsed {
91
+ button: string;
92
+ user: string;
93
+ at: string;
94
+ }
95
+ /** `null` for both an absent key and a JSON `null` — a message's `button_used` is never `undefined`. */
96
+ export declare function buttonUsedFromWire(value: unknown): ButtonUsed | null;
97
+ /** `[]` for both an absent key and a JSON `null` — `Message.embeds` is never `null`/`undefined`. */
98
+ export declare function embedsFromWire(value: unknown): Embed[];
99
+ /** `[]` for both an absent key and a JSON `null` — `Message.buttons` is never `null`/`undefined`. */
100
+ export declare function buttonsFromWire(value: unknown): Button[];
101
+ export type EmbedLike = Embed | Record<string, unknown>;
102
+ export type ButtonLike = Button | Record<string, unknown>;
103
+ /**
104
+ * Validates and serialises the `embeds` a caller passed to `send`/`reply`,
105
+ * to shape (a). A plain object literal is decoded (tolerant) then validated
106
+ * exactly as a builder is — never a bypass. `[]` when `embeds` is absent or
107
+ * empty, so the caller omits the key.
108
+ */
109
+ export declare function serialiseEmbeds(embeds: ReadonlyArray<EmbedLike> | undefined): Record<string, unknown>[];
110
+ /**
111
+ * Validates and serialises the `buttons` a caller passed to `send`/`reply`.
112
+ * `[]` when `buttons` is absent or empty, so the caller omits the key.
113
+ */
114
+ export declare function serialiseButtons(buttons: ReadonlyArray<ButtonLike> | undefined): Record<string, unknown>[];
115
+ //# sourceMappingURL=embeds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embeds.d.ts","sourceRoot":"","sources":["../src/embeds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA0CH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,qBAAa,KAAK;;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,SAAS,CAAC,EAA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CACF;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,wGAAwG;AACxG,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAQpE;AAED,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,CAGtD;AAED,qGAAqG;AACrG,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAGxD;AAED,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,SAAS,GAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAU3B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,SAAS,GAC7C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAa3B"}
package/dist/embeds.js ADDED
@@ -0,0 +1,308 @@
1
+ /**
2
+ * Discord-shaped `Embed` and `Button` builders (AMENDMENT-05). Mirrors
3
+ * python's builders field for field; the wire shape and every cap sentence
4
+ * are contractual (`caps.ts`) and must not drift between the two SDKs.
5
+ *
6
+ * Two ways in: a builder chain (`new Embed().addField(...)`), validated as
7
+ * each piece is added, or a plain object literal, accepted anywhere a
8
+ * builder is (the way `mentions` already accepts a raw `{ user }`) and
9
+ * validated to the exact same sentences by `serialiseEmbeds`/
10
+ * `serialiseButtons` before it ever reaches the wire — a plain object is
11
+ * never a bypass.
12
+ *
13
+ * Decoding off the wire (`fromJSON`, used by `embedsFromWire`/
14
+ * `buttonsFromWire` in events.ts) is deliberately tolerant and never
15
+ * throws — the caps are an outbound (client -> server) contract, not an
16
+ * inbound one, and a message already stored by the server is assumed valid.
17
+ */
18
+ import { BUTTON_STYLES, CAP_BAD_BUTTON_STYLE, CAP_BUTTON_ID_TOO_LONG, CAP_DESCRIPTION_TOO_LONG, CAP_DUPLICATE_BUTTON_ID, CAP_IMAGE_URL_NOT_HTTPS, CAP_LABEL_TOO_LONG, CAP_LINK_STYLE_DEFERRED, CAP_TITLE_TOO_LONG, CAP_TOO_MANY_BUTTONS, CAP_TOO_MANY_EMBEDS, CAP_TOO_MANY_FIELDS, MAX_BUTTON_ID_LENGTH, MAX_BUTTONS, MAX_DESCRIPTION_LENGTH, MAX_EMBED_FIELDS, MAX_EMBEDS, MAX_LABEL_RUNES, MAX_TITLE_LENGTH, } from './caps.js';
19
+ function asRecord(value) {
20
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
21
+ ? value
22
+ : null;
23
+ }
24
+ function asOptionalString(value) {
25
+ return typeof value === 'string' ? value : undefined;
26
+ }
27
+ function graphemeLength(text) {
28
+ return [...text].length;
29
+ }
30
+ function requireHttps(url) {
31
+ if (!url.startsWith('https://'))
32
+ throw new Error(CAP_IMAGE_URL_NOT_HTTPS);
33
+ }
34
+ /**
35
+ * `Embed().addField(...)` builder. Every mutation is validated immediately
36
+ * (the cap sentence, thrown as a plain `Error`); `toJSON()` emits the wire
37
+ * shape, omitting absent keys and omitting `fields` when empty.
38
+ */
39
+ export class Embed {
40
+ title;
41
+ description;
42
+ color;
43
+ author;
44
+ thumbnail;
45
+ image;
46
+ fields = [];
47
+ footer;
48
+ timestamp;
49
+ #extra = {};
50
+ constructor(init = {}) {
51
+ if (init.title !== undefined) {
52
+ if (init.title.length > MAX_TITLE_LENGTH)
53
+ throw new Error(CAP_TITLE_TOO_LONG);
54
+ this.title = init.title;
55
+ }
56
+ if (init.description !== undefined) {
57
+ if (init.description.length > MAX_DESCRIPTION_LENGTH) {
58
+ throw new Error(CAP_DESCRIPTION_TOO_LONG);
59
+ }
60
+ this.description = init.description;
61
+ }
62
+ if (init.color !== undefined)
63
+ this.color = init.color;
64
+ }
65
+ /** Refuses the 7th field on ONE embed — the whole-message cap (summed across embeds) is enforced by `serialiseEmbeds`. */
66
+ addField(name, value, inline = false) {
67
+ if (this.fields.length >= MAX_EMBED_FIELDS)
68
+ throw new Error(CAP_TOO_MANY_FIELDS);
69
+ this.fields.push({ name, value, inline });
70
+ return this;
71
+ }
72
+ setAuthor(name, icon) {
73
+ if (icon !== undefined) {
74
+ requireHttps(icon);
75
+ this.author = { name, icon };
76
+ }
77
+ else {
78
+ this.author = { name };
79
+ }
80
+ return this;
81
+ }
82
+ setThumbnail(url) {
83
+ requireHttps(url);
84
+ this.thumbnail = { url };
85
+ return this;
86
+ }
87
+ setImage(url) {
88
+ requireHttps(url);
89
+ this.image = { url };
90
+ return this;
91
+ }
92
+ setFooter(text) {
93
+ this.footer = { text };
94
+ return this;
95
+ }
96
+ /** A `Date` becomes UTC RFC3339 (`Z`); a string is assumed already in that form. */
97
+ setTimestamp(value) {
98
+ this.timestamp = value instanceof Date ? value.toISOString() : value;
99
+ return this;
100
+ }
101
+ toJSON() {
102
+ const out = { ...this.#extra };
103
+ if (this.title !== undefined)
104
+ out['title'] = this.title;
105
+ if (this.description !== undefined)
106
+ out['description'] = this.description;
107
+ if (this.color !== undefined)
108
+ out['color'] = this.color;
109
+ if (this.author !== undefined)
110
+ out['author'] = this.author;
111
+ if (this.thumbnail !== undefined)
112
+ out['thumbnail'] = this.thumbnail;
113
+ if (this.image !== undefined)
114
+ out['image'] = this.image;
115
+ if (this.fields.length > 0)
116
+ out['fields'] = this.fields;
117
+ if (this.footer !== undefined)
118
+ out['footer'] = this.footer;
119
+ if (this.timestamp !== undefined)
120
+ out['timestamp'] = this.timestamp;
121
+ return out;
122
+ }
123
+ /**
124
+ * Tolerant decode — never throws, never validates. Used both for wire
125
+ * messages (already server-validated) and to normalise a plain object
126
+ * literal before `serialiseEmbeds` validates it for real. Unknown
127
+ * top-level keys are preserved so a round trip is lossless.
128
+ */
129
+ static fromJSON(data) {
130
+ const record = asRecord(data) ?? {};
131
+ const { title, description, color, author, thumbnail, image, fields, footer, timestamp, ...rest } = record;
132
+ const embed = new Embed();
133
+ const titleStr = asOptionalString(title);
134
+ if (titleStr !== undefined)
135
+ embed.title = titleStr;
136
+ const descriptionStr = asOptionalString(description);
137
+ if (descriptionStr !== undefined)
138
+ embed.description = descriptionStr;
139
+ const colorStr = asOptionalString(color);
140
+ if (colorStr !== undefined)
141
+ embed.color = colorStr;
142
+ const authorRecord = asRecord(author);
143
+ if (authorRecord) {
144
+ const name = asOptionalString(authorRecord['name']) ?? '';
145
+ const icon = asOptionalString(authorRecord['icon']);
146
+ embed.author = icon !== undefined ? { name, icon } : { name };
147
+ }
148
+ const thumbnailRecord = asRecord(thumbnail);
149
+ const thumbnailUrl = thumbnailRecord ? asOptionalString(thumbnailRecord['url']) : undefined;
150
+ if (thumbnailUrl !== undefined)
151
+ embed.thumbnail = { url: thumbnailUrl };
152
+ const imageRecord = asRecord(image);
153
+ const imageUrl = imageRecord ? asOptionalString(imageRecord['url']) : undefined;
154
+ if (imageUrl !== undefined)
155
+ embed.image = { url: imageUrl };
156
+ const footerRecord = asRecord(footer);
157
+ const footerText = footerRecord ? asOptionalString(footerRecord['text']) : undefined;
158
+ if (footerText !== undefined)
159
+ embed.footer = { text: footerText };
160
+ const timestampStr = asOptionalString(timestamp);
161
+ if (timestampStr !== undefined)
162
+ embed.timestamp = timestampStr;
163
+ if (Array.isArray(fields)) {
164
+ for (const raw of fields) {
165
+ const fieldRecord = asRecord(raw);
166
+ if (!fieldRecord)
167
+ continue;
168
+ embed.fields.push({
169
+ name: asOptionalString(fieldRecord['name']) ?? '',
170
+ value: asOptionalString(fieldRecord['value']) ?? '',
171
+ inline: fieldRecord['inline'] === true,
172
+ });
173
+ }
174
+ }
175
+ embed.#extra = rest;
176
+ return embed;
177
+ }
178
+ }
179
+ /** Every cap `serialiseEmbeds` enforces on one already-decoded `Embed`, whichever path built it. */
180
+ function validateEmbedShape(embed) {
181
+ if (embed.title !== undefined && embed.title.length > MAX_TITLE_LENGTH) {
182
+ throw new Error(CAP_TITLE_TOO_LONG);
183
+ }
184
+ if (embed.description !== undefined && embed.description.length > MAX_DESCRIPTION_LENGTH) {
185
+ throw new Error(CAP_DESCRIPTION_TOO_LONG);
186
+ }
187
+ if (embed.author?.icon !== undefined && !embed.author.icon.startsWith('https://')) {
188
+ throw new Error(CAP_IMAGE_URL_NOT_HTTPS);
189
+ }
190
+ if (embed.thumbnail !== undefined && !embed.thumbnail.url.startsWith('https://')) {
191
+ throw new Error(CAP_IMAGE_URL_NOT_HTTPS);
192
+ }
193
+ if (embed.image !== undefined && !embed.image.url.startsWith('https://')) {
194
+ throw new Error(CAP_IMAGE_URL_NOT_HTTPS);
195
+ }
196
+ if (embed.fields.length > MAX_EMBED_FIELDS)
197
+ throw new Error(CAP_TOO_MANY_FIELDS);
198
+ }
199
+ function slugify(label) {
200
+ const slug = label
201
+ .toLowerCase()
202
+ .replace(/[^a-z0-9]+/g, '-')
203
+ .replace(/^-+|-+$/g, '');
204
+ return slug.length > MAX_BUTTON_ID_LENGTH
205
+ ? slug.slice(0, MAX_BUTTON_ID_LENGTH).replace(/-+$/g, '')
206
+ : slug;
207
+ }
208
+ function validateButtonShape(button) {
209
+ if (graphemeLength(button.label) > MAX_LABEL_RUNES)
210
+ throw new Error(CAP_LABEL_TOO_LONG);
211
+ if (button.id.length > MAX_BUTTON_ID_LENGTH)
212
+ throw new Error(CAP_BUTTON_ID_TOO_LONG);
213
+ if (button.style === 'link')
214
+ throw new Error(CAP_LINK_STYLE_DEFERRED);
215
+ if (!BUTTON_STYLES.includes(button.style)) {
216
+ throw new Error(CAP_BAD_BUTTON_STYLE);
217
+ }
218
+ }
219
+ /** `new Button({ label: 'Pacific' })` — `id` defaults to a slug of `label`, `style` defaults to `'primary'`. */
220
+ export class Button {
221
+ label;
222
+ id;
223
+ style;
224
+ constructor(init) {
225
+ this.label = init.label;
226
+ this.style = init.style ?? 'primary';
227
+ this.id = init.id ?? slugify(init.label);
228
+ validateButtonShape(this);
229
+ }
230
+ toJSON() {
231
+ return { id: this.id, label: this.label, style: this.style };
232
+ }
233
+ /** Tolerant decode — never throws. See `Embed.fromJSON` for why. */
234
+ static fromJSON(data) {
235
+ const record = asRecord(data) ?? {};
236
+ const label = asOptionalString(record['label']) ?? '';
237
+ const id = asOptionalString(record['id']);
238
+ const style = asOptionalString(record['style']);
239
+ const button = Object.create(Button.prototype);
240
+ button.label = label;
241
+ button.style = style ?? 'primary';
242
+ button.id = id ?? slugify(label);
243
+ return button;
244
+ }
245
+ }
246
+ /** `null` for both an absent key and a JSON `null` — a message's `button_used` is never `undefined`. */
247
+ export function buttonUsedFromWire(value) {
248
+ const record = asRecord(value);
249
+ if (!record)
250
+ return null;
251
+ return {
252
+ button: asOptionalString(record['button']) ?? '',
253
+ user: asOptionalString(record['user']) ?? '',
254
+ at: asOptionalString(record['at']) ?? '',
255
+ };
256
+ }
257
+ /** `[]` for both an absent key and a JSON `null` — `Message.embeds` is never `null`/`undefined`. */
258
+ export function embedsFromWire(value) {
259
+ if (!Array.isArray(value))
260
+ return [];
261
+ return value.map((entry) => Embed.fromJSON(entry));
262
+ }
263
+ /** `[]` for both an absent key and a JSON `null` — `Message.buttons` is never `null`/`undefined`. */
264
+ export function buttonsFromWire(value) {
265
+ if (!Array.isArray(value))
266
+ return [];
267
+ return value.map((entry) => Button.fromJSON(entry));
268
+ }
269
+ /**
270
+ * Validates and serialises the `embeds` a caller passed to `send`/`reply`,
271
+ * to shape (a). A plain object literal is decoded (tolerant) then validated
272
+ * exactly as a builder is — never a bypass. `[]` when `embeds` is absent or
273
+ * empty, so the caller omits the key.
274
+ */
275
+ export function serialiseEmbeds(embeds) {
276
+ if (embeds === undefined || embeds.length === 0)
277
+ return [];
278
+ if (embeds.length > MAX_EMBEDS)
279
+ throw new Error(CAP_TOO_MANY_EMBEDS);
280
+ const normalised = embeds.map((entry) => entry instanceof Embed ? entry : Embed.fromJSON(entry));
281
+ for (const embed of normalised)
282
+ validateEmbedShape(embed);
283
+ const totalFields = normalised.reduce((sum, embed) => sum + embed.fields.length, 0);
284
+ if (totalFields > MAX_EMBED_FIELDS)
285
+ throw new Error(CAP_TOO_MANY_FIELDS);
286
+ return normalised.map((embed) => embed.toJSON());
287
+ }
288
+ /**
289
+ * Validates and serialises the `buttons` a caller passed to `send`/`reply`.
290
+ * `[]` when `buttons` is absent or empty, so the caller omits the key.
291
+ */
292
+ export function serialiseButtons(buttons) {
293
+ if (buttons === undefined || buttons.length === 0)
294
+ return [];
295
+ if (buttons.length > MAX_BUTTONS)
296
+ throw new Error(CAP_TOO_MANY_BUTTONS);
297
+ const normalised = buttons.map((entry) => entry instanceof Button ? entry : Button.fromJSON(entry));
298
+ for (const button of normalised)
299
+ validateButtonShape(button);
300
+ const seen = new Set();
301
+ for (const button of normalised) {
302
+ if (seen.has(button.id))
303
+ throw new Error(CAP_DUPLICATE_BUTTON_ID);
304
+ seen.add(button.id);
305
+ }
306
+ return normalised.map((button) => button.toJSON());
307
+ }
308
+ //# sourceMappingURL=embeds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embeds.js","sourceRoot":"","sources":["../src/embeds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,SAAS,QAAQ,C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AW,GAAG,gBAAgB;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACzE,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA8C;IAE9C,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC7D,IAAI,OAAO,CAAC,MAAM,GAAG,WAAW;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACvC,KAAK,YAAY,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CACzD,CAAC;IACF,KAAK,MAAM,MAAM,IAAI,UAAU;QAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC7D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAClE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AACrD,CAAC"}
package/dist/errors.d.ts CHANGED
@@ -132,6 +132,57 @@ export declare class BotPlaygroundOnly extends PermissionDeniedError {
132
132
  /** `message_not_yours` — 403, `edit()`/`delete()` only work on the bot's own messages. */
133
133
  export declare class MessageNotYours extends PermissionDeniedError {
134
134
  }
135
+ /** `too_many_embeds` — a message carries more than `MAX_EMBEDS` embeds. */
136
+ export declare class TooManyEmbeds extends InvalidRequestError {
137
+ }
138
+ /** `too_many_embed_fields` — one embed carries more than `MAX_EMBED_FIELDS` fields. */
139
+ export declare class TooManyEmbedFields extends InvalidRequestError {
140
+ }
141
+ /** `too_many_buttons` — a message carries more than `MAX_BUTTONS` buttons. */
142
+ export declare class TooManyButtons extends InvalidRequestError {
143
+ }
144
+ /** `button_missing_field` — a button is missing a field it needs to be rendered or pressed. */
145
+ export declare class ButtonMissingField extends InvalidRequestError {
146
+ }
147
+ /** `button_id_too_long` — a button id is longer than `MAX_BUTTON_ID_LENGTH`. */
148
+ export declare class ButtonIDTooLong extends InvalidRequestError {
149
+ }
150
+ /** `duplicate_button_id` — two buttons in the same message share an id. Button ids must be unique within a message. */
151
+ export declare class DuplicateButtonID extends InvalidRequestError {
152
+ }
153
+ /** `button_label_too_long` — a button label is longer than `MAX_LABEL_RUNES`. */
154
+ export declare class ButtonLabelTooLong extends InvalidRequestError {
155
+ }
156
+ /** `link_button_not_supported` — link-style buttons are not supported in v1. */
157
+ export declare class LinkButtonNotSupported extends InvalidRequestError {
158
+ }
159
+ /** `invalid_button_style` — a button's style is not one of `BUTTON_STYLES`. */
160
+ export declare class InvalidButtonStyle extends InvalidRequestError {
161
+ }
162
+ /** `embed_title_too_long` — an embed title is longer than `MAX_TITLE_LENGTH`. */
163
+ export declare class EmbedTitleTooLong extends InvalidRequestError {
164
+ }
165
+ /** `embed_description_too_long` — an embed description is longer than `MAX_DESCRIPTION_LENGTH`. */
166
+ export declare class EmbedDescriptionTooLong extends InvalidRequestError {
167
+ }
168
+ /** `embed_url_not_https` — an embed image url does not start with `https://`. */
169
+ export declare class EmbedURLNotHTTPS extends InvalidRequestError {
170
+ }
171
+ /**
172
+ * `embed_empty` — an embed carries none of a title, a description, a field or
173
+ * a footer. A colour on its own is a coloured rectangle, not a message.
174
+ */
175
+ export declare class EmbedEmpty extends InvalidRequestError {
176
+ }
177
+ /** `buttons_without_message` — buttons were sent with nothing under them. Send text, embeds, or both alongside them. */
178
+ export declare class ButtonsWithoutMessage extends InvalidRequestError {
179
+ }
180
+ /**
181
+ * `button_already_used` — a row of actions is spent once a button on it has
182
+ * been pressed; send a new message for another press.
183
+ */
184
+ export declare class ButtonAlreadyUsed extends InvalidRequestError {
185
+ }
135
186
  export declare class RateLimited extends RateLimitError {
136
187
  }
137
188
  export declare class PairRateLimited extends RateLimitError {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2CAA2C;AAC3C,qBAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED,4EAA4E;AAC5E,qBAAa,cAAe,SAAQ,YAAY;CAAG;AAEnD,4EAA4E;AAC5E,qBAAa,aAAc,SAAQ,YAAY;CAAG;AAElD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,2EAA2E;AAC3E,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAA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GAGG;AACH,qBAAa,iBAAkB,SAAQ,mBAAmB;CAAG;AAE7D,qBAAa,WAAY,SAAQ,cAAc;CAAG;AAClD,qBAAa,eAAgB,SAAQ,cAAc;CAAG;AACtD,qBAAa,eAAgB,SAAQ,cAAc;CAAG;AAEtD,qBAAa,aAAc,SAAQ,QAAQ;CAAG;AAC9C,qBAAa,gBAAiB,SAAQ,QAAQ;CAAG;AACjD,qBAAa,WAAY,SAAQ,QAAQ;CAAG;AAE5C,eAAO,MAAM,cAAc,0CAA0C,CAAC;AAEtE,MAAM,MAAM,oBAAoB,GAAG,KAAK,IAAI,EAAE,mBAAmB,KAAK,eAAe,CAAC;AAEtF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAMvE,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAsDvE,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAYD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,GAAE,mBAAwB,GAChC,eAAe,CAoBjB"}
package/dist/errors.js CHANGED
@@ -136,6 +136,60 @@ export class BotPlaygroundOnly extends PermissionDeniedError {
136
136
  /** `message_not_yours` — 403, `edit()`/`delete()` only work on the bot's own messages. */
137
137
  export class MessageNotYours extends PermissionDeniedError {
138
138
  }
139
+ // AMENDMENT-05 §2. The card's caps and per-field refusals — every one a 400,
140
+ // and every sentence quotes card.go's CapTemplate* constants (mirrored in
141
+ // caps.ts) so a cap cannot move in the validator without moving here too.
142
+ /** `too_many_embeds` — a message carries more than `MAX_EMBEDS` embeds. */
143
+ export class TooManyEmbeds extends InvalidRequestError {
144
+ }
145
+ /** `too_many_embed_fields` — one embed carries more than `MAX_EMBED_FIELDS` fields. */
146
+ export class TooManyEmbedFields extends InvalidRequestError {
147
+ }
148
+ /** `too_many_buttons` — a message carries more than `MAX_BUTTONS` buttons. */
149
+ export class TooManyButtons extends InvalidRequestError {
150
+ }
151
+ /** `button_missing_field` — a button is missing a field it needs to be rendered or pressed. */
152
+ export class ButtonMissingField extends InvalidRequestError {
153
+ }
154
+ /** `button_id_too_long` — a button id is longer than `MAX_BUTTON_ID_LENGTH`. */
155
+ export class ButtonIDTooLong extends InvalidRequestError {
156
+ }
157
+ /** `duplicate_button_id` — two buttons in the same message share an id. Button ids must be unique within a message. */
158
+ export class DuplicateButtonID extends InvalidRequestError {
159
+ }
160
+ /** `button_label_too_long` — a button label is longer than `MAX_LABEL_RUNES`. */
161
+ export class ButtonLabelTooLong extends InvalidRequestError {
162
+ }
163
+ /** `link_button_not_supported` — link-style buttons are not supported in v1. */
164
+ export class LinkButtonNotSupported extends InvalidRequestError {
165
+ }
166
+ /** `invalid_button_style` — a button's style is not one of `BUTTON_STYLES`. */
167
+ export class InvalidButtonStyle extends InvalidRequestError {
168
+ }
169
+ /** `embed_title_too_long` — an embed title is longer than `MAX_TITLE_LENGTH`. */
170
+ export class EmbedTitleTooLong extends InvalidRequestError {
171
+ }
172
+ /** `embed_description_too_long` — an embed description is longer than `MAX_DESCRIPTION_LENGTH`. */
173
+ export class EmbedDescriptionTooLong extends InvalidRequestError {
174
+ }
175
+ /** `embed_url_not_https` — an embed image url does not start with `https://`. */
176
+ export class EmbedURLNotHTTPS extends InvalidRequestError {
177
+ }
178
+ /**
179
+ * `embed_empty` — an embed carries none of a title, a description, a field or
180
+ * a footer. A colour on its own is a coloured rectangle, not a message.
181
+ */
182
+ export class EmbedEmpty extends InvalidRequestError {
183
+ }
184
+ /** `buttons_without_message` — buttons were sent with nothing under them. Send text, embeds, or both alongside them. */
185
+ export class ButtonsWithoutMessage extends InvalidRequestError {
186
+ }
187
+ /**
188
+ * `button_already_used` — a row of actions is spent once a button on it has
189
+ * been pressed; send a new message for another press.
190
+ */
191
+ export class ButtonAlreadyUsed extends InvalidRequestError {
192
+ }
139
193
  export class RateLimited extends RateLimitError {
140
194
  }
141
195
  export class PairRateLimited extends RateLimitError {
@@ -195,6 +249,21 @@ export const CODE_CLASSES = {
195
249
  mention_not_member: MentionNotMember,
196
250
  mention_token_missing: MentionTokenMissing,
197
251
  message_not_yours: MessageNotYours,
252
+ too_many_embeds: TooManyEmbeds,
253
+ too_many_embed_fields: TooManyEmbedFields,
254
+ too_many_buttons: TooManyButtons,
255
+ button_missing_field: ButtonMissingField,
256
+ button_id_too_long: ButtonIDTooLong,
257
+ duplicate_button_id: DuplicateButtonID,
258
+ button_label_too_long: ButtonLabelTooLong,
259
+ link_button_not_supported: LinkButtonNotSupported,
260
+ invalid_button_style: InvalidButtonStyle,
261
+ embed_title_too_long: EmbedTitleTooLong,
262
+ embed_description_too_long: EmbedDescriptionTooLong,
263
+ embed_url_not_https: EmbedURLNotHTTPS,
264
+ embed_empty: EmbedEmpty,
265
+ buttons_without_message: ButtonsWithoutMessage,
266
+ button_already_used: ButtonAlreadyUsed,
198
267
  };
199
268
  function asString(value) {
200
269
  return typeof value === 'string' ? value : null;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2CAA2C;AAC3C,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAED,4EAA4E;AAC5E,MAAM,OAAO,cAAe,SAAQ,YAAY;CAAG;AAEnD,4EAA4E;AAC5E,MAAM,OAAO,aAAc,SAAQ,YAAY;CAAG;AAYlD,2EAA2E;AAC3E,MAAM,OAAO,eAAgB,SAAQ,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