@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.
@@ -1,7 +1,9 @@
1
- import { w9Form } from "./w9-form";
2
- import { W9FormDataDto, AddressDto, RequesterDto } from "./w9-form/form.dto";
1
+ import { formW9 } from "./form-w9";
2
+ import { form1099 } from "./form-1099";
3
+ import { W9FormDataDto, AddressDto, RequesterDto } from "./form-w9/form.dto";
4
+ import { Form1099Dto } from "./form-1099/form.dto";
3
5
  declare enum SupportedFormTypes {
4
6
  FORM_W9 = "form_w9",
5
7
  FORM_1099 = "form_1099"
6
8
  }
7
- export { w9Form, SupportedFormTypes, W9FormDataDto, AddressDto, RequesterDto };
9
+ export { formW9, form1099, SupportedFormTypes, W9FormDataDto, AddressDto, RequesterDto, Form1099Dto, };
@@ -1,12 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RequesterDto = exports.AddressDto = exports.W9FormDataDto = exports.SupportedFormTypes = exports.w9Form = void 0;
4
- const w9_form_1 = require("./w9-form");
5
- Object.defineProperty(exports, "w9Form", { enumerable: true, get: function () { return w9_form_1.w9Form; } });
6
- const form_dto_1 = require("./w9-form/form.dto");
3
+ exports.Form1099Dto = exports.RequesterDto = exports.AddressDto = exports.W9FormDataDto = exports.SupportedFormTypes = exports.form1099 = exports.formW9 = void 0;
4
+ const form_w9_1 = require("./form-w9");
5
+ Object.defineProperty(exports, "formW9", { enumerable: true, get: function () { return form_w9_1.formW9; } });
6
+ const form_1099_1 = require("./form-1099");
7
+ Object.defineProperty(exports, "form1099", { enumerable: true, get: function () { return form_1099_1.form1099; } });
8
+ const form_dto_1 = require("./form-w9/form.dto");
7
9
  Object.defineProperty(exports, "W9FormDataDto", { enumerable: true, get: function () { return form_dto_1.W9FormDataDto; } });
8
10
  Object.defineProperty(exports, "AddressDto", { enumerable: true, get: function () { return form_dto_1.AddressDto; } });
9
11
  Object.defineProperty(exports, "RequesterDto", { enumerable: true, get: function () { return form_dto_1.RequesterDto; } });
12
+ const form_dto_2 = require("./form-1099/form.dto");
13
+ Object.defineProperty(exports, "Form1099Dto", { enumerable: true, get: function () { return form_dto_2.Form1099Dto; } });
10
14
  var SupportedFormTypes;
11
15
  (function (SupportedFormTypes) {
12
16
  SupportedFormTypes["FORM_W9"] = "form_w9";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/create/pdf/united-states/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAQ1B,uFARA,gBAAM,OAQA;AAPf,iDAA6E;AAOxC,8FAP5B,wBAAa,OAO4B;AAAE,2FAP5B,qBAAU,OAO4B;AAAE,6FAP5B,uBAAY,OAO4B;AAL5E,IAAK,kBAGJ;AAHD,WAAK,kBAAkB;IACrB,yCAAmB,CAAA;IACnB,6CAAuB,CAAA;AACzB,CAAC,EAHI,kBAAkB,kCAAlB,kBAAkB,QAGtB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/create/pdf/united-states/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAWjC,uFAXO,gBAAM,OAWP;AAVR,2CAAuC;AAWrC,yFAXO,oBAAQ,OAWP;AAVV,iDAA6E;AAY3E,8FAZO,wBAAa,OAYP;AACb,2FAbsB,qBAAU,OAatB;AACV,6FAdkC,uBAAY,OAclC;AAbd,mDAAmD;AAcjD,4FAdO,sBAAW,OAcP;AAZb,IAAK,kBAGJ;AAHD,WAAK,kBAAkB;IACrB,yCAAmB,CAAA;IACnB,6CAAuB,CAAA;AACzB,CAAC,EAHI,kBAAkB,kCAAlB,kBAAkB,QAGtB"}
@@ -2,3 +2,4 @@ import { AddressDto } from "../united-states";
2
2
  export declare const toArrayBuffer: (buffer: Uint8Array) => ArrayBuffer;
3
3
  export declare const toBuffer: (ab: Uint8Array) => Buffer;
4
4
  export declare const formatAddress: (address: AddressDto) => string;
5
+ export declare const formatPayerDetails: (name: string, address: AddressDto, phone: string) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatAddress = exports.toBuffer = exports.toArrayBuffer = void 0;
3
+ exports.formatPayerDetails = 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);
@@ -22,7 +22,7 @@ exports.toBuffer = toBuffer;
22
22
  const formatAddress = (address) => {
23
23
  if (!address)
24
24
  return "";
25
- const { address_line_1, address_line_2, city, state, postal_code } = address;
25
+ const { address_line_1, address_line_2, city, state, country = "US", postal_code, } = address;
26
26
  let formattedAddress = "";
27
27
  if (address_line_1) {
28
28
  formattedAddress += `${address_line_1}\n`;
@@ -30,8 +30,23 @@ const formatAddress = (address) => {
30
30
  if (address_line_2) {
31
31
  formattedAddress += `${address_line_2}\n`;
32
32
  }
33
- formattedAddress += `${city}, ${state} ${postal_code}\n`;
33
+ formattedAddress += `${city}, ${state}, ${country} ${postal_code}\n`;
34
34
  return formattedAddress;
35
35
  };
36
36
  exports.formatAddress = formatAddress;
37
+ const formatPayerDetails = (name, address, phone) => {
38
+ if (!address)
39
+ return "";
40
+ const { address_line_1, city, state, country = "US", postal_code } = address;
41
+ let formattedDetails = `${name}\n`;
42
+ if (address_line_1) {
43
+ formattedDetails += `${address_line_1}, `;
44
+ }
45
+ formattedDetails += `${city}, ${state}, ${country} ${postal_code}\n`;
46
+ if (phone) {
47
+ formattedDetails += `${phone}\n`;
48
+ }
49
+ return formattedDetails;
50
+ };
51
+ exports.formatPayerDetails = formatPayerDetails;
37
52
  //# sourceMappingURL=buffer.js.map
@@ -1 +1 @@
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/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