@rainbow-o23/n7 1.0.42 → 1.0.44

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.cjs CHANGED
@@ -5,7 +5,8 @@ var n3 = require('@rainbow-o23/n3');
5
5
  var docxTemplates = require('docx-templates');
6
6
  var n4 = require('@rainbow-o23/n4');
7
7
 
8
- const ERR_TEMPLATE_NOT_DEFINED = 'O07-00001';
8
+ const ERR_N7_TEMPLATE_NOT_DEFINED = 'O07-00001';
9
+ n1.ErrorCodes.ERR_N7_TEMPLATE_NOT_DEFINED = ERR_N7_TEMPLATE_NOT_DEFINED;
9
10
 
10
11
  class PrintWordPipelineStep extends n3.AbstractFragmentaryPipelineStep {
11
12
  _cmdDelimiter;
@@ -48,7 +49,7 @@ class PrintWordPipelineStep extends n3.AbstractFragmentaryPipelineStep {
48
49
  }
49
50
  async doPerform(data, _request) {
50
51
  if (data.template == null) {
51
- throw new n1.UncatchableError(ERR_TEMPLATE_NOT_DEFINED, 'Print template cannot be null.');
52
+ throw new n1.UncatchableError(ERR_N7_TEMPLATE_NOT_DEFINED, 'Print template cannot be null.');
52
53
  }
53
54
  const file = await this.printWord(data.template, data.data, data.jsContext);
54
55
  return { file };
@@ -73,6 +74,6 @@ class PrintWordPipelineStepBuilder extends n4.AbstractFragmentaryPipelineStepBui
73
74
  }
74
75
  }
75
76
 
76
- exports.ERR_TEMPLATE_NOT_DEFINED = ERR_TEMPLATE_NOT_DEFINED;
77
+ exports.ERR_N7_TEMPLATE_NOT_DEFINED = ERR_N7_TEMPLATE_NOT_DEFINED;
77
78
  exports.PrintWordPipelineStep = PrintWordPipelineStep;
78
79
  exports.PrintWordPipelineStepBuilder = PrintWordPipelineStepBuilder;
package/index.js CHANGED
@@ -1,9 +1,10 @@
1
- import { UncatchableError } from '@rainbow-o23/n1';
1
+ import { ErrorCodes, UncatchableError } from '@rainbow-o23/n1';
2
2
  import { AbstractFragmentaryPipelineStep } from '@rainbow-o23/n3';
3
3
  import { createReport } from 'docx-templates';
4
4
  import { AbstractFragmentaryPipelineStepBuilder } from '@rainbow-o23/n4';
5
5
 
6
- const ERR_TEMPLATE_NOT_DEFINED = 'O07-00001';
6
+ const ERR_N7_TEMPLATE_NOT_DEFINED = 'O07-00001';
7
+ ErrorCodes.ERR_N7_TEMPLATE_NOT_DEFINED = ERR_N7_TEMPLATE_NOT_DEFINED;
7
8
 
8
9
  class PrintWordPipelineStep extends AbstractFragmentaryPipelineStep {
9
10
  _cmdDelimiter;
@@ -46,7 +47,7 @@ class PrintWordPipelineStep extends AbstractFragmentaryPipelineStep {
46
47
  }
47
48
  async doPerform(data, _request) {
48
49
  if (data.template == null) {
49
- throw new UncatchableError(ERR_TEMPLATE_NOT_DEFINED, 'Print template cannot be null.');
50
+ throw new UncatchableError(ERR_N7_TEMPLATE_NOT_DEFINED, 'Print template cannot be null.');
50
51
  }
51
52
  const file = await this.printWord(data.template, data.data, data.jsContext);
52
53
  return { file };
@@ -71,4 +72,4 @@ class PrintWordPipelineStepBuilder extends AbstractFragmentaryPipelineStepBuilde
71
72
  }
72
73
  }
73
74
 
74
- export { ERR_TEMPLATE_NOT_DEFINED, PrintWordPipelineStep, PrintWordPipelineStepBuilder };
75
+ export { ERR_N7_TEMPLATE_NOT_DEFINED, PrintWordPipelineStep, PrintWordPipelineStepBuilder };
@@ -1,2 +1,2 @@
1
1
  import { O23ReservedErrorCode } from '@rainbow-o23/n1';
2
- export declare const ERR_TEMPLATE_NOT_DEFINED: O23ReservedErrorCode;
2
+ export declare const ERR_N7_TEMPLATE_NOT_DEFINED: O23ReservedErrorCode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rainbow-o23/n7",
3
- "version": "1.0.42",
3
+ "version": "1.0.44",
4
4
  "description": "o23 word print",
5
5
  "main": "index.cjs",
6
6
  "module": "index.js",
@@ -21,8 +21,8 @@
21
21
  "url": "https://github.com/InsureMO/rainbow-o23/issues"
22
22
  },
23
23
  "dependencies": {
24
- "@rainbow-o23/n3": "1.0.42",
25
- "@rainbow-o23/n4": "1.0.42",
24
+ "@rainbow-o23/n3": "1.0.44",
25
+ "@rainbow-o23/n4": "1.0.44",
26
26
  "docx-templates": "^4.11.4"
27
27
  },
28
28
  "devDependencies": {
@@ -1,3 +1,5 @@
1
- import {O23ReservedErrorCode} from '@rainbow-o23/n1';
1
+ import {ErrorCodes, O23ReservedErrorCode} from '@rainbow-o23/n1';
2
2
 
3
- export const ERR_TEMPLATE_NOT_DEFINED: O23ReservedErrorCode = 'O07-00001';
3
+ export const ERR_N7_TEMPLATE_NOT_DEFINED: O23ReservedErrorCode = 'O07-00001';
4
+
5
+ ErrorCodes.ERR_N7_TEMPLATE_NOT_DEFINED = ERR_N7_TEMPLATE_NOT_DEFINED;
@@ -2,7 +2,7 @@ import {PipelineStepData, PipelineStepPayload, UncatchableError} from '@rainbow-
2
2
  import {AbstractFragmentaryPipelineStep, FragmentaryPipelineStepOptions} from '@rainbow-o23/n3';
3
3
  import {createReport} from 'docx-templates';
4
4
  import {UserOptions} from 'docx-templates/lib/types';
5
- import {ERR_TEMPLATE_NOT_DEFINED} from './error-codes';
5
+ import {ERR_N7_TEMPLATE_NOT_DEFINED} from './error-codes';
6
6
 
7
7
  export interface PrintWordPipelineStepOptions<In = PipelineStepPayload, Out = PipelineStepPayload, InFragment = In, OutFragment = Out>
8
8
  extends FragmentaryPipelineStepOptions<In, Out, InFragment, OutFragment> {
@@ -76,7 +76,7 @@ export class PrintWordPipelineStep<In = PipelineStepPayload, Out = PipelineStepP
76
76
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
77
77
  protected async doPerform(data: PrintWordPipelineStepInFragment, _request: PipelineStepData<In>): Promise<PrintWordPipelineStepOutFragment> {
78
78
  if (data.template == null) {
79
- throw new UncatchableError(ERR_TEMPLATE_NOT_DEFINED, 'Print template cannot be null.');
79
+ throw new UncatchableError(ERR_N7_TEMPLATE_NOT_DEFINED, 'Print template cannot be null.');
80
80
  }
81
81
  const file = await this.printWord(data.template, data.data, data.jsContext);
82
82
  return {file};