@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.
- package/dist/create/index.d.ts +2 -0
- package/dist/create/index.js +29 -0
- package/dist/create/index.js.map +1 -0
- package/dist/create/pdf/index.d.ts +2 -0
- package/dist/create/pdf/index.js +29 -0
- package/dist/create/pdf/index.js.map +1 -0
- package/dist/create/pdf/united-states/constants.d.ts +6 -0
- package/dist/create/pdf/united-states/constants.js +10 -0
- package/dist/create/pdf/united-states/constants.js.map +1 -0
- package/dist/create/pdf/united-states/index.d.ts +2 -0
- package/dist/create/pdf/united-states/index.js +6 -0
- package/dist/create/pdf/united-states/index.js.map +1 -0
- package/dist/create/pdf/united-states/w9-form/index.d.ts +19 -0
- package/dist/create/pdf/united-states/w9-form/index.js +54 -0
- package/dist/create/pdf/united-states/w9-form/index.js.map +1 -0
- package/dist/create/pdf/united-states/w9-form/schema.json +739 -0
- package/dist/create/pdf/united-states/w9-form/template.pdf +0 -0
- package/dist/create/pdf/util/buffer.d.ts +2 -0
- package/dist/create/pdf/util/buffer.js +22 -0
- package/dist/create/pdf/util/buffer.js.map +1 -0
- package/dist/create/pdf/util/format.d.ts +4 -0
- package/dist/create/pdf/util/format.js +17 -0
- package/dist/create/pdf/util/format.js.map +1 -0
- package/dist/create/pdf/util/pdf-editor.d.ts +36 -0
- package/dist/create/pdf/util/pdf-editor.js +20 -0
- package/dist/create/pdf/util/pdf-editor.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/document.d.ts +5 -0
- package/dist/types/document.js +10 -0
- package/dist/types/document.js.map +1 -0
- package/package.json +8 -28
|
Binary file
|
|
@@ -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,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
|
-
|
|
2
|
-
export {
|
|
1
|
+
import * as create from './create';
|
|
2
|
+
export { create };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAE1B,wBAAM"}
|