@productminds/article-events 6.2.2 → 6.2.3
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/lib/article-events/src/article-events.d.ts +3 -0
- package/lib/article-events/src/article-events.js +10 -0
- package/lib/article-events/src/cmd/write-json-schema.d.ts +1 -0
- package/lib/article-events/src/cmd/write-json-schema.js +14 -0
- package/lib/article-events/src/events/ExternalArticleEvent.d.ts +418 -0
- package/lib/article-events/src/events/ExternalArticleEvent.js +19 -0
- package/lib/article-events/src/events/InternalArticleEvent.d.ts +546 -0
- package/lib/article-events/src/events/InternalArticleEvent.js +19 -0
- package/lib/article-events/src/types/Article.d.ts +47 -0
- package/lib/article-events/src/types/Article.js +41 -0
- package/lib/article-events/src/utils/makeHelpers.d.ts +15 -0
- package/lib/article-events/src/utils/makeHelpers.js +45 -0
- package/lib/events/ArticleEvent.d.ts +70 -0
- package/lib/events/ArticleEvent.js +15 -0
- package/lib/events/InternalArticleEvent.d.ts +17 -16
- package/lib/events/InternalArticleEvent.js +1 -1
- package/lib/shared/schema.d.ts +2 -0
- package/lib/shared/schema.js +5 -0
- package/package.json +1 -1
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.makeHelpers = void 0;
|
4
|
+
const schema_1 = require("@effect/schema");
|
5
|
+
const makeHelpers = (schema) => {
|
6
|
+
const decode = schema_1.Schema.decodeUnknownEither(schema);
|
7
|
+
const decodeExn = (u) => {
|
8
|
+
const decoded = decode(u);
|
9
|
+
if (decoded._tag === 'Left') {
|
10
|
+
throw new Error('Failed to decode ArticleEvent');
|
11
|
+
}
|
12
|
+
return decoded.right;
|
13
|
+
};
|
14
|
+
const encode = schema_1.Schema.encodeEither(schema);
|
15
|
+
const encodeExn = (event) => {
|
16
|
+
const encoded = encode(event);
|
17
|
+
if (encoded._tag === 'Left') {
|
18
|
+
throw new Error('Failed to encode ArticleEvent');
|
19
|
+
}
|
20
|
+
return encoded.right;
|
21
|
+
};
|
22
|
+
const fromString = (msg) => decode(JSON.parse(msg));
|
23
|
+
const fromBuffer = (msg) => decode(JSON.parse(msg.toString()));
|
24
|
+
const fromStringExn = (msg) => decodeExn(JSON.parse(msg));
|
25
|
+
const fromBufferExn = (msg) => fromStringExn(msg.toString());
|
26
|
+
const toString = (event) => JSON.stringify(encode(event));
|
27
|
+
const toBuffer = (event) => Buffer.from(toString(event));
|
28
|
+
const toStringExn = (event) => JSON.stringify(encodeExn(event));
|
29
|
+
const toBufferExn = (event) => Buffer.from(toStringExn(event));
|
30
|
+
return {
|
31
|
+
decode,
|
32
|
+
decodeExn,
|
33
|
+
encode,
|
34
|
+
encodeExn,
|
35
|
+
fromString,
|
36
|
+
fromBuffer,
|
37
|
+
fromStringExn,
|
38
|
+
fromBufferExn,
|
39
|
+
toString,
|
40
|
+
toBuffer,
|
41
|
+
toStringExn,
|
42
|
+
toBufferExn,
|
43
|
+
};
|
44
|
+
};
|
45
|
+
exports.makeHelpers = makeHelpers;
|
@@ -0,0 +1,70 @@
|
|
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;
|
@@ -0,0 +1,15 @@
|
|
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);
|
@@ -32,12 +32,12 @@ export declare const ArticleIngressSchema: Schema.Struct<{
|
|
32
32
|
extID: typeof Schema.UUID;
|
33
33
|
extSource: typeof Schema.String;
|
34
34
|
}>]>>;
|
35
|
+
extId: Schema.optional<typeof Schema.NonEmptyString>;
|
35
36
|
reusePolicy: Schema.optional<Schema.Literal<["strictly_no_reuse", "by_request", "free_to_reuse"]>>;
|
36
37
|
}>>;
|
37
38
|
}>;
|
38
39
|
export declare const InternalArticleEventSchema: Schema.Struct<{
|
39
40
|
kind: Schema.Literal<["INTERNAL_ARTICLE_EVENT"]>;
|
40
|
-
extId: Schema.optional<typeof Schema.NonEmptyString>;
|
41
41
|
payload: Schema.Union<[Schema.Struct<{
|
42
42
|
source: Schema.Literal<["INTERNAL"]>;
|
43
43
|
status: Schema.Literal<["NEW", "UPDATED"]>;
|
@@ -66,6 +66,7 @@ export declare const InternalArticleEventSchema: Schema.Struct<{
|
|
66
66
|
extID: typeof Schema.UUID;
|
67
67
|
extSource: typeof Schema.String;
|
68
68
|
}>]>>;
|
69
|
+
extId: Schema.optional<typeof Schema.NonEmptyString>;
|
69
70
|
reusePolicy: Schema.optional<Schema.Literal<["strictly_no_reuse", "by_request", "free_to_reuse"]>>;
|
70
71
|
}>>;
|
71
72
|
}>, Schema.Struct<{
|
@@ -103,6 +104,7 @@ declare const _default: {
|
|
103
104
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
104
105
|
readonly id: string;
|
105
106
|
})[];
|
107
|
+
readonly extId?: string | undefined;
|
106
108
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
107
109
|
};
|
108
110
|
readonly status: "NEW" | "UPDATED";
|
@@ -112,7 +114,6 @@ declare const _default: {
|
|
112
114
|
readonly status: "UNPUBLISHED";
|
113
115
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
114
116
|
};
|
115
|
-
readonly extId?: string | undefined;
|
116
117
|
}, import("@effect/schema/ParseResult").ParseError>;
|
117
118
|
decodeExn: (u: unknown) => {
|
118
119
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -142,6 +143,7 @@ declare const _default: {
|
|
142
143
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
143
144
|
readonly id: string;
|
144
145
|
})[];
|
146
|
+
readonly extId?: string | undefined;
|
145
147
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
146
148
|
};
|
147
149
|
readonly status: "NEW" | "UPDATED";
|
@@ -151,7 +153,6 @@ declare const _default: {
|
|
151
153
|
readonly status: "UNPUBLISHED";
|
152
154
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
153
155
|
};
|
154
|
-
readonly extId?: string | undefined;
|
155
156
|
};
|
156
157
|
encode: (a: {
|
157
158
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -181,6 +182,7 @@ declare const _default: {
|
|
181
182
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
182
183
|
readonly id: string;
|
183
184
|
})[];
|
185
|
+
readonly extId?: string | undefined;
|
184
186
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
185
187
|
};
|
186
188
|
readonly status: "NEW" | "UPDATED";
|
@@ -190,7 +192,6 @@ declare const _default: {
|
|
190
192
|
readonly status: "UNPUBLISHED";
|
191
193
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
192
194
|
};
|
193
|
-
readonly extId?: string | undefined;
|
194
195
|
}, overrideOptions?: import("@effect/schema/AST").ParseOptions) => import("effect/Either").Either<{
|
195
196
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
196
197
|
readonly payload: {
|
@@ -219,6 +220,7 @@ declare const _default: {
|
|
219
220
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
220
221
|
readonly id: string;
|
221
222
|
})[];
|
223
|
+
readonly extId?: string | undefined;
|
222
224
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
223
225
|
};
|
224
226
|
readonly status: "NEW" | "UPDATED";
|
@@ -228,7 +230,6 @@ declare const _default: {
|
|
228
230
|
readonly status: "UNPUBLISHED";
|
229
231
|
readonly unpublishedAt: string;
|
230
232
|
};
|
231
|
-
readonly extId?: string | undefined;
|
232
233
|
}, import("@effect/schema/ParseResult").ParseError>;
|
233
234
|
encodeExn: (event: {
|
234
235
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -258,6 +259,7 @@ declare const _default: {
|
|
258
259
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
259
260
|
readonly id: string;
|
260
261
|
})[];
|
262
|
+
readonly extId?: string | undefined;
|
261
263
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
262
264
|
};
|
263
265
|
readonly status: "NEW" | "UPDATED";
|
@@ -267,7 +269,6 @@ declare const _default: {
|
|
267
269
|
readonly status: "UNPUBLISHED";
|
268
270
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
269
271
|
};
|
270
|
-
readonly extId?: string | undefined;
|
271
272
|
}) => {
|
272
273
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
273
274
|
readonly payload: {
|
@@ -296,6 +297,7 @@ declare const _default: {
|
|
296
297
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
297
298
|
readonly id: string;
|
298
299
|
})[];
|
300
|
+
readonly extId?: string | undefined;
|
299
301
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
300
302
|
};
|
301
303
|
readonly status: "NEW" | "UPDATED";
|
@@ -305,7 +307,6 @@ declare const _default: {
|
|
305
307
|
readonly status: "UNPUBLISHED";
|
306
308
|
readonly unpublishedAt: string;
|
307
309
|
};
|
308
|
-
readonly extId?: string | undefined;
|
309
310
|
};
|
310
311
|
fromString: (msg: string) => import("effect/Either").Either<{
|
311
312
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -335,6 +336,7 @@ declare const _default: {
|
|
335
336
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
336
337
|
readonly id: string;
|
337
338
|
})[];
|
339
|
+
readonly extId?: string | undefined;
|
338
340
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
339
341
|
};
|
340
342
|
readonly status: "NEW" | "UPDATED";
|
@@ -344,7 +346,6 @@ declare const _default: {
|
|
344
346
|
readonly status: "UNPUBLISHED";
|
345
347
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
346
348
|
};
|
347
|
-
readonly extId?: string | undefined;
|
348
349
|
}, import("@effect/schema/ParseResult").ParseError>;
|
349
350
|
fromBuffer: (msg: Buffer) => import("effect/Either").Either<{
|
350
351
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -374,6 +375,7 @@ declare const _default: {
|
|
374
375
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
375
376
|
readonly id: string;
|
376
377
|
})[];
|
378
|
+
readonly extId?: string | undefined;
|
377
379
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
378
380
|
};
|
379
381
|
readonly status: "NEW" | "UPDATED";
|
@@ -383,7 +385,6 @@ declare const _default: {
|
|
383
385
|
readonly status: "UNPUBLISHED";
|
384
386
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
385
387
|
};
|
386
|
-
readonly extId?: string | undefined;
|
387
388
|
}, import("@effect/schema/ParseResult").ParseError>;
|
388
389
|
fromStringExn: (msg: string) => {
|
389
390
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -413,6 +414,7 @@ declare const _default: {
|
|
413
414
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
414
415
|
readonly id: string;
|
415
416
|
})[];
|
417
|
+
readonly extId?: string | undefined;
|
416
418
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
417
419
|
};
|
418
420
|
readonly status: "NEW" | "UPDATED";
|
@@ -422,7 +424,6 @@ declare const _default: {
|
|
422
424
|
readonly status: "UNPUBLISHED";
|
423
425
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
424
426
|
};
|
425
|
-
readonly extId?: string | undefined;
|
426
427
|
};
|
427
428
|
fromBufferExn: (msg: Buffer) => {
|
428
429
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -452,6 +453,7 @@ declare const _default: {
|
|
452
453
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
453
454
|
readonly id: string;
|
454
455
|
})[];
|
456
|
+
readonly extId?: string | undefined;
|
455
457
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
456
458
|
};
|
457
459
|
readonly status: "NEW" | "UPDATED";
|
@@ -461,7 +463,6 @@ declare const _default: {
|
|
461
463
|
readonly status: "UNPUBLISHED";
|
462
464
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
463
465
|
};
|
464
|
-
readonly extId?: string | undefined;
|
465
466
|
};
|
466
467
|
toString: (event: {
|
467
468
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -491,6 +492,7 @@ declare const _default: {
|
|
491
492
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
492
493
|
readonly id: string;
|
493
494
|
})[];
|
495
|
+
readonly extId?: string | undefined;
|
494
496
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
495
497
|
};
|
496
498
|
readonly status: "NEW" | "UPDATED";
|
@@ -500,7 +502,6 @@ declare const _default: {
|
|
500
502
|
readonly status: "UNPUBLISHED";
|
501
503
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
502
504
|
};
|
503
|
-
readonly extId?: string | undefined;
|
504
505
|
}) => string;
|
505
506
|
toBuffer: (event: {
|
506
507
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -530,6 +531,7 @@ declare const _default: {
|
|
530
531
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
531
532
|
readonly id: string;
|
532
533
|
})[];
|
534
|
+
readonly extId?: string | undefined;
|
533
535
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
534
536
|
};
|
535
537
|
readonly status: "NEW" | "UPDATED";
|
@@ -539,7 +541,6 @@ declare const _default: {
|
|
539
541
|
readonly status: "UNPUBLISHED";
|
540
542
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
541
543
|
};
|
542
|
-
readonly extId?: string | undefined;
|
543
544
|
}) => Buffer;
|
544
545
|
toStringExn: (event: {
|
545
546
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -569,6 +570,7 @@ declare const _default: {
|
|
569
570
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
570
571
|
readonly id: string;
|
571
572
|
})[];
|
573
|
+
readonly extId?: string | undefined;
|
572
574
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
573
575
|
};
|
574
576
|
readonly status: "NEW" | "UPDATED";
|
@@ -578,7 +580,6 @@ declare const _default: {
|
|
578
580
|
readonly status: "UNPUBLISHED";
|
579
581
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
580
582
|
};
|
581
|
-
readonly extId?: string | undefined;
|
582
583
|
}) => string;
|
583
584
|
toBufferExn: (event: {
|
584
585
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
@@ -608,6 +609,7 @@ declare const _default: {
|
|
608
609
|
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
609
610
|
readonly id: string;
|
610
611
|
})[];
|
612
|
+
readonly extId?: string | undefined;
|
611
613
|
readonly reusePolicy?: "strictly_no_reuse" | "by_request" | "free_to_reuse" | undefined;
|
612
614
|
};
|
613
615
|
readonly status: "NEW" | "UPDATED";
|
@@ -617,11 +619,9 @@ declare const _default: {
|
|
617
619
|
readonly status: "UNPUBLISHED";
|
618
620
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
619
621
|
};
|
620
|
-
readonly extId?: string | undefined;
|
621
622
|
}) => Buffer;
|
622
623
|
Schema: Schema.Struct<{
|
623
624
|
kind: Schema.Literal<["INTERNAL_ARTICLE_EVENT"]>;
|
624
|
-
extId: Schema.optional<typeof Schema.NonEmptyString>;
|
625
625
|
payload: Schema.Union<[Schema.Struct<{
|
626
626
|
source: Schema.Literal<["INTERNAL"]>;
|
627
627
|
status: Schema.Literal<["NEW", "UPDATED"]>;
|
@@ -650,6 +650,7 @@ declare const _default: {
|
|
650
650
|
extID: typeof Schema.UUID;
|
651
651
|
extSource: typeof Schema.String;
|
652
652
|
}>]>>;
|
653
|
+
extId: Schema.optional<typeof Schema.NonEmptyString>;
|
653
654
|
reusePolicy: Schema.optional<Schema.Literal<["strictly_no_reuse", "by_request", "free_to_reuse"]>>;
|
654
655
|
}>>;
|
655
656
|
}>, Schema.Struct<{
|
@@ -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
|
+
extId: schema_1.Schema.optional(schema_1.Schema.NonEmptyString),
|
9
10
|
reusePolicy: schema_1.Schema.optional(schema_1.Schema.Literal('strictly_no_reuse', 'by_request', 'free_to_reuse')),
|
10
11
|
}));
|
11
12
|
exports.ArticleUnpublishedSchema = schema_1.Schema.Struct({
|
@@ -20,7 +21,6 @@ exports.ArticleIngressSchema = schema_1.Schema.Struct({
|
|
20
21
|
});
|
21
22
|
exports.InternalArticleEventSchema = schema_1.Schema.Struct({
|
22
23
|
kind: schema_1.Schema.Literal('INTERNAL_ARTICLE_EVENT'),
|
23
|
-
extId: schema_1.Schema.optional(schema_1.Schema.NonEmptyString),
|
24
24
|
payload: schema_1.Schema.Union(exports.ArticleIngressSchema, exports.ArticleUnpublishedSchema),
|
25
25
|
});
|
26
26
|
const helpers = (0, makeHelpers_1.makeHelpers)(exports.InternalArticleEventSchema);
|