@productminds/article-events 0.0.11 → 1.0.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.
@@ -2,11 +2,7 @@ import { Schema } from '@effect/schema';
2
2
  export declare const ExternalArticleEventSchema: Schema.Struct<{
3
3
  kind: Schema.Literal<["EXTERNAL_ARTICLE_EVENT"]>;
4
4
  payload: Schema.Struct<{
5
- article: Schema.Struct<{
6
- tags: Schema.Array$<Schema.Struct<{
7
- type: Schema.Literal<["CATEGORY"]>;
8
- value: typeof Schema.NonEmpty;
9
- }>>;
5
+ article: Schema.extend<Schema.Struct<{
10
6
  id: typeof Schema.UUID;
11
7
  title: typeof Schema.NonEmpty;
12
8
  teaser: typeof Schema.NonEmpty;
@@ -19,7 +15,12 @@ export declare const ExternalArticleEventSchema: Schema.Struct<{
19
15
  authors: Schema.Array$<Schema.Struct<{
20
16
  name: typeof Schema.NonEmpty;
21
17
  }>>;
22
- }>;
18
+ }>, Schema.Struct<{
19
+ tags: Schema.Array$<Schema.Struct<{
20
+ type: Schema.Literal<["CATEGORY"]>;
21
+ value: typeof Schema.NonEmpty;
22
+ }>>;
23
+ }>>;
23
24
  status: Schema.Literal<["NEW", "UPDATED"]>;
24
25
  source: Schema.Literal<["EXTERNAL"]>;
25
26
  }>;
@@ -30,7 +31,6 @@ declare const _default: {
30
31
  readonly payload: {
31
32
  readonly article: {
32
33
  readonly id: string;
33
- readonly site: string;
34
34
  readonly title: string;
35
35
  readonly teaser: string;
36
36
  readonly content: string;
@@ -38,13 +38,15 @@ declare const _default: {
38
38
  readonly updatedAt: Date;
39
39
  readonly retrievedAt: Date;
40
40
  readonly url: string;
41
+ readonly site: string;
42
+ readonly authors: readonly {
43
+ readonly name: string;
44
+ }[];
45
+ } & {
41
46
  readonly tags: readonly {
42
47
  readonly type: "CATEGORY";
43
48
  readonly value: string;
44
49
  }[];
45
- readonly authors: readonly {
46
- readonly name: string;
47
- }[];
48
50
  };
49
51
  readonly status: "NEW" | "UPDATED";
50
52
  readonly source: "EXTERNAL";
@@ -55,7 +57,6 @@ declare const _default: {
55
57
  readonly payload: {
56
58
  readonly article: {
57
59
  readonly id: string;
58
- readonly site: string;
59
60
  readonly title: string;
60
61
  readonly teaser: string;
61
62
  readonly content: string;
@@ -63,13 +64,15 @@ declare const _default: {
63
64
  readonly updatedAt: Date;
64
65
  readonly retrievedAt: Date;
65
66
  readonly url: string;
67
+ readonly site: string;
68
+ readonly authors: readonly {
69
+ readonly name: string;
70
+ }[];
71
+ } & {
66
72
  readonly tags: readonly {
67
73
  readonly type: "CATEGORY";
68
74
  readonly value: string;
69
75
  }[];
70
- readonly authors: readonly {
71
- readonly name: string;
72
- }[];
73
76
  };
74
77
  readonly status: "NEW" | "UPDATED";
75
78
  readonly source: "EXTERNAL";
@@ -80,7 +83,6 @@ declare const _default: {
80
83
  readonly payload: {
81
84
  readonly article: {
82
85
  readonly id: string;
83
- readonly site: string;
84
86
  readonly title: string;
85
87
  readonly teaser: string;
86
88
  readonly content: string;
@@ -88,13 +90,15 @@ declare const _default: {
88
90
  readonly updatedAt: Date;
89
91
  readonly retrievedAt: Date;
90
92
  readonly url: string;
93
+ readonly site: string;
94
+ readonly authors: readonly {
95
+ readonly name: string;
96
+ }[];
97
+ } & {
91
98
  readonly tags: readonly {
92
99
  readonly type: "CATEGORY";
93
100
  readonly value: string;
94
101
  }[];
95
- readonly authors: readonly {
96
- readonly name: string;
97
- }[];
98
102
  };
99
103
  readonly status: "NEW" | "UPDATED";
100
104
  readonly source: "EXTERNAL";
@@ -104,7 +108,6 @@ declare const _default: {
104
108
  readonly payload: {
105
109
  readonly article: {
106
110
  readonly id: string;
107
- readonly site: string;
108
111
  readonly title: string;
109
112
  readonly teaser: string;
110
113
  readonly content: string;
@@ -112,13 +115,15 @@ declare const _default: {
112
115
  readonly updatedAt: string;
113
116
  readonly retrievedAt: string;
114
117
  readonly url: string;
118
+ readonly site: string;
119
+ readonly authors: readonly {
120
+ readonly name: string;
121
+ }[];
122
+ } & {
115
123
  readonly tags: readonly {
116
124
  readonly type: "CATEGORY";
117
125
  readonly value: string;
118
126
  }[];
119
- readonly authors: readonly {
120
- readonly name: string;
121
- }[];
122
127
  };
123
128
  readonly status: "NEW" | "UPDATED";
124
129
  readonly source: "EXTERNAL";
@@ -129,7 +134,6 @@ declare const _default: {
129
134
  readonly payload: {
130
135
  readonly article: {
131
136
  readonly id: string;
132
- readonly site: string;
133
137
  readonly title: string;
134
138
  readonly teaser: string;
135
139
  readonly content: string;
@@ -137,13 +141,15 @@ declare const _default: {
137
141
  readonly updatedAt: Date;
138
142
  readonly retrievedAt: Date;
139
143
  readonly url: string;
144
+ readonly site: string;
145
+ readonly authors: readonly {
146
+ readonly name: string;
147
+ }[];
148
+ } & {
140
149
  readonly tags: readonly {
141
150
  readonly type: "CATEGORY";
142
151
  readonly value: string;
143
152
  }[];
144
- readonly authors: readonly {
145
- readonly name: string;
146
- }[];
147
153
  };
148
154
  readonly status: "NEW" | "UPDATED";
149
155
  readonly source: "EXTERNAL";
@@ -153,7 +159,6 @@ declare const _default: {
153
159
  readonly payload: {
154
160
  readonly article: {
155
161
  readonly id: string;
156
- readonly site: string;
157
162
  readonly title: string;
158
163
  readonly teaser: string;
159
164
  readonly content: string;
@@ -161,13 +166,15 @@ declare const _default: {
161
166
  readonly updatedAt: string;
162
167
  readonly retrievedAt: string;
163
168
  readonly url: string;
169
+ readonly site: string;
170
+ readonly authors: readonly {
171
+ readonly name: string;
172
+ }[];
173
+ } & {
164
174
  readonly tags: readonly {
165
175
  readonly type: "CATEGORY";
166
176
  readonly value: string;
167
177
  }[];
168
- readonly authors: readonly {
169
- readonly name: string;
170
- }[];
171
178
  };
172
179
  readonly status: "NEW" | "UPDATED";
173
180
  readonly source: "EXTERNAL";
@@ -178,7 +185,6 @@ declare const _default: {
178
185
  readonly payload: {
179
186
  readonly article: {
180
187
  readonly id: string;
181
- readonly site: string;
182
188
  readonly title: string;
183
189
  readonly teaser: string;
184
190
  readonly content: string;
@@ -186,13 +192,15 @@ declare const _default: {
186
192
  readonly updatedAt: Date;
187
193
  readonly retrievedAt: Date;
188
194
  readonly url: string;
195
+ readonly site: string;
196
+ readonly authors: readonly {
197
+ readonly name: string;
198
+ }[];
199
+ } & {
189
200
  readonly tags: readonly {
190
201
  readonly type: "CATEGORY";
191
202
  readonly value: string;
192
203
  }[];
193
- readonly authors: readonly {
194
- readonly name: string;
195
- }[];
196
204
  };
197
205
  readonly status: "NEW" | "UPDATED";
198
206
  readonly source: "EXTERNAL";
@@ -203,7 +211,6 @@ declare const _default: {
203
211
  readonly payload: {
204
212
  readonly article: {
205
213
  readonly id: string;
206
- readonly site: string;
207
214
  readonly title: string;
208
215
  readonly teaser: string;
209
216
  readonly content: string;
@@ -211,13 +218,15 @@ declare const _default: {
211
218
  readonly updatedAt: Date;
212
219
  readonly retrievedAt: Date;
213
220
  readonly url: string;
221
+ readonly site: string;
222
+ readonly authors: readonly {
223
+ readonly name: string;
224
+ }[];
225
+ } & {
214
226
  readonly tags: readonly {
215
227
  readonly type: "CATEGORY";
216
228
  readonly value: string;
217
229
  }[];
218
- readonly authors: readonly {
219
- readonly name: string;
220
- }[];
221
230
  };
222
231
  readonly status: "NEW" | "UPDATED";
223
232
  readonly source: "EXTERNAL";
@@ -228,7 +237,6 @@ declare const _default: {
228
237
  readonly payload: {
229
238
  readonly article: {
230
239
  readonly id: string;
231
- readonly site: string;
232
240
  readonly title: string;
233
241
  readonly teaser: string;
234
242
  readonly content: string;
@@ -236,13 +244,15 @@ declare const _default: {
236
244
  readonly updatedAt: Date;
237
245
  readonly retrievedAt: Date;
238
246
  readonly url: string;
247
+ readonly site: string;
248
+ readonly authors: readonly {
249
+ readonly name: string;
250
+ }[];
251
+ } & {
239
252
  readonly tags: readonly {
240
253
  readonly type: "CATEGORY";
241
254
  readonly value: string;
242
255
  }[];
243
- readonly authors: readonly {
244
- readonly name: string;
245
- }[];
246
256
  };
247
257
  readonly status: "NEW" | "UPDATED";
248
258
  readonly source: "EXTERNAL";
@@ -253,7 +263,6 @@ declare const _default: {
253
263
  readonly payload: {
254
264
  readonly article: {
255
265
  readonly id: string;
256
- readonly site: string;
257
266
  readonly title: string;
258
267
  readonly teaser: string;
259
268
  readonly content: string;
@@ -261,13 +270,15 @@ declare const _default: {
261
270
  readonly updatedAt: Date;
262
271
  readonly retrievedAt: Date;
263
272
  readonly url: string;
273
+ readonly site: string;
274
+ readonly authors: readonly {
275
+ readonly name: string;
276
+ }[];
277
+ } & {
264
278
  readonly tags: readonly {
265
279
  readonly type: "CATEGORY";
266
280
  readonly value: string;
267
281
  }[];
268
- readonly authors: readonly {
269
- readonly name: string;
270
- }[];
271
282
  };
272
283
  readonly status: "NEW" | "UPDATED";
273
284
  readonly source: "EXTERNAL";
@@ -278,7 +289,6 @@ declare const _default: {
278
289
  readonly payload: {
279
290
  readonly article: {
280
291
  readonly id: string;
281
- readonly site: string;
282
292
  readonly title: string;
283
293
  readonly teaser: string;
284
294
  readonly content: string;
@@ -286,13 +296,15 @@ declare const _default: {
286
296
  readonly updatedAt: Date;
287
297
  readonly retrievedAt: Date;
288
298
  readonly url: string;
299
+ readonly site: string;
300
+ readonly authors: readonly {
301
+ readonly name: string;
302
+ }[];
303
+ } & {
289
304
  readonly tags: readonly {
290
305
  readonly type: "CATEGORY";
291
306
  readonly value: string;
292
307
  }[];
293
- readonly authors: readonly {
294
- readonly name: string;
295
- }[];
296
308
  };
297
309
  readonly status: "NEW" | "UPDATED";
298
310
  readonly source: "EXTERNAL";
@@ -303,7 +315,6 @@ declare const _default: {
303
315
  readonly payload: {
304
316
  readonly article: {
305
317
  readonly id: string;
306
- readonly site: string;
307
318
  readonly title: string;
308
319
  readonly teaser: string;
309
320
  readonly content: string;
@@ -311,13 +322,15 @@ declare const _default: {
311
322
  readonly updatedAt: Date;
312
323
  readonly retrievedAt: Date;
313
324
  readonly url: string;
325
+ readonly site: string;
326
+ readonly authors: readonly {
327
+ readonly name: string;
328
+ }[];
329
+ } & {
314
330
  readonly tags: readonly {
315
331
  readonly type: "CATEGORY";
316
332
  readonly value: string;
317
333
  }[];
318
- readonly authors: readonly {
319
- readonly name: string;
320
- }[];
321
334
  };
322
335
  readonly status: "NEW" | "UPDATED";
323
336
  readonly source: "EXTERNAL";
@@ -328,7 +341,6 @@ declare const _default: {
328
341
  readonly payload: {
329
342
  readonly article: {
330
343
  readonly id: string;
331
- readonly site: string;
332
344
  readonly title: string;
333
345
  readonly teaser: string;
334
346
  readonly content: string;
@@ -336,13 +348,15 @@ declare const _default: {
336
348
  readonly updatedAt: Date;
337
349
  readonly retrievedAt: Date;
338
350
  readonly url: string;
351
+ readonly site: string;
352
+ readonly authors: readonly {
353
+ readonly name: string;
354
+ }[];
355
+ } & {
339
356
  readonly tags: readonly {
340
357
  readonly type: "CATEGORY";
341
358
  readonly value: string;
342
359
  }[];
343
- readonly authors: readonly {
344
- readonly name: string;
345
- }[];
346
360
  };
347
361
  readonly status: "NEW" | "UPDATED";
348
362
  readonly source: "EXTERNAL";
@@ -353,7 +367,6 @@ declare const _default: {
353
367
  readonly payload: {
354
368
  readonly article: {
355
369
  readonly id: string;
356
- readonly site: string;
357
370
  readonly title: string;
358
371
  readonly teaser: string;
359
372
  readonly content: string;
@@ -361,13 +374,15 @@ declare const _default: {
361
374
  readonly updatedAt: Date;
362
375
  readonly retrievedAt: Date;
363
376
  readonly url: string;
377
+ readonly site: string;
378
+ readonly authors: readonly {
379
+ readonly name: string;
380
+ }[];
381
+ } & {
364
382
  readonly tags: readonly {
365
383
  readonly type: "CATEGORY";
366
384
  readonly value: string;
367
385
  }[];
368
- readonly authors: readonly {
369
- readonly name: string;
370
- }[];
371
386
  };
372
387
  readonly status: "NEW" | "UPDATED";
373
388
  readonly source: "EXTERNAL";
@@ -376,11 +391,7 @@ declare const _default: {
376
391
  Schema: Schema.Struct<{
377
392
  kind: Schema.Literal<["EXTERNAL_ARTICLE_EVENT"]>;
378
393
  payload: Schema.Struct<{
379
- article: Schema.Struct<{
380
- tags: Schema.Array$<Schema.Struct<{
381
- type: Schema.Literal<["CATEGORY"]>;
382
- value: typeof Schema.NonEmpty;
383
- }>>;
394
+ article: Schema.extend<Schema.Struct<{
384
395
  id: typeof Schema.UUID;
385
396
  title: typeof Schema.NonEmpty;
386
397
  teaser: typeof Schema.NonEmpty;
@@ -393,7 +404,12 @@ declare const _default: {
393
404
  authors: Schema.Array$<Schema.Struct<{
394
405
  name: typeof Schema.NonEmpty;
395
406
  }>>;
396
- }>;
407
+ }>, Schema.Struct<{
408
+ tags: Schema.Array$<Schema.Struct<{
409
+ type: Schema.Literal<["CATEGORY"]>;
410
+ value: typeof Schema.NonEmpty;
411
+ }>>;
412
+ }>>;
397
413
  status: Schema.Literal<["NEW", "UPDATED"]>;
398
414
  source: Schema.Literal<["EXTERNAL"]>;
399
415
  }>;
@@ -4,12 +4,13 @@ exports.ExternalArticleEventSchema = void 0;
4
4
  const schema_1 = require("@effect/schema");
5
5
  const Article_1 = require("../types/Article");
6
6
  const makeHelpers_1 = require("../utils/makeHelpers");
7
- const TagSchema = schema_1.Schema.Union(Article_1.CategoryTagSchema);
8
- const ArticleSchema = schema_1.Schema.Struct(Object.assign(Object.assign({}, Article_1.ArticleSchema.fields), { tags: schema_1.Schema.Array(TagSchema) }));
7
+ const ExternalArticleSchema = schema_1.Schema.extend(Article_1.BaseArticleSchema, schema_1.Schema.Struct({
8
+ tags: schema_1.Schema.Array(Article_1.CategoryTagSchema),
9
+ }));
9
10
  exports.ExternalArticleEventSchema = schema_1.Schema.Struct({
10
11
  kind: schema_1.Schema.Literal('EXTERNAL_ARTICLE_EVENT'),
11
12
  payload: schema_1.Schema.Struct({
12
- article: ArticleSchema,
13
+ article: ExternalArticleSchema,
13
14
  status: schema_1.Schema.Literal('NEW', 'UPDATED'),
14
15
  source: schema_1.Schema.Literal('EXTERNAL'),
15
16
  }),