@superdurable/connector-intuit-quickbooks 0.0.0-stage → 0.1.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.
@@ -0,0 +1,505 @@
1
+ // src/generated/definitions.ts
2
+ var ConnectorID = "quickbooks";
3
+ var ProviderID = "quickbooks";
4
+ var FindCustomerBranch = {
5
+ Found: "found",
6
+ NotFound: "notFound",
7
+ Ambiguous: "ambiguous",
8
+ ProviderRejected: "providerRejected",
9
+ InvalidResponse: "invalidResponse",
10
+ Defect: "defect"
11
+ };
12
+ var FindCustomerBranchFound = FindCustomerBranch.Found;
13
+ var FindCustomerBranchNotFound = FindCustomerBranch.NotFound;
14
+ var FindCustomerBranchAmbiguous = FindCustomerBranch.Ambiguous;
15
+ var FindCustomerBranchProviderRejected = FindCustomerBranch.ProviderRejected;
16
+ var FindCustomerBranchInvalidResponse = FindCustomerBranch.InvalidResponse;
17
+ var FindCustomerBranchDefect = FindCustomerBranch.Defect;
18
+ var FindCustomerDefinition = {
19
+ operation: { connectorId: ConnectorID, operationId: "findCustomer" },
20
+ branches: [
21
+ { id: "found", description: "Exactly one customer matches." },
22
+ { id: "notFound", description: "No customer matches; inactive customers count only when the input includes them.", optional: true },
23
+ { id: "ambiguous", description: "Several customers share the email address; the output lists them so the application can choose.", optional: true },
24
+ { id: "providerRejected", description: "QuickBooks conclusively rejected the query, such as a revoked connection or a company the app can no longer reach.", optional: true },
25
+ { id: "invalidResponse", description: "QuickBooks returned an invalid or oversized customer list.", optional: true },
26
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
27
+ ],
28
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
29
+ };
30
+ var FindCustomerMetadata = { kind: "query", idempotency: "none", authorization: "required" };
31
+ var CreateCustomerBranch = {
32
+ Created: "created",
33
+ NameConflict: "nameConflict",
34
+ ProviderRejected: "providerRejected",
35
+ Uncertain: "uncertain",
36
+ Defect: "defect"
37
+ };
38
+ var CreateCustomerBranchCreated = CreateCustomerBranch.Created;
39
+ var CreateCustomerBranchNameConflict = CreateCustomerBranch.NameConflict;
40
+ var CreateCustomerBranchProviderRejected = CreateCustomerBranch.ProviderRejected;
41
+ var CreateCustomerBranchUncertain = CreateCustomerBranch.Uncertain;
42
+ var CreateCustomerBranchDefect = CreateCustomerBranch.Defect;
43
+ var CreateCustomerDefinition = {
44
+ operation: { connectorId: ConnectorID, operationId: "createCustomer" },
45
+ branches: [
46
+ { id: "created", description: "QuickBooks created the customer, or returned the customer this Step already created." },
47
+ { id: "nameConflict", description: "A customer, vendor, or employee already uses the display name (QuickBooks error 6240); resolve it with findCustomer by display name, including a possible earlier attempt.", optional: true },
48
+ { id: "providerRejected", description: "QuickBooks conclusively rejected the customer, such as an invalid field or a revoked connection; nothing was created.", optional: true },
49
+ { id: "uncertain", description: "QuickBooks accepted the request but returned an unusable customer that read-back could not confirm; look it up with findCustomer before creating again.", optional: true },
50
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
51
+ ],
52
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
53
+ };
54
+ var CreateCustomerMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
55
+ var CreateInvoiceBranch = {
56
+ Created: "created",
57
+ ProviderRejected: "providerRejected",
58
+ Uncertain: "uncertain",
59
+ Defect: "defect"
60
+ };
61
+ var CreateInvoiceBranchCreated = CreateInvoiceBranch.Created;
62
+ var CreateInvoiceBranchProviderRejected = CreateInvoiceBranch.ProviderRejected;
63
+ var CreateInvoiceBranchUncertain = CreateInvoiceBranch.Uncertain;
64
+ var CreateInvoiceBranchDefect = CreateInvoiceBranch.Defect;
65
+ var CreateInvoiceDefinition = {
66
+ operation: { connectorId: ConnectorID, operationId: "createInvoice" },
67
+ branches: [
68
+ { id: "created", description: "QuickBooks created the invoice, or returned the invoice this Step already created, with its number, total, and balance." },
69
+ { id: "providerRejected", description: "QuickBooks conclusively rejected the invoice, such as an unknown or inactive customer or item, a duplicate document number, a closed period, or a revoked connection; nothing was created.", optional: true },
70
+ { id: "uncertain", description: "QuickBooks accepted the request but returned an unusable invoice that read-back could not confirm; look it up by document number before creating again.", optional: true },
71
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
72
+ ],
73
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 6e4, maximumAttempts: 6, totalDurationMs: 3e5 } }
74
+ };
75
+ var CreateInvoiceMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
76
+ var GetInvoiceBranch = {
77
+ Found: "found",
78
+ NotFound: "notFound",
79
+ ProviderRejected: "providerRejected",
80
+ InvalidResponse: "invalidResponse",
81
+ Defect: "defect"
82
+ };
83
+ var GetInvoiceBranchFound = GetInvoiceBranch.Found;
84
+ var GetInvoiceBranchNotFound = GetInvoiceBranch.NotFound;
85
+ var GetInvoiceBranchProviderRejected = GetInvoiceBranch.ProviderRejected;
86
+ var GetInvoiceBranchInvalidResponse = GetInvoiceBranch.InvalidResponse;
87
+ var GetInvoiceBranchDefect = GetInvoiceBranch.Defect;
88
+ var GetInvoiceDefinition = {
89
+ operation: { connectorId: ConnectorID, operationId: "getInvoice" },
90
+ branches: [
91
+ { id: "found", description: "The invoice was read." },
92
+ { id: "notFound", description: "The invoice does not exist in the company or was deleted.", optional: true },
93
+ { id: "providerRejected", description: "QuickBooks conclusively rejected the read, such as a revoked connection.", optional: true },
94
+ { id: "invalidResponse", description: "QuickBooks returned an invalid or oversized invoice.", optional: true },
95
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
96
+ ],
97
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
98
+ };
99
+ var GetInvoiceMetadata = { kind: "query", idempotency: "none", authorization: "required" };
100
+ var ListInvoicesBranch = {
101
+ Listed: "listed",
102
+ ProviderRejected: "providerRejected",
103
+ InvalidResponse: "invalidResponse",
104
+ Defect: "defect"
105
+ };
106
+ var ListInvoicesBranchListed = ListInvoicesBranch.Listed;
107
+ var ListInvoicesBranchProviderRejected = ListInvoicesBranch.ProviderRejected;
108
+ var ListInvoicesBranchInvalidResponse = ListInvoicesBranch.InvalidResponse;
109
+ var ListInvoicesBranchDefect = ListInvoicesBranch.Defect;
110
+ var ListInvoicesDefinition = {
111
+ operation: { connectorId: ConnectorID, operationId: "listInvoices" },
112
+ branches: [
113
+ { id: "listed", description: "One page of matching invoices was read; it can be empty." },
114
+ { id: "providerRejected", description: "QuickBooks conclusively rejected the query, such as a revoked connection.", optional: true },
115
+ { id: "invalidResponse", description: "QuickBooks returned an invalid or oversized page of invoices.", optional: true },
116
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
117
+ ],
118
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
119
+ };
120
+ var ListInvoicesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
121
+ var SendInvoiceBranch = {
122
+ Sent: "sent",
123
+ ProviderRejected: "providerRejected",
124
+ Uncertain: "uncertain",
125
+ Defect: "defect"
126
+ };
127
+ var SendInvoiceBranchSent = SendInvoiceBranch.Sent;
128
+ var SendInvoiceBranchProviderRejected = SendInvoiceBranch.ProviderRejected;
129
+ var SendInvoiceBranchUncertain = SendInvoiceBranch.Uncertain;
130
+ var SendInvoiceBranchDefect = SendInvoiceBranch.Defect;
131
+ var SendInvoiceDefinition = {
132
+ operation: { connectorId: ConnectorID, operationId: "sendInvoice" },
133
+ branches: [
134
+ { id: "sent", description: "QuickBooks emailed the invoice, or returned the delivery this Step already made, with EmailStatus EmailSent." },
135
+ { id: "providerRejected", description: "QuickBooks conclusively rejected the delivery, such as an invoice without an address, a deleted invoice, or a revoked connection; nothing was sent.", optional: true },
136
+ { id: "uncertain", description: "QuickBooks accepted the request but returned an unusable invoice that read-back could not confirm; check its EmailStatus with getInvoice before sending again.", optional: true },
137
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
138
+ ],
139
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 6e4, maximumAttempts: 6, totalDurationMs: 3e5 } }
140
+ };
141
+ var SendInvoiceMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
142
+ var RecordPaymentBranch = {
143
+ Recorded: "recorded",
144
+ ProviderRejected: "providerRejected",
145
+ Uncertain: "uncertain",
146
+ Defect: "defect"
147
+ };
148
+ var RecordPaymentBranchRecorded = RecordPaymentBranch.Recorded;
149
+ var RecordPaymentBranchProviderRejected = RecordPaymentBranch.ProviderRejected;
150
+ var RecordPaymentBranchUncertain = RecordPaymentBranch.Uncertain;
151
+ var RecordPaymentBranchDefect = RecordPaymentBranch.Defect;
152
+ var RecordPaymentDefinition = {
153
+ operation: { connectorId: ConnectorID, operationId: "recordPayment" },
154
+ branches: [
155
+ { id: "recorded", description: "QuickBooks recorded the payment, or returned the payment this Step already recorded, with the invoices it applies to." },
156
+ { id: "providerRejected", description: "QuickBooks conclusively rejected the payment, such as an invoice of another customer, an amount above the balance, an invalid deposit account, a closed period, or a revoked connection; nothing was recorded.", optional: true },
157
+ { id: "uncertain", description: "QuickBooks accepted the request but returned an unusable payment that read-back could not confirm; inspect the invoice before paying again.", optional: true },
158
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
159
+ ],
160
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 6e4, maximumAttempts: 6, totalDurationMs: 3e5 } }
161
+ };
162
+ var RecordPaymentMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
163
+
164
+ // src/generated/connection.ts
165
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
166
+ import { newRefreshingCredentialProvider } from "@superdurable/connectors-sdk/projectconfig";
167
+ var Connection = class {
168
+ /** Stable provider and connection name. */
169
+ reference;
170
+ /** Bound provider operations. */
171
+ operations;
172
+ /** Validate a reference and bind operations. */
173
+ constructor(reference, operations) {
174
+ this.reference = ConnectionRefSchema.parse(reference);
175
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
176
+ if (!operations) throw new TypeError("connector operations are required");
177
+ this.operations = operations;
178
+ }
179
+ };
180
+ function newConnection(client, reference) {
181
+ if (!client) throw new TypeError("connector client is required");
182
+ return new Connection(reference, client);
183
+ }
184
+ function newConnectionWithOperations(operations, reference) {
185
+ return new Connection(reference, operations);
186
+ }
187
+ function newProjectConnection(project, connectionName, createClient) {
188
+ if (!project) throw new TypeError("loaded project is required");
189
+ const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
190
+ const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
191
+ if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
192
+ return newConnection(createClient(project, connectionName), reference);
193
+ }
194
+ function newProjectCredentialProvider(project, connectionName, decode, encode, decodeShared) {
195
+ return newRefreshingCredentialProvider(project.connections, { connectorId: ConnectorID, connectionName }, decode, encode, decodeShared);
196
+ }
197
+
198
+ // src/generated/models.ts
199
+ import { z } from "zod";
200
+ import { SecretString } from "@superdurable/connectors-sdk";
201
+ var goTimeJSONPattern = /^(\d{4})-(\d{2})-(\d{2})T(\d{1,2}):(\d{2}):(\d{2})(?:[.,](\d+))?(Z|([+-])(\d{2}):(\d{2}))$/;
202
+ function isGoTimeJSON(value) {
203
+ const match = goTimeJSONPattern.exec(value);
204
+ if (!match) return false;
205
+ const [, yearText, monthText, dayText, hourText, minuteText, secondText, , zone, , zoneHourText, zoneMinuteText] = match;
206
+ const year = Number(yearText);
207
+ const month = Number(monthText);
208
+ const day = Number(dayText);
209
+ const isLeap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
210
+ const monthDays = [31, isLeap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
211
+ return month >= 1 && month <= 12 && day >= 1 && day <= monthDays[month - 1] && Number(hourText) <= 23 && Number(minuteText) <= 59 && Number(secondText) <= 59 && (zone === "Z" || Number(zoneHourText) <= 24 && Number(zoneMinuteText) <= 60);
212
+ }
213
+ function canonicalGoTimeJSON(value) {
214
+ const match = goTimeJSONPattern.exec(value);
215
+ const [, year, month, day, hour, minute, second, fraction, zone, sign, zoneHour, zoneMinute] = match;
216
+ const clock = year + "-" + month + "-" + day + "T" + hour.padStart(2, "0") + ":" + minute + ":" + second;
217
+ const digits = (fraction ?? "").slice(0, 9).replace(/0+$/, "");
218
+ const offsetMinutes = zone === "Z" ? 0 : (Number(zoneHour) * 60 + Number(zoneMinute)) * (sign === "+" ? 1 : -1);
219
+ if (Math.abs(offsetMinutes) >= 1440) return value;
220
+ const offset = offsetMinutes === 0 ? "Z" : (offsetMinutes > 0 ? "+" : "-") + String(Math.floor(Math.abs(offsetMinutes) / 60)).padStart(2, "0") + ":" + String(Math.abs(offsetMinutes) % 60).padStart(2, "0");
221
+ return clock + (digits ? "." + digits : "") + offset;
222
+ }
223
+ var GoTimeJSONSchema = z.string().refine(isGoTimeJSON, "invalid Go time.Time JSON timestamp").transform(canonicalGoTimeJSON);
224
+ var ConfigSchema = z.object({
225
+ "environment": z.string().optional(),
226
+ "realmId": z.string().optional(),
227
+ "maxResponseBytes": z.number().int().optional()
228
+ });
229
+ function decodeCredentials(value) {
230
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
231
+ const fields = value;
232
+ const allowed = /* @__PURE__ */ new Set(["access_token", "client_id", "client_secret", "id_token", "refresh_token"]);
233
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
234
+ if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new TypeError("credential access_token has an invalid type");
235
+ if (fields["client_id"] != null && !(typeof fields["client_id"] === "string")) throw new TypeError("credential client_id has an invalid type");
236
+ if (fields["client_secret"] != null && !(typeof fields["client_secret"] === "string")) throw new TypeError("credential client_secret has an invalid type");
237
+ if (fields["id_token"] != null && !(typeof fields["id_token"] === "string")) throw new TypeError("credential id_token has an invalid type");
238
+ if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new TypeError("credential refresh_token has an invalid type");
239
+ const credentials = {};
240
+ if (!fields["client_id"]) throw new TypeError("credential client_id is required");
241
+ credentials.clientId = fields["client_id"] ?? "";
242
+ if (!fields["client_secret"]) throw new TypeError("credential client_secret is required");
243
+ credentials.clientSecret = new SecretString(fields["client_secret"] ?? "");
244
+ if (!fields["access_token"]) throw new TypeError("credential access_token is required");
245
+ credentials.accessToken = new SecretString(fields["access_token"] ?? "");
246
+ if (!fields["refresh_token"]) throw new TypeError("credential refresh_token is required");
247
+ credentials.refreshToken = new SecretString(fields["refresh_token"] ?? "");
248
+ credentials.idToken = new SecretString(fields["id_token"] ?? "");
249
+ return credentials;
250
+ }
251
+ function decodeSharedCredentials(value) {
252
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
253
+ const fields = value;
254
+ const allowed = /* @__PURE__ */ new Set(["access_token", "client_id", "client_secret", "id_token", "refresh_token"]);
255
+ if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
256
+ if (fields["access_token"] != null && !(typeof fields["access_token"] === "string")) throw new TypeError("credential access_token has an invalid type");
257
+ if (fields["client_id"] != null && !(typeof fields["client_id"] === "string")) throw new TypeError("credential client_id has an invalid type");
258
+ if (fields["client_secret"] != null && !(typeof fields["client_secret"] === "string")) throw new TypeError("credential client_secret has an invalid type");
259
+ if (fields["id_token"] != null && !(typeof fields["id_token"] === "string")) throw new TypeError("credential id_token has an invalid type");
260
+ if (fields["refresh_token"] != null && !(typeof fields["refresh_token"] === "string")) throw new TypeError("credential refresh_token has an invalid type");
261
+ const credentials = {};
262
+ if (!fields["client_id"]) throw new TypeError("credential client_id is required");
263
+ credentials.clientId = fields["client_id"] ?? "";
264
+ credentials.clientSecret = new SecretString(fields["client_secret"] ?? "");
265
+ if (!fields["access_token"]) throw new TypeError("credential access_token is required");
266
+ credentials.accessToken = new SecretString(fields["access_token"] ?? "");
267
+ credentials.refreshToken = new SecretString(fields["refresh_token"] ?? "");
268
+ credentials.idToken = new SecretString(fields["id_token"] ?? "");
269
+ return credentials;
270
+ }
271
+ var FindCustomerInputSchema = z.strictObject({
272
+ "emailAddress": z.string().optional(),
273
+ "displayName": z.string().optional(),
274
+ "includesInactive": z.boolean().optional()
275
+ });
276
+ var CustomerSchema = z.strictObject({
277
+ "customerId": z.string(),
278
+ "syncToken": z.string().optional(),
279
+ "displayName": z.string(),
280
+ "givenName": z.string().optional(),
281
+ "familyName": z.string().optional(),
282
+ "companyName": z.string().optional(),
283
+ "emailAddress": z.string().optional(),
284
+ "phone": z.string().optional(),
285
+ "isActive": z.boolean(),
286
+ "balance": z.string().optional(),
287
+ "currencyCode": z.string().optional(),
288
+ "createdAt": GoTimeJSONSchema.nullable().optional(),
289
+ "updatedAt": GoTimeJSONSchema.nullable().optional()
290
+ });
291
+ var FindCustomerOutputSchema = z.strictObject({
292
+ "emailAddress": z.string().optional(),
293
+ "displayName": z.string().optional(),
294
+ "customer": CustomerSchema.optional(),
295
+ "matches": z.array(CustomerSchema).optional()
296
+ });
297
+ var CreateCustomerInputSchema = z.strictObject({
298
+ "displayName": z.string(),
299
+ "emailAddress": z.string().optional(),
300
+ "givenName": z.string().optional(),
301
+ "familyName": z.string().optional(),
302
+ "companyName": z.string().optional(),
303
+ "phone": z.string().optional(),
304
+ "currencyCode": z.string().optional()
305
+ });
306
+ var CreateCustomerOutputSchema = z.strictObject({
307
+ "customer": CustomerSchema,
308
+ "displayName": z.string()
309
+ });
310
+ var InvoiceLineInputSchema = z.strictObject({
311
+ "itemId": z.string(),
312
+ "description": z.string().optional(),
313
+ "quantity": z.string().optional(),
314
+ "unitPrice": z.string().optional(),
315
+ "amount": z.string().optional(),
316
+ "taxCodeId": z.string().optional(),
317
+ "serviceDate": z.string().optional()
318
+ });
319
+ var CreateInvoiceInputSchema = z.strictObject({
320
+ "customerId": z.string(),
321
+ "lines": z.array(InvoiceLineInputSchema).nullable(),
322
+ "txnDate": z.string().optional(),
323
+ "dueDate": z.string().optional(),
324
+ "docNumber": z.string().optional(),
325
+ "billEmail": z.string().optional(),
326
+ "currencyCode": z.string().optional(),
327
+ "customerMemo": z.string().optional(),
328
+ "privateNote": z.string().optional()
329
+ });
330
+ var InvoiceLineSchema = z.strictObject({
331
+ "lineId": z.string().optional(),
332
+ "detailType": z.string(),
333
+ "description": z.string().optional(),
334
+ "amount": z.string().optional(),
335
+ "itemId": z.string().optional(),
336
+ "itemName": z.string().optional(),
337
+ "quantity": z.string().optional(),
338
+ "unitPrice": z.string().optional(),
339
+ "taxCodeId": z.string().optional(),
340
+ "serviceDate": z.string().optional()
341
+ });
342
+ var InvoiceSchema = z.strictObject({
343
+ "invoiceId": z.string(),
344
+ "syncToken": z.string().optional(),
345
+ "docNumber": z.string().optional(),
346
+ "customerId": z.string(),
347
+ "customerName": z.string().optional(),
348
+ "txnDate": z.string().optional(),
349
+ "dueDate": z.string().optional(),
350
+ "currencyCode": z.string().optional(),
351
+ "exchangeRate": z.string().optional(),
352
+ "lines": z.array(InvoiceLineSchema).nullable(),
353
+ "totalAmount": z.string(),
354
+ "totalTax": z.string().optional(),
355
+ "balance": z.string(),
356
+ "emailStatus": z.string().optional(),
357
+ "billEmail": z.string().optional(),
358
+ "deliveredAt": GoTimeJSONSchema.nullable().optional(),
359
+ "customerMemo": z.string().optional(),
360
+ "privateNote": z.string().optional(),
361
+ "linkedPaymentIds": z.array(z.string()).optional(),
362
+ "createdAt": GoTimeJSONSchema.nullable().optional(),
363
+ "updatedAt": GoTimeJSONSchema.nullable().optional()
364
+ });
365
+ var CreateInvoiceOutputSchema = z.strictObject({
366
+ "invoice": InvoiceSchema,
367
+ "docNumber": z.string().optional()
368
+ });
369
+ var GetInvoiceInputSchema = z.strictObject({
370
+ "invoiceId": z.string()
371
+ });
372
+ var ListInvoicesInputSchema = z.strictObject({
373
+ "customerId": z.string().optional(),
374
+ "docNumber": z.string().optional(),
375
+ "isOpenOnly": z.boolean().optional(),
376
+ "txnDateFrom": z.string().optional(),
377
+ "txnDateTo": z.string().optional(),
378
+ "updatedSince": GoTimeJSONSchema.nullable().optional(),
379
+ "startPosition": z.number().int().optional(),
380
+ "maxResults": z.number().int().optional()
381
+ });
382
+ var InvoicePageSchema = z.strictObject({
383
+ "invoices": z.array(InvoiceSchema).nullable(),
384
+ "startPosition": z.number().int(),
385
+ "maxResults": z.number().int(),
386
+ "hasMorePages": z.boolean(),
387
+ "nextStartPosition": z.number().int().optional()
388
+ });
389
+ var SendInvoiceInputSchema = z.strictObject({
390
+ "invoiceId": z.string(),
391
+ "sendTo": z.string().optional()
392
+ });
393
+ var RecordPaymentInputSchema = z.strictObject({
394
+ "customerId": z.string(),
395
+ "invoiceId": z.string(),
396
+ "amount": z.string(),
397
+ "txnDate": z.string().optional(),
398
+ "paymentReferenceNumber": z.string().optional(),
399
+ "depositAccountId": z.string().optional(),
400
+ "paymentMethodId": z.string().optional(),
401
+ "currencyCode": z.string().optional(),
402
+ "privateNote": z.string().optional()
403
+ });
404
+ var PaymentApplicationSchema = z.strictObject({
405
+ "invoiceId": z.string(),
406
+ "amount": z.string()
407
+ });
408
+ var PaymentSchema = z.strictObject({
409
+ "paymentId": z.string(),
410
+ "syncToken": z.string().optional(),
411
+ "customerId": z.string(),
412
+ "txnDate": z.string().optional(),
413
+ "totalAmount": z.string(),
414
+ "unappliedAmount": z.string().optional(),
415
+ "currencyCode": z.string().optional(),
416
+ "paymentReferenceNumber": z.string().optional(),
417
+ "depositAccountId": z.string().optional(),
418
+ "appliedInvoices": z.array(PaymentApplicationSchema).optional(),
419
+ "privateNote": z.string().optional(),
420
+ "createdAt": GoTimeJSONSchema.nullable().optional(),
421
+ "updatedAt": GoTimeJSONSchema.nullable().optional()
422
+ });
423
+
424
+ export {
425
+ ConnectorID,
426
+ ProviderID,
427
+ FindCustomerBranch,
428
+ FindCustomerBranchFound,
429
+ FindCustomerBranchNotFound,
430
+ FindCustomerBranchAmbiguous,
431
+ FindCustomerBranchProviderRejected,
432
+ FindCustomerBranchInvalidResponse,
433
+ FindCustomerBranchDefect,
434
+ FindCustomerDefinition,
435
+ FindCustomerMetadata,
436
+ CreateCustomerBranch,
437
+ CreateCustomerBranchCreated,
438
+ CreateCustomerBranchNameConflict,
439
+ CreateCustomerBranchProviderRejected,
440
+ CreateCustomerBranchUncertain,
441
+ CreateCustomerBranchDefect,
442
+ CreateCustomerDefinition,
443
+ CreateCustomerMetadata,
444
+ CreateInvoiceBranch,
445
+ CreateInvoiceBranchCreated,
446
+ CreateInvoiceBranchProviderRejected,
447
+ CreateInvoiceBranchUncertain,
448
+ CreateInvoiceBranchDefect,
449
+ CreateInvoiceDefinition,
450
+ CreateInvoiceMetadata,
451
+ GetInvoiceBranch,
452
+ GetInvoiceBranchFound,
453
+ GetInvoiceBranchNotFound,
454
+ GetInvoiceBranchProviderRejected,
455
+ GetInvoiceBranchInvalidResponse,
456
+ GetInvoiceBranchDefect,
457
+ GetInvoiceDefinition,
458
+ GetInvoiceMetadata,
459
+ ListInvoicesBranch,
460
+ ListInvoicesBranchListed,
461
+ ListInvoicesBranchProviderRejected,
462
+ ListInvoicesBranchInvalidResponse,
463
+ ListInvoicesBranchDefect,
464
+ ListInvoicesDefinition,
465
+ ListInvoicesMetadata,
466
+ SendInvoiceBranch,
467
+ SendInvoiceBranchSent,
468
+ SendInvoiceBranchProviderRejected,
469
+ SendInvoiceBranchUncertain,
470
+ SendInvoiceBranchDefect,
471
+ SendInvoiceDefinition,
472
+ SendInvoiceMetadata,
473
+ RecordPaymentBranch,
474
+ RecordPaymentBranchRecorded,
475
+ RecordPaymentBranchProviderRejected,
476
+ RecordPaymentBranchUncertain,
477
+ RecordPaymentBranchDefect,
478
+ RecordPaymentDefinition,
479
+ RecordPaymentMetadata,
480
+ Connection,
481
+ newConnection,
482
+ newConnectionWithOperations,
483
+ newProjectConnection,
484
+ newProjectCredentialProvider,
485
+ ConfigSchema,
486
+ decodeCredentials,
487
+ decodeSharedCredentials,
488
+ FindCustomerInputSchema,
489
+ CustomerSchema,
490
+ FindCustomerOutputSchema,
491
+ CreateCustomerInputSchema,
492
+ CreateCustomerOutputSchema,
493
+ InvoiceLineInputSchema,
494
+ CreateInvoiceInputSchema,
495
+ InvoiceLineSchema,
496
+ InvoiceSchema,
497
+ CreateInvoiceOutputSchema,
498
+ GetInvoiceInputSchema,
499
+ ListInvoicesInputSchema,
500
+ InvoicePageSchema,
501
+ SendInvoiceInputSchema,
502
+ RecordPaymentInputSchema,
503
+ PaymentApplicationSchema,
504
+ PaymentSchema
505
+ };