@teever/ez-hook-effect 0.4.4 → 0.5.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/README.md +88 -10
- package/dist/index.js +493 -264
- package/dist/index.js.map +16 -14
- package/package.json +55 -54
- package/dist/errors/WebhookError.d.ts +0 -156
- package/dist/errors/index.d.ts +0 -1
- package/dist/index.d.ts +0 -85
- package/dist/layers/Config.d.ts +0 -48
- package/dist/layers/HttpClient.d.ts +0 -80
- package/dist/layers/index.d.ts +0 -2
- package/dist/pipes/Embed.d.ts +0 -51
- package/dist/pipes/Webhook.d.ts +0 -37
- package/dist/pipes/index.d.ts +0 -2
- package/dist/schemas/Common.d.ts +0 -10
- package/dist/schemas/Discord.d.ts +0 -16
- package/dist/schemas/Embed.d.ts +0 -314
- package/dist/schemas/Field.d.ts +0 -45
- package/dist/schemas/Webhook.d.ts +0 -206
- package/dist/schemas/index.d.ts +0 -5
- package/dist/services/WebhookService.d.ts +0 -72
- package/dist/services/index.d.ts +0 -1
package/dist/schemas/Embed.d.ts
DELETED
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
declare const Attachment_base: Schema.Class<Attachment, {
|
|
3
|
-
url: typeof Schema.String;
|
|
4
|
-
proxyUrl: Schema.optional<typeof Schema.String>;
|
|
5
|
-
filename: Schema.optional<typeof Schema.String>;
|
|
6
|
-
size: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
7
|
-
height: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
8
|
-
width: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
9
|
-
}, Schema.Struct.Encoded<{
|
|
10
|
-
url: typeof Schema.String;
|
|
11
|
-
proxyUrl: Schema.optional<typeof Schema.String>;
|
|
12
|
-
filename: Schema.optional<typeof Schema.String>;
|
|
13
|
-
size: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
14
|
-
height: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
15
|
-
width: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
16
|
-
}>, never, {
|
|
17
|
-
readonly filename?: string;
|
|
18
|
-
} & {
|
|
19
|
-
readonly size?: number;
|
|
20
|
-
} & {
|
|
21
|
-
readonly url: string;
|
|
22
|
-
} & {
|
|
23
|
-
readonly proxyUrl?: string;
|
|
24
|
-
} & {
|
|
25
|
-
readonly height?: number;
|
|
26
|
-
} & {
|
|
27
|
-
readonly width?: number;
|
|
28
|
-
}, {}, {}>;
|
|
29
|
-
/**
|
|
30
|
-
* Attachment schema - represents file attachments or URLs
|
|
31
|
-
*/
|
|
32
|
-
export declare class Attachment extends Attachment_base {
|
|
33
|
-
}
|
|
34
|
-
export declare const UrlOrAttachment: Schema.Union<[Schema.refine<string, typeof Schema.String>, typeof Attachment]>;
|
|
35
|
-
declare const Author_base: Schema.Class<Author, {
|
|
36
|
-
name: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
37
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
38
|
-
icon_url: Schema.optional<Schema.Union<[Schema.refine<string, typeof Schema.String>, typeof Attachment]>>;
|
|
39
|
-
proxy_icon_url: Schema.optional<typeof Schema.String>;
|
|
40
|
-
}, Schema.Struct.Encoded<{
|
|
41
|
-
name: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
42
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
43
|
-
icon_url: Schema.optional<Schema.Union<[Schema.refine<string, typeof Schema.String>, typeof Attachment]>>;
|
|
44
|
-
proxy_icon_url: Schema.optional<typeof Schema.String>;
|
|
45
|
-
}>, never, {
|
|
46
|
-
readonly url?: string;
|
|
47
|
-
} & {
|
|
48
|
-
readonly name?: string;
|
|
49
|
-
} & {
|
|
50
|
-
readonly icon_url?: string | Attachment;
|
|
51
|
-
} & {
|
|
52
|
-
readonly proxy_icon_url?: string;
|
|
53
|
-
}, {}, {}>;
|
|
54
|
-
/**
|
|
55
|
-
* Author information schema
|
|
56
|
-
*/
|
|
57
|
-
export declare class Author extends Author_base {
|
|
58
|
-
}
|
|
59
|
-
declare const Footer_base: Schema.Class<Footer, {
|
|
60
|
-
text: Schema.filter<typeof Schema.String>;
|
|
61
|
-
icon_url: Schema.optional<Schema.Union<[Schema.refine<string, typeof Schema.String>, typeof Attachment]>>;
|
|
62
|
-
proxy_icon_url: Schema.optional<typeof Schema.String>;
|
|
63
|
-
}, Schema.Struct.Encoded<{
|
|
64
|
-
text: Schema.filter<typeof Schema.String>;
|
|
65
|
-
icon_url: Schema.optional<Schema.Union<[Schema.refine<string, typeof Schema.String>, typeof Attachment]>>;
|
|
66
|
-
proxy_icon_url: Schema.optional<typeof Schema.String>;
|
|
67
|
-
}>, never, {
|
|
68
|
-
readonly icon_url?: string | Attachment;
|
|
69
|
-
} & {
|
|
70
|
-
readonly proxy_icon_url?: string;
|
|
71
|
-
} & {
|
|
72
|
-
readonly text: string;
|
|
73
|
-
}, {}, {}>;
|
|
74
|
-
/**
|
|
75
|
-
* Footer information schema
|
|
76
|
-
*/
|
|
77
|
-
export declare class Footer extends Footer_base {
|
|
78
|
-
}
|
|
79
|
-
declare const Image_base: Schema.Class<Image, {
|
|
80
|
-
url: Schema.Union<[Schema.refine<string, typeof Schema.String>, typeof Attachment]>;
|
|
81
|
-
proxy_url: Schema.optional<typeof Schema.String>;
|
|
82
|
-
height: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
83
|
-
width: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
84
|
-
}, Schema.Struct.Encoded<{
|
|
85
|
-
url: Schema.Union<[Schema.refine<string, typeof Schema.String>, typeof Attachment]>;
|
|
86
|
-
proxy_url: Schema.optional<typeof Schema.String>;
|
|
87
|
-
height: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
88
|
-
width: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
89
|
-
}>, never, {
|
|
90
|
-
readonly url: string | Attachment;
|
|
91
|
-
} & {
|
|
92
|
-
readonly height?: number;
|
|
93
|
-
} & {
|
|
94
|
-
readonly width?: number;
|
|
95
|
-
} & {
|
|
96
|
-
readonly proxy_url?: string;
|
|
97
|
-
}, {}, {}>;
|
|
98
|
-
/**
|
|
99
|
-
* Image information schema
|
|
100
|
-
*/
|
|
101
|
-
export declare class Image extends Image_base {
|
|
102
|
-
}
|
|
103
|
-
declare const Thumbnail_base: Schema.Class<Thumbnail, {
|
|
104
|
-
url: Schema.Union<[Schema.refine<string, typeof Schema.String>, typeof Attachment]>;
|
|
105
|
-
proxy_url: Schema.optional<typeof Schema.String>;
|
|
106
|
-
height: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
107
|
-
width: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
108
|
-
}, Schema.Struct.Encoded<{
|
|
109
|
-
url: Schema.Union<[Schema.refine<string, typeof Schema.String>, typeof Attachment]>;
|
|
110
|
-
proxy_url: Schema.optional<typeof Schema.String>;
|
|
111
|
-
height: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
112
|
-
width: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
113
|
-
}>, never, {
|
|
114
|
-
readonly url: string | Attachment;
|
|
115
|
-
} & {
|
|
116
|
-
readonly height?: number;
|
|
117
|
-
} & {
|
|
118
|
-
readonly width?: number;
|
|
119
|
-
} & {
|
|
120
|
-
readonly proxy_url?: string;
|
|
121
|
-
}, {}, {}>;
|
|
122
|
-
/**
|
|
123
|
-
* Thumbnail information schema
|
|
124
|
-
*/
|
|
125
|
-
export declare class Thumbnail extends Thumbnail_base {
|
|
126
|
-
}
|
|
127
|
-
declare const Video_base: Schema.Class<Video, {
|
|
128
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
129
|
-
proxy_url: Schema.optional<typeof Schema.String>;
|
|
130
|
-
height: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
131
|
-
width: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
132
|
-
}, Schema.Struct.Encoded<{
|
|
133
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
134
|
-
proxy_url: Schema.optional<typeof Schema.String>;
|
|
135
|
-
height: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
136
|
-
width: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
|
|
137
|
-
}>, never, {
|
|
138
|
-
readonly url?: string;
|
|
139
|
-
} & {
|
|
140
|
-
readonly height?: number;
|
|
141
|
-
} & {
|
|
142
|
-
readonly width?: number;
|
|
143
|
-
} & {
|
|
144
|
-
readonly proxy_url?: string;
|
|
145
|
-
}, {}, {}>;
|
|
146
|
-
/**
|
|
147
|
-
* Video information schema
|
|
148
|
-
*/
|
|
149
|
-
export declare class Video extends Video_base {
|
|
150
|
-
}
|
|
151
|
-
declare const Provider_base: Schema.Class<Provider, {
|
|
152
|
-
name: Schema.optional<typeof Schema.String>;
|
|
153
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
154
|
-
}, Schema.Struct.Encoded<{
|
|
155
|
-
name: Schema.optional<typeof Schema.String>;
|
|
156
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
157
|
-
}>, never, {
|
|
158
|
-
readonly url?: string;
|
|
159
|
-
} & {
|
|
160
|
-
readonly name?: string;
|
|
161
|
-
}, {}, {}>;
|
|
162
|
-
/**
|
|
163
|
-
* Provider information schema
|
|
164
|
-
*/
|
|
165
|
-
export declare class Provider extends Provider_base {
|
|
166
|
-
}
|
|
167
|
-
declare const Embed_base: Schema.Class<Embed, {
|
|
168
|
-
/**
|
|
169
|
-
* Title of the embed.
|
|
170
|
-
* Up to 256 characters.
|
|
171
|
-
*/
|
|
172
|
-
title: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
173
|
-
/**
|
|
174
|
-
* Embed type.
|
|
175
|
-
* (Always "rich" for webhook embeds)
|
|
176
|
-
*/
|
|
177
|
-
type: Schema.optional<Schema.Literal<["rich"]>>;
|
|
178
|
-
/**
|
|
179
|
-
* URL of embed.
|
|
180
|
-
*/
|
|
181
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
182
|
-
/**
|
|
183
|
-
* Description of the embed.
|
|
184
|
-
* Up to 4096 characters.
|
|
185
|
-
*/
|
|
186
|
-
description: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
187
|
-
/**
|
|
188
|
-
* ISO8601 timestamp of the embed content.
|
|
189
|
-
*/
|
|
190
|
-
timestamp: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
191
|
-
/**
|
|
192
|
-
* Color code of the embed.
|
|
193
|
-
*/
|
|
194
|
-
color: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.Number>>>>;
|
|
195
|
-
/**
|
|
196
|
-
* Footer information.
|
|
197
|
-
*/
|
|
198
|
-
footer: Schema.optional<typeof Footer>;
|
|
199
|
-
/**
|
|
200
|
-
* Image information.
|
|
201
|
-
*/
|
|
202
|
-
image: Schema.optional<typeof Image>;
|
|
203
|
-
/**
|
|
204
|
-
* Thumbnail information.
|
|
205
|
-
*/
|
|
206
|
-
thumbnail: Schema.optional<typeof Thumbnail>;
|
|
207
|
-
/**
|
|
208
|
-
* Video information.
|
|
209
|
-
*/
|
|
210
|
-
video: Schema.optional<typeof Video>;
|
|
211
|
-
/**
|
|
212
|
-
* Provider information.
|
|
213
|
-
*/
|
|
214
|
-
provider: Schema.optional<typeof Provider>;
|
|
215
|
-
/**
|
|
216
|
-
* Author information.
|
|
217
|
-
*/
|
|
218
|
-
author: Schema.optional<typeof Author>;
|
|
219
|
-
/**
|
|
220
|
-
* Fields information.
|
|
221
|
-
* Up to 25 fields.
|
|
222
|
-
*/
|
|
223
|
-
fields: Schema.optional<Schema.filter<Schema.Array$<typeof import("./Field").Field>>>;
|
|
224
|
-
}, Schema.Struct.Encoded<{
|
|
225
|
-
/**
|
|
226
|
-
* Title of the embed.
|
|
227
|
-
* Up to 256 characters.
|
|
228
|
-
*/
|
|
229
|
-
title: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
230
|
-
/**
|
|
231
|
-
* Embed type.
|
|
232
|
-
* (Always "rich" for webhook embeds)
|
|
233
|
-
*/
|
|
234
|
-
type: Schema.optional<Schema.Literal<["rich"]>>;
|
|
235
|
-
/**
|
|
236
|
-
* URL of embed.
|
|
237
|
-
*/
|
|
238
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
239
|
-
/**
|
|
240
|
-
* Description of the embed.
|
|
241
|
-
* Up to 4096 characters.
|
|
242
|
-
*/
|
|
243
|
-
description: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
244
|
-
/**
|
|
245
|
-
* ISO8601 timestamp of the embed content.
|
|
246
|
-
*/
|
|
247
|
-
timestamp: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
248
|
-
/**
|
|
249
|
-
* Color code of the embed.
|
|
250
|
-
*/
|
|
251
|
-
color: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.Number>>>>;
|
|
252
|
-
/**
|
|
253
|
-
* Footer information.
|
|
254
|
-
*/
|
|
255
|
-
footer: Schema.optional<typeof Footer>;
|
|
256
|
-
/**
|
|
257
|
-
* Image information.
|
|
258
|
-
*/
|
|
259
|
-
image: Schema.optional<typeof Image>;
|
|
260
|
-
/**
|
|
261
|
-
* Thumbnail information.
|
|
262
|
-
*/
|
|
263
|
-
thumbnail: Schema.optional<typeof Thumbnail>;
|
|
264
|
-
/**
|
|
265
|
-
* Video information.
|
|
266
|
-
*/
|
|
267
|
-
video: Schema.optional<typeof Video>;
|
|
268
|
-
/**
|
|
269
|
-
* Provider information.
|
|
270
|
-
*/
|
|
271
|
-
provider: Schema.optional<typeof Provider>;
|
|
272
|
-
/**
|
|
273
|
-
* Author information.
|
|
274
|
-
*/
|
|
275
|
-
author: Schema.optional<typeof Author>;
|
|
276
|
-
/**
|
|
277
|
-
* Fields information.
|
|
278
|
-
* Up to 25 fields.
|
|
279
|
-
*/
|
|
280
|
-
fields: Schema.optional<Schema.filter<Schema.Array$<typeof import("./Field").Field>>>;
|
|
281
|
-
}>, never, {
|
|
282
|
-
readonly url?: string;
|
|
283
|
-
} & {
|
|
284
|
-
readonly fields?: readonly import("./Field").Field[];
|
|
285
|
-
} & {
|
|
286
|
-
readonly title?: string;
|
|
287
|
-
} & {
|
|
288
|
-
readonly description?: string;
|
|
289
|
-
} & {
|
|
290
|
-
readonly type?: "rich";
|
|
291
|
-
} & {
|
|
292
|
-
readonly timestamp?: string;
|
|
293
|
-
} & {
|
|
294
|
-
readonly color?: number;
|
|
295
|
-
} & {
|
|
296
|
-
readonly footer?: Footer;
|
|
297
|
-
} & {
|
|
298
|
-
readonly image?: Image;
|
|
299
|
-
} & {
|
|
300
|
-
readonly thumbnail?: Thumbnail;
|
|
301
|
-
} & {
|
|
302
|
-
readonly video?: Video;
|
|
303
|
-
} & {
|
|
304
|
-
readonly provider?: Provider;
|
|
305
|
-
} & {
|
|
306
|
-
readonly author?: Author;
|
|
307
|
-
}, {}, {}>;
|
|
308
|
-
/**
|
|
309
|
-
* Main Embed schema
|
|
310
|
-
*/
|
|
311
|
-
export declare class Embed extends Embed_base {
|
|
312
|
-
}
|
|
313
|
-
export declare const EmbedArray: Schema.filter<Schema.Array$<typeof Embed>>;
|
|
314
|
-
export {};
|
package/dist/schemas/Field.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
declare const Field_base: Schema.Class<Field, {
|
|
3
|
-
/**
|
|
4
|
-
* Name of the field.
|
|
5
|
-
* Up to 256 characters.
|
|
6
|
-
*/
|
|
7
|
-
name: Schema.filter<typeof Schema.String>;
|
|
8
|
-
/**
|
|
9
|
-
* Value of the field.
|
|
10
|
-
* Up to 1024 characters.
|
|
11
|
-
*/
|
|
12
|
-
value: Schema.filter<typeof Schema.String>;
|
|
13
|
-
/**
|
|
14
|
-
* Whether or not this field should be displayed inline.
|
|
15
|
-
*/
|
|
16
|
-
inline: Schema.optional<typeof Schema.Boolean>;
|
|
17
|
-
}, Schema.Struct.Encoded<{
|
|
18
|
-
/**
|
|
19
|
-
* Name of the field.
|
|
20
|
-
* Up to 256 characters.
|
|
21
|
-
*/
|
|
22
|
-
name: Schema.filter<typeof Schema.String>;
|
|
23
|
-
/**
|
|
24
|
-
* Value of the field.
|
|
25
|
-
* Up to 1024 characters.
|
|
26
|
-
*/
|
|
27
|
-
value: Schema.filter<typeof Schema.String>;
|
|
28
|
-
/**
|
|
29
|
-
* Whether or not this field should be displayed inline.
|
|
30
|
-
*/
|
|
31
|
-
inline: Schema.optional<typeof Schema.Boolean>;
|
|
32
|
-
}>, never, {
|
|
33
|
-
readonly value: string;
|
|
34
|
-
} & {
|
|
35
|
-
readonly name: string;
|
|
36
|
-
} & {
|
|
37
|
-
readonly inline?: boolean;
|
|
38
|
-
}, {}, {}>;
|
|
39
|
-
/**
|
|
40
|
-
* Discord embed field schema
|
|
41
|
-
*/
|
|
42
|
-
export declare class Field extends Field_base {
|
|
43
|
-
}
|
|
44
|
-
export declare const FieldArray: Schema.filter<Schema.Array$<typeof Field>>;
|
|
45
|
-
export {};
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import { Attachment } from "./Embed";
|
|
3
|
-
/**
|
|
4
|
-
* File attachment for webhooks
|
|
5
|
-
*/
|
|
6
|
-
export declare const WebhookFile: Schema.Union<[typeof Schema.String, typeof Attachment, Schema.Struct<{
|
|
7
|
-
name: typeof Schema.String;
|
|
8
|
-
data: Schema.Union<[typeof Schema.String, Schema.instanceOf<Uint8Array<ArrayBuffer>>]>;
|
|
9
|
-
}>]>;
|
|
10
|
-
declare const Webhook_base: Schema.Class<Webhook, {
|
|
11
|
-
/**
|
|
12
|
-
* Webhook username override.
|
|
13
|
-
*/
|
|
14
|
-
username: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
15
|
-
/**
|
|
16
|
-
* Webhook avatar URL override.
|
|
17
|
-
*/
|
|
18
|
-
avatar_url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
19
|
-
/**
|
|
20
|
-
* Whether or not this notification should be read as text to speech.
|
|
21
|
-
*/
|
|
22
|
-
tts: Schema.optional<typeof Schema.Boolean>;
|
|
23
|
-
/**
|
|
24
|
-
* Message contents.
|
|
25
|
-
* Max 2000 characters
|
|
26
|
-
*/
|
|
27
|
-
content: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
28
|
-
/**
|
|
29
|
-
* Contents of a file being sent.
|
|
30
|
-
*/
|
|
31
|
-
file: Schema.optional<Schema.Union<[typeof Schema.String, typeof Attachment, Schema.Struct<{
|
|
32
|
-
name: typeof Schema.String;
|
|
33
|
-
data: Schema.Union<[typeof Schema.String, Schema.instanceOf<Uint8Array<ArrayBuffer>>]>;
|
|
34
|
-
}>]>>;
|
|
35
|
-
/**
|
|
36
|
-
* Embedded "rich" content.
|
|
37
|
-
* Max 10 embeds
|
|
38
|
-
*/
|
|
39
|
-
embeds: Schema.optional<Schema.filter<Schema.Array$<typeof import("./Embed").Embed>>>;
|
|
40
|
-
}, Schema.Struct.Encoded<{
|
|
41
|
-
/**
|
|
42
|
-
* Webhook username override.
|
|
43
|
-
*/
|
|
44
|
-
username: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
45
|
-
/**
|
|
46
|
-
* Webhook avatar URL override.
|
|
47
|
-
*/
|
|
48
|
-
avatar_url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
49
|
-
/**
|
|
50
|
-
* Whether or not this notification should be read as text to speech.
|
|
51
|
-
*/
|
|
52
|
-
tts: Schema.optional<typeof Schema.Boolean>;
|
|
53
|
-
/**
|
|
54
|
-
* Message contents.
|
|
55
|
-
* Max 2000 characters
|
|
56
|
-
*/
|
|
57
|
-
content: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
58
|
-
/**
|
|
59
|
-
* Contents of a file being sent.
|
|
60
|
-
*/
|
|
61
|
-
file: Schema.optional<Schema.Union<[typeof Schema.String, typeof Attachment, Schema.Struct<{
|
|
62
|
-
name: typeof Schema.String;
|
|
63
|
-
data: Schema.Union<[typeof Schema.String, Schema.instanceOf<Uint8Array<ArrayBuffer>>]>;
|
|
64
|
-
}>]>>;
|
|
65
|
-
/**
|
|
66
|
-
* Embedded "rich" content.
|
|
67
|
-
* Max 10 embeds
|
|
68
|
-
*/
|
|
69
|
-
embeds: Schema.optional<Schema.filter<Schema.Array$<typeof import("./Embed").Embed>>>;
|
|
70
|
-
}>, never, {
|
|
71
|
-
readonly username?: string;
|
|
72
|
-
} & {
|
|
73
|
-
readonly avatar_url?: string;
|
|
74
|
-
} & {
|
|
75
|
-
readonly tts?: boolean;
|
|
76
|
-
} & {
|
|
77
|
-
readonly content?: string;
|
|
78
|
-
} & {
|
|
79
|
-
readonly file?: string | Attachment | {
|
|
80
|
-
readonly name: string;
|
|
81
|
-
readonly data: string | Uint8Array<ArrayBuffer>;
|
|
82
|
-
};
|
|
83
|
-
} & {
|
|
84
|
-
readonly embeds?: readonly import("./Embed").Embed[];
|
|
85
|
-
}, {}, {}>;
|
|
86
|
-
/**
|
|
87
|
-
* Main Webhook schema
|
|
88
|
-
*/
|
|
89
|
-
export declare class Webhook extends Webhook_base {
|
|
90
|
-
}
|
|
91
|
-
declare const WebhookParameter_base: Schema.Class<WebhookParameter, {
|
|
92
|
-
name: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
93
|
-
avatar: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
94
|
-
channel_id: Schema.optional<typeof Schema.String>;
|
|
95
|
-
}, Schema.Struct.Encoded<{
|
|
96
|
-
name: Schema.optional<Schema.filter<typeof Schema.String>>;
|
|
97
|
-
avatar: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
98
|
-
channel_id: Schema.optional<typeof Schema.String>;
|
|
99
|
-
}>, never, {
|
|
100
|
-
readonly name?: string;
|
|
101
|
-
} & {
|
|
102
|
-
readonly avatar?: string;
|
|
103
|
-
} & {
|
|
104
|
-
readonly channel_id?: string;
|
|
105
|
-
}, {}, {}>;
|
|
106
|
-
/**
|
|
107
|
-
* Webhook parameter schema (for modify operations)
|
|
108
|
-
*/
|
|
109
|
-
export declare class WebhookParameter extends WebhookParameter_base {
|
|
110
|
-
}
|
|
111
|
-
declare const WebhookResponse_base: Schema.Class<WebhookResponse, {
|
|
112
|
-
id: typeof Schema.String;
|
|
113
|
-
type: typeof Schema.Number;
|
|
114
|
-
guild_id: Schema.optional<typeof Schema.String>;
|
|
115
|
-
channel_id: typeof Schema.String;
|
|
116
|
-
user: Schema.optional<Schema.Struct<{
|
|
117
|
-
id: typeof Schema.String;
|
|
118
|
-
username: typeof Schema.String;
|
|
119
|
-
avatar: Schema.optional<typeof Schema.String>;
|
|
120
|
-
discriminator: typeof Schema.String;
|
|
121
|
-
public_flags: Schema.optional<typeof Schema.Number>;
|
|
122
|
-
}>>;
|
|
123
|
-
name: Schema.optional<typeof Schema.String>;
|
|
124
|
-
avatar: Schema.optional<typeof Schema.String>;
|
|
125
|
-
token: Schema.optional<typeof Schema.String>;
|
|
126
|
-
application_id: Schema.optional<typeof Schema.String>;
|
|
127
|
-
source_guild: Schema.optional<Schema.Struct<{
|
|
128
|
-
id: typeof Schema.String;
|
|
129
|
-
name: typeof Schema.String;
|
|
130
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
131
|
-
}>>;
|
|
132
|
-
source_channel: Schema.optional<Schema.Struct<{
|
|
133
|
-
id: typeof Schema.String;
|
|
134
|
-
name: typeof Schema.String;
|
|
135
|
-
}>>;
|
|
136
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
137
|
-
}, Schema.Struct.Encoded<{
|
|
138
|
-
id: typeof Schema.String;
|
|
139
|
-
type: typeof Schema.Number;
|
|
140
|
-
guild_id: Schema.optional<typeof Schema.String>;
|
|
141
|
-
channel_id: typeof Schema.String;
|
|
142
|
-
user: Schema.optional<Schema.Struct<{
|
|
143
|
-
id: typeof Schema.String;
|
|
144
|
-
username: typeof Schema.String;
|
|
145
|
-
avatar: Schema.optional<typeof Schema.String>;
|
|
146
|
-
discriminator: typeof Schema.String;
|
|
147
|
-
public_flags: Schema.optional<typeof Schema.Number>;
|
|
148
|
-
}>>;
|
|
149
|
-
name: Schema.optional<typeof Schema.String>;
|
|
150
|
-
avatar: Schema.optional<typeof Schema.String>;
|
|
151
|
-
token: Schema.optional<typeof Schema.String>;
|
|
152
|
-
application_id: Schema.optional<typeof Schema.String>;
|
|
153
|
-
source_guild: Schema.optional<Schema.Struct<{
|
|
154
|
-
id: typeof Schema.String;
|
|
155
|
-
name: typeof Schema.String;
|
|
156
|
-
icon: Schema.optional<typeof Schema.String>;
|
|
157
|
-
}>>;
|
|
158
|
-
source_channel: Schema.optional<Schema.Struct<{
|
|
159
|
-
id: typeof Schema.String;
|
|
160
|
-
name: typeof Schema.String;
|
|
161
|
-
}>>;
|
|
162
|
-
url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
163
|
-
}>, never, {
|
|
164
|
-
readonly url?: string;
|
|
165
|
-
} & {
|
|
166
|
-
readonly id: string;
|
|
167
|
-
} & {
|
|
168
|
-
readonly token?: string;
|
|
169
|
-
} & {
|
|
170
|
-
readonly name?: string;
|
|
171
|
-
} & {
|
|
172
|
-
readonly type: number;
|
|
173
|
-
} & {
|
|
174
|
-
readonly avatar?: string;
|
|
175
|
-
} & {
|
|
176
|
-
readonly channel_id: string;
|
|
177
|
-
} & {
|
|
178
|
-
readonly guild_id?: string;
|
|
179
|
-
} & {
|
|
180
|
-
readonly user?: {
|
|
181
|
-
readonly id: string;
|
|
182
|
-
readonly username: string;
|
|
183
|
-
readonly avatar?: string;
|
|
184
|
-
readonly discriminator: string;
|
|
185
|
-
readonly public_flags?: number;
|
|
186
|
-
};
|
|
187
|
-
} & {
|
|
188
|
-
readonly application_id?: string;
|
|
189
|
-
} & {
|
|
190
|
-
readonly source_guild?: {
|
|
191
|
-
readonly id: string;
|
|
192
|
-
readonly name: string;
|
|
193
|
-
readonly icon?: string;
|
|
194
|
-
};
|
|
195
|
-
} & {
|
|
196
|
-
readonly source_channel?: {
|
|
197
|
-
readonly id: string;
|
|
198
|
-
readonly name: string;
|
|
199
|
-
};
|
|
200
|
-
}, {}, {}>;
|
|
201
|
-
/**
|
|
202
|
-
* Webhook response schema
|
|
203
|
-
*/
|
|
204
|
-
export declare class WebhookResponse extends WebhookResponse_base {
|
|
205
|
-
}
|
|
206
|
-
export {};
|
package/dist/schemas/index.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Context, Effect, Layer } from "effect";
|
|
2
|
-
import { HttpError, NetworkError, RateLimitError, ValidationError, WebhookError } from "../errors";
|
|
3
|
-
import { Config } from "../layers/Config";
|
|
4
|
-
import { HttpClient } from "../layers/HttpClient";
|
|
5
|
-
import { Webhook, WebhookParameter, WebhookResponse } from "../schemas";
|
|
6
|
-
declare const WebhookService_base: Context.TagClass<WebhookService, "WebhookService", {
|
|
7
|
-
/**
|
|
8
|
-
* Send a webhook message
|
|
9
|
-
*/
|
|
10
|
-
readonly sendWebhook: (webhook: Webhook) => Effect.Effect<boolean, WebhookError | ValidationError | NetworkError | HttpError | RateLimitError>;
|
|
11
|
-
/**
|
|
12
|
-
* Modify webhook settings
|
|
13
|
-
*/
|
|
14
|
-
readonly modifyWebhook: (params: WebhookParameter) => Effect.Effect<WebhookResponse, WebhookError | ValidationError | NetworkError | HttpError | RateLimitError>;
|
|
15
|
-
/**
|
|
16
|
-
* Get webhook information
|
|
17
|
-
*/
|
|
18
|
-
readonly getWebhook: () => Effect.Effect<WebhookResponse, WebhookError | NetworkError | HttpError | RateLimitError>;
|
|
19
|
-
/**
|
|
20
|
-
* Delete the webhook
|
|
21
|
-
*/
|
|
22
|
-
readonly deleteWebhook: () => Effect.Effect<boolean, WebhookError | NetworkError | HttpError | RateLimitError>;
|
|
23
|
-
/**
|
|
24
|
-
* Validate webhook by checking if it exists and is accessible
|
|
25
|
-
*/
|
|
26
|
-
readonly validateWebhook: () => Effect.Effect<boolean, never>;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* Webhook service tag
|
|
30
|
-
*/
|
|
31
|
-
export declare class WebhookService extends WebhookService_base {
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Create webhook service implementation
|
|
35
|
-
*/
|
|
36
|
-
export declare const makeWebhookService: Effect.Effect<{
|
|
37
|
-
sendWebhook: (webhook: Webhook) => Effect.Effect<boolean, ValidationError | NetworkError | RateLimitError | HttpError, never>;
|
|
38
|
-
modifyWebhook: (params: WebhookParameter) => Effect.Effect<WebhookResponse, WebhookError | ValidationError | NetworkError | RateLimitError | HttpError, never>;
|
|
39
|
-
getWebhook: () => Effect.Effect<WebhookResponse, WebhookError | NetworkError | RateLimitError | HttpError, never>;
|
|
40
|
-
deleteWebhook: () => Effect.Effect<boolean, NetworkError | RateLimitError | HttpError, never>;
|
|
41
|
-
validateWebhook: () => Effect.Effect<boolean, never, never>;
|
|
42
|
-
}, never, Config | HttpClient>;
|
|
43
|
-
/**
|
|
44
|
-
* Live webhook service layer
|
|
45
|
-
*/
|
|
46
|
-
export declare const WebhookServiceLive: Layer.Layer<WebhookService, never, Config | HttpClient>;
|
|
47
|
-
/**
|
|
48
|
-
* Send a webhook message
|
|
49
|
-
* Module-level accessor that reads from context
|
|
50
|
-
*/
|
|
51
|
-
export declare const sendWebhook: (webhook: Webhook) => Effect.Effect<boolean, WebhookError | ValidationError | NetworkError | HttpError | RateLimitError, WebhookService>;
|
|
52
|
-
/**
|
|
53
|
-
* Modify webhook settings
|
|
54
|
-
* Module-level accessor that reads from context
|
|
55
|
-
*/
|
|
56
|
-
export declare const modifyWebhook: (params: WebhookParameter) => Effect.Effect<WebhookResponse, WebhookError | ValidationError | NetworkError | HttpError | RateLimitError, WebhookService>;
|
|
57
|
-
/**
|
|
58
|
-
* Get webhook information
|
|
59
|
-
* Module-level accessor that reads from context
|
|
60
|
-
*/
|
|
61
|
-
export declare const getWebhook: () => Effect.Effect<WebhookResponse, WebhookError | NetworkError | HttpError | RateLimitError, WebhookService>;
|
|
62
|
-
/**
|
|
63
|
-
* Delete the webhook
|
|
64
|
-
* Module-level accessor that reads from context
|
|
65
|
-
*/
|
|
66
|
-
export declare const deleteWebhook: () => Effect.Effect<boolean, WebhookError | NetworkError | HttpError | RateLimitError, WebhookService>;
|
|
67
|
-
/**
|
|
68
|
-
* Validate webhook by checking if it exists and is accessible
|
|
69
|
-
* Module-level accessor that reads from context
|
|
70
|
-
*/
|
|
71
|
-
export declare const validateWebhook: () => Effect.Effect<boolean, never, WebhookService>;
|
|
72
|
-
export {};
|
package/dist/services/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./WebhookService";
|