@driveflux/pdf 1.2.18-next.1 → 1.2.19
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/dist/__mocks__/subscription.d.ts.map +1 -1
- package/dist/__mocks__/subscription.js +0 -1
- package/dist/templates/QuotationPdf/index.d.ts +1 -1
- package/dist/templates/QuotationPdf/index.d.ts.map +1 -1
- package/dist/templates/SubscriptionAgreement/index.d.ts +1 -1
- package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
- package/dist/utils.d.ts +7 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +31 -7
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/__mocks__/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/__mocks__/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,wBA+zB1B,CAAA"}
|
|
@@ -529,7 +529,6 @@ export var subscription = {
|
|
|
529
529
|
activeSubscriptionId: 'S5Y9TWWSK',
|
|
530
530
|
createdAt: new Date('2024-04-01T08:15:04.448Z'),
|
|
531
531
|
updatedAt: new Date('2024-05-21T07:17:58.621Z'),
|
|
532
|
-
listedAt: new Date('2024-06-21T07:17:58.621Z'),
|
|
533
532
|
metadata: {},
|
|
534
533
|
addresses: {
|
|
535
534
|
return: {
|
|
@@ -4,6 +4,6 @@ type Options = {
|
|
|
4
4
|
locale?: PdfTemplatesSupportedLocales;
|
|
5
5
|
quotation: Quotation;
|
|
6
6
|
};
|
|
7
|
-
export declare const generateQuotationPdf: ({ locale, quotation }: Options, fileName
|
|
7
|
+
export declare const generateQuotationPdf: ({ locale, quotation }: Options, fileName?: string) => Promise<Buffer>;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAclE,KAAK,OAAO,GAAG;IACd,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,SAAS,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,oBAAoB,0BACF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/QuotationPdf/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAclE,KAAK,OAAO,GAAG;IACd,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,SAAS,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,oBAAoB,0BACF,OAAO,aAC1B,MAAM,oBAMjB,CAAA"}
|
|
@@ -9,6 +9,6 @@ type Options = {
|
|
|
9
9
|
locale?: PdfTemplatesSupportedLocales;
|
|
10
10
|
subscription: SubscriptionForAgreement;
|
|
11
11
|
};
|
|
12
|
-
export declare const generateSubscriptionAgreementPdf: ({ locale, subscription }: Options, fileName
|
|
12
|
+
export declare const generateSubscriptionAgreementPdf: ({ locale, subscription }: Options, fileName?: string) => Promise<Buffer>;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,YAAY,EACZ,oBAAoB,EACpB,IAAI,EACJ,OAAO,EACP,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AASlE,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACrD,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAA;CACtC,CAAA;AAED,KAAK,OAAO,GAAG;IACd,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,YAAY,EAAE,wBAAwB,CAAA;CACtC,CAAA;AACD,eAAO,MAAM,gCAAgC,6BACX,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,YAAY,EACZ,oBAAoB,EACpB,IAAI,EACJ,OAAO,EACP,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AASlE,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACrD,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAA;CACtC,CAAA;AAED,KAAK,OAAO,GAAG;IACd,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,YAAY,EAAE,wBAAwB,CAAA;CACtC,CAAA;AACD,eAAO,MAAM,gCAAgC,6BACX,OAAO,aAC7B,MAAM,oBAajB,CAAA"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { DocumentProps } from '@react-pdf/renderer';
|
|
2
2
|
import type { ReactElement } from 'react';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param document React PDF Document element
|
|
6
|
+
* @param fileName DO NOT USE THIS IN NEXT.JS APP, as Vercel does not allow us to amend files. This will generate a PDF file in the given fileName
|
|
7
|
+
* @returns PDF Buffer
|
|
8
|
+
*/
|
|
9
|
+
export declare const toPdf: (document: ReactElement<DocumentProps>, fileName?: string) => Promise<Buffer>;
|
|
4
10
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEzC,eAAO,MAAM,KAAK,aACP,YAAY,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,aACP,YAAY,CAAC,aAAa,CAAC,aAC1B,MAAM,KACf,OAAO,CAAC,MAAM,CAgBhB,CAAA"}
|
package/dist/utils.js
CHANGED
|
@@ -123,23 +123,47 @@ function _ts_generator(thisArg, body) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
import ReactPDF from '@react-pdf/renderer';
|
|
126
|
-
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
* @param document React PDF Document element
|
|
129
|
+
* @param fileName DO NOT USE THIS IN NEXT.JS APP, as Vercel does not allow us to amend files. This will generate a PDF file in the given fileName
|
|
130
|
+
* @returns PDF Buffer
|
|
131
|
+
*/ export var toPdf = function() {
|
|
127
132
|
var _ref = _async_to_generator(function(document, fileName) {
|
|
128
|
-
var
|
|
133
|
+
var stream;
|
|
129
134
|
return _ts_generator(this, function(_state) {
|
|
130
135
|
switch(_state.label){
|
|
131
136
|
case 0:
|
|
137
|
+
if (!fileName) return [
|
|
138
|
+
3,
|
|
139
|
+
2
|
|
140
|
+
];
|
|
132
141
|
return [
|
|
133
142
|
4,
|
|
134
143
|
ReactPDF.renderToFile(document, fileName)
|
|
135
144
|
];
|
|
136
145
|
case 1:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
});
|
|
146
|
+
_state.sent();
|
|
147
|
+
_state.label = 2;
|
|
148
|
+
case 2:
|
|
141
149
|
return [
|
|
142
|
-
|
|
150
|
+
4,
|
|
151
|
+
ReactPDF.renderToStream(document)
|
|
152
|
+
];
|
|
153
|
+
case 3:
|
|
154
|
+
stream = _state.sent();
|
|
155
|
+
return [
|
|
156
|
+
2,
|
|
157
|
+
new Promise(function(resolve, reject) {
|
|
158
|
+
var buffers = [];
|
|
159
|
+
stream.on('data', function(data) {
|
|
160
|
+
buffers.push(data);
|
|
161
|
+
});
|
|
162
|
+
stream.on('end', function() {
|
|
163
|
+
resolve(Buffer.concat(buffers));
|
|
164
|
+
});
|
|
165
|
+
stream.on('error', reject);
|
|
166
|
+
})
|
|
143
167
|
];
|
|
144
168
|
}
|
|
145
169
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@driveflux/pdf",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@driveflux/db": "1.
|
|
16
|
-
"@driveflux/env": "1.2.
|
|
17
|
-
"@driveflux/format-money": "5.2.
|
|
18
|
-
"@driveflux/time": "4.2.
|
|
15
|
+
"@driveflux/db": "1.5.12",
|
|
16
|
+
"@driveflux/env": "1.2.0",
|
|
17
|
+
"@driveflux/format-money": "5.2.0",
|
|
18
|
+
"@driveflux/time": "4.2.0",
|
|
19
19
|
"@react-pdf/renderer": "^3.4.4",
|
|
20
20
|
"date-fns": "^3.6.0",
|
|
21
21
|
"nodemon": "^3.1.4",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/preset-env": "^7.24.8",
|
|
26
|
-
"@driveflux/fab": "2.2.
|
|
27
|
-
"@driveflux/tsconfig": "1.2.
|
|
26
|
+
"@driveflux/fab": "2.2.0",
|
|
27
|
+
"@driveflux/tsconfig": "1.2.0",
|
|
28
28
|
"@swc/cli": "^0.4.0",
|
|
29
29
|
"@swc/core": "1.7.2",
|
|
30
|
-
"@types/node": "^20.14.
|
|
30
|
+
"@types/node": "^20.14.12",
|
|
31
31
|
"@types/react": "^18.3.3",
|
|
32
32
|
"del-cli": "^5.1.0",
|
|
33
33
|
"react": "^18.3.1",
|