@imolko/ultra-ddd 2.0.1 → 2.0.2-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.
@@ -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
- export type JsonSchemaForCloudEvent = z.core.ZodStandardJSONSchemaPayload<z.ZodObject>;
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,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AAEtF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG;IAChF,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"}
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,MA8EpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
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, JsonSchemaForCloudEvent, JsonSchemaProperties } from "@imolko/ultra-ddd";
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,8 +16,8 @@ export function main() {
23
16
  console.log('\\\\nEVENTS', events); // Escapar la barra invertida
24
17
 
25
18
  // Esquematizar eventos
26
- const groupByType = (list: SchemifyModel[]): SchemifyGroup => {
27
- const groupedMap: SchemifyGroup = {};
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;
@@ -39,7 +32,7 @@ export function main() {
39
32
  return groupedMap;
40
33
  }
41
34
  const getGroups = () => {
42
- let schemify: SchemifyGroup = {};
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8E7B,CAAC;AAEF,eAAe,aAAa,CAAC"}
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
- export type JsonSchemaForCloudEvent = z.core.ZodStandardJSONSchemaPayload<z.ZodObject>;
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,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AAEtF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG;IAChF,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"}
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,MA8EpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
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, JsonSchemaForCloudEvent, JsonSchemaProperties } from "@imolko/ultra-ddd";
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,8 +18,8 @@ export function main() {
25
18
  console.log('\\\\nEVENTS', events); // Escapar la barra invertida
26
19
 
27
20
  // Esquematizar eventos
28
- const groupByType = (list: SchemifyModel[]): SchemifyGroup => {
29
- const groupedMap: SchemifyGroup = {};
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;
@@ -41,7 +34,7 @@ export function main() {
41
34
  return groupedMap;
42
35
  }
43
36
  const getGroups = () => {
44
- let schemify: SchemifyGroup = {};
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8E7B,CAAC;AAEF,kBAAe,aAAa,CAAC"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imolko/ultra-ddd",
3
- "version": "2.0.1",
3
+ "version": "2.0.2-beta",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "results",