@productminds/article-events 6.0.0 → 6.2.0
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 +29 -12
- package/lib/events/InternalArticleEvent.js +1 -0
- package/lib/types/Article.d.ts +4 -4
- package/lib/types/ReusePolicy.d.ts +2 -0
- package/lib/types/ReusePolicy.js +5 -0
- 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
|
+
```
|
@@ -7,7 +7,7 @@ export declare const ExternalArticleEventSchema: Schema.Struct<{
|
|
7
7
|
url: typeof Schema.NonEmptyString;
|
8
8
|
site: typeof Schema.NonEmptyString;
|
9
9
|
content: typeof Schema.NonEmptyString;
|
10
|
-
retrievedAt: Schema.transformOrFail<Schema.
|
10
|
+
retrievedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
11
11
|
}>, Schema.SchemaClass<{
|
12
12
|
readonly title?: string | undefined;
|
13
13
|
readonly teaser?: string | undefined;
|
@@ -424,7 +424,7 @@ declare const _default: {
|
|
424
424
|
url: typeof Schema.NonEmptyString;
|
425
425
|
site: typeof Schema.NonEmptyString;
|
426
426
|
content: typeof Schema.NonEmptyString;
|
427
|
-
retrievedAt: Schema.transformOrFail<Schema.
|
427
|
+
retrievedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
428
428
|
}>, Schema.SchemaClass<{
|
429
429
|
readonly title?: string | undefined;
|
430
430
|
readonly teaser?: string | undefined;
|
@@ -2,7 +2,7 @@ import { Schema } from '@effect/schema';
|
|
2
2
|
export declare const ArticleUnpublishedSchema: Schema.Struct<{
|
3
3
|
status: Schema.Literal<["UNPUBLISHED"]>;
|
4
4
|
id: typeof Schema.NonEmptyString;
|
5
|
-
unpublishedAt: Schema.transformOrFail<Schema.
|
5
|
+
unpublishedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
6
6
|
}>;
|
7
7
|
export declare const ArticleIngressSchema: Schema.Struct<{
|
8
8
|
source: Schema.Literal<["INTERNAL"]>;
|
@@ -12,9 +12,9 @@ export declare const ArticleIngressSchema: Schema.Struct<{
|
|
12
12
|
title: typeof Schema.NonEmptyString;
|
13
13
|
teaser: typeof Schema.NonEmptyString;
|
14
14
|
content: typeof Schema.NonEmptyString;
|
15
|
-
publishedAt: Schema.transformOrFail<Schema.
|
16
|
-
updatedAt: Schema.transformOrFail<Schema.
|
17
|
-
retrievedAt: Schema.transformOrFail<Schema.
|
15
|
+
publishedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
16
|
+
updatedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
17
|
+
retrievedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
18
18
|
url: typeof Schema.NonEmptyString;
|
19
19
|
site: typeof Schema.NonEmptyString;
|
20
20
|
authors: Schema.Array$<Schema.Struct<{
|
@@ -32,6 +32,7 @@ export declare const ArticleIngressSchema: Schema.Struct<{
|
|
32
32
|
extID: typeof Schema.UUID;
|
33
33
|
extSource: typeof Schema.String;
|
34
34
|
}>]>>;
|
35
|
+
reusePolicy: Schema.optional<Schema.Literal<["strictly_no_reuse", "by_request", "free_to_reuse"]>>;
|
35
36
|
}>>;
|
36
37
|
}>;
|
37
38
|
export declare const InternalArticleEventSchema: Schema.Struct<{
|
@@ -44,9 +45,9 @@ export declare const InternalArticleEventSchema: Schema.Struct<{
|
|
44
45
|
title: typeof Schema.NonEmptyString;
|
45
46
|
teaser: typeof Schema.NonEmptyString;
|
46
47
|
content: typeof Schema.NonEmptyString;
|
47
|
-
publishedAt: Schema.transformOrFail<Schema.
|
48
|
-
updatedAt: Schema.transformOrFail<Schema.
|
49
|
-
retrievedAt: Schema.transformOrFail<Schema.
|
48
|
+
publishedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
49
|
+
updatedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
50
|
+
retrievedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
50
51
|
url: typeof Schema.NonEmptyString;
|
51
52
|
site: typeof Schema.NonEmptyString;
|
52
53
|
authors: Schema.Array$<Schema.Struct<{
|
@@ -64,11 +65,12 @@ export declare const InternalArticleEventSchema: Schema.Struct<{
|
|
64
65
|
extID: typeof Schema.UUID;
|
65
66
|
extSource: typeof Schema.String;
|
66
67
|
}>]>>;
|
68
|
+
reusePolicy: Schema.optional<Schema.Literal<["strictly_no_reuse", "by_request", "free_to_reuse"]>>;
|
67
69
|
}>>;
|
68
70
|
}>, Schema.Struct<{
|
69
71
|
status: Schema.Literal<["UNPUBLISHED"]>;
|
70
72
|
id: typeof Schema.NonEmptyString;
|
71
|
-
unpublishedAt: Schema.transformOrFail<Schema.
|
73
|
+
unpublishedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
72
74
|
}>]>;
|
73
75
|
}>;
|
74
76
|
declare const _default: {
|
@@ -100,6 +102,7 @@ declare const _default: {
|
|
100
102
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
101
103
|
readonly id: string;
|
102
104
|
})[];
|
105
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
103
106
|
};
|
104
107
|
readonly status: "NEW" | "UPDATED";
|
105
108
|
readonly source: "INTERNAL";
|
@@ -137,6 +140,7 @@ declare const _default: {
|
|
137
140
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
138
141
|
readonly id: string;
|
139
142
|
})[];
|
143
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
140
144
|
};
|
141
145
|
readonly status: "NEW" | "UPDATED";
|
142
146
|
readonly source: "INTERNAL";
|
@@ -174,6 +178,7 @@ declare const _default: {
|
|
174
178
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
175
179
|
readonly id: string;
|
176
180
|
})[];
|
181
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
177
182
|
};
|
178
183
|
readonly status: "NEW" | "UPDATED";
|
179
184
|
readonly source: "INTERNAL";
|
@@ -210,6 +215,7 @@ declare const _default: {
|
|
210
215
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
211
216
|
readonly id: string;
|
212
217
|
})[];
|
218
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
213
219
|
};
|
214
220
|
readonly status: "NEW" | "UPDATED";
|
215
221
|
readonly source: "INTERNAL";
|
@@ -247,6 +253,7 @@ declare const _default: {
|
|
247
253
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
248
254
|
readonly id: string;
|
249
255
|
})[];
|
256
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
250
257
|
};
|
251
258
|
readonly status: "NEW" | "UPDATED";
|
252
259
|
readonly source: "INTERNAL";
|
@@ -283,6 +290,7 @@ declare const _default: {
|
|
283
290
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
284
291
|
readonly id: string;
|
285
292
|
})[];
|
293
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
286
294
|
};
|
287
295
|
readonly status: "NEW" | "UPDATED";
|
288
296
|
readonly source: "INTERNAL";
|
@@ -320,6 +328,7 @@ declare const _default: {
|
|
320
328
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
321
329
|
readonly id: string;
|
322
330
|
})[];
|
331
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
323
332
|
};
|
324
333
|
readonly status: "NEW" | "UPDATED";
|
325
334
|
readonly source: "INTERNAL";
|
@@ -357,6 +366,7 @@ declare const _default: {
|
|
357
366
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
358
367
|
readonly id: string;
|
359
368
|
})[];
|
369
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
360
370
|
};
|
361
371
|
readonly status: "NEW" | "UPDATED";
|
362
372
|
readonly source: "INTERNAL";
|
@@ -394,6 +404,7 @@ declare const _default: {
|
|
394
404
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
395
405
|
readonly id: string;
|
396
406
|
})[];
|
407
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
397
408
|
};
|
398
409
|
readonly status: "NEW" | "UPDATED";
|
399
410
|
readonly source: "INTERNAL";
|
@@ -431,6 +442,7 @@ declare const _default: {
|
|
431
442
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
432
443
|
readonly id: string;
|
433
444
|
})[];
|
445
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
434
446
|
};
|
435
447
|
readonly status: "NEW" | "UPDATED";
|
436
448
|
readonly source: "INTERNAL";
|
@@ -468,6 +480,7 @@ declare const _default: {
|
|
468
480
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
469
481
|
readonly id: string;
|
470
482
|
})[];
|
483
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
471
484
|
};
|
472
485
|
readonly status: "NEW" | "UPDATED";
|
473
486
|
readonly source: "INTERNAL";
|
@@ -505,6 +518,7 @@ declare const _default: {
|
|
505
518
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
506
519
|
readonly id: string;
|
507
520
|
})[];
|
521
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
508
522
|
};
|
509
523
|
readonly status: "NEW" | "UPDATED";
|
510
524
|
readonly source: "INTERNAL";
|
@@ -542,6 +556,7 @@ declare const _default: {
|
|
542
556
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
543
557
|
readonly id: string;
|
544
558
|
})[];
|
559
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
545
560
|
};
|
546
561
|
readonly status: "NEW" | "UPDATED";
|
547
562
|
readonly source: "INTERNAL";
|
@@ -579,6 +594,7 @@ declare const _default: {
|
|
579
594
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
580
595
|
readonly id: string;
|
581
596
|
})[];
|
597
|
+
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
582
598
|
};
|
583
599
|
readonly status: "NEW" | "UPDATED";
|
584
600
|
readonly source: "INTERNAL";
|
@@ -598,9 +614,9 @@ declare const _default: {
|
|
598
614
|
title: typeof Schema.NonEmptyString;
|
599
615
|
teaser: typeof Schema.NonEmptyString;
|
600
616
|
content: typeof Schema.NonEmptyString;
|
601
|
-
publishedAt: Schema.transformOrFail<Schema.
|
602
|
-
updatedAt: Schema.transformOrFail<Schema.
|
603
|
-
retrievedAt: Schema.transformOrFail<Schema.
|
617
|
+
publishedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
618
|
+
updatedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
619
|
+
retrievedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
604
620
|
url: typeof Schema.NonEmptyString;
|
605
621
|
site: typeof Schema.NonEmptyString;
|
606
622
|
authors: Schema.Array$<Schema.Struct<{
|
@@ -618,11 +634,12 @@ declare const _default: {
|
|
618
634
|
extID: typeof Schema.UUID;
|
619
635
|
extSource: typeof Schema.String;
|
620
636
|
}>]>>;
|
637
|
+
reusePolicy: Schema.optional<Schema.Literal<["strictly_no_reuse", "by_request", "free_to_reuse"]>>;
|
621
638
|
}>>;
|
622
639
|
}>, Schema.Struct<{
|
623
640
|
status: Schema.Literal<["UNPUBLISHED"]>;
|
624
641
|
id: typeof Schema.NonEmptyString;
|
625
|
-
unpublishedAt: Schema.transformOrFail<Schema.
|
642
|
+
unpublishedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
626
643
|
}>]>;
|
627
644
|
}>;
|
628
645
|
};
|
@@ -6,6 +6,7 @@ const Article_1 = require("../types/Article");
|
|
6
6
|
const makeHelpers_1 = require("../utils/makeHelpers");
|
7
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
|
+
reusePolicy: schema_1.Schema.optional(schema_1.Schema.Literal('strictly_no_reuse', 'by_request', 'free_to_reuse')),
|
9
10
|
}));
|
10
11
|
exports.ArticleUnpublishedSchema = schema_1.Schema.Struct({
|
11
12
|
status: schema_1.Schema.Literal('UNPUBLISHED'),
|
package/lib/types/Article.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Schema } from '@effect/schema';
|
2
|
-
export declare const DateTimeSchema: Schema.transformOrFail<Schema.
|
2
|
+
export declare const DateTimeSchema: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
3
3
|
export declare const CategoryTagSchema: Schema.Struct<{
|
4
4
|
type: Schema.Literal<["CATEGORY"]>;
|
5
5
|
value: typeof Schema.NonEmptyString;
|
@@ -21,9 +21,9 @@ export declare const BaseArticleSchema: Schema.Struct<{
|
|
21
21
|
title: typeof Schema.NonEmptyString;
|
22
22
|
teaser: typeof Schema.NonEmptyString;
|
23
23
|
content: typeof Schema.NonEmptyString;
|
24
|
-
publishedAt: Schema.transformOrFail<Schema.
|
25
|
-
updatedAt: Schema.transformOrFail<Schema.
|
26
|
-
retrievedAt: Schema.transformOrFail<Schema.
|
24
|
+
publishedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
25
|
+
updatedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
26
|
+
retrievedAt: Schema.transformOrFail<typeof Schema.String, typeof Schema.DateTimeUtcFromSelf, never>;
|
27
27
|
url: typeof Schema.NonEmptyString;
|
28
28
|
site: typeof Schema.NonEmptyString;
|
29
29
|
authors: Schema.Array$<Schema.Struct<{
|
package/package.json
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
{
|
2
|
-
"name": "@productminds/article-events",
|
3
|
-
"version": "6.
|
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": "6.2.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);
|