@productminds/article-events 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,21 +4,21 @@ export declare const ExternalArticleEventSchema: Schema.Struct<{
4
4
  payload: Schema.Struct<{
5
5
  article: Schema.extend<Schema.Struct<{
6
6
  id: typeof Schema.UUID;
7
- title: typeof Schema.NonEmpty;
8
- teaser: typeof Schema.NonEmpty;
9
- content: typeof Schema.NonEmpty;
10
- publishedAt: typeof Schema.Date;
11
- updatedAt: typeof Schema.Date;
12
- retrievedAt: typeof Schema.Date;
13
- url: typeof Schema.NonEmpty;
14
- site: typeof Schema.NonEmpty;
7
+ title: typeof Schema.NonEmptyString;
8
+ teaser: typeof Schema.NonEmptyString;
9
+ content: typeof Schema.NonEmptyString;
10
+ publishedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
11
+ updatedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
12
+ retrievedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
13
+ url: typeof Schema.NonEmptyString;
14
+ site: typeof Schema.NonEmptyString;
15
15
  authors: Schema.Array$<Schema.Struct<{
16
- name: typeof Schema.NonEmpty;
16
+ name: typeof Schema.NonEmptyString;
17
17
  }>>;
18
18
  }>, Schema.Struct<{
19
19
  tags: Schema.Array$<Schema.Struct<{
20
20
  type: Schema.Literal<["CATEGORY"]>;
21
- value: typeof Schema.NonEmpty;
21
+ value: typeof Schema.NonEmptyString;
22
22
  }>>;
23
23
  }>>;
24
24
  status: Schema.Literal<["NEW", "UPDATED"]>;
@@ -393,21 +393,21 @@ declare const _default: {
393
393
  payload: Schema.Struct<{
394
394
  article: Schema.extend<Schema.Struct<{
395
395
  id: typeof Schema.UUID;
396
- title: typeof Schema.NonEmpty;
397
- teaser: typeof Schema.NonEmpty;
398
- content: typeof Schema.NonEmpty;
399
- publishedAt: typeof Schema.Date;
400
- updatedAt: typeof Schema.Date;
401
- retrievedAt: typeof Schema.Date;
402
- url: typeof Schema.NonEmpty;
403
- site: typeof Schema.NonEmpty;
396
+ title: typeof Schema.NonEmptyString;
397
+ teaser: typeof Schema.NonEmptyString;
398
+ content: typeof Schema.NonEmptyString;
399
+ publishedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
400
+ updatedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
401
+ retrievedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
402
+ url: typeof Schema.NonEmptyString;
403
+ site: typeof Schema.NonEmptyString;
404
404
  authors: Schema.Array$<Schema.Struct<{
405
- name: typeof Schema.NonEmpty;
405
+ name: typeof Schema.NonEmptyString;
406
406
  }>>;
407
407
  }>, Schema.Struct<{
408
408
  tags: Schema.Array$<Schema.Struct<{
409
409
  type: Schema.Literal<["CATEGORY"]>;
410
- value: typeof Schema.NonEmpty;
410
+ value: typeof Schema.NonEmptyString;
411
411
  }>>;
412
412
  }>>;
413
413
  status: Schema.Literal<["NEW", "UPDATED"]>;
@@ -4,24 +4,28 @@ export declare const InternalArticleEventSchema: Schema.Struct<{
4
4
  payload: Schema.Struct<{
5
5
  article: Schema.extend<Schema.Struct<{
6
6
  id: typeof Schema.UUID;
7
- title: typeof Schema.NonEmpty;
8
- teaser: typeof Schema.NonEmpty;
9
- content: typeof Schema.NonEmpty;
10
- publishedAt: typeof Schema.Date;
11
- updatedAt: typeof Schema.Date;
12
- retrievedAt: typeof Schema.Date;
13
- url: typeof Schema.NonEmpty;
14
- site: typeof Schema.NonEmpty;
7
+ title: typeof Schema.NonEmptyString;
8
+ teaser: typeof Schema.NonEmptyString;
9
+ content: typeof Schema.NonEmptyString;
10
+ publishedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
11
+ updatedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
12
+ retrievedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
13
+ url: typeof Schema.NonEmptyString;
14
+ site: typeof Schema.NonEmptyString;
15
15
  authors: Schema.Array$<Schema.Struct<{
16
- name: typeof Schema.NonEmpty;
16
+ name: typeof Schema.NonEmptyString;
17
17
  }>>;
18
18
  }>, Schema.Struct<{
19
19
  tags: Schema.Array$<Schema.Union<[Schema.Struct<{
20
20
  type: Schema.Literal<["CATEGORY"]>;
21
- value: typeof Schema.NonEmpty;
21
+ value: typeof Schema.NonEmptyString;
22
22
  }>, Schema.Struct<{
23
23
  type: Schema.Literal<["EXTERNAL_ARTICLE_REFERENCE"]>;
24
24
  id: typeof Schema.UUID;
25
+ }>, Schema.Struct<{
26
+ type: Schema.Literal<["DRUPAL_EXTERNAL_ID"]>;
27
+ extID: typeof Schema.UUID;
28
+ extSource: typeof Schema.String;
25
29
  }>]>>;
26
30
  }>>;
27
31
  status: Schema.Literal<["NEW", "UPDATED"]>;
@@ -47,6 +51,10 @@ declare const _default: {
47
51
  }[];
48
52
  } & {
49
53
  readonly tags: readonly ({
54
+ readonly type: "DRUPAL_EXTERNAL_ID";
55
+ readonly extID: string;
56
+ readonly extSource: string;
57
+ } | {
50
58
  readonly type: "CATEGORY";
51
59
  readonly value: string;
52
60
  } | {
@@ -76,6 +84,10 @@ declare const _default: {
76
84
  }[];
77
85
  } & {
78
86
  readonly tags: readonly ({
87
+ readonly type: "DRUPAL_EXTERNAL_ID";
88
+ readonly extID: string;
89
+ readonly extSource: string;
90
+ } | {
79
91
  readonly type: "CATEGORY";
80
92
  readonly value: string;
81
93
  } | {
@@ -105,6 +117,10 @@ declare const _default: {
105
117
  }[];
106
118
  } & {
107
119
  readonly tags: readonly ({
120
+ readonly type: "DRUPAL_EXTERNAL_ID";
121
+ readonly extID: string;
122
+ readonly extSource: string;
123
+ } | {
108
124
  readonly type: "CATEGORY";
109
125
  readonly value: string;
110
126
  } | {
@@ -133,6 +149,10 @@ declare const _default: {
133
149
  }[];
134
150
  } & {
135
151
  readonly tags: readonly ({
152
+ readonly type: "DRUPAL_EXTERNAL_ID";
153
+ readonly extID: string;
154
+ readonly extSource: string;
155
+ } | {
136
156
  readonly type: "CATEGORY";
137
157
  readonly value: string;
138
158
  } | {
@@ -162,6 +182,10 @@ declare const _default: {
162
182
  }[];
163
183
  } & {
164
184
  readonly tags: readonly ({
185
+ readonly type: "DRUPAL_EXTERNAL_ID";
186
+ readonly extID: string;
187
+ readonly extSource: string;
188
+ } | {
165
189
  readonly type: "CATEGORY";
166
190
  readonly value: string;
167
191
  } | {
@@ -190,6 +214,10 @@ declare const _default: {
190
214
  }[];
191
215
  } & {
192
216
  readonly tags: readonly ({
217
+ readonly type: "DRUPAL_EXTERNAL_ID";
218
+ readonly extID: string;
219
+ readonly extSource: string;
220
+ } | {
193
221
  readonly type: "CATEGORY";
194
222
  readonly value: string;
195
223
  } | {
@@ -219,6 +247,10 @@ declare const _default: {
219
247
  }[];
220
248
  } & {
221
249
  readonly tags: readonly ({
250
+ readonly type: "DRUPAL_EXTERNAL_ID";
251
+ readonly extID: string;
252
+ readonly extSource: string;
253
+ } | {
222
254
  readonly type: "CATEGORY";
223
255
  readonly value: string;
224
256
  } | {
@@ -248,6 +280,10 @@ declare const _default: {
248
280
  }[];
249
281
  } & {
250
282
  readonly tags: readonly ({
283
+ readonly type: "DRUPAL_EXTERNAL_ID";
284
+ readonly extID: string;
285
+ readonly extSource: string;
286
+ } | {
251
287
  readonly type: "CATEGORY";
252
288
  readonly value: string;
253
289
  } | {
@@ -277,6 +313,10 @@ declare const _default: {
277
313
  }[];
278
314
  } & {
279
315
  readonly tags: readonly ({
316
+ readonly type: "DRUPAL_EXTERNAL_ID";
317
+ readonly extID: string;
318
+ readonly extSource: string;
319
+ } | {
280
320
  readonly type: "CATEGORY";
281
321
  readonly value: string;
282
322
  } | {
@@ -306,6 +346,10 @@ declare const _default: {
306
346
  }[];
307
347
  } & {
308
348
  readonly tags: readonly ({
349
+ readonly type: "DRUPAL_EXTERNAL_ID";
350
+ readonly extID: string;
351
+ readonly extSource: string;
352
+ } | {
309
353
  readonly type: "CATEGORY";
310
354
  readonly value: string;
311
355
  } | {
@@ -335,6 +379,10 @@ declare const _default: {
335
379
  }[];
336
380
  } & {
337
381
  readonly tags: readonly ({
382
+ readonly type: "DRUPAL_EXTERNAL_ID";
383
+ readonly extID: string;
384
+ readonly extSource: string;
385
+ } | {
338
386
  readonly type: "CATEGORY";
339
387
  readonly value: string;
340
388
  } | {
@@ -364,6 +412,10 @@ declare const _default: {
364
412
  }[];
365
413
  } & {
366
414
  readonly tags: readonly ({
415
+ readonly type: "DRUPAL_EXTERNAL_ID";
416
+ readonly extID: string;
417
+ readonly extSource: string;
418
+ } | {
367
419
  readonly type: "CATEGORY";
368
420
  readonly value: string;
369
421
  } | {
@@ -393,6 +445,10 @@ declare const _default: {
393
445
  }[];
394
446
  } & {
395
447
  readonly tags: readonly ({
448
+ readonly type: "DRUPAL_EXTERNAL_ID";
449
+ readonly extID: string;
450
+ readonly extSource: string;
451
+ } | {
396
452
  readonly type: "CATEGORY";
397
453
  readonly value: string;
398
454
  } | {
@@ -422,6 +478,10 @@ declare const _default: {
422
478
  }[];
423
479
  } & {
424
480
  readonly tags: readonly ({
481
+ readonly type: "DRUPAL_EXTERNAL_ID";
482
+ readonly extID: string;
483
+ readonly extSource: string;
484
+ } | {
425
485
  readonly type: "CATEGORY";
426
486
  readonly value: string;
427
487
  } | {
@@ -438,24 +498,28 @@ declare const _default: {
438
498
  payload: Schema.Struct<{
439
499
  article: Schema.extend<Schema.Struct<{
440
500
  id: typeof Schema.UUID;
441
- title: typeof Schema.NonEmpty;
442
- teaser: typeof Schema.NonEmpty;
443
- content: typeof Schema.NonEmpty;
444
- publishedAt: typeof Schema.Date;
445
- updatedAt: typeof Schema.Date;
446
- retrievedAt: typeof Schema.Date;
447
- url: typeof Schema.NonEmpty;
448
- site: typeof Schema.NonEmpty;
501
+ title: typeof Schema.NonEmptyString;
502
+ teaser: typeof Schema.NonEmptyString;
503
+ content: typeof Schema.NonEmptyString;
504
+ publishedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
505
+ updatedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
506
+ retrievedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
507
+ url: typeof Schema.NonEmptyString;
508
+ site: typeof Schema.NonEmptyString;
449
509
  authors: Schema.Array$<Schema.Struct<{
450
- name: typeof Schema.NonEmpty;
510
+ name: typeof Schema.NonEmptyString;
451
511
  }>>;
452
512
  }>, Schema.Struct<{
453
513
  tags: Schema.Array$<Schema.Union<[Schema.Struct<{
454
514
  type: Schema.Literal<["CATEGORY"]>;
455
- value: typeof Schema.NonEmpty;
515
+ value: typeof Schema.NonEmptyString;
456
516
  }>, Schema.Struct<{
457
517
  type: Schema.Literal<["EXTERNAL_ARTICLE_REFERENCE"]>;
458
518
  id: typeof Schema.UUID;
519
+ }>, Schema.Struct<{
520
+ type: Schema.Literal<["DRUPAL_EXTERNAL_ID"]>;
521
+ extID: typeof Schema.UUID;
522
+ extSource: typeof Schema.String;
459
523
  }>]>>;
460
524
  }>>;
461
525
  status: Schema.Literal<["NEW", "UPDATED"]>;
@@ -5,7 +5,7 @@ const schema_1 = require("@effect/schema");
5
5
  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
- tags: schema_1.Schema.Array(schema_1.Schema.Union(Article_1.CategoryTagSchema, Article_1.ExternalArticleReferenceTagSchema)),
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({
11
11
  kind: schema_1.Schema.Literal('INTERNAL_ARTICLE_EVENT'),
@@ -1,27 +1,32 @@
1
1
  import { Schema } from '@effect/schema';
2
- export declare const DateTimeSchema: typeof Schema.Date;
2
+ export declare const DateTimeSchema: Schema.refine<Date, Schema.Schema<Date, string, never>>;
3
3
  export declare const CategoryTagSchema: Schema.Struct<{
4
4
  type: Schema.Literal<["CATEGORY"]>;
5
- value: typeof Schema.NonEmpty;
5
+ value: typeof Schema.NonEmptyString;
6
6
  }>;
7
7
  export declare const ExternalArticleReferenceTagSchema: Schema.Struct<{
8
8
  type: Schema.Literal<["EXTERNAL_ARTICLE_REFERENCE"]>;
9
9
  id: typeof Schema.UUID;
10
10
  }>;
11
+ export declare const DrupalExternalIDTag: Schema.Struct<{
12
+ type: Schema.Literal<["DRUPAL_EXTERNAL_ID"]>;
13
+ extID: typeof Schema.UUID;
14
+ extSource: typeof Schema.String;
15
+ }>;
11
16
  export declare const AuthorSchema: Schema.Struct<{
12
- name: typeof Schema.NonEmpty;
17
+ name: typeof Schema.NonEmptyString;
13
18
  }>;
14
19
  export declare const BaseArticleSchema: Schema.Struct<{
15
20
  id: typeof Schema.UUID;
16
- title: typeof Schema.NonEmpty;
17
- teaser: typeof Schema.NonEmpty;
18
- content: typeof Schema.NonEmpty;
19
- publishedAt: typeof Schema.Date;
20
- updatedAt: typeof Schema.Date;
21
- retrievedAt: typeof Schema.Date;
22
- url: typeof Schema.NonEmpty;
23
- site: typeof Schema.NonEmpty;
21
+ title: typeof Schema.NonEmptyString;
22
+ teaser: typeof Schema.NonEmptyString;
23
+ content: typeof Schema.NonEmptyString;
24
+ publishedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
25
+ updatedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
26
+ retrievedAt: Schema.refine<Date, Schema.Schema<Date, string, never>>;
27
+ url: typeof Schema.NonEmptyString;
28
+ site: typeof Schema.NonEmptyString;
24
29
  authors: Schema.Array$<Schema.Struct<{
25
- name: typeof Schema.NonEmpty;
30
+ name: typeof Schema.NonEmptyString;
26
31
  }>>;
27
32
  }>;
@@ -1,30 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseArticleSchema = exports.AuthorSchema = exports.ExternalArticleReferenceTagSchema = exports.CategoryTagSchema = exports.DateTimeSchema = void 0;
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.Date.annotations({
6
- jsonSchema: { format: 'date-time' },
6
+ jsonSchema: { type: 'string', format: 'date-time' },
7
7
  });
8
8
  exports.CategoryTagSchema = schema_1.Schema.Struct({
9
9
  type: schema_1.Schema.Literal('CATEGORY'),
10
- value: schema_1.Schema.NonEmpty,
10
+ value: schema_1.Schema.NonEmptyString,
11
11
  });
12
12
  exports.ExternalArticleReferenceTagSchema = schema_1.Schema.Struct({
13
13
  type: schema_1.Schema.Literal('EXTERNAL_ARTICLE_REFERENCE'),
14
14
  id: schema_1.Schema.UUID,
15
15
  });
16
+ exports.DrupalExternalIDTag = schema_1.Schema.Struct({
17
+ type: schema_1.Schema.Literal('DRUPAL_EXTERNAL_ID'),
18
+ extID: schema_1.Schema.UUID,
19
+ extSource: schema_1.Schema.String,
20
+ }).annotations({
21
+ description: 'A special case tag for tracking where a Drupal article was created from',
22
+ });
16
23
  exports.AuthorSchema = schema_1.Schema.Struct({
17
- name: schema_1.Schema.NonEmpty,
24
+ name: schema_1.Schema.NonEmptyString,
18
25
  });
19
26
  exports.BaseArticleSchema = schema_1.Schema.Struct({
20
27
  id: schema_1.Schema.UUID,
21
- title: schema_1.Schema.NonEmpty,
22
- teaser: schema_1.Schema.NonEmpty,
23
- content: schema_1.Schema.NonEmpty,
28
+ title: schema_1.Schema.NonEmptyString,
29
+ teaser: schema_1.Schema.NonEmptyString,
30
+ content: schema_1.Schema.NonEmptyString,
24
31
  publishedAt: exports.DateTimeSchema,
25
32
  updatedAt: exports.DateTimeSchema,
26
33
  retrievedAt: exports.DateTimeSchema,
27
- url: schema_1.Schema.NonEmpty,
28
- site: schema_1.Schema.NonEmpty,
34
+ url: schema_1.Schema.NonEmptyString,
35
+ site: schema_1.Schema.NonEmptyString,
29
36
  authors: schema_1.Schema.Array(exports.AuthorSchema),
30
37
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@productminds/article-events",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "Article events",
5
5
  "license": "ISC",
6
6
  "main": "lib/article-events.js",