@productminds/article-events 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,10 @@ export declare const ExternalArticleEventSchema: Schema.Struct<{
3
3
  kind: Schema.Literal<["EXTERNAL_ARTICLE_EVENT"]>;
4
4
  payload: Schema.Struct<{
5
5
  article: Schema.Struct<{
6
+ tags: Schema.Array$<Schema.Struct<{
7
+ type: Schema.Literal<["CATEGORY"]>;
8
+ value: typeof Schema.NonEmpty;
9
+ }>>;
6
10
  id: typeof Schema.UUID;
7
11
  title: typeof Schema.NonEmpty;
8
12
  teaser: typeof Schema.NonEmpty;
@@ -12,21 +16,9 @@ export declare const ExternalArticleEventSchema: Schema.Struct<{
12
16
  retrievedAt: typeof Schema.Date;
13
17
  url: typeof Schema.NonEmpty;
14
18
  site: typeof Schema.NonEmpty;
15
- tags: Schema.Array$<Schema.Union<[Schema.Struct<{
16
- type: Schema.Literal<["CATEGORY"]>;
17
- value: typeof Schema.NonEmpty;
18
- }>, Schema.Struct<{
19
- type: Schema.Literal<["EXTERNAL_ARTICLE_REFERENCE"]>;
20
- id: typeof Schema.UUID;
21
- }>, Schema.Struct<{
22
- type: Schema.Literal<["ENTITY"]>;
23
- entityType: Schema.Literal<["PERSON"]>;
24
- value: typeof Schema.NonEmpty;
25
- }>]>>;
26
19
  authors: Schema.Array$<Schema.Struct<{
27
20
  name: typeof Schema.NonEmpty;
28
21
  }>>;
29
- meta: Schema.optional<typeof Schema.Unknown>;
30
22
  }>;
31
23
  status: Schema.Literal<["NEW", "UPDATED"]>;
32
24
  source: Schema.Literal<["EXTERNAL"]>;
@@ -38,6 +30,7 @@ declare const _default: {
38
30
  readonly payload: {
39
31
  readonly article: {
40
32
  readonly id: string;
33
+ readonly site: string;
41
34
  readonly title: string;
42
35
  readonly teaser: string;
43
36
  readonly content: string;
@@ -45,22 +38,13 @@ declare const _default: {
45
38
  readonly updatedAt: Date;
46
39
  readonly retrievedAt: Date;
47
40
  readonly url: string;
48
- readonly site: string;
49
- readonly tags: readonly ({
41
+ readonly tags: readonly {
50
42
  readonly type: "CATEGORY";
51
43
  readonly value: string;
52
- } | {
53
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
54
- readonly id: string;
55
- } | {
56
- readonly type: "ENTITY";
57
- readonly value: string;
58
- readonly entityType: "PERSON";
59
- })[];
44
+ }[];
60
45
  readonly authors: readonly {
61
46
  readonly name: string;
62
47
  }[];
63
- readonly meta?: unknown;
64
48
  };
65
49
  readonly status: "NEW" | "UPDATED";
66
50
  readonly source: "EXTERNAL";
@@ -71,6 +55,7 @@ declare const _default: {
71
55
  readonly payload: {
72
56
  readonly article: {
73
57
  readonly id: string;
58
+ readonly site: string;
74
59
  readonly title: string;
75
60
  readonly teaser: string;
76
61
  readonly content: string;
@@ -78,22 +63,13 @@ declare const _default: {
78
63
  readonly updatedAt: Date;
79
64
  readonly retrievedAt: Date;
80
65
  readonly url: string;
81
- readonly site: string;
82
- readonly tags: readonly ({
66
+ readonly tags: readonly {
83
67
  readonly type: "CATEGORY";
84
68
  readonly value: string;
85
- } | {
86
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
87
- readonly id: string;
88
- } | {
89
- readonly type: "ENTITY";
90
- readonly value: string;
91
- readonly entityType: "PERSON";
92
- })[];
69
+ }[];
93
70
  readonly authors: readonly {
94
71
  readonly name: string;
95
72
  }[];
96
- readonly meta?: unknown;
97
73
  };
98
74
  readonly status: "NEW" | "UPDATED";
99
75
  readonly source: "EXTERNAL";
@@ -104,6 +80,7 @@ declare const _default: {
104
80
  readonly payload: {
105
81
  readonly article: {
106
82
  readonly id: string;
83
+ readonly site: string;
107
84
  readonly title: string;
108
85
  readonly teaser: string;
109
86
  readonly content: string;
@@ -111,22 +88,13 @@ declare const _default: {
111
88
  readonly updatedAt: Date;
112
89
  readonly retrievedAt: Date;
113
90
  readonly url: string;
114
- readonly site: string;
115
- readonly tags: readonly ({
91
+ readonly tags: readonly {
116
92
  readonly type: "CATEGORY";
117
93
  readonly value: string;
118
- } | {
119
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
120
- readonly id: string;
121
- } | {
122
- readonly type: "ENTITY";
123
- readonly value: string;
124
- readonly entityType: "PERSON";
125
- })[];
94
+ }[];
126
95
  readonly authors: readonly {
127
96
  readonly name: string;
128
97
  }[];
129
- readonly meta?: unknown;
130
98
  };
131
99
  readonly status: "NEW" | "UPDATED";
132
100
  readonly source: "EXTERNAL";
@@ -136,6 +104,7 @@ declare const _default: {
136
104
  readonly payload: {
137
105
  readonly article: {
138
106
  readonly id: string;
107
+ readonly site: string;
139
108
  readonly title: string;
140
109
  readonly teaser: string;
141
110
  readonly content: string;
@@ -143,22 +112,13 @@ declare const _default: {
143
112
  readonly updatedAt: string;
144
113
  readonly retrievedAt: string;
145
114
  readonly url: string;
146
- readonly site: string;
147
- readonly tags: readonly ({
115
+ readonly tags: readonly {
148
116
  readonly type: "CATEGORY";
149
117
  readonly value: string;
150
- } | {
151
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
152
- readonly id: string;
153
- } | {
154
- readonly type: "ENTITY";
155
- readonly value: string;
156
- readonly entityType: "PERSON";
157
- })[];
118
+ }[];
158
119
  readonly authors: readonly {
159
120
  readonly name: string;
160
121
  }[];
161
- readonly meta?: unknown;
162
122
  };
163
123
  readonly status: "NEW" | "UPDATED";
164
124
  readonly source: "EXTERNAL";
@@ -169,6 +129,7 @@ declare const _default: {
169
129
  readonly payload: {
170
130
  readonly article: {
171
131
  readonly id: string;
132
+ readonly site: string;
172
133
  readonly title: string;
173
134
  readonly teaser: string;
174
135
  readonly content: string;
@@ -176,22 +137,13 @@ declare const _default: {
176
137
  readonly updatedAt: Date;
177
138
  readonly retrievedAt: Date;
178
139
  readonly url: string;
179
- readonly site: string;
180
- readonly tags: readonly ({
140
+ readonly tags: readonly {
181
141
  readonly type: "CATEGORY";
182
142
  readonly value: string;
183
- } | {
184
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
185
- readonly id: string;
186
- } | {
187
- readonly type: "ENTITY";
188
- readonly value: string;
189
- readonly entityType: "PERSON";
190
- })[];
143
+ }[];
191
144
  readonly authors: readonly {
192
145
  readonly name: string;
193
146
  }[];
194
- readonly meta?: unknown;
195
147
  };
196
148
  readonly status: "NEW" | "UPDATED";
197
149
  readonly source: "EXTERNAL";
@@ -201,6 +153,7 @@ declare const _default: {
201
153
  readonly payload: {
202
154
  readonly article: {
203
155
  readonly id: string;
156
+ readonly site: string;
204
157
  readonly title: string;
205
158
  readonly teaser: string;
206
159
  readonly content: string;
@@ -208,22 +161,13 @@ declare const _default: {
208
161
  readonly updatedAt: string;
209
162
  readonly retrievedAt: string;
210
163
  readonly url: string;
211
- readonly site: string;
212
- readonly tags: readonly ({
164
+ readonly tags: readonly {
213
165
  readonly type: "CATEGORY";
214
166
  readonly value: string;
215
- } | {
216
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
217
- readonly id: string;
218
- } | {
219
- readonly type: "ENTITY";
220
- readonly value: string;
221
- readonly entityType: "PERSON";
222
- })[];
167
+ }[];
223
168
  readonly authors: readonly {
224
169
  readonly name: string;
225
170
  }[];
226
- readonly meta?: unknown;
227
171
  };
228
172
  readonly status: "NEW" | "UPDATED";
229
173
  readonly source: "EXTERNAL";
@@ -234,6 +178,7 @@ declare const _default: {
234
178
  readonly payload: {
235
179
  readonly article: {
236
180
  readonly id: string;
181
+ readonly site: string;
237
182
  readonly title: string;
238
183
  readonly teaser: string;
239
184
  readonly content: string;
@@ -241,22 +186,13 @@ declare const _default: {
241
186
  readonly updatedAt: Date;
242
187
  readonly retrievedAt: Date;
243
188
  readonly url: string;
244
- readonly site: string;
245
- readonly tags: readonly ({
189
+ readonly tags: readonly {
246
190
  readonly type: "CATEGORY";
247
191
  readonly value: string;
248
- } | {
249
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
250
- readonly id: string;
251
- } | {
252
- readonly type: "ENTITY";
253
- readonly value: string;
254
- readonly entityType: "PERSON";
255
- })[];
192
+ }[];
256
193
  readonly authors: readonly {
257
194
  readonly name: string;
258
195
  }[];
259
- readonly meta?: unknown;
260
196
  };
261
197
  readonly status: "NEW" | "UPDATED";
262
198
  readonly source: "EXTERNAL";
@@ -267,6 +203,7 @@ declare const _default: {
267
203
  readonly payload: {
268
204
  readonly article: {
269
205
  readonly id: string;
206
+ readonly site: string;
270
207
  readonly title: string;
271
208
  readonly teaser: string;
272
209
  readonly content: string;
@@ -274,22 +211,13 @@ declare const _default: {
274
211
  readonly updatedAt: Date;
275
212
  readonly retrievedAt: Date;
276
213
  readonly url: string;
277
- readonly site: string;
278
- readonly tags: readonly ({
214
+ readonly tags: readonly {
279
215
  readonly type: "CATEGORY";
280
216
  readonly value: string;
281
- } | {
282
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
283
- readonly id: string;
284
- } | {
285
- readonly type: "ENTITY";
286
- readonly value: string;
287
- readonly entityType: "PERSON";
288
- })[];
217
+ }[];
289
218
  readonly authors: readonly {
290
219
  readonly name: string;
291
220
  }[];
292
- readonly meta?: unknown;
293
221
  };
294
222
  readonly status: "NEW" | "UPDATED";
295
223
  readonly source: "EXTERNAL";
@@ -300,6 +228,7 @@ declare const _default: {
300
228
  readonly payload: {
301
229
  readonly article: {
302
230
  readonly id: string;
231
+ readonly site: string;
303
232
  readonly title: string;
304
233
  readonly teaser: string;
305
234
  readonly content: string;
@@ -307,22 +236,13 @@ declare const _default: {
307
236
  readonly updatedAt: Date;
308
237
  readonly retrievedAt: Date;
309
238
  readonly url: string;
310
- readonly site: string;
311
- readonly tags: readonly ({
239
+ readonly tags: readonly {
312
240
  readonly type: "CATEGORY";
313
241
  readonly value: string;
314
- } | {
315
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
316
- readonly id: string;
317
- } | {
318
- readonly type: "ENTITY";
319
- readonly value: string;
320
- readonly entityType: "PERSON";
321
- })[];
242
+ }[];
322
243
  readonly authors: readonly {
323
244
  readonly name: string;
324
245
  }[];
325
- readonly meta?: unknown;
326
246
  };
327
247
  readonly status: "NEW" | "UPDATED";
328
248
  readonly source: "EXTERNAL";
@@ -333,6 +253,7 @@ declare const _default: {
333
253
  readonly payload: {
334
254
  readonly article: {
335
255
  readonly id: string;
256
+ readonly site: string;
336
257
  readonly title: string;
337
258
  readonly teaser: string;
338
259
  readonly content: string;
@@ -340,22 +261,13 @@ declare const _default: {
340
261
  readonly updatedAt: Date;
341
262
  readonly retrievedAt: Date;
342
263
  readonly url: string;
343
- readonly site: string;
344
- readonly tags: readonly ({
264
+ readonly tags: readonly {
345
265
  readonly type: "CATEGORY";
346
266
  readonly value: string;
347
- } | {
348
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
349
- readonly id: string;
350
- } | {
351
- readonly type: "ENTITY";
352
- readonly value: string;
353
- readonly entityType: "PERSON";
354
- })[];
267
+ }[];
355
268
  readonly authors: readonly {
356
269
  readonly name: string;
357
270
  }[];
358
- readonly meta?: unknown;
359
271
  };
360
272
  readonly status: "NEW" | "UPDATED";
361
273
  readonly source: "EXTERNAL";
@@ -366,6 +278,7 @@ declare const _default: {
366
278
  readonly payload: {
367
279
  readonly article: {
368
280
  readonly id: string;
281
+ readonly site: string;
369
282
  readonly title: string;
370
283
  readonly teaser: string;
371
284
  readonly content: string;
@@ -373,22 +286,13 @@ declare const _default: {
373
286
  readonly updatedAt: Date;
374
287
  readonly retrievedAt: Date;
375
288
  readonly url: string;
376
- readonly site: string;
377
- readonly tags: readonly ({
289
+ readonly tags: readonly {
378
290
  readonly type: "CATEGORY";
379
291
  readonly value: string;
380
- } | {
381
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
382
- readonly id: string;
383
- } | {
384
- readonly type: "ENTITY";
385
- readonly value: string;
386
- readonly entityType: "PERSON";
387
- })[];
292
+ }[];
388
293
  readonly authors: readonly {
389
294
  readonly name: string;
390
295
  }[];
391
- readonly meta?: unknown;
392
296
  };
393
297
  readonly status: "NEW" | "UPDATED";
394
298
  readonly source: "EXTERNAL";
@@ -399,6 +303,7 @@ declare const _default: {
399
303
  readonly payload: {
400
304
  readonly article: {
401
305
  readonly id: string;
306
+ readonly site: string;
402
307
  readonly title: string;
403
308
  readonly teaser: string;
404
309
  readonly content: string;
@@ -406,22 +311,13 @@ declare const _default: {
406
311
  readonly updatedAt: Date;
407
312
  readonly retrievedAt: Date;
408
313
  readonly url: string;
409
- readonly site: string;
410
- readonly tags: readonly ({
314
+ readonly tags: readonly {
411
315
  readonly type: "CATEGORY";
412
316
  readonly value: string;
413
- } | {
414
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
415
- readonly id: string;
416
- } | {
417
- readonly type: "ENTITY";
418
- readonly value: string;
419
- readonly entityType: "PERSON";
420
- })[];
317
+ }[];
421
318
  readonly authors: readonly {
422
319
  readonly name: string;
423
320
  }[];
424
- readonly meta?: unknown;
425
321
  };
426
322
  readonly status: "NEW" | "UPDATED";
427
323
  readonly source: "EXTERNAL";
@@ -432,6 +328,7 @@ declare const _default: {
432
328
  readonly payload: {
433
329
  readonly article: {
434
330
  readonly id: string;
331
+ readonly site: string;
435
332
  readonly title: string;
436
333
  readonly teaser: string;
437
334
  readonly content: string;
@@ -439,22 +336,13 @@ declare const _default: {
439
336
  readonly updatedAt: Date;
440
337
  readonly retrievedAt: Date;
441
338
  readonly url: string;
442
- readonly site: string;
443
- readonly tags: readonly ({
339
+ readonly tags: readonly {
444
340
  readonly type: "CATEGORY";
445
341
  readonly value: string;
446
- } | {
447
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
448
- readonly id: string;
449
- } | {
450
- readonly type: "ENTITY";
451
- readonly value: string;
452
- readonly entityType: "PERSON";
453
- })[];
342
+ }[];
454
343
  readonly authors: readonly {
455
344
  readonly name: string;
456
345
  }[];
457
- readonly meta?: unknown;
458
346
  };
459
347
  readonly status: "NEW" | "UPDATED";
460
348
  readonly source: "EXTERNAL";
@@ -465,6 +353,7 @@ declare const _default: {
465
353
  readonly payload: {
466
354
  readonly article: {
467
355
  readonly id: string;
356
+ readonly site: string;
468
357
  readonly title: string;
469
358
  readonly teaser: string;
470
359
  readonly content: string;
@@ -472,22 +361,13 @@ declare const _default: {
472
361
  readonly updatedAt: Date;
473
362
  readonly retrievedAt: Date;
474
363
  readonly url: string;
475
- readonly site: string;
476
- readonly tags: readonly ({
364
+ readonly tags: readonly {
477
365
  readonly type: "CATEGORY";
478
366
  readonly value: string;
479
- } | {
480
- readonly type: "EXTERNAL_ARTICLE_REFERENCE";
481
- readonly id: string;
482
- } | {
483
- readonly type: "ENTITY";
484
- readonly value: string;
485
- readonly entityType: "PERSON";
486
- })[];
367
+ }[];
487
368
  readonly authors: readonly {
488
369
  readonly name: string;
489
370
  }[];
490
- readonly meta?: unknown;
491
371
  };
492
372
  readonly status: "NEW" | "UPDATED";
493
373
  readonly source: "EXTERNAL";
@@ -497,6 +377,10 @@ declare const _default: {
497
377
  kind: Schema.Literal<["EXTERNAL_ARTICLE_EVENT"]>;
498
378
  payload: Schema.Struct<{
499
379
  article: Schema.Struct<{
380
+ tags: Schema.Array$<Schema.Struct<{
381
+ type: Schema.Literal<["CATEGORY"]>;
382
+ value: typeof Schema.NonEmpty;
383
+ }>>;
500
384
  id: typeof Schema.UUID;
501
385
  title: typeof Schema.NonEmpty;
502
386
  teaser: typeof Schema.NonEmpty;
@@ -506,21 +390,9 @@ declare const _default: {
506
390
  retrievedAt: typeof Schema.Date;
507
391
  url: typeof Schema.NonEmpty;
508
392
  site: typeof Schema.NonEmpty;
509
- tags: Schema.Array$<Schema.Union<[Schema.Struct<{
510
- type: Schema.Literal<["CATEGORY"]>;
511
- value: typeof Schema.NonEmpty;
512
- }>, Schema.Struct<{
513
- type: Schema.Literal<["EXTERNAL_ARTICLE_REFERENCE"]>;
514
- id: typeof Schema.UUID;
515
- }>, Schema.Struct<{
516
- type: Schema.Literal<["ENTITY"]>;
517
- entityType: Schema.Literal<["PERSON"]>;
518
- value: typeof Schema.NonEmpty;
519
- }>]>>;
520
393
  authors: Schema.Array$<Schema.Struct<{
521
394
  name: typeof Schema.NonEmpty;
522
395
  }>>;
523
- meta: Schema.optional<typeof Schema.Unknown>;
524
396
  }>;
525
397
  status: Schema.Literal<["NEW", "UPDATED"]>;
526
398
  source: Schema.Literal<["EXTERNAL"]>;
@@ -3,14 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExternalArticleEventSchema = void 0;
4
4
  const schema_1 = require("@effect/schema");
5
5
  const Article_1 = require("../types/Article");
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) }));
6
9
  exports.ExternalArticleEventSchema = schema_1.Schema.Struct({
7
10
  kind: schema_1.Schema.Literal('EXTERNAL_ARTICLE_EVENT'),
8
11
  payload: schema_1.Schema.Struct({
9
- article: Article_1.ArticleSchema,
12
+ article: ArticleSchema,
10
13
  status: schema_1.Schema.Literal('NEW', 'UPDATED'),
11
- source: schema_1.Schema.Literal('EXTERNAL')
12
- })
14
+ source: schema_1.Schema.Literal('EXTERNAL'),
15
+ }),
13
16
  });
14
- const makeHelpers_1 = require("../utils/makeHelpers");
15
17
  const helpers = (0, makeHelpers_1.makeHelpers)(exports.ExternalArticleEventSchema);
16
18
  exports.default = Object.assign({ Schema: exports.ExternalArticleEventSchema }, helpers);