@apiverve/invoicegenerator 1.1.13 → 1.2.0

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/README.md CHANGED
@@ -63,20 +63,16 @@ var query = {
63
63
  "invoiceNumber": "INV000001",
64
64
  "date": "2025-02-01",
65
65
  "dueDate": "2025-11-30",
66
- "from": {
67
- "from_name": "John Doe",
68
- "from_street": "123 Elm St",
69
- "from_city": "Springfield",
70
- "from_state": "IL",
71
- "from_zip": "62701"
72
- },
73
- "to": {
74
- "to_name": "Jane Smith",
75
- "to_street": "456 Oak St",
76
- "to_city": "Springfield",
77
- "to_state": "IL",
78
- "to_zip": "62702"
79
- },
66
+ "from_name": "John Doe",
67
+ "from_street": "123 Elm St",
68
+ "from_city": "Springfield",
69
+ "from_state": "IL",
70
+ "from_zip": "62701",
71
+ "to_name": "Jane Smith",
72
+ "to_street": "456 Oak St",
73
+ "to_city": "Springfield",
74
+ "to_state": "IL",
75
+ "to_zip": "62702",
80
76
  "job": "Web Development",
81
77
  "paymentTerms": "Net 30",
82
78
  "discount": 10,
@@ -116,20 +112,16 @@ var query = {
116
112
  "invoiceNumber": "INV000001",
117
113
  "date": "2025-02-01",
118
114
  "dueDate": "2025-11-30",
119
- "from": {
120
- "from_name": "John Doe",
121
- "from_street": "123 Elm St",
122
- "from_city": "Springfield",
123
- "from_state": "IL",
124
- "from_zip": "62701"
125
- },
126
- "to": {
127
- "to_name": "Jane Smith",
128
- "to_street": "456 Oak St",
129
- "to_city": "Springfield",
130
- "to_state": "IL",
131
- "to_zip": "62702"
132
- },
115
+ "from_name": "John Doe",
116
+ "from_street": "123 Elm St",
117
+ "from_city": "Springfield",
118
+ "from_state": "IL",
119
+ "from_zip": "62701",
120
+ "to_name": "Jane Smith",
121
+ "to_street": "456 Oak St",
122
+ "to_city": "Springfield",
123
+ "to_state": "IL",
124
+ "to_zip": "62702",
133
125
  "job": "Web Development",
134
126
  "paymentTerms": "Net 30",
135
127
  "discount": 10,
@@ -170,20 +162,16 @@ async function makeRequest() {
170
162
  "invoiceNumber": "INV000001",
171
163
  "date": "2025-02-01",
172
164
  "dueDate": "2025-11-30",
173
- "from": {
174
- "from_name": "John Doe",
175
- "from_street": "123 Elm St",
176
- "from_city": "Springfield",
177
- "from_state": "IL",
178
- "from_zip": "62701"
179
- },
180
- "to": {
181
- "to_name": "Jane Smith",
182
- "to_street": "456 Oak St",
183
- "to_city": "Springfield",
184
- "to_state": "IL",
185
- "to_zip": "62702"
186
- },
165
+ "from_name": "John Doe",
166
+ "from_street": "123 Elm St",
167
+ "from_city": "Springfield",
168
+ "from_state": "IL",
169
+ "from_zip": "62701",
170
+ "to_name": "Jane Smith",
171
+ "to_street": "456 Oak St",
172
+ "to_city": "Springfield",
173
+ "to_state": "IL",
174
+ "to_zip": "62702",
187
175
  "job": "Web Development",
188
176
  "paymentTerms": "Net 30",
189
177
  "discount": 10,
@@ -221,9 +209,9 @@ async function makeRequest() {
221
209
  "status": "ok",
222
210
  "error": null,
223
211
  "data": {
224
- "pdfName": "f9210db5-8be3-4de4-8b20-d58019b0600a.pdf",
225
- "expires": 1740259902629,
226
- "downloadURL": "https://storage.googleapis.com/apiverve-helpers.appspot.com/htmltopdf/f9210db5-8be3-4de4-8b20-d58019b0600a.pdf?GoogleAccessId=1089020767582-compute%40developer.gserviceaccount.com&Expires=1740259902&Signature=PVHHoAfVg%2BUOXCC1kt3m3ttRAns6UTrYPm8%2BVS19hEFAH27VG%2FnZHgUl75iUYpZozqycZw7etohyekZIBPeqozfFWkkodkMvi487x2onk%2B3S9nQN5J0gmPxhcfWVjT4jPxk7ggQMhG2rl7QCxjAhG9OGo1U9OuhSYdJXaQqEmOMhTDkhW%2BB3RFMHqXmgYZHBLo8kh1aLLK%2FdKbGOF5ofR33W0w%2F5ywdykG%2BAnk0Rv3oxTIppAR%2F4NsDeqhYBgq3yXyRubOgcZGBEEtAj2bpYPuzNtqKgF7aENTQe4MkghWct8P4qs%2F8MDSSMCZCN1B24Xz8TxGGem814qThfv3DLOw%3D%3D"
212
+ "pdfName": "fc17c4bd-e660-4078-94ae-f46be56c9006.pdf",
213
+ "expires": 1766096689189,
214
+ "downloadURL": "https://storage.googleapis.com/apiverve-helpers.appspot.com/htmltopdf/fc17c4bd-e660-4078-94ae-f46be56c9006.pdf?GoogleAccessId=1089020767582-compute%40developer.gserviceaccount.com&Expires=1766096689&Signature=zZYB17Rj1yfbfhM3Epmjc9PEfmsVpgsCATX5%2Bx2yAo%2FV45xUatVzkAjUkPC48PkR4m%2BF7uIJBToUY2QAZMzNIOre4T0Md2eToXtcYF%2F%2FefS3sZocODRdiC%2BmEuMZjsAPMfkhbCMQZT4lZczQn9sfaWJlWJi%2FGWXKVUwZby3yn06Ed7OqianYbxQj87ENoqYudZFe5qFpI0hmwh4lBrnIM40hb4eZwwbGEvZL2WejNdBgD0cKb3C%2BHwJHkPvd2PAzFfNvuJolBxMN4jE3QCx9DN2MdHGUqb7t3vlP0Kder8m0lMpac%2BPbwZsDVmlF595cFzkKaE928uxzA1Mzkenffg%3D%3D"
227
215
  }
228
216
  }
229
217
  ```
package/index.d.ts CHANGED
@@ -4,18 +4,30 @@ declare module '@apiverve/invoicegenerator' {
4
4
  secure?: boolean;
5
5
  }
6
6
 
7
+ /**
8
+ * Describes fields the current plan does not unlock. Locked fields arrive as null
9
+ * in `data`; `locked_fields` names them, using dot paths for nested fields.
10
+ * Absent when the plan unlocks everything.
11
+ */
12
+ export interface PremiumInfo {
13
+ message: string;
14
+ upgrade_url: string;
15
+ locked_fields: string[];
16
+ }
17
+
7
18
  export interface invoicegeneratorResponse {
8
19
  status: string;
9
20
  error: string | null;
10
21
  data: InvoiceGeneratorData;
11
22
  code?: number;
23
+ premium?: PremiumInfo;
12
24
  }
13
25
 
14
26
 
15
27
  interface InvoiceGeneratorData {
16
- pdfName: string;
17
- expires: number;
18
- downloadURL: string;
28
+ pdfName: null | string;
29
+ expires: number | null;
30
+ downloadURL: null | string;
19
31
  }
20
32
 
21
33
  export default class invoicegeneratorWrapper {
package/index.js CHANGED
@@ -13,16 +13,10 @@ class invoicegeneratorWrapper {
13
13
  throw new Error('API key must be provided as a non-empty string. Get your API key at: https://apiverve.com');
14
14
  }
15
15
 
16
- // Validate API key format (GUID or alphanumeric with hyphens)
17
- const apiKeyPattern = /^[a-zA-Z0-9-]+$/;
16
+ // Validate API key format (GUID, prefixed keys like apv_xxx, or alphanumeric)
17
+ const apiKeyPattern = /^[a-zA-Z0-9_-]+$/;
18
18
  if (!apiKeyPattern.test(api_key)) {
19
- throw new Error('Invalid API key format. API key must be alphanumeric and may contain hyphens. Get your API key at: https://apiverve.com');
20
- }
21
-
22
- // Check minimum length (GUIDs are typically 36 chars with hyphens, or 32 without)
23
- const trimmedKey = api_key.replace(/-/g, '');
24
- if (trimmedKey.length < 32) {
25
- throw new Error('Invalid API key. API key appears to be too short. Get your API key at: https://apiverve.com');
19
+ throw new Error('Invalid API key format. API key must be alphanumeric and may contain hyphens and underscores. Get your API key at: https://apiverve.com');
26
20
  }
27
21
 
28
22
  if (typeof secure !== 'boolean') {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@apiverve/invoicegenerator",
3
- "version": "1.1.13",
3
+ "version": "1.2.0",
4
4
  "description": "Invoice Generator is a simple tool for generating invoices. It returns a PDF of the generated invoice.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "sideEffects": false,
8
8
  "engines": {
9
- "node": ">=14.0.0"
9
+ "node": ">=18.0.0"
10
10
  },
11
11
  "files": [
12
12
  "index.js",
@@ -23,7 +23,7 @@
23
23
  "directory": "npm"
24
24
  },
25
25
  "keywords": [
26
- ""
26
+ "invoice generator", "invoice generator api", "invoice generator tool", "invoice generator software", "invoice generator service"
27
27
  ],
28
28
  "author": {
29
29
  "name": "APIVerve",
@@ -41,8 +41,7 @@
41
41
  "dotenv": "^16.4.7"
42
42
  },
43
43
  "dependencies": {
44
- "node-fetch": "^3.3.2",
45
- "promise": "^8.3.0",
46
- "axios": "1.13.2"
44
+ "axios": "1.13.2",
45
+ "form-data": "^4.0.1"
47
46
  }
48
47
  }