@driveflux/pdf 4.0.39 → 4.0.40

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 (42) hide show
  1. package/dist/__mocks__/quotation.js +11 -10
  2. package/dist/__mocks__/subscription.js +121 -379
  3. package/dist/__mocks__/tou.js +10 -9
  4. package/dist/components/FluxLogo.js +3 -62
  5. package/dist/components/StandardPage.js +10 -99
  6. package/dist/debug.js +26 -205
  7. package/dist/index.js +1 -0
  8. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +27 -145
  9. package/dist/templates/QuotationPdf/GFV.js +12 -49
  10. package/dist/templates/QuotationPdf/Header.js +5 -63
  11. package/dist/templates/QuotationPdf/Pricing.js +201 -573
  12. package/dist/templates/QuotationPdf/QuotationPdfPage.js +3 -23
  13. package/dist/templates/QuotationPdf/SectionBoxNew.js +4 -34
  14. package/dist/templates/QuotationPdf/TermsSection.js +5 -42
  15. package/dist/templates/QuotationPdf/VehiclePhotos.js +24 -54
  16. package/dist/templates/QuotationPdf/index.js +10 -189
  17. package/dist/templates/QuotationPdf/translations.js +22 -34
  18. package/dist/templates/QuotationPdf/utils.d.ts +3 -3
  19. package/dist/templates/QuotationPdf/utils.d.ts.map +1 -1
  20. package/dist/templates/QuotationPdf/utils.js +49 -83
  21. package/dist/templates/QuotationPdf/utils.js.map +1 -1
  22. package/dist/templates/SubscriptionAgreement/Confirmation.js +10 -65
  23. package/dist/templates/SubscriptionAgreement/CoverPage.js +10 -93
  24. package/dist/templates/SubscriptionAgreement/CoverPageSection.js +5 -16
  25. package/dist/templates/SubscriptionAgreement/Details.js +59 -139
  26. package/dist/templates/SubscriptionAgreement/Footer.js +6 -48
  27. package/dist/templates/SubscriptionAgreement/Header.js +5 -35
  28. package/dist/templates/SubscriptionAgreement/LabelValue.js +3 -25
  29. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +3 -26
  30. package/dist/templates/SubscriptionAgreement/TermsOfUse.js +8 -94
  31. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +11 -97
  32. package/dist/templates/SubscriptionAgreement/index.js +15 -245
  33. package/dist/templates/SubscriptionAgreement/translations.js +194 -195
  34. package/dist/templates/SubscriptionAgreement/types.js +2 -1
  35. package/dist/templates/SubscriptionAgreement/utils.js +11 -16
  36. package/dist/templates/index.js +1 -0
  37. package/dist/theme/colors.js +63 -44
  38. package/dist/theme/index.js +1 -0
  39. package/dist/types.js +2 -1
  40. package/dist/utils.js +16 -159
  41. package/dist/watch.js +4 -3
  42. package/package.json +2 -2
@@ -1,22 +1,23 @@
1
- export var mockTermsOfUse = {
1
+ export const mockTermsOfUse = {
2
2
  items: [
3
3
  {
4
4
  content: 'Terms of Use',
5
5
  items: [
6
6
  {
7
7
  content: 'These Terms of ***Use*** are NOT no yes defined and govern the relationship, rules and regulations of the interactions by FLUX and its Members.',
8
- items: []
9
- }
10
- ]
8
+ items: [],
9
+ },
10
+ ],
11
11
  },
12
12
  {
13
13
  content: 'Introduction',
14
14
  items: [
15
15
  {
16
16
  content: 'FLUX is an online business functioning as a technology provider that facilitates vehicle subscriptions.',
17
- items: []
18
- }
19
- ]
20
- }
21
- ]
17
+ items: [],
18
+ },
19
+ ],
20
+ },
21
+ ],
22
22
  };
23
+ //# sourceMappingURL=tou.js.map
@@ -1,66 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Defs, G, Path, Rect, Svg } from '@react-pdf/renderer';
3
- var FluxLogo = function() {
4
- return /*#__PURE__*/ _jsxs(Svg, {
5
- width: "92",
6
- height: "29",
7
- viewBox: "0 0 92 29",
8
- fill: "none",
9
- children: [
10
- /*#__PURE__*/ _jsxs(G, {
11
- clipPath: "url(#clip0_664_102105)",
12
- children: [
13
- /*#__PURE__*/ _jsx(Path, {
14
- d: "M23.6621 6.12305H35.6903V8.00999H25.5568V13.5529H33.805V15.434H25.5568V22.8638H23.6715L23.6621 6.12305Z",
15
- fill: "black"
16
- }),
17
- /*#__PURE__*/ _jsx(Path, {
18
- d: "M40.9981 6.12305H42.8834V20.9827H52.3039V22.8697H40.9922L40.9981 6.12305Z",
19
- fill: "black"
20
- }),
21
- /*#__PURE__*/ _jsx(Path, {
22
- d: "M57.6172 15.6002V6.12305H59.5025V15.4811C59.5025 19.0946 61.4149 21.129 64.6187 21.129C67.7035 21.129 69.6642 19.2621 69.6642 15.6002V6.12305H71.5495V15.4552C71.5495 20.3376 68.751 22.8744 64.5669 22.8744C60.4381 22.8756 57.6172 20.3388 57.6172 15.6002Z",
23
- fill: "black"
24
- }),
25
- /*#__PURE__*/ _jsx(Path, {
26
- d: "M83.2965 14.3324L77.1033 6.12305H79.3338L84.4736 12.9632L89.5663 6.12305H91.7674L85.5742 14.3077L92.0054 22.8756H89.7525L84.4006 15.6722L79.0451 22.8756H76.8594L83.2965 14.3324Z",
27
- fill: "black"
28
- }),
29
- /*#__PURE__*/ _jsx(Path, {
30
- opacity: "0.3",
31
- d: "M3.05934 17.5614C2.45475 17.5598 1.86415 17.3792 1.36192 17.0423C0.859683 16.7054 0.468271 16.2273 0.23697 15.6682C0.00566877 15.1091 -0.0551799 14.494 0.0620863 13.9004C0.179353 13.3068 0.469491 12.7611 0.895964 12.3322L12.3256 0.892604C12.909 0.364801 13.6728 0.0817665 14.459 0.102098C15.2452 0.12243 15.9934 0.444573 16.5488 1.00183C17.1042 1.55908 17.4243 2.30877 17.4426 3.09567C17.461 3.88257 17.1764 4.64641 16.6476 5.22904L5.218 16.6686C4.93441 16.9521 4.59781 17.1768 4.22742 17.33C3.85703 17.4832 3.46011 17.5618 3.05934 17.5614Z",
32
- fill: "#50C8E8"
33
- }),
34
- /*#__PURE__*/ _jsx(Path, {
35
- opacity: "0.3",
36
- d: "M8.77458 23.28C8.16964 23.2788 7.57859 23.0985 7.07593 22.7616C6.57326 22.4248 6.18149 21.9465 5.94999 21.3871C5.7185 20.8277 5.65764 20.2123 5.7751 19.6183C5.89256 19.0244 6.18308 18.4786 6.61002 18.0496L12.3213 12.3334C12.6004 12.027 12.9387 11.7804 13.3158 11.6086C13.6928 11.4368 14.1008 11.3433 14.5149 11.3338C14.9291 11.3243 15.3409 11.399 15.7254 11.5533C16.1099 11.7076 16.4592 11.9384 16.752 12.2317C17.0449 12.525 17.2753 12.8746 17.4293 13.2596C17.5832 13.6445 17.6576 14.0567 17.6479 14.4712C17.6382 14.8858 17.5446 15.294 17.3727 15.6713C17.2008 16.0486 16.9543 16.3871 16.648 16.6663L10.9368 22.3837C10.653 22.6681 10.3159 22.8936 9.94489 23.0474C9.57386 23.2013 9.17617 23.2803 8.77458 23.28Z",
37
- fill: "#50C8E8"
38
- }),
39
- /*#__PURE__*/ _jsx(Path, {
40
- d: "M14.4866 29.0001C16.176 29.0001 17.5455 27.6294 17.5455 25.9385C17.5455 24.2477 16.176 22.877 14.4866 22.877C12.7972 22.877 11.4277 24.2477 11.4277 25.9385C11.4277 27.6294 12.7972 29.0001 14.4866 29.0001Z",
41
- fill: "#50C8E8"
42
- }),
43
- /*#__PURE__*/ _jsx(Path, {
44
- d: "M14.4866 6.12314C16.176 6.12314 17.5455 4.75243 17.5455 3.06157C17.5455 1.37071 16.176 0 14.4866 0C12.7972 0 11.4277 1.37071 11.4277 3.06157C11.4277 4.75243 12.7972 6.12314 14.4866 6.12314Z",
45
- fill: "#50C8E8"
46
- }),
47
- /*#__PURE__*/ _jsx(Path, {
48
- d: "M14.4866 17.5616C16.176 17.5616 17.5455 16.1909 17.5455 14.5C17.5455 12.8092 16.176 11.4385 14.4866 11.4385C12.7972 11.4385 11.4277 12.8092 11.4277 14.5C11.4277 16.1909 12.7972 17.5616 14.4866 17.5616Z",
49
- fill: "#50C8E8"
50
- })
51
- ]
52
- }),
53
- /*#__PURE__*/ _jsx(Defs, {
54
- children: /*#__PURE__*/ _jsx("clipPath", {
55
- id: "clip0_664_102105",
56
- children: /*#__PURE__*/ _jsx(Rect, {
57
- width: "92",
58
- height: "29",
59
- fill: "white"
60
- })
61
- })
62
- })
63
- ]
64
- });
3
+ const FluxLogo = () => {
4
+ return (_jsxs(Svg, { width: "92", height: "29", viewBox: "0 0 92 29", fill: "none", children: [_jsxs(G, { clipPath: "url(#clip0_664_102105)", children: [_jsx(Path, { d: "M23.6621 6.12305H35.6903V8.00999H25.5568V13.5529H33.805V15.434H25.5568V22.8638H23.6715L23.6621 6.12305Z", fill: "black" }), _jsx(Path, { d: "M40.9981 6.12305H42.8834V20.9827H52.3039V22.8697H40.9922L40.9981 6.12305Z", fill: "black" }), _jsx(Path, { d: "M57.6172 15.6002V6.12305H59.5025V15.4811C59.5025 19.0946 61.4149 21.129 64.6187 21.129C67.7035 21.129 69.6642 19.2621 69.6642 15.6002V6.12305H71.5495V15.4552C71.5495 20.3376 68.751 22.8744 64.5669 22.8744C60.4381 22.8756 57.6172 20.3388 57.6172 15.6002Z", fill: "black" }), _jsx(Path, { d: "M83.2965 14.3324L77.1033 6.12305H79.3338L84.4736 12.9632L89.5663 6.12305H91.7674L85.5742 14.3077L92.0054 22.8756H89.7525L84.4006 15.6722L79.0451 22.8756H76.8594L83.2965 14.3324Z", fill: "black" }), _jsx(Path, { opacity: "0.3", d: "M3.05934 17.5614C2.45475 17.5598 1.86415 17.3792 1.36192 17.0423C0.859683 16.7054 0.468271 16.2273 0.23697 15.6682C0.00566877 15.1091 -0.0551799 14.494 0.0620863 13.9004C0.179353 13.3068 0.469491 12.7611 0.895964 12.3322L12.3256 0.892604C12.909 0.364801 13.6728 0.0817665 14.459 0.102098C15.2452 0.12243 15.9934 0.444573 16.5488 1.00183C17.1042 1.55908 17.4243 2.30877 17.4426 3.09567C17.461 3.88257 17.1764 4.64641 16.6476 5.22904L5.218 16.6686C4.93441 16.9521 4.59781 17.1768 4.22742 17.33C3.85703 17.4832 3.46011 17.5618 3.05934 17.5614Z", fill: "#50C8E8" }), _jsx(Path, { opacity: "0.3", d: "M8.77458 23.28C8.16964 23.2788 7.57859 23.0985 7.07593 22.7616C6.57326 22.4248 6.18149 21.9465 5.94999 21.3871C5.7185 20.8277 5.65764 20.2123 5.7751 19.6183C5.89256 19.0244 6.18308 18.4786 6.61002 18.0496L12.3213 12.3334C12.6004 12.027 12.9387 11.7804 13.3158 11.6086C13.6928 11.4368 14.1008 11.3433 14.5149 11.3338C14.9291 11.3243 15.3409 11.399 15.7254 11.5533C16.1099 11.7076 16.4592 11.9384 16.752 12.2317C17.0449 12.525 17.2753 12.8746 17.4293 13.2596C17.5832 13.6445 17.6576 14.0567 17.6479 14.4712C17.6382 14.8858 17.5446 15.294 17.3727 15.6713C17.2008 16.0486 16.9543 16.3871 16.648 16.6663L10.9368 22.3837C10.653 22.6681 10.3159 22.8936 9.94489 23.0474C9.57386 23.2013 9.17617 23.2803 8.77458 23.28Z", fill: "#50C8E8" }), _jsx(Path, { d: "M14.4866 29.0001C16.176 29.0001 17.5455 27.6294 17.5455 25.9385C17.5455 24.2477 16.176 22.877 14.4866 22.877C12.7972 22.877 11.4277 24.2477 11.4277 25.9385C11.4277 27.6294 12.7972 29.0001 14.4866 29.0001Z", fill: "#50C8E8" }), _jsx(Path, { d: "M14.4866 6.12314C16.176 6.12314 17.5455 4.75243 17.5455 3.06157C17.5455 1.37071 16.176 0 14.4866 0C12.7972 0 11.4277 1.37071 11.4277 3.06157C11.4277 4.75243 12.7972 6.12314 14.4866 6.12314Z", fill: "#50C8E8" }), _jsx(Path, { d: "M14.4866 17.5616C16.176 17.5616 17.5455 16.1909 17.5455 14.5C17.5455 12.8092 16.176 11.4385 14.4866 11.4385C12.7972 11.4385 11.4277 12.8092 11.4277 14.5C11.4277 16.1909 12.7972 17.5616 14.4866 17.5616Z", fill: "#50C8E8" })] }), _jsx(Defs, { children: _jsx("clipPath", { id: "clip0_664_102105", children: _jsx(Rect, { width: "92", height: "29", fill: "white" }) }) })] }));
65
5
  };
66
6
  export default FluxLogo;
7
+ //# sourceMappingURL=FluxLogo.js.map
@@ -1,82 +1,3 @@
1
- function _define_property(obj, key, value) {
2
- if (key in obj) {
3
- Object.defineProperty(obj, key, {
4
- value: value,
5
- enumerable: true,
6
- configurable: true,
7
- writable: true
8
- });
9
- } else {
10
- obj[key] = value;
11
- }
12
- return obj;
13
- }
14
- function _object_spread(target) {
15
- for(var i = 1; i < arguments.length; i++){
16
- var source = arguments[i] != null ? arguments[i] : {};
17
- var ownKeys = Object.keys(source);
18
- if (typeof Object.getOwnPropertySymbols === "function") {
19
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
- }));
22
- }
23
- ownKeys.forEach(function(key) {
24
- _define_property(target, key, source[key]);
25
- });
26
- }
27
- return target;
28
- }
29
- function ownKeys(object, enumerableOnly) {
30
- var keys = Object.keys(object);
31
- if (Object.getOwnPropertySymbols) {
32
- var symbols = Object.getOwnPropertySymbols(object);
33
- if (enumerableOnly) {
34
- symbols = symbols.filter(function(sym) {
35
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
36
- });
37
- }
38
- keys.push.apply(keys, symbols);
39
- }
40
- return keys;
41
- }
42
- function _object_spread_props(target, source) {
43
- source = source != null ? source : {};
44
- if (Object.getOwnPropertyDescriptors) {
45
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
46
- } else {
47
- ownKeys(Object(source)).forEach(function(key) {
48
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
49
- });
50
- }
51
- return target;
52
- }
53
- function _object_without_properties(source, excluded) {
54
- if (source == null) return {};
55
- var target = _object_without_properties_loose(source, excluded);
56
- var key, i;
57
- if (Object.getOwnPropertySymbols) {
58
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
59
- for(i = 0; i < sourceSymbolKeys.length; i++){
60
- key = sourceSymbolKeys[i];
61
- if (excluded.indexOf(key) >= 0) continue;
62
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
63
- target[key] = source[key];
64
- }
65
- }
66
- return target;
67
- }
68
- function _object_without_properties_loose(source, excluded) {
69
- if (source == null) return {};
70
- var target = {};
71
- var sourceKeys = Object.keys(source);
72
- var key, i;
73
- for(i = 0; i < sourceKeys.length; i++){
74
- key = sourceKeys[i];
75
- if (excluded.indexOf(key) >= 0) continue;
76
- target[key] = source[key];
77
- }
78
- return target;
79
- }
80
1
  import { jsx as _jsx } from "react/jsx-runtime";
81
2
  import { Font, Page } from '@react-pdf/renderer';
82
3
  Font.register({
@@ -84,40 +5,30 @@ Font.register({
84
5
  fonts: [
85
6
  {
86
7
  src: 'https://fonts.gstatic.com/s/figtree/v8/_Xmz-HUzqDCFdgfMsYiV_F7wfS-Bs_d_QF5e.ttf',
87
- fontWeight: 'normal'
8
+ fontWeight: 'normal',
88
9
  },
89
10
  {
90
11
  src: 'https://fonts.gstatic.com/s/figtree/v8/_Xmz-HUzqDCFdgfMsYiV_F7wfS-Bs_eYR15e.ttf',
91
- fontWeight: 'bold'
12
+ fontWeight: 'bold',
92
13
  },
93
14
  {
94
15
  src: 'https://fonts.gstatic.com/s/figtree/v8/_Xm9-HUzqDCFdgfMm4GnA4aZFrUvtOK3A7YdyEU.ttf',
95
16
  fontWeight: 'normal',
96
- fontStyle: 'italic'
17
+ fontStyle: 'italic',
97
18
  },
98
19
  {
99
20
  src: 'https://fonts.gstatic.com/s/figtree/v8/_Xm9-HUzqDCFdgfMm4GnA4aZFrUvtOK3A1EayEU.ttf',
100
21
  fontWeight: 'bold',
101
- fontStyle: 'italic'
102
- }
103
- ]
22
+ fontStyle: 'italic',
23
+ },
24
+ ],
104
25
  });
105
26
  Font.register({
106
27
  family: 'Allura',
107
- src: 'https://fonts.gstatic.com/s/allura/v21/9oRPNYsQpS4zjuAPjAIXPtrrGA.ttf'
28
+ src: 'https://fonts.gstatic.com/s/allura/v21/9oRPNYsQpS4zjuAPjAIXPtrrGA.ttf',
108
29
  });
109
- var StandardDocument = function(_param) {
110
- var children = _param.children, style = _param.style, props = _object_without_properties(_param, [
111
- "children",
112
- "style"
113
- ]);
114
- return /*#__PURE__*/ _jsx(Page, _object_spread_props(_object_spread({
115
- style: _object_spread({
116
- fontFamily: 'Figtree',
117
- fontStyle: 'normal'
118
- }, style)
119
- }, props), {
120
- children: children
121
- }));
30
+ const StandardDocument = ({ children, style, ...props }) => {
31
+ return (_jsx(Page, { style: { fontFamily: 'Figtree', fontStyle: 'normal', ...style }, ...props, children: children }));
122
32
  };
123
33
  export default StandardDocument;
34
+ //# sourceMappingURL=StandardPage.js.map
package/dist/debug.js CHANGED
@@ -1,220 +1,41 @@
1
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
- try {
3
- var info = gen[key](arg);
4
- var value = info.value;
5
- } catch (error) {
6
- reject(error);
7
- return;
8
- }
9
- if (info.done) {
10
- resolve(value);
11
- } else {
12
- Promise.resolve(value).then(_next, _throw);
13
- }
14
- }
15
- function _async_to_generator(fn) {
16
- return function() {
17
- var self = this, args = arguments;
18
- return new Promise(function(resolve, reject) {
19
- var gen = fn.apply(self, args);
20
- function _next(value) {
21
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
- }
23
- function _throw(err) {
24
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
- }
26
- _next(undefined);
27
- });
28
- };
29
- }
30
- function _ts_generator(thisArg, body) {
31
- var f, y, t, _ = {
32
- label: 0,
33
- sent: function() {
34
- if (t[0] & 1) throw t[1];
35
- return t[1];
36
- },
37
- trys: [],
38
- ops: []
39
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
40
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
41
- return this;
42
- }), g;
43
- function verb(n) {
44
- return function(v) {
45
- return step([
46
- n,
47
- v
48
- ]);
49
- };
50
- }
51
- function step(op) {
52
- if (f) throw new TypeError("Generator is already executing.");
53
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
54
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
55
- if (y = 0, t) op = [
56
- op[0] & 2,
57
- t.value
58
- ];
59
- switch(op[0]){
60
- case 0:
61
- case 1:
62
- t = op;
63
- break;
64
- case 4:
65
- _.label++;
66
- return {
67
- value: op[1],
68
- done: false
69
- };
70
- case 5:
71
- _.label++;
72
- y = op[1];
73
- op = [
74
- 0
75
- ];
76
- continue;
77
- case 7:
78
- op = _.ops.pop();
79
- _.trys.pop();
80
- continue;
81
- default:
82
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
- _ = 0;
84
- continue;
85
- }
86
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
- _.label = op[1];
88
- break;
89
- }
90
- if (op[0] === 6 && _.label < t[1]) {
91
- _.label = t[1];
92
- t = op;
93
- break;
94
- }
95
- if (t && _.label < t[2]) {
96
- _.label = t[2];
97
- _.ops.push(op);
98
- break;
99
- }
100
- if (t[2]) _.ops.pop();
101
- _.trys.pop();
102
- continue;
103
- }
104
- op = body.call(thisArg, _);
105
- } catch (e) {
106
- op = [
107
- 6,
108
- e
109
- ];
110
- y = 0;
111
- } finally{
112
- f = t = 0;
113
- }
114
- if (op[0] & 5) throw op[1];
115
- return {
116
- value: op[0] ? op[1] : void 0,
117
- done: true
118
- };
119
- }
120
- }
121
1
  import { loadAllEnv } from '@driveflux/env';
122
2
  import { quotation } from './__mocks__/quotation.js';
123
3
  import { signature, subscription } from './__mocks__/subscription.js';
124
4
  import { mockTermsOfUse } from './__mocks__/tou.js';
125
5
  import { generateQuotationPdf } from './templates/index.js';
126
6
  import { generateSubscriptionAgreementPdf } from './templates/SubscriptionAgreement/index.js';
127
- var debugSubscriptionAgreement = function() {
128
- return _async_to_generator(function() {
129
- return _ts_generator(this, function(_state) {
130
- switch(_state.label){
131
- case 0:
132
- if (!subscription) {
133
- console.error('no such subscription');
134
- return [
135
- 2
136
- ];
137
- }
138
- return [
139
- 4,
140
- generateSubscriptionAgreementPdf({
141
- subscription: subscription,
142
- termsOfUse: mockTermsOfUse,
143
- signature: signature
144
- }, "".concat(process.cwd(), "/output/subscription-agreement.pdf"))
145
- ];
146
- case 1:
147
- _state.sent();
148
- return [
149
- 2
150
- ];
151
- }
152
- });
153
- })();
7
+ const debugSubscriptionAgreement = async () => {
8
+ if (!subscription) {
9
+ console.error('no such subscription');
10
+ return;
11
+ }
12
+ await generateSubscriptionAgreementPdf({ subscription, termsOfUse: mockTermsOfUse, signature }, `${process.cwd()}/output/subscription-agreement.pdf`);
154
13
  };
155
- var debugQuotation = function() {
156
- return _async_to_generator(function() {
157
- return _ts_generator(this, function(_state) {
158
- switch(_state.label){
159
- case 0:
160
- if (!quotation) {
161
- console.error('no such quotation');
162
- return [
163
- 2
164
- ];
165
- }
166
- return [
167
- 4,
168
- generateQuotationPdf({
169
- quotation: quotation
170
- }, "".concat(process.cwd(), "/output/quotation.pdf"))
171
- ];
172
- case 1:
173
- _state.sent();
174
- return [
175
- 2
176
- ];
177
- }
178
- });
179
- })();
14
+ const debugQuotation = async () => {
15
+ if (!quotation) {
16
+ console.error('no such quotation');
17
+ return;
18
+ }
19
+ await generateQuotationPdf({ quotation }, `${process.cwd()}/output/quotation.pdf`);
180
20
  };
181
21
  //! put all the debugging functions here
182
- var debugCases = [
22
+ const debugCases = [
183
23
  debugSubscriptionAgreement(),
184
- debugQuotation()
24
+ debugQuotation(),
185
25
  ];
186
- var debug = function() {
187
- return _async_to_generator(function() {
188
- var results;
189
- return _ts_generator(this, function(_state) {
190
- switch(_state.label){
191
- case 0:
192
- loadAllEnv();
193
- return [
194
- 4,
195
- Promise.allSettled(debugCases)
196
- ];
197
- case 1:
198
- results = _state.sent();
199
- if (results.some(function(res) {
200
- return res.status === 'rejected';
201
- })) {
202
- results.forEach(function(res, i) {
203
- if (res.status === 'rejected') {
204
- console.error("debug no ".concat(i + 1, " error:"), res.reason);
205
- }
206
- });
207
- return [
208
- 2
209
- ];
210
- }
211
- console.log('Generated all PDFs successfully!');
212
- console.log("You can view them in the 'output' folder!");
213
- return [
214
- 2
215
- ];
26
+ const debug = async () => {
27
+ loadAllEnv();
28
+ const results = await Promise.allSettled(debugCases);
29
+ if (results.some((res) => res.status === 'rejected')) {
30
+ results.forEach((res, i) => {
31
+ if (res.status === 'rejected') {
32
+ console.error(`debug no ${i + 1} error:`, res.reason);
216
33
  }
217
34
  });
218
- })();
35
+ return;
36
+ }
37
+ console.log('Generated all PDFs successfully!');
38
+ console.log(`You can view them in the 'output' folder!`);
219
39
  };
220
40
  debug();
41
+ //# sourceMappingURL=debug.js.map
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './templates/index.js';
2
2
  export * from './types.js';
3
3
  export * from './utils.js';
4
+ //# sourceMappingURL=index.js.map