@primuslabs/fhetransform-sdk 0.4.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/README.md +198 -0
- package/dist/abis/acl.abi.d.ts +379 -0
- package/dist/abis/acl.abi.js +495 -0
- package/dist/abis/acl.abi.js.map +1 -0
- package/dist/abis/alphatrion_reward.abi.d.ts +407 -0
- package/dist/abis/alphatrion_reward.abi.js +532 -0
- package/dist/abis/alphatrion_reward.abi.js.map +1 -0
- package/dist/abis/ciphertext_digests.abi.d.ts +336 -0
- package/dist/abis/ciphertext_digests.abi.js +444 -0
- package/dist/abis/ciphertext_digests.abi.js.map +1 -0
- package/dist/abis/ciphertext_verification.abi.d.ts +637 -0
- package/dist/abis/ciphertext_verification.abi.js +830 -0
- package/dist/abis/ciphertext_verification.abi.js.map +1 -0
- package/dist/abis/convert_token.abi.d.ts +922 -0
- package/dist/abis/convert_token.abi.js +1208 -0
- package/dist/abis/convert_token.abi.js.map +1 -0
- package/dist/abis/decryption.abi.d.ts +956 -0
- package/dist/abis/decryption.abi.js +1244 -0
- package/dist/abis/decryption.abi.js.map +1 -0
- package/dist/abis/erc20.abi.d.ts +265 -0
- package/dist/abis/erc20.abi.js +350 -0
- package/dist/abis/erc20.abi.js.map +1 -0
- package/dist/abis/fhe_executor.abi.d.ts +1535 -0
- package/dist/abis/fhe_executor.abi.js +1962 -0
- package/dist/abis/fhe_executor.abi.js.map +1 -0
- package/dist/abis/space_bridge_config.abi.d.ts +792 -0
- package/dist/abis/space_bridge_config.abi.js +1032 -0
- package/dist/abis/space_bridge_config.abi.js.map +1 -0
- package/dist/abis/token.abi.d.ts +630 -0
- package/dist/abis/token.abi.js +828 -0
- package/dist/abis/token.abi.js.map +1 -0
- package/dist/cli/eusdc.d.ts +2 -0
- package/dist/cli/eusdc.js +41 -0
- package/dist/cli/eusdc.js.map +1 -0
- package/dist/contract/callbacks.d.ts +59 -0
- package/dist/contract/callbacks.js +2 -0
- package/dist/contract/callbacks.js.map +1 -0
- package/dist/contract/convert-token.d.ts +107 -0
- package/dist/contract/convert-token.js +249 -0
- package/dist/contract/convert-token.js.map +1 -0
- package/dist/contract/token.d.ts +167 -0
- package/dist/contract/token.js +404 -0
- package/dist/contract/token.js.map +1 -0
- package/dist/contract/transaction.d.ts +29 -0
- package/dist/contract/transaction.js +2 -0
- package/dist/contract/transaction.js.map +1 -0
- package/dist/core/address.d.ts +118 -0
- package/dist/core/address.js +200 -0
- package/dist/core/address.js.map +1 -0
- package/dist/core/auth.d.ts +68 -0
- package/dist/core/auth.js +58 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/bytes.d.ts +48 -0
- package/dist/core/bytes.js +117 -0
- package/dist/core/bytes.js.map +1 -0
- package/dist/core/cache-manager.d.ts +138 -0
- package/dist/core/cache-manager.js +440 -0
- package/dist/core/cache-manager.js.map +1 -0
- package/dist/core/chain.d.ts +41 -0
- package/dist/core/chain.js +59 -0
- package/dist/core/chain.js.map +1 -0
- package/dist/core/constants.d.ts +24 -0
- package/dist/core/constants.js +25 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/error.d.ts +2 -0
- package/dist/core/error.js +14 -0
- package/dist/core/error.js.map +1 -0
- package/dist/core/errors/error-catalog.d.ts +29 -0
- package/dist/core/errors/error-catalog.js +84 -0
- package/dist/core/errors/error-catalog.js.map +1 -0
- package/dist/core/errors/error-codes.d.ts +52 -0
- package/dist/core/errors/error-codes.js +61 -0
- package/dist/core/errors/error-codes.js.map +1 -0
- package/dist/core/errors/error-utils.d.ts +27 -0
- package/dist/core/errors/error-utils.js +110 -0
- package/dist/core/errors/error-utils.js.map +1 -0
- package/dist/core/errors/fhe-error.d.ts +98 -0
- package/dist/core/errors/fhe-error.js +190 -0
- package/dist/core/errors/fhe-error.js.map +1 -0
- package/dist/core/errors/index.d.ts +4 -0
- package/dist/core/errors/index.js +5 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/estimate.d.ts +39 -0
- package/dist/core/estimate.js +111 -0
- package/dist/core/estimate.js.map +1 -0
- package/dist/core/event.d.ts +212 -0
- package/dist/core/event.js +42 -0
- package/dist/core/event.js.map +1 -0
- package/dist/core/fhe-type.d.ts +75 -0
- package/dist/core/fhe-type.js +115 -0
- package/dist/core/fhe-type.js.map +1 -0
- package/dist/core/fhe.d.ts +11 -0
- package/dist/core/fhe.js +23 -0
- package/dist/core/fhe.js.map +1 -0
- package/dist/core/handle.d.ts +42 -0
- package/dist/core/handle.js +99 -0
- package/dist/core/handle.js.map +1 -0
- package/dist/core/json-utils.d.ts +18 -0
- package/dist/core/json-utils.js +37 -0
- package/dist/core/json-utils.js.map +1 -0
- package/dist/core/kms.d.ts +42 -0
- package/dist/core/kms.js +70 -0
- package/dist/core/kms.js.map +1 -0
- package/dist/core/logger.d.ts +3 -0
- package/dist/core/logger.js +11 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/pretty-print.d.ts +18 -0
- package/dist/core/pretty-print.js +84 -0
- package/dist/core/pretty-print.js.map +1 -0
- package/dist/core/primitives.d.ts +22 -0
- package/dist/core/primitives.js +2 -0
- package/dist/core/primitives.js.map +1 -0
- package/dist/core/retryable-handler.d.ts +74 -0
- package/dist/core/retryable-handler.js +227 -0
- package/dist/core/retryable-handler.js.map +1 -0
- package/dist/core/signer-address-info.d.ts +15 -0
- package/dist/core/signer-address-info.js +33 -0
- package/dist/core/signer-address-info.js.map +1 -0
- package/dist/core/string.d.ts +28 -0
- package/dist/core/string.js +33 -0
- package/dist/core/string.js.map +1 -0
- package/dist/core/swallow.d.ts +23 -0
- package/dist/core/swallow.js +37 -0
- package/dist/core/swallow.js.map +1 -0
- package/dist/core/system-contract-info.d.ts +17 -0
- package/dist/core/system-contract-info.js +41 -0
- package/dist/core/system-contract-info.js.map +1 -0
- package/dist/core/ttl-cache.d.ts +81 -0
- package/dist/core/ttl-cache.js +113 -0
- package/dist/core/ttl-cache.js.map +1 -0
- package/dist/core/tx-error-parser.d.ts +40 -0
- package/dist/core/tx-error-parser.js +83 -0
- package/dist/core/tx-error-parser.js.map +1 -0
- package/dist/core/utils.d.ts +62 -0
- package/dist/core/utils.js +143 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/jazz/encrypt-key-p.d.ts +65 -0
- package/dist/jazz/encrypt-key-p.js +283 -0
- package/dist/jazz/encrypt-key-p.js.map +1 -0
- package/dist/jazz/encrypt-p.d.ts +82 -0
- package/dist/jazz/encrypt-p.js +139 -0
- package/dist/jazz/encrypt-p.js.map +1 -0
- package/dist/jazz/encrypt.d.ts +58 -0
- package/dist/jazz/encrypt.js +155 -0
- package/dist/jazz/encrypt.js.map +1 -0
- package/dist/jazz/input-proof-p.d.ts +122 -0
- package/dist/jazz/input-proof-p.js +265 -0
- package/dist/jazz/input-proof-p.js.map +1 -0
- package/dist/jazz/jazz-client-i.d.ts +16 -0
- package/dist/jazz/jazz-client-i.js +2 -0
- package/dist/jazz/jazz-client-i.js.map +1 -0
- package/dist/jazz/jazz-client.d.ts +18 -0
- package/dist/jazz/jazz-client.js +24 -0
- package/dist/jazz/jazz-client.js.map +1 -0
- package/dist/jazz/key-pair.d.ts +50 -0
- package/dist/jazz/key-pair.js +166 -0
- package/dist/jazz/key-pair.js.map +1 -0
- package/dist/jazz/mock/fake.d.ts +3 -0
- package/dist/jazz/mock/fake.js +23 -0
- package/dist/jazz/mock/fake.js.map +1 -0
- package/dist/jazz/mock/fetch-input-proof.d.ts +4 -0
- package/dist/jazz/mock/fetch-input-proof.js +63 -0
- package/dist/jazz/mock/fetch-input-proof.js.map +1 -0
- package/dist/jazz/mock/fetch-key-url.d.ts +3 -0
- package/dist/jazz/mock/fetch-key-url.js +15 -0
- package/dist/jazz/mock/fetch-key-url.js.map +1 -0
- package/dist/jazz/mock/fetch-public-decrypt.d.ts +3 -0
- package/dist/jazz/mock/fetch-public-decrypt.js +81 -0
- package/dist/jazz/mock/fetch-public-decrypt.js.map +1 -0
- package/dist/jazz/mock/fetch-user-decrypt.d.ts +4 -0
- package/dist/jazz/mock/fetch-user-decrypt.js +174 -0
- package/dist/jazz/mock/fetch-user-decrypt.js.map +1 -0
- package/dist/jazz/module/fetch-input-proof.d.ts +19 -0
- package/dist/jazz/module/fetch-input-proof.js +72 -0
- package/dist/jazz/module/fetch-input-proof.js.map +1 -0
- package/dist/jazz/module/fetch-key-url.d.ts +17 -0
- package/dist/jazz/module/fetch-key-url.js +46 -0
- package/dist/jazz/module/fetch-key-url.js.map +1 -0
- package/dist/jazz/module/fetch-public-decrypt.d.ts +19 -0
- package/dist/jazz/module/fetch-public-decrypt.js +65 -0
- package/dist/jazz/module/fetch-public-decrypt.js.map +1 -0
- package/dist/jazz/module/fetch-user-decrypt.d.ts +19 -0
- package/dist/jazz/module/fetch-user-decrypt.js +109 -0
- package/dist/jazz/module/fetch-user-decrypt.js.map +1 -0
- package/dist/jazz/module/jazz-async-request.d.ts +102 -0
- package/dist/jazz/module/jazz-async-request.js +515 -0
- package/dist/jazz/module/jazz-async-request.js.map +1 -0
- package/dist/jazz/module/jazz-p.d.ts +61 -0
- package/dist/jazz/module/jazz-p.js +33 -0
- package/dist/jazz/module/jazz-p.js.map +1 -0
- package/dist/jazz/module/s3-download.d.ts +85 -0
- package/dist/jazz/module/s3-download.js +293 -0
- package/dist/jazz/module/s3-download.js.map +1 -0
- package/dist/jazz/permit.d.ts +200 -0
- package/dist/jazz/permit.js +319 -0
- package/dist/jazz/permit.js.map +1 -0
- package/dist/jazz/public-decrypt-p.d.ts +96 -0
- package/dist/jazz/public-decrypt-p.js +258 -0
- package/dist/jazz/public-decrypt-p.js.map +1 -0
- package/dist/jazz/public-decrypt.d.ts +48 -0
- package/dist/jazz/public-decrypt.js +156 -0
- package/dist/jazz/public-decrypt.js.map +1 -0
- package/dist/jazz/read-contract.d.ts +81 -0
- package/dist/jazz/read-contract.js +125 -0
- package/dist/jazz/read-contract.js.map +1 -0
- package/dist/jazz/types/common.d.ts +17 -0
- package/dist/jazz/types/common.js +2 -0
- package/dist/jazz/types/common.js.map +1 -0
- package/dist/jazz/types/input-proof.d.ts +76 -0
- package/dist/jazz/types/input-proof.js +2 -0
- package/dist/jazz/types/input-proof.js.map +1 -0
- package/dist/jazz/types/key-url.d.ts +68 -0
- package/dist/jazz/types/key-url.js +5 -0
- package/dist/jazz/types/key-url.js.map +1 -0
- package/dist/jazz/types/public-decrypt.d.ts +61 -0
- package/dist/jazz/types/public-decrypt.js +2 -0
- package/dist/jazz/types/public-decrypt.js.map +1 -0
- package/dist/jazz/types/user-decrypt.d.ts +123 -0
- package/dist/jazz/types/user-decrypt.js +2 -0
- package/dist/jazz/types/user-decrypt.js.map +1 -0
- package/dist/jazz/user-decrypt-p.d.ts +111 -0
- package/dist/jazz/user-decrypt-p.js +280 -0
- package/dist/jazz/user-decrypt-p.js.map +1 -0
- package/dist/jazz/user-decrypt.d.ts +74 -0
- package/dist/jazz/user-decrypt.js +143 -0
- package/dist/jazz/user-decrypt.js.map +1 -0
- package/dist/native/fhe-api.js +5959 -0
- package/dist/native/fhe-api.node.cjs +6167 -0
- package/dist/native/fhe-api.node.worker.cjs +210 -0
- package/dist/native/fhe-api.wasm +0 -0
- package/dist/native/fhe-api.worker.js +164 -0
- package/dist/native/kms/node/kms_lib.d.ts +38 -0
- package/dist/native/kms/node/kms_lib.js +356 -0
- package/dist/native/kms/node/kms_lib_bg.wasm +0 -0
- package/dist/native/kms/node/kms_lib_bg.wasm.d.ts +21 -0
- package/dist/native/kms/node/package.json +11 -0
- package/dist/native/kms/web/kms_lib.d.ts +84 -0
- package/dist/native/kms/web/kms_lib.js +443 -0
- package/dist/native/kms/web/kms_lib_bg.wasm +0 -0
- package/dist/native/kms/web/kms_lib_bg.wasm.d.ts +21 -0
- package/dist/native/kms/web/package.json +15 -0
- package/dist/runtime/browser.d.ts +36 -0
- package/dist/runtime/browser.js +115 -0
- package/dist/runtime/browser.js.map +1 -0
- package/dist/runtime/node.d.ts +30 -0
- package/dist/runtime/node.js +95 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/sdk/fhetransform-sdk-b.d.ts +102 -0
- package/dist/sdk/fhetransform-sdk-b.js +294 -0
- package/dist/sdk/fhetransform-sdk-b.js.map +1 -0
- package/dist/sdk/fhetransform-sdk.d.ts +87 -0
- package/dist/sdk/fhetransform-sdk.js +135 -0
- package/dist/sdk/fhetransform-sdk.js.map +1 -0
- package/dist/sdk/jazz-service.d.ts +13 -0
- package/dist/sdk/jazz-service.js +58 -0
- package/dist/sdk/jazz-service.js.map +1 -0
- package/dist/sdk/permit-service.d.ts +45 -0
- package/dist/sdk/permit-service.js +144 -0
- package/dist/sdk/permit-service.js.map +1 -0
- package/dist/wasm/fhe-wasm-client.d.ts +19 -0
- package/dist/wasm/fhe-wasm-client.js +23 -0
- package/dist/wasm/fhe-wasm-client.js.map +1 -0
- package/dist/wasm/fhe-wasm-module.d.ts +24 -0
- package/dist/wasm/fhe-wasm-module.js +141 -0
- package/dist/wasm/fhe-wasm-module.js.map +1 -0
- package/dist/wasm/fhe-wasm-type.d.ts +59 -0
- package/dist/wasm/fhe-wasm-type.js +244 -0
- package/dist/wasm/fhe-wasm-type.js.map +1 -0
- package/dist/wasm/wasm-loader.browser.d.ts +21 -0
- package/dist/wasm/wasm-loader.browser.js +143 -0
- package/dist/wasm/wasm-loader.browser.js.map +1 -0
- package/dist/wasm/wasm-loader.node.d.ts +24 -0
- package/dist/wasm/wasm-loader.node.js +114 -0
- package/dist/wasm/wasm-loader.node.js.map +1 -0
- package/dist/wasm/worker-client.browser.d.ts +6 -0
- package/dist/wasm/worker-client.browser.js +21 -0
- package/dist/wasm/worker-client.browser.js.map +1 -0
- package/dist/wasm/worker-client.d.ts +34 -0
- package/dist/wasm/worker-client.js +160 -0
- package/dist/wasm/worker-client.js.map +1 -0
- package/dist/wasm/worker-client.node.d.ts +6 -0
- package/dist/wasm/worker-client.node.js +20 -0
- package/dist/wasm/worker-client.node.js.map +1 -0
- package/dist/wasm/worker-message.d.ts +61 -0
- package/dist/wasm/worker-message.js +2 -0
- package/dist/wasm/worker-message.js.map +1 -0
- package/dist/wasm/worker-transport.browser.d.ts +15 -0
- package/dist/wasm/worker-transport.browser.js +35 -0
- package/dist/wasm/worker-transport.browser.js.map +1 -0
- package/dist/wasm/worker-transport.d.ts +6 -0
- package/dist/wasm/worker-transport.js +2 -0
- package/dist/wasm/worker-transport.js.map +1 -0
- package/dist/wasm/worker-transport.node.d.ts +17 -0
- package/dist/wasm/worker-transport.node.js +39 -0
- package/dist/wasm/worker-transport.node.js.map +1 -0
- package/dist/wasm/worker.d.ts +1 -0
- package/dist/wasm/worker.js +69 -0
- package/dist/wasm/worker.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { Auth } from "../../core/auth.js";
|
|
3
|
+
import { Bytes32Hex, Bytes65Hex, Bytes65HexNo0x, BytesHex, BytesHexNo0x } from "../../core/primitives.js";
|
|
4
|
+
/**
|
|
5
|
+
* Creates an Axios instance with pre-configured base URL, timeout, and authentication interceptor.
|
|
6
|
+
* @param baseURL - The base URL for all requests
|
|
7
|
+
* @param auth - Optional authentication credentials
|
|
8
|
+
* @returns Configured Axios instance
|
|
9
|
+
*/
|
|
10
|
+
export declare function createAuthenticatedAxios(baseURL: string, auth?: Auth): AxiosInstance;
|
|
11
|
+
/**
|
|
12
|
+
* Response payload for input proof acceptance (200 OK)
|
|
13
|
+
* Indicates the input proof was successfully verified and accepted.
|
|
14
|
+
*/
|
|
15
|
+
export type JazzResult200InputProofAccepted = {
|
|
16
|
+
/** Acceptance flag - always true for this type */
|
|
17
|
+
accepted: true;
|
|
18
|
+
/** Additional contextual data as hex string with 0x prefix */
|
|
19
|
+
extraData: BytesHex;
|
|
20
|
+
/** Ordered list of 32-byte handles, each as hex with 0x prefix */
|
|
21
|
+
handles: Bytes32Hex[];
|
|
22
|
+
/** Attestation signatures for input verification, ordered to match handles, each as 65-byte hex with 0x prefix */
|
|
23
|
+
signatures: Bytes65Hex[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Response payload for input proof rejection (200 OK)
|
|
27
|
+
* Indicates the input proof was verified but rejected.
|
|
28
|
+
*/
|
|
29
|
+
export type JazzResult200InputProofRejected = {
|
|
30
|
+
/** Acceptance flag - always false for this type */
|
|
31
|
+
accepted: false;
|
|
32
|
+
/** Additional contextual data as hex string with 0x prefix */
|
|
33
|
+
extraData: BytesHex;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Response payload for public decryption operation (200 OK)
|
|
37
|
+
* Contains decrypted values and their corresponding signatures.
|
|
38
|
+
*/
|
|
39
|
+
export type JazzResult200PublicDecrypt = {
|
|
40
|
+
/** List of signatures as hex without 0x prefix */
|
|
41
|
+
signatures: BytesHexNo0x[];
|
|
42
|
+
/** The decrypted value as hex without 0x prefix */
|
|
43
|
+
decryptedValue: BytesHexNo0x;
|
|
44
|
+
/** Additional contextual data as hex with 0x prefix */
|
|
45
|
+
extraData: BytesHex;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Response payload for user decryption operation (200 OK)
|
|
49
|
+
* Contains an array of decrypted payloads with their signatures and metadata.
|
|
50
|
+
*/
|
|
51
|
+
export type JazzResult200UserDecrypt = {
|
|
52
|
+
/** Array of decryption results, each containing payload, signature, and extra data */
|
|
53
|
+
result: Array<{
|
|
54
|
+
/** The decrypted payload as hex without 0x prefix */
|
|
55
|
+
payload: BytesHexNo0x;
|
|
56
|
+
/** The associated signature as 65-byte hex without 0x prefix */
|
|
57
|
+
signature: Bytes65HexNo0x;
|
|
58
|
+
/** Additional contextual data as hex with 0x prefix */
|
|
59
|
+
extraData: BytesHex;
|
|
60
|
+
}>;
|
|
61
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { setAxiosAuth } from "../../core/auth.js";
|
|
3
|
+
import { logger } from "../../core/logger.js";
|
|
4
|
+
/**
|
|
5
|
+
* Creates an Axios instance with pre-configured base URL, timeout, and authentication interceptor.
|
|
6
|
+
* @param baseURL - The base URL for all requests
|
|
7
|
+
* @param auth - Optional authentication credentials
|
|
8
|
+
* @returns Configured Axios instance
|
|
9
|
+
*/
|
|
10
|
+
export function createAuthenticatedAxios(baseURL, auth) {
|
|
11
|
+
// Enter method - log with debug level
|
|
12
|
+
logger.debug(`[createAuthenticatedAxios] Enter: baseURL=${baseURL}, auth=${auth ? 'provided' : 'not provided'}`);
|
|
13
|
+
// Create axios instance with default settings
|
|
14
|
+
const instance = axios.create({
|
|
15
|
+
baseURL,
|
|
16
|
+
timeout: 30000,
|
|
17
|
+
headers: {
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
// Log instance creation success
|
|
22
|
+
logger.debug(`[createAuthenticatedAxios] Axios instance created for baseURL: ${baseURL}`);
|
|
23
|
+
// Attach request interceptor to inject authentication if available
|
|
24
|
+
instance.interceptors.request.use((config) => {
|
|
25
|
+
logger.trace(`[createAuthenticatedAxios] Interceptor invoked for ${config.method?.toUpperCase()} ${config.url}`);
|
|
26
|
+
const updatedConfig = setAxiosAuth(config, auth);
|
|
27
|
+
logger.debug(`[createAuthenticatedAxios] Auth applied: ${auth ? 'yes' : 'no'}`);
|
|
28
|
+
return updatedConfig;
|
|
29
|
+
});
|
|
30
|
+
logger.debug(`[createAuthenticatedAxios] Successfully configured and ready`);
|
|
31
|
+
return instance;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=jazz-p.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jazz-p.js","sourceRoot":"","sources":["../../../src/jazz/module/jazz-p.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,EAAQ,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe,EAAE,IAAW;IACnE,sCAAsC;IACtC,MAAM,CAAC,KAAK,CAAC,6CAA6C,OAAO,UAAU,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;IAEjH,8CAA8C;IAC9C,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,OAAO;QACP,OAAO,EAAE,KAAK;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;KACF,CAAC,CAAC;IAEH,gCAAgC;IAChC,MAAM,CAAC,KAAK,CAAC,kEAAkE,OAAO,EAAE,CAAC,CAAC;IAE1F,mEAAmE;IACnE,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAkC,EAAE,EAAE;QACvE,MAAM,CAAC,KAAK,CAAC,sDAAsD,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;QACjH,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,KAAK,CAAC,4CAA4C,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAChF,OAAO,aAAa,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAC7E,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TimeoutRetryOptions } from '../../core/retryable-handler.js';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for a download operation.
|
|
4
|
+
*/
|
|
5
|
+
export interface DownloadOptions {
|
|
6
|
+
/** Target URL to download from */
|
|
7
|
+
url: string;
|
|
8
|
+
/** Optional timeout in milliseconds (overrides instance default) */
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
/** Retry policy configuration */
|
|
11
|
+
retryOptions?: TimeoutRetryOptions;
|
|
12
|
+
/** AbortSignal for cancellation support */
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
/** Custom HTTP headers to include in the request */
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
/** Response type - defaults to 'arraybuffer' for binary data */
|
|
17
|
+
responseType?: 'arraybuffer';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Result of a successful download operation.
|
|
21
|
+
*/
|
|
22
|
+
export interface DownloadResult {
|
|
23
|
+
/** Raw binary data as Uint8Array */
|
|
24
|
+
data: Uint8Array;
|
|
25
|
+
/** MIME type from Content-Type header if present */
|
|
26
|
+
contentType?: string;
|
|
27
|
+
/** Content length from Content-Length header if present */
|
|
28
|
+
contentLength?: number;
|
|
29
|
+
/** ETag from response header if present (for caching/validation) */
|
|
30
|
+
etag?: string;
|
|
31
|
+
/** Last-Modified timestamp from response header if present */
|
|
32
|
+
lastModified?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* S3Downloader - Handles reliable binary downloads from S3 URLs with retry support.
|
|
36
|
+
*
|
|
37
|
+
* Features:
|
|
38
|
+
* - Automatic retry on transient failures (network errors, 5xx, rate limiting)
|
|
39
|
+
* - AbortSignal support for cancellation
|
|
40
|
+
* - Response header extraction (content-type, etag, etc.)
|
|
41
|
+
* - Size and checksum validation (optional)
|
|
42
|
+
*/
|
|
43
|
+
export declare class S3Downloader {
|
|
44
|
+
private readonly client;
|
|
45
|
+
private readonly retryHandler;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new S3Downloader instance.
|
|
48
|
+
* @param retryOptions - Optional retry policy configuration
|
|
49
|
+
*/
|
|
50
|
+
constructor(retryOptions?: TimeoutRetryOptions);
|
|
51
|
+
/**
|
|
52
|
+
* Download binary data from S3 URL with retry support.
|
|
53
|
+
* @param options - Download configuration
|
|
54
|
+
* @returns DownloadResult containing binary data and metadata
|
|
55
|
+
* @throws Error on non-retryable failures or after exhausting retries
|
|
56
|
+
*/
|
|
57
|
+
downloadBinary(options: DownloadOptions): Promise<DownloadResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Determines whether an error should trigger a retry.
|
|
60
|
+
* @param error - The error object from Axios or network layer
|
|
61
|
+
* @returns true if the error is transient and retryable
|
|
62
|
+
*/
|
|
63
|
+
private isRetryableError;
|
|
64
|
+
/**
|
|
65
|
+
* Helper to download and validate binary data with optional size and checksum checks.
|
|
66
|
+
* @param options - Download options with optional validation parameters
|
|
67
|
+
* @returns Uint8Array of the downloaded data (validated)
|
|
68
|
+
* @throws Error if size or checksum validation fails
|
|
69
|
+
*/
|
|
70
|
+
downloadAndValidate(options: DownloadOptions & {
|
|
71
|
+
expectedSize?: number;
|
|
72
|
+
expectedChecksum?: string;
|
|
73
|
+
}): Promise<Uint8Array>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Convenience function for simple one-off S3 downloads.
|
|
77
|
+
* @param url - Target URL to download from
|
|
78
|
+
* @param options - Optional configuration (retry, signal, headers)
|
|
79
|
+
* @returns Uint8Array of the downloaded data
|
|
80
|
+
*/
|
|
81
|
+
export declare function downloadFromS3(url: string, options?: {
|
|
82
|
+
retryOptions?: TimeoutRetryOptions;
|
|
83
|
+
signal?: AbortSignal;
|
|
84
|
+
headers?: Record<string, string>;
|
|
85
|
+
}): Promise<Uint8Array>;
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { TimeoutRetryHandler } from '../../core/retryable-handler.js';
|
|
3
|
+
import { logger } from '../../core/logger.js';
|
|
4
|
+
import { FheError } from '../../core/errors/fhe-error.js';
|
|
5
|
+
import { FheErrorCode } from '../../core/errors/error-codes.js';
|
|
6
|
+
/**
|
|
7
|
+
* S3Downloader - Handles reliable binary downloads from S3 URLs with retry support.
|
|
8
|
+
*
|
|
9
|
+
* Features:
|
|
10
|
+
* - Automatic retry on transient failures (network errors, 5xx, rate limiting)
|
|
11
|
+
* - AbortSignal support for cancellation
|
|
12
|
+
* - Response header extraction (content-type, etag, etc.)
|
|
13
|
+
* - Size and checksum validation (optional)
|
|
14
|
+
*/
|
|
15
|
+
export class S3Downloader {
|
|
16
|
+
client;
|
|
17
|
+
retryHandler;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new S3Downloader instance.
|
|
20
|
+
* @param retryOptions - Optional retry policy configuration
|
|
21
|
+
*/
|
|
22
|
+
constructor(retryOptions) {
|
|
23
|
+
// Enter constructor
|
|
24
|
+
logger.debug('[S3Downloader] Constructor called', { retryOptions: retryOptions ? 'provided' : 'default' });
|
|
25
|
+
// Initialize Axios client with timeout from retry options or fallback
|
|
26
|
+
const timeout = retryOptions?.maxRetryTimeMs || 120000;
|
|
27
|
+
this.client = axios.create({
|
|
28
|
+
timeout,
|
|
29
|
+
validateStatus: (status) => status >= 200 && status < 300,
|
|
30
|
+
});
|
|
31
|
+
// Initialize retry handler
|
|
32
|
+
this.retryHandler = new TimeoutRetryHandler(retryOptions);
|
|
33
|
+
logger.debug('[S3Downloader] Instance created', { timeout, retryEnabled: !!retryOptions });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Download binary data from S3 URL with retry support.
|
|
37
|
+
* @param options - Download configuration
|
|
38
|
+
* @returns DownloadResult containing binary data and metadata
|
|
39
|
+
* @throws Error on non-retryable failures or after exhausting retries
|
|
40
|
+
*/
|
|
41
|
+
async downloadBinary(options) {
|
|
42
|
+
const { url, signal, headers = {}, responseType = 'arraybuffer' } = options;
|
|
43
|
+
// Log method entry
|
|
44
|
+
logger.debug('[S3Downloader.downloadBinary] Enter', {
|
|
45
|
+
url,
|
|
46
|
+
responseType,
|
|
47
|
+
headersCount: Object.keys(headers).length,
|
|
48
|
+
hasSignal: !!signal,
|
|
49
|
+
});
|
|
50
|
+
// Validate method - only GET is supported (implied by axios.get)
|
|
51
|
+
const result = await this.retryHandler.withRetry(async () => {
|
|
52
|
+
// Check if aborted before request
|
|
53
|
+
if (signal?.aborted) {
|
|
54
|
+
logger.warn('[S3Downloader.downloadBinary] Aborted before request', { url });
|
|
55
|
+
throw new FheError({ code: FheErrorCode.Aborted, message: 'Download aborted' });
|
|
56
|
+
}
|
|
57
|
+
logger.trace('[S3Downloader.downloadBinary] Sending GET request', {
|
|
58
|
+
url,
|
|
59
|
+
headers: Object.keys(headers),
|
|
60
|
+
});
|
|
61
|
+
try {
|
|
62
|
+
const response = await this.client.get(url, {
|
|
63
|
+
headers: {
|
|
64
|
+
...headers,
|
|
65
|
+
},
|
|
66
|
+
responseType: responseType,
|
|
67
|
+
signal: signal,
|
|
68
|
+
// Axios will handle timeout via the instance config
|
|
69
|
+
});
|
|
70
|
+
// Check if aborted after response
|
|
71
|
+
if (signal?.aborted) {
|
|
72
|
+
logger.warn('[S3Downloader.downloadBinary] Aborted after response', { url });
|
|
73
|
+
throw new FheError({ code: FheErrorCode.Aborted, message: 'Download aborted after response' });
|
|
74
|
+
}
|
|
75
|
+
// Validate response status (already validated by validateStatus, but double-check)
|
|
76
|
+
if (response.status !== 200) {
|
|
77
|
+
logger.error('[S3Downloader.downloadBinary] Unexpected status', {
|
|
78
|
+
url,
|
|
79
|
+
status: response.status,
|
|
80
|
+
});
|
|
81
|
+
throw new FheError({ code: FheErrorCode.HttpError, message: `HTTP error! status: ${response.status}` });
|
|
82
|
+
}
|
|
83
|
+
// Convert ArrayBuffer to Uint8Array
|
|
84
|
+
const buffer = response.data;
|
|
85
|
+
const uint8Array = new Uint8Array(buffer);
|
|
86
|
+
// Extract and convert headers safely
|
|
87
|
+
const contentType = response.headers['content-type']
|
|
88
|
+
? String(response.headers['content-type'])
|
|
89
|
+
: undefined;
|
|
90
|
+
const contentLength = response.headers['content-length']
|
|
91
|
+
? parseInt(String(response.headers['content-length']), 10)
|
|
92
|
+
: undefined;
|
|
93
|
+
const etag = response.headers['etag']
|
|
94
|
+
? String(response.headers['etag'])
|
|
95
|
+
: undefined;
|
|
96
|
+
const lastModified = response.headers['last-modified']
|
|
97
|
+
? String(response.headers['last-modified'])
|
|
98
|
+
: undefined;
|
|
99
|
+
// Log successful download
|
|
100
|
+
logger.debug('[S3Downloader.downloadBinary] Download successful', {
|
|
101
|
+
url,
|
|
102
|
+
size: uint8Array.length,
|
|
103
|
+
contentType,
|
|
104
|
+
etag: etag,
|
|
105
|
+
});
|
|
106
|
+
return {
|
|
107
|
+
data: uint8Array,
|
|
108
|
+
contentType,
|
|
109
|
+
contentLength,
|
|
110
|
+
etag,
|
|
111
|
+
lastModified,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
// Handle abort errors without retry
|
|
116
|
+
if (error.name === 'AbortError' || error.code === 'ERR_CANCELED') {
|
|
117
|
+
logger.warn('[S3Downloader.downloadBinary] Request cancelled', {
|
|
118
|
+
url,
|
|
119
|
+
error: error.message,
|
|
120
|
+
});
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
// Check if the error is retryable
|
|
124
|
+
const isRetryable = this.isRetryableError(error);
|
|
125
|
+
if (!isRetryable) {
|
|
126
|
+
logger.error('[S3Downloader.downloadBinary] Non-retryable error', {
|
|
127
|
+
url,
|
|
128
|
+
error: error.message,
|
|
129
|
+
code: error.code,
|
|
130
|
+
status: error.response?.status,
|
|
131
|
+
});
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
// Log retryable error and enhance with context
|
|
135
|
+
logger.warn('[S3Downloader.downloadBinary] Retryable error, will retry', {
|
|
136
|
+
url,
|
|
137
|
+
error: error.message,
|
|
138
|
+
code: error.code,
|
|
139
|
+
status: error.response?.status,
|
|
140
|
+
});
|
|
141
|
+
// Wrap into a retryable FheError so the retry handler can honor it.
|
|
142
|
+
throw new FheError({
|
|
143
|
+
code: FheErrorCode.Network,
|
|
144
|
+
message: `S3 download failed: ${error.message}`,
|
|
145
|
+
retryable: true,
|
|
146
|
+
context: { url },
|
|
147
|
+
cause: error,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}, `S3Download:${url.substring(0, 50)}`, { url, headers: Object.keys(headers) }, async () => {
|
|
151
|
+
// Callback after failed attempt
|
|
152
|
+
logger.warn('[S3Downloader.downloadBinary] Retry attempt scheduled', {
|
|
153
|
+
url,
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
logger.debug('[S3Downloader.downloadBinary] Exit', {
|
|
157
|
+
url,
|
|
158
|
+
dataSize: result.data.length,
|
|
159
|
+
});
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Determines whether an error should trigger a retry.
|
|
164
|
+
* @param error - The error object from Axios or network layer
|
|
165
|
+
* @returns true if the error is transient and retryable
|
|
166
|
+
*/
|
|
167
|
+
isRetryableError(error) {
|
|
168
|
+
logger.trace('[S3Downloader.isRetryableError] Evaluating error', {
|
|
169
|
+
name: error.name,
|
|
170
|
+
code: error.code,
|
|
171
|
+
status: error.response?.status,
|
|
172
|
+
message: error.message?.substring(0, 100),
|
|
173
|
+
});
|
|
174
|
+
// Network errors - transient by nature
|
|
175
|
+
if (error.code === 'ECONNRESET' ||
|
|
176
|
+
error.code === 'ETIMEDOUT' ||
|
|
177
|
+
error.code === 'ENOTFOUND' ||
|
|
178
|
+
error.code === 'ECONNREFUSED') {
|
|
179
|
+
logger.trace('[S3Downloader.isRetryableError] Network error - retryable', { code: error.code });
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
// Axios timeout error
|
|
183
|
+
if (error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT') {
|
|
184
|
+
logger.trace('[S3Downloader.isRetryableError] Timeout error - retryable');
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
// Rate limiting or server errors (5xx)
|
|
188
|
+
if (error.response) {
|
|
189
|
+
const status = error.response.status;
|
|
190
|
+
if (status >= 500 && status < 600) {
|
|
191
|
+
logger.trace('[S3Downloader.isRetryableError] Server error - retryable', { status });
|
|
192
|
+
return true; // Server errors are retryable
|
|
193
|
+
}
|
|
194
|
+
if (status === 429) {
|
|
195
|
+
logger.trace('[S3Downloader.isRetryableError] Rate limiting - retryable');
|
|
196
|
+
return true; // Rate limiting - retry with backoff
|
|
197
|
+
}
|
|
198
|
+
if (status === 408) {
|
|
199
|
+
logger.trace('[S3Downloader.isRetryableError] Request timeout - retryable');
|
|
200
|
+
return true; // Request timeout
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// Check for retryable error messages
|
|
204
|
+
if (error.message) {
|
|
205
|
+
const retryablePhrases = [
|
|
206
|
+
'timeout',
|
|
207
|
+
'socket hang up',
|
|
208
|
+
'connection refused',
|
|
209
|
+
'connection reset',
|
|
210
|
+
'network error',
|
|
211
|
+
'unavailable',
|
|
212
|
+
'deadline exceeded',
|
|
213
|
+
];
|
|
214
|
+
const message = error.message.toLowerCase();
|
|
215
|
+
for (const phrase of retryablePhrases) {
|
|
216
|
+
if (message.includes(phrase)) {
|
|
217
|
+
logger.trace('[S3Downloader.isRetryableError] Retryable phrase detected', { phrase });
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
logger.trace('[S3Downloader.isRetryableError] Error is NOT retryable');
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Helper to download and validate binary data with optional size and checksum checks.
|
|
227
|
+
* @param options - Download options with optional validation parameters
|
|
228
|
+
* @returns Uint8Array of the downloaded data (validated)
|
|
229
|
+
* @throws Error if size or checksum validation fails
|
|
230
|
+
*/
|
|
231
|
+
async downloadAndValidate(options) {
|
|
232
|
+
const { expectedSize, expectedChecksum, ...downloadOptions } = options;
|
|
233
|
+
logger.debug('[S3Downloader.downloadAndValidate] Enter', {
|
|
234
|
+
url: downloadOptions.url,
|
|
235
|
+
expectedSize,
|
|
236
|
+
hasChecksum: !!expectedChecksum,
|
|
237
|
+
});
|
|
238
|
+
const result = await this.downloadBinary(downloadOptions);
|
|
239
|
+
const data = result.data;
|
|
240
|
+
// Validate size if expected
|
|
241
|
+
if (expectedSize !== undefined && data.length !== expectedSize) {
|
|
242
|
+
logger.error('[S3Downloader.downloadAndValidate] Size mismatch', {
|
|
243
|
+
url: downloadOptions.url,
|
|
244
|
+
expected: expectedSize,
|
|
245
|
+
actual: data.length,
|
|
246
|
+
});
|
|
247
|
+
throw new FheError({ code: FheErrorCode.InvalidArgument, message: `Size mismatch: expected ${expectedSize}, got ${data.length}` });
|
|
248
|
+
}
|
|
249
|
+
// Validate checksum if provided (simple example - you might want to use crypto)
|
|
250
|
+
if (expectedChecksum) {
|
|
251
|
+
logger.warn('[S3Downloader.downloadAndValidate] Checksum validation requested but not implemented', {
|
|
252
|
+
url: downloadOptions.url,
|
|
253
|
+
});
|
|
254
|
+
// You could implement checksum verification here
|
|
255
|
+
// For example, using crypto.subtle or other hashing libraries
|
|
256
|
+
// const actualChecksum = await computeChecksum(data);
|
|
257
|
+
// if (actualChecksum !== expectedChecksum) {
|
|
258
|
+
// throw new Error(`Checksum mismatch`);
|
|
259
|
+
// }
|
|
260
|
+
}
|
|
261
|
+
logger.debug('[S3Downloader.downloadAndValidate] Validation passed', {
|
|
262
|
+
url: downloadOptions.url,
|
|
263
|
+
dataSize: data.length,
|
|
264
|
+
});
|
|
265
|
+
return data;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Convenience function for simple one-off S3 downloads.
|
|
270
|
+
* @param url - Target URL to download from
|
|
271
|
+
* @param options - Optional configuration (retry, signal, headers)
|
|
272
|
+
* @returns Uint8Array of the downloaded data
|
|
273
|
+
*/
|
|
274
|
+
export async function downloadFromS3(url, options) {
|
|
275
|
+
// Enter function
|
|
276
|
+
logger.debug('[downloadFromS3] Enter', {
|
|
277
|
+
url: url.substring(0, 60) + (url.length > 60 ? '...' : ''),
|
|
278
|
+
hasRetryOptions: !!options?.retryOptions,
|
|
279
|
+
hasSignal: !!options?.signal,
|
|
280
|
+
});
|
|
281
|
+
const downloader = new S3Downloader(options?.retryOptions);
|
|
282
|
+
const result = await downloader.downloadBinary({
|
|
283
|
+
url,
|
|
284
|
+
signal: options?.signal,
|
|
285
|
+
headers: options?.headers,
|
|
286
|
+
});
|
|
287
|
+
logger.debug('[downloadFromS3] Exit', {
|
|
288
|
+
url: url.substring(0, 60) + (url.length > 60 ? '...' : ''),
|
|
289
|
+
dataSize: result.data.length,
|
|
290
|
+
});
|
|
291
|
+
return result.data;
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=s3-download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3-download.js","sourceRoot":"","sources":["../../../src/jazz/module/s3-download.ts"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAuB,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAoChE;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAY;IACN,MAAM,CAAgB;IACtB,YAAY,CAAsB;IAEnD;;;OAGG;IACH,YAAY,YAAkC;QAC5C,oBAAoB;QACpB,MAAM,CAAC,KAAK,CAAC,mCAAmC,EAAE,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QAE3G,sEAAsE;QACtE,MAAM,OAAO,GAAG,YAAY,EAAE,cAAc,IAAI,MAAM,CAAC;QACvD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;YACzB,OAAO;YACP,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,IAA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