discord-message-transcript 1.1.6 → 1.1.7-dev.1.2.0.8.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { CreateTranscriptOptions, ConvertTranscriptOptions, TranscriptOptions, ReturnType } from "./types/types.js";
1
+ export { CreateTranscriptOptions, ConvertTranscriptOptions, TranscriptOptions, ReturnType, CDNOptions, CDNType, MimeType } from "./types/types.js";
2
2
  export { ReturnFormat, LocalDate, TimeZone } from "discord-message-transcript-base";
3
3
  import { TextBasedChannel } from "discord.js";
4
4
  import { ConvertTranscriptOptions, CreateTranscriptOptions, OutputType, ReturnType } from "./types/types.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { ReturnType } from "./types/types.js";
1
+ export { ReturnType, CDNType } from "./types/types.js";
2
2
  export { ReturnFormat } from "discord-message-transcript-base";
3
3
  import { AttachmentBuilder } from "discord.js";
4
4
  import { Json } from "./renderers/json/json.js";
@@ -33,7 +33,11 @@ export type ConvertTranscriptOptions<T extends ReturnType> = Partial<{
33
33
  */
34
34
  watermark: boolean;
35
35
  }>;
36
- export interface TranscriptOptions<T extends ReturnType> {
36
+ export interface TranscriptOptions<T extends ReturnType, Other = unknown> {
37
+ /**
38
+ * CDN Options
39
+ */
40
+ cdnOptions: CDNOptions<Other>;
37
41
  /**
38
42
  * The name of the file to be created.
39
43
  * Default depends if is DM or Guild
@@ -135,3 +139,21 @@ export interface MapMentions {
135
139
  roles: Map<string, JsonMessageMentionsRoles>;
136
140
  users: Map<string, JsonMessageMentionsUsers>;
137
141
  }
142
+ export declare const CDNType: {
143
+ readonly CUSTOM: "CUSTOM";
144
+ readonly CLOUDFLARE: "CLOUDFLARE";
145
+ };
146
+ export type CDNType = typeof CDNType[keyof typeof CDNType];
147
+ export type MimeType = `${string}/${string}`;
148
+ export type CDNOptions<Other> = (Partial<{
149
+ includeAudio: boolean;
150
+ includeImage: boolean;
151
+ includeVideo: boolean;
152
+ includeDownloads: boolean;
153
+ }>) & ({
154
+ type: Exclude<CDNType, "CUSTOM">;
155
+ } | {
156
+ type: "CUSTOM";
157
+ customCdnResolver: (url: string, contentType: MimeType | null, other: Other) => Promise<string> | string;
158
+ other: Other;
159
+ });
@@ -5,3 +5,7 @@ export const ReturnType = {
5
5
  String: "string",
6
6
  Uploadable: "uploadable"
7
7
  };
8
+ export const CDNType = {
9
+ CUSTOM: "CUSTOM",
10
+ CLOUDFLARE: "CLOUDFLARE",
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discord-message-transcript",
3
- "version": "1.1.6",
3
+ "version": "1.1.7-dev.1.2.0.8.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -48,7 +48,7 @@
48
48
  "typescript": "^5.9.3"
49
49
  },
50
50
  "dependencies": {
51
- "discord-message-transcript-base": "^1.1.6"
51
+ "discord-message-transcript-base": "1.1.7-dev.1.2.0.8.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "discord.js": ">=14.19.0 <15"