@ottoai/documents 1.3.2 → 1.3.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.
- package/dist/create/pdf/united-states/w9-form/form.dto.js +0 -64
- package/dist/create/pdf/united-states/w9-form/form.dto.js.map +1 -1
- package/dist/create/pdf/united-states/w9-form/index.js +57 -11
- package/dist/create/pdf/united-states/w9-form/index.js.map +1 -1
- package/dist/create/pdf/united-states/w9-form/schema.json +12 -12
- package/dist/create/pdf/util/buffer.d.ts +2 -0
- package/dist/create/pdf/util/buffer.js +16 -1
- package/dist/create/pdf/util/buffer.js.map +1 -1
- package/dist/create/pdf/util/pdfme/schemas/text/uiRender.d.ts +1 -1
- package/dist/create/pdf/util/pdfme/schemas/utils.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -10,44 +10,32 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.W9FormDataDto = exports.RequesterDto = exports.AddressDto = void 0;
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
13
|
const class_validator_1 = require("class-validator");
|
|
15
14
|
const pdf_editor_1 = require("../../util/pdf-editor");
|
|
16
15
|
class AddressDto {
|
|
17
16
|
}
|
|
18
17
|
exports.AddressDto = AddressDto;
|
|
19
18
|
__decorate([
|
|
20
|
-
(0, swagger_1.ApiProperty)({ description: "City", example: "New York" }),
|
|
21
19
|
(0, class_validator_1.IsString)(),
|
|
22
20
|
(0, class_validator_1.IsNotEmpty)(),
|
|
23
21
|
__metadata("design:type", Object)
|
|
24
22
|
], AddressDto.prototype, "city", void 0);
|
|
25
23
|
__decorate([
|
|
26
|
-
(0, swagger_1.ApiProperty)({ description: "State", example: "NY" }),
|
|
27
24
|
(0, class_validator_1.IsString)(),
|
|
28
25
|
(0, class_validator_1.IsNotEmpty)(),
|
|
29
26
|
__metadata("design:type", Object)
|
|
30
27
|
], AddressDto.prototype, "state", void 0);
|
|
31
28
|
__decorate([
|
|
32
|
-
(0, swagger_1.ApiProperty)({ description: "Postal code", example: "10001" }),
|
|
33
29
|
(0, class_validator_1.IsString)(),
|
|
34
30
|
(0, class_validator_1.IsNotEmpty)(),
|
|
35
31
|
__metadata("design:type", Object)
|
|
36
32
|
], AddressDto.prototype, "postal_code", void 0);
|
|
37
33
|
__decorate([
|
|
38
|
-
(0, swagger_1.ApiProperty)({
|
|
39
|
-
description: "Primary address line",
|
|
40
|
-
example: "123 Main St",
|
|
41
|
-
}),
|
|
42
34
|
(0, class_validator_1.IsString)(),
|
|
43
35
|
(0, class_validator_1.IsNotEmpty)(),
|
|
44
36
|
__metadata("design:type", Object)
|
|
45
37
|
], AddressDto.prototype, "address_line_1", void 0);
|
|
46
38
|
__decorate([
|
|
47
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
48
|
-
description: "Secondary address line",
|
|
49
|
-
example: "Apt 4B",
|
|
50
|
-
}),
|
|
51
39
|
(0, class_validator_1.IsOptional)(),
|
|
52
40
|
(0, class_validator_1.IsString)(),
|
|
53
41
|
__metadata("design:type", Object)
|
|
@@ -56,13 +44,11 @@ class RequesterDto {
|
|
|
56
44
|
}
|
|
57
45
|
exports.RequesterDto = RequesterDto;
|
|
58
46
|
__decorate([
|
|
59
|
-
(0, swagger_1.ApiProperty)({ description: "Requesting entity name", example: "ACME Corp" }),
|
|
60
47
|
(0, class_validator_1.IsString)(),
|
|
61
48
|
(0, class_validator_1.IsNotEmpty)(),
|
|
62
49
|
__metadata("design:type", String)
|
|
63
50
|
], RequesterDto.prototype, "name", void 0);
|
|
64
51
|
__decorate([
|
|
65
|
-
(0, swagger_1.ApiPropertyOptional)({ description: "Requesting entity address" }),
|
|
66
52
|
(0, class_validator_1.IsOptional)(),
|
|
67
53
|
(0, class_validator_1.IsObject)(),
|
|
68
54
|
__metadata("design:type", AddressDto)
|
|
@@ -71,53 +57,32 @@ class W9FormDataDto {
|
|
|
71
57
|
}
|
|
72
58
|
exports.W9FormDataDto = W9FormDataDto;
|
|
73
59
|
__decorate([
|
|
74
|
-
(0, swagger_1.ApiProperty)({ description: "Full legal name", example: "John Doe" }),
|
|
75
60
|
(0, class_validator_1.IsString)(),
|
|
76
61
|
(0, class_validator_1.IsNotEmpty)(),
|
|
77
62
|
__metadata("design:type", String)
|
|
78
63
|
], W9FormDataDto.prototype, "name", void 0);
|
|
79
64
|
__decorate([
|
|
80
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
81
|
-
description: "Business name if applicable",
|
|
82
|
-
example: "John Doe Inc.",
|
|
83
|
-
}),
|
|
84
65
|
(0, class_validator_1.IsOptional)(),
|
|
85
66
|
(0, class_validator_1.IsString)(),
|
|
86
67
|
__metadata("design:type", String)
|
|
87
68
|
], W9FormDataDto.prototype, "businessName", void 0);
|
|
88
69
|
__decorate([
|
|
89
|
-
(0, swagger_1.ApiProperty)({
|
|
90
|
-
description: "Federal tax classification",
|
|
91
|
-
enum: pdf_editor_1.FedralTaxClassification,
|
|
92
|
-
}),
|
|
93
70
|
(0, class_validator_1.IsEnum)(pdf_editor_1.FedralTaxClassification),
|
|
94
71
|
__metadata("design:type", String)
|
|
95
72
|
], W9FormDataDto.prototype, "fedralTaxClassification", void 0);
|
|
96
73
|
__decorate([
|
|
97
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
98
|
-
description: "Tax classification, required if Federal Tax Classification is LLC",
|
|
99
|
-
enum: pdf_editor_1.TaxClassification,
|
|
100
|
-
}),
|
|
101
74
|
(0, class_validator_1.ValidateIf)((obj) => obj.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.LLC),
|
|
102
75
|
(0, class_validator_1.IsEnum)(pdf_editor_1.TaxClassification),
|
|
103
76
|
(0, class_validator_1.IsNotEmpty)(),
|
|
104
77
|
__metadata("design:type", String)
|
|
105
78
|
], W9FormDataDto.prototype, "taxClassification", void 0);
|
|
106
79
|
__decorate([
|
|
107
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
108
|
-
description: "Other tax classification",
|
|
109
|
-
example: "Other Classification",
|
|
110
|
-
}),
|
|
111
80
|
(0, class_validator_1.ValidateIf)((o) => o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.Other),
|
|
112
81
|
(0, class_validator_1.IsOptional)(),
|
|
113
82
|
(0, class_validator_1.IsString)(),
|
|
114
83
|
__metadata("design:type", String)
|
|
115
84
|
], W9FormDataDto.prototype, "otherTaxClassification", void 0);
|
|
116
85
|
__decorate([
|
|
117
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
118
|
-
description: "Indicates whether there are foreign partners",
|
|
119
|
-
example: true,
|
|
120
|
-
}),
|
|
121
86
|
(0, class_validator_1.ValidateIf)((o) => o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.Partnership ||
|
|
122
87
|
o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.TrustEstate ||
|
|
123
88
|
(o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.LLC &&
|
|
@@ -127,77 +92,48 @@ __decorate([
|
|
|
127
92
|
__metadata("design:type", Boolean)
|
|
128
93
|
], W9FormDataDto.prototype, "isForeignPartners", void 0);
|
|
129
94
|
__decorate([
|
|
130
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
131
|
-
description: "Exemption from backup withholding",
|
|
132
|
-
example: "Exempt",
|
|
133
|
-
}),
|
|
134
95
|
(0, class_validator_1.IsOptional)(),
|
|
135
96
|
(0, class_validator_1.IsString)(),
|
|
136
97
|
__metadata("design:type", String)
|
|
137
98
|
], W9FormDataDto.prototype, "exemptionCode", void 0);
|
|
138
99
|
__decorate([
|
|
139
|
-
(0, swagger_1.ApiProperty)({ description: "Street address" }),
|
|
140
100
|
(0, class_validator_1.IsObject)(),
|
|
141
101
|
(0, class_validator_1.IsNotEmpty)(),
|
|
142
102
|
__metadata("design:type", AddressDto)
|
|
143
103
|
], W9FormDataDto.prototype, "address", void 0);
|
|
144
104
|
__decorate([
|
|
145
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
146
|
-
description: "Account number for specific requester",
|
|
147
|
-
example: "123456789",
|
|
148
|
-
}),
|
|
149
105
|
(0, class_validator_1.IsOptional)(),
|
|
150
106
|
(0, class_validator_1.IsString)(),
|
|
151
107
|
__metadata("design:type", String)
|
|
152
108
|
], W9FormDataDto.prototype, "accountNumber", void 0);
|
|
153
109
|
__decorate([
|
|
154
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
155
|
-
description: "SSN, required if individual",
|
|
156
|
-
example: "123-45-6789",
|
|
157
|
-
}),
|
|
158
110
|
(0, class_validator_1.ValidateIf)((o) => !o.ein),
|
|
159
111
|
(0, class_validator_1.IsOptional)(),
|
|
160
112
|
(0, class_validator_1.IsString)(),
|
|
161
113
|
__metadata("design:type", String)
|
|
162
114
|
], W9FormDataDto.prototype, "ssn", void 0);
|
|
163
115
|
__decorate([
|
|
164
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
165
|
-
description: "EIN, required if business or entity",
|
|
166
|
-
example: "12-3456789",
|
|
167
|
-
}),
|
|
168
116
|
(0, class_validator_1.ValidateIf)((o) => !o.ssn),
|
|
169
117
|
(0, class_validator_1.IsOptional)(),
|
|
170
118
|
(0, class_validator_1.IsString)(),
|
|
171
119
|
__metadata("design:type", String)
|
|
172
120
|
], W9FormDataDto.prototype, "ein", void 0);
|
|
173
121
|
__decorate([
|
|
174
|
-
(0, swagger_1.ApiProperty)({
|
|
175
|
-
description: "Base64-encoded signature image",
|
|
176
|
-
example: "data:image/png;base64,iVBORw0...",
|
|
177
|
-
}),
|
|
178
122
|
(0, class_validator_1.IsString)(),
|
|
179
123
|
(0, class_validator_1.IsNotEmpty)(),
|
|
180
124
|
__metadata("design:type", String)
|
|
181
125
|
], W9FormDataDto.prototype, "signature", void 0);
|
|
182
126
|
__decorate([
|
|
183
|
-
(0, swagger_1.ApiProperty)({ description: "Date of signing", example: "2023-10-01" }),
|
|
184
127
|
(0, class_validator_1.IsDateString)(),
|
|
185
128
|
(0, class_validator_1.IsNotEmpty)(),
|
|
186
129
|
__metadata("design:type", String)
|
|
187
130
|
], W9FormDataDto.prototype, "date", void 0);
|
|
188
131
|
__decorate([
|
|
189
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
190
|
-
description: "FATCA reporting code if applicable",
|
|
191
|
-
example: "A",
|
|
192
|
-
}),
|
|
193
132
|
(0, class_validator_1.IsOptional)(),
|
|
194
133
|
(0, class_validator_1.IsString)(),
|
|
195
134
|
__metadata("design:type", String)
|
|
196
135
|
], W9FormDataDto.prototype, "fatcaCode", void 0);
|
|
197
136
|
__decorate([
|
|
198
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
199
|
-
description: "Details of the entity requesting the W-9 form",
|
|
200
|
-
}),
|
|
201
137
|
(0, class_validator_1.IsOptional)(),
|
|
202
138
|
(0, class_validator_1.IsObject)(),
|
|
203
139
|
__metadata("design:type", RequesterDto)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.dto.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/w9-form/form.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"form.dto.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/w9-form/form.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDASyB;AACzB,sDAG+B;AAG/B,MAAa,UAAU;CAoBtB;AApBD,gCAoBC;AAjBC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;wCACO;AAIpB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yCACQ;AAIrB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;+CACc;AAI3B;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;kDACiB;AAI9B;IAFC,IAAA,4BAAU,GAAE;IACZ,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E;IACV,IAAA,4BAAU,GAAE;8BACJ,UAAU;8CAAC;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACY;AAKvB;IAHC,IAAA,4BAAU,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACzB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0CACE;AAKb;IAHC,IAAA,4BAAU,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACzB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0CACE;AAIb;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;gDACK;AAIlB;IAFC,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;;2CACA;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;8BACC,YAAY;gDAAC"}
|
|
@@ -13,22 +13,68 @@ const generator_1 = require("../../util/pdfme/generator");
|
|
|
13
13
|
const text_1 = __importDefault(require("../../util/pdfme/schemas/text"));
|
|
14
14
|
const image_1 = __importDefault(require("../../util/pdfme/schemas/graphics/image"));
|
|
15
15
|
const buffer_1 = require("../../util/buffer");
|
|
16
|
+
const pdf_editor_1 = require("../../util/pdf-editor");
|
|
16
17
|
const constants_1 = require("../constants");
|
|
17
18
|
const schema_json_1 = __importDefault(require("./schema.json"));
|
|
18
19
|
const readFilePromise = (0, util_1.promisify)(fs_1.readFile);
|
|
19
20
|
const w9FormCoordinates = (data) => {
|
|
20
21
|
const today = (0, date_fns_1.format)(new Date(), constants_1.DOCUMENTS_DATE_FORMAT);
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
const page1 = {
|
|
23
|
+
name: `${data.name}`,
|
|
24
|
+
businessName: `${data.businessName}`,
|
|
25
|
+
address: `${data.address.address_line_1}`,
|
|
26
|
+
city_state_zip: `${data.address.city}, ${data.address.state}, ${data.address.postal_code}`,
|
|
27
|
+
date: `${today}`,
|
|
28
|
+
signature: data.signature,
|
|
29
|
+
[`ftc_${data.fedralTaxClassification}`]: constants_1.CHECKED_IMAGE,
|
|
30
|
+
requester_details: "",
|
|
31
|
+
};
|
|
32
|
+
if (data.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.Other &&
|
|
33
|
+
data.otherTaxClassification) {
|
|
34
|
+
page1.ftc_other_tc = data.otherTaxClassification;
|
|
35
|
+
}
|
|
36
|
+
if (data.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.LLC) {
|
|
37
|
+
if (data.taxClassification === pdf_editor_1.TaxClassification.CCorporation) {
|
|
38
|
+
page1.ftc_llc_category = "C";
|
|
39
|
+
}
|
|
40
|
+
if (data.taxClassification === pdf_editor_1.TaxClassification.SCorporation) {
|
|
41
|
+
page1.ftc_llc_category = "S";
|
|
42
|
+
}
|
|
43
|
+
if (data.taxClassification === pdf_editor_1.TaxClassification.Partnership) {
|
|
44
|
+
page1.ftc_llc_category = "P";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (data.isForeignPartners) {
|
|
48
|
+
page1.ftc_is_foreign_partners = constants_1.CHECKED_IMAGE;
|
|
49
|
+
}
|
|
50
|
+
if (data.accountNumber) {
|
|
51
|
+
page1.account_numbers = data.accountNumber;
|
|
52
|
+
}
|
|
53
|
+
if (data.exemptionCode) {
|
|
54
|
+
page1.exempt_payee_code = data.exemptionCode;
|
|
55
|
+
}
|
|
56
|
+
if (data.fatcaCode) {
|
|
57
|
+
page1.exempt_fatcha_code = data.fatcaCode;
|
|
58
|
+
}
|
|
59
|
+
if (data.ssn) {
|
|
60
|
+
const ssnArr = data.ssn.split("");
|
|
61
|
+
ssnArr.forEach((s, i) => {
|
|
62
|
+
page1[`ssn_${i + 1}`] = s;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (data.ein) {
|
|
66
|
+
const einArr = data.ein.split("");
|
|
67
|
+
einArr.forEach((e, i) => {
|
|
68
|
+
page1[`ein_${i + 1}`] = e;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (data.requester?.name) {
|
|
72
|
+
page1.requester_details = `${data.requester?.name}\n\n`;
|
|
73
|
+
}
|
|
74
|
+
if (data.requester?.address) {
|
|
75
|
+
page1.requester_details += (0, buffer_1.formatAddress)(data.requester?.address);
|
|
76
|
+
}
|
|
77
|
+
return [page1];
|
|
32
78
|
};
|
|
33
79
|
let pdfBufferInstance;
|
|
34
80
|
const getPDFInstance = async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/w9-form/index.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA8B;AAC9B,+BAAiC;AACjC,+BAA+B;AAC/B,uCAAkC;AAElC,0DAAiC;AACjC,0DAAsD;AACtD,yEAAuD;AACvD,oFAAkE;AAElE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/w9-form/index.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA8B;AAC9B,+BAAiC;AACjC,+BAA+B;AAC/B,uCAAkC;AAElC,0DAAiC;AACjC,0DAAsD;AACtD,yEAAuD;AACvD,oFAAkE;AAElE,8CAA2E;AAC3E,sDAG+B;AAC/B,4CAAoE;AACpE,gEAAyC;AAGzC,MAAM,eAAe,GAAG,IAAA,gBAAS,EAAC,aAAQ,CAAC,CAAC;AAE5C,MAAM,iBAAiB,GAAG,CAAC,IAAmB,EAA4B,EAAE;IAC1E,MAAM,KAAK,GAAG,IAAA,iBAAM,EAAC,IAAI,IAAI,EAAE,EAA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
+
"fontSize": 9,
|
|
57
57
|
"lineHeight": 1,
|
|
58
58
|
"characterSpacing": 0,
|
|
59
59
|
"fontColor": "#000000",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"rotate": 0,
|
|
76
76
|
"alignment": "left",
|
|
77
77
|
"verticalAlignment": "top",
|
|
78
|
-
"fontSize":
|
|
78
|
+
"fontSize": 9,
|
|
79
79
|
"lineHeight": 1,
|
|
80
80
|
"characterSpacing": 0,
|
|
81
81
|
"fontColor": "#000000",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"fontName": "Roboto"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
"name": "
|
|
91
|
+
"name": "account_numbers",
|
|
92
92
|
"type": "text",
|
|
93
93
|
"content": "",
|
|
94
94
|
"position": { "x": 26, "y": 117.5 },
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"rotate": 0,
|
|
98
98
|
"alignment": "left",
|
|
99
99
|
"verticalAlignment": "top",
|
|
100
|
-
"fontSize":
|
|
100
|
+
"fontSize": 9,
|
|
101
101
|
"lineHeight": 1,
|
|
102
102
|
"characterSpacing": 0,
|
|
103
103
|
"fontColor": "#000000",
|
|
@@ -278,13 +278,13 @@
|
|
|
278
278
|
"name": "exempt_payee_code",
|
|
279
279
|
"type": "text",
|
|
280
280
|
"content": "",
|
|
281
|
-
"position": { "x": 191.78, "y":
|
|
282
|
-
"width":
|
|
281
|
+
"position": { "x": 191.78, "y": 68.5 },
|
|
282
|
+
"width": 26.44,
|
|
283
283
|
"height": 4.99,
|
|
284
284
|
"rotate": 0,
|
|
285
285
|
"alignment": "left",
|
|
286
286
|
"verticalAlignment": "top",
|
|
287
|
-
"fontSize":
|
|
287
|
+
"fontSize": 8,
|
|
288
288
|
"lineHeight": 1,
|
|
289
289
|
"characterSpacing": 0,
|
|
290
290
|
"fontColor": "#000000",
|
|
@@ -300,13 +300,13 @@
|
|
|
300
300
|
"name": "exempt_fatcha_code",
|
|
301
301
|
"type": "text",
|
|
302
302
|
"content": "",
|
|
303
|
-
"position": { "x": 176.12, "y":
|
|
303
|
+
"position": { "x": 176.12, "y": 81 },
|
|
304
304
|
"width": 26.44,
|
|
305
305
|
"height": 4.99,
|
|
306
306
|
"rotate": 0,
|
|
307
307
|
"alignment": "left",
|
|
308
308
|
"verticalAlignment": "top",
|
|
309
|
-
"fontSize":
|
|
309
|
+
"fontSize": 8,
|
|
310
310
|
"lineHeight": 1,
|
|
311
311
|
"characterSpacing": 0,
|
|
312
312
|
"fontColor": "#000000",
|
|
@@ -322,13 +322,13 @@
|
|
|
322
322
|
"name": "requester_details",
|
|
323
323
|
"type": "text",
|
|
324
324
|
"content": "",
|
|
325
|
-
"position": { "x": 138.66, "y":
|
|
325
|
+
"position": { "x": 138.66, "y": 102 },
|
|
326
326
|
"width": 63.48,
|
|
327
|
-
"height":
|
|
327
|
+
"height": 13,
|
|
328
328
|
"rotate": 0,
|
|
329
329
|
"alignment": "left",
|
|
330
330
|
"verticalAlignment": "middle",
|
|
331
|
-
"fontSize":
|
|
331
|
+
"fontSize": 8,
|
|
332
332
|
"lineHeight": 1,
|
|
333
333
|
"characterSpacing": 0,
|
|
334
334
|
"fontColor": "#000000",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toBuffer = exports.toArrayBuffer = void 0;
|
|
3
|
+
exports.formatAddress = exports.toBuffer = exports.toArrayBuffer = void 0;
|
|
4
4
|
const toArrayBuffer = (buffer) => {
|
|
5
5
|
const ab = new ArrayBuffer(buffer.length);
|
|
6
6
|
const view = new Uint8Array(ab);
|
|
@@ -19,4 +19,19 @@ const toBuffer = (ab) => {
|
|
|
19
19
|
return buf;
|
|
20
20
|
};
|
|
21
21
|
exports.toBuffer = toBuffer;
|
|
22
|
+
const formatAddress = (address) => {
|
|
23
|
+
if (!address)
|
|
24
|
+
return "";
|
|
25
|
+
const { address_line_1, address_line_2, city, state, postal_code } = address;
|
|
26
|
+
let formattedAddress = "";
|
|
27
|
+
if (address_line_1) {
|
|
28
|
+
formattedAddress += `${address_line_1}\n`;
|
|
29
|
+
}
|
|
30
|
+
if (address_line_2) {
|
|
31
|
+
formattedAddress += `${address_line_2}\n`;
|
|
32
|
+
}
|
|
33
|
+
formattedAddress += `${city}, ${state} ${postal_code}\n`;
|
|
34
|
+
return formattedAddress;
|
|
35
|
+
};
|
|
36
|
+
exports.formatAddress = formatAddress;
|
|
22
37
|
//# sourceMappingURL=buffer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.js","sourceRoot":"","sources":["../../../../src/create/pdf/util/buffer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"buffer.js","sourceRoot":"","sources":["../../../../src/create/pdf/util/buffer.ts"],"names":[],"mappings":";;;AAEO,MAAM,aAAa,GAAG,CAAC,MAAkB,EAAe,EAAE;IAC/D,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAEhC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AARW,QAAA,aAAa,iBAQxB;AAEK,MAAM,QAAQ,GAAG,CAAC,EAAc,EAAU,EAAE;IACjD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAEhC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QACpC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AARW,QAAA,QAAQ,YAQnB;AAEK,MAAM,aAAa,GAAG,CAAC,OAAmB,EAAE,EAAE;IACnD,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAE7E,IAAI,gBAAgB,GAAG,EAAE,CAAC;IAC1B,IAAI,cAAc,EAAE,CAAC;QACnB,gBAAgB,IAAI,GAAG,cAAc,IAAI,CAAC;IAC5C,CAAC;IACD,IAAI,cAAc,EAAE,CAAC;QACnB,gBAAgB,IAAI,GAAG,cAAc,IAAI,CAAC;IAC5C,CAAC;IACD,gBAAgB,IAAI,GAAG,IAAI,KAAK,KAAK,IAAI,WAAW,IAAI,CAAC;IACzD,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAbW,QAAA,aAAa,iBAaxB"}
|
|
@@ -3,7 +3,7 @@ import type { TextSchema } from './types';
|
|
|
3
3
|
export declare const uiRender: (arg: UIRenderProps<TextSchema>) => Promise<void>;
|
|
4
4
|
export declare const buildStyledTextContainer: (arg: UIRenderProps<TextSchema>, value: string) => Promise<HTMLDivElement>;
|
|
5
5
|
export declare const makeElementPlainTextContentEditable: (element: HTMLElement) => void;
|
|
6
|
-
export declare const mapVerticalAlignToFlex: (verticalAlignmentValue: string | undefined) => "center" | "flex-
|
|
6
|
+
export declare const mapVerticalAlignToFlex: (verticalAlignmentValue: string | undefined) => "center" | "flex-start" | "flex-end";
|
|
7
7
|
export declare const getBackgroundColor: (value: string, schema: {
|
|
8
8
|
backgroundColor?: string;
|
|
9
9
|
}) => string;
|
|
@@ -26,6 +26,6 @@ export declare const rotatePoint: (point: {
|
|
|
26
26
|
export declare const addAlphaToHex: (hex: string, alphaPercentage: number) => string;
|
|
27
27
|
export declare const isEditable: (mode: Mode, schema: Schema) => boolean;
|
|
28
28
|
export declare const hex2RgbColor: (hexString: string | undefined) => import("@pdfme/pdf-lib").RGB | undefined;
|
|
29
|
-
export declare const hex2PrintingColor: (hexString: string | undefined, colorType?: ColorType) => import("@pdfme/pdf-lib").
|
|
29
|
+
export declare const hex2PrintingColor: (hexString: string | undefined, colorType?: ColorType) => import("@pdfme/pdf-lib").RGB | import("@pdfme/pdf-lib").CMYK | undefined;
|
|
30
30
|
export declare const readFile: (input: File | FileList | null) => Promise<string | ArrayBuffer>;
|
|
31
31
|
export declare const createErrorElm: () => HTMLDivElement;
|