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