@v3finance/monitoring-sdk 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/LICENSE +21 -0
- package/README.md +322 -2
- package/dist/cjs/client.d.ts +46 -0
- package/dist/cjs/client.d.ts.map +1 -0
- package/dist/cjs/client.js +80 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/core/errors.d.ts +64 -0
- package/dist/cjs/core/errors.d.ts.map +1 -0
- package/dist/cjs/core/errors.js +95 -0
- package/dist/cjs/core/errors.js.map +1 -0
- package/dist/cjs/core/http.d.ts +58 -0
- package/dist/cjs/core/http.d.ts.map +1 -0
- package/dist/cjs/core/http.js +143 -0
- package/dist/cjs/core/http.js.map +1 -0
- package/dist/cjs/core/pagination.d.ts +12 -0
- package/dist/cjs/core/pagination.d.ts.map +1 -0
- package/dist/cjs/core/pagination.js +15 -0
- package/dist/cjs/core/pagination.js.map +1 -0
- package/dist/cjs/core/scope.d.ts +8 -0
- package/dist/cjs/core/scope.d.ts.map +1 -0
- package/dist/cjs/core/scope.js +3 -0
- package/dist/cjs/core/scope.js.map +1 -0
- package/dist/cjs/generated/types.d.ts +336 -0
- package/dist/cjs/generated/types.d.ts.map +1 -0
- package/dist/cjs/generated/types.js +5 -0
- package/dist/cjs/generated/types.js.map +1 -0
- package/dist/cjs/index.d.ts +23 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +47 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/resources/account.d.ts +22 -0
- package/dist/cjs/resources/account.d.ts.map +1 -0
- package/dist/cjs/resources/account.js +31 -0
- package/dist/cjs/resources/account.js.map +1 -0
- package/dist/cjs/resources/addresses.d.ts +93 -0
- package/dist/cjs/resources/addresses.d.ts.map +1 -0
- package/dist/cjs/resources/addresses.js +128 -0
- package/dist/cjs/resources/addresses.js.map +1 -0
- package/dist/cjs/resources/catalog.d.ts +37 -0
- package/dist/cjs/resources/catalog.d.ts.map +1 -0
- package/dist/cjs/resources/catalog.js +52 -0
- package/dist/cjs/resources/catalog.js.map +1 -0
- package/dist/cjs/resources/deliveries.d.ts +61 -0
- package/dist/cjs/resources/deliveries.d.ts.map +1 -0
- package/dist/cjs/resources/deliveries.js +53 -0
- package/dist/cjs/resources/deliveries.js.map +1 -0
- package/dist/cjs/resources/transactions.d.ts +28 -0
- package/dist/cjs/resources/transactions.d.ts.map +1 -0
- package/dist/cjs/resources/transactions.js +34 -0
- package/dist/cjs/resources/transactions.js.map +1 -0
- package/dist/cjs/resources/webhooks.d.ts +22 -0
- package/dist/cjs/resources/webhooks.d.ts.map +1 -0
- package/dist/cjs/resources/webhooks.js +35 -0
- package/dist/cjs/resources/webhooks.js.map +1 -0
- package/dist/cjs/units.d.ts +29 -0
- package/dist/cjs/units.d.ts.map +1 -0
- package/dist/cjs/units.js +62 -0
- package/dist/cjs/units.js.map +1 -0
- package/dist/cjs/version.d.ts +5 -0
- package/dist/cjs/version.d.ts.map +1 -0
- package/dist/cjs/version.js +8 -0
- package/dist/cjs/version.js.map +1 -0
- package/dist/cjs/webhooks.d.ts +82 -0
- package/dist/cjs/webhooks.d.ts.map +1 -0
- package/dist/cjs/webhooks.js +133 -0
- package/dist/cjs/webhooks.js.map +1 -0
- package/dist/esm/client.d.ts +46 -0
- package/dist/esm/client.d.ts.map +1 -0
- package/dist/esm/client.js +76 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/core/errors.d.ts +64 -0
- package/dist/esm/core/errors.d.ts.map +1 -0
- package/dist/esm/core/errors.js +86 -0
- package/dist/esm/core/errors.js.map +1 -0
- package/dist/esm/core/http.d.ts +58 -0
- package/dist/esm/core/http.d.ts.map +1 -0
- package/dist/esm/core/http.js +138 -0
- package/dist/esm/core/http.js.map +1 -0
- package/dist/esm/core/pagination.d.ts +12 -0
- package/dist/esm/core/pagination.d.ts.map +1 -0
- package/dist/esm/core/pagination.js +12 -0
- package/dist/esm/core/pagination.js.map +1 -0
- package/dist/esm/core/scope.d.ts +8 -0
- package/dist/esm/core/scope.d.ts.map +1 -0
- package/dist/esm/core/scope.js +2 -0
- package/dist/esm/core/scope.js.map +1 -0
- package/dist/esm/generated/types.d.ts +336 -0
- package/dist/esm/generated/types.d.ts.map +1 -0
- package/dist/esm/generated/types.js +4 -0
- package/dist/esm/generated/types.js.map +1 -0
- package/dist/esm/index.d.ts +23 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +20 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/resources/account.d.ts +22 -0
- package/dist/esm/resources/account.d.ts.map +1 -0
- package/dist/esm/resources/account.js +27 -0
- package/dist/esm/resources/account.js.map +1 -0
- package/dist/esm/resources/addresses.d.ts +93 -0
- package/dist/esm/resources/addresses.d.ts.map +1 -0
- package/dist/esm/resources/addresses.js +124 -0
- package/dist/esm/resources/addresses.js.map +1 -0
- package/dist/esm/resources/catalog.d.ts +37 -0
- package/dist/esm/resources/catalog.d.ts.map +1 -0
- package/dist/esm/resources/catalog.js +47 -0
- package/dist/esm/resources/catalog.js.map +1 -0
- package/dist/esm/resources/deliveries.d.ts +61 -0
- package/dist/esm/resources/deliveries.d.ts.map +1 -0
- package/dist/esm/resources/deliveries.js +49 -0
- package/dist/esm/resources/deliveries.js.map +1 -0
- package/dist/esm/resources/transactions.d.ts +28 -0
- package/dist/esm/resources/transactions.d.ts.map +1 -0
- package/dist/esm/resources/transactions.js +30 -0
- package/dist/esm/resources/transactions.js.map +1 -0
- package/dist/esm/resources/webhooks.d.ts +22 -0
- package/dist/esm/resources/webhooks.d.ts.map +1 -0
- package/dist/esm/resources/webhooks.js +31 -0
- package/dist/esm/resources/webhooks.js.map +1 -0
- package/dist/esm/units.d.ts +29 -0
- package/dist/esm/units.d.ts.map +1 -0
- package/dist/esm/units.js +58 -0
- package/dist/esm/units.js.map +1 -0
- package/dist/esm/version.d.ts +5 -0
- package/dist/esm/version.d.ts.map +1 -0
- package/dist/esm/version.js +5 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/esm/webhooks.d.ts +82 -0
- package/dist/esm/webhooks.d.ts.map +1 -0
- package/dist/esm/webhooks.js +125 -0
- package/dist/esm/webhooks.js.map +1 -0
- package/package.json +69 -4
- package/src/client.ts +83 -0
- package/src/core/errors.ts +99 -0
- package/src/core/http.ts +183 -0
- package/src/core/pagination.ts +20 -0
- package/src/core/scope.ts +8 -0
- package/src/generated/types.ts +369 -0
- package/src/index.ts +43 -0
- package/src/resources/account.ts +33 -0
- package/src/resources/addresses.ts +165 -0
- package/src/resources/catalog.ts +56 -0
- package/src/resources/deliveries.ts +82 -0
- package/src/resources/transactions.ts +34 -0
- package/src/resources/webhooks.ts +36 -0
- package/src/units.ts +56 -0
- package/src/version.ts +5 -0
- package/src/webhooks.ts +138 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/core/errors.ts"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;GAYG;AACH,qBAA6B,SAAQ,KAAK;IACxC,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAA;IAC/B,CAAC;CACF;;AAED,2DAA2D;AAC3D,wBAAgC,SAAQ,eAAe;IACrD,wBAAwB;IACf,MAAM,CAAQ;IACvB;;;OAGG;IACM,IAAI,CAAQ;IACrB,kGAAkG;IACzF,OAAO,CAAe;IAC/B,sDAAsD;IAC7C,SAAS,CAAoB;IACtC,yBAAyB;IAChB,IAAI,CAAS;IAEtB,YAAY,IAAoH;QAC9H,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,UAAU,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,CAAA;QAC5D,IAAI,CAAC,IAAI,GAAG,oBAAoB,C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,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA;AACzE,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Per-request options, accepted as the last argument of every method. */
|
|
2
|
+
export interface RequestOptions {
|
|
3
|
+
/** Cancels the request, including pending retries. */
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
/** Timeout for this request in milliseconds. Overrides {@link ClientOptions.timeoutMs}. */
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
/** Maximum number of retries for this request. Overrides {@link ClientOptions.maxRetries}. */
|
|
8
|
+
maxRetries?: number;
|
|
9
|
+
}
|
|
10
|
+
/** Options of {@link MonitoringClient}. */
|
|
11
|
+
export interface ClientOptions {
|
|
12
|
+
/** Your API key. Sent in the `x-api-key` header. */
|
|
13
|
+
apiKey: string;
|
|
14
|
+
/**
|
|
15
|
+
* Your client ID. Optional: when omitted, it is resolved from the API key on first use and cached.
|
|
16
|
+
*/
|
|
17
|
+
clientId?: string;
|
|
18
|
+
/** API base URL. Defaults to `https://monitoring.v3.finance`. */
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
/** Request timeout in milliseconds. Defaults to `30000`. */
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum number of retries for transient errors. Defaults to `2`.
|
|
24
|
+
*
|
|
25
|
+
* `429` and `503` responses are retried for every request, honoring `Retry-After`. Network errors and timeouts are
|
|
26
|
+
* retried only for requests that are safe to repeat. Backoff is exponential with jitter.
|
|
27
|
+
*/
|
|
28
|
+
maxRetries?: number;
|
|
29
|
+
/** Custom `fetch` implementation, e.g. for proxies or instrumentation. Defaults to the global `fetch`. */
|
|
30
|
+
fetch?: typeof fetch;
|
|
31
|
+
/** Additional headers sent with every request. */
|
|
32
|
+
headers?: Record<string, string>;
|
|
33
|
+
}
|
|
34
|
+
type Query = Record<string, string | number | boolean | null | undefined>;
|
|
35
|
+
/** @internal A request to the API. */
|
|
36
|
+
export interface Call {
|
|
37
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
38
|
+
path: string;
|
|
39
|
+
query?: Query;
|
|
40
|
+
body?: unknown;
|
|
41
|
+
/** The request can be repeated after a network failure without changing the outcome. */
|
|
42
|
+
idempotent: boolean;
|
|
43
|
+
/** Statuses returned as data rather than thrown. */
|
|
44
|
+
acceptStatuses?: number[];
|
|
45
|
+
options?: RequestOptions | undefined;
|
|
46
|
+
}
|
|
47
|
+
/** @internal Transport: base URL, authentication, timeouts, retries and error mapping. */
|
|
48
|
+
export declare class HttpClient {
|
|
49
|
+
#private;
|
|
50
|
+
readonly baseUrl: string;
|
|
51
|
+
constructor(options: ClientOptions, defaultBaseUrl: string);
|
|
52
|
+
/** Sends a request and returns the parsed JSON response. */
|
|
53
|
+
request<T>(call: Call): Promise<T>;
|
|
54
|
+
}
|
|
55
|
+
/** @internal Encodes a path segment. */
|
|
56
|
+
export declare const seg: (value: string | number) => string;
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/core/http.ts"],"names":[],"mappings":"AAGA,0EAA0E;AAC1E,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;IACpB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAED,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAA;AAEzE,sCAAsC;AACtC,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,wFAAwF;IACxF,UAAU,EAAE,OAAO,CAAA;IACnB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;CACrC;AAKD,0FAA0F;AAC1F,qBAAa,UAAU;;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAOxB,YAAY,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAUzD;IAED,4DAA4D;IACtD,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAmCvC;CA6BF;AAuCD,wCAAwC;AACxC,eAAO,MAAM,GAAG,UAAW,MAAM,GAAG,MAAM,WAAsC,CAAA"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.seg = exports.HttpClient = void 0;
|
|
4
|
+
const version_js_1 = require("../version.js");
|
|
5
|
+
const errors_js_1 = require("./errors.js");
|
|
6
|
+
const DEFAULTS = { timeoutMs: 30_000, maxRetries: 2 };
|
|
7
|
+
const MAX_RETRY_DELAY_MS = 60_000;
|
|
8
|
+
/** @internal Transport: base URL, authentication, timeouts, retries and error mapping. */
|
|
9
|
+
class HttpClient {
|
|
10
|
+
baseUrl;
|
|
11
|
+
#apiKey;
|
|
12
|
+
#timeoutMs;
|
|
13
|
+
#maxRetries;
|
|
14
|
+
#fetch;
|
|
15
|
+
#headers;
|
|
16
|
+
constructor(options, defaultBaseUrl) {
|
|
17
|
+
if (!options?.apiKey)
|
|
18
|
+
throw new errors_js_1.MonitoringError('apiKey is required');
|
|
19
|
+
this.baseUrl = (options.baseUrl ?? defaultBaseUrl).replace(/\/+$/, '');
|
|
20
|
+
this.#apiKey = options.apiKey;
|
|
21
|
+
this.#timeoutMs = options.timeoutMs ?? DEFAULTS.timeoutMs;
|
|
22
|
+
this.#maxRetries = options.maxRetries ?? DEFAULTS.maxRetries;
|
|
23
|
+
const f = options.fetch ?? globalThis.fetch;
|
|
24
|
+
if (typeof f !== 'function')
|
|
25
|
+
throw new errors_js_1.MonitoringError('fetch is not available: use Node.js 20 or later, or pass options.fetch');
|
|
26
|
+
this.#fetch = f;
|
|
27
|
+
this.#headers = { ...options.headers };
|
|
28
|
+
}
|
|
29
|
+
/** Sends a request and returns the parsed JSON response. */
|
|
30
|
+
async request(call) {
|
|
31
|
+
const url = this.#url(call.path, call.query);
|
|
32
|
+
const headers = {
|
|
33
|
+
accept: 'application/json',
|
|
34
|
+
'user-agent': `@v3finance/monitoring-sdk/${version_js_1.SDK_VERSION}`,
|
|
35
|
+
...this.#headers,
|
|
36
|
+
'x-api-key': this.#apiKey,
|
|
37
|
+
};
|
|
38
|
+
if (call.body !== undefined)
|
|
39
|
+
headers['content-type'] = 'application/json';
|
|
40
|
+
const body = call.body === undefined ? undefined : JSON.stringify(call.body);
|
|
41
|
+
const maxRetries = call.options?.maxRetries ?? this.#maxRetries;
|
|
42
|
+
const timeoutMs = call.options?.timeoutMs ?? this.#timeoutMs;
|
|
43
|
+
const signal = call.options?.signal;
|
|
44
|
+
for (let attempt = 0;; attempt++) {
|
|
45
|
+
let res;
|
|
46
|
+
try {
|
|
47
|
+
res = await this.#send(url, { method: call.method, headers, body }, timeoutMs, signal);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (signal?.aborted)
|
|
51
|
+
throw signal.reason;
|
|
52
|
+
if (call.idempotent && attempt < maxRetries) {
|
|
53
|
+
await sleep(backoff(attempt), signal);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
if ((res.status >= 200 && res.status < 300) || call.acceptStatuses?.includes(res.status))
|
|
59
|
+
return res.data;
|
|
60
|
+
const error = (0, errors_js_1.apiErrorFrom)(res.status, res.data, res.headers.get('cf-ray') ?? undefined);
|
|
61
|
+
// 429 and 503 mean the request was not processed, so retrying is safe for any method
|
|
62
|
+
if (error.retryable && attempt < maxRetries) {
|
|
63
|
+
await sleep(retryAfter(res.headers) ?? backoff(attempt), signal);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
#url(path, query) {
|
|
70
|
+
const url = new URL(this.baseUrl + path);
|
|
71
|
+
for (const [k, v] of Object.entries(query ?? {}))
|
|
72
|
+
if (v !== undefined && v !== null && v !== '')
|
|
73
|
+
url.searchParams.set(k, String(v));
|
|
74
|
+
return url.toString();
|
|
75
|
+
}
|
|
76
|
+
/** One attempt, with a single timeout covering both the connection and the response body. */
|
|
77
|
+
async #send(url, init, timeoutMs, signal) {
|
|
78
|
+
const controller = new AbortController();
|
|
79
|
+
const timer = setTimeout(() => controller.abort(new errors_js_1.MonitoringTimeoutError(timeoutMs)), timeoutMs);
|
|
80
|
+
const onAbort = () => controller.abort(signal.reason);
|
|
81
|
+
if (signal?.aborted)
|
|
82
|
+
onAbort();
|
|
83
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
84
|
+
try {
|
|
85
|
+
const res = await this.#fetch(url, { ...init, signal: controller.signal });
|
|
86
|
+
const text = await res.text();
|
|
87
|
+
return { status: res.status, headers: res.headers, data: text ? parseJson(text) : undefined };
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
const reason = controller.signal.reason;
|
|
91
|
+
if (reason instanceof errors_js_1.MonitoringTimeoutError)
|
|
92
|
+
throw reason;
|
|
93
|
+
if (signal?.aborted)
|
|
94
|
+
throw signal.reason;
|
|
95
|
+
throw new errors_js_1.MonitoringConnectionError(`request to ${new URL(url).origin} failed: ${error.message}`, { cause: error });
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
clearTimeout(timer);
|
|
99
|
+
signal?.removeEventListener('abort', onAbort);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.HttpClient = HttpClient;
|
|
104
|
+
function parseJson(text) {
|
|
105
|
+
try {
|
|
106
|
+
return JSON.parse(text);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return text;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** Exponential backoff with jitter: ~0.5 s, 1 s, 2 s… capped at 8 s. */
|
|
113
|
+
function backoff(attempt) {
|
|
114
|
+
return Math.min(8_000, 500 * 2 ** attempt) * (0.5 + Math.random() / 2);
|
|
115
|
+
}
|
|
116
|
+
/** Delay from a `Retry-After` header: seconds or an HTTP date. */
|
|
117
|
+
function retryAfter(headers) {
|
|
118
|
+
const raw = headers.get('retry-after');
|
|
119
|
+
if (!raw)
|
|
120
|
+
return undefined;
|
|
121
|
+
const seconds = Number(raw);
|
|
122
|
+
const ms = Number.isFinite(seconds) ? seconds * 1000 : Date.parse(raw) - Date.now();
|
|
123
|
+
return Number.isFinite(ms) ? Math.min(Math.max(ms, 0), MAX_RETRY_DELAY_MS) : undefined;
|
|
124
|
+
}
|
|
125
|
+
function sleep(ms, signal) {
|
|
126
|
+
return new Promise((resolve, reject) => {
|
|
127
|
+
if (signal?.aborted)
|
|
128
|
+
return reject(signal.reason);
|
|
129
|
+
const timer = setTimeout(() => {
|
|
130
|
+
signal?.removeEventListener('abort', onAbort);
|
|
131
|
+
resolve();
|
|
132
|
+
}, ms);
|
|
133
|
+
const onAbort = () => {
|
|
134
|
+
clearTimeout(timer);
|
|
135
|
+
reject(signal.reason);
|
|
136
|
+
};
|
|
137
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/** @internal Encodes a path segment. */
|
|
141
|
+
const seg = (value) => encodeURIComponent(String(value));
|
|
142
|
+
exports.seg = seg;
|
|
143
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/core/http.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAC3C,2CAA8G;AAoD9G,MAAM,QAAQ,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,CAAA;AACrD,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAEjC,0FAA0F;AAC1F;IACW,OAAO,CAAQ;IACf,OAAO,CAAQ;IACf,UAAU,CAAQ;IAClB,WAAW,CAAQ;IACnB,MAAM,CAAc;IACpB,QAAQ,CAAwB;IAEzC,YAAY,OAAsB,EAAE,cAAsB;QACxD,IAAI,CAAC,OAAO,EAAE,MAAM;YAAE,MAAM,IAAI,2BAAe,CAAC,oBAAoB,CAAC,CAAA;QACrE,IAAI,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QACtE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAA;QAC7B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAA;QACzD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAA;QAC5D,MAAM,CA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
+
export interface Page<T> {
|
|
7
|
+
items: T[];
|
|
8
|
+
next: number | null;
|
|
9
|
+
}
|
|
10
|
+
/** @internal Yields every item, fetching the next page only when the current one is exhausted. */
|
|
11
|
+
export declare function paginate<T>(fetchPage: (cursor: number | undefined) => Promise<Page<T>>): AsyncGenerator<T, void, undefined>;
|
|
12
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/core/pagination.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,kGAAkG;AAClG,wBAAuB,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAQlI"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paginate = paginate;
|
|
4
|
+
/** @internal Yields every item, fetching the next page only when the current one is exhausted. */
|
|
5
|
+
async function* paginate(fetchPage) {
|
|
6
|
+
let cursor;
|
|
7
|
+
for (;;) {
|
|
8
|
+
const page = await fetchPage(cursor);
|
|
9
|
+
yield* page.items;
|
|
10
|
+
if (page.next === null || page.next === undefined)
|
|
11
|
+
return;
|
|
12
|
+
cursor = page.next;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/core/pagination.ts"],"names":[],"mappings":";;;AAUA,kGAAkG;AAC3F,KAAK,SAAS,CAAC,UAAa,SAA2D;IAC5F,IAAI,MAA0B,CAAA;IAC9B,SAAS,CAAC;QACR,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,CAAA;QACpC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;QACjB,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,OAAM;QACzD,MAAM,GAAG,IAAI,CAAC,IAAI,CAAA;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HttpClient } from './http.js';
|
|
2
|
+
/** @internal What resources share: the transport and the client ID of the API key. */
|
|
3
|
+
export interface Scope {
|
|
4
|
+
http: HttpClient;
|
|
5
|
+
/** Path segment of the client: resolved from the API key once, then cached. */
|
|
6
|
+
clientPath: () => Promise<string>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/core/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,sFAAsF;AACtF,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,UAAU,CAAA;IAChB,+EAA+E;IAC/E,UAAU,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/core/scope.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
export interface ApiErrorBody {
|
|
2
|
+
error: {
|
|
3
|
+
/**
|
|
4
|
+
* Machine-readable error code.
|
|
5
|
+
* @example "invalid_request"
|
|
6
|
+
*/
|
|
7
|
+
code: string;
|
|
8
|
+
/** Human-readable description. */
|
|
9
|
+
message: string;
|
|
10
|
+
/** Per-item problems of a batch request. */
|
|
11
|
+
details?: Array<{
|
|
12
|
+
/** Index of the item in the request. */
|
|
13
|
+
index: number;
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface User {
|
|
19
|
+
id: string;
|
|
20
|
+
email: string;
|
|
21
|
+
name: string;
|
|
22
|
+
role?: "admin" | "user";
|
|
23
|
+
banned?: boolean;
|
|
24
|
+
createdAt?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface Identity {
|
|
27
|
+
actor: {
|
|
28
|
+
/** `client-key` for a client API key. */
|
|
29
|
+
kind: "client-key" | "user" | "admin";
|
|
30
|
+
/** Your client ID (client API keys). */
|
|
31
|
+
clientId?: string;
|
|
32
|
+
/** ID of the API key (client API keys). */
|
|
33
|
+
keyId?: string;
|
|
34
|
+
userId?: string | null;
|
|
35
|
+
via?: "session" | "api-key" | "token";
|
|
36
|
+
};
|
|
37
|
+
user: User | null;
|
|
38
|
+
memberships: Array<{
|
|
39
|
+
clientId: string;
|
|
40
|
+
role: "owner" | "admin" | "member";
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export interface Client {
|
|
44
|
+
/** Client ID. */
|
|
45
|
+
id: string;
|
|
46
|
+
name: string | null;
|
|
47
|
+
/** Where webhooks are sent. */
|
|
48
|
+
webhookUrl: string;
|
|
49
|
+
/** `disabled` — webhooks are not sent. */
|
|
50
|
+
status: "active" | "disabled";
|
|
51
|
+
/** format: date-time */
|
|
52
|
+
createdAt: string;
|
|
53
|
+
}
|
|
54
|
+
export interface Network {
|
|
55
|
+
id: number;
|
|
56
|
+
/**
|
|
57
|
+
* Network identifier used across the API.
|
|
58
|
+
* @example "tron"
|
|
59
|
+
*/
|
|
60
|
+
slug: string;
|
|
61
|
+
/**
|
|
62
|
+
* CAIP-2 chain ID.
|
|
63
|
+
* @example "tron:0x2b6653dc"
|
|
64
|
+
*/
|
|
65
|
+
caip2: string;
|
|
66
|
+
chainId: number;
|
|
67
|
+
name: string;
|
|
68
|
+
shortName: string | null;
|
|
69
|
+
/** 1 for L1 networks, 2 for L2 rollups. */
|
|
70
|
+
layer: 1 | 2;
|
|
71
|
+
parent: string | null;
|
|
72
|
+
l2Type: string | null;
|
|
73
|
+
l2Stack: string | null;
|
|
74
|
+
isTestnet: boolean;
|
|
75
|
+
explorerUrl: string | null;
|
|
76
|
+
/** Transfers on this network are monitored. */
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface NetworkList {
|
|
80
|
+
items: Network[];
|
|
81
|
+
}
|
|
82
|
+
export interface Asset {
|
|
83
|
+
id: number;
|
|
84
|
+
/** Network slug. */
|
|
85
|
+
network: string;
|
|
86
|
+
/** CAIP-19 asset ID. */
|
|
87
|
+
caip19: string;
|
|
88
|
+
standard: "native" | "erc20" | "trc20";
|
|
89
|
+
contract: string | null;
|
|
90
|
+
/** @example "USDT" */
|
|
91
|
+
symbol: string;
|
|
92
|
+
name: string;
|
|
93
|
+
decimals: number;
|
|
94
|
+
/** Smallest transfer you are notified about, in the smallest unit (inclusive). */
|
|
95
|
+
minAmount: string;
|
|
96
|
+
/** Transfers of this asset are monitored. */
|
|
97
|
+
enabled: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface AssetList {
|
|
100
|
+
items: Asset[];
|
|
101
|
+
}
|
|
102
|
+
/** `in` — the address receives, `out` — the address sends, `both` — either. */
|
|
103
|
+
export type Direction = "in" | "out" | "both";
|
|
104
|
+
/** Asset symbols (`USDT`) or contract addresses. `null` — all assets of the network, including ones added later. */
|
|
105
|
+
export type AssetSelection = string[] | null;
|
|
106
|
+
export interface AddressInput {
|
|
107
|
+
/** Network slug or CAIP-2 ID. */
|
|
108
|
+
network: string;
|
|
109
|
+
address: string;
|
|
110
|
+
/**
|
|
111
|
+
* Your reference, e.g. a user or account ID.
|
|
112
|
+
*
|
|
113
|
+
* length: 0..200
|
|
114
|
+
*/
|
|
115
|
+
label?: string;
|
|
116
|
+
assets?: AssetSelection;
|
|
117
|
+
direction?: Direction;
|
|
118
|
+
}
|
|
119
|
+
export interface AddAddressesRequest {
|
|
120
|
+
/** items: 1..1000 */
|
|
121
|
+
addresses: AddressInput[];
|
|
122
|
+
assets?: AssetSelection;
|
|
123
|
+
direction?: Direction;
|
|
124
|
+
}
|
|
125
|
+
export interface AddAddressesResult {
|
|
126
|
+
/** Addresses that started being monitored. */
|
|
127
|
+
added: number;
|
|
128
|
+
/** Addresses that were already monitored and left unchanged. */
|
|
129
|
+
alreadyWatched: number;
|
|
130
|
+
}
|
|
131
|
+
export interface AddressUpdate {
|
|
132
|
+
network: string;
|
|
133
|
+
address: string;
|
|
134
|
+
assets?: AssetSelection;
|
|
135
|
+
direction?: Direction;
|
|
136
|
+
}
|
|
137
|
+
export interface UpdateAddressesRequest {
|
|
138
|
+
/** items: 1..1000 */
|
|
139
|
+
addresses: AddressUpdate[];
|
|
140
|
+
assets?: AssetSelection;
|
|
141
|
+
direction?: Direction;
|
|
142
|
+
}
|
|
143
|
+
export interface UpdateAddressesResult {
|
|
144
|
+
/** Addresses whose subscription was changed. */
|
|
145
|
+
updated: number;
|
|
146
|
+
/** Addresses that are not monitored. */
|
|
147
|
+
notWatched: number;
|
|
148
|
+
}
|
|
149
|
+
export interface AddressRef {
|
|
150
|
+
/** Network slug or CAIP-2 ID. */
|
|
151
|
+
network: string;
|
|
152
|
+
address: string;
|
|
153
|
+
}
|
|
154
|
+
export interface RemoveAddressesRequest {
|
|
155
|
+
/** items: 1..1000 */
|
|
156
|
+
addresses: AddressRef[];
|
|
157
|
+
}
|
|
158
|
+
export interface RemoveAddressesResult {
|
|
159
|
+
/** Addresses that stopped being monitored. */
|
|
160
|
+
removed: number;
|
|
161
|
+
/** Addresses that were not monitored. */
|
|
162
|
+
notWatched: number;
|
|
163
|
+
}
|
|
164
|
+
export interface Address {
|
|
165
|
+
id: number;
|
|
166
|
+
network: string;
|
|
167
|
+
/** CAIP-10 account ID. */
|
|
168
|
+
caip10: string;
|
|
169
|
+
address: string;
|
|
170
|
+
label: string | null;
|
|
171
|
+
/** Subscribed asset symbols; `null` — all assets. */
|
|
172
|
+
assets: string[] | null;
|
|
173
|
+
direction: Direction;
|
|
174
|
+
/** format: date-time */
|
|
175
|
+
createdAt: string;
|
|
176
|
+
}
|
|
177
|
+
/** A page of addresses. */
|
|
178
|
+
export interface AddressPage {
|
|
179
|
+
items: Address[];
|
|
180
|
+
/** Cursor for the next page — pass it as `after`. `null` when there are no more pages. */
|
|
181
|
+
next: number | null;
|
|
182
|
+
}
|
|
183
|
+
/** `delivered` — you responded with 2xx; `retrying` — the last attempt failed and will be retried; `failed` — all attempts failed. */
|
|
184
|
+
export type DeliveryStatus = "delivered" | "retrying" | "failed";
|
|
185
|
+
export interface Delivery {
|
|
186
|
+
id: number;
|
|
187
|
+
clientId: string;
|
|
188
|
+
network: string;
|
|
189
|
+
asset: string;
|
|
190
|
+
contract: string;
|
|
191
|
+
/** Transaction hash. */
|
|
192
|
+
txId: string;
|
|
193
|
+
logIndex: number | null;
|
|
194
|
+
block: number;
|
|
195
|
+
/** Block time, milliseconds since epoch. */
|
|
196
|
+
blockTime: number;
|
|
197
|
+
from: string;
|
|
198
|
+
to: string;
|
|
199
|
+
/** Amount in the smallest unit. */
|
|
200
|
+
value: string;
|
|
201
|
+
status: DeliveryStatus;
|
|
202
|
+
attempts: number;
|
|
203
|
+
lastHttpStatus: number | null;
|
|
204
|
+
lastError: string | null;
|
|
205
|
+
lastDurationMs: number | null;
|
|
206
|
+
/** format: date-time */
|
|
207
|
+
firstAttemptAt: string;
|
|
208
|
+
/** format: date-time */
|
|
209
|
+
lastAttemptAt: string;
|
|
210
|
+
deliveredAt: string | null;
|
|
211
|
+
}
|
|
212
|
+
export type DeliveryDetail = Delivery & {
|
|
213
|
+
/** URL of the last attempt. */
|
|
214
|
+
url: string;
|
|
215
|
+
/** Exact request body. */
|
|
216
|
+
body: string;
|
|
217
|
+
};
|
|
218
|
+
/** A page of deliveries, newest first. */
|
|
219
|
+
export interface DeliveryPage {
|
|
220
|
+
items: Delivery[];
|
|
221
|
+
/** Cursor for the next page — pass it as `before`. `null` when there are no more pages. */
|
|
222
|
+
next: number | null;
|
|
223
|
+
}
|
|
224
|
+
export interface TxTransfer {
|
|
225
|
+
/** `native` — sent by the transaction itself; `token` — a token Transfer event; `internal` — TRX sent by a contract; `trc10` — a TRC-10 token. */
|
|
226
|
+
kind: "native" | "token" | "internal" | "trc10";
|
|
227
|
+
asset: string | null;
|
|
228
|
+
/** Token contract address, `native`, or the TRC-10 token ID. */
|
|
229
|
+
contract: string;
|
|
230
|
+
from: string;
|
|
231
|
+
to: string;
|
|
232
|
+
/** Amount in the smallest unit. */
|
|
233
|
+
value: string;
|
|
234
|
+
logIndex?: number;
|
|
235
|
+
/** The asset is monitored: transfers of at least its `minAmount` are notified. */
|
|
236
|
+
tracked: boolean;
|
|
237
|
+
}
|
|
238
|
+
export interface Transaction {
|
|
239
|
+
network: string;
|
|
240
|
+
caip2: string;
|
|
241
|
+
txId: string;
|
|
242
|
+
/** `pending` — not yet included in a block. */
|
|
243
|
+
status: "success" | "failed" | "pending";
|
|
244
|
+
failure: string | null;
|
|
245
|
+
block: number | null;
|
|
246
|
+
blockTime: number | null;
|
|
247
|
+
/** Blocks since inclusion, counting the block itself; `0` when pending. */
|
|
248
|
+
confirmations: number;
|
|
249
|
+
/** The transaction can no longer be reverted. */
|
|
250
|
+
final: boolean;
|
|
251
|
+
/** Signer of the transaction. */
|
|
252
|
+
from: string;
|
|
253
|
+
to: string | null;
|
|
254
|
+
/** TRON contract type (`TransferContract`, `TriggerSmartContract`, …) or, on EVM networks, `transfer`, `contract_call` or `contract_creation`. */
|
|
255
|
+
type: string;
|
|
256
|
+
/** Native amount sent by the transaction itself. */
|
|
257
|
+
value: string;
|
|
258
|
+
fee: {
|
|
259
|
+
asset: string;
|
|
260
|
+
value: string;
|
|
261
|
+
} | null;
|
|
262
|
+
transfers: TxTransfer[];
|
|
263
|
+
/** Your monitored addresses involved in the transaction. */
|
|
264
|
+
watched: Array<{
|
|
265
|
+
clientId: string;
|
|
266
|
+
address: string;
|
|
267
|
+
direction: Direction;
|
|
268
|
+
}>;
|
|
269
|
+
/** Webhooks sent to you for this transaction. */
|
|
270
|
+
webhooks: Array<{
|
|
271
|
+
id: number;
|
|
272
|
+
clientId: string;
|
|
273
|
+
asset: string;
|
|
274
|
+
value: string;
|
|
275
|
+
status: DeliveryStatus;
|
|
276
|
+
attempts: number;
|
|
277
|
+
deliveredAt: string | null;
|
|
278
|
+
}>;
|
|
279
|
+
}
|
|
280
|
+
export interface WebhookTx {
|
|
281
|
+
/**
|
|
282
|
+
* Network slug in upper case.
|
|
283
|
+
* @example "TRON"
|
|
284
|
+
* @example "ETHEREUM"
|
|
285
|
+
*/
|
|
286
|
+
network: string;
|
|
287
|
+
/** @example "USDT" */
|
|
288
|
+
asset: string;
|
|
289
|
+
/** Token contract address or `native`. */
|
|
290
|
+
contract: string;
|
|
291
|
+
/** Always `TOPUP`, for both directions: compare `from` and `to` with your addresses. */
|
|
292
|
+
type: "TOPUP";
|
|
293
|
+
/** Transaction hash. */
|
|
294
|
+
id: string;
|
|
295
|
+
block: number;
|
|
296
|
+
/** Block time, milliseconds since epoch. */
|
|
297
|
+
timestamp: number;
|
|
298
|
+
from: string;
|
|
299
|
+
to: string;
|
|
300
|
+
/** Amount in the smallest unit. */
|
|
301
|
+
value: string;
|
|
302
|
+
/** Position of the transfer in the block, for EVM token transfers. */
|
|
303
|
+
logIndex?: number;
|
|
304
|
+
}
|
|
305
|
+
export interface WebhookPayload {
|
|
306
|
+
tx: WebhookTx;
|
|
307
|
+
/** Present on test webhooks only. */
|
|
308
|
+
test?: true;
|
|
309
|
+
}
|
|
310
|
+
export interface TestWebhookRequest {
|
|
311
|
+
/** @defaultValue "USDT" */
|
|
312
|
+
asset?: "USDT" | "A7A5" | "TRX";
|
|
313
|
+
/** TRON address. */
|
|
314
|
+
from?: string;
|
|
315
|
+
/** TRON address. */
|
|
316
|
+
to?: string;
|
|
317
|
+
/** Amount in the smallest unit. */
|
|
318
|
+
value?: string;
|
|
319
|
+
}
|
|
320
|
+
export interface TestDelivery {
|
|
321
|
+
/** Your endpoint responded with 2xx. */
|
|
322
|
+
ok: boolean;
|
|
323
|
+
/** Status code of your response. */
|
|
324
|
+
status?: number;
|
|
325
|
+
/** Connection error. */
|
|
326
|
+
error?: string;
|
|
327
|
+
durationMs: number;
|
|
328
|
+
}
|
|
329
|
+
export interface TestWebhookResult {
|
|
330
|
+
delivery: TestDelivery;
|
|
331
|
+
/** Value of the `x-signature` header. */
|
|
332
|
+
signature: string;
|
|
333
|
+
/** Exact request body. */
|
|
334
|
+
body: string;
|
|
335
|
+
}
|
|
336
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/generated/types.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE;QACL;;;WAGG;QACH,IAAI,EAAE,MAAM,CAAA;QACZ,kCAAkC;QAClC,OAAO,EAAE,MAAM,CAAA;QACf,4CAA4C;QAC5C,OAAO,CAAC,EAAE,KAAK,CAAC;YACd,wCAAwC;YACxC,KAAK,EAAE,MAAM,CAAA;YACb,OAAO,EAAE,MAAM,CAAA;SAChB,CAAC,CAAA;KACH,CAAA;CACF;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE;QACL,yCAAyC;QACzC,IAAI,EAAE,YAAY,GAAG,MAAM,G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AED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAA;IACtB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAA;IACjB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;CACb"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Generated from openapi/openapi.json by scripts/generate.ts — do not edit by hand.
|
|
3
|
+
// V3 Finance Monitoring API 1.0.0. Regenerate: npm run spec:update && npm run generate
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/generated/types.ts"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,uFAAuF"}
|