@productminds/article-events 4.1.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,198 +34,464 @@ 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 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
- }[];
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
+ };
49
68
  }, import("@effect/schema/ParseResult").ParseError>;
50
69
  decodeExn: (u: unknown) => {
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
- }[];
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
+ };
63
101
  };
64
102
  encode: (a: {
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
- }[];
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
+ };
77
134
  }, overrideOptions?: import("@effect/schema/AST").ParseOptions) => import("effect/Either").Either<{
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
- }[];
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
+ };
90
166
  }, import("@effect/schema/ParseResult").ParseError>;
91
167
  encodeExn: (event: {
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
- }[];
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
+ };
104
199
  }) => {
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
- }[];
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
+ };
117
231
  };
118
232
  fromString: (msg: string) => import("effect/Either").Either<{
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
- }[];
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
+ };
131
264
  }, import("@effect/schema/ParseResult").ParseError>;
132
265
  fromBuffer: (msg: Buffer) => import("effect/Either").Either<{
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
- }[];
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
+ };
145
297
  }, import("@effect/schema/ParseResult").ParseError>;
146
298
  fromStringExn: (msg: string) => {
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
- }[];
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
+ };
159
330
  };
160
331
  fromBufferExn: (msg: Buffer) => {
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
- }[];
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
+ };
173
363
  };
174
364
  toString: (event: {
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
- }[];
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
+ };
187
396
  }) => string;
188
397
  toBuffer: (event: {
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
- }[];
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
+ };
201
429
  }) => Buffer;
202
430
  toStringExn: (event: {
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
- }[];
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
+ };
215
462
  }) => string;
216
463
  toBufferExn: (event: {
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
- }[];
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
+ };
229
495
  }) => Buffer;
230
496
  Schema: Schema.Struct<{
231
497
  kind: Schema.Literal<["INTERNAL_ARTICLE_EVENT"]>;
@@ -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)(Article_1.BaseArticleSchema);
18
+ const helpers = (0, makeHelpers_1.makeHelpers)(exports.InternalArticleEventSchema);
19
19
  exports.default = Object.assign({ Schema: exports.InternalArticleEventSchema }, helpers);