@productminds/article-events 4.0.0 → 4.1.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 +174 -456
- package/lib/events/InternalArticleEvent.js +2 -2
- 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;
|
|
@@ -35,483 +34,204 @@ export declare const InternalArticleEventSchema: Schema.Struct<{
|
|
|
35
34
|
}>;
|
|
36
35
|
declare const _default: {
|
|
37
36
|
decode: (u: unknown, overrideOptions?: import("@effect/schema/AST").ParseOptions) => import("effect/Either").Either<{
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
readonly name: string;
|
|
51
|
-
}[];
|
|
52
|
-
} & {
|
|
53
|
-
readonly id: string;
|
|
54
|
-
} & {
|
|
55
|
-
readonly tags: readonly ({
|
|
56
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
57
|
-
readonly extID: string;
|
|
58
|
-
readonly extSource: string;
|
|
59
|
-
} | {
|
|
60
|
-
readonly type: "CATEGORY";
|
|
61
|
-
readonly value: string;
|
|
62
|
-
} | {
|
|
63
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
64
|
-
readonly id: string;
|
|
65
|
-
})[];
|
|
66
|
-
};
|
|
67
|
-
readonly status: "NEW" | "UPDATED";
|
|
68
|
-
readonly source: "INTERNAL";
|
|
69
|
-
};
|
|
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
|
+
}[];
|
|
70
49
|
}, import("@effect/schema/ParseResult").ParseError>;
|
|
71
50
|
decodeExn: (u: unknown) => {
|
|
72
|
-
readonly
|
|
73
|
-
readonly
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
readonly name: string;
|
|
85
|
-
}[];
|
|
86
|
-
} & {
|
|
87
|
-
readonly id: string;
|
|
88
|
-
} & {
|
|
89
|
-
readonly tags: readonly ({
|
|
90
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
91
|
-
readonly extID: string;
|
|
92
|
-
readonly extSource: string;
|
|
93
|
-
} | {
|
|
94
|
-
readonly type: "CATEGORY";
|
|
95
|
-
readonly value: string;
|
|
96
|
-
} | {
|
|
97
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
98
|
-
readonly id: string;
|
|
99
|
-
})[];
|
|
100
|
-
};
|
|
101
|
-
readonly status: "NEW" | "UPDATED";
|
|
102
|
-
readonly source: "INTERNAL";
|
|
103
|
-
};
|
|
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
|
+
}[];
|
|
104
63
|
};
|
|
105
64
|
encode: (a: {
|
|
106
|
-
readonly
|
|
107
|
-
readonly
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
readonly name: string;
|
|
119
|
-
}[];
|
|
120
|
-
} & {
|
|
121
|
-
readonly id: string;
|
|
122
|
-
} & {
|
|
123
|
-
readonly tags: readonly ({
|
|
124
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
125
|
-
readonly extID: string;
|
|
126
|
-
readonly extSource: string;
|
|
127
|
-
} | {
|
|
128
|
-
readonly type: "CATEGORY";
|
|
129
|
-
readonly value: string;
|
|
130
|
-
} | {
|
|
131
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
132
|
-
readonly id: string;
|
|
133
|
-
})[];
|
|
134
|
-
};
|
|
135
|
-
readonly status: "NEW" | "UPDATED";
|
|
136
|
-
readonly source: "INTERNAL";
|
|
137
|
-
};
|
|
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
|
+
}[];
|
|
138
77
|
}, overrideOptions?: import("@effect/schema/AST").ParseOptions) => import("effect/Either").Either<{
|
|
139
|
-
readonly
|
|
140
|
-
readonly
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
readonly name: string;
|
|
152
|
-
}[];
|
|
153
|
-
} & {
|
|
154
|
-
readonly id: string;
|
|
155
|
-
} & {
|
|
156
|
-
readonly tags: readonly ({
|
|
157
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
158
|
-
readonly extID: string;
|
|
159
|
-
readonly extSource: string;
|
|
160
|
-
} | {
|
|
161
|
-
readonly type: "CATEGORY";
|
|
162
|
-
readonly value: string;
|
|
163
|
-
} | {
|
|
164
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
165
|
-
readonly id: string;
|
|
166
|
-
})[];
|
|
167
|
-
};
|
|
168
|
-
readonly status: "NEW" | "UPDATED";
|
|
169
|
-
readonly source: "INTERNAL";
|
|
170
|
-
};
|
|
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
|
+
}[];
|
|
171
90
|
}, import("@effect/schema/ParseResult").ParseError>;
|
|
172
91
|
encodeExn: (event: {
|
|
173
|
-
readonly
|
|
174
|
-
readonly
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
readonly name: string;
|
|
186
|
-
}[];
|
|
187
|
-
} & {
|
|
188
|
-
readonly id: string;
|
|
189
|
-
} & {
|
|
190
|
-
readonly tags: readonly ({
|
|
191
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
192
|
-
readonly extID: string;
|
|
193
|
-
readonly extSource: string;
|
|
194
|
-
} | {
|
|
195
|
-
readonly type: "CATEGORY";
|
|
196
|
-
readonly value: string;
|
|
197
|
-
} | {
|
|
198
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
199
|
-
readonly id: string;
|
|
200
|
-
})[];
|
|
201
|
-
};
|
|
202
|
-
readonly status: "NEW" | "UPDATED";
|
|
203
|
-
readonly source: "INTERNAL";
|
|
204
|
-
};
|
|
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
|
+
}[];
|
|
205
104
|
}) => {
|
|
206
|
-
readonly
|
|
207
|
-
readonly
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
readonly name: string;
|
|
219
|
-
}[];
|
|
220
|
-
} & {
|
|
221
|
-
readonly id: string;
|
|
222
|
-
} & {
|
|
223
|
-
readonly tags: readonly ({
|
|
224
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
225
|
-
readonly extID: string;
|
|
226
|
-
readonly extSource: string;
|
|
227
|
-
} | {
|
|
228
|
-
readonly type: "CATEGORY";
|
|
229
|
-
readonly value: string;
|
|
230
|
-
} | {
|
|
231
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
232
|
-
readonly id: string;
|
|
233
|
-
})[];
|
|
234
|
-
};
|
|
235
|
-
readonly status: "NEW" | "UPDATED";
|
|
236
|
-
readonly source: "INTERNAL";
|
|
237
|
-
};
|
|
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
|
+
}[];
|
|
238
117
|
};
|
|
239
118
|
fromString: (msg: string) => import("effect/Either").Either<{
|
|
240
|
-
readonly
|
|
241
|
-
readonly
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
readonly name: string;
|
|
253
|
-
}[];
|
|
254
|
-
} & {
|
|
255
|
-
readonly id: string;
|
|
256
|
-
} & {
|
|
257
|
-
readonly tags: readonly ({
|
|
258
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
259
|
-
readonly extID: string;
|
|
260
|
-
readonly extSource: string;
|
|
261
|
-
} | {
|
|
262
|
-
readonly type: "CATEGORY";
|
|
263
|
-
readonly value: string;
|
|
264
|
-
} | {
|
|
265
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
266
|
-
readonly id: string;
|
|
267
|
-
})[];
|
|
268
|
-
};
|
|
269
|
-
readonly status: "NEW" | "UPDATED";
|
|
270
|
-
readonly source: "INTERNAL";
|
|
271
|
-
};
|
|
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
|
+
}[];
|
|
272
131
|
}, import("@effect/schema/ParseResult").ParseError>;
|
|
273
132
|
fromBuffer: (msg: Buffer) => import("effect/Either").Either<{
|
|
274
|
-
readonly
|
|
275
|
-
readonly
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
readonly name: string;
|
|
287
|
-
}[];
|
|
288
|
-
} & {
|
|
289
|
-
readonly id: string;
|
|
290
|
-
} & {
|
|
291
|
-
readonly tags: readonly ({
|
|
292
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
293
|
-
readonly extID: string;
|
|
294
|
-
readonly extSource: string;
|
|
295
|
-
} | {
|
|
296
|
-
readonly type: "CATEGORY";
|
|
297
|
-
readonly value: string;
|
|
298
|
-
} | {
|
|
299
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
300
|
-
readonly id: string;
|
|
301
|
-
})[];
|
|
302
|
-
};
|
|
303
|
-
readonly status: "NEW" | "UPDATED";
|
|
304
|
-
readonly source: "INTERNAL";
|
|
305
|
-
};
|
|
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
|
+
}[];
|
|
306
145
|
}, import("@effect/schema/ParseResult").ParseError>;
|
|
307
146
|
fromStringExn: (msg: string) => {
|
|
308
|
-
readonly
|
|
309
|
-
readonly
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
readonly name: string;
|
|
321
|
-
}[];
|
|
322
|
-
} & {
|
|
323
|
-
readonly id: string;
|
|
324
|
-
} & {
|
|
325
|
-
readonly tags: readonly ({
|
|
326
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
327
|
-
readonly extID: string;
|
|
328
|
-
readonly extSource: string;
|
|
329
|
-
} | {
|
|
330
|
-
readonly type: "CATEGORY";
|
|
331
|
-
readonly value: string;
|
|
332
|
-
} | {
|
|
333
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
334
|
-
readonly id: string;
|
|
335
|
-
})[];
|
|
336
|
-
};
|
|
337
|
-
readonly status: "NEW" | "UPDATED";
|
|
338
|
-
readonly source: "INTERNAL";
|
|
339
|
-
};
|
|
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
|
+
}[];
|
|
340
159
|
};
|
|
341
160
|
fromBufferExn: (msg: Buffer) => {
|
|
342
|
-
readonly
|
|
343
|
-
readonly
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
readonly name: string;
|
|
355
|
-
}[];
|
|
356
|
-
} & {
|
|
357
|
-
readonly id: string;
|
|
358
|
-
} & {
|
|
359
|
-
readonly tags: readonly ({
|
|
360
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
361
|
-
readonly extID: string;
|
|
362
|
-
readonly extSource: string;
|
|
363
|
-
} | {
|
|
364
|
-
readonly type: "CATEGORY";
|
|
365
|
-
readonly value: string;
|
|
366
|
-
} | {
|
|
367
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
368
|
-
readonly id: string;
|
|
369
|
-
})[];
|
|
370
|
-
};
|
|
371
|
-
readonly status: "NEW" | "UPDATED";
|
|
372
|
-
readonly source: "INTERNAL";
|
|
373
|
-
};
|
|
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
|
+
}[];
|
|
374
173
|
};
|
|
375
174
|
toString: (event: {
|
|
376
|
-
readonly
|
|
377
|
-
readonly
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
readonly name: string;
|
|
389
|
-
}[];
|
|
390
|
-
} & {
|
|
391
|
-
readonly id: string;
|
|
392
|
-
} & {
|
|
393
|
-
readonly tags: readonly ({
|
|
394
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
395
|
-
readonly extID: string;
|
|
396
|
-
readonly extSource: string;
|
|
397
|
-
} | {
|
|
398
|
-
readonly type: "CATEGORY";
|
|
399
|
-
readonly value: string;
|
|
400
|
-
} | {
|
|
401
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
402
|
-
readonly id: string;
|
|
403
|
-
})[];
|
|
404
|
-
};
|
|
405
|
-
readonly status: "NEW" | "UPDATED";
|
|
406
|
-
readonly source: "INTERNAL";
|
|
407
|
-
};
|
|
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
|
+
}[];
|
|
408
187
|
}) => string;
|
|
409
188
|
toBuffer: (event: {
|
|
410
|
-
readonly
|
|
411
|
-
readonly
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
readonly name: string;
|
|
423
|
-
}[];
|
|
424
|
-
} & {
|
|
425
|
-
readonly id: string;
|
|
426
|
-
} & {
|
|
427
|
-
readonly tags: readonly ({
|
|
428
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
429
|
-
readonly extID: string;
|
|
430
|
-
readonly extSource: string;
|
|
431
|
-
} | {
|
|
432
|
-
readonly type: "CATEGORY";
|
|
433
|
-
readonly value: string;
|
|
434
|
-
} | {
|
|
435
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
436
|
-
readonly id: string;
|
|
437
|
-
})[];
|
|
438
|
-
};
|
|
439
|
-
readonly status: "NEW" | "UPDATED";
|
|
440
|
-
readonly source: "INTERNAL";
|
|
441
|
-
};
|
|
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
|
+
}[];
|
|
442
201
|
}) => Buffer;
|
|
443
202
|
toStringExn: (event: {
|
|
444
|
-
readonly
|
|
445
|
-
readonly
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
readonly name: string;
|
|
457
|
-
}[];
|
|
458
|
-
} & {
|
|
459
|
-
readonly id: string;
|
|
460
|
-
} & {
|
|
461
|
-
readonly tags: readonly ({
|
|
462
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
463
|
-
readonly extID: string;
|
|
464
|
-
readonly extSource: string;
|
|
465
|
-
} | {
|
|
466
|
-
readonly type: "CATEGORY";
|
|
467
|
-
readonly value: string;
|
|
468
|
-
} | {
|
|
469
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
470
|
-
readonly id: string;
|
|
471
|
-
})[];
|
|
472
|
-
};
|
|
473
|
-
readonly status: "NEW" | "UPDATED";
|
|
474
|
-
readonly source: "INTERNAL";
|
|
475
|
-
};
|
|
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
|
+
}[];
|
|
476
215
|
}) => string;
|
|
477
216
|
toBufferExn: (event: {
|
|
478
|
-
readonly
|
|
479
|
-
readonly
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
readonly name: string;
|
|
491
|
-
}[];
|
|
492
|
-
} & {
|
|
493
|
-
readonly id: string;
|
|
494
|
-
} & {
|
|
495
|
-
readonly tags: readonly ({
|
|
496
|
-
readonly type: "DRUPAL_EXTERNAL_ID";
|
|
497
|
-
readonly extID: string;
|
|
498
|
-
readonly extSource: string;
|
|
499
|
-
} | {
|
|
500
|
-
readonly type: "CATEGORY";
|
|
501
|
-
readonly value: string;
|
|
502
|
-
} | {
|
|
503
|
-
readonly type: "EXTERNAL_ARTICLE_REFERENCE";
|
|
504
|
-
readonly id: string;
|
|
505
|
-
})[];
|
|
506
|
-
};
|
|
507
|
-
readonly status: "NEW" | "UPDATED";
|
|
508
|
-
readonly source: "INTERNAL";
|
|
509
|
-
};
|
|
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
|
+
}[];
|
|
510
229
|
}) => Buffer;
|
|
511
230
|
Schema: Schema.Struct<{
|
|
512
231
|
kind: Schema.Literal<["INTERNAL_ARTICLE_EVENT"]>;
|
|
513
232
|
payload: Schema.Struct<{
|
|
514
|
-
article: Schema.extend<Schema.
|
|
233
|
+
article: Schema.extend<Schema.Struct<{
|
|
234
|
+
id: typeof Schema.NonEmptyString;
|
|
515
235
|
title: typeof Schema.NonEmptyString;
|
|
516
236
|
teaser: typeof Schema.NonEmptyString;
|
|
517
237
|
content: typeof Schema.NonEmptyString;
|
|
@@ -524,14 +244,12 @@ declare const _default: {
|
|
|
524
244
|
name: typeof Schema.NonEmptyString;
|
|
525
245
|
}>>;
|
|
526
246
|
}>, Schema.Struct<{
|
|
527
|
-
id: typeof Schema.NonEmptyString;
|
|
528
|
-
}>>, Schema.Struct<{
|
|
529
247
|
tags: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
530
248
|
type: Schema.Literal<["CATEGORY"]>;
|
|
531
249
|
value: typeof Schema.NonEmptyString;
|
|
532
250
|
}>, Schema.Struct<{
|
|
533
251
|
type: Schema.Literal<["EXTERNAL_ARTICLE_REFERENCE"]>;
|
|
534
|
-
id: typeof Schema.
|
|
252
|
+
id: typeof Schema.NonEmptyString;
|
|
535
253
|
}>, Schema.Struct<{
|
|
536
254
|
type: Schema.Literal<["DRUPAL_EXTERNAL_ID"]>;
|
|
537
255
|
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({
|
|
@@ -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)(
|
|
18
|
+
const helpers = (0, makeHelpers_1.makeHelpers)(Article_1.BaseArticleSchema);
|
|
19
19
|
exports.default = Object.assign({ Schema: exports.InternalArticleEventSchema }, helpers);
|
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.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);
|