@invoiceleaf/integration-sdk 1.6.0 → 2.0.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/dist/context/IntegrationContext.d.ts +94 -24
- package/dist/context/IntegrationContext.d.ts.map +1 -1
- package/dist/context/types.d.ts +98 -25
- package/dist/context/types.d.ts.map +1 -1
- package/dist/helpers/defineHandler.d.ts +120 -5
- package/dist/helpers/defineHandler.d.ts.map +1 -1
- package/dist/helpers/defineHandler.js +5 -5
- package/dist/helpers/defineHandler.js.map +1 -1
- package/dist/helpers/firstFinite.d.ts +13 -0
- package/dist/helpers/firstFinite.d.ts.map +1 -0
- package/dist/helpers/firstFinite.js +20 -0
- package/dist/helpers/firstFinite.js.map +1 -0
- package/dist/helpers/httpRetry.d.ts +70 -0
- package/dist/helpers/httpRetry.d.ts.map +1 -0
- package/dist/helpers/httpRetry.js +166 -0
- package/dist/helpers/httpRetry.js.map +1 -0
- package/dist/helpers/toBoundedInt.d.ts +14 -0
- package/dist/helpers/toBoundedInt.d.ts.map +1 -0
- package/dist/helpers/toBoundedInt.js +26 -0
- package/dist/helpers/toBoundedInt.js.map +1 -0
- package/dist/helpers/toDateOnly.d.ts +22 -0
- package/dist/helpers/toDateOnly.d.ts.map +1 -0
- package/dist/helpers/toDateOnly.js +40 -0
- package/dist/helpers/toDateOnly.js.map +1 -0
- package/dist/helpers/toErrorMessage.d.ts +14 -0
- package/dist/helpers/toErrorMessage.d.ts.map +1 -0
- package/dist/helpers/toErrorMessage.js +19 -0
- package/dist/helpers/toErrorMessage.js.map +1 -0
- package/dist/helpers/toFiniteNumber.d.ts +12 -0
- package/dist/helpers/toFiniteNumber.d.ts.map +1 -0
- package/dist/helpers/toFiniteNumber.js +17 -0
- package/dist/helpers/toFiniteNumber.js.map +1 -0
- package/dist/helpers/trimToUndefined.d.ts +12 -0
- package/dist/helpers/trimToUndefined.d.ts.map +1 -0
- package/dist/helpers/trimToUndefined.js +18 -0
- package/dist/helpers/trimToUndefined.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/types/actions.d.ts +2 -0
- package/dist/types/actions.d.ts.map +1 -1
- package/dist/types/invocation.d.ts +1 -1
- package/dist/types/invocation.d.ts.map +1 -1
- package/dist/types/manifest.d.ts +4 -2
- package/dist/types/manifest.d.ts.map +1 -1
- package/dist/types/triggers.d.ts +3 -2
- package/dist/types/triggers.d.ts.map +1 -1
- package/dist/types/triggers.js +1 -1
- package/dist/types/triggers.js.map +1 -1
- package/package.json +7 -5
|
@@ -31,8 +31,14 @@ export interface IntegrationContext<TConfig = Record<string, unknown>> {
|
|
|
31
31
|
readonly userId: string;
|
|
32
32
|
/** Installation ID */
|
|
33
33
|
readonly installationId: string;
|
|
34
|
-
/**
|
|
35
|
-
|
|
34
|
+
/**
|
|
35
|
+
* User-provided configuration.
|
|
36
|
+
*
|
|
37
|
+
* This is typed as `Partial<TConfig>` because the installation may not have
|
|
38
|
+
* all configuration fields populated. Always check for the presence of
|
|
39
|
+
* required fields before using them.
|
|
40
|
+
*/
|
|
41
|
+
readonly config: Partial<TConfig>;
|
|
36
42
|
/** Data access client */
|
|
37
43
|
readonly data: DataClient;
|
|
38
44
|
/** Credential access client */
|
|
@@ -43,12 +49,27 @@ export interface IntegrationContext<TConfig = Record<string, unknown>> {
|
|
|
43
49
|
readonly state: StateClient;
|
|
44
50
|
/** Email transport and mailbox operations */
|
|
45
51
|
readonly email: EmailClient;
|
|
52
|
+
/**
|
|
53
|
+
* Privileged tax-filing capability (validate / submit via the host).
|
|
54
|
+
*
|
|
55
|
+
* Only present for verified integrations that have been granted the `filing`
|
|
56
|
+
* capability; enforcement is server-side. Plugins must guard usage with a
|
|
57
|
+
* presence check (`if (context.filing) { ... }`).
|
|
58
|
+
*/
|
|
59
|
+
readonly filing?: FilingClient;
|
|
46
60
|
/** Structured logger */
|
|
47
61
|
readonly logger: Logger;
|
|
48
62
|
}
|
|
49
63
|
/**
|
|
50
64
|
* Client for accessing InvoiceLeaf data.
|
|
51
65
|
* All operations are scoped to the current space.
|
|
66
|
+
*
|
|
67
|
+
* **Error handling contract:** All methods throw on failure (network errors,
|
|
68
|
+
* API errors, invalid requests). Methods that semantically return "not found"
|
|
69
|
+
* (e.g. {@link StateClient.get}, {@link MappingsClient.get}) return `null`
|
|
70
|
+
* on success when no record exists — they only throw on transport/server errors.
|
|
71
|
+
* Plugins should use try/catch for operations where graceful degradation is
|
|
72
|
+
* preferred over hard failure (e.g. checkpoint reads, deduplication checks).
|
|
52
73
|
*/
|
|
53
74
|
export interface DataClient {
|
|
54
75
|
/**
|
|
@@ -79,6 +100,10 @@ export interface DataClient {
|
|
|
79
100
|
* Get a category by ID.
|
|
80
101
|
*/
|
|
81
102
|
getCategory(id: string): Promise<Category>;
|
|
103
|
+
/**
|
|
104
|
+
* Get a tag by ID.
|
|
105
|
+
*/
|
|
106
|
+
getTag(id: string): Promise<Tag>;
|
|
82
107
|
/**
|
|
83
108
|
* List all tags.
|
|
84
109
|
*/
|
|
@@ -90,6 +115,12 @@ export interface DataClient {
|
|
|
90
115
|
format: string;
|
|
91
116
|
documentIds?: string[];
|
|
92
117
|
filters?: DocumentListParams;
|
|
118
|
+
/** Output filename (without extension) */
|
|
119
|
+
filename?: string;
|
|
120
|
+
/** Currency code for the export (e.g. "EUR", "USD") */
|
|
121
|
+
currency?: string;
|
|
122
|
+
/** Report type identifier */
|
|
123
|
+
report?: number;
|
|
93
124
|
}): Promise<Export>;
|
|
94
125
|
/**
|
|
95
126
|
* Get export status by ID.
|
|
@@ -111,7 +142,9 @@ export interface DocumentImportInput {
|
|
|
111
142
|
source: string;
|
|
112
143
|
description?: string;
|
|
113
144
|
externalRef?: string;
|
|
114
|
-
|
|
145
|
+
categoryId?: string;
|
|
146
|
+
tagIds?: string[];
|
|
147
|
+
dedupeTtlSeconds?: number;
|
|
115
148
|
}
|
|
116
149
|
export interface DocumentImportResult {
|
|
117
150
|
documentId: string;
|
|
@@ -136,6 +169,7 @@ export interface DocumentIntegrationMetaPatchInput {
|
|
|
136
169
|
export interface StateClient {
|
|
137
170
|
/**
|
|
138
171
|
* Read installation-scoped state value by key.
|
|
172
|
+
* Returns `null` when the key does not exist. Throws on transport/server errors.
|
|
139
173
|
*/
|
|
140
174
|
get<T = unknown>(key: string): Promise<T | null>;
|
|
141
175
|
/**
|
|
@@ -155,12 +189,7 @@ export interface EmailAttachmentInput {
|
|
|
155
189
|
contentBase64: string;
|
|
156
190
|
}
|
|
157
191
|
export interface SendSmtpEmailInput {
|
|
158
|
-
|
|
159
|
-
smtpPort: number;
|
|
160
|
-
smtpSecure?: boolean;
|
|
161
|
-
smtpUsername: string;
|
|
162
|
-
smtpPassword: string;
|
|
163
|
-
fromAddress: string;
|
|
192
|
+
fromAddress?: string;
|
|
164
193
|
to: string[];
|
|
165
194
|
cc?: string[];
|
|
166
195
|
bcc?: string[];
|
|
@@ -177,21 +206,13 @@ export interface SendSmtpEmailResult {
|
|
|
177
206
|
response?: string;
|
|
178
207
|
}
|
|
179
208
|
export interface SmtpImapConnectionTestInput {
|
|
180
|
-
smtpHost: string;
|
|
181
|
-
smtpPort: number;
|
|
182
|
-
smtpSecure?: boolean;
|
|
183
|
-
smtpUsername: string;
|
|
184
|
-
smtpPassword: string;
|
|
185
|
-
imapHost: string;
|
|
186
|
-
imapPort: number;
|
|
187
|
-
imapSecure?: boolean;
|
|
188
|
-
imapUsername: string;
|
|
189
|
-
imapPassword: string;
|
|
190
209
|
imapFolder?: string;
|
|
191
210
|
}
|
|
192
211
|
export interface SmtpImapConnectionTestResult {
|
|
193
212
|
smtp: boolean;
|
|
194
213
|
imap: boolean;
|
|
214
|
+
smtpError?: string;
|
|
215
|
+
imapError?: string;
|
|
195
216
|
}
|
|
196
217
|
export interface ImapPdfAttachment {
|
|
197
218
|
uid: number;
|
|
@@ -204,11 +225,6 @@ export interface ImapPdfAttachment {
|
|
|
204
225
|
date?: string;
|
|
205
226
|
}
|
|
206
227
|
export interface CrawlImapPdfAttachmentsInput {
|
|
207
|
-
imapHost: string;
|
|
208
|
-
imapPort: number;
|
|
209
|
-
imapSecure?: boolean;
|
|
210
|
-
imapUsername: string;
|
|
211
|
-
imapPassword: string;
|
|
212
228
|
imapFolder?: string;
|
|
213
229
|
searchFilter?: string;
|
|
214
230
|
maxMessagesPerRun?: number;
|
|
@@ -260,6 +276,58 @@ export interface CredentialConnectionInfo {
|
|
|
260
276
|
valid?: boolean;
|
|
261
277
|
errorMessage?: string;
|
|
262
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* Privileged client for tax filing (e.g. ELSTER via the native ERiC service).
|
|
281
|
+
*
|
|
282
|
+
* Granted only to verified integrations with the `filing` capability. The
|
|
283
|
+
* sandbox builds and passes the transfer XML; certificate bytes and PIN never
|
|
284
|
+
* enter the isolate — the plugin references the customer's certificate by a
|
|
285
|
+
* stable handle and the host performs the native call.
|
|
286
|
+
*/
|
|
287
|
+
export interface FilingClient {
|
|
288
|
+
/**
|
|
289
|
+
* Validate a built transfer XML against the filing schema without sending it.
|
|
290
|
+
* Runs in test mode by default.
|
|
291
|
+
*/
|
|
292
|
+
validate(input: FilingValidateInput): Promise<FilingValidateResult>;
|
|
293
|
+
/**
|
|
294
|
+
* Submit a built transfer XML to the tax authority using the customer's
|
|
295
|
+
* stored certificate (referenced by handle). Irreversible in production mode.
|
|
296
|
+
*/
|
|
297
|
+
submit(input: FilingSubmitInput): Promise<FilingSubmitResult>;
|
|
298
|
+
}
|
|
299
|
+
export interface FilingValidateInput {
|
|
300
|
+
/** The built transfer-package XML (Nutzdaten + envelope). */
|
|
301
|
+
xml: string;
|
|
302
|
+
/** Form type, e.g. "ustva" or "euer". */
|
|
303
|
+
formType: string;
|
|
304
|
+
/** Tax period (e.g. "2026-01") or year, depending on the form. */
|
|
305
|
+
period?: string;
|
|
306
|
+
/** When true (default), validate against the test path / test Finanzamt. */
|
|
307
|
+
testMode?: boolean;
|
|
308
|
+
}
|
|
309
|
+
export interface FilingValidateResult {
|
|
310
|
+
ok: boolean;
|
|
311
|
+
errors?: string[];
|
|
312
|
+
}
|
|
313
|
+
export interface FilingSubmitInput {
|
|
314
|
+
/** The built transfer-package XML (Nutzdaten + envelope). */
|
|
315
|
+
xml: string;
|
|
316
|
+
/** Form type, e.g. "ustva" or "euer". */
|
|
317
|
+
formType: string;
|
|
318
|
+
/** Tax period (e.g. "2026-01") or year, depending on the form. */
|
|
319
|
+
period?: string;
|
|
320
|
+
/** Stable handle referencing the customer's stored certificate. */
|
|
321
|
+
certHandle: string;
|
|
322
|
+
/** When true, route to the test path instead of a real submission. */
|
|
323
|
+
testMode?: boolean;
|
|
324
|
+
}
|
|
325
|
+
export interface FilingSubmitResult {
|
|
326
|
+
transferTicket: string;
|
|
327
|
+
/** GCS reference to the stored receipt PDF, if available. */
|
|
328
|
+
receiptFileSource?: string;
|
|
329
|
+
serverResponse?: string;
|
|
330
|
+
}
|
|
263
331
|
export interface MappingRecord {
|
|
264
332
|
system: string;
|
|
265
333
|
entity: string;
|
|
@@ -280,7 +348,9 @@ export interface MappingFindByExternalInput {
|
|
|
280
348
|
export interface MappingUpsertInput extends MappingRecord {
|
|
281
349
|
}
|
|
282
350
|
export interface MappingsClient {
|
|
351
|
+
/** Returns `null` when no mapping exists. Throws on transport/server errors. */
|
|
283
352
|
get(input: MappingGetInput): Promise<MappingRecord | null>;
|
|
353
|
+
/** Returns `null` when no mapping exists. Throws on transport/server errors. */
|
|
284
354
|
findByExternal(input: MappingFindByExternalInput): Promise<MappingRecord | null>;
|
|
285
355
|
upsert(input: MappingUpsertInput): Promise<void>;
|
|
286
356
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationContext.d.ts","sourceRoot":"","sources":["../../src/context/IntegrationContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,GAAG,EAC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kB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9C;AAGD,YAAY,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,GAAG,EACH,MAAM,EACN,kBAAkB,EAClB,UAAU,EACV,UAAU,GACX,MAAM,YAAY,CAAC"}
|
package/dist/context/types.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export interface Document {
|
|
|
15
15
|
category?: Category;
|
|
16
16
|
/** Tags associated with the document */
|
|
17
17
|
tags?: Tag[];
|
|
18
|
+
/** Space member who owns/uploaded the document */
|
|
19
|
+
member?: DocumentMember;
|
|
18
20
|
/** Description/notes */
|
|
19
21
|
description?: string;
|
|
20
22
|
/** Supplier/vendor company */
|
|
@@ -93,6 +95,8 @@ export interface Document {
|
|
|
93
95
|
errorType?: number;
|
|
94
96
|
/** Error message */
|
|
95
97
|
errorMessage?: string;
|
|
98
|
+
/** Processing/activity log */
|
|
99
|
+
log?: string;
|
|
96
100
|
/** Payment date (ISO string) */
|
|
97
101
|
paymentDate?: string;
|
|
98
102
|
/** Payment method */
|
|
@@ -101,6 +105,8 @@ export interface Document {
|
|
|
101
105
|
paymentStatus?: PaymentStatus;
|
|
102
106
|
/** Invoice series ID */
|
|
103
107
|
invoiceSeriesId?: string;
|
|
108
|
+
/** Template ID used for generating this document */
|
|
109
|
+
templateId?: string;
|
|
104
110
|
/** Tax treatment classification */
|
|
105
111
|
taxTreatment?: string;
|
|
106
112
|
/** Tax system (EU_VAT, US_SALES_TAX) */
|
|
@@ -115,10 +121,18 @@ export interface Document {
|
|
|
115
121
|
taxExemptionReason?: string;
|
|
116
122
|
/** Tax determination status */
|
|
117
123
|
taxDeterminationStatus?: string;
|
|
124
|
+
/** Tax determination trace */
|
|
125
|
+
taxDeterminationTrace?: string;
|
|
118
126
|
/** Line items */
|
|
119
127
|
lineItems?: DocumentLineItem[];
|
|
120
128
|
/** Tax breakdown items */
|
|
121
129
|
taxItems?: DocumentTaxItem[];
|
|
130
|
+
/** Barcodes detected on the document */
|
|
131
|
+
barcodes?: DocumentBarcode[];
|
|
132
|
+
/** ID of the next document in sequence */
|
|
133
|
+
next?: string;
|
|
134
|
+
/** ID of the previous document in sequence */
|
|
135
|
+
previous?: string;
|
|
122
136
|
/** Display name (computed) */
|
|
123
137
|
displayName?: string;
|
|
124
138
|
}
|
|
@@ -135,6 +149,8 @@ export interface Currency {
|
|
|
135
149
|
code: string;
|
|
136
150
|
symbol?: string;
|
|
137
151
|
name?: string;
|
|
152
|
+
/** Number of decimal places (ISO 4217 minor units, e.g. 2 for EUR, 0 for JPY) */
|
|
153
|
+
minorUnits?: number;
|
|
138
154
|
}
|
|
139
155
|
export interface PaymentMethod {
|
|
140
156
|
id: string;
|
|
@@ -142,40 +158,95 @@ export interface PaymentMethod {
|
|
|
142
158
|
}
|
|
143
159
|
export interface DocumentLineItem {
|
|
144
160
|
id?: string;
|
|
145
|
-
|
|
161
|
+
name?: string;
|
|
162
|
+
lineIdentifier?: string;
|
|
163
|
+
itemSellerIdentifier?: string;
|
|
164
|
+
unitCode?: string;
|
|
146
165
|
quantity?: number;
|
|
147
|
-
|
|
166
|
+
/** Tax rate as a percentage in range 0–100 (e.g. 19 for 19% VAT) */
|
|
167
|
+
taxPercentage?: number;
|
|
168
|
+
/** Price per unit (before tax) */
|
|
169
|
+
unitAmount?: number;
|
|
170
|
+
/** Line net amount before tax: quantity * unitAmount */
|
|
148
171
|
netAmount?: number;
|
|
172
|
+
/** Tax amount for this line: netAmount * (taxPercentage / 100) */
|
|
149
173
|
taxAmount?: number;
|
|
174
|
+
/** Line total including tax: netAmount + taxAmount */
|
|
150
175
|
totalAmount?: number;
|
|
176
|
+
lineDiscount?: number;
|
|
177
|
+
lineDiscountReason?: string;
|
|
151
178
|
}
|
|
152
179
|
export interface DocumentTaxItem {
|
|
153
180
|
id?: string;
|
|
154
|
-
|
|
155
|
-
|
|
181
|
+
/** Display name of the tax (e.g. "VAT", "GST 10%") */
|
|
182
|
+
name?: string;
|
|
183
|
+
/** Tax rate as a percentage in range 0–100 (e.g. 19 for 19% VAT) */
|
|
184
|
+
taxPercentage?: number;
|
|
185
|
+
/** Taxable base amount before tax (i.e. the net/subtotal this tax applies to) */
|
|
186
|
+
netAmount?: number;
|
|
187
|
+
/** Computed tax amount: netAmount * (taxPercentage / 100) */
|
|
156
188
|
taxAmount?: number;
|
|
157
|
-
|
|
189
|
+
/** Total tax collected across all line items for this tax rate (may differ from taxAmount for multi-line documents) */
|
|
190
|
+
totalTax?: number;
|
|
191
|
+
/** Tax role in accounting (e.g. "INVOICE_TAX", "SELF_ASSESSED_PAYABLE", "SELF_ASSESSED_RECOVERABLE", "IMPORT_TAX", "USE_TAX", "WITHHOLDING") */
|
|
192
|
+
taxRole?: string;
|
|
193
|
+
/** Reference to the tax jurisdiction/registration this tax applies to */
|
|
194
|
+
taxJurisdictionId?: string;
|
|
195
|
+
/** Source of the tax rate (e.g. "MANUAL", "PROVIDER", "RULESET", "AUTHORITY", "DOCUMENT", "UNKNOWN") */
|
|
196
|
+
rateSource?: string;
|
|
197
|
+
}
|
|
198
|
+
export interface DocumentBarcode {
|
|
199
|
+
/** Barcode category identifier for internal classification */
|
|
200
|
+
code?: string;
|
|
201
|
+
type?: string;
|
|
202
|
+
rawCode?: string;
|
|
203
|
+
}
|
|
204
|
+
export interface DocumentMember {
|
|
205
|
+
uid?: string;
|
|
206
|
+
firstname?: string;
|
|
207
|
+
lastname?: string;
|
|
208
|
+
email?: string;
|
|
209
|
+
imageUrl?: string;
|
|
210
|
+
deleted?: boolean;
|
|
211
|
+
/** Computed display name */
|
|
212
|
+
displayName?: string;
|
|
213
|
+
/** Computed initials */
|
|
214
|
+
initials?: string;
|
|
158
215
|
}
|
|
159
216
|
export interface Company {
|
|
160
217
|
id: string;
|
|
161
|
-
|
|
218
|
+
space?: {
|
|
219
|
+
id: string;
|
|
220
|
+
};
|
|
221
|
+
userId?: string;
|
|
222
|
+
deleted?: boolean;
|
|
223
|
+
lastUpdate: number;
|
|
224
|
+
created: number;
|
|
162
225
|
name: string;
|
|
163
226
|
displayName?: string;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
phone?: string;
|
|
167
|
-
website?: string;
|
|
168
|
-
address?: Address;
|
|
169
|
-
metadata?: Record<string, unknown>;
|
|
170
|
-
createdAt: string;
|
|
171
|
-
updatedAt: string;
|
|
172
|
-
}
|
|
173
|
-
export interface Address {
|
|
227
|
+
country?: string;
|
|
228
|
+
countryIso?: string;
|
|
174
229
|
street?: string;
|
|
175
|
-
|
|
230
|
+
addressLine2?: string;
|
|
176
231
|
state?: string;
|
|
177
|
-
|
|
178
|
-
|
|
232
|
+
zip?: string;
|
|
233
|
+
city?: string;
|
|
234
|
+
contactPerson?: string;
|
|
235
|
+
email?: string;
|
|
236
|
+
phone?: string;
|
|
237
|
+
fax?: string;
|
|
238
|
+
taxNumber?: string;
|
|
239
|
+
vatId?: string;
|
|
240
|
+
commercialRegister?: string;
|
|
241
|
+
electronicAddress?: string;
|
|
242
|
+
electronicAddressScheme?: string;
|
|
243
|
+
iban?: string;
|
|
244
|
+
bic?: string;
|
|
245
|
+
url?: string;
|
|
246
|
+
icon?: string;
|
|
247
|
+
billingAddress?: boolean;
|
|
248
|
+
supplier?: number;
|
|
249
|
+
receiver?: number;
|
|
179
250
|
}
|
|
180
251
|
export interface Category {
|
|
181
252
|
id: string;
|
|
@@ -183,7 +254,7 @@ export interface Category {
|
|
|
183
254
|
name: string;
|
|
184
255
|
color?: string;
|
|
185
256
|
icon?: string;
|
|
186
|
-
parentId?: string;
|
|
257
|
+
parentId?: string | null;
|
|
187
258
|
documentCount?: number;
|
|
188
259
|
createdAt: string;
|
|
189
260
|
updatedAt: string;
|
|
@@ -193,7 +264,6 @@ export interface Tag {
|
|
|
193
264
|
spaceId: string;
|
|
194
265
|
name: string;
|
|
195
266
|
color?: string;
|
|
196
|
-
documentCount?: number;
|
|
197
267
|
createdAt: string;
|
|
198
268
|
updatedAt: string;
|
|
199
269
|
}
|
|
@@ -215,24 +285,27 @@ export interface ListParams {
|
|
|
215
285
|
/** Filter by specific IDs */
|
|
216
286
|
ids?: string[];
|
|
217
287
|
page?: number;
|
|
218
|
-
|
|
288
|
+
/** Items per page (backend parameter name) */
|
|
289
|
+
limit?: number;
|
|
219
290
|
sortBy?: string;
|
|
220
291
|
sortDirection?: 'asc' | 'desc';
|
|
292
|
+
/** Search/filter query (e.g. company name search) */
|
|
293
|
+
query?: string;
|
|
221
294
|
}
|
|
222
295
|
export interface DocumentListParams extends ListParams {
|
|
223
296
|
status?: DocumentStatus;
|
|
224
297
|
companyId?: string;
|
|
225
298
|
categoryId?: string;
|
|
226
299
|
tagIds?: string[];
|
|
227
|
-
|
|
228
|
-
|
|
300
|
+
startDate?: number;
|
|
301
|
+
endDate?: number;
|
|
229
302
|
search?: string;
|
|
230
303
|
}
|
|
231
304
|
export interface ListResult<T> {
|
|
232
305
|
items: T[];
|
|
233
306
|
total: number;
|
|
234
307
|
page: number;
|
|
235
|
-
|
|
308
|
+
limit: number;
|
|
236
309
|
hasMore: boolean;
|
|
237
310
|
}
|
|
238
311
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAA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,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import type { IntegrationContext } from '../context/IntegrationContext.js';
|
|
2
|
+
/**
|
|
3
|
+
* Standard base result shape that all integration handlers should return.
|
|
4
|
+
*
|
|
5
|
+
* Integrations are free to extend this interface with domain-specific fields
|
|
6
|
+
* (e.g. `documentId`, `synced`, `failures`), but every handler result should
|
|
7
|
+
* at minimum include `success` so the runtime can determine outcome without
|
|
8
|
+
* inspecting opaque payloads.
|
|
9
|
+
*/
|
|
10
|
+
export interface HandlerResult {
|
|
11
|
+
/** Whether the handler completed successfully. */
|
|
12
|
+
success: boolean;
|
|
13
|
+
/** Human-readable summary (present on success or failure). */
|
|
14
|
+
message?: string;
|
|
15
|
+
/** Error description when `success` is false. */
|
|
16
|
+
error?: string;
|
|
17
|
+
/** If true the handler intentionally did no work (e.g. notification disabled). */
|
|
18
|
+
skipped?: boolean;
|
|
19
|
+
/** Machine-readable reason code when `skipped` is true. */
|
|
20
|
+
reason?: string;
|
|
21
|
+
/** Arbitrary structured details the caller may inspect. */
|
|
22
|
+
details?: Record<string, unknown>;
|
|
23
|
+
}
|
|
2
24
|
/**
|
|
3
25
|
* Handler function type.
|
|
4
26
|
*/
|
|
@@ -28,8 +50,8 @@ export type IntegrationHandler<TInput = unknown, TOutput = unknown, TConfig = Re
|
|
|
28
50
|
* @example
|
|
29
51
|
* ```typescript
|
|
30
52
|
* interface ExportInput {
|
|
31
|
-
*
|
|
32
|
-
*
|
|
53
|
+
* startDate: number;
|
|
54
|
+
* endDate: number;
|
|
33
55
|
* format: 'csv' | 'xml';
|
|
34
56
|
* }
|
|
35
57
|
*
|
|
@@ -40,11 +62,11 @@ export type IntegrationHandler<TInput = unknown, TOutput = unknown, TConfig = Re
|
|
|
40
62
|
*
|
|
41
63
|
* export const exportToDATEV = defineHandler<ExportInput, ExportOutput>(
|
|
42
64
|
* async (input, context) => {
|
|
43
|
-
* context.logger.info('Starting export', {
|
|
65
|
+
* context.logger.info('Starting export', { startDate: input.startDate });
|
|
44
66
|
*
|
|
45
67
|
* const documents = await context.data.listDocuments({
|
|
46
|
-
*
|
|
47
|
-
*
|
|
68
|
+
* startDate: input.startDate,
|
|
69
|
+
* endDate: input.endDate,
|
|
48
70
|
* });
|
|
49
71
|
*
|
|
50
72
|
* const exportResult = await context.data.createExport({
|
|
@@ -63,6 +85,10 @@ export type IntegrationHandler<TInput = unknown, TOutput = unknown, TConfig = Re
|
|
|
63
85
|
export declare function defineHandler<TInput = unknown, TOutput = unknown, TConfig = Record<string, unknown>>(handler: HandlerFunction<TInput, TOutput, TConfig>): HandlerFunction<TInput, TOutput, TConfig>;
|
|
64
86
|
/**
|
|
65
87
|
* Event handler input types for built-in events.
|
|
88
|
+
*
|
|
89
|
+
* Each input shape matches the normalized payload produced by the backend
|
|
90
|
+
* IntegrationEventDispatcher.normalizeEventPayload(). All event payloads
|
|
91
|
+
* include a `spaceId` field identifying the workspace where the event occurred.
|
|
66
92
|
*/
|
|
67
93
|
export interface DocumentCreatedInput {
|
|
68
94
|
documentId: string;
|
|
@@ -73,6 +99,7 @@ export interface DocumentCreatedInput {
|
|
|
73
99
|
companyId?: string;
|
|
74
100
|
categoryId?: string;
|
|
75
101
|
};
|
|
102
|
+
spaceId: string;
|
|
76
103
|
}
|
|
77
104
|
export interface DocumentUpdatedInput {
|
|
78
105
|
documentId: string;
|
|
@@ -82,6 +109,7 @@ export interface DocumentUpdatedInput {
|
|
|
82
109
|
status: string;
|
|
83
110
|
};
|
|
84
111
|
changes: string[];
|
|
112
|
+
spaceId: string;
|
|
85
113
|
}
|
|
86
114
|
export interface DocumentProcessedInput {
|
|
87
115
|
documentId: string;
|
|
@@ -93,9 +121,23 @@ export interface DocumentProcessedInput {
|
|
|
93
121
|
totalAmount?: number;
|
|
94
122
|
currency?: string;
|
|
95
123
|
};
|
|
124
|
+
spaceId: string;
|
|
96
125
|
}
|
|
97
126
|
export interface DocumentDeletedInput {
|
|
98
127
|
documentId: string;
|
|
128
|
+
spaceId: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Generic document event input for sync-on-event handlers.
|
|
132
|
+
* Supports both direct invocation (`documentId` at top level)
|
|
133
|
+
* and event payload shape (`document.id` nested).
|
|
134
|
+
*/
|
|
135
|
+
export interface DocumentEventInput {
|
|
136
|
+
documentId?: string;
|
|
137
|
+
document?: {
|
|
138
|
+
id?: string;
|
|
139
|
+
};
|
|
140
|
+
spaceId?: string;
|
|
99
141
|
}
|
|
100
142
|
export interface CompanyCreatedInput {
|
|
101
143
|
companyId: string;
|
|
@@ -104,6 +146,60 @@ export interface CompanyCreatedInput {
|
|
|
104
146
|
name: string;
|
|
105
147
|
taxId?: string;
|
|
106
148
|
};
|
|
149
|
+
spaceId: string;
|
|
150
|
+
}
|
|
151
|
+
export interface CompanyUpdatedInput {
|
|
152
|
+
companyId: string;
|
|
153
|
+
company: {
|
|
154
|
+
id: string;
|
|
155
|
+
name: string;
|
|
156
|
+
taxId?: string;
|
|
157
|
+
};
|
|
158
|
+
spaceId: string;
|
|
159
|
+
}
|
|
160
|
+
export interface CompanyDeletedInput {
|
|
161
|
+
companyId: string;
|
|
162
|
+
spaceId: string;
|
|
163
|
+
}
|
|
164
|
+
export interface TagCreatedInput {
|
|
165
|
+
tagId: string;
|
|
166
|
+
tag: {
|
|
167
|
+
id: string;
|
|
168
|
+
name: string;
|
|
169
|
+
};
|
|
170
|
+
spaceId: string;
|
|
171
|
+
}
|
|
172
|
+
export interface TagUpdatedInput {
|
|
173
|
+
tagId: string;
|
|
174
|
+
tag: {
|
|
175
|
+
id: string;
|
|
176
|
+
name: string;
|
|
177
|
+
};
|
|
178
|
+
spaceId: string;
|
|
179
|
+
}
|
|
180
|
+
export interface TagDeletedInput {
|
|
181
|
+
tagId: string;
|
|
182
|
+
spaceId: string;
|
|
183
|
+
}
|
|
184
|
+
export interface CategoryCreatedInput {
|
|
185
|
+
categoryId: string;
|
|
186
|
+
category: {
|
|
187
|
+
id: string;
|
|
188
|
+
name: string;
|
|
189
|
+
};
|
|
190
|
+
spaceId: string;
|
|
191
|
+
}
|
|
192
|
+
export interface CategoryUpdatedInput {
|
|
193
|
+
categoryId: string;
|
|
194
|
+
category: {
|
|
195
|
+
id: string;
|
|
196
|
+
name: string;
|
|
197
|
+
};
|
|
198
|
+
spaceId: string;
|
|
199
|
+
}
|
|
200
|
+
export interface CategoryDeletedInput {
|
|
201
|
+
categoryId: string;
|
|
202
|
+
spaceId: string;
|
|
107
203
|
}
|
|
108
204
|
export interface ExportCompletedInput {
|
|
109
205
|
exportId: string;
|
|
@@ -114,6 +210,7 @@ export interface ExportCompletedInput {
|
|
|
114
210
|
downloadUrl?: string;
|
|
115
211
|
documentCount?: number;
|
|
116
212
|
};
|
|
213
|
+
spaceId: string;
|
|
117
214
|
}
|
|
118
215
|
export interface ReminderTriggeredInput {
|
|
119
216
|
reminderId: string;
|
|
@@ -129,6 +226,24 @@ export interface ReminderTriggeredInput {
|
|
|
129
226
|
aiMode?: 'off' | 'light_rewrite' | 'tool_enabled' | string;
|
|
130
227
|
};
|
|
131
228
|
}
|
|
229
|
+
export interface SpaceMemberAddedInput {
|
|
230
|
+
memberId: string;
|
|
231
|
+
member: {
|
|
232
|
+
id: string;
|
|
233
|
+
userId?: string;
|
|
234
|
+
role?: string;
|
|
235
|
+
};
|
|
236
|
+
spaceId: string;
|
|
237
|
+
}
|
|
238
|
+
export interface SpaceMemberRemovedInput {
|
|
239
|
+
memberId: string;
|
|
240
|
+
member: {
|
|
241
|
+
id: string;
|
|
242
|
+
userId?: string;
|
|
243
|
+
role?: string;
|
|
244
|
+
};
|
|
245
|
+
spaceId: string;
|
|
246
|
+
}
|
|
132
247
|
export interface WebhookInput {
|
|
133
248
|
headers: Record<string, string>;
|
|
134
249
|
body: unknown;
|