@imolko/ultra-ddd 1.0.15-beta → 1.0.16-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/scripts/get-event/constants.d.ts +1 -1
- package/dist-browser/scripts/get-event/constants.d.ts.map +1 -1
- package/dist-browser/scripts/get-event/constants.js +1 -1
- package/dist-browser/scripts/get-event/constants.js.map +1 -1
- package/dist-browser/scripts/get-event/copy-tsconfig.d.ts.map +1 -1
- package/dist-browser/scripts/get-event/copy-tsconfig.js +3 -4
- package/dist-browser/scripts/get-event/copy-tsconfig.js.map +1 -1
- package/dist-browser/scripts/get-event/generate-track-events.d.ts.map +1 -1
- package/dist-browser/scripts/get-event/generate-track-events.js +3 -4
- package/dist-browser/scripts/get-event/generate-track-events.js.map +1 -1
- package/dist-browser/scripts/get-event/templates/index.d.ts +3 -0
- package/dist-browser/scripts/get-event/templates/index.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/templates/index.js +3 -0
- package/dist-browser/scripts/get-event/templates/index.js.map +1 -0
- package/dist-browser/scripts/get-event/templates/track.template.d.ts +3 -0
- package/dist-browser/scripts/get-event/templates/track.template.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/templates/track.template.js +49 -0
- package/dist-browser/scripts/get-event/templates/track.template.js.map +1 -0
- package/dist-browser/scripts/get-event/templates/tsconfig.event-track.d.ts +3 -0
- package/dist-browser/scripts/get-event/templates/tsconfig.event-track.d.ts.map +1 -0
- package/dist-browser/scripts/get-event/templates/tsconfig.event-track.js +40 -0
- package/dist-browser/scripts/get-event/templates/tsconfig.event-track.js.map +1 -0
- package/dist-node/scripts/get-event/constants.d.ts +1 -1
- package/dist-node/scripts/get-event/constants.d.ts.map +1 -1
- package/dist-node/scripts/get-event/constants.js +1 -1
- package/dist-node/scripts/get-event/constants.js.map +1 -1
- package/dist-node/scripts/get-event/copy-tsconfig.d.ts.map +1 -1
- package/dist-node/scripts/get-event/copy-tsconfig.js +4 -25
- package/dist-node/scripts/get-event/copy-tsconfig.js.map +1 -1
- package/dist-node/scripts/get-event/generate-track-events.d.ts.map +1 -1
- package/dist-node/scripts/get-event/generate-track-events.js +4 -25
- package/dist-node/scripts/get-event/generate-track-events.js.map +1 -1
- package/dist-node/scripts/get-event/templates/index.d.ts +3 -0
- package/dist-node/scripts/get-event/templates/index.d.ts.map +1 -0
- package/dist-node/scripts/get-event/templates/index.js +19 -0
- package/dist-node/scripts/get-event/templates/index.js.map +1 -0
- package/dist-node/scripts/get-event/templates/track.template.d.ts +3 -0
- package/dist-node/scripts/get-event/templates/track.template.d.ts.map +1 -0
- package/dist-node/scripts/get-event/templates/track.template.js +51 -0
- package/dist-node/scripts/get-event/templates/track.template.js.map +1 -0
- package/dist-node/scripts/get-event/templates/tsconfig.event-track.d.ts +3 -0
- package/dist-node/scripts/get-event/templates/tsconfig.event-track.d.ts.map +1 -0
- package/dist-node/scripts/get-event/templates/tsconfig.event-track.js +42 -0
- package/dist-node/scripts/get-event/templates/tsconfig.event-track.js.map +1 -0
- package/package.json +1 -1
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
export declare const DEFAULT_CONTEXT = "default";
|
|
5
5
|
export declare const ROOT_PATH = "./src";
|
|
6
6
|
export declare const DEFAULT_FOLDER = "events";
|
|
7
|
-
export declare const DEFAULT_PATH = "./src/events
|
|
7
|
+
export declare const DEFAULT_PATH = "./src/events";
|
|
8
8
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,YAAY,iBAAmC,CAAC"}
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
export const DEFAULT_CONTEXT = "default";
|
|
5
5
|
export const ROOT_PATH = "./src";
|
|
6
6
|
export const DEFAULT_FOLDER = "events";
|
|
7
|
-
export const DEFAULT_PATH = `${ROOT_PATH}/${DEFAULT_FOLDER}
|
|
7
|
+
export const DEFAULT_PATH = `${ROOT_PATH}/${DEFAULT_FOLDER}`;
|
|
8
8
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AACzC,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,SAAS,IAAI,cAAc,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AACzC,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,SAAS,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-tsconfig.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-tsconfig.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAsB,YAAY,kBAGjC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { createRootFile } from "./helpers";
|
|
2
|
+
import tsconfigTemplate from "./templates/tsconfig.event-track";
|
|
3
3
|
/**
|
|
4
4
|
* Copia el archivo tsconfig
|
|
5
5
|
*/
|
|
6
6
|
export async function copyTsConfig() {
|
|
7
|
-
const
|
|
8
|
-
const content = await getFile(TSCONFIG_PATH);
|
|
7
|
+
const content = tsconfigTemplate;
|
|
9
8
|
createRootFile("./", content, "tsconfig.event-track.json");
|
|
10
9
|
}
|
|
11
10
|
//# sourceMappingURL=copy-tsconfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-tsconfig.js","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-tsconfig.js","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAW,MAAM,WAAW,CAAC;AACpD,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,OAAO,GAAG,gBAAgB,CAAC;IACjC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,2BAA2B,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-track-events.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-track-events.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"AA4BA;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,GAAE,MAAqB,iBA4BnC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { addImports, createRootFile, getEventDomain,
|
|
2
|
-
import * as path from 'path';
|
|
1
|
+
import { addImports, createRootFile, getEventDomain, getNames } from "./helpers";
|
|
3
2
|
import { DEFAULT_FOLDER, DEFAULT_PATH } from "./constants";
|
|
3
|
+
import template from './templates/track.template';
|
|
4
4
|
const TEMPLATE = `
|
|
5
5
|
try {
|
|
6
6
|
<Artifac>.NAME
|
|
@@ -8,7 +8,6 @@ const TEMPLATE = `
|
|
|
8
8
|
console.error("Artifac <Artifac> not found")
|
|
9
9
|
}
|
|
10
10
|
// flag`;
|
|
11
|
-
const TEMPLATE_PATH = path.join(__dirname, 'templates', 'track.template.txt');
|
|
12
11
|
/**
|
|
13
12
|
* Agrega un elemento
|
|
14
13
|
* @param {string} texto
|
|
@@ -28,7 +27,7 @@ function addArtifacts(texto, artifacName, folder) {
|
|
|
28
27
|
*/
|
|
29
28
|
export async function trackEvents(outputPath, contextName, eventFolder = DEFAULT_PATH) {
|
|
30
29
|
const artifacts = getEventDomain(eventFolder);
|
|
31
|
-
let templateContent =
|
|
30
|
+
let templateContent = template;
|
|
32
31
|
templateContent = templateContent.replace("<%= context-name %>", contextName.trim());
|
|
33
32
|
for (const artifac of artifacts) {
|
|
34
33
|
const artifacNames = getNames(artifac.name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-track-events.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"generate-track-events.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE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,CAAC,CAAC;IACzE,CAAC;IACD,qDAAqD;IAErD,+BAA+B;IAC/B,cAAc,CAAC,UAAU,EAAE,eAAe,EAAE,wBAAwB,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.template.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,QAAQ,EAAE,MA8Cf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const template = `
|
|
2
|
+
import { DomainDirectory, EventPublicApi, JsonSchemaForCloudEvent } from "@imolko/ultra-ddd";
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
|
|
6
|
+
const eventPaths: { [key: string]: string } = {
|
|
7
|
+
// event-path-flag
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function main() {
|
|
11
|
+
// flag
|
|
12
|
+
|
|
13
|
+
const eventsDefault = DomainDirectory.getEvents();
|
|
14
|
+
const eventsContext = DomainDirectory.getEvents("<%= context-name %>");
|
|
15
|
+
|
|
16
|
+
const events: EventPublicApi[] = [...eventsDefault, ...eventsContext];
|
|
17
|
+
console.log('\\\\nEVENTS', events); // Escapar la barra invertida
|
|
18
|
+
|
|
19
|
+
// Esquematizar eventos
|
|
20
|
+
const schemify: { [key: string]: { version: string; schema: JsonSchemaForCloudEvent; }[] } = {};
|
|
21
|
+
for (const event of events) {
|
|
22
|
+
const schemaExe = event.getJsonSchemasForEvolution();
|
|
23
|
+
if (schemaExe.isValid()) {
|
|
24
|
+
const schemes = schemaExe.getValue();
|
|
25
|
+
schemify[event.NAME] = schemes;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
console.log("\\\\nSCHEMES", schemify); // Escapar la barra invertida
|
|
29
|
+
|
|
30
|
+
// Obtener la ruta del directorio src
|
|
31
|
+
const srcFolderPath = path.resolve(__dirname, '..'); // Subir un nivel desde event-schemes
|
|
32
|
+
|
|
33
|
+
// Crear la carpeta schemas dentro de src si no existe
|
|
34
|
+
const schemasFolderPath = path.join(srcFolderPath, 'schemes');
|
|
35
|
+
if (!fs.existsSync(schemasFolderPath)) {
|
|
36
|
+
fs.mkdirSync(schemasFolderPath);
|
|
37
|
+
console.log(\`\\\\nCarpeta 'schemes' creada en: \${schemasFolderPath}\`); // Escapar la barra invertida
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Crear el archivo JSON dentro de la carpeta schemas
|
|
41
|
+
const jsonFilePath = path.join(schemasFolderPath, 'schemes.json');
|
|
42
|
+
fs.writeFileSync(jsonFilePath, JSON.stringify(schemify, null, 2));
|
|
43
|
+
console.log(\`\\\\nJSON file created in: \${jsonFilePath}\`); // Escapar la barra invertida
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
main();
|
|
47
|
+
`;
|
|
48
|
+
export default template;
|
|
49
|
+
//# sourceMappingURL=track.template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.template.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CxB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfig.event-track.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/tsconfig.event-track.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,cAAc,EAAE,MAqCpB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const tsconfigString = `{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "CommonJS",
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"outDir": "event-schemes",
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"sourceMap": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"noEmitOnError": true
|
|
14
|
+
},
|
|
15
|
+
"include": ["src/**/*"],
|
|
16
|
+
"exclude": ["node_modules", "dist"],
|
|
17
|
+
"esbuild": {
|
|
18
|
+
"platform": "node",
|
|
19
|
+
"bundle": false,
|
|
20
|
+
"format": "cjs",
|
|
21
|
+
"entryPoints": ["src/track-events-script.ts"],
|
|
22
|
+
"outdir": "event-schemes",
|
|
23
|
+
"sourcemap": true,
|
|
24
|
+
"outExtension": {
|
|
25
|
+
".js": ".js"
|
|
26
|
+
},
|
|
27
|
+
"generatePackageJson": true,
|
|
28
|
+
"assets": ["src/assets"]
|
|
29
|
+
},
|
|
30
|
+
"configurations": {
|
|
31
|
+
"development": {
|
|
32
|
+
"sourceMap": true
|
|
33
|
+
},
|
|
34
|
+
"production": {
|
|
35
|
+
"sourceMap": false
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}`;
|
|
39
|
+
export default tsconfigString;
|
|
40
|
+
//# sourceMappingURL=tsconfig.event-track.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfig.event-track.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/tsconfig.event-track.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqC7B,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
export declare const DEFAULT_CONTEXT = "default";
|
|
5
5
|
export declare const ROOT_PATH = "./src";
|
|
6
6
|
export declare const DEFAULT_FOLDER = "events";
|
|
7
|
-
export declare const DEFAULT_PATH = "./src/events
|
|
7
|
+
export declare const DEFAULT_PATH = "./src/events";
|
|
8
8
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,SAAS,UAAU,CAAC;AACjC,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,YAAY,iBAAmC,CAAC"}
|
|
@@ -7,5 +7,5 @@ exports.DEFAULT_PATH = exports.DEFAULT_FOLDER = exports.ROOT_PATH = exports.DEFA
|
|
|
7
7
|
exports.DEFAULT_CONTEXT = "default";
|
|
8
8
|
exports.ROOT_PATH = "./src";
|
|
9
9
|
exports.DEFAULT_FOLDER = "events";
|
|
10
|
-
exports.DEFAULT_PATH = `${exports.ROOT_PATH}/${exports.DEFAULT_FOLDER}
|
|
10
|
+
exports.DEFAULT_PATH = `${exports.ROOT_PATH}/${exports.DEFAULT_FOLDER}`;
|
|
11
11
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,eAAe,GAAG,SAAS,CAAC;AAC5B,QAAA,SAAS,GAAG,OAAO,CAAC;AACpB,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,YAAY,GAAG,GAAG,iBAAS,IAAI,sBAAc,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/scripts/get-event/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,eAAe,GAAG,SAAS,CAAC;AAC5B,QAAA,SAAS,GAAG,OAAO,CAAC;AACpB,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,YAAY,GAAG,GAAG,iBAAS,IAAI,sBAAc,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-tsconfig.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-tsconfig.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAsB,YAAY,kBAGjC"}
|
|
@@ -1,37 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.copyTsConfig = void 0;
|
|
27
|
-
const path = __importStar(require("path"));
|
|
28
7
|
const helpers_1 = require("./helpers");
|
|
8
|
+
const tsconfig_event_track_1 = __importDefault(require("./templates/tsconfig.event-track"));
|
|
29
9
|
/**
|
|
30
10
|
* Copia el archivo tsconfig
|
|
31
11
|
*/
|
|
32
12
|
async function copyTsConfig() {
|
|
33
|
-
const
|
|
34
|
-
const content = await (0, helpers_1.getFile)(TSCONFIG_PATH);
|
|
13
|
+
const content = tsconfig_event_track_1.default;
|
|
35
14
|
(0, helpers_1.createRootFile)("./", content, "tsconfig.event-track.json");
|
|
36
15
|
}
|
|
37
16
|
exports.copyTsConfig = copyTsConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-tsconfig.js","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-tsconfig.js","sourceRoot":"","sources":["../../../src/scripts/get-event/copy-tsconfig.ts"],"names":[],"mappings":";;;;;;AACA,uCAAoD;AACpD,4FAAgE;AAEhE;;GAEG;AACI,KAAK,UAAU,YAAY;IAChC,MAAM,OAAO,GAAG,8BAAgB,CAAC;IACjC,IAAA,wBAAc,EAAC,IAAI,EAAE,OAAO,EAAE,2BAA2B,CAAC,CAAC;AAC7D,CAAC;AAHD,oCAGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-track-events.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-track-events.d.ts","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"AA4BA;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,GAAE,MAAqB,iBA4BnC"}
|
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.trackEvents = void 0;
|
|
27
7
|
const helpers_1 = require("./helpers");
|
|
28
|
-
const path = __importStar(require("path"));
|
|
29
8
|
const constants_1 = require("./constants");
|
|
9
|
+
const track_template_1 = __importDefault(require("./templates/track.template"));
|
|
30
10
|
const TEMPLATE = `
|
|
31
11
|
try {
|
|
32
12
|
<Artifac>.NAME
|
|
@@ -34,7 +14,6 @@ const TEMPLATE = `
|
|
|
34
14
|
console.error("Artifac <Artifac> not found")
|
|
35
15
|
}
|
|
36
16
|
// flag`;
|
|
37
|
-
const TEMPLATE_PATH = path.join(__dirname, 'templates', 'track.template.txt');
|
|
38
17
|
/**
|
|
39
18
|
* Agrega un elemento
|
|
40
19
|
* @param {string} texto
|
|
@@ -54,7 +33,7 @@ function addArtifacts(texto, artifacName, folder) {
|
|
|
54
33
|
*/
|
|
55
34
|
async function trackEvents(outputPath, contextName, eventFolder = constants_1.DEFAULT_PATH) {
|
|
56
35
|
const artifacts = (0, helpers_1.getEventDomain)(eventFolder);
|
|
57
|
-
let templateContent =
|
|
36
|
+
let templateContent = track_template_1.default;
|
|
58
37
|
templateContent = templateContent.replace("<%= context-name %>", contextName.trim());
|
|
59
38
|
for (const artifac of artifacts) {
|
|
60
39
|
const artifacNames = (0, helpers_1.getNames)(artifac.name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-track-events.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-track-events.js","sourceRoot":"","sources":["../../../src/scripts/get-event/generate-track-events.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0F;AAC1F,2CAA2D;AAC3D,gFAAkD;AAElD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A/BD,kCA+BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./track.template"), exports);
|
|
18
|
+
__exportStar(require("./tsconfig.event-track"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,yDAAuC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.template.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,QAAQ,EAAE,MA8Cf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const template = `
|
|
4
|
+
import { DomainDirectory, EventPublicApi, JsonSchemaForCloudEvent } from "@imolko/ultra-ddd";
|
|
5
|
+
import * as fs from 'fs';
|
|
6
|
+
import * as path from 'path';
|
|
7
|
+
|
|
8
|
+
const eventPaths: { [key: string]: string } = {
|
|
9
|
+
// event-path-flag
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function main() {
|
|
13
|
+
// flag
|
|
14
|
+
|
|
15
|
+
const eventsDefault = DomainDirectory.getEvents();
|
|
16
|
+
const eventsContext = DomainDirectory.getEvents("<%= context-name %>");
|
|
17
|
+
|
|
18
|
+
const events: EventPublicApi[] = [...eventsDefault, ...eventsContext];
|
|
19
|
+
console.log('\\\\nEVENTS', events); // Escapar la barra invertida
|
|
20
|
+
|
|
21
|
+
// Esquematizar eventos
|
|
22
|
+
const schemify: { [key: string]: { version: string; schema: JsonSchemaForCloudEvent; }[] } = {};
|
|
23
|
+
for (const event of events) {
|
|
24
|
+
const schemaExe = event.getJsonSchemasForEvolution();
|
|
25
|
+
if (schemaExe.isValid()) {
|
|
26
|
+
const schemes = schemaExe.getValue();
|
|
27
|
+
schemify[event.NAME] = schemes;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
console.log("\\\\nSCHEMES", schemify); // Escapar la barra invertida
|
|
31
|
+
|
|
32
|
+
// Obtener la ruta del directorio src
|
|
33
|
+
const srcFolderPath = path.resolve(__dirname, '..'); // Subir un nivel desde event-schemes
|
|
34
|
+
|
|
35
|
+
// Crear la carpeta schemas dentro de src si no existe
|
|
36
|
+
const schemasFolderPath = path.join(srcFolderPath, 'schemes');
|
|
37
|
+
if (!fs.existsSync(schemasFolderPath)) {
|
|
38
|
+
fs.mkdirSync(schemasFolderPath);
|
|
39
|
+
console.log(\`\\\\nCarpeta 'schemes' creada en: \${schemasFolderPath}\`); // Escapar la barra invertida
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Crear el archivo JSON dentro de la carpeta schemas
|
|
43
|
+
const jsonFilePath = path.join(schemasFolderPath, 'schemes.json');
|
|
44
|
+
fs.writeFileSync(jsonFilePath, JSON.stringify(schemify, null, 2));
|
|
45
|
+
console.log(\`\\\\nJSON file created in: \${jsonFilePath}\`); // Escapar la barra invertida
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
main();
|
|
49
|
+
`;
|
|
50
|
+
exports.default = template;
|
|
51
|
+
//# sourceMappingURL=track.template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.template.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/track.template.ts"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CxB,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfig.event-track.d.ts","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/tsconfig.event-track.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,cAAc,EAAE,MAqCpB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tsconfigString = `{
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"module": "CommonJS",
|
|
6
|
+
"target": "ES2020",
|
|
7
|
+
"outDir": "event-schemes",
|
|
8
|
+
"rootDir": "src",
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"experimentalDecorators": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"noEmitOnError": true
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*"],
|
|
18
|
+
"exclude": ["node_modules", "dist"],
|
|
19
|
+
"esbuild": {
|
|
20
|
+
"platform": "node",
|
|
21
|
+
"bundle": false,
|
|
22
|
+
"format": "cjs",
|
|
23
|
+
"entryPoints": ["src/track-events-script.ts"],
|
|
24
|
+
"outdir": "event-schemes",
|
|
25
|
+
"sourcemap": true,
|
|
26
|
+
"outExtension": {
|
|
27
|
+
".js": ".js"
|
|
28
|
+
},
|
|
29
|
+
"generatePackageJson": true,
|
|
30
|
+
"assets": ["src/assets"]
|
|
31
|
+
},
|
|
32
|
+
"configurations": {
|
|
33
|
+
"development": {
|
|
34
|
+
"sourceMap": true
|
|
35
|
+
},
|
|
36
|
+
"production": {
|
|
37
|
+
"sourceMap": false
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}`;
|
|
41
|
+
exports.default = tsconfigString;
|
|
42
|
+
//# sourceMappingURL=tsconfig.event-track.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfig.event-track.js","sourceRoot":"","sources":["../../../../src/scripts/get-event/templates/tsconfig.event-track.ts"],"names":[],"mappings":";;AAAA,MAAM,cAAc,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqC7B,CAAC;AAEH,kBAAe,cAAc,CAAC"}
|