@fiderail/indexer 0.0.0-stage → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,178 @@
1
+ import type { FideRailRepository } from "@fiderail/core";
2
+ export declare function isSafePublicHttpUrl(rawUrl: string, { allowPrivateHosts }?: {
3
+ allowPrivateHosts?: boolean;
4
+ }): boolean;
5
+ export declare function assertSafePublicUrlWithDns(rawUrl: string, { allowPrivateHosts, dnsLookup, }?: {
6
+ allowPrivateHosts?: boolean;
7
+ dnsLookup?: (host: string, opts: {
8
+ all: true;
9
+ }) => Promise<Array<{
10
+ address: string;
11
+ family: number;
12
+ }>>;
13
+ }): Promise<{
14
+ safe: boolean;
15
+ reason?: string;
16
+ }>;
17
+ export declare function createProxyFetch({ proxyUrl, proxyToken, baseFetch, }: {
18
+ proxyUrl: string;
19
+ proxyToken?: string;
20
+ baseFetch?: typeof globalThis.fetch;
21
+ }): (targetUrl: string | URL, init?: RequestInit) => Promise<any>;
22
+ export declare function probeSingleEndpoint({ chain, address, resourceUrl, method, catalogPriceUsdc, fetchImpl, timeoutMs, allowPrivateHosts, proxyUrl, proxyToken, dnsLookup, }: {
23
+ chain: string;
24
+ address: string;
25
+ resourceUrl: string;
26
+ method?: string | null;
27
+ catalogPriceUsdc?: number | null;
28
+ fetchImpl?: typeof globalThis.fetch;
29
+ timeoutMs?: number;
30
+ allowPrivateHosts?: boolean;
31
+ proxyUrl?: string;
32
+ proxyToken?: string;
33
+ dnsLookup?: any;
34
+ }): Promise<{
35
+ chain: string;
36
+ address: string;
37
+ resourceUrl: string;
38
+ livenessStatus: string;
39
+ httpStatus: any;
40
+ latencyMs: number;
41
+ headerBytes: number | null;
42
+ observedPriceUsdc: number | null;
43
+ diagnosticFlags: string[];
44
+ error: string;
45
+ } | {
46
+ chain: string;
47
+ address: string;
48
+ resourceUrl: string;
49
+ livenessStatus: string;
50
+ httpStatus: any;
51
+ latencyMs: number;
52
+ headerBytes: number | null;
53
+ observedPriceUsdc: number | null;
54
+ diagnosticFlags: string[];
55
+ error: null;
56
+ } | {
57
+ chain: string;
58
+ address: string;
59
+ resourceUrl: string;
60
+ livenessStatus: string;
61
+ httpStatus: null;
62
+ latencyMs: number;
63
+ headerBytes: null;
64
+ observedPriceUsdc: null;
65
+ diagnosticFlags: never[];
66
+ error: any;
67
+ }>;
68
+ export declare function diagnoseX402Endpoint({ url, method, catalogPriceUsdc, fetchImpl, timeoutMs, allowPrivateHosts, proxyUrl, proxyToken, dnsLookup, }: {
69
+ url: string;
70
+ method?: string;
71
+ catalogPriceUsdc?: number | null;
72
+ fetchImpl?: typeof globalThis.fetch;
73
+ timeoutMs?: number;
74
+ allowPrivateHosts?: boolean;
75
+ proxyUrl?: string;
76
+ proxyToken?: string;
77
+ dnsLookup?: any;
78
+ }): Promise<{
79
+ url: string;
80
+ method: string;
81
+ grade: string;
82
+ healthy: boolean;
83
+ livenessStatus: string;
84
+ httpStatus: null;
85
+ latencyMs: number;
86
+ headerBytes: null;
87
+ aiohttpSafe: null;
88
+ nodeHttpSafe: null;
89
+ observedPriceUsdc: null;
90
+ accepts: Array<Record<string, any>>;
91
+ diagnosticFlags: string[];
92
+ recommendations: string[];
93
+ wellKnownFound: boolean;
94
+ wellKnownDescriptor: Record<string, any> | null;
95
+ error: string;
96
+ checkedAt: string;
97
+ } | {
98
+ url: string;
99
+ method: string;
100
+ grade: string;
101
+ healthy: boolean;
102
+ livenessStatus: string;
103
+ httpStatus: any;
104
+ latencyMs: number;
105
+ headerBytes: number | null;
106
+ aiohttpSafe: boolean;
107
+ nodeHttpSafe: boolean;
108
+ observedPriceUsdc: number | null;
109
+ accepts: {
110
+ chain: import("@fiderail/spec").ChainKey;
111
+ network: string;
112
+ payTo: string;
113
+ asset: string | null;
114
+ assetSymbol: import("@fiderail/spec").AssetSymbol;
115
+ amountUsdc: number;
116
+ scheme: string;
117
+ }[];
118
+ diagnosticFlags: string[];
119
+ recommendations: string[];
120
+ wellKnownFound: boolean;
121
+ wellKnownDescriptor: Record<string, any> | null;
122
+ error: null;
123
+ checkedAt: string;
124
+ } | {
125
+ url: string;
126
+ method: string;
127
+ grade: string;
128
+ healthy: boolean;
129
+ livenessStatus: string;
130
+ httpStatus: any;
131
+ latencyMs: number;
132
+ headerBytes: null;
133
+ aiohttpSafe: null;
134
+ nodeHttpSafe: null;
135
+ observedPriceUsdc: null;
136
+ accepts: never[];
137
+ diagnosticFlags: never[];
138
+ recommendations: string[];
139
+ wellKnownFound: boolean;
140
+ wellKnownDescriptor: Record<string, any> | null;
141
+ error: string | null;
142
+ checkedAt: string;
143
+ } | {
144
+ url: string;
145
+ method: string;
146
+ grade: string;
147
+ healthy: boolean;
148
+ livenessStatus: string;
149
+ httpStatus: null;
150
+ latencyMs: number;
151
+ headerBytes: null;
152
+ aiohttpSafe: boolean | null;
153
+ nodeHttpSafe: boolean | null;
154
+ observedPriceUsdc: null;
155
+ accepts: never[];
156
+ diagnosticFlags: string[];
157
+ recommendations: string[];
158
+ wellKnownFound: boolean;
159
+ wellKnownDescriptor: Record<string, any> | null;
160
+ error: any;
161
+ checkedAt: string;
162
+ }>;
163
+ export declare function runLivenessProbeBatch({ repo, limit, concurrency, fetchImpl, timeoutMs, allowPrivateHosts, proxyUrl, proxyToken, dnsLookup, }: {
164
+ repo: FideRailRepository;
165
+ limit?: number;
166
+ concurrency?: number;
167
+ fetchImpl?: typeof globalThis.fetch;
168
+ timeoutMs?: number;
169
+ allowPrivateHosts?: boolean;
170
+ proxyUrl?: string;
171
+ proxyToken?: string;
172
+ dnsLookup?: any;
173
+ }): Promise<{
174
+ probed: number;
175
+ healthy: number;
176
+ downOrDegraded: number;
177
+ }>;
178
+ //# sourceMappingURL=liveness-probe.d.ts.map