@productminds/article-events 6.2.3 → 7.0.2
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/cmd/write-json-schema.js +3 -3
- package/lib/events/ExternalArticleEvent.d.ts +7 -7
- package/lib/events/ExternalArticleEvent.js +18 -18
- package/lib/events/InternalArticleEvent.d.ts +7 -7
- package/lib/events/InternalArticleEvent.js +14 -14
- package/lib/types/Article.d.ts +1 -1
- package/lib/types/Article.js +22 -22
- package/lib/types/ReusePolicy.d.ts +1 -1
- package/lib/types/ReusePolicy.js +2 -2
- package/lib/utils/makeHelpers.d.ts +5 -5
- package/lib/utils/makeHelpers.js +3 -3
- package/package.json +1 -1
- package/lib/article-events/src/article-events.d.ts +0 -3
- package/lib/article-events/src/article-events.js +0 -10
- package/lib/article-events/src/cmd/write-json-schema.d.ts +0 -1
- package/lib/article-events/src/cmd/write-json-schema.js +0 -14
- package/lib/article-events/src/events/ExternalArticleEvent.d.ts +0 -418
- package/lib/article-events/src/events/ExternalArticleEvent.js +0 -19
- package/lib/article-events/src/events/InternalArticleEvent.d.ts +0 -546
- package/lib/article-events/src/events/InternalArticleEvent.js +0 -19
- package/lib/article-events/src/types/Article.d.ts +0 -47
- package/lib/article-events/src/types/Article.js +0 -41
- package/lib/article-events/src/utils/makeHelpers.d.ts +0 -15
- package/lib/article-events/src/utils/makeHelpers.js +0 -45
- package/lib/events/ArticleEvent.d.ts +0 -70
- package/lib/events/ArticleEvent.js +0 -15
- package/lib/shared/schema.d.ts +0 -2
- package/lib/shared/schema.js +0 -5
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const
|
3
|
+
const effect_1 = require("effect");
|
4
4
|
const InternalArticleEvent_1 = require("../events/InternalArticleEvent");
|
5
5
|
const ExternalArticleEvent_1 = require("../events/ExternalArticleEvent");
|
6
6
|
const fs_1 = require("fs");
|
@@ -8,7 +8,7 @@ const dir = './jsonSchemas';
|
|
8
8
|
if (!(0, fs_1.existsSync)(dir)) {
|
9
9
|
(0, fs_1.mkdirSync)(dir);
|
10
10
|
}
|
11
|
-
const jsonSchemaInternal =
|
11
|
+
const jsonSchemaInternal = effect_1.JSONSchema.make(InternalArticleEvent_1.InternalArticleEventSchema);
|
12
12
|
(0, fs_1.writeFileSync)(`${dir}/internalArticleEventSchema.json`, JSON.stringify(jsonSchemaInternal, null, 2));
|
13
|
-
const jsonSchemaExternal =
|
13
|
+
const jsonSchemaExternal = effect_1.JSONSchema.make(ExternalArticleEvent_1.ExternalArticleEventSchema);
|
14
14
|
(0, fs_1.writeFileSync)(`${dir}/externalArticleEventSchema.json`, JSON.stringify(jsonSchemaExternal, null, 2));
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Schema } from '
|
1
|
+
import { Schema } from 'effect';
|
2
2
|
export declare const ExternalArticleEventSchema: Schema.Struct<{
|
3
3
|
kind: Schema.Literal<["EXTERNAL_ARTICLE_EVENT"]>;
|
4
4
|
payload: Schema.Struct<{
|
@@ -40,7 +40,7 @@ export declare const ExternalArticleEventSchema: Schema.Struct<{
|
|
40
40
|
}>;
|
41
41
|
}>;
|
42
42
|
declare const _default: {
|
43
|
-
decode: (u: unknown, overrideOptions?: import("
|
43
|
+
decode: (u: unknown, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either<{
|
44
44
|
readonly kind: "EXTERNAL_ARTICLE_EVENT";
|
45
45
|
readonly payload: {
|
46
46
|
readonly article: {
|
@@ -66,7 +66,7 @@ declare const _default: {
|
|
66
66
|
readonly status: "NEW" | "UPDATED";
|
67
67
|
readonly source: "EXTERNAL";
|
68
68
|
};
|
69
|
-
}, import("
|
69
|
+
}, import("effect/ParseResult").ParseError>;
|
70
70
|
decodeExn: (u: unknown) => {
|
71
71
|
readonly kind: "EXTERNAL_ARTICLE_EVENT";
|
72
72
|
readonly payload: {
|
@@ -120,7 +120,7 @@ declare const _default: {
|
|
120
120
|
readonly status: "NEW" | "UPDATED";
|
121
121
|
readonly source: "EXTERNAL";
|
122
122
|
};
|
123
|
-
}, overrideOptions?: import("
|
123
|
+
}, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either<{
|
124
124
|
readonly kind: "EXTERNAL_ARTICLE_EVENT";
|
125
125
|
readonly payload: {
|
126
126
|
readonly article: {
|
@@ -146,7 +146,7 @@ declare const _default: {
|
|
146
146
|
readonly status: "NEW" | "UPDATED";
|
147
147
|
readonly source: "EXTERNAL";
|
148
148
|
};
|
149
|
-
}, import("
|
149
|
+
}, import("effect/ParseResult").ParseError>;
|
150
150
|
encodeExn: (event: {
|
151
151
|
readonly kind: "EXTERNAL_ARTICLE_EVENT";
|
152
152
|
readonly payload: {
|
@@ -226,7 +226,7 @@ declare const _default: {
|
|
226
226
|
readonly status: "NEW" | "UPDATED";
|
227
227
|
readonly source: "EXTERNAL";
|
228
228
|
};
|
229
|
-
}, import("
|
229
|
+
}, import("effect/ParseResult").ParseError>;
|
230
230
|
fromBuffer: (msg: Buffer) => import("effect/Either").Either<{
|
231
231
|
readonly kind: "EXTERNAL_ARTICLE_EVENT";
|
232
232
|
readonly payload: {
|
@@ -253,7 +253,7 @@ declare const _default: {
|
|
253
253
|
readonly status: "NEW" | "UPDATED";
|
254
254
|
readonly source: "EXTERNAL";
|
255
255
|
};
|
256
|
-
}, import("
|
256
|
+
}, import("effect/ParseResult").ParseError>;
|
257
257
|
fromStringExn: (msg: string) => {
|
258
258
|
readonly kind: "EXTERNAL_ARTICLE_EVENT";
|
259
259
|
readonly payload: {
|
@@ -1,32 +1,32 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.ExternalArticleEventSchema = void 0;
|
4
|
-
const
|
4
|
+
const effect_1 = require("effect");
|
5
5
|
const Article_1 = require("../types/Article");
|
6
6
|
const makeHelpers_1 = require("../utils/makeHelpers");
|
7
|
-
const ExternalArticleSchema =
|
8
|
-
id:
|
9
|
-
url:
|
10
|
-
site:
|
11
|
-
content:
|
7
|
+
const ExternalArticleSchema = effect_1.Schema.extend(effect_1.Schema.Struct({
|
8
|
+
id: effect_1.Schema.NonEmptyString,
|
9
|
+
url: effect_1.Schema.NonEmptyString,
|
10
|
+
site: effect_1.Schema.NonEmptyString,
|
11
|
+
content: effect_1.Schema.NonEmptyString,
|
12
12
|
retrievedAt: Article_1.DateTimeSchema,
|
13
|
-
}),
|
14
|
-
title:
|
15
|
-
teaser:
|
13
|
+
}), effect_1.Schema.partial(effect_1.Schema.Struct({
|
14
|
+
title: effect_1.Schema.NonEmptyString,
|
15
|
+
teaser: effect_1.Schema.NonEmptyString,
|
16
16
|
publishedAt: Article_1.DateTimeSchema,
|
17
17
|
updatedAt: Article_1.DateTimeSchema,
|
18
|
-
authors:
|
19
|
-
name:
|
18
|
+
authors: effect_1.Schema.Array(effect_1.Schema.Struct({
|
19
|
+
name: effect_1.Schema.NonEmptyString,
|
20
20
|
})),
|
21
|
-
tags:
|
22
|
-
languageCode:
|
21
|
+
tags: effect_1.Schema.Array(Article_1.CategoryTagSchema),
|
22
|
+
languageCode: effect_1.Schema.NonEmptyString,
|
23
23
|
})));
|
24
|
-
exports.ExternalArticleEventSchema =
|
25
|
-
kind:
|
26
|
-
payload:
|
24
|
+
exports.ExternalArticleEventSchema = effect_1.Schema.Struct({
|
25
|
+
kind: effect_1.Schema.Literal('EXTERNAL_ARTICLE_EVENT'),
|
26
|
+
payload: effect_1.Schema.Struct({
|
27
27
|
article: ExternalArticleSchema,
|
28
|
-
status:
|
29
|
-
source:
|
28
|
+
status: effect_1.Schema.Literal('NEW', 'UPDATED'),
|
29
|
+
source: effect_1.Schema.Literal('EXTERNAL'),
|
30
30
|
}),
|
31
31
|
});
|
32
32
|
const helpers = (0, makeHelpers_1.makeHelpers)(exports.ExternalArticleEventSchema);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Schema } from '
|
1
|
+
import { Schema } from 'effect';
|
2
2
|
export declare const ArticleUnpublishedSchema: Schema.Struct<{
|
3
3
|
status: Schema.Literal<["UNPUBLISHED"]>;
|
4
4
|
id: typeof Schema.NonEmptyString;
|
@@ -76,7 +76,7 @@ export declare const InternalArticleEventSchema: Schema.Struct<{
|
|
76
76
|
}>]>;
|
77
77
|
}>;
|
78
78
|
declare const _default: {
|
79
|
-
decode: (u: unknown, overrideOptions?: import("
|
79
|
+
decode: (u: unknown, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either<{
|
80
80
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
81
81
|
readonly payload: {
|
82
82
|
readonly article: {
|
@@ -114,7 +114,7 @@ declare const _default: {
|
|
114
114
|
readonly status: "UNPUBLISHED";
|
115
115
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
116
116
|
};
|
117
|
-
}, import("
|
117
|
+
}, import("effect/ParseResult").ParseError>;
|
118
118
|
decodeExn: (u: unknown) => {
|
119
119
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
120
120
|
readonly payload: {
|
@@ -192,7 +192,7 @@ declare const _default: {
|
|
192
192
|
readonly status: "UNPUBLISHED";
|
193
193
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
194
194
|
};
|
195
|
-
}, overrideOptions?: import("
|
195
|
+
}, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either<{
|
196
196
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
197
197
|
readonly payload: {
|
198
198
|
readonly article: {
|
@@ -230,7 +230,7 @@ declare const _default: {
|
|
230
230
|
readonly status: "UNPUBLISHED";
|
231
231
|
readonly unpublishedAt: string;
|
232
232
|
};
|
233
|
-
}, import("
|
233
|
+
}, import("effect/ParseResult").ParseError>;
|
234
234
|
encodeExn: (event: {
|
235
235
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
236
236
|
readonly payload: {
|
@@ -346,7 +346,7 @@ declare const _default: {
|
|
346
346
|
readonly status: "UNPUBLISHED";
|
347
347
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
348
348
|
};
|
349
|
-
}, import("
|
349
|
+
}, import("effect/ParseResult").ParseError>;
|
350
350
|
fromBuffer: (msg: Buffer) => import("effect/Either").Either<{
|
351
351
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
352
352
|
readonly payload: {
|
@@ -385,7 +385,7 @@ declare const _default: {
|
|
385
385
|
readonly status: "UNPUBLISHED";
|
386
386
|
readonly unpublishedAt: import("effect/DateTime").Utc;
|
387
387
|
};
|
388
|
-
}, import("
|
388
|
+
}, import("effect/ParseResult").ParseError>;
|
389
389
|
fromStringExn: (msg: string) => {
|
390
390
|
readonly kind: "INTERNAL_ARTICLE_EVENT";
|
391
391
|
readonly payload: {
|
@@ -1,27 +1,27 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.InternalArticleEventSchema = exports.ArticleIngressSchema = exports.ArticleUnpublishedSchema = void 0;
|
4
|
-
const
|
4
|
+
const effect_1 = require("effect");
|
5
5
|
const Article_1 = require("../types/Article");
|
6
6
|
const makeHelpers_1 = require("../utils/makeHelpers");
|
7
|
-
const InternalArticleSchema =
|
8
|
-
tags:
|
9
|
-
extId:
|
10
|
-
reusePolicy:
|
7
|
+
const InternalArticleSchema = effect_1.Schema.extend(Article_1.BaseArticleSchema, effect_1.Schema.Struct({
|
8
|
+
tags: effect_1.Schema.Array(effect_1.Schema.Union(Article_1.CategoryTagSchema, Article_1.ExternalArticleReferenceTagSchema, Article_1.DrupalExternalIDTag)),
|
9
|
+
extId: effect_1.Schema.optional(effect_1.Schema.NonEmptyString),
|
10
|
+
reusePolicy: effect_1.Schema.optional(effect_1.Schema.Literal('strictly_no_reuse', 'by_request', 'free_to_reuse')),
|
11
11
|
}));
|
12
|
-
exports.ArticleUnpublishedSchema =
|
13
|
-
status:
|
14
|
-
id:
|
12
|
+
exports.ArticleUnpublishedSchema = effect_1.Schema.Struct({
|
13
|
+
status: effect_1.Schema.Literal('UNPUBLISHED'),
|
14
|
+
id: effect_1.Schema.NonEmptyString,
|
15
15
|
unpublishedAt: Article_1.DateTimeSchema,
|
16
16
|
});
|
17
|
-
exports.ArticleIngressSchema =
|
18
|
-
source:
|
19
|
-
status:
|
17
|
+
exports.ArticleIngressSchema = effect_1.Schema.Struct({
|
18
|
+
source: effect_1.Schema.Literal('INTERNAL'),
|
19
|
+
status: effect_1.Schema.Literal('NEW', 'UPDATED'),
|
20
20
|
article: InternalArticleSchema,
|
21
21
|
});
|
22
|
-
exports.InternalArticleEventSchema =
|
23
|
-
kind:
|
24
|
-
payload:
|
22
|
+
exports.InternalArticleEventSchema = effect_1.Schema.Struct({
|
23
|
+
kind: effect_1.Schema.Literal('INTERNAL_ARTICLE_EVENT'),
|
24
|
+
payload: effect_1.Schema.Union(exports.ArticleIngressSchema, exports.ArticleUnpublishedSchema),
|
25
25
|
});
|
26
26
|
const helpers = (0, makeHelpers_1.makeHelpers)(exports.InternalArticleEventSchema);
|
27
27
|
exports.default = Object.assign({ Schema: exports.InternalArticleEventSchema }, helpers);
|
package/lib/types/Article.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Schema } from '
|
1
|
+
import { Schema } from 'effect';
|
2
2
|
export declare const DateTimeSchema: Schema.transformOrFail<Schema.SchemaClass<string, string, never>, typeof Schema.DateTimeUtcFromSelf, never>;
|
3
3
|
export declare const CategoryTagSchema: Schema.Struct<{
|
4
4
|
type: Schema.Literal<["CATEGORY"]>;
|
package/lib/types/Article.js
CHANGED
@@ -1,37 +1,37 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.BaseArticleSchema = exports.AuthorSchema = exports.DrupalExternalIDTag = exports.ExternalArticleReferenceTagSchema = exports.CategoryTagSchema = exports.DateTimeSchema = void 0;
|
4
|
-
const
|
5
|
-
exports.DateTimeSchema =
|
4
|
+
const effect_1 = require("effect");
|
5
|
+
exports.DateTimeSchema = effect_1.Schema.DateTimeUtc.annotations({
|
6
6
|
jsonSchema: { type: 'string', format: 'date-time' },
|
7
7
|
});
|
8
|
-
exports.CategoryTagSchema =
|
9
|
-
type:
|
10
|
-
value:
|
8
|
+
exports.CategoryTagSchema = effect_1.Schema.Struct({
|
9
|
+
type: effect_1.Schema.Literal('CATEGORY'),
|
10
|
+
value: effect_1.Schema.NonEmptyString,
|
11
11
|
});
|
12
|
-
exports.ExternalArticleReferenceTagSchema =
|
13
|
-
type:
|
14
|
-
id:
|
12
|
+
exports.ExternalArticleReferenceTagSchema = effect_1.Schema.Struct({
|
13
|
+
type: effect_1.Schema.Literal('EXTERNAL_ARTICLE_REFERENCE'),
|
14
|
+
id: effect_1.Schema.NonEmptyString,
|
15
15
|
});
|
16
|
-
exports.DrupalExternalIDTag =
|
17
|
-
type:
|
18
|
-
extID:
|
19
|
-
extSource:
|
16
|
+
exports.DrupalExternalIDTag = effect_1.Schema.Struct({
|
17
|
+
type: effect_1.Schema.Literal('DRUPAL_EXTERNAL_ID'),
|
18
|
+
extID: effect_1.Schema.UUID,
|
19
|
+
extSource: effect_1.Schema.String,
|
20
20
|
}).annotations({
|
21
21
|
description: 'A special case tag for tracking where a Drupal article was created from',
|
22
22
|
});
|
23
|
-
exports.AuthorSchema =
|
24
|
-
name:
|
23
|
+
exports.AuthorSchema = effect_1.Schema.Struct({
|
24
|
+
name: effect_1.Schema.NonEmptyString,
|
25
25
|
});
|
26
|
-
exports.BaseArticleSchema =
|
27
|
-
id:
|
28
|
-
title:
|
29
|
-
teaser:
|
30
|
-
content:
|
26
|
+
exports.BaseArticleSchema = effect_1.Schema.Struct({
|
27
|
+
id: effect_1.Schema.NonEmptyString,
|
28
|
+
title: effect_1.Schema.NonEmptyString,
|
29
|
+
teaser: effect_1.Schema.NonEmptyString,
|
30
|
+
content: effect_1.Schema.NonEmptyString,
|
31
31
|
publishedAt: exports.DateTimeSchema,
|
32
32
|
updatedAt: exports.DateTimeSchema,
|
33
33
|
retrievedAt: exports.DateTimeSchema,
|
34
|
-
url:
|
35
|
-
site:
|
36
|
-
authors:
|
34
|
+
url: effect_1.Schema.NonEmptyString,
|
35
|
+
site: effect_1.Schema.NonEmptyString,
|
36
|
+
authors: effect_1.Schema.Array(exports.AuthorSchema),
|
37
37
|
});
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { Schema } from '
|
1
|
+
import { Schema } from 'effect';
|
2
2
|
export declare const ReusePolicySchema: Schema.Struct<{}>;
|
package/lib/types/ReusePolicy.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.ReusePolicySchema = void 0;
|
4
|
-
const
|
5
|
-
exports.ReusePolicySchema =
|
4
|
+
const effect_1 = require("effect");
|
5
|
+
exports.ReusePolicySchema = effect_1.Schema.Struct({});
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { Schema } from '
|
1
|
+
import { Schema } from 'effect';
|
2
2
|
export declare const makeHelpers: <A, I>(schema: Schema.Schema<A, I, never>) => {
|
3
|
-
decode: (u: unknown, overrideOptions?: import("
|
3
|
+
decode: (u: unknown, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either<A, import("effect/ParseResult").ParseError>;
|
4
4
|
decodeExn: (u: unknown) => A;
|
5
|
-
encode: (a: A, overrideOptions?: import("
|
5
|
+
encode: (a: A, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Either").Either<I, import("effect/ParseResult").ParseError>;
|
6
6
|
encodeExn: (event: typeof schema.Type) => I;
|
7
|
-
fromString: (msg: string) => import("effect/Either").Either<A, import("
|
8
|
-
fromBuffer: (msg: Buffer) => import("effect/Either").Either<A, import("
|
7
|
+
fromString: (msg: string) => import("effect/Either").Either<A, import("effect/ParseResult").ParseError>;
|
8
|
+
fromBuffer: (msg: Buffer) => import("effect/Either").Either<A, import("effect/ParseResult").ParseError>;
|
9
9
|
fromStringExn: (msg: string) => A;
|
10
10
|
fromBufferExn: (msg: Buffer) => A;
|
11
11
|
toString: (event: typeof schema.Type) => string;
|
package/lib/utils/makeHelpers.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.makeHelpers = void 0;
|
4
|
-
const
|
4
|
+
const effect_1 = require("effect");
|
5
5
|
const makeHelpers = (schema) => {
|
6
|
-
const decode =
|
6
|
+
const decode = effect_1.Schema.decodeUnknownEither(schema);
|
7
7
|
const decodeExn = (u) => {
|
8
8
|
const decoded = decode(u);
|
9
9
|
if (decoded._tag === 'Left') {
|
@@ -11,7 +11,7 @@ const makeHelpers = (schema) => {
|
|
11
11
|
}
|
12
12
|
return decoded.right;
|
13
13
|
};
|
14
|
-
const encode =
|
14
|
+
const encode = effect_1.Schema.encodeEither(schema);
|
15
15
|
const encodeExn = (event) => {
|
16
16
|
const encoded = encode(event);
|
17
17
|
if (encoded._tag === 'Left') {
|
package/package.json
CHANGED
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.InternalArticleEvent = exports.ExternalArticleEvent = void 0;
|
7
|
-
const ExternalArticleEvent_1 = __importDefault(require("./events/ExternalArticleEvent"));
|
8
|
-
exports.ExternalArticleEvent = ExternalArticleEvent_1.default;
|
9
|
-
const InternalArticleEvent_1 = __importDefault(require("./events/InternalArticleEvent"));
|
10
|
-
exports.InternalArticleEvent = InternalArticleEvent_1.default;
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,14 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const schema_1 = require("@effect/schema");
|
4
|
-
const InternalArticleEvent_1 = require("../events/InternalArticleEvent");
|
5
|
-
const ExternalArticleEvent_1 = require("../events/ExternalArticleEvent");
|
6
|
-
const fs_1 = require("fs");
|
7
|
-
const dir = './jsonSchemas';
|
8
|
-
if (!(0, fs_1.existsSync)(dir)) {
|
9
|
-
(0, fs_1.mkdirSync)(dir);
|
10
|
-
}
|
11
|
-
const jsonSchemaInternal = schema_1.JSONSchema.make(InternalArticleEvent_1.InternalArticleEventSchema);
|
12
|
-
(0, fs_1.writeFileSync)(`${dir}/internalArticleEventSchema.json`, JSON.stringify(jsonSchemaInternal, null, 2));
|
13
|
-
const jsonSchemaExternal = schema_1.JSONSchema.make(ExternalArticleEvent_1.ExternalArticleEventSchema);
|
14
|
-
(0, fs_1.writeFileSync)(`${dir}/externalArticleEventSchema.json`, JSON.stringify(jsonSchemaExternal, null, 2));
|