@tstdl/base 0.78.0-beta31 → 0.78.0-beta32
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/examples/pdf/templates/hello-name.d.ts +1 -4
- package/package.json +2 -2
- package/templates/providers/file-template.provider.base.d.ts +1 -1
- package/templates/providers/file-template.provider.d.ts +2 -2
- package/templates/providers/file-template.provider.js.map +1 -1
- package/templates/renderers/handlebars.template-renderer.d.ts +2 -0
- package/templates/renderers/handlebars.template-renderer.js +9 -1
- package/templates/renderers/handlebars.template-renderer.js.map +1 -1
- package/templates/template.model.d.ts +1 -0
- package/templates/template.model.js +5 -0
- package/templates/template.model.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.78.0-
|
|
3
|
+
"version": "0.78.0-beta32",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@elastic/elasticsearch": "^8.2",
|
|
41
41
|
"@koa/router": "^12.0",
|
|
42
|
-
"@tstdl/angular": "^0.11.0-
|
|
42
|
+
"@tstdl/angular": "^0.11.0-beta32",
|
|
43
43
|
"chroma-js": "^2.4",
|
|
44
44
|
"got": "^12.3",
|
|
45
45
|
"handlebars": "^4.7",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "../../schema";
|
|
2
2
|
import type { TypedOmit } from "../../types";
|
|
3
3
|
import type { Template } from '../template.model';
|
|
4
|
-
export declare type FileTemplateBase = TypedOmit<
|
|
4
|
+
export declare type FileTemplateBase<T extends Template = Template> = TypedOmit<T, 'template'>;
|
|
5
5
|
export declare type FileForward<T extends FileTemplateBase, U extends FileTemplateBase> = [fileKey: keyof U, targetKey: keyof T];
|
|
6
6
|
export declare class FileTemplateProviderBase<T extends FileTemplateBase, U extends FileTemplateBase> {
|
|
7
7
|
private readonly schema;
|
|
@@ -4,7 +4,7 @@ import type { Template } from '../template.model';
|
|
|
4
4
|
import type { TemplateProvider } from '../template.provider';
|
|
5
5
|
import type { FileTemplateBase } from './file-template.provider.base';
|
|
6
6
|
import { FileTemplateProviderBase } from './file-template.provider.base';
|
|
7
|
-
export declare type FileTemplate = FileTemplateBase & {
|
|
7
|
+
export declare type FileTemplate<T extends Template = Template> = FileTemplateBase<T> & {
|
|
8
8
|
template?: string;
|
|
9
9
|
/** subject template file */
|
|
10
10
|
templateFile?: string;
|
|
@@ -19,4 +19,4 @@ export declare class FileTemplateProvider extends FileTemplateProviderBase<Templ
|
|
|
19
19
|
constructor(basePath: string);
|
|
20
20
|
}
|
|
21
21
|
export declare function configureFileTemplateProvider(config?: Partial<FileTemplateProviderConfig>): void;
|
|
22
|
-
export declare function fileTemplate<T extends
|
|
22
|
+
export declare function fileTemplate<T extends Template = Template>(template: FileTemplate<T>): FileTemplate<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-template.provider.js","sourceRoot":"","sources":["../../../source/templates/providers/file-template.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+CAAwE;
|
|
1
|
+
{"version":3,"file":"file-template.provider.js","sourceRoot":"","sources":["../../../source/templates/providers/file-template.provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,+CAAwE;AACxE,yCAA6D;AAI7D,+EAAyE;AAe5D,QAAA,0BAA0B,GAA+B,EAAE,CAAC;AAEzE,MAAM,kBAAkB,GAAG,IAAA,eAAM,EAAe;IAC9C,IAAI,EAAE,IAAA,eAAM,GAAE;IACd,QAAQ,EAAE,IAAA,iBAAQ,EAAC,IAAA,eAAM,GAAE,CAAC;IAC5B,YAAY,EAAE,IAAA,iBAAQ,EAAC,IAAA,eAAM,GAAE,CAAC;IAChC,OAAO,EAAE,IAAA,iBAAQ,EAAC,IAAA,gBAAO,GAAE,CAAC;CAC7B,CAAC,CAAC;AAKI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sDAAgD;IAGxF,YAAyB,QAAgB;QACvC,KAAK,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAAC,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;CACF,CAAA;AANY,oBAAoB;IAHhC,IAAA,qBAAS,EAAC;QACT,uBAAuB,EAAE,GAAG,EAAE,CAAC,kCAA0B,CAAC,QAAQ;KACnE,CAAC;IAIa,WAAA,IAAA,qBAAS,GAAE,CAAA;;GAHb,oBAAoB,CAMhC;AANY,oDAAoB;AAQjC,SAAgB,6BAA6B,CAAC,SAA8C,EAAE;IAC5F,kCAA0B,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,kCAA0B,CAAC,QAAQ,CAAC;AAC/F,CAAC;AAFD,sEAEC;AAED,SAAgB,YAAY,CAAgC,QAAyB;IACnF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAFD,oCAEC"}
|
|
@@ -14,3 +14,5 @@ export declare class HandlebarsTemplateRenderer extends TemplateRenderer<Handleb
|
|
|
14
14
|
canHandleType(type: string): boolean;
|
|
15
15
|
render(template: HandlebarsTemplate, context?: object): Promise<TemplateRenderResult>;
|
|
16
16
|
}
|
|
17
|
+
export declare function handlebarsTemplateOptions<T extends HandlebarsTemplateOptions>(options: T): T;
|
|
18
|
+
export declare function handlebarsTemplate<T extends HandlebarsTemplate = HandlebarsTemplate>(template: T): T;
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.HandlebarsTemplateRenderer = void 0;
|
|
9
|
+
exports.handlebarsTemplate = exports.handlebarsTemplateOptions = exports.HandlebarsTemplateRenderer = void 0;
|
|
10
10
|
const container_1 = require("../../container");
|
|
11
11
|
const memoize_1 = require("../../utils/function/memoize");
|
|
12
12
|
const object_1 = require("../../utils/object/object");
|
|
@@ -27,6 +27,14 @@ HandlebarsTemplateRenderer = __decorate([
|
|
|
27
27
|
(0, container_1.singleton)()
|
|
28
28
|
], HandlebarsTemplateRenderer);
|
|
29
29
|
exports.HandlebarsTemplateRenderer = HandlebarsTemplateRenderer;
|
|
30
|
+
function handlebarsTemplateOptions(options) {
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
33
|
+
exports.handlebarsTemplateOptions = handlebarsTemplateOptions;
|
|
34
|
+
function handlebarsTemplate(template) {
|
|
35
|
+
return template;
|
|
36
|
+
}
|
|
37
|
+
exports.handlebarsTemplate = handlebarsTemplate;
|
|
30
38
|
function _compileHandlebarsTemplate({ template, options = {} }) {
|
|
31
39
|
const renderer = handlebars.compile(template, {
|
|
32
40
|
strict: options.strict ?? true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlebars.template-renderer.js","sourceRoot":"","sources":["../../../source/templates/renderers/handlebars.template-renderer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAAwC;AAExC,0DAAyD;AACzD,sDAAwD;AACxD,yDAAgD;AAChD,yCAAyC;AAGzC,4DAAwD;AAWxD,MAAM,yBAAyB,GAAG,IAAA,uBAAa,EAAC,0BAA0B,CAAC,CAAC;AAGrE,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,oCAAoC;IAClF,aAAa,CAAC,IAAY;QACxB,OAAO,IAAI,IAAI,YAAY,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAA4B,EAAE,OAAgB;QACzD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAC;QACrD,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;CACF,CAAA;AATY,0BAA0B;IADtC,IAAA,qBAAS,GAAE;GACC,0BAA0B,CAStC;AATY,gEAA0B;
|
|
1
|
+
{"version":3,"file":"handlebars.template-renderer.js","sourceRoot":"","sources":["../../../source/templates/renderers/handlebars.template-renderer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+CAAwC;AAExC,0DAAyD;AACzD,sDAAwD;AACxD,yDAAgD;AAChD,yCAAyC;AAGzC,4DAAwD;AAWxD,MAAM,yBAAyB,GAAG,IAAA,uBAAa,EAAC,0BAA0B,CAAC,CAAC;AAGrE,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,oCAAoC;IAClF,aAAa,CAAC,IAAY;QACxB,OAAO,IAAI,IAAI,YAAY,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAA4B,EAAE,OAAgB;QACzD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAC;QACrD,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;CACF,CAAA;AATY,0BAA0B;IADtC,IAAA,qBAAS,GAAE;GACC,0BAA0B,CAStC;AATY,gEAA0B;AAWvC,SAAgB,yBAAyB,CAAsC,OAAU;IACvF,OAAO,OAAO,CAAC;AACjB,CAAC;AAFD,8DAEC;AAED,SAAgB,kBAAkB,CAAoD,QAAW;IAC/F,OAAO,QAAQ,CAAC;AAClB,CAAC;AAFD,gDAEC;AAED,SAAS,0BAA0B,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,EAAE,EAAsB;IAChF,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE;QAC5C,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI;QAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,YAAY,EAAE,IAAA,uBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,wBAAe,EAAC,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QACnG,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,OAAO,CAAC,OAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AACxG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.model.js","sourceRoot":"","sources":["../../source/templates/template.model.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"template.model.js","sourceRoot":"","sources":["../../source/templates/template.model.ts"],"names":[],"mappings":";;;AAMA,SAAgB,QAAQ,CAAgC,QAAW;IACjE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAFD,4BAEC"}
|