@bronlabs/intents-sdk 1.0.137 → 1.0.138
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/proxy.d.ts +0 -1
- package/dist/proxy.js +4 -7
- package/dist/proxy.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './config.js';
|
|
|
5
5
|
export * from './eventQueue.js';
|
|
6
6
|
export * from './contracts.js';
|
|
7
7
|
export * from './utils.js';
|
|
8
|
-
export { configureProxy,
|
|
8
|
+
export { configureProxy, getProxyAgentForUrl, proxyFetch } from './proxy.js';
|
|
9
9
|
export { initNetworks } from './networks/index.js';
|
|
10
10
|
export type { Network, TransactionData } from './networks/index.js';
|
|
11
11
|
export * from './attestation.js';
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export * from './config.js';
|
|
|
5
5
|
export * from './eventQueue.js';
|
|
6
6
|
export * from './contracts.js';
|
|
7
7
|
export * from './utils.js';
|
|
8
|
-
export { configureProxy,
|
|
8
|
+
export { configureProxy, getProxyAgentForUrl, proxyFetch } from './proxy.js';
|
|
9
9
|
export { initNetworks } from './networks/index.js';
|
|
10
10
|
export * from './attestation.js';
|
|
11
11
|
// Monkey-patch BigInt.prototype.toJSON
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,cAAc,kBAAkB,CAAC;AAEjC,uCAAuC;AACtC,MAAM,CAAC,SAAiB,CAAC,MAAM,GAAG;IACjC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC,CAAC"}
|
package/dist/proxy.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HttpsProxyAgent } from 'https-proxy-agent';
|
|
2
2
|
import { type RequestInit, type Response } from 'node-fetch';
|
|
3
3
|
export declare function configureProxy(url?: string, noProxyHosts?: string[]): void;
|
|
4
|
-
export declare function getProxyAgent(): HttpsProxyAgent<string> | undefined;
|
|
5
4
|
export declare function getProxyAgentForUrl(url: string): HttpsProxyAgent<string> | undefined;
|
|
6
5
|
export declare function proxyFetch(url: string, options?: RequestInit): Promise<Response>;
|
package/dist/proxy.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { HttpsProxyAgent } from 'https-proxy-agent';
|
|
2
2
|
import nodeFetch from 'node-fetch';
|
|
3
3
|
import { log } from './utils.js';
|
|
4
|
+
// In-cluster traffic must never go through the corporate proxy (the proxy can't resolve cluster DNS).
|
|
5
|
+
// Always bypassed, on top of any configured nonProxyHosts.
|
|
6
|
+
const ALWAYS_NO_PROXY = ['*.svc.cluster.local'];
|
|
4
7
|
let proxyAgent;
|
|
5
8
|
let nonProxyHosts = [];
|
|
6
9
|
export function configureProxy(url, noProxyHosts = []) {
|
|
7
10
|
proxyAgent = url
|
|
8
11
|
? new HttpsProxyAgent(url, { rejectUnauthorized: false })
|
|
9
12
|
: undefined;
|
|
10
|
-
nonProxyHosts = noProxyHosts;
|
|
13
|
+
nonProxyHosts = [...ALWAYS_NO_PROXY, ...noProxyHosts];
|
|
11
14
|
if (proxyAgent) {
|
|
12
15
|
log.info(`Using proxy: ${proxyAgent.proxy.hostname}:${proxyAgent.proxy.port}`);
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
|
-
export function getProxyAgent() {
|
|
16
|
-
return proxyAgent;
|
|
17
|
-
}
|
|
18
18
|
export function getProxyAgentForUrl(url) {
|
|
19
19
|
if (!proxyAgent || isNonProxyHost(url)) {
|
|
20
20
|
return undefined;
|
|
@@ -28,9 +28,6 @@ export function proxyFetch(url, options) {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
function isNonProxyHost(url) {
|
|
31
|
-
if (nonProxyHosts.length === 0) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
31
|
let host;
|
|
35
32
|
try {
|
|
36
33
|
host = new URL(url).hostname.toLowerCase();
|
package/dist/proxy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,SAA8C,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,IAAI,UAA+C,CAAC;AACpD,IAAI,aAAa,GAAa,EAAE,CAAC;AAEjC,MAAM,UAAU,cAAc,CAAC,GAAY,EAAE,eAAyB,EAAE;IACtE,UAAU,GAAG,GAAG;QACd,CAAC,CAAC,IAAI,eAAe,CAAC,GAAG,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;QACzD,CAAC,CAAC,SAAS,CAAC;IACd,aAAa,GAAG,YAAY,CA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