@ottoai/documents 1.0.11 → 1.0.13

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,4 +1,3 @@
1
- import { PDFDocument } from 'pdf-lib';
2
1
  export interface Field {
3
2
  value: string;
4
3
  x: number;
@@ -7,11 +6,31 @@ export interface Field {
7
6
  isImage?: boolean;
8
7
  size?: number;
9
8
  }
10
- interface DocConfig {
11
- size: number;
12
- }
13
9
  export type PdfCoordinates = {
14
10
  [name: string]: Field;
15
11
  };
16
- export declare const editPdf: (pdfDoc: PDFDocument, field: Field, docConfig?: DocConfig) => Promise<void>;
17
- export {};
12
+ export interface Address {
13
+ city: string | null;
14
+ state: string | null;
15
+ postal_code: string | null;
16
+ address_line_1: string | null;
17
+ address_line_2?: string | null;
18
+ }
19
+ export declare enum FedralTaxClassification {
20
+ IndividualSoleProprietor = "solo",
21
+ CCorporation = "c_corporation",
22
+ SCorporation = "s_corporation",
23
+ Partnership = "partnership",
24
+ TrustEstate = "trust",
25
+ LLC = "llc",
26
+ Other = "other"
27
+ }
28
+ export declare enum TaxClassification {
29
+ CCorporation = "c_corporation",
30
+ SCorporation = "s_corporation",
31
+ Partnership = "partnership"
32
+ }
33
+ export interface Requester {
34
+ name: string;
35
+ address: Address;
36
+ }
@@ -1,37 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.editPdf = void 0;
4
- const constants_1 = require("../united-states/constants");
5
- const editPdf = async (pdfDoc, field, docConfig = {
6
- size: constants_1.TEXT_SIZE,
7
- }) => {
8
- const pageNumber = field.page;
9
- const page = pdfDoc.getPages()[pageNumber - 1];
10
- const { height } = page.getSize();
11
- if (field.isImage) {
12
- const image = await pdfDoc.embedPng(field.value);
13
- let scaled = {
14
- width: constants_1.SIGNATURE_WIDTH,
15
- height: constants_1.SIGNATURE_HEIGHT,
16
- };
17
- if (image.height > 50) {
18
- scaled = image.scale(50 / image.height);
19
- }
20
- page.drawImage(image, {
21
- x: field.x,
22
- y: height - field.y,
23
- width: scaled.width,
24
- height: scaled.height,
25
- });
26
- }
27
- else {
28
- page.drawText(field.value.toString(), {
29
- x: field.x,
30
- y: height - field.y,
31
- size: field.size || docConfig.size,
32
- lineHeight: field.size || docConfig.size,
33
- });
34
- }
35
- };
36
- exports.editPdf = editPdf;
3
+ exports.TaxClassification = exports.FedralTaxClassification = void 0;
4
+ var FedralTaxClassification;
5
+ (function (FedralTaxClassification) {
6
+ FedralTaxClassification["IndividualSoleProprietor"] = "solo";
7
+ FedralTaxClassification["CCorporation"] = "c_corporation";
8
+ FedralTaxClassification["SCorporation"] = "s_corporation";
9
+ FedralTaxClassification["Partnership"] = "partnership";
10
+ FedralTaxClassification["TrustEstate"] = "trust";
11
+ FedralTaxClassification["LLC"] = "llc";
12
+ FedralTaxClassification["Other"] = "other";
13
+ })(FedralTaxClassification || (exports.FedralTaxClassification = FedralTaxClassification = {}));
14
+ var TaxClassification;
15
+ (function (TaxClassification) {
16
+ TaxClassification["CCorporation"] = "c_corporation";
17
+ TaxClassification["SCorporation"] = "s_corporation";
18
+ TaxClassification["Partnership"] = "partnership";
19
+ })(TaxClassification || (exports.TaxClassification = TaxClassification = {}));
37
20
  //# sourceMappingURL=pdf-editor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-editor.js","sourceRoot":"","sources":["../../../../src/create/pdf/util/pdf-editor.ts"],"names":[],"mappings":";;;AAEA,0DAA0F;AAmBnF,MAAM,OAAO,GAAG,KAAK,EAC1B,MAAmB,EACnB,KAAY,EACZ,YAAuB;IACrB,IAAI,EAAE,qBAAS;CAChB,EACc,EAAE;IACjB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;IAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAC/C,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC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CAAC,EARW,uBAAuB,uCAAvB,uBAAuB,QAQlC;AAED,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,mDAA8B,CAAA;IAC9B,mDAA8B,CAAA;IAC9B,gDAA2B,CAAA;AAC7B,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import * as create from './create';
2
- export { create };
1
+ declare const helloworld: () => void;
2
+ export { helloworld };
package/dist/index.js CHANGED
@@ -1,29 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.create = void 0;
27
- const create = __importStar(require("./create"));
28
- exports.create = create;
3
+ exports.helloworld = void 0;
4
+ const helloworld = () => {
5
+ console.log('hello');
6
+ };
7
+ exports.helloworld = helloworld;
29
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAE1B,wBAAM"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAIA,MAAM,UAAU,GAAG,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC,CAAA;AAEQ,gCAAU"}