@rainbow-o23/n7 1.0.43 → 1.0.45
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 +4 -3
- package/index.js +5 -4
- package/lib/error-codes.d.ts +1 -1
- package/lib/print-word-step.d.ts +0 -1
- package/package.json +5 -5
- package/src/lib/error-codes.ts +4 -2
- package/src/lib/print-word-step.ts +2 -2
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
|
|
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(
|
|
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.
|
|
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
|
|
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(
|
|
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 {
|
|
75
|
+
export { ERR_N7_TEMPLATE_NOT_DEFINED, PrintWordPipelineStep, PrintWordPipelineStepBuilder };
|
package/lib/error-codes.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { O23ReservedErrorCode } from '@rainbow-o23/n1';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ERR_N7_TEMPLATE_NOT_DEFINED: O23ReservedErrorCode;
|
package/lib/print-word-step.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rainbow-o23/n7",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45",
|
|
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.
|
|
25
|
-
"@rainbow-o23/n4": "1.0.
|
|
24
|
+
"@rainbow-o23/n3": "1.0.45",
|
|
25
|
+
"@rainbow-o23/n4": "1.0.45",
|
|
26
26
|
"docx-templates": "^4.11.4"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"rollup-plugin-tslint": "^0.2.2",
|
|
41
41
|
"rollup-plugin-typescript2": "^0.34.1",
|
|
42
42
|
"tslib": "^2.4.1",
|
|
43
|
-
"typescript": "5.
|
|
43
|
+
"typescript": "5.5.4"
|
|
44
44
|
},
|
|
45
45
|
"jest": {
|
|
46
46
|
"moduleFileExtensions": [
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"testEnvironment": "node"
|
|
68
68
|
},
|
|
69
69
|
"volta": {
|
|
70
|
-
"node": "
|
|
70
|
+
"node": "20.17.0",
|
|
71
71
|
"yarn": "1.22.21"
|
|
72
72
|
}
|
|
73
73
|
}
|
package/src/lib/error-codes.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {O23ReservedErrorCode} from '@rainbow-o23/n1';
|
|
1
|
+
import {ErrorCodes, O23ReservedErrorCode} from '@rainbow-o23/n1';
|
|
2
2
|
|
|
3
|
-
export const
|
|
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 {
|
|
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(
|
|
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};
|