@teever/ez-hook-effect 0.5.0 → 0.5.1

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 (56) hide show
  1. package/dist/errors/WebhookError.d.ts +295 -0
  2. package/dist/errors/WebhookError.js +322 -0
  3. package/dist/errors/WebhookError.js.map +1 -0
  4. package/dist/errors/index.d.ts +1 -0
  5. package/dist/errors/index.js +2 -0
  6. package/dist/errors/index.js.map +1 -0
  7. package/dist/index.d.ts +89 -0
  8. package/dist/layers/Config.d.ts +48 -0
  9. package/dist/layers/Config.js +166 -0
  10. package/dist/layers/Config.js.map +1 -0
  11. package/dist/layers/Default.d.ts +6 -0
  12. package/dist/layers/Default.js +9 -0
  13. package/dist/layers/Default.js.map +1 -0
  14. package/dist/layers/HttpClient.d.ts +84 -0
  15. package/dist/layers/HttpClient.js +209 -0
  16. package/dist/layers/HttpClient.js.map +1 -0
  17. package/dist/layers/index.d.ts +2 -0
  18. package/dist/layers/index.js +3 -0
  19. package/dist/layers/index.js.map +1 -0
  20. package/dist/pipes/Embed.d.ts +51 -0
  21. package/dist/pipes/Embed.js +198 -0
  22. package/dist/pipes/Embed.js.map +1 -0
  23. package/dist/pipes/Webhook.d.ts +38 -0
  24. package/dist/pipes/Webhook.js +46 -0
  25. package/dist/pipes/Webhook.js.map +1 -0
  26. package/dist/pipes/index.d.ts +2 -0
  27. package/dist/pipes/index.js +3 -0
  28. package/dist/pipes/index.js.map +1 -0
  29. package/dist/schemas/Common.d.ts +10 -0
  30. package/dist/schemas/Common.js +30 -0
  31. package/dist/schemas/Common.js.map +1 -0
  32. package/dist/schemas/Discord.d.ts +16 -0
  33. package/dist/schemas/Discord.js +19 -0
  34. package/dist/schemas/Discord.js.map +1 -0
  35. package/dist/schemas/Embed.d.ts +143 -0
  36. package/dist/schemas/Embed.js +139 -0
  37. package/dist/schemas/Embed.js.map +1 -0
  38. package/dist/schemas/Field.d.ts +24 -0
  39. package/dist/schemas/Field.js +25 -0
  40. package/dist/schemas/Field.js.map +1 -0
  41. package/dist/schemas/Webhook.d.ts +88 -0
  42. package/dist/schemas/Webhook.js +87 -0
  43. package/dist/schemas/Webhook.js.map +1 -0
  44. package/dist/schemas/index.d.ts +5 -0
  45. package/dist/schemas/index.js +6 -0
  46. package/dist/schemas/index.js.map +1 -0
  47. package/dist/services/WebhookService.d.ts +94 -0
  48. package/dist/services/WebhookService.js +116 -0
  49. package/dist/services/WebhookService.js.map +1 -0
  50. package/dist/services/index.d.ts +1 -0
  51. package/dist/services/index.js +2 -0
  52. package/dist/services/index.js.map +1 -0
  53. package/dist/utils/normalize.d.ts +1 -0
  54. package/dist/utils/normalize.js +17 -0
  55. package/dist/utils/normalize.js.map +1 -0
  56. package/package.json +3 -2
@@ -0,0 +1,51 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { ValidationError } from "../errors";
3
+ import { Author, Embed as EmbedSchema, Field, Footer, Image, Provider, Thumbnail, Video } from "../schemas";
4
+ type EmbedDraft = Partial<Schema.Schema.Type<typeof EmbedSchema>>;
5
+ export declare const addFieldImpl: (fieldOrName: Field | string, value?: string, inline?: boolean) => (d: EmbedDraft) => Effect.Effect<{
6
+ fields: Field[];
7
+ url?: string;
8
+ title?: string;
9
+ type?: "rich";
10
+ description?: string;
11
+ timestamp?: string;
12
+ color?: number;
13
+ footer?: Footer;
14
+ image?: Image;
15
+ thumbnail?: Thumbnail;
16
+ video?: Video;
17
+ provider?: Provider;
18
+ author?: Author;
19
+ }, ValidationError, never>;
20
+ export declare const buildDirect: (d: EmbedDraft) => Effect.Effect<EmbedSchema, ValidationError, never>;
21
+ export declare const addFieldDirect: (fieldOrName: Field | string, value?: string, inline?: boolean) => (d: EmbedDraft) => Effect.Effect<{
22
+ fields: Field[];
23
+ url?: string;
24
+ title?: string;
25
+ type?: "rich";
26
+ description?: string;
27
+ timestamp?: string;
28
+ color?: number;
29
+ footer?: Footer;
30
+ image?: Image;
31
+ thumbnail?: Thumbnail;
32
+ video?: Video;
33
+ provider?: Provider;
34
+ author?: Author;
35
+ }, ValidationError, never>;
36
+ export declare const make: Effect.Effect<EmbedDraft, never>;
37
+ export declare const setTitle: (title: string) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
38
+ export declare const setURL: (url: string) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
39
+ export declare const setDescription: (description: string) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
40
+ export declare const setTimestamp: (date?: Date) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
41
+ export declare const setColor: (color: number | string) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
42
+ export declare const setFooter: (footer: Footer | string, icon_url?: string, proxy_icon_url?: string) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
43
+ export declare const setImage: (image: Image | string, height?: number, width?: number) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
44
+ export declare const setThumbnail: (thumbnail: Thumbnail | string, height?: number, width?: number) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
45
+ export declare const setVideo: (video: Video | string, height?: number, width?: number) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
46
+ export declare const setProvider: (provider: Provider | string, url?: string) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
47
+ export declare const setAuthor: (author: Author | string, url?: string, icon_url?: string) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
48
+ export declare const addField: (field: Field | string, value?: string, inline?: boolean) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
49
+ export declare const setFields: (fields: ReadonlyArray<Field>) => (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<Partial<EmbedSchema>, ValidationError, never>;
50
+ export declare const build: (self: Effect.Effect<EmbedDraft, ValidationError>) => Effect.Effect<EmbedSchema, ValidationError, never>;
51
+ export {};
@@ -0,0 +1,198 @@
1
+ import { Effect, pipe, Schema } from "effect";
2
+ import { ValidationError } from "../errors";
3
+ import { Author, ColorCode, Embed as EmbedSchema, Field, Footer, Image, maxLength, Provider, Thumbnail, UrlString, Video, } from "../schemas";
4
+ import { stripUndefined } from "../utils/normalize";
5
+ const createDraft = () => ({});
6
+ const setTitleImpl = (title) => (d) => pipe(Schema.decodeUnknownEffect(maxLength(256))(title), Effect.mapError(() => ValidationError.fromIssue("title", "Title must be 256 characters or less", {
7
+ constraint: "MaxLength",
8
+ expected: "256 characters or less",
9
+ actual: title.length,
10
+ })), Effect.as({ ...d, title }));
11
+ const setURLImpl = (url) => (d) => pipe(Schema.decodeUnknownEffect(UrlString)(url), Effect.mapError(() => ValidationError.fromIssue("url", "Invalid URL", {
12
+ constraint: "URL",
13
+ expected: "valid URL",
14
+ actual: url,
15
+ })), Effect.as({ ...d, url }));
16
+ const setDescriptionImpl = (description) => (d) => pipe(Schema.decodeUnknownEffect(maxLength(4096))(description), Effect.mapError(() => ValidationError.fromIssue("description", "Description must be 4096 characters or less", {
17
+ constraint: "MaxLength",
18
+ expected: "4096 characters or less",
19
+ actual: description.length,
20
+ })), Effect.as({ ...d, description }));
21
+ const setTimestampImpl = (date) => (d) => Effect.succeed({ ...d, timestamp: (date ?? new Date()).toISOString() });
22
+ const setColorImpl = (color) => (d) => {
23
+ const colorValue = typeof color === "string" ? parseInt(color.replace("#", ""), 16) : color;
24
+ return pipe(Schema.decodeUnknownEffect(ColorCode)(colorValue), Effect.mapError(() => ValidationError.fromIssue("color", "Invalid color code (must be 0-16777215)", {
25
+ constraint: "Range",
26
+ expected: "0-16777215",
27
+ actual: colorValue,
28
+ })), Effect.as({ ...d, color: colorValue }));
29
+ };
30
+ const setFooterImpl = (footerOrText, icon_url, proxy_icon_url) => (d) => {
31
+ const footer = typeof footerOrText === "string"
32
+ ? {
33
+ text: footerOrText,
34
+ ...(icon_url === undefined ? {} : { icon_url }),
35
+ ...(proxy_icon_url === undefined ? {} : { proxy_icon_url }),
36
+ }
37
+ : (() => {
38
+ const { text, icon_url, proxy_icon_url } = footerOrText;
39
+ return {
40
+ text,
41
+ ...(icon_url === undefined ? {} : { icon_url }),
42
+ ...(proxy_icon_url === undefined ? {} : { proxy_icon_url }),
43
+ };
44
+ })();
45
+ return pipe(Schema.decodeUnknownEffect(Footer)(footer), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "footer", value: footer })), Effect.as({ ...d, footer }));
46
+ };
47
+ const setImageImpl = (imageOrUrl, height, width) => (d) => {
48
+ const image = typeof imageOrUrl === "string"
49
+ ? {
50
+ url: imageOrUrl,
51
+ ...(height === undefined ? {} : { height }),
52
+ ...(width === undefined ? {} : { width }),
53
+ }
54
+ : (() => {
55
+ const { url, proxy_url, height, width } = imageOrUrl;
56
+ return {
57
+ url,
58
+ ...(proxy_url === undefined ? {} : { proxy_url }),
59
+ ...(height === undefined ? {} : { height }),
60
+ ...(width === undefined ? {} : { width }),
61
+ };
62
+ })();
63
+ return pipe(Schema.decodeUnknownEffect(Image)(image), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "image", value: image })), Effect.as({ ...d, image }));
64
+ };
65
+ const setThumbnailImpl = (thumbnailOrUrl, height, width) => (d) => {
66
+ const thumbnail = typeof thumbnailOrUrl === "string"
67
+ ? {
68
+ url: thumbnailOrUrl,
69
+ ...(height === undefined ? {} : { height }),
70
+ ...(width === undefined ? {} : { width }),
71
+ }
72
+ : (() => {
73
+ const { url, proxy_url, height, width } = thumbnailOrUrl;
74
+ return {
75
+ url,
76
+ ...(proxy_url === undefined ? {} : { proxy_url }),
77
+ ...(height === undefined ? {} : { height }),
78
+ ...(width === undefined ? {} : { width }),
79
+ };
80
+ })();
81
+ return pipe(Schema.decodeUnknownEffect(Thumbnail)(thumbnail), Effect.mapError((e) => ValidationError.fromParseError(e, {
82
+ field: "thumbnail",
83
+ value: thumbnail,
84
+ })), Effect.as({ ...d, thumbnail }));
85
+ };
86
+ const setVideoImpl = (videoOrUrl, height, width) => (d) => {
87
+ const video = typeof videoOrUrl === "string"
88
+ ? {
89
+ url: videoOrUrl,
90
+ ...(height === undefined ? {} : { height }),
91
+ ...(width === undefined ? {} : { width }),
92
+ }
93
+ : (() => {
94
+ const { url, proxy_url, height, width } = videoOrUrl;
95
+ return {
96
+ ...(url === undefined ? {} : { url }),
97
+ ...(proxy_url === undefined ? {} : { proxy_url }),
98
+ ...(height === undefined ? {} : { height }),
99
+ ...(width === undefined ? {} : { width }),
100
+ };
101
+ })();
102
+ return pipe(Schema.decodeUnknownEffect(Video)(video), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "video", value: video })), Effect.as({ ...d, video }));
103
+ };
104
+ const setProviderImpl = (providerOrName, url) => (d) => {
105
+ const provider = typeof providerOrName === "string"
106
+ ? {
107
+ name: providerOrName,
108
+ ...(url === undefined ? {} : { url }),
109
+ }
110
+ : (() => {
111
+ const { name, url } = providerOrName;
112
+ return {
113
+ ...(name === undefined ? {} : { name }),
114
+ ...(url === undefined ? {} : { url }),
115
+ };
116
+ })();
117
+ return pipe(Schema.decodeUnknownEffect(Provider)(provider), Effect.mapError((e) => ValidationError.fromParseError(e, {
118
+ field: "provider",
119
+ value: provider,
120
+ })), Effect.as({ ...d, provider }));
121
+ };
122
+ const setAuthorImpl = (authorOrName, url, icon_url) => (d) => {
123
+ const author = typeof authorOrName === "string"
124
+ ? {
125
+ name: authorOrName,
126
+ ...(url === undefined ? {} : { url }),
127
+ ...(icon_url === undefined ? {} : { icon_url }),
128
+ }
129
+ : (() => {
130
+ const { name, url, icon_url, proxy_icon_url } = authorOrName;
131
+ return {
132
+ ...(name === undefined ? {} : { name }),
133
+ ...(url === undefined ? {} : { url }),
134
+ ...(icon_url === undefined ? {} : { icon_url }),
135
+ ...(proxy_icon_url === undefined ? {} : { proxy_icon_url }),
136
+ };
137
+ })();
138
+ return pipe(Schema.decodeUnknownEffect(Author)(author), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "author", value: author })), Effect.as({ ...d, author }));
139
+ };
140
+ export const addFieldImpl = (fieldOrName, value, inline = false) => (d) => {
141
+ const currentFields = d.fields || [];
142
+ if (currentFields.length >= 25) {
143
+ return Effect.fail(ValidationError.fromIssue("fields", "Cannot add more than 25 fields", {
144
+ constraint: "MaxItems",
145
+ expected: "25 fields or less",
146
+ actual: currentFields.length + 1,
147
+ }));
148
+ }
149
+ const field = typeof fieldOrName === "string"
150
+ ? { name: fieldOrName, value: value ?? "", inline }
151
+ : (() => {
152
+ const { name, value, inline } = fieldOrName;
153
+ return {
154
+ name,
155
+ value,
156
+ ...(inline === undefined ? {} : { inline }),
157
+ };
158
+ })();
159
+ return pipe(Schema.decodeUnknownEffect(Field)(field), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "fields", value: field })), Effect.map(() => ({ ...d, fields: [...currentFields, field] })));
160
+ };
161
+ const setFieldsImpl = (fields) => (d) => {
162
+ if (fields.length > 25) {
163
+ return Effect.fail(ValidationError.fromIssue("fields", "Cannot have more than 25 fields", {
164
+ constraint: "MaxItems",
165
+ expected: "25 fields or less",
166
+ actual: fields.length,
167
+ }));
168
+ }
169
+ const normalized = fields.map((field) => {
170
+ const { name, value, inline } = field;
171
+ return {
172
+ name,
173
+ value,
174
+ ...(inline === undefined ? {} : { inline }),
175
+ };
176
+ });
177
+ return pipe(Effect.forEach(normalized, (f) => Schema.decodeUnknownEffect(Field)(f)), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "fields", value: fields })), Effect.map((decoded) => ({ ...d, fields: decoded })));
178
+ };
179
+ const buildImpl = (d) => pipe(Schema.decodeUnknownEffect(EmbedSchema)(stripUndefined({ ...d, type: "rich" })), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "embed", value: d })));
180
+ export const buildDirect = buildImpl;
181
+ export const addFieldDirect = addFieldImpl;
182
+ export const make = Effect.succeed(createDraft());
183
+ const chain = (f) => (self) => pipe(self, Effect.flatMap(f));
184
+ export const setTitle = (title) => chain(setTitleImpl(title));
185
+ export const setURL = (url) => chain(setURLImpl(url));
186
+ export const setDescription = (description) => chain(setDescriptionImpl(description));
187
+ export const setTimestamp = (date) => chain(setTimestampImpl(date));
188
+ export const setColor = (color) => chain(setColorImpl(color));
189
+ export const setFooter = (footer, icon_url, proxy_icon_url) => chain(setFooterImpl(footer, icon_url, proxy_icon_url));
190
+ export const setImage = (image, height, width) => chain(setImageImpl(image, height, width));
191
+ export const setThumbnail = (thumbnail, height, width) => chain(setThumbnailImpl(thumbnail, height, width));
192
+ export const setVideo = (video, height, width) => chain(setVideoImpl(video, height, width));
193
+ export const setProvider = (provider, url) => chain(setProviderImpl(provider, url));
194
+ export const setAuthor = (author, url, icon_url) => chain(setAuthorImpl(author, url, icon_url));
195
+ export const addField = (field, value, inline = false) => chain(addFieldImpl(field, value, inline));
196
+ export const setFields = (fields) => chain(setFieldsImpl(fields));
197
+ export const build = (self) => pipe(self, Effect.flatMap(buildImpl));
198
+ //# sourceMappingURL=Embed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Embed.js","sourceRoot":"","sources":["../../src/pipes/Embed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACN,MAAM,EACN,SAAS,EACT,KAAK,IAAI,WAAW,EACpB,KAAK,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,QAAQ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,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { ValidationError } from "../errors";
3
+ import { type Embed as EmbedSchema, type WebhookFile, WebhookParameter, Webhook as WebhookSchema } from "../schemas";
4
+ type WebhookDraft = Partial<Schema.Schema.Type<typeof WebhookSchema>>;
5
+ export declare const addEmbedImpl: (embed: Schema.Schema.Type<typeof EmbedSchema>) => (d: WebhookDraft) => Effect.Effect<{
6
+ embeds: readonly EmbedSchema[];
7
+ username?: string;
8
+ avatar_url?: string;
9
+ tts?: boolean;
10
+ content?: string;
11
+ file?: string | import("..").Attachment | {
12
+ readonly name: string;
13
+ readonly data: string | Uint8Array<ArrayBuffer>;
14
+ };
15
+ }, ValidationError, never>;
16
+ export declare const buildDirect: (d: WebhookDraft) => Effect.Effect<WebhookSchema, ValidationError, never>;
17
+ export declare const addEmbedDirect: (embed: Schema.Schema.Type<typeof EmbedSchema>) => (d: WebhookDraft) => Effect.Effect<{
18
+ embeds: readonly EmbedSchema[];
19
+ username?: string;
20
+ avatar_url?: string;
21
+ tts?: boolean;
22
+ content?: string;
23
+ file?: string | import("..").Attachment | {
24
+ readonly name: string;
25
+ readonly data: string | Uint8Array<ArrayBuffer>;
26
+ };
27
+ }, ValidationError, never>;
28
+ export declare const validate: (input: unknown) => Effect.Effect<WebhookSchema, ValidationError, never>;
29
+ export declare const modifyParams: (p: Schema.Schema.Type<typeof WebhookParameter>) => Effect.Effect<WebhookParameter, ValidationError, never>;
30
+ export declare const make: Effect.Effect<WebhookDraft, never>;
31
+ export declare const setUsername: (username: string) => (self: Effect.Effect<WebhookDraft, ValidationError>) => Effect.Effect<Partial<WebhookSchema>, ValidationError, never>;
32
+ export declare const setAvatarUrl: (url: string) => (self: Effect.Effect<WebhookDraft, ValidationError>) => Effect.Effect<Partial<WebhookSchema>, ValidationError, never>;
33
+ export declare const setContent: (content: string) => (self: Effect.Effect<WebhookDraft, ValidationError>) => Effect.Effect<Partial<WebhookSchema>, ValidationError, never>;
34
+ export declare const setTTS: (tts: boolean) => (self: Effect.Effect<WebhookDraft, ValidationError>) => Effect.Effect<Partial<WebhookSchema>, ValidationError, never>;
35
+ export declare const addEmbed: (embed: Schema.Schema.Type<typeof EmbedSchema>) => (self: Effect.Effect<WebhookDraft, ValidationError>) => Effect.Effect<Partial<WebhookSchema>, ValidationError, never>;
36
+ export declare const setFile: (file: Schema.Schema.Type<typeof WebhookFile>) => (self: Effect.Effect<WebhookDraft, ValidationError>) => Effect.Effect<Partial<WebhookSchema>, ValidationError, never>;
37
+ export declare const build: (self: Effect.Effect<WebhookDraft, ValidationError>) => Effect.Effect<WebhookSchema, ValidationError, never>;
38
+ export {};
@@ -0,0 +1,46 @@
1
+ import { Effect, pipe, Schema } from "effect";
2
+ import { ValidationError } from "../errors";
3
+ import { EmbedArray, maxLength, UrlString, WebhookParameter, Webhook as WebhookSchema, } from "../schemas";
4
+ import { stripUndefined } from "../utils/normalize";
5
+ const createDraft = () => ({});
6
+ const setUsernameImpl = (username) => (d) => pipe(Schema.decodeUnknownEffect(maxLength(80))(username), Effect.mapError(() => ValidationError.fromIssue("username", "Username must be 80 characters or less", {
7
+ constraint: "MaxLength",
8
+ expected: "80 characters or less",
9
+ actual: username.length,
10
+ })), Effect.as({ ...d, username }));
11
+ const setAvatarUrlImpl = (avatar_url) => (d) => pipe(Schema.decodeUnknownEffect(UrlString)(avatar_url), Effect.mapError(() => ValidationError.fromIssue("avatar_url", "Invalid avatar URL", {
12
+ constraint: "URL",
13
+ expected: "valid URL",
14
+ actual: avatar_url,
15
+ })), Effect.as({ ...d, avatar_url }));
16
+ const setContentImpl = (content) => (d) => pipe(Schema.decodeUnknownEffect(maxLength(2000))(content), Effect.mapError(() => ValidationError.fromIssue("content", "Content must be 2000 characters or less", {
17
+ constraint: "MaxLength",
18
+ expected: "2000 characters or less",
19
+ actual: content.length,
20
+ })), Effect.as({ ...d, content }));
21
+ const setTTSImpl = (tts) => (d) => Effect.succeed({ ...d, tts });
22
+ export const addEmbedImpl = (embed) => (d) => {
23
+ const current = d.embeds || [];
24
+ const next = [...current, embed];
25
+ return pipe(Schema.decodeUnknownEffect(EmbedArray)(stripUndefined(next)), Effect.mapError(() => ValidationError.fromIssue("embeds", "Cannot have more than 10 embeds", {
26
+ constraint: "MaxItems",
27
+ expected: "10 embeds or less",
28
+ actual: next.length,
29
+ })), Effect.map((decoded) => ({ ...d, embeds: decoded })));
30
+ };
31
+ const setFileImpl = (file) => (d) => Effect.succeed({ ...d, file });
32
+ const buildImpl = (d) => pipe(Schema.decodeUnknownEffect(WebhookSchema)(stripUndefined(d)), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "webhook", value: d })));
33
+ export const buildDirect = buildImpl;
34
+ export const addEmbedDirect = addEmbedImpl;
35
+ export const validate = (input) => pipe(Schema.decodeUnknownEffect(WebhookSchema)(stripUndefined(input)), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "webhook", value: input })));
36
+ export const modifyParams = (p) => pipe(Schema.decodeUnknownEffect(WebhookParameter)(stripUndefined(p)), Effect.mapError((e) => ValidationError.fromParseError(e, { field: "params", value: p })));
37
+ export const make = Effect.succeed(createDraft());
38
+ const chain = (f) => (self) => pipe(self, Effect.flatMap(f));
39
+ export const setUsername = (username) => chain(setUsernameImpl(username));
40
+ export const setAvatarUrl = (url) => chain(setAvatarUrlImpl(url));
41
+ export const setContent = (content) => chain(setContentImpl(content));
42
+ export const setTTS = (tts) => chain(setTTSImpl(tts));
43
+ export const addEmbed = (embed) => chain(addEmbedImpl(embed));
44
+ export const setFile = (file) => chain(setFileImpl(file));
45
+ export const build = (self) => pipe(self, Effect.flatMap(buildImpl));
46
+ //# sourceMappingURL=Webhook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Webhook.js","sourceRoot":"","sources":["../../src/pipes/Webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE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AM,IAAI,GAAuC,MAAM,CAAC,OAAO,CACrE,WAAW,EAAE,CACb,CAAC;AAEF,MAAM,KAAK,GACV,CAAC,CAAoE,EAAE,EAAE,CACzE,CAAC,IAAkD,EAAE,EAAE,CACtD,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE,CAC/C,KAAK,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAY,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAA6C,EAAE,EAAE,CACzE,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAA4C,EAAE,EAAE,CACvE,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAkD,EAAE,EAAE,CAC3E,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * as Embed from "./Embed";
2
+ export * as Webhook from "./Webhook";
@@ -0,0 +1,3 @@
1
+ export * as Embed from "./Embed";
2
+ export * as Webhook from "./Webhook";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pipes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Common schema definitions and constraints
4
+ */
5
+ export declare const maxLength: (max: number) => Schema.String;
6
+ export declare const positiveInt: Schema.Number;
7
+ export declare const UrlString: Schema.String;
8
+ export declare const ISO8601Timestamp: Schema.String;
9
+ export declare const ColorCode: Schema.Number;
10
+ export declare const Uint8ArraySchema: Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
@@ -0,0 +1,30 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Common schema definitions and constraints
4
+ */
5
+ // String with max length constraint (use native annotation so Arbitrary can honor it)
6
+ export const maxLength = (max) => Schema.String.check(Schema.isMaxLength(max));
7
+ // Positive integer constraint
8
+ export const positiveInt = Schema.Number.check(Schema.isInt(), Schema.isGreaterThan(0));
9
+ // URL string validation
10
+ export const UrlString = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => {
11
+ try {
12
+ new URL(value);
13
+ return true;
14
+ }
15
+ catch {
16
+ return "Invalid URL format";
17
+ }
18
+ })));
19
+ // ISO8601 timestamp validation
20
+ export const ISO8601Timestamp = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => {
21
+ const iso8601Regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/;
22
+ return iso8601Regex.test(value)
23
+ ? true
24
+ : "Invalid ISO8601 timestamp format";
25
+ })));
26
+ // Discord color code (0-16777215)
27
+ export const ColorCode = Schema.Number.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(16777215));
28
+ // Uint8Array schema (used in Webhook file data)
29
+ export const Uint8ArraySchema = Schema.instanceOf(Uint8Array);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AAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAC3C,MAAM,CAAC,KAAK,EAAE,EACd,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAChC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CACpC,CAAC;AAEF,gDAAgD;AAChD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Discord webhook URL regex
4
+ * Matches:
5
+ * - https://discord.com/api/webhooks/ID/TOKEN
6
+ * - Optional canary/ptb subdomains
7
+ * - Optional /v{number} API version segment
8
+ * - Optional trailing slash
9
+ * - Supports legacy discordapp.com domain
10
+ * Exposes named capture groups `id` and `token` for callers that need them.
11
+ */
12
+ export declare const DISCORD_WEBHOOK_REGEX: RegExp;
13
+ /**
14
+ * Effect Schema for validating Discord webhook URLs.
15
+ */
16
+ export declare const DiscordWebhookUrl: Schema.String;
@@ -0,0 +1,19 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Discord webhook URL regex
4
+ * Matches:
5
+ * - https://discord.com/api/webhooks/ID/TOKEN
6
+ * - Optional canary/ptb subdomains
7
+ * - Optional /v{number} API version segment
8
+ * - Optional trailing slash
9
+ * - Supports legacy discordapp.com domain
10
+ * Exposes named capture groups `id` and `token` for callers that need them.
11
+ */
12
+ export const DISCORD_WEBHOOK_REGEX = /^https:\/\/(?:(?:canary|ptb)\.)?discord(?:app)?\.com\/api(?:\/v\d+)?\/webhooks\/(?<id>\d+)\/(?<token>[\w-]+)\/?$/;
13
+ /**
14
+ * Effect Schema for validating Discord webhook URLs.
15
+ */
16
+ export const DiscordWebhookUrl = Schema.String.check(Schema.isPattern(DISCORD_WEBHOOK_REGEX, {
17
+ message: "Invalid Discord webhook URL",
18
+ }));
19
+ //# sourceMappingURL=Discord.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Discord.js","sourceRoot":"","sources":["../../src/schemas/Discord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,qBAAqB,GACjC,kHAAkH,CAAC;AAEpH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CACnD,MAAM,CAAC,SAAS,CAAC,qBAAqB,EAAE;IACvC,OAAO,EAAE,6BAA6B;CACtC,CAAC,CACF,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { Schema } from "effect";
2
+ declare const Attachment_base: Schema.ExtendableClass<Attachment, Schema.Struct<{
3
+ readonly url: Schema.String;
4
+ readonly proxyUrl: Schema.optionalKey<Schema.String>;
5
+ readonly filename: Schema.optionalKey<Schema.String>;
6
+ readonly size: Schema.optionalKey<Schema.Number>;
7
+ readonly height: Schema.optionalKey<Schema.Number>;
8
+ readonly width: Schema.optionalKey<Schema.Number>;
9
+ }>, {}>;
10
+ /**
11
+ * Attachment schema - represents file attachments or URLs
12
+ */
13
+ export declare class Attachment extends Attachment_base {
14
+ }
15
+ export declare const UrlOrAttachment: Schema.Union<readonly [Schema.String, typeof Attachment]>;
16
+ declare const Author_base: Schema.ExtendableClass<Author, Schema.Struct<{
17
+ readonly name: Schema.optionalKey<Schema.String>;
18
+ readonly url: Schema.optionalKey<Schema.String>;
19
+ readonly icon_url: Schema.optionalKey<Schema.Union<readonly [Schema.String, typeof Attachment]>>;
20
+ readonly proxy_icon_url: Schema.optionalKey<Schema.String>;
21
+ }>, {}>;
22
+ /**
23
+ * Author information schema
24
+ */
25
+ export declare class Author extends Author_base {
26
+ }
27
+ declare const Footer_base: Schema.ExtendableClass<Footer, Schema.Struct<{
28
+ readonly text: Schema.String;
29
+ readonly icon_url: Schema.optionalKey<Schema.Union<readonly [Schema.String, typeof Attachment]>>;
30
+ readonly proxy_icon_url: Schema.optionalKey<Schema.String>;
31
+ }>, {}>;
32
+ /**
33
+ * Footer information schema
34
+ */
35
+ export declare class Footer extends Footer_base {
36
+ }
37
+ declare const Image_base: Schema.ExtendableClass<Image, Schema.Struct<{
38
+ readonly url: Schema.Union<readonly [Schema.String, typeof Attachment]>;
39
+ readonly proxy_url: Schema.optionalKey<Schema.String>;
40
+ readonly height: Schema.optionalKey<Schema.Number>;
41
+ readonly width: Schema.optionalKey<Schema.Number>;
42
+ }>, {}>;
43
+ /**
44
+ * Image information schema
45
+ */
46
+ export declare class Image extends Image_base {
47
+ }
48
+ declare const Thumbnail_base: Schema.ExtendableClass<Thumbnail, Schema.Struct<{
49
+ readonly url: Schema.Union<readonly [Schema.String, typeof Attachment]>;
50
+ readonly proxy_url: Schema.optionalKey<Schema.String>;
51
+ readonly height: Schema.optionalKey<Schema.Number>;
52
+ readonly width: Schema.optionalKey<Schema.Number>;
53
+ }>, {}>;
54
+ /**
55
+ * Thumbnail information schema
56
+ */
57
+ export declare class Thumbnail extends Thumbnail_base {
58
+ }
59
+ declare const Video_base: Schema.ExtendableClass<Video, Schema.Struct<{
60
+ readonly url: Schema.optionalKey<Schema.String>;
61
+ readonly proxy_url: Schema.optionalKey<Schema.String>;
62
+ readonly height: Schema.optionalKey<Schema.Number>;
63
+ readonly width: Schema.optionalKey<Schema.Number>;
64
+ }>, {}>;
65
+ /**
66
+ * Video information schema
67
+ */
68
+ export declare class Video extends Video_base {
69
+ }
70
+ declare const Provider_base: Schema.ExtendableClass<Provider, Schema.Struct<{
71
+ readonly name: Schema.optionalKey<Schema.String>;
72
+ readonly url: Schema.optionalKey<Schema.String>;
73
+ }>, {}>;
74
+ /**
75
+ * Provider information schema
76
+ */
77
+ export declare class Provider extends Provider_base {
78
+ }
79
+ declare const Embed_base: Schema.ExtendableClass<Embed, Schema.Struct<{
80
+ /**
81
+ * Title of the embed.
82
+ * Up to 256 characters.
83
+ */
84
+ readonly title: Schema.optionalKey<Schema.String>;
85
+ /**
86
+ * Embed type.
87
+ * (Always "rich" for webhook embeds)
88
+ */
89
+ readonly type: Schema.optionalKey<Schema.Literal<"rich">>;
90
+ /**
91
+ * URL of embed.
92
+ */
93
+ readonly url: Schema.optionalKey<Schema.String>;
94
+ /**
95
+ * Description of the embed.
96
+ * Up to 4096 characters.
97
+ */
98
+ readonly description: Schema.optionalKey<Schema.String>;
99
+ /**
100
+ * ISO8601 timestamp of the embed content.
101
+ */
102
+ readonly timestamp: Schema.optionalKey<Schema.String>;
103
+ /**
104
+ * Color code of the embed.
105
+ */
106
+ readonly color: Schema.optionalKey<Schema.Number>;
107
+ /**
108
+ * Footer information.
109
+ */
110
+ readonly footer: Schema.optionalKey<typeof Footer>;
111
+ /**
112
+ * Image information.
113
+ */
114
+ readonly image: Schema.optionalKey<typeof Image>;
115
+ /**
116
+ * Thumbnail information.
117
+ */
118
+ readonly thumbnail: Schema.optionalKey<typeof Thumbnail>;
119
+ /**
120
+ * Video information.
121
+ */
122
+ readonly video: Schema.optionalKey<typeof Video>;
123
+ /**
124
+ * Provider information.
125
+ */
126
+ readonly provider: Schema.optionalKey<typeof Provider>;
127
+ /**
128
+ * Author information.
129
+ */
130
+ readonly author: Schema.optionalKey<typeof Author>;
131
+ /**
132
+ * Fields information.
133
+ * Up to 25 fields.
134
+ */
135
+ readonly fields: Schema.optionalKey<Schema.$Array<typeof import("./Field").Field>>;
136
+ }>, {}>;
137
+ /**
138
+ * Main Embed schema
139
+ */
140
+ export declare class Embed extends Embed_base {
141
+ }
142
+ export declare const EmbedArray: Schema.$Array<typeof Embed>;
143
+ export {};