@breadstone-tools/openapi-templates 0.0.2-beta.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/Index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import type { TemplateMap } from './Templates/TemplateMap.js';
2
+ export type { TemplateKind } from './Templates/TemplateKind.js';
3
+ export type { TemplateMap } from './Templates/TemplateMap.js';
4
+ /**
5
+ * The default resolver to get all templates.
6
+ *
7
+ * @public
8
+ * @returns TemplateMap
9
+ */
10
+ export declare const templateResolver: () => {
11
+ path: string;
12
+ mapping: TemplateMap;
13
+ };
14
+ //# sourceMappingURL=Index.d.ts.map
package/Index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Index.d.ts","sourceRoot":"","sources":["../src/Index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAI9D,YAAY,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,QAAO;IAAE,IAAI,EAAE,MAAM,CAAC;IAC/C,OAAO,EAAE,WAAW,CAAC;CAoBxB,CAAC"}
package/Index.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.templateResolver = void 0;
5
+ const utilities_1 = require("@breadstone-infrastructure/utilities");
6
+ /**
7
+ * The default resolver to get all templates.
8
+ *
9
+ * @public
10
+ * @returns TemplateMap
11
+ */
12
+ const templateResolver = () => {
13
+ const parentPath = utilities_1.Directory.getParent(__dirname) ?? '';
14
+ const templatePath = utilities_1.Path.combine(parentPath, 'templates');
15
+ if ((!parentPath || !templatePath) && !utilities_1.Directory.exists(templatePath)) {
16
+ throw new Error('Directory could not be resolved.');
17
+ }
18
+ const templateMapping = new Map()
19
+ .set('enum', utilities_1.Path.combine(templatePath, 'Enum.tpl'))
20
+ .set('index', utilities_1.Path.combine(templatePath, 'Index.tpl'))
21
+ .set('interface', utilities_1.Path.combine(templatePath, 'Interface.tpl'))
22
+ .set('service', utilities_1.Path.combine(templatePath, 'Service.tpl'))
23
+ .set('type', utilities_1.Path.combine(templatePath, 'Type.tpl'))
24
+ .set('class', utilities_1.Path.combine(templatePath, 'Class.tpl'));
25
+ return {
26
+ path: templatePath,
27
+ mapping: templateMapping
28
+ };
29
+ };
30
+ exports.templateResolver = templateResolver;
31
+ //# sourceMappingURL=Index.js.map
package/Index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Index.js","sourceRoot":"","sources":["../src/Index.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAElB,oEAAuE;AASvE;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,GACJ,EAAE;IAC1B,MAAM,UAAU,GAAG,qBAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,gBAAI,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAE3D,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,qBAAS,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,eAAe,GAAG,IAAI,GAAG,EAAwB;SAClD,GAAG,CAAC,MAAM,EAAE,gBAAI,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;SACnD,GAAG,CAAC,OAAO,EAAE,gBAAI,CAAC,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;SACrD,GAAG,CAAC,WAAW,EAAE,gBAAI,CAAC,OAAO,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;SAC7D,GAAG,CAAC,SAAS,EAAE,gBAAI,CAAC,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;SACzD,GAAG,CAAC,MAAM,EAAE,gBAAI,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;SACnD,GAAG,CAAC,OAAO,EAAE,gBAAI,CAAC,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;IAE3D,OAAO;QACH,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,eAAe;KAC3B,CAAC;AACN,CAAC,CAAC;AArBW,QAAA,gBAAgB,oBAqB3B"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @public
3
+ */
4
+ export type TemplateKind = 'enum' | 'index' | 'interface' | 'service' | 'type' | 'class';
5
+ //# sourceMappingURL=TemplateKind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateKind.d.ts","sourceRoot":"","sources":["../../src/Templates/TemplateKind.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TemplateKind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateKind.js","sourceRoot":"","sources":["../../src/Templates/TemplateKind.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { TemplateKind } from './TemplateKind.js';
2
+ /**
3
+ * @public
4
+ */
5
+ export type TemplateMap = Map<TemplateKind, string>;
6
+ //# sourceMappingURL=TemplateMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateMap.d.ts","sourceRoot":"","sources":["../../src/Templates/TemplateMap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD;;GAEG;AAEH,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // #region Imports
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=TemplateMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateMap.js","sourceRoot":"","sources":["../../src/Templates/TemplateMap.ts"],"names":[],"mappings":";AAAA,kBAAkB"}
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@breadstone-tools/openapi-templates",
3
+ "description": "Open API Model generator templates",
4
+ "version": "0.0.2-beta.0",
5
+ "license": "MIT",
6
+ "author": "andre.wehlert <awehlert@breadstone.de> (https://www.breadstone.de)",
7
+ "repository": {
8
+ "url": "git+ssh://git@github.com/RueDeRennes/mosaik.git"
9
+ },
10
+ "type": "commonjs",
11
+ "main": "./Index.js",
12
+ "commonjs": "./Index.js",
13
+ "module": "./Index.js",
14
+ "types": "./Index.d.ts",
15
+ "dependencies": {
16
+ "@breadstone-infrastructure/utilities": "^0.0.2-beta.0",
17
+ "jsesc": "3.1.0",
18
+ "json-schema-ref-parser": "9.0.9"
19
+ }
20
+ }