@ottoai/documents 1.3.5 → 1.3.7

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/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@ottoai/documents",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "Generic library for creating documents (xml, pdf) with the given input data",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "private": false,
8
8
  "scripts": {
9
- "build": "tsc && npm run copy-files",
9
+ "build": "tsc && npm run copy-form-w9-files && npm run copy-form-1099-files",
10
10
  "build:test": "tsc --noEmit",
11
11
  "test": "jest --config jest.config.js",
12
12
  "lint": "eslint --ext .js,.ts \"src/**\"",
13
13
  "ci": "npm run test -- --coverage && npm run lint && npm run build:test",
14
14
  "release": "npx standard-version",
15
- "copy-files": "cp src/create/pdf/united-states/w9-form/*.pdf dist/create/pdf/united-states/w9-form/"
15
+ "copy-form-w9-files": "cp src/create/pdf/united-states/form-w9/*.pdf dist/create/pdf/united-states/form-w9/",
16
+ "copy-form-1099-files": "cp src/create/pdf/united-states/form-1099/*.pdf dist/create/pdf/united-states/form-1099/"
16
17
  },
17
18
  "author": "Anurag Patek <anurag@joinotto.com>",
18
19
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -1,29 +0,0 @@
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
- }
9
- export declare class RequesterDto {
10
- name: string;
11
- address?: AddressDto;
12
- }
13
- export declare class W9FormDataDto {
14
- name: string;
15
- businessName?: string;
16
- fedralTaxClassification: FedralTaxClassification;
17
- taxClassification?: TaxClassification;
18
- otherTaxClassification?: string;
19
- isForeignPartners?: boolean;
20
- exemptionCode?: string;
21
- address: AddressDto;
22
- accountNumber?: string;
23
- ssn?: string;
24
- ein?: string;
25
- signature: string;
26
- date: string;
27
- fatcaCode?: string;
28
- requester?: RequesterDto;
29
- }
@@ -1,141 +0,0 @@
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
- class RequesterDto {
44
- }
45
- exports.RequesterDto = RequesterDto;
46
- __decorate([
47
- (0, class_validator_1.IsString)(),
48
- (0, class_validator_1.IsNotEmpty)(),
49
- __metadata("design:type", String)
50
- ], RequesterDto.prototype, "name", void 0);
51
- __decorate([
52
- (0, class_validator_1.IsOptional)(),
53
- (0, class_validator_1.IsObject)(),
54
- __metadata("design:type", AddressDto)
55
- ], RequesterDto.prototype, "address", void 0);
56
- class W9FormDataDto {
57
- }
58
- exports.W9FormDataDto = W9FormDataDto;
59
- __decorate([
60
- (0, class_validator_1.IsString)(),
61
- (0, class_validator_1.IsNotEmpty)(),
62
- __metadata("design:type", String)
63
- ], W9FormDataDto.prototype, "name", void 0);
64
- __decorate([
65
- (0, class_validator_1.IsOptional)(),
66
- (0, class_validator_1.IsString)(),
67
- __metadata("design:type", String)
68
- ], W9FormDataDto.prototype, "businessName", void 0);
69
- __decorate([
70
- (0, class_validator_1.IsEnum)(pdf_editor_1.FedralTaxClassification),
71
- __metadata("design:type", String)
72
- ], W9FormDataDto.prototype, "fedralTaxClassification", void 0);
73
- __decorate([
74
- (0, class_validator_1.ValidateIf)((obj) => obj.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.LLC),
75
- (0, class_validator_1.IsEnum)(pdf_editor_1.TaxClassification),
76
- (0, class_validator_1.IsNotEmpty)(),
77
- __metadata("design:type", String)
78
- ], W9FormDataDto.prototype, "taxClassification", void 0);
79
- __decorate([
80
- (0, class_validator_1.ValidateIf)((o) => o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.Other),
81
- (0, class_validator_1.IsOptional)(),
82
- (0, class_validator_1.IsString)(),
83
- __metadata("design:type", String)
84
- ], W9FormDataDto.prototype, "otherTaxClassification", void 0);
85
- __decorate([
86
- (0, class_validator_1.ValidateIf)((o) => o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.Partnership ||
87
- o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.TrustEstate ||
88
- (o.fedralTaxClassification === pdf_editor_1.FedralTaxClassification.LLC &&
89
- o.taxClassification === pdf_editor_1.TaxClassification.Partnership)),
90
- (0, class_validator_1.IsNotEmpty)(),
91
- (0, class_validator_1.IsBoolean)(),
92
- __metadata("design:type", Boolean)
93
- ], W9FormDataDto.prototype, "isForeignPartners", void 0);
94
- __decorate([
95
- (0, class_validator_1.IsOptional)(),
96
- (0, class_validator_1.IsString)(),
97
- __metadata("design:type", String)
98
- ], W9FormDataDto.prototype, "exemptionCode", void 0);
99
- __decorate([
100
- (0, class_validator_1.IsObject)(),
101
- (0, class_validator_1.IsNotEmpty)(),
102
- __metadata("design:type", AddressDto)
103
- ], W9FormDataDto.prototype, "address", void 0);
104
- __decorate([
105
- (0, class_validator_1.IsOptional)(),
106
- (0, class_validator_1.IsString)(),
107
- __metadata("design:type", String)
108
- ], W9FormDataDto.prototype, "accountNumber", void 0);
109
- __decorate([
110
- (0, class_validator_1.ValidateIf)((o) => !o.ein),
111
- (0, class_validator_1.IsOptional)(),
112
- (0, class_validator_1.IsString)(),
113
- __metadata("design:type", String)
114
- ], W9FormDataDto.prototype, "ssn", void 0);
115
- __decorate([
116
- (0, class_validator_1.ValidateIf)((o) => !o.ssn),
117
- (0, class_validator_1.IsOptional)(),
118
- (0, class_validator_1.IsString)(),
119
- __metadata("design:type", String)
120
- ], W9FormDataDto.prototype, "ein", void 0);
121
- __decorate([
122
- (0, class_validator_1.IsString)(),
123
- (0, class_validator_1.IsNotEmpty)(),
124
- __metadata("design:type", String)
125
- ], W9FormDataDto.prototype, "signature", void 0);
126
- __decorate([
127
- (0, class_validator_1.IsDateString)(),
128
- (0, class_validator_1.IsNotEmpty)(),
129
- __metadata("design:type", String)
130
- ], W9FormDataDto.prototype, "date", void 0);
131
- __decorate([
132
- (0, class_validator_1.IsOptional)(),
133
- (0, class_validator_1.IsString)(),
134
- __metadata("design:type", String)
135
- ], W9FormDataDto.prototype, "fatcaCode", void 0);
136
- __decorate([
137
- (0, class_validator_1.IsOptional)(),
138
- (0, class_validator_1.IsObject)(),
139
- __metadata("design:type", RequesterDto)
140
- ], W9FormDataDto.prototype, "requester", void 0);
141
- //# sourceMappingURL=form.dto.js.map
@@ -1 +0,0 @@
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,IAAA,0BAAQ,GAAE;;kDACoB;AAIjC,MAAa,YAAY;CAQxB;AARD,oCAQC;AALC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0CACA;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;8BACD,UAAU;6CAAC;AAGvB,MAAa,aAAa;CA0EzB;AA1ED,sCA0EC;AAvEC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;2CACA;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACW;AAGtB;IADC,IAAA,wBAAM,EAAC,oCAAuB,CAAC;;8DACiB;AAOjD;IALC,IAAA,4BAAU,EACT,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,uBAAuB,KAAK,oCAAuB,CAAC,GAAG,CACrE;IACA,IAAA,wBAAM,EAAC,8BAAiB,CAAC;IACzB,IAAA,4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;;gDACQ;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;8BACC,YAAY;gDAAC"}
@@ -1,2 +0,0 @@
1
- import { W9FormDataDto } from "./form.dto";
2
- export declare const w9Form: (data: W9FormDataDto) => Promise<Buffer>;
@@ -1,105 +0,0 @@
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.w9Form = 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 w9Form = 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.w9Form = w9Form;
105
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,EAAE,iCAAqB,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG;QACZ,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE;QACpB,YAAY,EAAE,GAAG,IAAI,CAAC,YAAY,EAAE;QACpC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;QACzC,cAAc,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;QAC1F,IAAI,EAAE,GAAG,KAAK,EAAE;QAChB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,CAAC,OAAO,IAAI,CAAC,uBAAuB,EAAE,CAAC,EAAE,yBAAa;QACtD,iBAAiB,EAAE,EAAE;KACtB,CAAC;IACF,IACE,IAAI,CAAC,uBAAuB,KAAK,oCAAuB,CAAC,KAAK;QAC9D,IAAI,CAAC,sBAAsB,EAC3B,CAAC;QACD,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,sBAAsB,CAAC;IACnD,CAAC;IACD,IAAI,IAAI,CAA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