@teever/ez-hook-effect 0.4.4 → 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 (54) hide show
  1. package/README.md +88 -10
  2. package/dist/errors/WebhookError.d.ts +142 -3
  3. package/dist/errors/WebhookError.js +322 -0
  4. package/dist/errors/WebhookError.js.map +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 +7 -3
  8. package/dist/index.js +493 -264
  9. package/dist/index.js.map +16 -14
  10. package/dist/layers/Config.d.ts +3 -3
  11. package/dist/layers/Config.js +166 -0
  12. package/dist/layers/Config.js.map +1 -0
  13. package/dist/layers/Default.d.ts +6 -0
  14. package/dist/layers/Default.js +9 -0
  15. package/dist/layers/Default.js.map +1 -0
  16. package/dist/layers/HttpClient.d.ts +8 -4
  17. package/dist/layers/HttpClient.js +209 -0
  18. package/dist/layers/HttpClient.js.map +1 -0
  19. package/dist/layers/index.js +3 -0
  20. package/dist/layers/index.js.map +1 -0
  21. package/dist/pipes/Embed.d.ts +2 -2
  22. package/dist/pipes/Embed.js +198 -0
  23. package/dist/pipes/Embed.js.map +1 -0
  24. package/dist/pipes/Webhook.d.ts +3 -2
  25. package/dist/pipes/Webhook.js +46 -0
  26. package/dist/pipes/Webhook.js.map +1 -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 +6 -6
  30. package/dist/schemas/Common.js +30 -0
  31. package/dist/schemas/Common.js.map +1 -0
  32. package/dist/schemas/Discord.d.ts +1 -1
  33. package/dist/schemas/Discord.js +19 -0
  34. package/dist/schemas/Discord.js.map +1 -0
  35. package/dist/schemas/Embed.d.ts +58 -229
  36. package/dist/schemas/Embed.js +139 -0
  37. package/dist/schemas/Embed.js.map +1 -0
  38. package/dist/schemas/Field.d.ts +6 -27
  39. package/dist/schemas/Field.js +25 -0
  40. package/dist/schemas/Field.js.map +1 -0
  41. package/dist/schemas/Webhook.d.ts +42 -160
  42. package/dist/schemas/Webhook.js +87 -0
  43. package/dist/schemas/Webhook.js.map +1 -0
  44. package/dist/schemas/index.js +6 -0
  45. package/dist/schemas/index.js.map +1 -0
  46. package/dist/services/WebhookService.d.ts +27 -5
  47. package/dist/services/WebhookService.js +116 -0
  48. package/dist/services/WebhookService.js.map +1 -0
  49. package/dist/services/index.js +2 -0
  50. package/dist/services/index.js.map +1 -0
  51. package/dist/utils/normalize.d.ts +1 -0
  52. package/dist/utils/normalize.js +17 -0
  53. package/dist/utils/normalize.js.map +1 -0
  54. package/package.json +56 -54
@@ -1,314 +1,143 @@
1
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
- }, {}, {}>;
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
+ }>, {}>;
29
10
  /**
30
11
  * Attachment schema - represents file attachments or URLs
31
12
  */
32
13
  export declare class Attachment extends Attachment_base {
33
14
  }
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
- }, {}, {}>;
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
+ }>, {}>;
54
22
  /**
55
23
  * Author information schema
56
24
  */
57
25
  export declare class Author extends Author_base {
58
26
  }
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
- }, {}, {}>;
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
+ }>, {}>;
74
32
  /**
75
33
  * Footer information schema
76
34
  */
77
35
  export declare class Footer extends Footer_base {
78
36
  }
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
- }, {}, {}>;
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
+ }>, {}>;
98
43
  /**
99
44
  * Image information schema
100
45
  */
101
46
  export declare class Image extends Image_base {
102
47
  }
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
- }, {}, {}>;
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
+ }>, {}>;
122
54
  /**
123
55
  * Thumbnail information schema
124
56
  */
125
57
  export declare class Thumbnail extends Thumbnail_base {
126
58
  }
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
- }, {}, {}>;
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
+ }>, {}>;
146
65
  /**
147
66
  * Video information schema
148
67
  */
149
68
  export declare class Video extends Video_base {
150
69
  }
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
- }, {}, {}>;
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
+ }>, {}>;
162
74
  /**
163
75
  * Provider information schema
164
76
  */
165
77
  export declare class Provider extends Provider_base {
166
78
  }
167
- declare const Embed_base: Schema.Class<Embed, {
79
+ declare const Embed_base: Schema.ExtendableClass<Embed, Schema.Struct<{
168
80
  /**
169
81
  * Title of the embed.
170
82
  * Up to 256 characters.
171
83
  */
172
- title: Schema.optional<Schema.filter<typeof Schema.String>>;
84
+ readonly title: Schema.optionalKey<Schema.String>;
173
85
  /**
174
86
  * Embed type.
175
87
  * (Always "rich" for webhook embeds)
176
88
  */
177
- type: Schema.optional<Schema.Literal<["rich"]>>;
89
+ readonly type: Schema.optionalKey<Schema.Literal<"rich">>;
178
90
  /**
179
91
  * URL of embed.
180
92
  */
181
- url: Schema.optional<Schema.refine<string, typeof Schema.String>>;
93
+ readonly url: Schema.optionalKey<Schema.String>;
182
94
  /**
183
95
  * Description of the embed.
184
96
  * Up to 4096 characters.
185
97
  */
186
- description: Schema.optional<Schema.filter<typeof Schema.String>>;
98
+ readonly description: Schema.optionalKey<Schema.String>;
187
99
  /**
188
100
  * ISO8601 timestamp of the embed content.
189
101
  */
190
- timestamp: Schema.optional<Schema.refine<string, typeof Schema.String>>;
102
+ readonly timestamp: Schema.optionalKey<Schema.String>;
191
103
  /**
192
104
  * Color code of the embed.
193
105
  */
194
- color: Schema.optional<Schema.filter<Schema.filter<Schema.filter<typeof Schema.Number>>>>;
106
+ readonly color: Schema.optionalKey<Schema.Number>;
195
107
  /**
196
108
  * Footer information.
197
109
  */
198
- footer: Schema.optional<typeof Footer>;
110
+ readonly footer: Schema.optionalKey<typeof Footer>;
199
111
  /**
200
112
  * Image information.
201
113
  */
202
- image: Schema.optional<typeof Image>;
114
+ readonly image: Schema.optionalKey<typeof Image>;
203
115
  /**
204
116
  * Thumbnail information.
205
117
  */
206
- thumbnail: Schema.optional<typeof Thumbnail>;
118
+ readonly thumbnail: Schema.optionalKey<typeof Thumbnail>;
207
119
  /**
208
120
  * Video information.
209
121
  */
210
- video: Schema.optional<typeof Video>;
122
+ readonly video: Schema.optionalKey<typeof Video>;
211
123
  /**
212
124
  * Provider information.
213
125
  */
214
- provider: Schema.optional<typeof Provider>;
126
+ readonly provider: Schema.optionalKey<typeof Provider>;
215
127
  /**
216
128
  * Author information.
217
129
  */
218
- author: Schema.optional<typeof Author>;
130
+ readonly author: Schema.optionalKey<typeof Author>;
219
131
  /**
220
132
  * Fields information.
221
133
  * Up to 25 fields.
222
134
  */
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
- }, {}, {}>;
135
+ readonly fields: Schema.optionalKey<Schema.$Array<typeof import("./Field").Field>>;
136
+ }>, {}>;
308
137
  /**
309
138
  * Main Embed schema
310
139
  */
311
140
  export declare class Embed extends Embed_base {
312
141
  }
313
- export declare const EmbedArray: Schema.filter<Schema.Array$<typeof Embed>>;
142
+ export declare const EmbedArray: Schema.$Array<typeof Embed>;
314
143
  export {};
@@ -0,0 +1,139 @@
1
+ import { Schema } from "effect";
2
+ import { ColorCode, ISO8601Timestamp, maxLength, positiveInt, UrlString, } from "./Common";
3
+ import { FieldArray } from "./Field";
4
+ /**
5
+ * Attachment schema - represents file attachments or URLs
6
+ */
7
+ export class Attachment extends Schema.Class("Attachment")({
8
+ url: Schema.String,
9
+ proxyUrl: Schema.optionalKey(Schema.String),
10
+ filename: Schema.optionalKey(Schema.String),
11
+ size: Schema.optionalKey(positiveInt),
12
+ height: Schema.optionalKey(positiveInt),
13
+ width: Schema.optionalKey(positiveInt),
14
+ }) {
15
+ }
16
+ // Union type for URL or Attachment
17
+ export const UrlOrAttachment = Schema.Union([UrlString, Attachment]);
18
+ /**
19
+ * Author information schema
20
+ */
21
+ export class Author extends Schema.Class("Author")({
22
+ name: Schema.optionalKey(maxLength(256)),
23
+ url: Schema.optionalKey(UrlString),
24
+ icon_url: Schema.optionalKey(UrlOrAttachment),
25
+ proxy_icon_url: Schema.optionalKey(Schema.String),
26
+ }) {
27
+ }
28
+ /**
29
+ * Footer information schema
30
+ */
31
+ export class Footer extends Schema.Class("Footer")({
32
+ text: maxLength(2048),
33
+ icon_url: Schema.optionalKey(UrlOrAttachment),
34
+ proxy_icon_url: Schema.optionalKey(Schema.String),
35
+ }) {
36
+ }
37
+ /**
38
+ * Image information schema
39
+ */
40
+ export class Image extends Schema.Class("Image")({
41
+ url: UrlOrAttachment,
42
+ proxy_url: Schema.optionalKey(Schema.String),
43
+ height: Schema.optionalKey(positiveInt),
44
+ width: Schema.optionalKey(positiveInt),
45
+ }) {
46
+ }
47
+ /**
48
+ * Thumbnail information schema
49
+ */
50
+ export class Thumbnail extends Schema.Class("Thumbnail")({
51
+ url: UrlOrAttachment,
52
+ proxy_url: Schema.optionalKey(Schema.String),
53
+ height: Schema.optionalKey(positiveInt),
54
+ width: Schema.optionalKey(positiveInt),
55
+ }) {
56
+ }
57
+ /**
58
+ * Video information schema
59
+ */
60
+ export class Video extends Schema.Class("Video")({
61
+ url: Schema.optionalKey(UrlString),
62
+ proxy_url: Schema.optionalKey(Schema.String),
63
+ height: Schema.optionalKey(positiveInt),
64
+ width: Schema.optionalKey(positiveInt),
65
+ }) {
66
+ }
67
+ /**
68
+ * Provider information schema
69
+ */
70
+ export class Provider extends Schema.Class("Provider")({
71
+ name: Schema.optionalKey(Schema.String),
72
+ url: Schema.optionalKey(UrlString),
73
+ }) {
74
+ }
75
+ /**
76
+ * Main Embed schema
77
+ */
78
+ export class Embed extends Schema.Class("Embed")({
79
+ /**
80
+ * Title of the embed.
81
+ * Up to 256 characters.
82
+ */
83
+ title: Schema.optionalKey(maxLength(256)),
84
+ /**
85
+ * Embed type.
86
+ * (Always "rich" for webhook embeds)
87
+ */
88
+ type: Schema.optionalKey(Schema.Literal("rich")),
89
+ /**
90
+ * URL of embed.
91
+ */
92
+ url: Schema.optionalKey(UrlString),
93
+ /**
94
+ * Description of the embed.
95
+ * Up to 4096 characters.
96
+ */
97
+ description: Schema.optionalKey(maxLength(4096)),
98
+ /**
99
+ * ISO8601 timestamp of the embed content.
100
+ */
101
+ timestamp: Schema.optionalKey(ISO8601Timestamp),
102
+ /**
103
+ * Color code of the embed.
104
+ */
105
+ color: Schema.optionalKey(ColorCode),
106
+ /**
107
+ * Footer information.
108
+ */
109
+ footer: Schema.optionalKey(Footer),
110
+ /**
111
+ * Image information.
112
+ */
113
+ image: Schema.optionalKey(Image),
114
+ /**
115
+ * Thumbnail information.
116
+ */
117
+ thumbnail: Schema.optionalKey(Thumbnail),
118
+ /**
119
+ * Video information.
120
+ */
121
+ video: Schema.optionalKey(Video),
122
+ /**
123
+ * Provider information.
124
+ */
125
+ provider: Schema.optionalKey(Provider),
126
+ /**
127
+ * Author information.
128
+ */
129
+ author: Schema.optionalKey(Author),
130
+ /**
131
+ * Fields information.
132
+ * Up to 25 fields.
133
+ */
134
+ fields: Schema.optionalKey(FieldArray),
135
+ }) {
136
+ }
137
+ // Array of embeds with max 10 constraint
138
+ export const EmbedArray = Schema.Array(Embed).pipe(Schema.check(Schema.isMaxLength(10)));
139
+ //# sourceMappingURL=Embed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Embed.js","sourceRoot":"","sources":["../../src/schemas/Embed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EACN,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,SAAS,GACT,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,MAAM,CAAC,KAAK,CAAa,YAAY,CAAC,CAAC;IACtE,GAAG,EAAE,MAAM,CAAC,MAAM;IAClB,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC;CACtC,CAAC;CAAG;AAEL,mCAAmC;AACnC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAErE;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,M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S,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC;IAExC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC;IAEtC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;IAElC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;CACtC,CAAC;CAAG;AAEL,yCAAyC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CACjD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CACpC,CAAC"}
@@ -1,45 +1,24 @@
1
1
  import { Schema } from "effect";
2
- declare const Field_base: Schema.Class<Field, {
2
+ declare const Field_base: Schema.ExtendableClass<Field, Schema.Struct<{
3
3
  /**
4
4
  * Name of the field.
5
5
  * Up to 256 characters.
6
6
  */
7
- name: Schema.filter<typeof Schema.String>;
7
+ readonly name: Schema.String;
8
8
  /**
9
9
  * Value of the field.
10
10
  * Up to 1024 characters.
11
11
  */
12
- value: Schema.filter<typeof Schema.String>;
12
+ readonly value: Schema.String;
13
13
  /**
14
14
  * Whether or not this field should be displayed inline.
15
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
- }, {}, {}>;
16
+ readonly inline: Schema.optionalKey<Schema.Boolean>;
17
+ }>, {}>;
39
18
  /**
40
19
  * Discord embed field schema
41
20
  */
42
21
  export declare class Field extends Field_base {
43
22
  }
44
- export declare const FieldArray: Schema.filter<Schema.Array$<typeof Field>>;
23
+ export declare const FieldArray: Schema.$Array<typeof Field>;
45
24
  export {};
@@ -0,0 +1,25 @@
1
+ import { Schema } from "effect";
2
+ import { maxLength } from "./Common";
3
+ /**
4
+ * Discord embed field schema
5
+ */
6
+ export class Field extends Schema.Class("Field")({
7
+ /**
8
+ * Name of the field.
9
+ * Up to 256 characters.
10
+ */
11
+ name: maxLength(256),
12
+ /**
13
+ * Value of the field.
14
+ * Up to 1024 characters.
15
+ */
16
+ value: maxLength(1024),
17
+ /**
18
+ * Whether or not this field should be displayed inline.
19
+ */
20
+ inline: Schema.optionalKey(Schema.Boolean),
21
+ }) {
22
+ }
23
+ // Array of fields with max 25 constraint
24
+ export const FieldArray = Schema.Array(Field).pipe(Schema.check(Schema.isMaxLength(25)));
25
+ //# sourceMappingURL=Field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.js","sourceRoot":"","sources":["../../src/schemas/Field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,MAAM,CAAC,KAAK,CAAQ,OAAO,CAAC,CAAC;IACvD;;;OAGG;IACH,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC;IAEtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC;CAC1C,CAAC;CAAG;AAEL,yCAAyC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CACjD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CACpC,CAAC"}