@company-six/qbosync 0.6.1 → 0.9.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 +40 -3
- package/dist/client.d.ts +46 -5
- package/dist/client.js +164 -11
- package/dist/contract/answers.d.ts +3 -0
- package/dist/contract/attachments.d.ts +98 -0
- package/dist/contract/attachments.js +112 -0
- package/dist/contract/bill.d.ts +12 -0
- package/dist/contract/common.d.ts +7 -0
- package/dist/contract/common.js +3 -0
- package/dist/contract/creditMemo.d.ts +6 -0
- package/dist/contract/errorInWords.d.ts +46 -0
- package/dist/contract/errorInWords.js +193 -0
- package/dist/contract/index.d.ts +26 -0
- package/dist/contract/index.js +2 -0
- package/dist/contract/invoice.d.ts +6 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/sql/002_daily_report.sql +258 -258
- package/sql/003_daily_report_bills.sql +25 -25
|
@@ -72,6 +72,12 @@ export declare const creditMemoSchema: z.ZodObject<{
|
|
|
72
72
|
active: "active";
|
|
73
73
|
voided: "voided";
|
|
74
74
|
}>;
|
|
75
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
76
|
+
file_name: z.ZodString;
|
|
77
|
+
content_type: z.ZodString;
|
|
78
|
+
size_bytes: z.ZodInt;
|
|
79
|
+
sha256: z.ZodString;
|
|
80
|
+
}, z.core.$strict>>>;
|
|
75
81
|
}, z.core.$strict>;
|
|
76
82
|
export type CreditMemoDTO = z.infer<typeof creditMemoSchema>;
|
|
77
83
|
export type CreditMemoLine = z.infer<typeof creditMemoLine>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A document's error as a sentence for the people who read it.
|
|
3
|
+
*
|
|
4
|
+
* Most errors QBO Sync keeps are already sentences it wrote ("Waiting: …"), and pass through unchanged. The
|
|
5
|
+
* exception is a refusal from QuickBooks itself, kept as it arrived:
|
|
6
|
+
*
|
|
7
|
+
* QuickBooks API POST /v3/company/9130…/vendorcredit failed: 400 - {"Fault":{"Error":[{"Message":"Invalid
|
|
8
|
+
* Reference Id","Detail":"…","code":"2500"}],"type":"ValidationFault"},"time":"…"}
|
|
9
|
+
*
|
|
10
|
+
* That text stays in QBO Sync's records, where it helps whoever investigates. Screens, and the reports QBO Sync
|
|
11
|
+
* sends to apps, show `text` instead; `technical` holds the original for a "Technical details" line.
|
|
12
|
+
*
|
|
13
|
+
* ## One place for every refusal
|
|
14
|
+
*
|
|
15
|
+
* `RULES` is the whole list: each entry recognises one kind of refusal and says it in words, the first match wins,
|
|
16
|
+
* and a refusal no entry knows still reads as QuickBooks' own sentence without the wrapper. A new kind is one new
|
|
17
|
+
* entry here (and a test): nothing else changes, in QBO Sync or in any app.
|
|
18
|
+
*
|
|
19
|
+
* QBO Sync rewords before it reports to an app, so an app shows `error` as it arrives. An app holding text stored
|
|
20
|
+
* before that can pass it through this function; text already in words comes back as it is. Safe in a browser.
|
|
21
|
+
*/
|
|
22
|
+
export interface ErrorInWords {
|
|
23
|
+
/** What to show a person. */
|
|
24
|
+
text: string;
|
|
25
|
+
/** The original, when `text` reworded any of it; null when the error was already in words. */
|
|
26
|
+
technical: string | null;
|
|
27
|
+
}
|
|
28
|
+
/** A refusal from QuickBooks, as a rule reads it. */
|
|
29
|
+
export interface QuickBooksRefusal {
|
|
30
|
+
/** The HTTP status QuickBooks answered with. */
|
|
31
|
+
status: number;
|
|
32
|
+
/** QuickBooks' own number for the fault ("2500"); "" when it sent none. */
|
|
33
|
+
code: string;
|
|
34
|
+
/** QuickBooks' short name for the fault ("Invalid Reference Id"); "" when it sent none. */
|
|
35
|
+
message: string;
|
|
36
|
+
/** QuickBooks' sentence about it; "" when it sent none. */
|
|
37
|
+
detail: string;
|
|
38
|
+
/** What was being saved, in words ("vendor credit"); "" when not known. */
|
|
39
|
+
thing: string;
|
|
40
|
+
/** True when QBO Sync was only reading from QuickBooks. */
|
|
41
|
+
reading: boolean;
|
|
42
|
+
/** True when the refused call was the renewal of QBO Sync's access to the company's QuickBooks. */
|
|
43
|
+
renewal: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** `error` for a person to read, and the original when any of it was reworded. */
|
|
46
|
+
export declare function errorInWords(error: string | null | undefined): ErrorInWords;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A document's error as a sentence for the people who read it.
|
|
3
|
+
*
|
|
4
|
+
* Most errors QBO Sync keeps are already sentences it wrote ("Waiting: …"), and pass through unchanged. The
|
|
5
|
+
* exception is a refusal from QuickBooks itself, kept as it arrived:
|
|
6
|
+
*
|
|
7
|
+
* QuickBooks API POST /v3/company/9130…/vendorcredit failed: 400 - {"Fault":{"Error":[{"Message":"Invalid
|
|
8
|
+
* Reference Id","Detail":"…","code":"2500"}],"type":"ValidationFault"},"time":"…"}
|
|
9
|
+
*
|
|
10
|
+
* That text stays in QBO Sync's records, where it helps whoever investigates. Screens, and the reports QBO Sync
|
|
11
|
+
* sends to apps, show `text` instead; `technical` holds the original for a "Technical details" line.
|
|
12
|
+
*
|
|
13
|
+
* ## One place for every refusal
|
|
14
|
+
*
|
|
15
|
+
* `RULES` is the whole list: each entry recognises one kind of refusal and says it in words, the first match wins,
|
|
16
|
+
* and a refusal no entry knows still reads as QuickBooks' own sentence without the wrapper. A new kind is one new
|
|
17
|
+
* entry here (and a test): nothing else changes, in QBO Sync or in any app.
|
|
18
|
+
*
|
|
19
|
+
* QBO Sync rewords before it reports to an app, so an app shows `error` as it arrives. An app holding text stored
|
|
20
|
+
* before that can pass it through this function; text already in words comes back as it is. Safe in a browser.
|
|
21
|
+
*/
|
|
22
|
+
/** QuickBooks' record names, as they appear in the address called, in words. */
|
|
23
|
+
const THINGS = {
|
|
24
|
+
invoice: "invoice",
|
|
25
|
+
creditmemo: "credit memo",
|
|
26
|
+
bill: "bill",
|
|
27
|
+
vendorcredit: "vendor credit",
|
|
28
|
+
payment: "payment",
|
|
29
|
+
refundreceipt: "refund",
|
|
30
|
+
billpayment: "bill payment",
|
|
31
|
+
purchase: "expense",
|
|
32
|
+
transfer: "transfer",
|
|
33
|
+
deposit: "deposit",
|
|
34
|
+
journalentry: "journal entry",
|
|
35
|
+
vendor: "vendor",
|
|
36
|
+
customer: "customer",
|
|
37
|
+
item: "product",
|
|
38
|
+
account: "account",
|
|
39
|
+
attachable: "attachment",
|
|
40
|
+
// A file being sent to, or read back from, a record (QBO Sync migration 069).
|
|
41
|
+
upload: "file",
|
|
42
|
+
download: "file",
|
|
43
|
+
};
|
|
44
|
+
const AGAIN = "then try again";
|
|
45
|
+
const the = (r) => (r.thing ? `the ${r.thing}` : "this");
|
|
46
|
+
const a = (r) => (r.thing ? `${/^[aeiou]/.test(r.thing) ? "an" : "a"} ${r.thing}` : "a record");
|
|
47
|
+
const says = (r) => `${r.message} ${r.detail}`;
|
|
48
|
+
/**
|
|
49
|
+
* Every refusal QBO Sync says in its own words, most specific first. What the connection or QuickBooks itself is
|
|
50
|
+
* doing (the first three) outranks what the fault says, because then the fault is not about the document.
|
|
51
|
+
*/
|
|
52
|
+
const RULES = [
|
|
53
|
+
{
|
|
54
|
+
// QBO Sync's access ran out or was taken away: nothing about the document.
|
|
55
|
+
when: (r) => r.renewal || r.status === 401 || r.code === "3200" || /AuthenticationFailed|invalid_grant/i.test(says(r)),
|
|
56
|
+
say: () => `QBO Sync's connection to this company's QuickBooks has expired or was removed. Reconnect QuickBooks in QBO Sync, ${AGAIN}.`,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
when: (r) => r.status === 429,
|
|
60
|
+
say: () => "QuickBooks is handling too many requests right now. Try again in a few minutes.",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
when: (r) => r.status >= 500,
|
|
64
|
+
say: () => "QuickBooks had a problem on its side and could not complete this. Try again in a few minutes.",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
// "Vendor assigned to this transaction has been deleted. Before you can modify this transaction, you must
|
|
68
|
+
// restore S&S (deleted)." Merging two records deletes one of them, which is how this usually happens.
|
|
69
|
+
when: (r) => /has been deleted/i.test(r.detail),
|
|
70
|
+
say: (r) => {
|
|
71
|
+
const kind = (r.detail.match(/([A-Za-z]+) assigned to this transaction has been deleted/)?.[1] ?? "").toLowerCase();
|
|
72
|
+
const name = r.detail.match(/you must restore (.+?) \(deleted\)/i)?.[1]?.trim();
|
|
73
|
+
const what = kind ? `The ${kind}${name ? ` "${name}"` : ""}` : "A record";
|
|
74
|
+
const kept = kind ? `the ${kind} you kept` : "the one you kept";
|
|
75
|
+
return (`${what} that ${the(r)} uses was deleted in QuickBooks (merging two records deletes one of them). ` +
|
|
76
|
+
`Restore it in QuickBooks, or ask QBO Sync staff to use ${kept}, ${AGAIN}.`);
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
when: (r) => /made inactive/i.test(r.detail),
|
|
81
|
+
say: (r) => `Something ${the(r)} uses (a customer, vendor, product, account or class) has been made inactive in QuickBooks. ` +
|
|
82
|
+
`Make it active again in QuickBooks, ${AGAIN}.`,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
when: (r) => r.code === "6140" || /Duplicate Document Number/i.test(says(r)),
|
|
86
|
+
say: (r) => `QuickBooks already has ${a(r)} with this number.`,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
when: (r) => r.code === "6240" || /Duplicate Name Exists/i.test(says(r)),
|
|
90
|
+
say: () => "QuickBooks already uses this name. It keeps one list of names across customers, vendors and employees, so a name " +
|
|
91
|
+
`cannot be used twice. Rename one of them in QuickBooks, ${AGAIN}.`,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
when: (r) => r.code === "5010" || /Stale Object/i.test(says(r)),
|
|
95
|
+
say: () => "Someone changed this in QuickBooks at the same moment. Try again.",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
when: (r) => /Account Period Closed|closing date|books (are|were|have been) closed/i.test(says(r)),
|
|
99
|
+
say: (r) => `The date of ${the(r)} falls in a period this company's books are closed for in QuickBooks. ` +
|
|
100
|
+
`Reopen the period in QuickBooks (or ask whoever closed it), ${AGAIN}.`,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
when: (r) => r.code === "610" || /Object Not Found/i.test(says(r)),
|
|
104
|
+
say: (r) => `QuickBooks could not find a record ${the(r)} needs: it may have been deleted there.`,
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
/** A refusal no rule knows: QuickBooks' own sentence, without the wrapper. */
|
|
108
|
+
function inQuickBooksWords(r) {
|
|
109
|
+
const lead = r.reading ? "QuickBooks could not be read" : `QuickBooks refused ${the(r)}`;
|
|
110
|
+
// QuickBooks often opens its sentence with the fault's name again ("Invalid Reference Id : …").
|
|
111
|
+
const opener = r.message ? new RegExp(`^${r.message.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*:\\s*`, "i") : null;
|
|
112
|
+
let said = (r.detail || r.message).replace(/\s+/g, " ").trim();
|
|
113
|
+
if (opener && r.detail)
|
|
114
|
+
said = said.replace(opener, "").trim() || said;
|
|
115
|
+
if (!said)
|
|
116
|
+
return `${lead} without giving a reason (status ${r.status}).`;
|
|
117
|
+
if (said.length > 300)
|
|
118
|
+
said = `${said.slice(0, 299).trimEnd()}…`;
|
|
119
|
+
return `${lead}: ${said}${/[.!?…]$/.test(said) ? "" : "."}`;
|
|
120
|
+
}
|
|
121
|
+
/** Where QuickBooks' own text starts inside an error, and what the call was. */
|
|
122
|
+
const RAW = /QuickBooks (?:API ([A-Z]+)(?: (\/\S*))?|(token request)) failed: (\d{3}) - /;
|
|
123
|
+
/** The JSON object `text` opens with, and what follows it; null when it does not open with one. */
|
|
124
|
+
function leadingJson(text) {
|
|
125
|
+
if (!text.startsWith("{"))
|
|
126
|
+
return null;
|
|
127
|
+
let depth = 0;
|
|
128
|
+
let inString = false;
|
|
129
|
+
for (let i = 0; i < text.length; i++) {
|
|
130
|
+
const ch = text[i];
|
|
131
|
+
if (inString) {
|
|
132
|
+
if (ch === "\\")
|
|
133
|
+
i++;
|
|
134
|
+
else if (ch === '"')
|
|
135
|
+
inString = false;
|
|
136
|
+
}
|
|
137
|
+
else if (ch === '"')
|
|
138
|
+
inString = true;
|
|
139
|
+
else if (ch === "{")
|
|
140
|
+
depth++;
|
|
141
|
+
else if (ch === "}" && --depth === 0)
|
|
142
|
+
return { json: text.slice(0, i + 1), rest: text.slice(i + 1) };
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
const str = (v) => (typeof v === "string" ? v : typeof v === "number" ? String(v) : "");
|
|
147
|
+
/** QuickBooks' fault out of the body it answered with: its JSON when it is JSON, else the body as its message. */
|
|
148
|
+
function faultOf(body) {
|
|
149
|
+
try {
|
|
150
|
+
const parsed = JSON.parse(body);
|
|
151
|
+
// QuickBooks writes "Fault"/"Error" for a refused document and "fault"/"error" for a refused sign-in.
|
|
152
|
+
const fault = (parsed.Fault ?? parsed.fault);
|
|
153
|
+
const first = (fault?.Error ?? fault?.error)?.[0];
|
|
154
|
+
if (first)
|
|
155
|
+
return { code: str(first.code), message: str(first.Message ?? first.message), detail: str(first.Detail ?? first.detail) };
|
|
156
|
+
// The renewal endpoint's shape: { error: "invalid_grant", error_description: "…" }.
|
|
157
|
+
if (typeof parsed.error === "string")
|
|
158
|
+
return { code: "", message: parsed.error, detail: str(parsed.error_description) };
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
// Not JSON: a page, or a bare line.
|
|
162
|
+
}
|
|
163
|
+
return { code: "", message: body.replace(/\s+/g, " ").trim().slice(0, 300), detail: "" };
|
|
164
|
+
}
|
|
165
|
+
/** `error` for a person to read, and the original when any of it was reworded. */
|
|
166
|
+
export function errorInWords(error) {
|
|
167
|
+
const original = (error ?? "").trim();
|
|
168
|
+
const text = reword(original);
|
|
169
|
+
return { text, technical: text === original ? null : original };
|
|
170
|
+
}
|
|
171
|
+
function reword(error) {
|
|
172
|
+
const found = RAW.exec(error);
|
|
173
|
+
if (!found)
|
|
174
|
+
return error;
|
|
175
|
+
const [whole, method, path, renewal, status] = found;
|
|
176
|
+
const after = error.slice(found.index + whole.length);
|
|
177
|
+
// QuickBooks' answer runs to the end of the text unless it is JSON, which says where it ends.
|
|
178
|
+
const { json: body, rest } = leadingJson(after) ?? { json: after, rest: "" };
|
|
179
|
+
// The record's name follows the company in the address: /v3/company/<id>/vendorcredit[/<id>].
|
|
180
|
+
const record = path?.match(/\/company\/[^/]+\/([a-z]+)/i)?.[1]?.toLowerCase() ?? "";
|
|
181
|
+
const refusal = {
|
|
182
|
+
status: Number(status),
|
|
183
|
+
...faultOf(body.trim()),
|
|
184
|
+
thing: THINGS[record] ?? "",
|
|
185
|
+
reading: method === "GET",
|
|
186
|
+
renewal: Boolean(renewal),
|
|
187
|
+
};
|
|
188
|
+
const rule = RULES.find((r) => r.when(refusal));
|
|
189
|
+
const sentence = rule ? rule.say(refusal) : inQuickBooksWords(refusal);
|
|
190
|
+
// Whatever QBO Sync wrote around it stays ("Could not link to an existing bill: …"), and a second refusal
|
|
191
|
+
// further on is reworded the same way.
|
|
192
|
+
return `${error.slice(0, found.index)}${sentence}${reword(rest)}`;
|
|
193
|
+
}
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { type InvoiceDTO } from "./invoice.ts";
|
|
|
8
8
|
* QBO Sync checks every document with this same code.
|
|
9
9
|
*/
|
|
10
10
|
export * from "./common.ts";
|
|
11
|
+
export * from "./attachments.ts";
|
|
11
12
|
export * from "./invoice.ts";
|
|
12
13
|
export * from "./creditMemo.ts";
|
|
13
14
|
export * from "./bill.ts";
|
|
@@ -15,6 +16,7 @@ export * from "./codes.ts";
|
|
|
15
16
|
export * from "./statusReport.ts";
|
|
16
17
|
export * from "./protocol.ts";
|
|
17
18
|
export * from "./answers.ts";
|
|
19
|
+
export * from "./errorInWords.ts";
|
|
18
20
|
/** An invoice, a credit memo, a bill or a vendor credit: what an app may send. */
|
|
19
21
|
export declare const appDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
22
|
type: z.ZodLiteral<"invoice">;
|
|
@@ -76,6 +78,12 @@ export declare const appDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
76
78
|
active: "active";
|
|
77
79
|
voided: "voided";
|
|
78
80
|
}>;
|
|
81
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
82
|
+
file_name: z.ZodString;
|
|
83
|
+
content_type: z.ZodString;
|
|
84
|
+
size_bytes: z.ZodInt;
|
|
85
|
+
sha256: z.ZodString;
|
|
86
|
+
}, z.core.$strict>>>;
|
|
79
87
|
}, z.core.$strict>, z.ZodObject<{
|
|
80
88
|
type: z.ZodLiteral<"credit_memo">;
|
|
81
89
|
number: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
@@ -129,6 +137,12 @@ export declare const appDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
129
137
|
active: "active";
|
|
130
138
|
voided: "voided";
|
|
131
139
|
}>;
|
|
140
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
141
|
+
file_name: z.ZodString;
|
|
142
|
+
content_type: z.ZodString;
|
|
143
|
+
size_bytes: z.ZodInt;
|
|
144
|
+
sha256: z.ZodString;
|
|
145
|
+
}, z.core.$strict>>>;
|
|
132
146
|
}, z.core.$strict>, z.ZodObject<{
|
|
133
147
|
type: z.ZodLiteral<"bill">;
|
|
134
148
|
due_date: z.ZodOptional<z.ZodString>;
|
|
@@ -218,6 +232,12 @@ export declare const appDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
218
232
|
active: "active";
|
|
219
233
|
voided: "voided";
|
|
220
234
|
}>;
|
|
235
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
236
|
+
file_name: z.ZodString;
|
|
237
|
+
content_type: z.ZodString;
|
|
238
|
+
size_bytes: z.ZodInt;
|
|
239
|
+
sha256: z.ZodString;
|
|
240
|
+
}, z.core.$strict>>>;
|
|
221
241
|
}, z.core.$strict>, z.ZodObject<{
|
|
222
242
|
type: z.ZodLiteral<"vendor_credit">;
|
|
223
243
|
applies_to_bill_ref: z.ZodOptional<z.ZodString>;
|
|
@@ -306,6 +326,12 @@ export declare const appDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
306
326
|
active: "active";
|
|
307
327
|
voided: "voided";
|
|
308
328
|
}>;
|
|
329
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
330
|
+
file_name: z.ZodString;
|
|
331
|
+
content_type: z.ZodString;
|
|
332
|
+
size_bytes: z.ZodInt;
|
|
333
|
+
sha256: z.ZodString;
|
|
334
|
+
}, z.core.$strict>>>;
|
|
309
335
|
}, z.core.$strict>], "type">;
|
|
310
336
|
export type AppDocument = InvoiceDTO | CreditMemoDTO | BillDTO | VendorCreditDTO;
|
|
311
337
|
export type CheckedDocument = {
|
package/dist/contract/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { APP_DOCUMENT_TYPES } from "./protocol.js";
|
|
|
9
9
|
* QBO Sync checks every document with this same code.
|
|
10
10
|
*/
|
|
11
11
|
export * from "./common.js";
|
|
12
|
+
export * from "./attachments.js";
|
|
12
13
|
export * from "./invoice.js";
|
|
13
14
|
export * from "./creditMemo.js";
|
|
14
15
|
export * from "./bill.js";
|
|
@@ -16,6 +17,7 @@ export * from "./codes.js";
|
|
|
16
17
|
export * from "./statusReport.js";
|
|
17
18
|
export * from "./protocol.js";
|
|
18
19
|
export * from "./answers.js";
|
|
20
|
+
export * from "./errorInWords.js";
|
|
19
21
|
/** An invoice, a credit memo, a bill or a vendor credit: what an app may send. */
|
|
20
22
|
export const appDocumentSchema = z.discriminatedUnion("type", [invoiceSchema, creditMemoSchema, billSchema, vendorCreditSchema], {
|
|
21
23
|
error: `type must be one of ${APP_DOCUMENT_TYPES.join(", ")}`,
|
|
@@ -83,6 +83,12 @@ export declare const invoiceSchema: z.ZodObject<{
|
|
|
83
83
|
active: "active";
|
|
84
84
|
voided: "voided";
|
|
85
85
|
}>;
|
|
86
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
87
|
+
file_name: z.ZodString;
|
|
88
|
+
content_type: z.ZodString;
|
|
89
|
+
size_bytes: z.ZodInt;
|
|
90
|
+
sha256: z.ZodString;
|
|
91
|
+
}, z.core.$strict>>>;
|
|
86
92
|
}, z.core.$strict>;
|
|
87
93
|
export type InvoiceDTO = z.infer<typeof invoiceSchema>;
|
|
88
94
|
export type InvoiceLine = z.infer<typeof invoiceLine>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The QBO Sync SDK for an app's server. See README.md. */
|
|
2
2
|
export * from "./contract/index.ts";
|
|
3
|
-
export { QbosyncClient, SIGN_IN_PAGE_PATH, type ConnectionState, type DocumentResult, type Failure, type FailureReason, type QbosyncClientConfig, type SendResult, } from "./client.ts";
|
|
3
|
+
export { QbosyncClient, SIGN_IN_PAGE_PATH, type ConnectionState, type DocumentResult, type Failure, type FailureReason, type QbosyncClientConfig, type AttachmentFile, type SendOptions, type SendResult, type UploadResult, } from "./client.ts";
|
|
4
4
|
export type { CollectResult, ConnectRequestRow, ConnectRequestStore, NewConnectRequest, OpenResult, RequestRefusal } from "./connectRequest.ts";
|
|
5
5
|
export type { ConnectionRow, ConnectionStore, Log, TokenAnswer } from "./connection.ts";
|
|
6
6
|
export { isNewerReport, verifySignature, type CheckedStatusReports, type InvalidReport, type PublicSigningKey, type StatusReportEntry, type StatusReportResult, } from "./statusReports.ts";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@company-six/qbosync",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Connect an app to QBO Sync: send invoices, credit memos, bills and vendor credits to QuickBooks, and hear back what happened to them.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|