@productminds/article-events 6.2.2 → 7.0.1

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