@productminds/article-events 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/lib/events/ExternalArticleEvent.d.ts +2 -2
- package/lib/events/InternalArticleEvent.d.ts +20 -36
- package/lib/events/InternalArticleEvent.js +1 -1
- package/lib/types/Article.d.ts +2 -17
- package/lib/types/Article.js +3 -7
- package/package.json +20 -20
- package/lib/events/ArticleEvent.d.ts +0 -70
- package/lib/events/ArticleEvent.js +0 -15
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.
|
|
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.
|
|
395
|
+
id: typeof Schema.NonEmptyString;
|
|
396
396
|
title: typeof Schema.NonEmptyString;
|
|
397
397
|
teaser: typeof Schema.NonEmptyString;
|
|
398
398
|
content: typeof Schema.NonEmptyString;
|
|
@@ -2,7 +2,8 @@ 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.extend<Schema.
|
|
5
|
+
article: Schema.extend<Schema.Struct<{
|
|
6
|
+
id: typeof Schema.NonEmptyString;
|
|
6
7
|
title: typeof Schema.NonEmptyString;
|
|
7
8
|
teaser: typeof Schema.NonEmptyString;
|
|
8
9
|
content: typeof Schema.NonEmptyString;
|
|
@@ -15,14 +16,12 @@ export declare const InternalArticleEventSchema: Schema.Struct<{
|
|
|
15
16
|
name: typeof Schema.NonEmptyString;
|
|
16
17
|
}>>;
|
|
17
18
|
}>, Schema.Struct<{
|
|
18
|
-
id: typeof Schema.NonEmptyString;
|
|
19
|
-
}>>, Schema.Struct<{
|
|
20
19
|
tags: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
21
20
|
type: Schema.Literal<["CATEGORY"]>;
|
|
22
21
|
value: typeof Schema.NonEmptyString;
|
|
23
22
|
}>, Schema.Struct<{
|
|
24
23
|
type: Schema.Literal<["EXTERNAL_ARTICLE_REFERENCE"]>;
|
|
25
|
-
id: typeof Schema.
|
|
24
|
+
id: typeof Schema.NonEmptyString;
|
|
26
25
|
}>, Schema.Struct<{
|
|
27
26
|
type: Schema.Literal<["DRUPAL_EXTERNAL_ID"]>;
|
|
28
27
|
extID: typeof Schema.UUID;
|
|
@@ -38,6 +37,7 @@ declare const _default: {
|
|
|
38
37
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
39
38
|
readonly payload: {
|
|
40
39
|
readonly article: {
|
|
40
|
+
readonly id: string;
|
|
41
41
|
readonly title: string;
|
|
42
42
|
readonly teaser: string;
|
|
43
43
|
readonly content: string;
|
|
@@ -49,8 +49,6 @@ declare const _default: {
|
|
|
49
49
|
readonly authors: readonly {
|
|
50
50
|
readonly name: string;
|
|
51
51
|
}[];
|
|
52
|
-
} & {
|
|
53
|
-
readonly id: string;
|
|
54
52
|
} & {
|
|
55
53
|
readonly tags: readonly ({
|
|
56
54
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -72,6 +70,7 @@ declare const _default: {
|
|
|
72
70
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
73
71
|
readonly payload: {
|
|
74
72
|
readonly article: {
|
|
73
|
+
readonly id: string;
|
|
75
74
|
readonly title: string;
|
|
76
75
|
readonly teaser: string;
|
|
77
76
|
readonly content: string;
|
|
@@ -83,8 +82,6 @@ declare const _default: {
|
|
|
83
82
|
readonly authors: readonly {
|
|
84
83
|
readonly name: string;
|
|
85
84
|
}[];
|
|
86
|
-
} & {
|
|
87
|
-
readonly id: string;
|
|
88
85
|
} & {
|
|
89
86
|
readonly tags: readonly ({
|
|
90
87
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -106,6 +103,7 @@ declare const _default: {
|
|
|
106
103
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
107
104
|
readonly payload: {
|
|
108
105
|
readonly article: {
|
|
106
|
+
readonly id: string;
|
|
109
107
|
readonly title: string;
|
|
110
108
|
readonly teaser: string;
|
|
111
109
|
readonly content: string;
|
|
@@ -117,8 +115,6 @@ declare const _default: {
|
|
|
117
115
|
readonly authors: readonly {
|
|
118
116
|
readonly name: string;
|
|
119
117
|
}[];
|
|
120
|
-
} & {
|
|
121
|
-
readonly id: string;
|
|
122
118
|
} & {
|
|
123
119
|
readonly tags: readonly ({
|
|
124
120
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -139,6 +135,7 @@ declare const _default: {
|
|
|
139
135
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
140
136
|
readonly payload: {
|
|
141
137
|
readonly article: {
|
|
138
|
+
readonly id: string;
|
|
142
139
|
readonly title: string;
|
|
143
140
|
readonly teaser: string;
|
|
144
141
|
readonly content: string;
|
|
@@ -150,8 +147,6 @@ declare const _default: {
|
|
|
150
147
|
readonly authors: readonly {
|
|
151
148
|
readonly name: string;
|
|
152
149
|
}[];
|
|
153
|
-
} & {
|
|
154
|
-
readonly id: string;
|
|
155
150
|
} & {
|
|
156
151
|
readonly tags: readonly ({
|
|
157
152
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -173,6 +168,7 @@ declare const _default: {
|
|
|
173
168
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
174
169
|
readonly payload: {
|
|
175
170
|
readonly article: {
|
|
171
|
+
readonly id: string;
|
|
176
172
|
readonly title: string;
|
|
177
173
|
readonly teaser: string;
|
|
178
174
|
readonly content: string;
|
|
@@ -184,8 +180,6 @@ declare const _default: {
|
|
|
184
180
|
readonly authors: readonly {
|
|
185
181
|
readonly name: string;
|
|
186
182
|
}[];
|
|
187
|
-
} & {
|
|
188
|
-
readonly id: string;
|
|
189
183
|
} & {
|
|
190
184
|
readonly tags: readonly ({
|
|
191
185
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -206,6 +200,7 @@ declare const _default: {
|
|
|
206
200
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
207
201
|
readonly payload: {
|
|
208
202
|
readonly article: {
|
|
203
|
+
readonly id: string;
|
|
209
204
|
readonly title: string;
|
|
210
205
|
readonly teaser: string;
|
|
211
206
|
readonly content: string;
|
|
@@ -217,8 +212,6 @@ declare const _default: {
|
|
|
217
212
|
readonly authors: readonly {
|
|
218
213
|
readonly name: string;
|
|
219
214
|
}[];
|
|
220
|
-
} & {
|
|
221
|
-
readonly id: string;
|
|
222
215
|
} & {
|
|
223
216
|
readonly tags: readonly ({
|
|
224
217
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -240,6 +233,7 @@ declare const _default: {
|
|
|
240
233
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
241
234
|
readonly payload: {
|
|
242
235
|
readonly article: {
|
|
236
|
+
readonly id: string;
|
|
243
237
|
readonly title: string;
|
|
244
238
|
readonly teaser: string;
|
|
245
239
|
readonly content: string;
|
|
@@ -251,8 +245,6 @@ declare const _default: {
|
|
|
251
245
|
readonly authors: readonly {
|
|
252
246
|
readonly name: string;
|
|
253
247
|
}[];
|
|
254
|
-
} & {
|
|
255
|
-
readonly id: string;
|
|
256
248
|
} & {
|
|
257
249
|
readonly tags: readonly ({
|
|
258
250
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -274,6 +266,7 @@ declare const _default: {
|
|
|
274
266
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
275
267
|
readonly payload: {
|
|
276
268
|
readonly article: {
|
|
269
|
+
readonly id: string;
|
|
277
270
|
readonly title: string;
|
|
278
271
|
readonly teaser: string;
|
|
279
272
|
readonly content: string;
|
|
@@ -285,8 +278,6 @@ declare const _default: {
|
|
|
285
278
|
readonly authors: readonly {
|
|
286
279
|
readonly name: string;
|
|
287
280
|
}[];
|
|
288
|
-
} & {
|
|
289
|
-
readonly id: string;
|
|
290
281
|
} & {
|
|
291
282
|
readonly tags: readonly ({
|
|
292
283
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -308,6 +299,7 @@ declare const _default: {
|
|
|
308
299
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
309
300
|
readonly payload: {
|
|
310
301
|
readonly article: {
|
|
302
|
+
readonly id: string;
|
|
311
303
|
readonly title: string;
|
|
312
304
|
readonly teaser: string;
|
|
313
305
|
readonly content: string;
|
|
@@ -319,8 +311,6 @@ declare const _default: {
|
|
|
319
311
|
readonly authors: readonly {
|
|
320
312
|
readonly name: string;
|
|
321
313
|
}[];
|
|
322
|
-
} & {
|
|
323
|
-
readonly id: string;
|
|
324
314
|
} & {
|
|
325
315
|
readonly tags: readonly ({
|
|
326
316
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -342,6 +332,7 @@ declare const _default: {
|
|
|
342
332
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
343
333
|
readonly payload: {
|
|
344
334
|
readonly article: {
|
|
335
|
+
readonly id: string;
|
|
345
336
|
readonly title: string;
|
|
346
337
|
readonly teaser: string;
|
|
347
338
|
readonly content: string;
|
|
@@ -353,8 +344,6 @@ declare const _default: {
|
|
|
353
344
|
readonly authors: readonly {
|
|
354
345
|
readonly name: string;
|
|
355
346
|
}[];
|
|
356
|
-
} & {
|
|
357
|
-
readonly id: string;
|
|
358
347
|
} & {
|
|
359
348
|
readonly tags: readonly ({
|
|
360
349
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -376,6 +365,7 @@ declare const _default: {
|
|
|
376
365
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
377
366
|
readonly payload: {
|
|
378
367
|
readonly article: {
|
|
368
|
+
readonly id: string;
|
|
379
369
|
readonly title: string;
|
|
380
370
|
readonly teaser: string;
|
|
381
371
|
readonly content: string;
|
|
@@ -387,8 +377,6 @@ declare const _default: {
|
|
|
387
377
|
readonly authors: readonly {
|
|
388
378
|
readonly name: string;
|
|
389
379
|
}[];
|
|
390
|
-
} & {
|
|
391
|
-
readonly id: string;
|
|
392
380
|
} & {
|
|
393
381
|
readonly tags: readonly ({
|
|
394
382
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -410,6 +398,7 @@ declare const _default: {
|
|
|
410
398
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
411
399
|
readonly payload: {
|
|
412
400
|
readonly article: {
|
|
401
|
+
readonly id: string;
|
|
413
402
|
readonly title: string;
|
|
414
403
|
readonly teaser: string;
|
|
415
404
|
readonly content: string;
|
|
@@ -421,8 +410,6 @@ declare const _default: {
|
|
|
421
410
|
readonly authors: readonly {
|
|
422
411
|
readonly name: string;
|
|
423
412
|
}[];
|
|
424
|
-
} & {
|
|
425
|
-
readonly id: string;
|
|
426
413
|
} & {
|
|
427
414
|
readonly tags: readonly ({
|
|
428
415
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -444,6 +431,7 @@ declare const _default: {
|
|
|
444
431
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
445
432
|
readonly payload: {
|
|
446
433
|
readonly article: {
|
|
434
|
+
readonly id: string;
|
|
447
435
|
readonly title: string;
|
|
448
436
|
readonly teaser: string;
|
|
449
437
|
readonly content: string;
|
|
@@ -455,8 +443,6 @@ declare const _default: {
|
|
|
455
443
|
readonly authors: readonly {
|
|
456
444
|
readonly name: string;
|
|
457
445
|
}[];
|
|
458
|
-
} & {
|
|
459
|
-
readonly id: string;
|
|
460
446
|
} & {
|
|
461
447
|
readonly tags: readonly ({
|
|
462
448
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -478,6 +464,7 @@ declare const _default: {
|
|
|
478
464
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
|
479
465
|
readonly payload: {
|
|
480
466
|
readonly article: {
|
|
467
|
+
readonly id: string;
|
|
481
468
|
readonly title: string;
|
|
482
469
|
readonly teaser: string;
|
|
483
470
|
readonly content: string;
|
|
@@ -489,8 +476,6 @@ declare const _default: {
|
|
|
489
476
|
readonly authors: readonly {
|
|
490
477
|
readonly name: string;
|
|
491
478
|
}[];
|
|
492
|
-
} & {
|
|
493
|
-
readonly id: string;
|
|
494
479
|
} & {
|
|
495
480
|
readonly tags: readonly ({
|
|
496
481
|
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
@@ -511,7 +496,8 @@ declare const _default: {
|
|
|
511
496
|
Schema: Schema.Struct<{
|
|
512
497
|
kind: Schema.Literal<["INTERNAL_ARTICLE_EVENT"]>;
|
|
513
498
|
payload: Schema.Struct<{
|
|
514
|
-
article: Schema.extend<Schema.
|
|
499
|
+
article: Schema.extend<Schema.Struct<{
|
|
500
|
+
id: typeof Schema.NonEmptyString;
|
|
515
501
|
title: typeof Schema.NonEmptyString;
|
|
516
502
|
teaser: typeof Schema.NonEmptyString;
|
|
517
503
|
content: typeof Schema.NonEmptyString;
|
|
@@ -524,14 +510,12 @@ declare const _default: {
|
|
|
524
510
|
name: typeof Schema.NonEmptyString;
|
|
525
511
|
}>>;
|
|
526
512
|
}>, Schema.Struct<{
|
|
527
|
-
id: typeof Schema.NonEmptyString;
|
|
528
|
-
}>>, Schema.Struct<{
|
|
529
513
|
tags: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
530
514
|
type: Schema.Literal<["CATEGORY"]>;
|
|
531
515
|
value: typeof Schema.NonEmptyString;
|
|
532
516
|
}>, Schema.Struct<{
|
|
533
517
|
type: Schema.Literal<["EXTERNAL_ARTICLE_REFERENCE"]>;
|
|
534
|
-
id: typeof Schema.
|
|
518
|
+
id: typeof Schema.NonEmptyString;
|
|
535
519
|
}>, Schema.Struct<{
|
|
536
520
|
type: Schema.Literal<["DRUPAL_EXTERNAL_ID"]>;
|
|
537
521
|
extID: typeof Schema.UUID;
|
|
@@ -4,7 +4,7 @@ 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 InternalArticleSchema = schema_1.Schema.extend(Article_1.
|
|
7
|
+
const InternalArticleSchema = schema_1.Schema.extend(Article_1.BaseArticleSchema, schema_1.Schema.Struct({
|
|
8
8
|
tags: schema_1.Schema.Array(schema_1.Schema.Union(Article_1.CategoryTagSchema, Article_1.ExternalArticleReferenceTagSchema, Article_1.DrupalExternalIDTag)),
|
|
9
9
|
}));
|
|
10
10
|
exports.InternalArticleEventSchema = schema_1.Schema.Struct({
|
package/lib/types/Article.d.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
20
|
+
id: typeof Schema.NonEmptyString;
|
|
21
21
|
title: typeof Schema.NonEmptyString;
|
|
22
22
|
teaser: typeof Schema.NonEmptyString;
|
|
23
23
|
content: typeof Schema.NonEmptyString;
|
|
@@ -30,18 +30,3 @@ export declare const BaseArticleSchema: Schema.Struct<{
|
|
|
30
30
|
name: typeof Schema.NonEmptyString;
|
|
31
31
|
}>>;
|
|
32
32
|
}>;
|
|
33
|
-
export declare const BaseInternalArticleSchema: Schema.extend<Schema.Struct<{
|
|
34
|
-
title: typeof Schema.NonEmptyString;
|
|
35
|
-
teaser: typeof Schema.NonEmptyString;
|
|
36
|
-
content: typeof Schema.NonEmptyString;
|
|
37
|
-
publishedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
|
38
|
-
updatedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
|
39
|
-
retrievedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
|
40
|
-
url: typeof Schema.NonEmptyString;
|
|
41
|
-
site: typeof Schema.NonEmptyString;
|
|
42
|
-
authors: Schema.Array$<Schema.Struct<{
|
|
43
|
-
name: typeof Schema.NonEmptyString;
|
|
44
|
-
}>>;
|
|
45
|
-
}>, Schema.Struct<{
|
|
46
|
-
id: typeof Schema.NonEmptyString;
|
|
47
|
-
}>>;
|
package/lib/types/Article.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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.DateTimeUtc.annotations({
|
|
6
6
|
jsonSchema: { type: 'string', format: 'date-time' },
|
|
@@ -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.
|
|
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.
|
|
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,
|
|
@@ -35,7 +35,3 @@ exports.BaseArticleSchema = schema_1.Schema.Struct({
|
|
|
35
35
|
site: schema_1.Schema.NonEmptyString,
|
|
36
36
|
authors: schema_1.Schema.Array(exports.AuthorSchema),
|
|
37
37
|
});
|
|
38
|
-
const InternalArticleIDSchema = schema_1.Schema.NonEmptyString;
|
|
39
|
-
exports.BaseInternalArticleSchema = schema_1.Schema.extend(exports.BaseArticleSchema.omit('id'), schema_1.Schema.Struct({
|
|
40
|
-
id: InternalArticleIDSchema,
|
|
41
|
-
}));
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@productminds/article-events",
|
|
3
|
-
"version": "4.
|
|
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.1",
|
|
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);
|