@ottoai/documents 1.0.14 → 1.0.17

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.
Files changed (34) hide show
  1. package/dist/create/index.d.ts +2 -0
  2. package/dist/create/index.js +29 -0
  3. package/dist/create/index.js.map +1 -0
  4. package/dist/create/pdf/index.d.ts +2 -0
  5. package/dist/create/pdf/index.js +29 -0
  6. package/dist/create/pdf/index.js.map +1 -0
  7. package/dist/create/pdf/united-states/constants.d.ts +6 -0
  8. package/dist/create/pdf/united-states/constants.js +10 -0
  9. package/dist/create/pdf/united-states/constants.js.map +1 -0
  10. package/dist/create/pdf/united-states/index.d.ts +2 -0
  11. package/dist/create/pdf/united-states/index.js +6 -0
  12. package/dist/create/pdf/united-states/index.js.map +1 -0
  13. package/dist/create/pdf/united-states/w9-form/index.d.ts +19 -0
  14. package/dist/create/pdf/united-states/w9-form/index.js +54 -0
  15. package/dist/create/pdf/united-states/w9-form/index.js.map +1 -0
  16. package/dist/create/pdf/united-states/w9-form/schema.json +739 -0
  17. package/dist/create/pdf/united-states/w9-form/template.pdf +0 -0
  18. package/dist/create/pdf/util/buffer.d.ts +2 -0
  19. package/dist/create/pdf/util/buffer.js +22 -0
  20. package/dist/create/pdf/util/buffer.js.map +1 -0
  21. package/dist/create/pdf/util/format.d.ts +4 -0
  22. package/dist/create/pdf/util/format.js +17 -0
  23. package/dist/create/pdf/util/format.js.map +1 -0
  24. package/dist/create/pdf/util/pdf-editor.d.ts +36 -0
  25. package/dist/create/pdf/util/pdf-editor.js +20 -0
  26. package/dist/create/pdf/util/pdf-editor.js.map +1 -0
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +26 -5
  29. package/dist/index.js.map +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/dist/types/document.d.ts +5 -0
  32. package/dist/types/document.js +10 -0
  33. package/dist/types/document.js.map +1 -0
  34. package/package.json +8 -28
@@ -0,0 +1,2 @@
1
+ export declare const toArrayBuffer: (buffer: Uint8Array) => ArrayBuffer;
2
+ export declare const toBuffer: (ab: Uint8Array) => Buffer;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toBuffer = exports.toArrayBuffer = void 0;
4
+ const toArrayBuffer = (buffer) => {
5
+ const ab = new ArrayBuffer(buffer.length);
6
+ const view = new Uint8Array(ab);
7
+ for (let i = 0; i < buffer.length; ++i) {
8
+ view[i] = buffer[i];
9
+ }
10
+ return ab;
11
+ };
12
+ exports.toArrayBuffer = toArrayBuffer;
13
+ const toBuffer = (ab) => {
14
+ const buf = Buffer.alloc(ab.byteLength);
15
+ const view = new Uint8Array(ab);
16
+ for (let i = 0; i < buf.length; ++i) {
17
+ buf[i] = view[i];
18
+ }
19
+ return buf;
20
+ };
21
+ exports.toBuffer = toBuffer;
22
+ //# sourceMappingURL=buffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer.js","sourceRoot":"","sources":["../../../../src/create/pdf/util/buffer.ts"],"names":[],"mappings":";;;AAAO,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"}
@@ -0,0 +1,4 @@
1
+ import { CountryNames } from '../../../types/document';
2
+ declare const formatNumberToLocale: (value: number) => string;
3
+ declare const getCountryName: (countryCode: string) => CountryNames;
4
+ export { formatNumberToLocale, getCountryName };
@@ -0,0 +1,17 @@
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.getCountryName = exports.formatNumberToLocale = void 0;
7
+ const currency_js_1 = __importDefault(require("currency.js"));
8
+ const document_1 = require("../../../types/document");
9
+ const formatNumberToLocale = (value) => {
10
+ return (0, currency_js_1.default)(value, { symbol: '', separator: '.', decimal: ',' }).format();
11
+ };
12
+ exports.formatNumberToLocale = formatNumberToLocale;
13
+ const getCountryName = (countryCode) => {
14
+ return document_1.CountryNames[countryCode];
15
+ };
16
+ exports.getCountryName = getCountryName;
17
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../../src/create/pdf/util/format.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAmC;AAEnC,sDAAuD;AAEvD,MAAM,oBAAoB,GAAG,CAAC,KAAa,EAAU,EAAE;IAErD,OAAO,IAAA,qBAAQ,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAChF,CAAC,CAAC;AAMO,oDAAoB;AAJ7B,MAAM,cAAc,GAAG,CAAC,WAAmB,EAAgB,EAAE;IAC3D,OAAO,uBAAY,CAAC,WAAwC,CAAC,CAAC;AAChE,CAAC,CAAC;AAE6B,wCAAc"}
@@ -0,0 +1,36 @@
1
+ export interface Field {
2
+ value: string;
3
+ x: number;
4
+ y: number;
5
+ page: number;
6
+ isImage?: boolean;
7
+ size?: number;
8
+ }
9
+ export type PdfCoordinates = {
10
+ [name: string]: Field;
11
+ };
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
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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 = {}));
20
+ //# sourceMappingURL=pdf-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf-editor.js","sourceRoot":"","sources":["../../../../src/create/pdf/util/pdf-editor.ts"],"names":[],"mappings":";;;AAqBA,IAAY,uBAQX;AARD,WAAY,uBAAuB;IACjC,4DAAiC,CAAA;IACjC,yDAA8B,CAAA;IAC9B,yDAA8B,CAAA;IAC9B,sDAA2B,CAAA;IAC3B,gDAAqB,CAAA;IACrB,sCAAW,CAAA;IACX,0CAAe,CAAA;AACjB,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
- declare const helloworld: () => void;
2
- export { helloworld };
1
+ import * as create from './create';
2
+ export { create };
package/dist/index.js CHANGED
@@ -1,8 +1,29 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.helloworld = void 0;
4
- const helloworld = () => {
5
- console.log('hello');
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;
6
24
  };
7
- exports.helloworld = helloworld;
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.create = void 0;
27
+ const create = __importStar(require("./create"));
28
+ exports.create = create;
8
29
  //# 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":";;;AAIA,MAAM,UAAU,GAAG,GAAG,EAAE;IACpB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC,CAAA;AAEQ,gCAAU"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAE1B,wBAAM"}