@imolko/ultra-ddd 2.0.1 → 2.0.3-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 -1
- package/dist-browser/event/cloud-event-ddd/index.d.ts.map +1 -1
- package/dist-browser/event/cloud-event-ddd/json-schema-for-cloud-event.type.d.ts +23 -2
- package/dist-browser/event/cloud-event-ddd/json-schema-for-cloud-event.type.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 +6 -13
- package/dist-browser/scripts/get-event/templates/track.template.js.map +1 -1
- package/dist-node/event/cloud-event-ddd/index.d.ts +1 -1
- package/dist-node/event/cloud-event-ddd/index.d.ts.map +1 -1
- package/dist-node/event/cloud-event-ddd/json-schema-for-cloud-event.type.d.ts +23 -2
- package/dist-node/event/cloud-event-ddd/json-schema-for-cloud-event.type.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 +6 -13
- package/dist-node/scripts/get-event/templates/track.template.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,5 +3,5 @@ export { Errors as CloudEventDddErrors } from './errors';
|
|
|
3
3
|
export { Payload as CloudEventDddPayload } from './payload';
|
|
4
4
|
export { Primitive as CloudEventDddPrimitive } from './primitive';
|
|
5
5
|
export { PrimitiveSigned as CloudEventDddPrimitiveSigned } from './primitive';
|
|
6
|
-
export { JsonSchemaForCloudEvent, JsonSchemaProperties } from './json-schema-for-cloud-event.type';
|
|
6
|
+
export { JsonSchemaForCloudEvent, JsonSchemaProperties, EventsJsonSchema, JsonSchemaMap } from './json-schema-for-cloud-event.type';
|
|
7
7
|
//# 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,oBAAoB,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,oBAAoB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from '@imolko/ultra-v8n';
|
|
2
|
-
|
|
3
|
-
export type JsonSchemaProperties = Record<string, z.core.JSONSchema.JSONSchema> & {
|
|
2
|
+
type SpecialType = {
|
|
4
3
|
type: {
|
|
5
4
|
type: "string" | "number" | "integer" | "boolean";
|
|
6
5
|
const: string | number | boolean;
|
|
@@ -8,4 +7,26 @@ export type JsonSchemaProperties = Record<string, z.core.JSONSchema.JSONSchema>
|
|
|
8
7
|
type: "object" | "array";
|
|
9
8
|
};
|
|
10
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Esquema Json para CloudEvent
|
|
12
|
+
*/
|
|
13
|
+
export type JsonSchemaForCloudEvent = z.core.JSONSchema.JSONSchema;
|
|
14
|
+
/**
|
|
15
|
+
* Propiedades del Esquema Json
|
|
16
|
+
*/
|
|
17
|
+
export type JsonSchemaProperties = Record<string, z.core.JSONSchema.JSONSchema> & SpecialType;
|
|
18
|
+
/**
|
|
19
|
+
* Mapa con la versión y Esquema Json para CloudEvent
|
|
20
|
+
*/
|
|
21
|
+
export interface JsonSchemaMap {
|
|
22
|
+
version: string;
|
|
23
|
+
schema: JsonSchemaForCloudEvent;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Esquema Json de los eventos
|
|
27
|
+
*/
|
|
28
|
+
export interface EventsJsonSchema {
|
|
29
|
+
[key: string]: JsonSchemaMap[];
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
11
32
|
//# sourceMappingURL=json-schema-for-cloud-event.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-for-cloud-event.type.d.ts","sourceRoot":"","sources":["../../../src/event/cloud-event-ddd/json-schema-for-cloud-event.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,
|
|
1
|
+
{"version":3,"file":"json-schema-for-cloud-event.type.d.ts","sourceRoot":"","sources":["../../../src/event/cloud-event-ddd/json-schema-for-cloud-event.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;QAClD,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;KAClC,GAAG;QACF,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;KAC1B,CAAA;CACF,CAAA;AACD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAA;AAClE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,WAAW,CAAA;AAC7F;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAC;CAClD;AACD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,EAAE,CAAA;CAC/B"}
|
|
@@ -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,MAuEpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const trackTemplate = `
|
|
2
|
-
import { DomainDirectory, EventPublicApi,
|
|
2
|
+
import { DomainDirectory, EventPublicApi, EventsJsonSchema, JsonSchemaMap, JsonSchemaProperties } from "@imolko/ultra-ddd";
|
|
3
3
|
import * as fs from 'fs';
|
|
4
4
|
import * as path from 'path';
|
|
5
5
|
|
|
@@ -7,13 +7,6 @@ const eventPaths: { [key: string]: string } = {
|
|
|
7
7
|
// event-path-flag
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
interface SchemifyModel {
|
|
11
|
-
version: string; schema: JsonSchemaForCloudEvent;
|
|
12
|
-
}
|
|
13
|
-
interface SchemifyGroup {
|
|
14
|
-
[key: string]: SchemifyModel[]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
10
|
export function main() {
|
|
18
11
|
// flag
|
|
19
12
|
|
|
@@ -23,23 +16,23 @@ export function main() {
|
|
|
23
16
|
console.log('\\\\nEVENTS', events); // Escapar la barra invertida
|
|
24
17
|
|
|
25
18
|
// Esquematizar eventos
|
|
26
|
-
const groupByType = (list:
|
|
27
|
-
const groupedMap:
|
|
19
|
+
const groupByType = (list: JsonSchemaMap[]): EventsJsonSchema => {
|
|
20
|
+
const groupedMap: EventsJsonSchema = {};
|
|
28
21
|
for (const item of list) {
|
|
29
22
|
const properties = item.schema.properties as JsonSchemaProperties;
|
|
30
23
|
const propertyType = properties.type;
|
|
31
24
|
if (propertyType && propertyType.type !== 'string') {
|
|
32
25
|
return groupedMap;
|
|
33
26
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
27
|
+
if ("const" in propertyType && typeof propertyType.const === 'string') {
|
|
28
|
+
const typeConst = propertyType.const;
|
|
36
29
|
groupedMap[typeConst] = groupedMap[typeConst] ? [...groupedMap[typeConst], item] : [item];
|
|
37
30
|
}
|
|
38
31
|
}
|
|
39
32
|
return groupedMap;
|
|
40
33
|
}
|
|
41
34
|
const getGroups = () => {
|
|
42
|
-
let schemify:
|
|
35
|
+
let schemify: EventsJsonSchema = {};
|
|
43
36
|
for (const event of events) {
|
|
44
37
|
const schemaExe = event.getJsonSchemasForEvolution();
|
|
45
38
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuE7B,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -3,5 +3,5 @@ export { Errors as CloudEventDddErrors } from './errors';
|
|
|
3
3
|
export { Payload as CloudEventDddPayload } from './payload';
|
|
4
4
|
export { Primitive as CloudEventDddPrimitive } from './primitive';
|
|
5
5
|
export { PrimitiveSigned as CloudEventDddPrimitiveSigned } from './primitive';
|
|
6
|
-
export { JsonSchemaForCloudEvent, JsonSchemaProperties } from './json-schema-for-cloud-event.type';
|
|
6
|
+
export { JsonSchemaForCloudEvent, JsonSchemaProperties, EventsJsonSchema, JsonSchemaMap } from './json-schema-for-cloud-event.type';
|
|
7
7
|
//# 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,oBAAoB,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,oBAAoB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from '@imolko/ultra-v8n';
|
|
2
|
-
|
|
3
|
-
export type JsonSchemaProperties = Record<string, z.core.JSONSchema.JSONSchema> & {
|
|
2
|
+
type SpecialType = {
|
|
4
3
|
type: {
|
|
5
4
|
type: "string" | "number" | "integer" | "boolean";
|
|
6
5
|
const: string | number | boolean;
|
|
@@ -8,4 +7,26 @@ export type JsonSchemaProperties = Record<string, z.core.JSONSchema.JSONSchema>
|
|
|
8
7
|
type: "object" | "array";
|
|
9
8
|
};
|
|
10
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Esquema Json para CloudEvent
|
|
12
|
+
*/
|
|
13
|
+
export type JsonSchemaForCloudEvent = z.core.JSONSchema.JSONSchema;
|
|
14
|
+
/**
|
|
15
|
+
* Propiedades del Esquema Json
|
|
16
|
+
*/
|
|
17
|
+
export type JsonSchemaProperties = Record<string, z.core.JSONSchema.JSONSchema> & SpecialType;
|
|
18
|
+
/**
|
|
19
|
+
* Mapa con la versión y Esquema Json para CloudEvent
|
|
20
|
+
*/
|
|
21
|
+
export interface JsonSchemaMap {
|
|
22
|
+
version: string;
|
|
23
|
+
schema: JsonSchemaForCloudEvent;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Esquema Json de los eventos
|
|
27
|
+
*/
|
|
28
|
+
export interface EventsJsonSchema {
|
|
29
|
+
[key: string]: JsonSchemaMap[];
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
11
32
|
//# sourceMappingURL=json-schema-for-cloud-event.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-for-cloud-event.type.d.ts","sourceRoot":"","sources":["../../../src/event/cloud-event-ddd/json-schema-for-cloud-event.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,
|
|
1
|
+
{"version":3,"file":"json-schema-for-cloud-event.type.d.ts","sourceRoot":"","sources":["../../../src/event/cloud-event-ddd/json-schema-for-cloud-event.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;QAClD,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;KAClC,GAAG;QACF,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;KAC1B,CAAA;CACF,CAAA;AACD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAA;AAClE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,WAAW,CAAA;AAC7F;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAC;CAClD;AACD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,EAAE,CAAA;CAC/B"}
|
|
@@ -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,MAuEpB,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,
|
|
4
|
+
import { DomainDirectory, EventPublicApi, EventsJsonSchema, JsonSchemaMap, JsonSchemaProperties } from "@imolko/ultra-ddd";
|
|
5
5
|
import * as fs from 'fs';
|
|
6
6
|
import * as path from 'path';
|
|
7
7
|
|
|
@@ -9,13 +9,6 @@ const eventPaths: { [key: string]: string } = {
|
|
|
9
9
|
// event-path-flag
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
interface SchemifyModel {
|
|
13
|
-
version: string; schema: JsonSchemaForCloudEvent;
|
|
14
|
-
}
|
|
15
|
-
interface SchemifyGroup {
|
|
16
|
-
[key: string]: SchemifyModel[]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
12
|
export function main() {
|
|
20
13
|
// flag
|
|
21
14
|
|
|
@@ -25,23 +18,23 @@ export function main() {
|
|
|
25
18
|
console.log('\\\\nEVENTS', events); // Escapar la barra invertida
|
|
26
19
|
|
|
27
20
|
// Esquematizar eventos
|
|
28
|
-
const groupByType = (list:
|
|
29
|
-
const groupedMap:
|
|
21
|
+
const groupByType = (list: JsonSchemaMap[]): EventsJsonSchema => {
|
|
22
|
+
const groupedMap: EventsJsonSchema = {};
|
|
30
23
|
for (const item of list) {
|
|
31
24
|
const properties = item.schema.properties as JsonSchemaProperties;
|
|
32
25
|
const propertyType = properties.type;
|
|
33
26
|
if (propertyType && propertyType.type !== 'string') {
|
|
34
27
|
return groupedMap;
|
|
35
28
|
}
|
|
36
|
-
const
|
|
37
|
-
|
|
29
|
+
if ("const" in propertyType && typeof propertyType.const === 'string') {
|
|
30
|
+
const typeConst = propertyType.const;
|
|
38
31
|
groupedMap[typeConst] = groupedMap[typeConst] ? [...groupedMap[typeConst], item] : [item];
|
|
39
32
|
}
|
|
40
33
|
}
|
|
41
34
|
return groupedMap;
|
|
42
35
|
}
|
|
43
36
|
const getGroups = () => {
|
|
44
|
-
let schemify:
|
|
37
|
+
let schemify: EventsJsonSchema = {};
|
|
45
38
|
for (const event of events) {
|
|
46
39
|
const schemaExe = event.getJsonSchemasForEvolution();
|
|
47
40
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuE7B,CAAC;AAEF,kBAAe,aAAa,CAAC"}
|