@pagopa/interop-outbound-models 1.0.13 → 1.2.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/CHANGELOG.md +12 -2
- package/dist/delegation/eventsV2.d.ts +90 -0
- package/dist/delegation/eventsV2.d.ts.map +1 -0
- package/dist/delegation/eventsV2.js +46 -0
- package/dist/delegation/index.d.ts +53 -0
- package/dist/delegation/index.d.ts.map +1 -0
- package/dist/delegation/index.js +36 -0
- package/dist/eservice/eventsV2.d.ts +85 -1
- package/dist/eservice/eventsV2.d.ts.map +1 -1
- package/dist/eservice/eventsV2.js +37 -1
- package/dist/eservice/index.d.ts +28 -0
- package/dist/eservice/index.d.ts.map +1 -1
- package/dist/gen/v2/delegation/delegation.d.ts +202 -0
- package/dist/gen/v2/delegation/delegation.d.ts.map +1 -0
- package/dist/gen/v2/delegation/delegation.js +385 -0
- package/dist/gen/v2/delegation/events.d.ts +85 -0
- package/dist/gen/v2/delegation/events.d.ts.map +1 -0
- package/dist/gen/v2/delegation/events.js +189 -0
- package/dist/gen/v2/eservice/eservice.d.ts +4 -0
- package/dist/gen/v2/eservice/eservice.d.ts.map +1 -1
- package/dist/gen/v2/eservice/eservice.js +9 -1
- package/dist/gen/v2/eservice/events.d.ts +88 -0
- package/dist/gen/v2/eservice/events.d.ts.map +1 -1
- package/dist/gen/v2/eservice/events.js +208 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/package.json +1 -1
- package/proto/v2/delegation/delegation.proto +52 -0
- package/proto/v2/delegation/events.proto +21 -0
- package/proto/v2/eservice/eservice.proto +1 -0
- package/proto/v2/eservice/events.proto +19 -0
- package/src/delegation/eventsV2.ts +65 -0
- package/src/delegation/index.ts +49 -0
- package/src/eservice/eventsV2.ts +48 -0
- package/src/index.ts +3 -0
- package/tests/eservice.test.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## 1.0
|
|
5
|
+
## 1.2.0
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
- Added `Delegation` data models
|
|
10
|
+
- Added delegation events: `ProducerDelegationSubmittedV2`, `ProducerDelegationApprovedV2`, `ProducerDelegationRejectedV2` and `ProducerDelegationRevokedV2`
|
|
11
|
+
- Added eservice events: `EServiceDescriptorSubmittedByDelegateV2`, `EServiceDescriptorApprovedByDelegatorV2` and `EServiceDescriptorRejectedByDelegatorV2`
|
|
12
|
+
- Added `rejectionReasons` property in `EServiceDescriptorV2` data model
|
|
13
|
+
|
|
14
|
+
## 1.1.0
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Added eservice event `EServiceNameUpdated`
|
|
@@ -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("../index.js").ProducerDelegationSubmittedV2;
|
|
22
|
+
stream_id: string;
|
|
23
|
+
timestamp: Date;
|
|
24
|
+
} | {
|
|
25
|
+
event_version: 2;
|
|
26
|
+
type: "ProducerDelegationApproved";
|
|
27
|
+
version: number;
|
|
28
|
+
data: import("../index.js").ProducerDelegationApprovedV2;
|
|
29
|
+
stream_id: string;
|
|
30
|
+
timestamp: Date;
|
|
31
|
+
} | {
|
|
32
|
+
event_version: 2;
|
|
33
|
+
type: "ProducerDelegationRejected";
|
|
34
|
+
version: number;
|
|
35
|
+
data: import("../index.js").ProducerDelegationRejectedV2;
|
|
36
|
+
stream_id: string;
|
|
37
|
+
timestamp: Date;
|
|
38
|
+
} | {
|
|
39
|
+
event_version: 2;
|
|
40
|
+
type: "ProducerDelegationRevoked";
|
|
41
|
+
version: number;
|
|
42
|
+
data: import("../index.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, EServiceDescriptorAttributesUpdatedV2 } 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, EServiceNameUpdatedV2 } 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>;
|
|
@@ -400,6 +400,69 @@ export declare const EServiceEventV2: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
400
400
|
stream_id: string;
|
|
401
401
|
timestamp: Date;
|
|
402
402
|
data?: any;
|
|
403
|
+
}>, z.ZodObject<{
|
|
404
|
+
event_version: z.ZodLiteral<2>;
|
|
405
|
+
type: z.ZodLiteral<"EServiceDescriptorSubmittedByDelegate">;
|
|
406
|
+
data: z.ZodEffects<z.ZodAny, EServiceDescriptorSubmittedByDelegateV2, any>;
|
|
407
|
+
stream_id: z.ZodString;
|
|
408
|
+
version: z.ZodNumber;
|
|
409
|
+
timestamp: z.ZodDate;
|
|
410
|
+
}, "strip", z.ZodTypeAny, {
|
|
411
|
+
event_version: 2;
|
|
412
|
+
type: "EServiceDescriptorSubmittedByDelegate";
|
|
413
|
+
version: number;
|
|
414
|
+
data: EServiceDescriptorSubmittedByDelegateV2;
|
|
415
|
+
stream_id: string;
|
|
416
|
+
timestamp: Date;
|
|
417
|
+
}, {
|
|
418
|
+
event_version: 2;
|
|
419
|
+
type: "EServiceDescriptorSubmittedByDelegate";
|
|
420
|
+
version: number;
|
|
421
|
+
stream_id: string;
|
|
422
|
+
timestamp: Date;
|
|
423
|
+
data?: any;
|
|
424
|
+
}>, z.ZodObject<{
|
|
425
|
+
event_version: z.ZodLiteral<2>;
|
|
426
|
+
type: z.ZodLiteral<"EServiceDescriptorApprovedByDelegator">;
|
|
427
|
+
data: z.ZodEffects<z.ZodAny, EServiceDescriptorApprovedByDelegatorV2, any>;
|
|
428
|
+
stream_id: z.ZodString;
|
|
429
|
+
version: z.ZodNumber;
|
|
430
|
+
timestamp: z.ZodDate;
|
|
431
|
+
}, "strip", z.ZodTypeAny, {
|
|
432
|
+
event_version: 2;
|
|
433
|
+
type: "EServiceDescriptorApprovedByDelegator";
|
|
434
|
+
version: number;
|
|
435
|
+
data: EServiceDescriptorApprovedByDelegatorV2;
|
|
436
|
+
stream_id: string;
|
|
437
|
+
timestamp: Date;
|
|
438
|
+
}, {
|
|
439
|
+
event_version: 2;
|
|
440
|
+
type: "EServiceDescriptorApprovedByDelegator";
|
|
441
|
+
version: number;
|
|
442
|
+
stream_id: string;
|
|
443
|
+
timestamp: Date;
|
|
444
|
+
data?: any;
|
|
445
|
+
}>, z.ZodObject<{
|
|
446
|
+
event_version: z.ZodLiteral<2>;
|
|
447
|
+
type: z.ZodLiteral<"EServiceDescriptorRejectedByDelegator">;
|
|
448
|
+
data: z.ZodEffects<z.ZodAny, EServiceDescriptorRejectedByDelegatorV2, any>;
|
|
449
|
+
stream_id: z.ZodString;
|
|
450
|
+
version: z.ZodNumber;
|
|
451
|
+
timestamp: z.ZodDate;
|
|
452
|
+
}, "strip", z.ZodTypeAny, {
|
|
453
|
+
event_version: 2;
|
|
454
|
+
type: "EServiceDescriptorRejectedByDelegator";
|
|
455
|
+
version: number;
|
|
456
|
+
data: EServiceDescriptorRejectedByDelegatorV2;
|
|
457
|
+
stream_id: string;
|
|
458
|
+
timestamp: Date;
|
|
459
|
+
}, {
|
|
460
|
+
event_version: 2;
|
|
461
|
+
type: "EServiceDescriptorRejectedByDelegator";
|
|
462
|
+
version: number;
|
|
463
|
+
stream_id: string;
|
|
464
|
+
timestamp: Date;
|
|
465
|
+
data?: any;
|
|
403
466
|
}>, z.ZodObject<{
|
|
404
467
|
event_version: z.ZodLiteral<2>;
|
|
405
468
|
type: z.ZodLiteral<"EServiceDescriptorAttributesUpdated">;
|
|
@@ -421,6 +484,27 @@ export declare const EServiceEventV2: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
421
484
|
stream_id: string;
|
|
422
485
|
timestamp: Date;
|
|
423
486
|
data?: any;
|
|
487
|
+
}>, z.ZodObject<{
|
|
488
|
+
event_version: z.ZodLiteral<2>;
|
|
489
|
+
type: z.ZodLiteral<"EServiceNameUpdated">;
|
|
490
|
+
data: z.ZodEffects<z.ZodAny, EServiceNameUpdatedV2, any>;
|
|
491
|
+
stream_id: z.ZodString;
|
|
492
|
+
version: z.ZodNumber;
|
|
493
|
+
timestamp: z.ZodDate;
|
|
494
|
+
}, "strip", z.ZodTypeAny, {
|
|
495
|
+
event_version: 2;
|
|
496
|
+
type: "EServiceNameUpdated";
|
|
497
|
+
version: number;
|
|
498
|
+
data: EServiceNameUpdatedV2;
|
|
499
|
+
stream_id: string;
|
|
500
|
+
timestamp: Date;
|
|
501
|
+
}, {
|
|
502
|
+
event_version: 2;
|
|
503
|
+
type: "EServiceNameUpdated";
|
|
504
|
+
version: number;
|
|
505
|
+
stream_id: string;
|
|
506
|
+
timestamp: Date;
|
|
507
|
+
data?: any;
|
|
424
508
|
}>]>;
|
|
425
509
|
export type EServiceEventV2 = z.infer<typeof EServiceEventV2>;
|
|
426
510
|
//# sourceMappingURL=eventsV2.d.ts.map
|
|
@@ -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,
|
|
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,EACrC,qBAAqB,EACtB,MAAM,8BAA8B,CAAC;AAEtC,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,eAAe,GACrB,UAAU,CA2EZ;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiM1B,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, EServiceDescriptorAttributesUpdatedV2, } 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, EServiceNameUpdatedV2, } 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,7 +23,11 @@ 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: "EServiceDescriptorSubmittedByDelegate" }, ({ data }) => EServiceDescriptorSubmittedByDelegateV2.toBinary(data))
|
|
27
|
+
.with({ type: "EServiceDescriptorApprovedByDelegator" }, ({ data }) => EServiceDescriptorApprovedByDelegatorV2.toBinary(data))
|
|
28
|
+
.with({ type: "EServiceDescriptorRejectedByDelegator" }, ({ data }) => EServiceDescriptorRejectedByDelegatorV2.toBinary(data))
|
|
26
29
|
.with({ type: "EServiceDescriptorAttributesUpdated" }, ({ data }) => EServiceDescriptorAttributesUpdatedV2.toBinary(data))
|
|
30
|
+
.with({ type: "EServiceNameUpdated" }, ({ data }) => EServiceDescriptionUpdatedV2.toBinary(data))
|
|
27
31
|
.exhaustive();
|
|
28
32
|
}
|
|
29
33
|
export const EServiceEventV2 = z.discriminatedUnion("type", [
|
|
@@ -179,6 +183,30 @@ export const EServiceEventV2 = z.discriminatedUnion("type", [
|
|
|
179
183
|
version: z.number(),
|
|
180
184
|
timestamp: z.coerce.date(),
|
|
181
185
|
}),
|
|
186
|
+
z.object({
|
|
187
|
+
event_version: z.literal(2),
|
|
188
|
+
type: z.literal("EServiceDescriptorSubmittedByDelegate"),
|
|
189
|
+
data: protobufDecoder(EServiceDescriptorSubmittedByDelegateV2),
|
|
190
|
+
stream_id: z.string(),
|
|
191
|
+
version: z.number(),
|
|
192
|
+
timestamp: z.coerce.date(),
|
|
193
|
+
}),
|
|
194
|
+
z.object({
|
|
195
|
+
event_version: z.literal(2),
|
|
196
|
+
type: z.literal("EServiceDescriptorApprovedByDelegator"),
|
|
197
|
+
data: protobufDecoder(EServiceDescriptorApprovedByDelegatorV2),
|
|
198
|
+
stream_id: z.string(),
|
|
199
|
+
version: z.number(),
|
|
200
|
+
timestamp: z.coerce.date(),
|
|
201
|
+
}),
|
|
202
|
+
z.object({
|
|
203
|
+
event_version: z.literal(2),
|
|
204
|
+
type: z.literal("EServiceDescriptorRejectedByDelegator"),
|
|
205
|
+
data: protobufDecoder(EServiceDescriptorRejectedByDelegatorV2),
|
|
206
|
+
stream_id: z.string(),
|
|
207
|
+
version: z.number(),
|
|
208
|
+
timestamp: z.coerce.date(),
|
|
209
|
+
}),
|
|
182
210
|
z.object({
|
|
183
211
|
event_version: z.literal(2),
|
|
184
212
|
type: z.literal("EServiceDescriptorAttributesUpdated"),
|
|
@@ -187,4 +215,12 @@ export const EServiceEventV2 = z.discriminatedUnion("type", [
|
|
|
187
215
|
version: z.number(),
|
|
188
216
|
timestamp: z.coerce.date(),
|
|
189
217
|
}),
|
|
218
|
+
z.object({
|
|
219
|
+
event_version: z.literal(2),
|
|
220
|
+
type: z.literal("EServiceNameUpdated"),
|
|
221
|
+
data: protobufDecoder(EServiceNameUpdatedV2),
|
|
222
|
+
stream_id: z.string(),
|
|
223
|
+
version: z.number(),
|
|
224
|
+
timestamp: z.coerce.date(),
|
|
225
|
+
}),
|
|
190
226
|
]);
|
package/dist/eservice/index.d.ts
CHANGED
|
@@ -225,6 +225,27 @@ export declare const EServiceEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"event_
|
|
|
225
225
|
data: import("../index.js").EServiceDescriptionUpdatedV2;
|
|
226
226
|
stream_id: string;
|
|
227
227
|
timestamp: Date;
|
|
228
|
+
} | {
|
|
229
|
+
event_version: 2;
|
|
230
|
+
type: "EServiceDescriptorSubmittedByDelegate";
|
|
231
|
+
version: number;
|
|
232
|
+
data: import("../index.js").EServiceDescriptorSubmittedByDelegateV2;
|
|
233
|
+
stream_id: string;
|
|
234
|
+
timestamp: Date;
|
|
235
|
+
} | {
|
|
236
|
+
event_version: 2;
|
|
237
|
+
type: "EServiceDescriptorApprovedByDelegator";
|
|
238
|
+
version: number;
|
|
239
|
+
data: import("../index.js").EServiceDescriptorApprovedByDelegatorV2;
|
|
240
|
+
stream_id: string;
|
|
241
|
+
timestamp: Date;
|
|
242
|
+
} | {
|
|
243
|
+
event_version: 2;
|
|
244
|
+
type: "EServiceDescriptorRejectedByDelegator";
|
|
245
|
+
version: number;
|
|
246
|
+
data: import("../index.js").EServiceDescriptorRejectedByDelegatorV2;
|
|
247
|
+
stream_id: string;
|
|
248
|
+
timestamp: Date;
|
|
228
249
|
} | {
|
|
229
250
|
event_version: 2;
|
|
230
251
|
type: "EServiceDescriptorAttributesUpdated";
|
|
@@ -232,6 +253,13 @@ export declare const EServiceEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"event_
|
|
|
232
253
|
data: import("../index.js").EServiceDescriptorAttributesUpdatedV2;
|
|
233
254
|
stream_id: string;
|
|
234
255
|
timestamp: Date;
|
|
256
|
+
} | {
|
|
257
|
+
event_version: 2;
|
|
258
|
+
type: "EServiceNameUpdated";
|
|
259
|
+
version: number;
|
|
260
|
+
data: import("../index.js").EServiceNameUpdatedV2;
|
|
261
|
+
stream_id: string;
|
|
262
|
+
timestamp: Date;
|
|
235
263
|
}, z.objectInputType<{
|
|
236
264
|
event_version: z.ZodLiteral<1>;
|
|
237
265
|
}, z.ZodTypeAny, "passthrough"> | 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
|
|
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"}
|