@productminds/article-events 3.0.0 → 4.1.0

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