@pagopa/interop-outbound-models 1.0.11-a → 1.0.11-c

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/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## 1.0.13
6
+
7
+ ### Added
8
+ - Added e-service event `EServiceDescriptorAttributesUpdated` (In-Add Attributes Feature)
@@ -0,0 +1,90 @@
1
+ import { z } from "zod";
2
+ import { ProducerDelegationSubmittedV2, ProducerDelegationApprovedV2, ProducerDelegationRejectedV2, ProducerDelegationRevokedV2 } from "../gen/v2/delegation/events.js";
3
+ export declare function delegationEventToBinaryDataV2(event: DelegationEventV2): Uint8Array;
4
+ export declare const DelegationEventV2: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5
+ event_version: z.ZodLiteral<2>;
6
+ type: z.ZodLiteral<"ProducerDelegationSubmitted">;
7
+ data: z.ZodEffects<z.ZodAny, ProducerDelegationSubmittedV2, any>;
8
+ stream_id: z.ZodString;
9
+ version: z.ZodNumber;
10
+ timestamp: z.ZodDate;
11
+ }, "strip", z.ZodTypeAny, {
12
+ event_version: 2;
13
+ type: "ProducerDelegationSubmitted";
14
+ version: number;
15
+ data: ProducerDelegationSubmittedV2;
16
+ stream_id: string;
17
+ timestamp: Date;
18
+ }, {
19
+ event_version: 2;
20
+ type: "ProducerDelegationSubmitted";
21
+ version: number;
22
+ stream_id: string;
23
+ timestamp: Date;
24
+ data?: any;
25
+ }>, z.ZodObject<{
26
+ event_version: z.ZodLiteral<2>;
27
+ type: z.ZodLiteral<"ProducerDelegationApproved">;
28
+ data: z.ZodEffects<z.ZodAny, ProducerDelegationApprovedV2, any>;
29
+ stream_id: z.ZodString;
30
+ version: z.ZodNumber;
31
+ timestamp: z.ZodDate;
32
+ }, "strip", z.ZodTypeAny, {
33
+ event_version: 2;
34
+ type: "ProducerDelegationApproved";
35
+ version: number;
36
+ data: ProducerDelegationApprovedV2;
37
+ stream_id: string;
38
+ timestamp: Date;
39
+ }, {
40
+ event_version: 2;
41
+ type: "ProducerDelegationApproved";
42
+ version: number;
43
+ stream_id: string;
44
+ timestamp: Date;
45
+ data?: any;
46
+ }>, z.ZodObject<{
47
+ event_version: z.ZodLiteral<2>;
48
+ type: z.ZodLiteral<"ProducerDelegationRejected">;
49
+ data: z.ZodEffects<z.ZodAny, ProducerDelegationRejectedV2, any>;
50
+ stream_id: z.ZodString;
51
+ version: z.ZodNumber;
52
+ timestamp: z.ZodDate;
53
+ }, "strip", z.ZodTypeAny, {
54
+ event_version: 2;
55
+ type: "ProducerDelegationRejected";
56
+ version: number;
57
+ data: ProducerDelegationRejectedV2;
58
+ stream_id: string;
59
+ timestamp: Date;
60
+ }, {
61
+ event_version: 2;
62
+ type: "ProducerDelegationRejected";
63
+ version: number;
64
+ stream_id: string;
65
+ timestamp: Date;
66
+ data?: any;
67
+ }>, z.ZodObject<{
68
+ event_version: z.ZodLiteral<2>;
69
+ type: z.ZodLiteral<"ProducerDelegationRevoked">;
70
+ data: z.ZodEffects<z.ZodAny, ProducerDelegationRevokedV2, any>;
71
+ stream_id: z.ZodString;
72
+ version: z.ZodNumber;
73
+ timestamp: z.ZodDate;
74
+ }, "strip", z.ZodTypeAny, {
75
+ event_version: 2;
76
+ type: "ProducerDelegationRevoked";
77
+ version: number;
78
+ data: ProducerDelegationRevokedV2;
79
+ stream_id: string;
80
+ timestamp: Date;
81
+ }, {
82
+ event_version: 2;
83
+ type: "ProducerDelegationRevoked";
84
+ version: number;
85
+ stream_id: string;
86
+ timestamp: Date;
87
+ data?: any;
88
+ }>]>;
89
+ export type DelegationEventV2 = z.infer<typeof DelegationEventV2>;
90
+ //# sourceMappingURL=eventsV2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventsV2.d.ts","sourceRoot":"","sources":["../../src/delegation/eventsV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,gCAAgC,CAAC;AAGxC,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,iBAAiB,GACvB,UAAU,CAeZ;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiC5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+ import { match } from "ts-pattern";
3
+ import { ProducerDelegationSubmittedV2, ProducerDelegationApprovedV2, ProducerDelegationRejectedV2, ProducerDelegationRevokedV2, } from "../gen/v2/delegation/events.js";
4
+ import { protobufDecoder } from "../utils.js";
5
+ export function delegationEventToBinaryDataV2(event) {
6
+ return match(event)
7
+ .with({ type: "ProducerDelegationSubmitted" }, ({ data }) => ProducerDelegationSubmittedV2.toBinary(data))
8
+ .with({ type: "ProducerDelegationApproved" }, ({ data }) => ProducerDelegationApprovedV2.toBinary(data))
9
+ .with({ type: "ProducerDelegationRejected" }, ({ data }) => ProducerDelegationRejectedV2.toBinary(data))
10
+ .with({ type: "ProducerDelegationRevoked" }, ({ data }) => ProducerDelegationRevokedV2.toBinary(data))
11
+ .exhaustive();
12
+ }
13
+ export const DelegationEventV2 = z.discriminatedUnion("type", [
14
+ z.object({
15
+ event_version: z.literal(2),
16
+ type: z.literal("ProducerDelegationSubmitted"),
17
+ data: protobufDecoder(ProducerDelegationSubmittedV2),
18
+ stream_id: z.string(),
19
+ version: z.number(),
20
+ timestamp: z.coerce.date(),
21
+ }),
22
+ z.object({
23
+ event_version: z.literal(2),
24
+ type: z.literal("ProducerDelegationApproved"),
25
+ data: protobufDecoder(ProducerDelegationApprovedV2),
26
+ stream_id: z.string(),
27
+ version: z.number(),
28
+ timestamp: z.coerce.date(),
29
+ }),
30
+ z.object({
31
+ event_version: z.literal(2),
32
+ type: z.literal("ProducerDelegationRejected"),
33
+ data: protobufDecoder(ProducerDelegationRejectedV2),
34
+ stream_id: z.string(),
35
+ version: z.number(),
36
+ timestamp: z.coerce.date(),
37
+ }),
38
+ z.object({
39
+ event_version: z.literal(2),
40
+ type: z.literal("ProducerDelegationRevoked"),
41
+ data: protobufDecoder(ProducerDelegationRevokedV2),
42
+ stream_id: z.string(),
43
+ version: z.number(),
44
+ timestamp: z.coerce.date(),
45
+ }),
46
+ ]);
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ import { DelegationEventV2 } from "./eventsV2.js";
3
+ export declare function encodeOutboundDelegationEvent(event: DelegationEvent): string;
4
+ export declare function decodeOutboundDelegationEvent(encodedEvent: string): DelegationEvent;
5
+ export declare const DelegationEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"event_version", [z.ZodObject<{
6
+ event_version: z.ZodLiteral<1>;
7
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
8
+ event_version: z.ZodLiteral<1>;
9
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
10
+ event_version: z.ZodLiteral<1>;
11
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
12
+ event_version: z.ZodLiteral<2>;
13
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14
+ event_version: z.ZodLiteral<2>;
15
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
16
+ event_version: z.ZodLiteral<2>;
17
+ }, z.ZodTypeAny, "passthrough">>]>, {
18
+ event_version: 2;
19
+ type: "ProducerDelegationSubmitted";
20
+ version: number;
21
+ data: import("../gen/v2/delegation/events.js").ProducerDelegationSubmittedV2;
22
+ stream_id: string;
23
+ timestamp: Date;
24
+ } | {
25
+ event_version: 2;
26
+ type: "ProducerDelegationApproved";
27
+ version: number;
28
+ data: import("../gen/v2/delegation/events.js").ProducerDelegationApprovedV2;
29
+ stream_id: string;
30
+ timestamp: Date;
31
+ } | {
32
+ event_version: 2;
33
+ type: "ProducerDelegationRejected";
34
+ version: number;
35
+ data: import("../gen/v2/delegation/events.js").ProducerDelegationRejectedV2;
36
+ stream_id: string;
37
+ timestamp: Date;
38
+ } | {
39
+ event_version: 2;
40
+ type: "ProducerDelegationRevoked";
41
+ version: number;
42
+ data: import("../gen/v2/delegation/events.js").ProducerDelegationRevokedV2;
43
+ stream_id: string;
44
+ timestamp: Date;
45
+ }, z.objectInputType<{
46
+ event_version: z.ZodLiteral<1>;
47
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
48
+ event_version: z.ZodLiteral<2>;
49
+ }, z.ZodTypeAny, "passthrough">>;
50
+ export type DelegationEventType = DelegationEvent["type"];
51
+ export type DelegationEvent = z.infer<typeof DelegationEvent>;
52
+ export { DelegationEventV2 };
53
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,iBAAiB,EAElB,MAAM,eAAe,CAAC;AAQvB,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAS5E;AAED,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,MAAM,GACnB,eAAe,CAEjB;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAa1B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { match } from "ts-pattern";
2
+ import { z } from "zod";
3
+ import { VersionedEvent } from "../utils.js";
4
+ import { DelegationEventV2, delegationEventToBinaryDataV2, } from "./eventsV2.js";
5
+ function delegationEventToBinaryData(event) {
6
+ return match(event)
7
+ .with({ event_version: 2 }, delegationEventToBinaryDataV2)
8
+ .exhaustive();
9
+ }
10
+ export function encodeOutboundDelegationEvent(event) {
11
+ return JSON.stringify({
12
+ event_version: event.event_version,
13
+ type: event.type,
14
+ data: Buffer.from(delegationEventToBinaryData(event)).toString("hex"),
15
+ stream_id: event.stream_id,
16
+ version: event.version,
17
+ timestamp: event.timestamp,
18
+ });
19
+ }
20
+ export function decodeOutboundDelegationEvent(encodedEvent) {
21
+ return DelegationEvent.parse(JSON.parse(encodedEvent));
22
+ }
23
+ export const DelegationEvent = VersionedEvent.transform((obj, ctx) => {
24
+ const res = match(obj)
25
+ .with({ event_version: 1 }, () => {
26
+ throw new Error("Unsupported event version");
27
+ })
28
+ .with({ event_version: 2 }, () => DelegationEventV2.safeParse(obj))
29
+ .exhaustive();
30
+ if (!res.success) {
31
+ res.error.issues.forEach(ctx.addIssue);
32
+ return z.NEVER;
33
+ }
34
+ return res.data;
35
+ });
36
+ export { DelegationEventV2 };
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { DraftEServiceUpdatedV2, EServiceAddedV2, EServiceClonedV2, EServiceDeletedV2, EServiceDescriptorActivatedV2, EServiceDescriptorAddedV2, EServiceDescriptorArchivedV2, EServiceDescriptorDocumentAddedV2, EServiceDescriptorDocumentDeletedV2, EServiceDescriptorDocumentUpdatedV2, EServiceDescriptorInterfaceAddedV2, EServiceDescriptorInterfaceDeletedV2, EServiceDescriptorInterfaceUpdatedV2, EServiceDescriptorPublishedV2, EServiceDescriptorSuspendedV2, EServiceDraftDescriptorDeletedV2, EServiceDraftDescriptorUpdatedV2, EServiceDescriptorQuotasUpdatedV2, EServiceDescriptionUpdatedV2, EServiceDescriptorDelegateSubmittedV2, EServiceDescriptorDelegatorApprovedV2, EServiceDescriptorDelegatorRejectedV2 } from "../gen/v2/eservice/events.js";
2
+ import { DraftEServiceUpdatedV2, EServiceAddedV2, EServiceClonedV2, EServiceDeletedV2, EServiceDescriptorActivatedV2, EServiceDescriptorAddedV2, EServiceDescriptorArchivedV2, EServiceDescriptorDocumentAddedV2, EServiceDescriptorDocumentDeletedV2, EServiceDescriptorDocumentUpdatedV2, EServiceDescriptorInterfaceAddedV2, EServiceDescriptorInterfaceDeletedV2, EServiceDescriptorInterfaceUpdatedV2, EServiceDescriptorPublishedV2, EServiceDescriptorSuspendedV2, EServiceDraftDescriptorDeletedV2, EServiceDraftDescriptorUpdatedV2, EServiceDescriptorQuotasUpdatedV2, EServiceDescriptionUpdatedV2, EServiceDescriptorSubmittedByDelegateV2, EServiceDescriptorApprovedByDelegatorV2, EServiceDescriptorRejectedByDelegatorV2, EServiceDescriptorAttributesUpdatedV2 } from "../gen/v2/eservice/events.js";
3
3
  export declare function eServiceEventToBinaryDataV2(event: EServiceEventV2): Uint8Array;
4
4
  export declare const EServiceEventV2: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
5
5
  event_version: z.ZodLiteral<2>;
@@ -402,63 +402,84 @@ export declare const EServiceEventV2: z.ZodDiscriminatedUnion<"type", [z.ZodObje
402
402
  data?: any;
403
403
  }>, z.ZodObject<{
404
404
  event_version: z.ZodLiteral<2>;
405
- type: z.ZodLiteral<"EServiceDescriptorDelegateSubmitted">;
406
- data: z.ZodEffects<z.ZodAny, EServiceDescriptorDelegateSubmittedV2, any>;
405
+ type: z.ZodLiteral<"EServiceDescriptorSubmittedByDelegate">;
406
+ data: z.ZodEffects<z.ZodAny, EServiceDescriptorSubmittedByDelegateV2, any>;
407
407
  stream_id: z.ZodString;
408
408
  version: z.ZodNumber;
409
409
  timestamp: z.ZodDate;
410
410
  }, "strip", z.ZodTypeAny, {
411
411
  event_version: 2;
412
- type: "EServiceDescriptorDelegateSubmitted";
412
+ type: "EServiceDescriptorSubmittedByDelegate";
413
413
  version: number;
414
- data: EServiceDescriptorDelegateSubmittedV2;
414
+ data: EServiceDescriptorSubmittedByDelegateV2;
415
415
  stream_id: string;
416
416
  timestamp: Date;
417
417
  }, {
418
418
  event_version: 2;
419
- type: "EServiceDescriptorDelegateSubmitted";
419
+ type: "EServiceDescriptorSubmittedByDelegate";
420
420
  version: number;
421
421
  stream_id: string;
422
422
  timestamp: Date;
423
423
  data?: any;
424
424
  }>, z.ZodObject<{
425
425
  event_version: z.ZodLiteral<2>;
426
- type: z.ZodLiteral<"EServiceDescriptorDelegatorApproved">;
427
- data: z.ZodEffects<z.ZodAny, EServiceDescriptorDelegatorApprovedV2, any>;
426
+ type: z.ZodLiteral<"EServiceDescriptorApprovedByDelegator">;
427
+ data: z.ZodEffects<z.ZodAny, EServiceDescriptorApprovedByDelegatorV2, any>;
428
428
  stream_id: z.ZodString;
429
429
  version: z.ZodNumber;
430
430
  timestamp: z.ZodDate;
431
431
  }, "strip", z.ZodTypeAny, {
432
432
  event_version: 2;
433
- type: "EServiceDescriptorDelegatorApproved";
433
+ type: "EServiceDescriptorApprovedByDelegator";
434
434
  version: number;
435
- data: EServiceDescriptorDelegatorApprovedV2;
435
+ data: EServiceDescriptorApprovedByDelegatorV2;
436
436
  stream_id: string;
437
437
  timestamp: Date;
438
438
  }, {
439
439
  event_version: 2;
440
- type: "EServiceDescriptorDelegatorApproved";
440
+ type: "EServiceDescriptorApprovedByDelegator";
441
441
  version: number;
442
442
  stream_id: string;
443
443
  timestamp: Date;
444
444
  data?: any;
445
445
  }>, z.ZodObject<{
446
446
  event_version: z.ZodLiteral<2>;
447
- type: z.ZodLiteral<"EServiceDescriptorDelegatorRejected">;
448
- data: z.ZodEffects<z.ZodAny, EServiceDescriptorDelegatorRejectedV2, any>;
447
+ type: z.ZodLiteral<"EServiceDescriptorRejectedByDelegator">;
448
+ data: z.ZodEffects<z.ZodAny, EServiceDescriptorRejectedByDelegatorV2, any>;
449
449
  stream_id: z.ZodString;
450
450
  version: z.ZodNumber;
451
451
  timestamp: z.ZodDate;
452
452
  }, "strip", z.ZodTypeAny, {
453
453
  event_version: 2;
454
- type: "EServiceDescriptorDelegatorRejected";
454
+ type: "EServiceDescriptorRejectedByDelegator";
455
455
  version: number;
456
- data: EServiceDescriptorDelegatorRejectedV2;
456
+ data: EServiceDescriptorRejectedByDelegatorV2;
457
457
  stream_id: string;
458
458
  timestamp: Date;
459
459
  }, {
460
460
  event_version: 2;
461
- type: "EServiceDescriptorDelegatorRejected";
461
+ type: "EServiceDescriptorRejectedByDelegator";
462
+ version: number;
463
+ stream_id: string;
464
+ timestamp: Date;
465
+ data?: any;
466
+ }>, z.ZodObject<{
467
+ event_version: z.ZodLiteral<2>;
468
+ type: z.ZodLiteral<"EServiceDescriptorAttributesUpdated">;
469
+ data: z.ZodEffects<z.ZodAny, EServiceDescriptorAttributesUpdatedV2, any>;
470
+ stream_id: z.ZodString;
471
+ version: z.ZodNumber;
472
+ timestamp: z.ZodDate;
473
+ }, "strip", z.ZodTypeAny, {
474
+ event_version: 2;
475
+ type: "EServiceDescriptorAttributesUpdated";
476
+ version: number;
477
+ data: EServiceDescriptorAttributesUpdatedV2;
478
+ stream_id: string;
479
+ timestamp: Date;
480
+ }, {
481
+ event_version: 2;
482
+ type: "EServiceDescriptorAttributesUpdated";
462
483
  version: number;
463
484
  stream_id: string;
464
485
  timestamp: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"eventsV2.d.ts","sourceRoot":"","sources":["../../src/eservice/eventsV2.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,6BAA6B,EAC7B,yBAAyB,EACzB,4BAA4B,EAC5B,iCAAiC,EACjC,mCAAmC,EACnC,mCAAmC,EACnC,kCAAkC,EAClC,oCAAoC,EACpC,oCAAoC,EACpC,6BAA6B,EAC7B,6BAA6B,EAC7B,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,4BAA4B,EAC5B,qCAAqC,EACrC,qCAAqC,EACrC,qCAAqC,EACtC,MAAM,8BAA8B,CAAC;AAEtC,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,eAAe,GACrB,UAAU,CAqEZ;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiL1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"eventsV2.d.ts","sourceRoot":"","sources":["../../src/eservice/eventsV2.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,6BAA6B,EAC7B,yBAAyB,EACzB,4BAA4B,EAC5B,iCAAiC,EACjC,mCAAmC,EACnC,mCAAmC,EACnC,kCAAkC,EAClC,oCAAoC,EACpC,oCAAoC,EACpC,6BAA6B,EAC7B,6BAA6B,EAC7B,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,EACjC,4BAA4B,EAC5B,uCAAuC,EACvC,uCAAuC,EACvC,uCAAuC,EACvC,qCAAqC,EACtC,MAAM,8BAA8B,CAAC;AAEtC,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,eAAe,GACrB,UAAU,CAwEZ;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyL1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { match } from "ts-pattern";
2
2
  import { z } from "zod";
3
3
  import { protobufDecoder } from "../utils.js";
4
- import { DraftEServiceUpdatedV2, EServiceAddedV2, EServiceClonedV2, EServiceDeletedV2, EServiceDescriptorActivatedV2, EServiceDescriptorAddedV2, EServiceDescriptorArchivedV2, EServiceDescriptorDocumentAddedV2, EServiceDescriptorDocumentDeletedV2, EServiceDescriptorDocumentUpdatedV2, EServiceDescriptorInterfaceAddedV2, EServiceDescriptorInterfaceDeletedV2, EServiceDescriptorInterfaceUpdatedV2, EServiceDescriptorPublishedV2, EServiceDescriptorSuspendedV2, EServiceDraftDescriptorDeletedV2, EServiceDraftDescriptorUpdatedV2, EServiceDescriptorQuotasUpdatedV2, EServiceDescriptionUpdatedV2, EServiceDescriptorDelegateSubmittedV2, EServiceDescriptorDelegatorApprovedV2, EServiceDescriptorDelegatorRejectedV2, } from "../gen/v2/eservice/events.js";
4
+ import { DraftEServiceUpdatedV2, EServiceAddedV2, EServiceClonedV2, EServiceDeletedV2, EServiceDescriptorActivatedV2, EServiceDescriptorAddedV2, EServiceDescriptorArchivedV2, EServiceDescriptorDocumentAddedV2, EServiceDescriptorDocumentDeletedV2, EServiceDescriptorDocumentUpdatedV2, EServiceDescriptorInterfaceAddedV2, EServiceDescriptorInterfaceDeletedV2, EServiceDescriptorInterfaceUpdatedV2, EServiceDescriptorPublishedV2, EServiceDescriptorSuspendedV2, EServiceDraftDescriptorDeletedV2, EServiceDraftDescriptorUpdatedV2, EServiceDescriptorQuotasUpdatedV2, EServiceDescriptionUpdatedV2, EServiceDescriptorSubmittedByDelegateV2, EServiceDescriptorApprovedByDelegatorV2, EServiceDescriptorRejectedByDelegatorV2, EServiceDescriptorAttributesUpdatedV2, } from "../gen/v2/eservice/events.js";
5
5
  export function eServiceEventToBinaryDataV2(event) {
6
6
  return match(event)
7
7
  .with({ type: "EServiceAdded" }, ({ data }) => EServiceAddedV2.toBinary(data))
@@ -23,9 +23,10 @@ export function eServiceEventToBinaryDataV2(event) {
23
23
  .with({ type: "EServiceDescriptorInterfaceDeleted" }, ({ data }) => EServiceDescriptorInterfaceDeletedV2.toBinary(data))
24
24
  .with({ type: "EServiceDescriptorDocumentDeleted" }, ({ data }) => EServiceDescriptorDocumentDeletedV2.toBinary(data))
25
25
  .with({ type: "EServiceDescriptionUpdated" }, ({ data }) => EServiceDescriptionUpdatedV2.toBinary(data))
26
- .with({ type: "EServiceDescriptorDelegateSubmitted" }, ({ data }) => EServiceDescriptorDelegateSubmittedV2.toBinary(data))
27
- .with({ type: "EServiceDescriptorDelegatorApproved" }, ({ data }) => EServiceDescriptorDelegatorApprovedV2.toBinary(data))
28
- .with({ type: "EServiceDescriptorDelegatorRejected" }, ({ data }) => EServiceDescriptorDelegatorRejectedV2.toBinary(data))
26
+ .with({ type: "EServiceDescriptorSubmittedByDelegate" }, ({ data }) => EServiceDescriptorSubmittedByDelegateV2.toBinary(data))
27
+ .with({ type: "EServiceDescriptorApprovedByDelegator" }, ({ data }) => EServiceDescriptorApprovedByDelegatorV2.toBinary(data))
28
+ .with({ type: "EServiceDescriptorRejectedByDelegator" }, ({ data }) => EServiceDescriptorRejectedByDelegatorV2.toBinary(data))
29
+ .with({ type: "EServiceDescriptorAttributesUpdated" }, ({ data }) => EServiceDescriptorAttributesUpdatedV2.toBinary(data))
29
30
  .exhaustive();
30
31
  }
31
32
  export const EServiceEventV2 = z.discriminatedUnion("type", [
@@ -183,24 +184,32 @@ export const EServiceEventV2 = z.discriminatedUnion("type", [
183
184
  }),
184
185
  z.object({
185
186
  event_version: z.literal(2),
186
- type: z.literal("EServiceDescriptorDelegateSubmitted"),
187
- data: protobufDecoder(EServiceDescriptorDelegateSubmittedV2),
187
+ type: z.literal("EServiceDescriptorSubmittedByDelegate"),
188
+ data: protobufDecoder(EServiceDescriptorSubmittedByDelegateV2),
188
189
  stream_id: z.string(),
189
190
  version: z.number(),
190
191
  timestamp: z.coerce.date(),
191
192
  }),
192
193
  z.object({
193
194
  event_version: z.literal(2),
194
- type: z.literal("EServiceDescriptorDelegatorApproved"),
195
- data: protobufDecoder(EServiceDescriptorDelegatorApprovedV2),
195
+ type: z.literal("EServiceDescriptorApprovedByDelegator"),
196
+ data: protobufDecoder(EServiceDescriptorApprovedByDelegatorV2),
196
197
  stream_id: z.string(),
197
198
  version: z.number(),
198
199
  timestamp: z.coerce.date(),
199
200
  }),
200
201
  z.object({
201
202
  event_version: z.literal(2),
202
- type: z.literal("EServiceDescriptorDelegatorRejected"),
203
- data: protobufDecoder(EServiceDescriptorDelegatorRejectedV2),
203
+ type: z.literal("EServiceDescriptorRejectedByDelegator"),
204
+ data: protobufDecoder(EServiceDescriptorRejectedByDelegatorV2),
205
+ stream_id: z.string(),
206
+ version: z.number(),
207
+ timestamp: z.coerce.date(),
208
+ }),
209
+ z.object({
210
+ event_version: z.literal(2),
211
+ type: z.literal("EServiceDescriptorAttributesUpdated"),
212
+ data: protobufDecoder(EServiceDescriptorAttributesUpdatedV2),
204
213
  stream_id: z.string(),
205
214
  version: z.number(),
206
215
  timestamp: z.coerce.date(),
@@ -227,23 +227,30 @@ export declare const EServiceEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"event_
227
227
  timestamp: Date;
228
228
  } | {
229
229
  event_version: 2;
230
- type: "EServiceDescriptorDelegateSubmitted";
230
+ type: "EServiceDescriptorSubmittedByDelegate";
231
231
  version: number;
232
- data: import("../index.js").EServiceDescriptorDelegateSubmittedV2;
232
+ data: import("../index.js").EServiceDescriptorSubmittedByDelegateV2;
233
233
  stream_id: string;
234
234
  timestamp: Date;
235
235
  } | {
236
236
  event_version: 2;
237
- type: "EServiceDescriptorDelegatorApproved";
237
+ type: "EServiceDescriptorApprovedByDelegator";
238
238
  version: number;
239
- data: import("../index.js").EServiceDescriptorDelegatorApprovedV2;
239
+ data: import("../index.js").EServiceDescriptorApprovedByDelegatorV2;
240
240
  stream_id: string;
241
241
  timestamp: Date;
242
242
  } | {
243
243
  event_version: 2;
244
- type: "EServiceDescriptorDelegatorRejected";
244
+ type: "EServiceDescriptorRejectedByDelegator";
245
245
  version: number;
246
- data: import("../index.js").EServiceDescriptorDelegatorRejectedV2;
246
+ data: import("../index.js").EServiceDescriptorRejectedByDelegatorV2;
247
+ stream_id: string;
248
+ timestamp: Date;
249
+ } | {
250
+ event_version: 2;
251
+ type: "EServiceDescriptorAttributesUpdated";
252
+ version: number;
253
+ data: import("../index.js").EServiceDescriptorAttributesUpdatedV2;
247
254
  stream_id: string;
248
255
  timestamp: Date;
249
256
  }, z.objectInputType<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eservice/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAA+B,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,eAAe,EAA+B,MAAM,eAAe,CAAC;AAS7E,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CASxE;AAED,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,GACnB,aAAa,CAEf;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAWxB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AACtD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eservice/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAA+B,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,eAAe,EAA+B,MAAM,eAAe,CAAC;AAS7E,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CASxE;AAED,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,GACnB,aAAa,CAEf;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAWxB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AACtD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC"}