@ottoai/documents 1.3.4 → 1.3.5

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.
@@ -0,0 +1,30 @@
1
+ import { FedralTaxClassification, TaxClassification } from "../../util/pdf-editor";
2
+ export declare class AddressDto {
3
+ city: string | null;
4
+ state: string | null;
5
+ postal_code: string | null;
6
+ address_line_1: string | null;
7
+ address_line_2?: string | null;
8
+ country?: string | null;
9
+ }
10
+ export declare class RequesterDto {
11
+ name: string;
12
+ address?: AddressDto;
13
+ }
14
+ export declare class W9FormDataDto {
15
+ name: string;
16
+ businessName?: string;
17
+ fedralTaxClassification: FedralTaxClassification;
18
+ taxClassification?: TaxClassification;
19
+ otherTaxClassification?: string;
20
+ isForeignPartners?: boolean;
21
+ exemptionCode?: string;
22
+ address: AddressDto;
23
+ accountNumber?: string;
24
+ ssn?: string;
25
+ ein?: string;
26
+ signature: string;
27
+ date: string;
28
+ fatcaCode?: string;
29
+ requester?: RequesterDto;
30
+ }
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.W9FormDataDto = exports.RequesterDto = exports.AddressDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const pdf_editor_1 = require("../../util/pdf-editor");
15
+ class AddressDto {
16
+ }
17
+ exports.AddressDto = AddressDto;
18
+ __decorate([
19
+ (0, class_validator_1.IsString)(),
20
+ (0, class_validator_1.IsNotEmpty)(),
21
+ __metadata("design:type", Object)
22
+ ], AddressDto.prototype, "city", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.IsNotEmpty)(),
26
+ __metadata("design:type", Object)
27
+ ], AddressDto.prototype, "state", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ __metadata("design:type", Object)
32
+ ], AddressDto.prototype, "postal_code", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsString)(),
35
+ (0, class_validator_1.IsNotEmpty)(),
36
+ __metadata("design:type", Object)
37
+ ], AddressDto.prototype, "address_line_1", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, class_validator_1.IsString)(),
41
+ __metadata("design:type", Object)
42
+ ], AddressDto.prototype, "address_line_2", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsOptional)(),
45
+ (0, class_validator_1.IsString)(),
46
+ __metadata("design:type", Object)
47
+ ], AddressDto.prototype, "country", void 0);
48
+ class RequesterDto {
49
+ }
50
+ exports.RequesterDto = RequesterDto;
51
+ __decorate([
52
+ (0, class_validator_1.IsString)(),
53
+ (0, class_validator_1.IsNotEmpty)(),
54
+ __metadata("design:type", String)
55
+ ], RequesterDto.prototype, "name", void 0);
56
+ __decorate([
57
+ (0, class_validator_1.IsOptional)(),
58
+ (0, class_validator_1.IsObject)(),
59
+ __metadata("design:type", AddressDto)
60
+ ], RequesterDto.prototype, "address", void 0);
61
+ class W9FormDataDto {
62
+ }
63
+ exports.W9FormDataDto = W9FormDataDto;
64
+ __decorate([
65
+ (0, class_validator_1.IsString)(),
66
+ (0, class_validator_1.IsNotEmpty)(),
67
+ __metadata("design:type", String)
68
+ ], W9FormDataDto.prototype, "name", void 0);
69
+ __decorate([
70
+ (0, class_validator_1.IsOptional)(),
71
+ (0, class_validator_1.IsString)(),
72
+ __metadata("design:type", String)
73
+ ], W9FormDataDto.prototype, "businessName", void 0);
74
+ __decorate([
75
+ (0, class_validator_1.IsEnum)(pdf_editor_1.FedralTaxClassification),
76
+ __metadata("design:type", String)
77
+ ], W9FormDataDto.prototype, "fedralTaxClassification", void 0);
78
+ __decorate([
79
+ (0, class_validator_1.ValidateIf)((obj) => obj.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.LLC),
80
+ (0, class_validator_1.IsEnum)(pdf_editor_1.TaxClassification),
81
+ (0, class_validator_1.IsNotEmpty)(),
82
+ __metadata("design:type", String)
83
+ ], W9FormDataDto.prototype, "taxClassification", void 0);
84
+ __decorate([
85
+ (0, class_validator_1.ValidateIf)((o) => o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.Other),
86
+ (0, class_validator_1.IsOptional)(),
87
+ (0, class_validator_1.IsString)(),
88
+ __metadata("design:type", String)
89
+ ], W9FormDataDto.prototype, "otherTaxClassification", void 0);
90
+ __decorate([
91
+ (0, class_validator_1.ValidateIf)((o) => o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.Partnership ||
92
+ o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.TrustEstate ||
93
+ (o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.LLC &&
94
+ o.taxClassification === pdf_editor_1.TaxClassification.Partnership)),
95
+ (0, class_validator_1.IsNotEmpty)(),
96
+ (0, class_validator_1.IsBoolean)(),
97
+ __metadata("design:type", Boolean)
98
+ ], W9FormDataDto.prototype, "isForeignPartners", void 0);
99
+ __decorate([
100
+ (0, class_validator_1.IsOptional)(),
101
+ (0, class_validator_1.IsString)(),
102
+ __metadata("design:type", String)
103
+ ], W9FormDataDto.prototype, "exemptionCode", void 0);
104
+ __decorate([
105
+ (0, class_validator_1.IsObject)(),
106
+ (0, class_validator_1.IsNotEmpty)(),
107
+ __metadata("design:type", AddressDto)
108
+ ], W9FormDataDto.prototype, "address", void 0);
109
+ __decorate([
110
+ (0, class_validator_1.IsOptional)(),
111
+ (0, class_validator_1.IsString)(),
112
+ __metadata("design:type", String)
113
+ ], W9FormDataDto.prototype, "accountNumber", void 0);
114
+ __decorate([
115
+ (0, class_validator_1.ValidateIf)((o) => !o.ein),
116
+ (0, class_validator_1.IsOptional)(),
117
+ (0, class_validator_1.IsString)(),
118
+ __metadata("design:type", String)
119
+ ], W9FormDataDto.prototype, "ssn", void 0);
120
+ __decorate([
121
+ (0, class_validator_1.ValidateIf)((o) => !o.ssn),
122
+ (0, class_validator_1.IsOptional)(),
123
+ (0, class_validator_1.IsString)(),
124
+ __metadata("design:type", String)
125
+ ], W9FormDataDto.prototype, "ein", void 0);
126
+ __decorate([
127
+ (0, class_validator_1.IsString)(),
128
+ (0, class_validator_1.IsNotEmpty)(),
129
+ __metadata("design:type", String)
130
+ ], W9FormDataDto.prototype, "signature", void 0);
131
+ __decorate([
132
+ (0, class_validator_1.IsDateString)(),
133
+ (0, class_validator_1.IsNotEmpty)(),
134
+ __metadata("design:type", String)
135
+ ], W9FormDataDto.prototype, "date", void 0);
136
+ __decorate([
137
+ (0, class_validator_1.IsOptional)(),
138
+ (0, class_validator_1.IsString)(),
139
+ __metadata("design:type", String)
140
+ ], W9FormDataDto.prototype, "fatcaCode", void 0);
141
+ __decorate([
142
+ (0, class_validator_1.IsOptional)(),
143
+ (0, class_validator_1.IsObject)(),
144
+ __metadata("design:type", RequesterDto)
145
+ ], W9FormDataDto.prototype, "requester", void 0);
146
+ //# sourceMappingURL=form.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.dto.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/form-w9/form.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDASyB;AACzB,sDAG+B;AAG/B,MAAa,UAAU;CAwBtB;AAxBD,gCAwBC;AArBC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GA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AAuB,KAAK,oCAAuB,CAAC,WAAW;QACjE,CAAC,CAAC,CAAC,uBAAuB,KAAK,oCAAuB,CAAC,GAAG;YACxD,CAAC,CAAC,iBAAiB,KAAK,8BAAiB,CAAC,WAAW,CAAC,CAC3D;IACA,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;wDACgB;AAI5B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACY;AAIvB;IAFC,IAAA,0BAAQ,GAAE;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"}
@@ -0,0 +1,2 @@
1
+ import { W9FormDataDto } from "./form.dto";
2
+ export declare const formW9: (data: W9FormDataDto) => Promise<Buffer>;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.formW9 = void 0;
7
+ const fs_1 = require("fs");
8
+ const util_1 = require("util");
9
+ const path_1 = require("path");
10
+ const date_fns_1 = require("date-fns");
11
+ const is_base64_1 = __importDefault(require("is-base64"));
12
+ const generator_1 = require("../../util/pdfme/generator");
13
+ const text_1 = __importDefault(require("../../util/pdfme/schemas/text"));
14
+ const image_1 = __importDefault(require("../../util/pdfme/schemas/graphics/image"));
15
+ const buffer_1 = require("../../util/buffer");
16
+ const pdf_editor_1 = require("../../util/pdf-editor");
17
+ const constants_1 = require("../constants");
18
+ const schema_json_1 = __importDefault(require("./schema.json"));
19
+ const readFilePromise = (0, util_1.promisify)(fs_1.readFile);
20
+ const w9FormCoordinates = (data) => {
21
+ const today = (0, date_fns_1.format)(new Date(), constants_1.DOCUMENTS_DATE_FORMAT);
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];
78
+ };
79
+ let pdfBufferInstance;
80
+ const getPDFInstance = async () => {
81
+ if (!pdfBufferInstance) {
82
+ pdfBufferInstance = await readFilePromise((0, path_1.resolve)(__dirname, "./template.pdf"));
83
+ }
84
+ return pdfBufferInstance;
85
+ };
86
+ const formW9 = async (data) => {
87
+ if (!(0, is_base64_1.default)(data.signature, { mimeRequired: true })) {
88
+ throw new Error("Invalid signature");
89
+ }
90
+ const pdfBuffer = await getPDFInstance();
91
+ const template = {
92
+ basePdf: (0, buffer_1.toArrayBuffer)(pdfBuffer),
93
+ schemas: [schema_json_1.default],
94
+ };
95
+ const plugins = {
96
+ Text: text_1.default,
97
+ Image: image_1.default,
98
+ };
99
+ const inputs = w9FormCoordinates(data);
100
+ return (0, generator_1.generate)({ template, inputs, plugins }).then((pdf) => {
101
+ return (0, buffer_1.toBuffer)(pdf);
102
+ });
103
+ };
104
+ exports.formW9 = formW9;
105
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/create/pdf/united-states/form-w9/index.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA8B;AAC9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