@teever/ez-hook-effect 0.5.19 → 0.5.20

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.js CHANGED
@@ -1,233 +1,105 @@
1
- // src/schemas/Common.ts
2
- import { Schema } from "effect";
3
- var maxLength = (max) => Schema.String.check(Schema.isMaxLength(max));
4
- var positiveInt = Schema.Number.check(Schema.isInt(), Schema.isGreaterThan(0));
5
- var UrlString = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => {
6
- try {
7
- new URL(value);
8
- return true;
9
- } catch {
10
- return "Invalid URL format";
11
- }
12
- })));
13
- var ISO8601Timestamp = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => {
14
- const iso8601Regex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/;
15
- return iso8601Regex.test(value) ? true : "Invalid ISO8601 timestamp format";
16
- })));
17
- var ColorCode = Schema.Number.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(16777215));
18
- var Uint8ArraySchema = Schema.instanceOf(Uint8Array);
19
-
20
- // src/schemas/Discord.ts
21
- import { Schema as Schema2 } from "effect";
22
- var DISCORD_WEBHOOK_REGEX = /^https:\/\/(?:(?:canary|ptb)\.)?discord(?:app)?\.com\/api(?:\/v\d+)?\/webhooks\/(?<id>\d+)\/(?<token>[\w-]+)\/?$/;
23
- var DiscordWebhookUrl = Schema2.String.check(Schema2.isPattern(DISCORD_WEBHOOK_REGEX, {
24
- message: "Invalid Discord webhook URL"
25
- }));
26
-
27
- // src/schemas/Embed.ts
28
- import { Schema as Schema4 } from "effect";
29
-
30
- // src/schemas/Field.ts
31
- import { Schema as Schema3 } from "effect";
32
- class Field extends Schema3.Class("Field")({
33
- name: maxLength(256),
34
- value: maxLength(1024),
35
- inline: Schema3.optionalKey(Schema3.Boolean)
36
- }) {
37
- }
38
- var FieldArray = Schema3.Array(Field).pipe(Schema3.check(Schema3.isMaxLength(25)));
39
-
40
- // src/schemas/Embed.ts
41
- class Attachment extends Schema4.Class("Attachment")({
42
- url: Schema4.String,
43
- proxyUrl: Schema4.optionalKey(Schema4.String),
44
- filename: Schema4.optionalKey(Schema4.String),
45
- size: Schema4.optionalKey(positiveInt),
46
- height: Schema4.optionalKey(positiveInt),
47
- width: Schema4.optionalKey(positiveInt)
48
- }) {
49
- }
50
- var UrlOrAttachment = Schema4.Union([UrlString, Attachment]);
51
-
52
- class Author extends Schema4.Class("Author")({
53
- name: Schema4.optionalKey(maxLength(256)),
54
- url: Schema4.optionalKey(UrlString),
55
- icon_url: Schema4.optionalKey(UrlOrAttachment),
56
- proxy_icon_url: Schema4.optionalKey(Schema4.String)
57
- }) {
58
- }
59
-
60
- class Footer extends Schema4.Class("Footer")({
61
- text: maxLength(2048),
62
- icon_url: Schema4.optionalKey(UrlOrAttachment),
63
- proxy_icon_url: Schema4.optionalKey(Schema4.String)
64
- }) {
65
- }
66
-
67
- class Image extends Schema4.Class("Image")({
68
- url: UrlOrAttachment,
69
- proxy_url: Schema4.optionalKey(Schema4.String),
70
- height: Schema4.optionalKey(positiveInt),
71
- width: Schema4.optionalKey(positiveInt)
72
- }) {
73
- }
74
-
75
- class Thumbnail extends Schema4.Class("Thumbnail")({
76
- url: UrlOrAttachment,
77
- proxy_url: Schema4.optionalKey(Schema4.String),
78
- height: Schema4.optionalKey(positiveInt),
79
- width: Schema4.optionalKey(positiveInt)
80
- }) {
81
- }
82
-
83
- class Video extends Schema4.Class("Video")({
84
- url: Schema4.optionalKey(UrlString),
85
- proxy_url: Schema4.optionalKey(Schema4.String),
86
- height: Schema4.optionalKey(positiveInt),
87
- width: Schema4.optionalKey(positiveInt)
88
- }) {
89
- }
90
-
91
- class Provider extends Schema4.Class("Provider")({
92
- name: Schema4.optionalKey(Schema4.String),
93
- url: Schema4.optionalKey(UrlString)
94
- }) {
95
- }
96
-
97
- class Embed extends Schema4.Class("Embed")({
98
- title: Schema4.optionalKey(maxLength(256)),
99
- type: Schema4.optionalKey(Schema4.Literal("rich")),
100
- url: Schema4.optionalKey(UrlString),
101
- description: Schema4.optionalKey(maxLength(4096)),
102
- timestamp: Schema4.optionalKey(ISO8601Timestamp),
103
- color: Schema4.optionalKey(ColorCode),
104
- footer: Schema4.optionalKey(Footer),
105
- image: Schema4.optionalKey(Image),
106
- thumbnail: Schema4.optionalKey(Thumbnail),
107
- video: Schema4.optionalKey(Video),
108
- provider: Schema4.optionalKey(Provider),
109
- author: Schema4.optionalKey(Author),
110
- fields: Schema4.optionalKey(FieldArray)
111
- }) {
112
- }
113
- var EmbedArray = Schema4.Array(Embed).pipe(Schema4.check(Schema4.isMaxLength(10)));
114
-
115
- // src/schemas/Webhook.ts
116
- import { Schema as Schema5 } from "effect";
117
- var WebhookFile = Schema5.Union([
118
- Schema5.String,
119
- Attachment,
120
- Schema5.Struct({
121
- name: Schema5.String,
122
- data: Schema5.Union([Schema5.String, Uint8ArraySchema])
123
- })
124
- ]);
125
-
126
- class Webhook extends Schema5.Class("Webhook")({
127
- username: Schema5.optionalKey(maxLength(80)),
128
- avatar_url: Schema5.optionalKey(UrlString),
129
- tts: Schema5.optionalKey(Schema5.Boolean),
130
- content: Schema5.optionalKey(maxLength(2000)),
131
- file: Schema5.optionalKey(WebhookFile),
132
- embeds: Schema5.optionalKey(EmbedArray)
133
- }) {
134
- }
135
-
136
- class WebhookParameter extends Schema5.Class("WebhookParameter")({
137
- name: Schema5.optionalKey(maxLength(80)),
138
- avatar: Schema5.optionalKey(UrlString),
139
- channel_id: Schema5.optionalKey(Schema5.String)
140
- }) {
141
- }
142
-
143
- class WebhookResponse extends Schema5.Class("WebhookResponse")({
144
- id: Schema5.String,
145
- type: Schema5.Number,
146
- guild_id: Schema5.optionalKey(Schema5.String),
147
- channel_id: Schema5.String,
148
- user: Schema5.optionalKey(Schema5.Struct({
149
- id: Schema5.String,
150
- username: Schema5.String,
151
- avatar: Schema5.optionalKey(Schema5.String),
152
- discriminator: Schema5.String,
153
- public_flags: Schema5.optionalKey(Schema5.Number)
154
- })),
155
- name: Schema5.optionalKey(Schema5.String),
156
- avatar: Schema5.optionalKey(Schema5.String),
157
- token: Schema5.optionalKey(Schema5.String),
158
- application_id: Schema5.optionalKey(Schema5.String),
159
- source_guild: Schema5.optionalKey(Schema5.Struct({
160
- id: Schema5.String,
161
- name: Schema5.String,
162
- icon: Schema5.optionalKey(Schema5.String)
163
- })),
164
- source_channel: Schema5.optionalKey(Schema5.Struct({
165
- id: Schema5.String,
166
- name: Schema5.String
167
- })),
168
- url: Schema5.optionalKey(UrlString)
169
- }) {
170
- }
171
- export {
172
- webhookErrorToLogObject,
173
- validateWebhook,
174
- sendWebhookRaw,
175
- sendWebhook,
176
- positiveInt,
177
- parseWebhookUrl,
178
- parseRateLimitHeaders,
179
- parseErrorToIssues,
180
- modifyWebhook,
181
- maxLength,
182
- makeWebhookService,
183
- makeTestHttpClient,
184
- makeIssue,
185
- makeHttpClientLayer,
186
- makeDefaultLayer,
187
- makeConfigLayer,
188
- makeConfig,
189
- getWebhook,
190
- formatWebhookError,
191
- deleteWebhook,
192
- defaultRetryConfig,
193
- createRetrySchedule,
194
- WebhookServiceLive,
195
- WebhookService,
196
- WebhookResponse,
197
- WebhookParameter,
198
- WebhookFile,
199
- WebhookError,
200
- Webhook2 as Webhook,
201
- Video,
202
- ValidationError,
203
- UrlString,
204
- UrlOrAttachment,
205
- Uint8ArraySchema,
206
- Thumbnail,
207
- RateLimitError,
208
- Provider,
209
- NetworkError,
210
- Image,
211
- ISO8601Timestamp,
212
- HttpError,
213
- HttpClientLive,
214
- HttpClient,
215
- Footer,
216
- FileError,
217
- FieldArray,
218
- Field,
219
- FetchHttpClient,
220
- EmbedArray,
221
- Embed2 as Embed,
222
- DiscordWebhookUrl,
223
- DISCORD_WEBHOOK_REGEX,
224
- ConfigFromEnv,
225
- ConfigError,
226
- Config,
227
- ColorCode,
228
- Author,
229
- Attachment
230
- };
231
-
232
- //# debugId=77B5F8F8A236B81364756E2164756E21
233
- //# sourceMappingURL=index.js.map
1
+ /**
2
+ * ez-hook-effect - Discord webhook library built with Effect
3
+ *
4
+ * Type-safe, composable, and resilient Discord webhook client.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { Webhook, Embed, sendWebhook, WebhookServiceLive, makeConfigLayer, HttpClientLive } from "ez-hook-effect";
9
+ * import { Effect, Layer, pipe } from "effect";
10
+ *
11
+ * const webhook = pipe(
12
+ * Webhook.make,
13
+ * Webhook.setContent("Hello from Effect!"),
14
+ * Webhook.build
15
+ * );
16
+ *
17
+ * const layer = WebhookServiceLive.pipe(
18
+ * Layer.provide(makeConfigLayer("https://discord.com/api/webhooks/...")),
19
+ * Layer.provide(HttpClientLive)
20
+ * );
21
+ *
22
+ * Effect.gen(function* () {
23
+ * const msg = yield* webhook;
24
+ * yield* sendWebhook(msg);
25
+ * }).pipe(Effect.provide(layer), Effect.runPromise);
26
+ * ```
27
+ *
28
+ * @packageDocumentation
29
+ */
30
+ // ============================================================================
31
+ // Errors
32
+ // ============================================================================
33
+ /** Error types for handling webhook failures */
34
+ export { ConfigError, FileError, formatWebhookError, HttpError, makeIssue, NetworkError, parseErrorToIssues, RateLimitError, ValidationError, webhookErrorToLogObject, WebhookError, } from "./errors";
35
+ // ============================================================================
36
+ // Layers (Configuration & HTTP Client)
37
+ // ============================================================================
38
+ /**
39
+ * Configuration service and layers.
40
+ * Use makeConfigLayer for programmatic config or ConfigFromEnv for environment variables.
41
+ */
42
+ export { Config, ConfigFromEnv, makeConfig, makeConfigLayer, parseWebhookUrl, } from "./layers/Config";
43
+ /**
44
+ * HTTP client service and layers.
45
+ * Provides fetch-based HTTP client with retry and rate limit support.
46
+ */
47
+ export { createRetrySchedule, defaultRetryConfig, FetchHttpClient, HttpClient, HttpClientLive, makeHttpClientLayer, makeTestHttpClient, parseRateLimitHeaders, } from "./layers/HttpClient";
48
+ /**
49
+ * Convenience layer to wire Config + HttpClient + WebhookService.
50
+ */
51
+ export { makeDefaultLayer } from "./layers/Default";
52
+ // ============================================================================
53
+ // Builders (Pipe-first API)
54
+ // ============================================================================
55
+ /**
56
+ * Embed builder namespace.
57
+ * Pipe-first API for building Discord embed objects.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * import { Embed } from "ez-hook-effect";
62
+ * import { pipe } from "effect";
63
+ *
64
+ * const embed = pipe(
65
+ * Embed.make,
66
+ * Embed.setTitle("Hello"),
67
+ * Embed.setDescription("World"),
68
+ * Embed.setColor("#5865F2"),
69
+ * Embed.build
70
+ * );
71
+ * ```
72
+ */
73
+ export * as Embed from "./pipes/Embed";
74
+ /**
75
+ * Webhook builder namespace.
76
+ * Pipe-first API for building Discord webhook payloads.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * import { Webhook } from "ez-hook-effect";
81
+ * import { pipe } from "effect";
82
+ *
83
+ * const webhook = pipe(
84
+ * Webhook.make,
85
+ * Webhook.setUsername("Bot"),
86
+ * Webhook.setContent("Hello!"),
87
+ * Webhook.build
88
+ * );
89
+ * ```
90
+ */
91
+ export * as Webhook from "./pipes/Webhook";
92
+ // ============================================================================
93
+ // Schemas
94
+ // ============================================================================
95
+ /** Schema types for Discord webhook payloads */
96
+ export * from "./schemas";
97
+ // ============================================================================
98
+ // Services
99
+ // ============================================================================
100
+ /**
101
+ * Webhook service and module-level accessors.
102
+ * Use these with Effect.flatMap or Effect.gen for sending webhooks.
103
+ */
104
+ export { deleteWebhook, getWebhook, makeWebhookService, modifyWebhook, sendWebhook, sendWebhookRaw, validateWebhook, WebhookService, WebhookServiceLive, } from "./services/WebhookService";
105
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,14 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/schemas/Common.ts", "../src/schemas/Discord.ts", "../src/schemas/Embed.ts", "../src/schemas/Field.ts", "../src/schemas/Webhook.ts"],
4
- "sourcesContent": [
5
- "import { Schema } from \"effect\";\n\n/**\n * Common schema definitions and constraints\n */\n\n// String with max length constraint (use native annotation so Arbitrary can honor it)\nexport const maxLength = (max: number) =>\n\tSchema.String.check(Schema.isMaxLength(max));\n\n// Positive integer constraint\nexport const positiveInt = Schema.Number.check(\n\tSchema.isInt(),\n\tSchema.isGreaterThan(0),\n);\n\n// URL string validation\nexport const UrlString = Schema.String.pipe(\n\tSchema.check(\n\t\tSchema.makeFilter((value) => {\n\t\t\ttry {\n\t\t\t\tnew URL(value);\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn \"Invalid URL format\";\n\t\t\t}\n\t\t}),\n\t),\n);\n\n// ISO8601 timestamp validation\nexport const ISO8601Timestamp = Schema.String.pipe(\n\tSchema.check(\n\t\tSchema.makeFilter((value) => {\n\t\t\tconst iso8601Regex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z?$/;\n\t\t\treturn iso8601Regex.test(value)\n\t\t\t\t? true\n\t\t\t\t: \"Invalid ISO8601 timestamp format\";\n\t\t}),\n\t),\n);\n\n// Discord color code (0-16777215)\nexport const ColorCode = Schema.Number.check(\n\tSchema.isInt(),\n\tSchema.isGreaterThanOrEqualTo(0),\n\tSchema.isLessThanOrEqualTo(16777215),\n);\n\n// Uint8Array schema (used in Webhook file data)\nexport const Uint8ArraySchema = Schema.instanceOf(Uint8Array);\n",
6
- "import { Schema } from \"effect\";\n\n/**\n * Discord webhook URL regex\n * Matches:\n * - https://discord.com/api/webhooks/ID/TOKEN\n * - Optional canary/ptb subdomains\n * - Optional /v{number} API version segment\n * - Optional trailing slash\n * - Supports legacy discordapp.com domain\n * Exposes named capture groups `id` and `token` for callers that need them.\n */\nexport const DISCORD_WEBHOOK_REGEX =\n\t/^https:\\/\\/(?:(?:canary|ptb)\\.)?discord(?:app)?\\.com\\/api(?:\\/v\\d+)?\\/webhooks\\/(?<id>\\d+)\\/(?<token>[\\w-]+)\\/?$/;\n\n/**\n * Effect Schema for validating Discord webhook URLs.\n */\nexport const DiscordWebhookUrl = Schema.String.check(\n\tSchema.isPattern(DISCORD_WEBHOOK_REGEX, {\n\t\tmessage: \"Invalid Discord webhook URL\",\n\t}),\n);\n",
7
- "import { Schema } from \"effect\";\nimport {\n\tColorCode,\n\tISO8601Timestamp,\n\tmaxLength,\n\tpositiveInt,\n\tUrlString,\n} from \"./Common\";\nimport { FieldArray } from \"./Field\";\n\n/**\n * Attachment schema - represents file attachments or URLs\n */\nexport class Attachment extends Schema.Class<Attachment>(\"Attachment\")({\n\turl: Schema.String,\n\tproxyUrl: Schema.optionalKey(Schema.String),\n\tfilename: Schema.optionalKey(Schema.String),\n\tsize: Schema.optionalKey(positiveInt),\n\theight: Schema.optionalKey(positiveInt),\n\twidth: Schema.optionalKey(positiveInt),\n}) {}\n\n// Union type for URL or Attachment\nexport const UrlOrAttachment = Schema.Union([UrlString, Attachment]);\n\n/**\n * Author information schema\n */\nexport class Author extends Schema.Class<Author>(\"Author\")({\n\tname: Schema.optionalKey(maxLength(256)),\n\turl: Schema.optionalKey(UrlString),\n\ticon_url: Schema.optionalKey(UrlOrAttachment),\n\tproxy_icon_url: Schema.optionalKey(Schema.String),\n}) {}\n\n/**\n * Footer information schema\n */\nexport class Footer extends Schema.Class<Footer>(\"Footer\")({\n\ttext: maxLength(2048),\n\ticon_url: Schema.optionalKey(UrlOrAttachment),\n\tproxy_icon_url: Schema.optionalKey(Schema.String),\n}) {}\n\n/**\n * Image information schema\n */\nexport class Image extends Schema.Class<Image>(\"Image\")({\n\turl: UrlOrAttachment,\n\tproxy_url: Schema.optionalKey(Schema.String),\n\theight: Schema.optionalKey(positiveInt),\n\twidth: Schema.optionalKey(positiveInt),\n}) {}\n\n/**\n * Thumbnail information schema\n */\nexport class Thumbnail extends Schema.Class<Thumbnail>(\"Thumbnail\")({\n\turl: UrlOrAttachment,\n\tproxy_url: Schema.optionalKey(Schema.String),\n\theight: Schema.optionalKey(positiveInt),\n\twidth: Schema.optionalKey(positiveInt),\n}) {}\n\n/**\n * Video information schema\n */\nexport class Video extends Schema.Class<Video>(\"Video\")({\n\turl: Schema.optionalKey(UrlString),\n\tproxy_url: Schema.optionalKey(Schema.String),\n\theight: Schema.optionalKey(positiveInt),\n\twidth: Schema.optionalKey(positiveInt),\n}) {}\n\n/**\n * Provider information schema\n */\nexport class Provider extends Schema.Class<Provider>(\"Provider\")({\n\tname: Schema.optionalKey(Schema.String),\n\turl: Schema.optionalKey(UrlString),\n}) {}\n\n/**\n * Main Embed schema\n */\nexport class Embed extends Schema.Class<Embed>(\"Embed\")({\n\t/**\n\t * Title of the embed.\n\t * Up to 256 characters.\n\t */\n\ttitle: Schema.optionalKey(maxLength(256)),\n\n\t/**\n\t * Embed type.\n\t * (Always \"rich\" for webhook embeds)\n\t */\n\ttype: Schema.optionalKey(Schema.Literal(\"rich\")),\n\n\t/**\n\t * URL of embed.\n\t */\n\turl: Schema.optionalKey(UrlString),\n\n\t/**\n\t * Description of the embed.\n\t * Up to 4096 characters.\n\t */\n\tdescription: Schema.optionalKey(maxLength(4096)),\n\n\t/**\n\t * ISO8601 timestamp of the embed content.\n\t */\n\ttimestamp: Schema.optionalKey(ISO8601Timestamp),\n\n\t/**\n\t * Color code of the embed.\n\t */\n\tcolor: Schema.optionalKey(ColorCode),\n\n\t/**\n\t * Footer information.\n\t */\n\tfooter: Schema.optionalKey(Footer),\n\n\t/**\n\t * Image information.\n\t */\n\timage: Schema.optionalKey(Image),\n\n\t/**\n\t * Thumbnail information.\n\t */\n\tthumbnail: Schema.optionalKey(Thumbnail),\n\n\t/**\n\t * Video information.\n\t */\n\tvideo: Schema.optionalKey(Video),\n\n\t/**\n\t * Provider information.\n\t */\n\tprovider: Schema.optionalKey(Provider),\n\n\t/**\n\t * Author information.\n\t */\n\tauthor: Schema.optionalKey(Author),\n\n\t/**\n\t * Fields information.\n\t * Up to 25 fields.\n\t */\n\tfields: Schema.optionalKey(FieldArray),\n}) {}\n\n// Array of embeds with max 10 constraint\nexport const EmbedArray = Schema.Array(Embed).pipe(\n\tSchema.check(Schema.isMaxLength(10)),\n);\n",
8
- "import { Schema } from \"effect\";\nimport { maxLength } from \"./Common\";\n\n/**\n * Discord embed field schema\n */\nexport class Field extends Schema.Class<Field>(\"Field\")({\n\t/**\n\t * Name of the field.\n\t * Up to 256 characters.\n\t */\n\tname: maxLength(256),\n\n\t/**\n\t * Value of the field.\n\t * Up to 1024 characters.\n\t */\n\tvalue: maxLength(1024),\n\n\t/**\n\t * Whether or not this field should be displayed inline.\n\t */\n\tinline: Schema.optionalKey(Schema.Boolean),\n}) {}\n\n// Array of fields with max 25 constraint\nexport const FieldArray = Schema.Array(Field).pipe(\n\tSchema.check(Schema.isMaxLength(25)),\n);\n",
9
- "import { Schema } from \"effect\";\nimport { maxLength, Uint8ArraySchema, UrlString } from \"./Common\";\nimport { Attachment, EmbedArray } from \"./Embed\";\n\n/**\n * File attachment for webhooks\n */\nexport const WebhookFile = Schema.Union([\n\tSchema.String,\n\tAttachment,\n\tSchema.Struct({\n\t\tname: Schema.String,\n\t\tdata: Schema.Union([Schema.String, Uint8ArraySchema]),\n\t}),\n]);\n\n/**\n * Main Webhook schema\n */\nexport class Webhook extends Schema.Class<Webhook>(\"Webhook\")({\n\t/**\n\t * Webhook username override.\n\t */\n\tusername: Schema.optionalKey(maxLength(80)),\n\n\t/**\n\t * Webhook avatar URL override.\n\t */\n\tavatar_url: Schema.optionalKey(UrlString),\n\n\t/**\n\t * Whether or not this notification should be read as text to speech.\n\t */\n\ttts: Schema.optionalKey(Schema.Boolean),\n\n\t/**\n\t * Message contents.\n\t * Max 2000 characters\n\t */\n\tcontent: Schema.optionalKey(maxLength(2000)),\n\n\t/**\n\t * Contents of a file being sent.\n\t */\n\tfile: Schema.optionalKey(WebhookFile),\n\n\t/**\n\t * Embedded \"rich\" content.\n\t * Max 10 embeds\n\t */\n\tembeds: Schema.optionalKey(EmbedArray),\n}) {}\n\n/**\n * Webhook parameter schema (for modify operations)\n */\nexport class WebhookParameter extends Schema.Class<WebhookParameter>(\n\t\"WebhookParameter\",\n)({\n\tname: Schema.optionalKey(maxLength(80)),\n\tavatar: Schema.optionalKey(UrlString),\n\tchannel_id: Schema.optionalKey(Schema.String),\n}) {}\n\n/**\n * Webhook response schema\n */\nexport class WebhookResponse extends Schema.Class<WebhookResponse>(\n\t\"WebhookResponse\",\n)({\n\tid: Schema.String,\n\ttype: Schema.Number,\n\tguild_id: Schema.optionalKey(Schema.String),\n\tchannel_id: Schema.String,\n\tuser: Schema.optionalKey(\n\t\tSchema.Struct({\n\t\t\tid: Schema.String,\n\t\t\tusername: Schema.String,\n\t\t\tavatar: Schema.optionalKey(Schema.String),\n\t\t\tdiscriminator: Schema.String,\n\t\t\tpublic_flags: Schema.optionalKey(Schema.Number),\n\t\t}),\n\t),\n\tname: Schema.optionalKey(Schema.String),\n\tavatar: Schema.optionalKey(Schema.String),\n\ttoken: Schema.optionalKey(Schema.String),\n\tapplication_id: Schema.optionalKey(Schema.String),\n\tsource_guild: Schema.optionalKey(\n\t\tSchema.Struct({\n\t\t\tid: Schema.String,\n\t\t\tname: Schema.String,\n\t\t\ticon: Schema.optionalKey(Schema.String),\n\t\t}),\n\t),\n\tsource_channel: Schema.optionalKey(\n\t\tSchema.Struct({\n\t\t\tid: Schema.String,\n\t\t\tname: Schema.String,\n\t\t}),\n\t),\n\turl: Schema.optionalKey(UrlString),\n}) {}\n"
10
- ],
11
- "mappings": ";AAAA;AAOO,IAAM,YAAY,CAAC,QACzB,OAAO,OAAO,MAAM,OAAO,YAAY,GAAG,CAAC;AAGrC,IAAM,cAAc,OAAO,OAAO,MACxC,OAAO,MAAM,GACb,OAAO,cAAc,CAAC,CACvB;AAGO,IAAM,YAAY,OAAO,OAAO,KACtC,OAAO,MACN,OAAO,WAAW,CAAC,UAAU;AAAA,EAC5B,IAAI;AAAA,IACH,IAAI,IAAI,KAAK;AAAA,IACb,OAAO;AAAA,IACN,MAAM;AAAA,IACP,OAAO;AAAA;AAAA,CAER,CACF,CACD;AAGO,IAAM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AY,QAAO,YAAY,QAAO,MAAM;AAC7C,CAAC,EAAE;AAAC;AAAA;AAKG,MAAM,wBAAwB,QAAO,MAC3C,iBACD,EAAE;AAAA,EACD,IAAI,QAAO;AAAA,EACX,MAAM,QAAO;AAAA,EACb,UAAU,QAAO,YAAY,QAAO,MAAM;AAAA,EAC1C,YAAY,QAAO;AAAA,EACnB,MAAM,QAAO,YACZ,QAAO,OAAO;AAAA,IACb,IAAI,QAAO;AAAA,IACX,UAAU,QAAO;AAAA,IACjB,QAAQ,QAAO,YAAY,QAAO,MAAM;AAAA,IACxC,eAAe,QAAO;AAAA,IACtB,cAAc,QAAO,YAAY,QAAO,MAAM;AAAA,EAC/C,CAAC,CACF;AAAA,EACA,MAAM,QAAO,YAAY,QAAO,MAAM;AAAA,EACtC,QAAQ,QAAO,YAAY,QAAO,MAAM;AAAA,EACxC,OAAO,QAAO,YAAY,QAAO,MAAM;AAAA,EACvC,gBAAgB,QAAO,YAAY,QAAO,MAAM;AAAA,EAChD,cAAc,QAAO,YACpB,QAAO,OAAO;AAAA,IACb,IAAI,QAAO;AAAA,IACX,MAAM,QAAO;AAAA,IACb,MAAM,QAAO,YAAY,QAAO,MAAM;AAAA,EACvC,CAAC,CACF;AAAA,EACA,gBAAgB,QAAO,YACtB,QAAO,OAAO;AAAA,IACb,IAAI,QAAO;AAAA,IACX,MAAM,QAAO;AAAA,EACd,CAAC,CACF;AAAA,EACA,KAAK,QAAO,YAAY,SAAS;AAClC,CAAC,EAAE;AAAC;",
12
- "debugId": "77B5F8F8A236B81364756E2164756E21",
13
- "names": []
14
- }
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,gDAAgD;AAChD,OAAO,EACN,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,SAAS,EAET,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,eAAe,EAEf,uBAAuB,EACvB,YAAY,GAEZ,MAAM,UAAU,CAAC;AAElB,+EAA+E;AAC/E,uCAAuC;AACvC,+EAA+E;AAE/E;;;GAGG;AACH,OAAO,EACN,MAAM,EACN,aAAa,EACb,UAAU,EACV,eAAe,EACf,eAAe,GAEf,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,cAAc,EAGd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,GAGrB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAEvC;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAE3C,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,gDAAgD;AAChD,cAAc,WAAW,CAAC;AAE1B,+EAA+E;AAC/E,WAAW;AACX,+EAA+E;AAE/E;;;GAGG;AACH,OAAO,EACN,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EAEf,cAAc,EACd,kBAAkB,GAClB,MAAM,2BAA2B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teever/ez-hook-effect",
3
- "version": "0.5.19",
3
+ "version": "0.5.20",
4
4
  "description": "A Discord webhook library built with Effect - type-safe, composable, and resilient",
5
5
  "module": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -24,11 +24,12 @@
24
24
  "dev": "bun src/index.ts",
25
25
  "lint": "bun biome check ./src ./examples ./tests --write --unsafe",
26
26
  "jsr": "bunx jsr publish --allow-slow-types --allow-dirty",
27
- "build": "bun run clean && bun run build:tsc && bun run build:bundle",
27
+ "build": "bun run clean && bun run build:tsc && bun run build:smoke",
28
28
  "build:tsc": "tsc --project tsconfig.build.json",
29
- "build:bundle": "bun build ./src/index.ts --outdir ./dist --target node --format esm --sourcemap --external effect",
29
+ "build:bundle": "bun build ./src/index.ts --outdir ./dist-bundle --target node --format esm --sourcemap --external effect",
30
+ "build:smoke": "bun --eval 'await import(\"./dist/index.js\")'",
30
31
  "build:standalone": "bun build ./src/index.ts --compile --outfile ez-hook-effect",
31
- "clean": "rm -rf dist ez-hook-effect",
32
+ "clean": "rm -rf dist dist-bundle ez-hook-effect",
32
33
  "prepublishOnly": "bun run build",
33
34
  "test": "bun test",
34
35
  "test:watch": "bun test --watch",