@imolko/ultra-ddd 1.0.23-beta → 1.0.24-beta
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/dist-browser/event/cloud-event-ddd/index.d.ts +1 -0
- package/dist-browser/event/cloud-event-ddd/index.d.ts.map +1 -1
- package/dist-browser/scripts/get-event/templates/track.template.d.ts.map +1 -1
- package/dist-browser/scripts/get-event/templates/track.template.js +11 -5
- package/dist-browser/scripts/get-event/templates/track.template.js.map +1 -1
- package/dist-node/event/cloud-event-ddd/index.d.ts +1 -0
- package/dist-node/event/cloud-event-ddd/index.d.ts.map +1 -1
- package/dist-node/scripts/get-event/templates/track.template.d.ts.map +1 -1
- package/dist-node/scripts/get-event/templates/track.template.js +11 -5
- package/dist-node/scripts/get-event/templates/track.template.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,4 +4,5 @@ export { Payload as CloudEventDddPayload } from './payload';
|
|
|
4
4
|
export { Primitive as CloudEventDddPrimitive } from './primitive';
|
|
5
5
|
export { PrimitiveSigned as CloudEventDddPrimitiveSigned } from './primitive';
|
|
6
6
|
export { JsonSchemaForCloudEvent } from './json-schema-for-cloud-event.type';
|
|
7
|
+
export { JsonSchema7LiteralType } from 'zod-to-json-schema';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/event/cloud-event-ddd/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,eAAe,IAAI,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/event/cloud-event-ddd/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,eAAe,IAAI,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.template.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"track.template.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,EAAE,MA8EpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const trackTemplate = `
|
|
2
|
-
import { DomainDirectory, EventPublicApi, JsonSchemaForCloudEvent } from "@imolko/ultra-ddd";
|
|
2
|
+
import { DomainDirectory, EventPublicApi, JsonSchemaForCloudEvent, JsonSchema7LiteralType } from "@imolko/ultra-ddd";
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import * as path from 'path';
|
|
5
5
|
|
|
@@ -10,6 +10,9 @@ const eventPaths: { [key: string]: string } = {
|
|
|
10
10
|
interface SchemifyModel {
|
|
11
11
|
version: string; schema: JsonSchemaForCloudEvent;
|
|
12
12
|
}
|
|
13
|
+
interface SchemifyGroup {
|
|
14
|
+
[key: string]: SchemifyModel[]
|
|
15
|
+
}
|
|
13
16
|
|
|
14
17
|
export function main() {
|
|
15
18
|
// flag
|
|
@@ -21,10 +24,13 @@ export function main() {
|
|
|
21
24
|
console.log('\\\\nEVENTS', events); // Escapar la barra invertida
|
|
22
25
|
|
|
23
26
|
// Esquematizar eventos
|
|
24
|
-
const groupByType = (list: SchemifyModel[]):
|
|
25
|
-
const groupedMap:
|
|
27
|
+
const groupByType = (list: SchemifyModel[]): SchemifyGroup => {
|
|
28
|
+
const groupedMap: SchemifyGroup = {};
|
|
26
29
|
for (const item of list) {
|
|
27
|
-
const typeObject = item.schema.properties.type as
|
|
30
|
+
const typeObject = item.schema.properties.type as JsonSchema7LiteralType;
|
|
31
|
+
if (typeObject.type !== 'string') {
|
|
32
|
+
return groupedMap;
|
|
33
|
+
}
|
|
28
34
|
const type = typeObject.const;
|
|
29
35
|
if (type && typeof type === 'string') {
|
|
30
36
|
groupedMap[type] = groupedMap[type] ? [...groupedMap[type], item] : [item];
|
|
@@ -33,7 +39,7 @@ export function main() {
|
|
|
33
39
|
return groupedMap;
|
|
34
40
|
}
|
|
35
41
|
const getGroups = () => {
|
|
36
|
-
let schemify:
|
|
42
|
+
let schemify: SchemifyGroup = {};
|
|
37
43
|
for (const event of events) {
|
|
38
44
|
const schemaExe = event.getJsonSchemasForEvolution();
|
|
39
45
|
if (schemaExe.isValid()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.template.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAW
|
|
1
|
+
{"version":3,"file":"track.template.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8E7B,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -4,4 +4,5 @@ export { Payload as CloudEventDddPayload } from './payload';
|
|
|
4
4
|
export { Primitive as CloudEventDddPrimitive } from './primitive';
|
|
5
5
|
export { PrimitiveSigned as CloudEventDddPrimitiveSigned } from './primitive';
|
|
6
6
|
export { JsonSchemaForCloudEvent } from './json-schema-for-cloud-event.type';
|
|
7
|
+
export { JsonSchema7LiteralType } from 'zod-to-json-schema';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/event/cloud-event-ddd/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,eAAe,IAAI,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/event/cloud-event-ddd/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,SAAS,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,eAAe,IAAI,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.template.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"track.template.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,EAAE,MA8EpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const trackTemplate = `
|
|
4
|
-
import { DomainDirectory, EventPublicApi, JsonSchemaForCloudEvent } from "@imolko/ultra-ddd";
|
|
4
|
+
import { DomainDirectory, EventPublicApi, JsonSchemaForCloudEvent, JsonSchema7LiteralType } from "@imolko/ultra-ddd";
|
|
5
5
|
import * as fs from 'fs';
|
|
6
6
|
import * as path from 'path';
|
|
7
7
|
|
|
@@ -12,6 +12,9 @@ const eventPaths: { [key: string]: string } = {
|
|
|
12
12
|
interface SchemifyModel {
|
|
13
13
|
version: string; schema: JsonSchemaForCloudEvent;
|
|
14
14
|
}
|
|
15
|
+
interface SchemifyGroup {
|
|
16
|
+
[key: string]: SchemifyModel[]
|
|
17
|
+
}
|
|
15
18
|
|
|
16
19
|
export function main() {
|
|
17
20
|
// flag
|
|
@@ -23,10 +26,13 @@ export function main() {
|
|
|
23
26
|
console.log('\\\\nEVENTS', events); // Escapar la barra invertida
|
|
24
27
|
|
|
25
28
|
// Esquematizar eventos
|
|
26
|
-
const groupByType = (list: SchemifyModel[]):
|
|
27
|
-
const groupedMap:
|
|
29
|
+
const groupByType = (list: SchemifyModel[]): SchemifyGroup => {
|
|
30
|
+
const groupedMap: SchemifyGroup = {};
|
|
28
31
|
for (const item of list) {
|
|
29
|
-
const typeObject = item.schema.properties.type as
|
|
32
|
+
const typeObject = item.schema.properties.type as JsonSchema7LiteralType;
|
|
33
|
+
if (typeObject.type !== 'string') {
|
|
34
|
+
return groupedMap;
|
|
35
|
+
}
|
|
30
36
|
const type = typeObject.const;
|
|
31
37
|
if (type && typeof type === 'string') {
|
|
32
38
|
groupedMap[type] = groupedMap[type] ? [...groupedMap[type], item] : [item];
|
|
@@ -35,7 +41,7 @@ export function main() {
|
|
|
35
41
|
return groupedMap;
|
|
36
42
|
}
|
|
37
43
|
const getGroups = () => {
|
|
38
|
-
let schemify:
|
|
44
|
+
let schemify: SchemifyGroup = {};
|
|
39
45
|
for (const event of events) {
|
|
40
46
|
const schemaExe = event.getJsonSchemasForEvolution();
|
|
41
47
|
if (schemaExe.isValid()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.template.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":";;AAAA,MAAM,aAAa,GAAW
|
|
1
|
+
{"version":3,"file":"track.template.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":";;AAAA,MAAM,aAAa,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8E7B,CAAC;AAEF,kBAAe,aAAa,CAAC"}
|