@rocketmakers/orbit-template-service 2.0.0-beta.3 → 2.0.0-beta.4

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.
Files changed (55) hide show
  1. package/lib/{src/core → core}/index.d.ts +0 -0
  2. package/lib/core/index.d.ts.map +1 -0
  3. package/lib/{src/core → core}/index.js +0 -0
  4. package/lib/{src/core → core}/index.js.map +1 -1
  5. package/lib/{src/core → core}/validation.d.ts +1 -1
  6. package/lib/core/validation.d.ts.map +1 -0
  7. package/lib/{src/core → core}/validation.js +2 -2
  8. package/lib/core/validation.js.map +1 -0
  9. package/lib/{src/index.d.ts → index.d.ts} +0 -0
  10. package/lib/index.d.ts.map +1 -0
  11. package/lib/{src/index.js → index.js} +0 -0
  12. package/lib/index.js.map +1 -0
  13. package/lib/{src/ioc → ioc}/index.d.ts +0 -0
  14. package/lib/ioc/index.d.ts.map +1 -0
  15. package/lib/{src/ioc → ioc}/index.js +0 -0
  16. package/lib/ioc/index.js.map +1 -0
  17. package/lib/ioc/register.d.ts +9 -0
  18. package/lib/ioc/register.d.ts.map +1 -0
  19. package/lib/ioc/register.js +12 -0
  20. package/lib/ioc/register.js.map +1 -0
  21. package/lib/{src/ioc → ioc}/types.d.ts +0 -0
  22. package/lib/ioc/types.d.ts.map +1 -0
  23. package/lib/{src/ioc → ioc}/types.js +0 -0
  24. package/lib/{src/ioc → ioc}/types.js.map +1 -1
  25. package/lib/{src/services → services}/index.d.ts +0 -0
  26. package/lib/services/index.d.ts.map +1 -0
  27. package/lib/{src/services → services}/index.js +0 -0
  28. package/lib/services/index.js.map +1 -0
  29. package/lib/services/templateService.d.ts +16 -0
  30. package/lib/services/templateService.d.ts.map +1 -0
  31. package/lib/{src/services → services}/templateService.js +36 -39
  32. package/lib/services/templateService.js.map +1 -0
  33. package/lib/tsconfig.tsbuildinfo +1 -2342
  34. package/package.json +13 -13
  35. package/lib/src/core/index.d.ts.map +0 -1
  36. package/lib/src/core/validation.d.ts.map +0 -1
  37. package/lib/src/core/validation.js.map +0 -1
  38. package/lib/src/index.d.ts.map +0 -1
  39. package/lib/src/index.js.map +0 -1
  40. package/lib/src/ioc/container.d.ts +0 -13
  41. package/lib/src/ioc/container.d.ts.map +0 -1
  42. package/lib/src/ioc/container.js +0 -7
  43. package/lib/src/ioc/container.js.map +0 -1
  44. package/lib/src/ioc/index.d.ts.map +0 -1
  45. package/lib/src/ioc/index.js.map +0 -1
  46. package/lib/src/ioc/register.d.ts +0 -2
  47. package/lib/src/ioc/register.d.ts.map +0 -1
  48. package/lib/src/ioc/register.js +0 -13
  49. package/lib/src/ioc/register.js.map +0 -1
  50. package/lib/src/ioc/types.d.ts.map +0 -1
  51. package/lib/src/services/index.d.ts.map +0 -1
  52. package/lib/src/services/index.js.map +0 -1
  53. package/lib/src/services/templateService.d.ts +0 -11
  54. package/lib/src/services/templateService.d.ts.map +0 -1
  55. package/lib/src/services/templateService.js.map +0 -1
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B"}
@@ -1,7 +1,7 @@
1
1
  import { LayoutId } from '@rocketmakers/orbit-template-core';
2
2
  export declare namespace Validation {
3
3
  function renderLayoutTemplates<TPayload>(layoutId: LayoutId, payload: TPayload): Promise<{
4
- validatedLayoutId: import("@rocketmakers/orbit-core").OpaqueString<"LayoutId">;
4
+ validatedLayoutId: LayoutId;
5
5
  providedPayload: unknown;
6
6
  }>;
7
7
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/core/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAM7D,yBAAiB,UAAU,CAAC;IAC1B,SAAsB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ;;;OAK1F;CACF"}
@@ -10,8 +10,8 @@ var Validation;
10
10
  function renderLayoutTemplates(layoutId, payload) {
11
11
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
12
  return {
13
- validatedLayoutId: yield orbit_core_1.validate(validateLayoutId, layoutId),
14
- providedPayload: yield orbit_core_1.validate(validatePayloadExists, payload),
13
+ validatedLayoutId: yield (0, orbit_core_1.validate)(validateLayoutId, layoutId),
14
+ providedPayload: yield (0, orbit_core_1.validate)(validatePayloadExists, payload),
15
15
  };
16
16
  });
17
17
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/core/validation.ts"],"names":[],"mappings":";;;;AACA,yDAAsE;AAEtE,MAAM,gBAAgB,GAAG,6BAAgB,CAAC,MAAM,CAAW,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AACtF,MAAM,qBAAqB,GAAG,6BAAgB,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;AAEtG,IAAiB,UAAU,CAO1B;AAPD,WAAiB,UAAU;IACzB,SAAsB,qBAAqB,CAAW,QAAkB,EAAE,OAAiB;;YACzF,OAAO;gBACL,iBAAiB,EAAE,MAAM,IAAA,qBAAQ,EAAC,gBAAgB,EAAE,QAAQ,CAAC;gBAC7D,eAAe,EAAE,MAAM,IAAA,qBAAQ,EAAC,qBAAqB,EAAE,OAAO,CAAC;aAChE,CAAC;QACJ,CAAC;KAAA;IALqB,gCAAqB,wBAK1C,CAAA;AACH,CAAC,EAPgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAO1B"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAIA,iDAAuB;AACvB,gDAAsB;AACtB,qDAA2B"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ioc/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ioc/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,kDAAwB"}
@@ -0,0 +1,9 @@
1
+ import { ICoreContainerTypes } from '@rocketmakers/orbit-core';
2
+ import { IContainer } from '@rocketmakers/ioc';
3
+ import { CamelPrefix } from '@rocketmakers/ioc/lib/prefix';
4
+ import { IRepositoryContainerTypes } from '@rocketmakers/orbit-template-core';
5
+ import { ITemplateServicesContainerTypes } from './types';
6
+ export declare type ContainerDependencies<TServiceName extends string> = ICoreContainerTypes & CamelPrefix.Prefixed<IRepositoryContainerTypes, TServiceName>;
7
+ export declare type TemplateServiceIoC<TServiceName extends string> = CamelPrefix.Prefixed<ITemplateServicesContainerTypes, TServiceName> & ContainerDependencies<TServiceName>;
8
+ export declare function registerTemplateServiceIoC<TServiceName extends string>(serviceName: TServiceName, container: IContainer<ContainerDependencies<TServiceName>>): IContainer<TemplateServiceIoC<TServiceName>>;
9
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/ioc/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAsB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE1D,oBAAY,qBAAqB,CAAC,YAAY,SAAS,MAAM,IAAI,mBAAmB,GAClF,WAAW,CAAC,QAAQ,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC;AAEhE,oBAAY,kBAAkB,CAAC,YAAY,SAAS,MAAM,IAAI,WAAW,CAAC,QAAQ,CAChF,+BAA+B,EAC/B,YAAY,CACb,GACC,qBAAqB,CAAC,YAAY,CAAC,CAAC;AACtC,wBAAgB,0BAA0B,CAAC,YAAY,SAAS,MAAM,EACpE,WAAW,EAAE,YAAY,EACzB,SAAS,EAAE,UAAU,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,GACzD,UAAU,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAU9C"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerTemplateServiceIoC = void 0;
4
+ const ioc_1 = require("@rocketmakers/ioc");
5
+ const services_1 = require("../services");
6
+ function registerTemplateServiceIoC(serviceName, container) {
7
+ return (0, ioc_1.registerWithPrefix)('camel', serviceName, {
8
+ templateService: builder => builder.class(services_1.TemplateService, [`${serviceName}TemplateRepository`, 'logger']).inSingletonScope(),
9
+ }, container);
10
+ }
11
+ exports.registerTemplateServiceIoC = registerTemplateServiceIoC;
12
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/ioc/register.ts"],"names":[],"mappings":";;;AACA,2CAAmE;AAGnE,0CAA8C;AAW9C,SAAgB,0BAA0B,CACxC,WAAyB,EACzB,SAA0D;IAE1D,OAAO,IAAA,wBAAkB,EACvB,OAAO,EACP,WAAW,EACX;QACE,eAAe,EAAE,OAAO,CAAC,EAAE,CACzB,OAAO,CAAC,KAAK,CAAC,0BAAe,EAAE,CAAC,GAAG,WAAW,oBAAoB,EAAE,QAAQ,CAAQ,CAAC,CAAC,gBAAgB,EAAE;KAC3G,EACD,SAAS,CACV,CAAC;AACJ,CAAC;AAbD,gEAaC"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ioc/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,+BAA+B;IAE9C,eAAe,EAAE,eAAe,CAAC;CAClC"}
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ioc/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ioc/types.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="bunyan" />
2
+ import { CompiledTemplate, ICache, ITemplateRepository, LayoutId, ILayoutNotFound } from '@rocketmakers/orbit-template-core';
3
+ import { IOrbitResponse } from '@rocketmakers/orbit-core';
4
+ import { Logger } from '@rocketmakers/log';
5
+ export declare class TemplateService {
6
+ private templateRepository;
7
+ private logger;
8
+ constructor(templateRepository: ITemplateRepository, logger: Logger);
9
+ private cache;
10
+ getCache(): Promise<ICache | undefined>;
11
+ initCache(): IOrbitResponse<ICache>;
12
+ private prepareHandlebars;
13
+ updateCache(): IOrbitResponse<ICache>;
14
+ renderLayoutTemplates<TPayload>(layoutId: LayoutId, payload: TPayload): IOrbitResponse<CompiledTemplate[], ILayoutNotFound>;
15
+ }
16
+ //# sourceMappingURL=templateService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templateService.d.ts","sourceRoot":"","sources":["../../src/services/templateService.ts"],"names":[],"mappings":";AACA,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,mBAAmB,EACnB,QAAQ,EAER,eAAe,EAEhB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,cAAc,EAEf,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAM3C,qBAAa,eAAe;IAEd,OAAO,CAAC,kBAAkB;IAAuB,OAAO,CAAC,MAAM;gBAAvD,kBAAkB,EAAE,mBAAmB,EAAU,MAAM,EAAE,MAAM;IAEnF,OAAO,CAAC,KAAK,CAAmB;IAMnB,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAcvC,SAAS,IAAI,cAAc,CAAC,MAAM,CAAC;YAelC,iBAAiB;IAsBlB,WAAW,IAAI,cAAc,CAAC,MAAM,CAAC;IAmBrC,qBAAqB,CAAC,QAAQ,EACzC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,QAAQ,GAChB,cAAc,CAAC,gBAAgB,EAAE,EAAE,eAAe,CAAC;CA0CvD"}
@@ -2,13 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TemplateService = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const orbit_template_core_1 = require("@rocketmakers/orbit-template-core");
6
+ const orbit_core_1 = require("@rocketmakers/orbit-core");
5
7
  const handlebars = require("handlebars");
6
8
  const Ajv = require("ajv");
7
- const orbit_core_1 = require("@rocketmakers/orbit-core");
8
9
  const core_1 = require("../core");
9
10
  class TemplateService {
10
- constructor(templateRepository) {
11
+ constructor(templateRepository, logger) {
11
12
  this.templateRepository = templateRepository;
13
+ this.logger = logger;
12
14
  }
13
15
  getCache() {
14
16
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
@@ -22,47 +24,41 @@ class TemplateService {
22
24
  initCache() {
23
25
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
26
  if (this.cache) {
25
- return this.cache;
27
+ return { kind: 'ok', result: yield this.cache };
26
28
  }
27
- const updateFunctions = [];
28
- const { partials, layouts } = yield this.templateRepository.getInitialCache();
29
+ const newCache = yield this.templateRepository.getInitialCache();
29
30
  this.cache = new Promise((resolve) => tslib_1.__awaiter(this, void 0, void 0, function* () {
30
- for (const partial in partials) {
31
- updateFunctions.push(() => handlebars.registerPartial(partial, partials[partial]));
32
- }
33
- for (const layout in layouts) {
34
- layouts[layout].forEach(template => {
35
- updateFunctions.push(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
36
- handlebars.precompile(template.content, { strict: true });
37
- }));
38
- });
39
- }
40
- yield updateFunctions.forEach(fn => fn());
41
- resolve({ partials, layouts });
31
+ yield this.prepareHandlebars(newCache);
32
+ resolve(newCache);
42
33
  }));
43
- return this.cache;
34
+ return { kind: 'ok', result: yield this.cache };
44
35
  });
45
36
  }
46
- updateCache() {
37
+ prepareHandlebars(cache) {
47
38
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
48
39
  const updateFunctions = [];
40
+ for (const partial in cache.partials) {
41
+ updateFunctions.push(() => tslib_1.__awaiter(this, void 0, void 0, function* () { return handlebars.registerPartial(partial, cache.partials[partial]); }));
42
+ }
43
+ for (const layout in cache.layouts) {
44
+ cache.layouts[layout].forEach(template => {
45
+ updateFunctions.push(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
46
+ handlebars.precompile(template.content, { strict: true });
47
+ }));
48
+ });
49
+ }
50
+ yield Promise.all(updateFunctions.map(fn => fn()));
51
+ });
52
+ }
53
+ updateCache() {
54
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
49
55
  const currentCache = yield this.cache;
50
56
  this.cache = new Promise((resolve) => tslib_1.__awaiter(this, void 0, void 0, function* () {
51
- const { partials, layouts } = yield this.templateRepository.getUpdatedCache(currentCache);
52
- for (const partial in partials) {
53
- updateFunctions.push(() => handlebars.registerPartial(partial, partials[partial]));
54
- }
55
- for (const layout in layouts) {
56
- layouts[layout].forEach(template => {
57
- updateFunctions.push(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- handlebars.precompile(template.content, { strict: true });
59
- }));
60
- });
61
- }
62
- yield updateFunctions.forEach(fn => fn());
63
- resolve({ partials, layouts });
57
+ const newCache = yield this.templateRepository.getUpdatedCache(currentCache);
58
+ yield this.prepareHandlebars(newCache);
59
+ resolve(newCache);
64
60
  }));
65
- return this.cache;
61
+ return { kind: 'ok', result: yield this.cache };
66
62
  });
67
63
  }
68
64
  renderLayoutTemplates(layoutId, payload) {
@@ -82,19 +78,20 @@ class TemplateService {
82
78
  }
83
79
  const currentCache = yield this.cache;
84
80
  if (!currentCache.layouts[validatedLayoutId]) {
85
- throw new orbit_core_1.NotFoundError(`No layout found matching id: ${validatedLayoutId}`);
81
+ return (0, orbit_core_1.buildNotFoundResponse)('Layout', this.logger, `No layout found matching id: ${validatedLayoutId}`);
86
82
  }
87
- const res = currentCache.layouts[validatedLayoutId].map(template => {
88
- const compile = handlebars.compile(template.content, { strict: true });
83
+ const result = currentCache.layouts[validatedLayoutId].map(template => {
89
84
  try {
85
+ const compile = handlebars.compile(template.content, { strict: true });
90
86
  return { name: template.type, compiled: compile(payload) };
91
87
  }
92
88
  catch (error) {
93
- console.error(error);
94
- throw new orbit_core_1.BadRequestError('Provided payload did not successfully compile using target template', error.message);
89
+ this.logger.info(error.message);
90
+ this.logger.info('Provided payload did not successfully compile using target template');
91
+ throw new orbit_core_1.ArgumentValidationError(orbit_template_core_1.PayloadInvalidKind);
95
92
  }
96
93
  });
97
- return res;
94
+ return { kind: 'ok', result };
98
95
  });
99
96
  }
100
97
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template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