@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineHandler.d.ts","sourceRoot":"","sources":["../../src/helpers/defineHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"defineHandler.d.ts","sourceRoot":"","sources":["../../src/helpers/defineHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAM3E;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAMD;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,I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E,CAAC;CACxB"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @example
|
|
5
5
|
* ```typescript
|
|
6
6
|
* interface ExportInput {
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* startDate: number;
|
|
8
|
+
* endDate: number;
|
|
9
9
|
* format: 'csv' | 'xml';
|
|
10
10
|
* }
|
|
11
11
|
*
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
*
|
|
17
17
|
* export const exportToDATEV = defineHandler<ExportInput, ExportOutput>(
|
|
18
18
|
* async (input, context) => {
|
|
19
|
-
* context.logger.info('Starting export', {
|
|
19
|
+
* context.logger.info('Starting export', { startDate: input.startDate });
|
|
20
20
|
*
|
|
21
21
|
* const documents = await context.data.listDocuments({
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* startDate: input.startDate,
|
|
23
|
+
* endDate: input.endDate,
|
|
24
24
|
* });
|
|
25
25
|
*
|
|
26
26
|
* const exportResult = await context.data.createExport({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineHandler.js","sourceRoot":"","sources":["../../src/helpers/defineHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defineHandler.js","sourceRoot":"","sources":["../../src/helpers/defineHandler.ts"],"names":[],"mappings":"AAgEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAkD;IAElD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the first finite number from the provided values, or `undefined` if none are finite.
|
|
3
|
+
*
|
|
4
|
+
* Useful for picking the best available numeric value from multiple optional sources
|
|
5
|
+
* (e.g. totalAmount, netAmount, amountDue).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* firstFinite(item.totalAmount, item.netAmount, 0); // => first finite value
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare function firstFinite(...values: Array<number | undefined>): number | undefined;
|
|
13
|
+
//# sourceMappingURL=firstFinite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firstFinite.d.ts","sourceRoot":"","sources":["../../src/helpers/firstFinite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAOpF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the first finite number from the provided values, or `undefined` if none are finite.
|
|
3
|
+
*
|
|
4
|
+
* Useful for picking the best available numeric value from multiple optional sources
|
|
5
|
+
* (e.g. totalAmount, netAmount, amountDue).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* firstFinite(item.totalAmount, item.netAmount, 0); // => first finite value
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export function firstFinite(...values) {
|
|
13
|
+
for (const value of values) {
|
|
14
|
+
if (Number.isFinite(value)) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=firstFinite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firstFinite.js","sourceRoot":"","sources":["../../src/helpers/firstFinite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,GAAG,MAAiC;IAC9D,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,KAAe,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared HTTP retry logic for integration API clients.
|
|
3
|
+
*
|
|
4
|
+
* All integration clients share identical retry semantics:
|
|
5
|
+
* - GET requests retry on 429 / 500 / 502 / 503 / 504 and network errors.
|
|
6
|
+
* - Mutating requests (POST / PUT / DELETE) only retry on 429 (rate-limit).
|
|
7
|
+
* - Exponential backoff capped at 2 000 ms, up to 3 attempts.
|
|
8
|
+
* - Per-request timeout with AbortController.
|
|
9
|
+
*/
|
|
10
|
+
/** Status codes safe to retry for idempotent (GET) requests. */
|
|
11
|
+
export declare const RETRYABLE_STATUSES: Set<number>;
|
|
12
|
+
/** Status codes safe to retry for mutating (POST/PUT/DELETE) requests. */
|
|
13
|
+
export declare const SAFE_RETRY_STATUSES_FOR_MUTATING: Set<number>;
|
|
14
|
+
/** Default maximum number of request attempts. */
|
|
15
|
+
export declare const DEFAULT_MAX_REQUEST_ATTEMPTS = 3;
|
|
16
|
+
/** Default per-request timeout in milliseconds. */
|
|
17
|
+
export declare const DEFAULT_REQUEST_TIMEOUT_MS = 30000;
|
|
18
|
+
/**
|
|
19
|
+
* Returns exponential-backoff delay for the given attempt, capped at 2 000 ms.
|
|
20
|
+
*
|
|
21
|
+
* Attempt 1 → 250 ms, attempt 2 → 500 ms, attempt 3+ → 2 000 ms.
|
|
22
|
+
*/
|
|
23
|
+
export declare function backoffMs(attempt: number): number;
|
|
24
|
+
/** Promise-based sleep. */
|
|
25
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Options for {@link requestWithRetry} and {@link requestResponseWithRetry}.
|
|
28
|
+
*/
|
|
29
|
+
export interface RequestWithRetryOptions {
|
|
30
|
+
/** HTTP method — determines whether the request is treated as idempotent. */
|
|
31
|
+
method?: string;
|
|
32
|
+
/** Maximum number of attempts (default: 3). */
|
|
33
|
+
maxAttempts?: number;
|
|
34
|
+
/** Per-request timeout in milliseconds (default: 30 000). */
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
/** Whether to include the response body in thrown errors (default: true). */
|
|
37
|
+
includeBodyInError?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Factory that turns a failed HTTP response into an error instance.
|
|
40
|
+
* If not provided, a generic `Error` is thrown.
|
|
41
|
+
*/
|
|
42
|
+
createError?: (message: string, status: number, responseBody: string) => Error & {
|
|
43
|
+
status: number;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Whether the request is semantically idempotent, regardless of HTTP method.
|
|
47
|
+
* Overrides the default GET-based heuristic. Useful for APIs like Dropbox
|
|
48
|
+
* that use POST for read operations.
|
|
49
|
+
*/
|
|
50
|
+
idempotent?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Executes an HTTP request with retry, backoff, and timeout.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const data = await requestWithRetry<MyResponse>(url, init, {
|
|
58
|
+
* method: 'POST',
|
|
59
|
+
* createError: (msg, status, body) => new MyApiError(msg, status, body),
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function requestWithRetry<T>(url: string, init: RequestInit, options?: RequestWithRetryOptions): Promise<T>;
|
|
64
|
+
/**
|
|
65
|
+
* Like {@link requestWithRetry}, but returns the raw `Response` instead of
|
|
66
|
+
* parsing JSON. Useful for binary downloads where the caller needs to read
|
|
67
|
+
* headers or stream the body.
|
|
68
|
+
*/
|
|
69
|
+
export declare function requestResponseWithRetry(url: string, init: RequestInit, options?: RequestWithRetryOptions): Promise<Response>;
|
|
70
|
+
//# sourceMappingURL=httpRetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpRetry.d.ts","sourceRoot":"","sources":["../../src/helpers/httpRetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gEAAgE;AAChE,eAAO,MA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clients.
|
|
3
|
+
*
|
|
4
|
+
* All integration clients share identical retry semantics:
|
|
5
|
+
* - GET requests retry on 429 / 500 / 502 / 503 / 504 and network errors.
|
|
6
|
+
* - Mutating requests (POST / PUT / DELETE) only retry on 429 (rate-limit).
|
|
7
|
+
* - Exponential backoff capped at 2 000 ms, up to 3 attempts.
|
|
8
|
+
* - Per-request timeout with AbortController.
|
|
9
|
+
*/
|
|
10
|
+
/** Status codes safe to retry for idempotent (GET) requests. */
|
|
11
|
+
export const RETRYABLE_STATUSES = new Set([429, 500, 502, 503, 504]);
|
|
12
|
+
/** Status codes safe to retry for mutating (POST/PUT/DELETE) requests. */
|
|
13
|
+
export const SAFE_RETRY_STATUSES_FOR_MUTATING = new Set([429]);
|
|
14
|
+
/** Default maximum number of request attempts. */
|
|
15
|
+
export const DEFAULT_MAX_REQUEST_ATTEMPTS = 3;
|
|
16
|
+
/** Default per-request timeout in milliseconds. */
|
|
17
|
+
export const DEFAULT_REQUEST_TIMEOUT_MS = 30_000;
|
|
18
|
+
/**
|
|
19
|
+
* Returns exponential-backoff delay for the given attempt, capped at 2 000 ms.
|
|
20
|
+
*
|
|
21
|
+
* Attempt 1 → 250 ms, attempt 2 → 500 ms, attempt 3+ → 2 000 ms.
|
|
22
|
+
*/
|
|
23
|
+
export function backoffMs(attempt) {
|
|
24
|
+
return Math.min(2000, 250 * 2 ** (attempt - 1));
|
|
25
|
+
}
|
|
26
|
+
/** Promise-based sleep. */
|
|
27
|
+
export function sleep(ms) {
|
|
28
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Executes an HTTP request with retry, backoff, and timeout.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const data = await requestWithRetry<MyResponse>(url, init, {
|
|
36
|
+
* method: 'POST',
|
|
37
|
+
* createError: (msg, status, body) => new MyApiError(msg, status, body),
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export async function requestWithRetry(url, init, options = {}) {
|
|
42
|
+
const { method = 'GET', maxAttempts = DEFAULT_MAX_REQUEST_ATTEMPTS, timeoutMs = DEFAULT_REQUEST_TIMEOUT_MS, includeBodyInError = true, createError, idempotent, } = options;
|
|
43
|
+
let lastError = null;
|
|
44
|
+
const isIdempotent = idempotent ?? method === 'GET';
|
|
45
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
46
|
+
const controller = new AbortController();
|
|
47
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
48
|
+
// Combine the timeout signal with any caller-supplied signal so that
|
|
49
|
+
// either one can abort the request.
|
|
50
|
+
const signals = [controller.signal];
|
|
51
|
+
if (init.signal)
|
|
52
|
+
signals.push(init.signal);
|
|
53
|
+
const combinedSignal = signals.length > 1 ? AbortSignal.any(signals) : controller.signal;
|
|
54
|
+
try {
|
|
55
|
+
const response = await fetch(url, { ...init, signal: combinedSignal });
|
|
56
|
+
const body = await response.text();
|
|
57
|
+
if (!response.ok) {
|
|
58
|
+
const error = createError
|
|
59
|
+
? createError(`API request failed with status ${response.status}`, response.status, includeBodyInError ? body : '')
|
|
60
|
+
: Object.assign(new Error(`API request failed with status ${response.status}`), { status: response.status, responseBody: includeBodyInError ? body : '' });
|
|
61
|
+
const canRetryStatus = isIdempotent
|
|
62
|
+
? RETRYABLE_STATUSES.has(response.status)
|
|
63
|
+
: SAFE_RETRY_STATUSES_FOR_MUTATING.has(response.status);
|
|
64
|
+
if (attempt < maxAttempts && canRetryStatus) {
|
|
65
|
+
await sleep(backoffMs(attempt));
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
if (body.length === 0) {
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
return JSON.parse(body);
|
|
75
|
+
}
|
|
76
|
+
catch (parseError) {
|
|
77
|
+
const msg = `Failed to parse API response: ${String(parseError)}`;
|
|
78
|
+
throw createError
|
|
79
|
+
? createError(msg, response.status, body.slice(0, 500))
|
|
80
|
+
: new Error(msg);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
lastError = error;
|
|
85
|
+
const errorStatus = error.status;
|
|
86
|
+
if (typeof errorStatus === 'number') {
|
|
87
|
+
const canRetryStatus = isIdempotent
|
|
88
|
+
? RETRYABLE_STATUSES.has(errorStatus)
|
|
89
|
+
: SAFE_RETRY_STATUSES_FOR_MUTATING.has(errorStatus);
|
|
90
|
+
if (attempt < maxAttempts && canRetryStatus) {
|
|
91
|
+
await sleep(backoffMs(attempt));
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else if (isIdempotent && attempt < maxAttempts) {
|
|
96
|
+
// Network errors — only retry for idempotent requests.
|
|
97
|
+
await sleep(backoffMs(attempt));
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
clearTimeout(timeout);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
throw lastError ?? new Error('Request failed after retries.');
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Like {@link requestWithRetry}, but returns the raw `Response` instead of
|
|
110
|
+
* parsing JSON. Useful for binary downloads where the caller needs to read
|
|
111
|
+
* headers or stream the body.
|
|
112
|
+
*/
|
|
113
|
+
export async function requestResponseWithRetry(url, init, options = {}) {
|
|
114
|
+
const { method = 'GET', maxAttempts = DEFAULT_MAX_REQUEST_ATTEMPTS, timeoutMs = DEFAULT_REQUEST_TIMEOUT_MS, includeBodyInError = true, createError, idempotent, } = options;
|
|
115
|
+
let lastError = null;
|
|
116
|
+
const isIdempotent = idempotent ?? method === 'GET';
|
|
117
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
118
|
+
const controller = new AbortController();
|
|
119
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
120
|
+
const signals = [controller.signal];
|
|
121
|
+
if (init.signal)
|
|
122
|
+
signals.push(init.signal);
|
|
123
|
+
const combinedSignal = signals.length > 1 ? AbortSignal.any(signals) : controller.signal;
|
|
124
|
+
try {
|
|
125
|
+
const response = await fetch(url, { ...init, signal: combinedSignal });
|
|
126
|
+
if (!response.ok) {
|
|
127
|
+
const body = includeBodyInError ? await response.text() : '';
|
|
128
|
+
const error = createError
|
|
129
|
+
? createError(`API request failed with status ${response.status}`, response.status, body)
|
|
130
|
+
: Object.assign(new Error(`API request failed with status ${response.status}`), { status: response.status, responseBody: body });
|
|
131
|
+
const canRetryStatus = isIdempotent
|
|
132
|
+
? RETRYABLE_STATUSES.has(response.status)
|
|
133
|
+
: SAFE_RETRY_STATUSES_FOR_MUTATING.has(response.status);
|
|
134
|
+
if (attempt < maxAttempts && canRetryStatus) {
|
|
135
|
+
await sleep(backoffMs(attempt));
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
return response;
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
lastError = error;
|
|
144
|
+
const errorStatus = error.status;
|
|
145
|
+
if (typeof errorStatus === 'number') {
|
|
146
|
+
const canRetryStatus = isIdempotent
|
|
147
|
+
? RETRYABLE_STATUSES.has(errorStatus)
|
|
148
|
+
: SAFE_RETRY_STATUSES_FOR_MUTATING.has(errorStatus);
|
|
149
|
+
if (attempt < maxAttempts && canRetryStatus) {
|
|
150
|
+
await sleep(backoffMs(attempt));
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else if (isIdempotent && attempt < maxAttempts) {
|
|
155
|
+
await sleep(backoffMs(attempt));
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
throw error;
|
|
159
|
+
}
|
|
160
|
+
finally {
|
|
161
|
+
clearTimeout(timeout);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
throw lastError ?? new Error('Request failed after retries.');
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=httpRetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpRetry.js","sourceRoot":"","sources":["../../src/helpers/httpRetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAErE,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,kDAAkD;AAClD,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAE9C,mDAAmD;AACnD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,2BAA2B;AAC3B,MAAM,UAAU,KAAK,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AA2BD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAW,EACX,IAAiB,EACjB,UAAmC,EAAE;IAErC,MAAM,EACJ,MAAM,GAAG,KAAK,EACd,WAAW,GAAG,4BAA4B,EAC1C,SAAS,GAAG,0BAA0B,EACtC,kBAAkB,GAAG,IAAI,EACzB,WAAW,EACX,UAAU,GACX,GAAG,OAAO,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,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS,GAAG,KAAc,CAAC;YAE3B,MAAM,WAAW,GAAI,KAA6B,CAAC,MAAM,CAAC;YAC1D,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;gBACpC,MAAM,cAAc,GAAG,YAAY;oBACjC,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC;oBACrC,CAAC,CAAC,gCAAgC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBACtD,IAAI,OAAO,GAAG,WAAW,IAAI,cAAc,EAAE,CAAC;oBAC5C,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;oBAChC,SAAS;gBACX,CAAC;YACH,CAAC;iBAAM,IAAI,YAAY,IAAI,OAAO,GAAG,WAAW,EAAE,CAAC;gBACjD,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChC,SAAS;YACX,CAAC;YAED,MAAM,KAAK,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED,MAAM,SAAS,IAAI,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clamps a numeric value to an integer within the given `[min, max]` range.
|
|
3
|
+
*
|
|
4
|
+
* Returns `fallback` when the input is not a finite number.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* toBoundedInt(7.9, 5, 1, 10); // => 7
|
|
9
|
+
* toBoundedInt(undefined, 5, 1, 10); // => 5
|
|
10
|
+
* toBoundedInt(100, 5, 1, 10); // => 10
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function toBoundedInt(value: number | undefined, fallback: number, min: number, max: number): number;
|
|
14
|
+
//# sourceMappingURL=toBoundedInt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toBoundedInt.d.ts","sourceRoot":"","sources":["../../src/helpers/toBoundedInt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,MAAM,CAYR"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clamps a numeric value to an integer within the given `[min, max]` range.
|
|
3
|
+
*
|
|
4
|
+
* Returns `fallback` when the input is not a finite number.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* toBoundedInt(7.9, 5, 1, 10); // => 7
|
|
9
|
+
* toBoundedInt(undefined, 5, 1, 10); // => 5
|
|
10
|
+
* toBoundedInt(100, 5, 1, 10); // => 10
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export function toBoundedInt(value, fallback, min, max) {
|
|
14
|
+
if (!Number.isFinite(value)) {
|
|
15
|
+
return fallback;
|
|
16
|
+
}
|
|
17
|
+
const rounded = Math.floor(value);
|
|
18
|
+
if (rounded < min) {
|
|
19
|
+
return min;
|
|
20
|
+
}
|
|
21
|
+
if (rounded > max) {
|
|
22
|
+
return max;
|
|
23
|
+
}
|
|
24
|
+
return rounded;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=toBoundedInt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toBoundedInt.js","sourceRoot":"","sources":["../../src/helpers/toBoundedInt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAyB,EACzB,QAAgB,EAChB,GAAW,EACX,GAAW;IAEX,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAe,CAAC,CAAC;IAC5C,IAAI,OAAO,GAAG,GAAG,EAAE,CAAC;QAClB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,OAAO,GAAG,GAAG,EAAE,CAAC;QAClB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a date string to `YYYY-MM-DD` format, or returns `undefined` if invalid.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* toDateOnly('2024-03-15T10:30:00Z'); // => '2024-03-15'
|
|
7
|
+
* toDateOnly('not-a-date'); // => undefined
|
|
8
|
+
* toDateOnly(undefined); // => undefined
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function toDateOnly(value: string | undefined): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Converts a Unix timestamp (milliseconds) to `YYYY-MM-DD` format, or returns `undefined` if invalid.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* toDateOnlyFromTimestamp(1710489600000); // => '2024-03-15'
|
|
18
|
+
* toDateOnlyFromTimestamp(undefined); // => undefined
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function toDateOnlyFromTimestamp(value: number | undefined): string | undefined;
|
|
22
|
+
//# sourceMappingURL=toDateOnly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toDateOnly.d.ts","sourceRoot":"","sources":["../../src/helpers/toDateOnly.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CASxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CASrF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a date string to `YYYY-MM-DD` format, or returns `undefined` if invalid.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* toDateOnly('2024-03-15T10:30:00Z'); // => '2024-03-15'
|
|
7
|
+
* toDateOnly('not-a-date'); // => undefined
|
|
8
|
+
* toDateOnly(undefined); // => undefined
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export function toDateOnly(value) {
|
|
12
|
+
if (!value) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const date = new Date(value);
|
|
16
|
+
if (Number.isNaN(date.getTime())) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return date.toISOString().slice(0, 10);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Converts a Unix timestamp (milliseconds) to `YYYY-MM-DD` format, or returns `undefined` if invalid.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* toDateOnlyFromTimestamp(1710489600000); // => '2024-03-15'
|
|
27
|
+
* toDateOnlyFromTimestamp(undefined); // => undefined
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function toDateOnlyFromTimestamp(value) {
|
|
31
|
+
if (!Number.isFinite(value)) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const date = new Date(value);
|
|
35
|
+
if (Number.isNaN(date.getTime())) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return date.toISOString().slice(0, 10);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=toDateOnly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toDateOnly.js","sourceRoot":"","sources":["../../src/helpers/toDateOnly.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,KAAyB;IAClD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACjC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAyB;IAC/D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAe,CAAC,CAAC;IACvC,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACjC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts an unknown error value into a human-readable string.
|
|
3
|
+
*
|
|
4
|
+
* For `Error` instances, returns `.message`. For anything else, falls back to `String(error)`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* toErrorMessage(new Error('boom')); // => 'boom'
|
|
9
|
+
* toErrorMessage('string error'); // => 'string error'
|
|
10
|
+
* toErrorMessage(42); // => '42'
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function toErrorMessage(error: unknown): string;
|
|
14
|
+
//# sourceMappingURL=toErrorMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toErrorMessage.d.ts","sourceRoot":"","sources":["../../src/helpers/toErrorMessage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKrD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts an unknown error value into a human-readable string.
|
|
3
|
+
*
|
|
4
|
+
* For `Error` instances, returns `.message`. For anything else, falls back to `String(error)`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* toErrorMessage(new Error('boom')); // => 'boom'
|
|
9
|
+
* toErrorMessage('string error'); // => 'string error'
|
|
10
|
+
* toErrorMessage(42); // => '42'
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export function toErrorMessage(error) {
|
|
14
|
+
if (error instanceof Error) {
|
|
15
|
+
return error.message;
|
|
16
|
+
}
|
|
17
|
+
return String(error);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=toErrorMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toErrorMessage.js","sourceRoot":"","sources":["../../src/helpers/toErrorMessage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the value if it is a finite number, otherwise returns the fallback.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* toFiniteNumber(42, 0); // => 42
|
|
7
|
+
* toFiniteNumber(undefined, 0); // => 0
|
|
8
|
+
* toFiniteNumber(NaN, 0); // => 0
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function toFiniteNumber(value: number | undefined, fallback: number): number;
|
|
12
|
+
//# sourceMappingURL=toFiniteNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toFiniteNumber.d.ts","sourceRoot":"","sources":["../../src/helpers/toFiniteNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKlF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the value if it is a finite number, otherwise returns the fallback.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* toFiniteNumber(42, 0); // => 42
|
|
7
|
+
* toFiniteNumber(undefined, 0); // => 0
|
|
8
|
+
* toFiniteNumber(NaN, 0); // => 0
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export function toFiniteNumber(value, fallback) {
|
|
12
|
+
if (Number.isFinite(value)) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
return fallback;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=toFiniteNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toFiniteNumber.js","sourceRoot":"","sources":["../../src/helpers/toFiniteNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAC,KAAyB,EAAE,QAAgB;IACxE,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,KAAe,CAAC;IACzB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trims whitespace from a string and returns `undefined` if the result is empty.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* trimToUndefined(' hello '); // => 'hello'
|
|
7
|
+
* trimToUndefined(' '); // => undefined
|
|
8
|
+
* trimToUndefined(undefined); // => undefined
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function trimToUndefined(value: string | undefined): string | undefined;
|
|
12
|
+
//# sourceMappingURL=trimToUndefined.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trimToUndefined.d.ts","sourceRoot":"","sources":["../../src/helpers/trimToUndefined.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAM7E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trims whitespace from a string and returns `undefined` if the result is empty.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* trimToUndefined(' hello '); // => 'hello'
|
|
7
|
+
* trimToUndefined(' '); // => undefined
|
|
8
|
+
* trimToUndefined(undefined); // => undefined
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export function trimToUndefined(value) {
|
|
12
|
+
if (!value) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const trimmed = value.trim();
|
|
16
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=trimToUndefined.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trimToUndefined.js","sourceRoot":"","sources":["../../src/helpers/trimToUndefined.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,KAAyB;IACvD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -28,9 +28,18 @@
|
|
|
28
28
|
*/
|
|
29
29
|
export * from './types/index.js';
|
|
30
30
|
export * from './context/index.js';
|
|
31
|
+
export type { EmailClient, EmailAttachmentInput, SendSmtpEmailInput, SendSmtpEmailResult, SmtpImapConnectionTestInput, SmtpImapConnectionTestResult, ImapPdfAttachment, CrawlImapPdfAttachmentsInput, CrawlImapPdfAttachmentsResult, CredentialsClient, CredentialConnectionInfo, FilingClient, FilingValidateInput, FilingValidateResult, FilingSubmitInput, FilingSubmitResult, MappingsClient, MappingRecord, MappingGetInput, MappingFindByExternalInput, MappingUpsertInput, StateClient, DataClient, DocumentImportInput, DocumentImportResult, DocumentFileContent, DocumentIntegrationMetaPatchInput, Logger, } from './context/IntegrationContext.js';
|
|
31
32
|
export { defineIntegration } from './helpers/defineIntegration.js';
|
|
32
33
|
export { defineHandler } from './helpers/defineHandler.js';
|
|
33
34
|
export { createAttachmentFingerprint } from './helpers/createAttachmentFingerprint.js';
|
|
35
|
+
export { firstFinite } from './helpers/firstFinite.js';
|
|
36
|
+
export { toBoundedInt } from './helpers/toBoundedInt.js';
|
|
37
|
+
export { trimToUndefined } from './helpers/trimToUndefined.js';
|
|
38
|
+
export { toErrorMessage } from './helpers/toErrorMessage.js';
|
|
39
|
+
export { toFiniteNumber } from './helpers/toFiniteNumber.js';
|
|
40
|
+
export { toDateOnly, toDateOnlyFromTimestamp } from './helpers/toDateOnly.js';
|
|
41
|
+
export { requestWithRetry, requestResponseWithRetry, backoffMs, sleep, RETRYABLE_STATUSES, SAFE_RETRY_STATUSES_FOR_MUTATING, DEFAULT_MAX_REQUEST_ATTEMPTS, DEFAULT_REQUEST_TIMEOUT_MS, } from './helpers/httpRetry.js';
|
|
42
|
+
export type { RequestWithRetryOptions } from './helpers/httpRetry.js';
|
|
34
43
|
export type { AttachmentFingerprintInput } from './helpers/createAttachmentFingerprint.js';
|
|
35
|
-
export type { IntegrationHandler, HandlerFunction, DocumentCreatedInput, DocumentUpdatedInput, DocumentProcessedInput, DocumentDeletedInput, CompanyCreatedInput, ExportCompletedInput, ReminderTriggeredInput, WebhookInput, ScheduleInput, UserActionInput, } from './helpers/defineHandler.js';
|
|
44
|
+
export type { HandlerResult, IntegrationHandler, HandlerFunction, DocumentCreatedInput, DocumentUpdatedInput, DocumentProcessedInput, DocumentDeletedInput, DocumentEventInput, CompanyCreatedInput, CompanyUpdatedInput, CompanyDeletedInput, TagCreatedInput, TagUpdatedInput, TagDeletedInput, CategoryCreatedInput, CategoryUpdatedInput, CategoryDeletedInput, ExportCompletedInput, ReminderTriggeredInput, SpaceMemberAddedInput, SpaceMemberRemovedInput, WebhookInput, ScheduleInput, UserActionInput, } from './helpers/defineHandler.js';
|
|
36
45
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AACnC,YAAY,EAEV,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,mBAA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