@productminds/article-events 0.0.11 → 1.0.1

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