diff --git a/examples/call_raw/src/index.ts b/examples/call_raw/src/index.ts index 257f00ab92..b64cf24290 100644 --- a/examples/call_raw/src/index.ts +++ b/examples/call_raw/src/index.ts @@ -1,33 +1,11 @@ -import { - Canister, - ic, - nat, - nat64, - Principal, - text, - update -} from 'azle/experimental'; +import { Canister, ic, nat, Principal, text, update } from 'azle/experimental'; export default Canister({ executeCallRaw: update( - [Principal, text, text, nat64], - text, - async (canisterId, method, candidArgs, payment) => { - const result = await ic.callRaw( - canisterId, - method, - ic.candidEncode(candidArgs), - payment - ); - - return ic.candidDecode(result); - } - ), - executeCallRaw128: update( [Principal, text, text, nat], text, async (canisterId, method, candidArgs, payment) => { - const result = await ic.callRaw128( + const result = await ic.callRaw( canisterId, method, ic.candidEncode(candidArgs), diff --git a/examples/call_raw/test/tests.ts b/examples/call_raw/test/tests.ts index 73708a63de..d9f2d61a10 100644 --- a/examples/call_raw/test/tests.ts +++ b/examples/call_raw/test/tests.ts @@ -28,28 +28,5 @@ export function getTests(call_raw_canister: ActorSubclass<_SERVICE>): Test { expect(result).toMatch('record'); expect(result).toMatch('principal'); }); - - it('calls raw_rand via execute_call_raw128', async () => { - const result = await call_raw_canister.executeCallRaw128( - Principal.fromText('aaaaa-aa'), - 'raw_rand', - '()', - 0n - ); - - expect(result).toMatch('blob'); - }); - - it('calls create_canister via execute_call_raw128', async () => { - const result = await call_raw_canister.executeCallRaw128( - Principal.fromText('aaaaa-aa'), - 'create_canister', - '(record { settings = null })', - 100_000_000_000n - ); - - expect(result).toMatch('record'); - expect(result).toMatch('principal'); - }); }; } diff --git a/examples/ckbtc/package-lock.json b/examples/ckbtc/package-lock.json index 16df809743..b7cf69424a 100644 --- a/examples/ckbtc/package-lock.json +++ b/examples/ckbtc/package-lock.json @@ -14,7 +14,7 @@ "@dfinity/identity": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.4", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -755,6 +755,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1471,6 +1487,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3367,6 +3385,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5085,6 +5115,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5473,6 +5512,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5516,6 +5557,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -5528,6 +5571,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -5631,7 +6083,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.2.0", diff --git a/examples/composite_queries/package-lock.json b/examples/composite_queries/package-lock.json index f53bee566f..6529291eec 100644 --- a/examples/composite_queries/package-lock.json +++ b/examples/composite_queries/package-lock.json @@ -12,7 +12,7 @@ "@dfinity/agent": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.4", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -737,6 +737,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1453,6 +1469,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3302,6 +3320,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5020,6 +5050,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5408,6 +5447,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5451,6 +5492,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -5463,6 +5506,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5560,7 +6012,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.2.0", @@ -6289,6 +6743,13 @@ "@noble/hashes": "^1.3.1" } }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -6742,6 +7203,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -8124,6 +8587,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9449,6 +9921,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9714,6 +10192,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -9735,6 +10215,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" } @@ -9746,6 +10228,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9797,7 +10477,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.2.0", diff --git a/examples/composite_queries/src/canister1/index.ts b/examples/composite_queries/src/canister1/index.ts index 05ff405951..7265babda6 100644 --- a/examples/composite_queries/src/canister1/index.ts +++ b/examples/composite_queries/src/canister1/index.ts @@ -72,9 +72,12 @@ const CompQueryCanister = Canister({ ); const responseJson = await response.json(); - ic.reply(responseJson, text); + ic.reply({ data: responseJson, candidType: text }); } else { - ic.reply(await ic.call(canister2.manualQuery), text); + ic.reply({ + data: await ic.call(canister2.manualQuery), + candidType: text + }); } }, { manual: true } diff --git a/examples/composite_queries/src/canister2/index.ts b/examples/composite_queries/src/canister2/index.ts index 959a5ea264..4828bc05b9 100644 --- a/examples/composite_queries/src/canister2/index.ts +++ b/examples/composite_queries/src/canister2/index.ts @@ -35,7 +35,10 @@ export default Canister({ [], Manual(text), () => { - ic.reply('Hello from Canister 2 manual query', text); + ic.reply({ + data: 'Hello from Canister 2 manual query', + candidType: text + }); }, { manual: true } ), diff --git a/examples/cycles/src/cycles/index.did b/examples/cycles/src/cycles/index.did index 0d3dfd51c0..d21649aa87 100644 --- a/examples/cycles/src/cycles/index.did +++ b/examples/cycles/src/cycles/index.did @@ -1,6 +1,4 @@ service: () -> { - getCanisterBalance: () -> (nat64) query; - getCanisterBalance128: () -> (nat) query; - receiveCycles: () -> (nat64); - receiveCycles128: () -> (nat); + getCanisterBalance: () -> (nat) query; + receiveCycles: () -> (nat); } diff --git a/examples/cycles/src/cycles/index.ts b/examples/cycles/src/cycles/index.ts index 00ad187b9e..8a50b9554b 100644 --- a/examples/cycles/src/cycles/index.ts +++ b/examples/cycles/src/cycles/index.ts @@ -1,17 +1,10 @@ -import { Canister, ic, nat, nat64, query, update } from 'azle/experimental'; +import { Canister, ic, nat, query, update } from 'azle/experimental'; export default Canister({ - receiveCycles: update([], nat64, () => { + receiveCycles: update([], nat, () => { return ic.msgCyclesAccept(ic.msgCyclesAvailable() / 2n); }), - // Moves all transferred cycles to the canister - receiveCycles128: update([], nat, () => { - return ic.msgCyclesAccept128(ic.msgCyclesAvailable128() / 2n); - }), - getCanisterBalance: query([], nat64, () => { + getCanisterBalance: query([], nat, () => { return ic.canisterBalance(); - }), - getCanisterBalance128: query([], nat, () => { - return ic.canisterBalance128(); }) }); diff --git a/examples/cycles/src/intermediary/index.ts b/examples/cycles/src/intermediary/index.ts index fab9f2bcdb..eb51ca5e23 100644 --- a/examples/cycles/src/intermediary/index.ts +++ b/examples/cycles/src/intermediary/index.ts @@ -3,7 +3,6 @@ import { ic, init, nat, - nat64, Principal, query, serialize, @@ -20,7 +19,7 @@ export default Canister({ cyclesCanister = Cycles(Principal.fromText(getCyclesPrincipal())); }), // Reports the number of cycles returned from the Cycles canister - sendCycles: update([], nat64, async () => { + sendCycles: update([], nat, async () => { if (process.env.AZLE_TEST_FETCH === 'true') { const response = await fetch( `icp://${getCyclesPrincipal()}/receiveCycles`, @@ -45,33 +44,8 @@ export default Canister({ cycles: 1_000_000n }); }), - // Reports the number of cycles returned from the Cycles canister - sendCycles128: update([], nat, async () => { - if (process.env.AZLE_TEST_FETCH === 'true') { - await fetch(`icp://${getCyclesPrincipal()}/receiveCycles128`, { - body: serialize({ - candidPath: '/candid/cycles.did', - cycles128: 1_000_000n - }) - }); - } else { - await ic.call(cyclesCanister.receiveCycles128, { - cycles128: 1_000_000n - }); - } - - return ic.msgCyclesRefunded128(); - }), - sendCycles128Notify: update([], Void, () => { - return ic.notify(cyclesCanister.receiveCycles128, { - cycles: 1_000_000n - }); - }), - getCanisterBalance: query([], nat64, () => { + getCanisterBalance: query([], nat, () => { return ic.canisterBalance(); - }), - getCanisterBalance128: query([], nat, () => { - return ic.canisterBalance128(); }) }); diff --git a/examples/cycles/test/tests.ts b/examples/cycles/test/tests.ts index c0bb2ec6a8..b309f2816a 100644 --- a/examples/cycles/test/tests.ts +++ b/examples/cycles/test/tests.ts @@ -16,11 +16,6 @@ export function getTests( await intermediaryCanister.getCanisterBalance(); const cyclesCallResult = await cyclesCanister.getCanisterBalance(); - const intermediaryCanister128Result = - await intermediaryCanister.getCanisterBalance128(); - const cyclesCanister128Result = - await cyclesCanister.getCanisterBalance128(); - const twoAndAHalfTrillion = 2_500_000_000_000n; const fourTrillion = 4_000_000_000_000n; @@ -28,14 +23,6 @@ export function getTests( expect(intermediaryCallResult).toBeLessThan(fourTrillion); expect(cyclesCallResult).toBeGreaterThan(twoAndAHalfTrillion); expect(cyclesCallResult).toBeLessThan(fourTrillion); - expect(intermediaryCanister128Result).toBeGreaterThan( - twoAndAHalfTrillion - ); - expect(intermediaryCanister128Result).toBeLessThan(fourTrillion); - expect(cyclesCanister128Result).toBeGreaterThan( - twoAndAHalfTrillion - ); - expect(cyclesCanister128Result).toBeLessThan(fourTrillion); }); it('checks msgCyclesAvailable and msgCyclesAccept with 0 cycles sent', async () => { @@ -44,12 +31,6 @@ export function getTests( expect(result).toBe(0n); }); - it('checks msgCyclesAvailable128 and msgCyclesAccept128 with 0 cycles sent', async () => { - const result = await cyclesCanister.receiveCycles128(); - - expect(result).toBe(0n); - }); - it('refunds cycles with msgCyclesRefunded', async () => { const refundResult = await intermediaryCanister.sendCycles(); @@ -58,37 +39,9 @@ export function getTests( // await intermediaryCanister.getCanisterBalance(); // const cyclesCallResult = await cyclesCanister.getCanisterBalance(); - // const intermediaryCanister128Result = - // await intermediaryCanister.getCanisterBalance128(); - // const cyclesCanister128Result = - // await cyclesCanister.getCanisterBalance128(); - expect(refundResult).toBe(500_000n); // expect(intermediaryCallResult).toBe(3_999_999_500_000n); // expect(cyclesCallResult).toBe(4_000_000_500_000n); - // expect(intermediaryCanister128Result).toBe(3_999_999_500_000n); - // expect(cyclesCanister128Result).toBe(4_000_000_500_000n); - }); - - it('refunds cycles with msgCyclesRefunded128', async () => { - const refundResult = await intermediaryCanister.sendCycles128(); - - // TODO It would be a bit messy and difficult to try and do this - // const intermediaryCallResult = - // await intermediaryCanister.getCanisterBalance(); - // const cyclesCallResult = - // await cyclesCanister.getCanisterBalance(); - - // const intermediaryCanister128Result = - // await intermediaryCanister.getCanisterBalance128(); - // const cyclesCanister128Result = - // await cyclesCanister.getCanisterBalance128(); - - expect(refundResult).toBe(500_000n); - // expect(intermediaryCallResult).toBe(3_999_999_000_000n); - // expect(cyclesCallResult).toBe(4_000_001_000_000n); - // expect(intermediaryCanister128Result).toBe(3_999_999_000_000n); - // expect(cyclesCanister128Result).toBe(4_000_001_000_000n); }); it('sends cycles with notify', async () => { @@ -101,38 +54,9 @@ export function getTests( // const cyclesCallResult = // await cyclesCanister.getCanisterBalance(); - // const intermediaryCanister128Result = - // await intermediaryCanister.getCanisterBalance128(); - // const cyclesCanister128Result = - // await cyclesCanister.getCanisterBalance128(); - expect(sendCyclesNotifyResult).toBeUndefined(); // expect(intermediaryCallResult).toBe(3_999_998_500_000n); // expect(cyclesCallResult).toBe(4_000_001_500_000n); - // expect(intermediaryCanister128Result).toBe(3_999_998_500_000n); - // expect(cyclesCanister128Result).toBe(4_000_001_500_000n); - }); - - it('sends cycles128 with notify', async () => { - const sendCycles128NotifyResult = - await intermediaryCanister.sendCycles128Notify(); - - // TODO It would be a bit messy and difficult to try and do this - // const intermediaryCallResult = - // await intermediaryCanister.getCanisterBalance(); - // const cyclesCallResult = - // await cyclesCanister.getCanisterBalance(); - - // const intermediaryCanister128Result = - // await intermediaryCanister.getCanisterBalance128(); - // const cyclesCanister128Result = - // await cyclesCanister.getCanisterBalance128(); - - expect(sendCycles128NotifyResult).toBeUndefined(); - // expect(intermediaryCallResult).toBe(3_999_998_000_000n); - // expect(cyclesCallResult).toBe(4_000_002_000_000n); - // expect(intermediaryCanister128Result).toBe(3_999_998_000_000n); - // expect(cyclesCanister128Result).toBe(4_000_002_000_000n); }); }; } diff --git a/examples/ic_api/src/index.ts b/examples/ic_api/src/index.ts index adb6619438..ce98ace83c 100644 --- a/examples/ic_api/src/index.ts +++ b/examples/ic_api/src/index.ts @@ -72,13 +72,9 @@ export default Canister({ return ic.caller(); }), // returns the amount of cycles available in the canister - canisterBalance: query([], nat64, () => { + canisterBalance: query([], nat, () => { return ic.canisterBalance(); }), - // returns the amount of cycles available in the canister - canisterBalance128: query([], nat, () => { - return ic.canisterBalance128(); - }), // returns the canister's version number canisterVersion: query([], nat64, () => { return ic.canisterVersion(); diff --git a/examples/ic_api/test/tests.ts b/examples/ic_api/test/tests.ts index 411ebe776a..fa40b2bd54 100644 --- a/examples/ic_api/test/tests.ts +++ b/examples/ic_api/test/tests.ts @@ -113,13 +113,6 @@ export function getTests(icApiCanister: ActorSubclass<_SERVICE>): Test { expect(result).toBeLessThan(4_000_000_000_000n); }); - it('calls canisterBalance128 on the ic object', async () => { - const result = await icApiCanister.canisterBalance128(); - - expect(result).toBeGreaterThan(2_000_000_000_000n); - expect(result).toBeLessThan(4_000_000_000_000n); - }); - it('calls canisterVersion on the ic object', async () => { const result = await icApiCanister.canisterVersion(); diff --git a/examples/management_canister/package-lock.json b/examples/management_canister/package-lock.json index ba7e640044..669d44d4c6 100644 --- a/examples/management_canister/package-lock.json +++ b/examples/management_canister/package-lock.json @@ -12,7 +12,7 @@ "@dfinity/agent": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -737,6 +737,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1453,6 +1469,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3302,6 +3320,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5020,6 +5050,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5408,6 +5447,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5451,6 +5492,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -5463,6 +5506,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5560,7 +6012,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.2.0", @@ -6289,6 +6743,13 @@ "@noble/hashes": "^1.3.1" } }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -6742,6 +7203,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -8124,6 +8587,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9449,6 +9921,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9714,6 +10192,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -9735,6 +10215,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" } @@ -9746,6 +10228,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9797,7 +10477,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.2.0", diff --git a/examples/manual_reply/package-lock.json b/examples/manual_reply/package-lock.json index e5eef05d1a..ad520dcd75 100644 --- a/examples/manual_reply/package-lock.json +++ b/examples/manual_reply/package-lock.json @@ -12,7 +12,7 @@ "@dfinity/agent": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -737,6 +737,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1453,6 +1469,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3302,6 +3320,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5023,6 +5053,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5411,6 +5450,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5454,6 +5495,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -5466,6 +5509,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5563,7 +6015,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -6292,6 +6746,13 @@ "@noble/hashes": "^1.3.1" } }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -6745,6 +7206,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -8127,6 +8590,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9452,6 +9924,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9717,6 +10195,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -9738,6 +10218,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" } @@ -9749,6 +10231,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9800,7 +10480,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.3.0", diff --git a/examples/manual_reply/src/index.ts b/examples/manual_reply/src/index.ts index e3b56a0a44..0d384e7675 100644 --- a/examples/manual_reply/src/index.ts +++ b/examples/manual_reply/src/index.ts @@ -79,7 +79,7 @@ export default Canister({ return; } - ic.reply(message, text); + ic.reply({ data: message, candidType: text }); }, { manual: true } ), @@ -87,10 +87,12 @@ export default Canister({ [], Manual(blob), () => { - ic.reply( - new Uint8Array([83, 117, 114, 112, 114, 105, 115, 101, 33]), - blob - ); + ic.reply({ + data: new Uint8Array([ + 83, 117, 114, 112, 114, 105, 115, 101, 33 + ]), + candidType: blob + }); }, { manual: true } ), @@ -98,7 +100,7 @@ export default Canister({ [], Manual(float32), () => { - ic.reply(1245.678, float32); + ic.reply({ data: 1245.678, candidType: float32 }); }, { manual: true } ), @@ -106,7 +108,7 @@ export default Canister({ [], Manual(int8), () => { - ic.reply(-100, int8); + ic.reply({ data: -100, candidType: int8 }); }, { manual: true } ), @@ -114,7 +116,7 @@ export default Canister({ [], Manual(nat), () => { - ic.reply(184467440737095516150n, nat); + ic.reply({ data: 184467440737095516150n, candidType: nat }); }, { manual: true } ), @@ -122,7 +124,7 @@ export default Canister({ [], Manual(Null), () => { - ic.reply(null, Null); + ic.reply({ data: null, candidType: Null }); }, { manual: true } ), @@ -130,7 +132,7 @@ export default Canister({ [], Manual(Void), () => { - ic.reply(undefined, Void); + ic.reply({ data: undefined, candidType: Void }); }, { manual: true } ), @@ -154,7 +156,7 @@ export default Canister({ Gas: { Elemental: null } } }; - ic.reply(element, Element); + ic.reply({ data: element, candidType: Element }); }, { manual: true } ), @@ -162,7 +164,7 @@ export default Canister({ [], Manual(reserved), () => { - ic.reply(undefined, reserved); + ic.reply({ data: undefined, candidType: reserved }); }, { manual: true } ), @@ -170,7 +172,7 @@ export default Canister({ [], Manual(text), () => { - ic.reply('hello', text); + ic.reply({ data: 'hello', candidType: text }); }, { manual: true } ), @@ -179,7 +181,7 @@ export default Canister({ Manual(Gas), () => { const gas = { Toxic: null }; - ic.reply(gas, Gas); + ic.reply({ data: gas, candidType: Gas }); }, { manual: true } ), @@ -187,11 +189,11 @@ export default Canister({ [], Manual(RawReply), () => { - ic.replyRaw( - ic.candidEncode( + ic.reply({ + raw: ic.candidEncode( '(record { "int" = 42; "text" = "text"; "bool" = true; "myBlob" = blob "Surprise!"; "myVariant" = variant { Medium } })' ) - ); + }); }, { manual: true } ), @@ -205,7 +207,7 @@ export default Canister({ return; } - ic.reply(message, text); + ic.reply({ data: message, candidType: text }); }, { manual: true } ), @@ -213,10 +215,12 @@ export default Canister({ [], Manual(blob), () => { - ic.reply( - new Uint8Array([83, 117, 114, 112, 114, 105, 115, 101, 33]), - blob - ); + ic.reply({ + data: new Uint8Array([ + 83, 117, 114, 112, 114, 105, 115, 101, 33 + ]), + candidType: blob + }); }, { manual: true } ), @@ -224,7 +228,7 @@ export default Canister({ [], Manual(float32), () => { - ic.reply(1245.678, float32); + ic.reply({ data: 1245.678, candidType: float32 }); }, { manual: true } ), @@ -232,7 +236,7 @@ export default Canister({ [], Manual(int8), () => { - ic.reply(-100, int8); + ic.reply({ data: -100, candidType: int8 }); }, { manual: true } ), @@ -240,7 +244,7 @@ export default Canister({ [], Manual(nat), () => { - ic.reply(184_467_440_737_095_516_150n, nat); + ic.reply({ data: 184_467_440_737_095_516_150n, candidType: nat }); }, { manual: true } ), @@ -248,7 +252,7 @@ export default Canister({ [], Manual(Null), () => { - ic.reply(null, Null); + ic.reply({ data: null, candidType: Null }); }, { manual: true } ), @@ -256,7 +260,7 @@ export default Canister({ [], Manual(Void), () => { - ic.reply(undefined, Void); + ic.reply({ data: undefined, candidType: Void }); }, { manual: true } ), @@ -280,7 +284,7 @@ export default Canister({ Gas: { Elemental: null } } }; - ic.reply(element, Element); + ic.reply({ data: element, candidType: Element }); }, { manual: true } ), @@ -288,7 +292,7 @@ export default Canister({ [], Manual(reserved), () => { - ic.reply(undefined, reserved); + ic.reply({ data: undefined, candidType: reserved }); }, { manual: true } ), @@ -296,7 +300,7 @@ export default Canister({ [], Manual(text), () => { - ic.reply('hello', text); + ic.reply({ data: 'hello', candidType: text }); }, { manual: true } ), @@ -305,7 +309,7 @@ export default Canister({ Manual(Gas), () => { const gas = { Toxic: null }; - ic.reply(gas, Gas); + ic.reply({ data: gas, candidType: Gas }); }, { manual: true } ) diff --git a/examples/null_example/package-lock.json b/examples/null_example/package-lock.json index 3d2eda8d55..d4eeec17fb 100644 --- a/examples/null_example/package-lock.json +++ b/examples/null_example/package-lock.json @@ -12,7 +12,7 @@ "@dfinity/agent": "0.11.1", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "10.7.0", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -712,6 +712,22 @@ "dev": true, "peer": true }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -3226,6 +3242,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4947,6 +4975,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5335,6 +5372,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -5378,6 +5417,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5475,7 +5923,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -6168,6 +6618,13 @@ "dev": true, "peer": true }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -7948,6 +8405,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9273,6 +9739,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9538,6 +10010,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -9559,6 +10033,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9610,7 +10282,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.3.0", diff --git a/examples/open_value_sharing/src/wallet.ts b/examples/open_value_sharing/src/wallet.ts index 9b03963cc2..233768348d 100644 --- a/examples/open_value_sharing/src/wallet.ts +++ b/examples/open_value_sharing/src/wallet.ts @@ -47,16 +47,16 @@ export default Canister({ }), wallet_receive: update([Opt(ReceiveOptions)], Void, (_receiveOptions) => { console.log('wallet_receive'); - console.log(`cycles available: ${ic.msgCyclesAvailable128()}`); + console.log(`cycles available: ${ic.msgCyclesAvailable()}`); const callerInWhitelist = principalsWhitelist.includes( ic.caller().toText() ); if (callerInWhitelist) { - const cyclesAvailable = ic.msgCyclesAvailable128(); + const cyclesAvailable = ic.msgCyclesAvailable(); - ic.msgCyclesAccept128(cyclesAvailable); + ic.msgCyclesAccept(cyclesAvailable); payments.push({ time: ic.time(), diff --git a/examples/outgoing_http_requests/src/index.ts b/examples/outgoing_http_requests/src/index.ts index 4e5c98ab59..c1bd9cef11 100644 --- a/examples/outgoing_http_requests/src/index.ts +++ b/examples/outgoing_http_requests/src/index.ts @@ -81,7 +81,7 @@ export default Canister({ 50_000_000n ); - ic.replyRaw(httpResponse); + ic.reply({ raw: httpResponse }); }, { manual: true } ), diff --git a/examples/primitive_types/package-lock.json b/examples/primitive_types/package-lock.json index 63c2a493cd..e6041116a1 100644 --- a/examples/primitive_types/package-lock.json +++ b/examples/primitive_types/package-lock.json @@ -12,7 +12,7 @@ "@dfinity/agent": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -623,6 +623,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -738,6 +740,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1454,6 +1472,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3319,6 +3339,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5040,6 +5072,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5428,6 +5469,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5471,6 +5514,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5568,7 +6020,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", diff --git a/examples/principal/package-lock.json b/examples/principal/package-lock.json index 1b6525bc58..9551b6fe4e 100644 --- a/examples/principal/package-lock.json +++ b/examples/principal/package-lock.json @@ -12,7 +12,7 @@ "@dfinity/agent": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -623,6 +623,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -738,6 +740,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1454,6 +1472,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3319,6 +3339,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5040,6 +5072,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5428,6 +5469,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5471,6 +5514,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5568,7 +6020,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", diff --git a/examples/principal/test/tests.ts b/examples/principal/test/tests.ts index 0aa38ea69f..5483522f4b 100644 --- a/examples/principal/test/tests.ts +++ b/examples/principal/test/tests.ts @@ -70,6 +70,16 @@ function getFromHexTests(principalCanister: ActorSubclass<_SERVICE>): Test { expect(result.toHex()).toBe(principal.toHex()); }); + it('converts the hex of the anonymous principal to a principal', async () => { + const principal = Principal.fromHex('04'); + + const result = await principalCanister.principalFromHex( + principal.toHex() + ); + + expect(result.toHex()).toBe(principal.toHex()); + }); + it('converts the hex of rrkah-fqaaa-aaaaa-aaaaq-cai to a principal', async () => { const principal = Principal.fromText('rrkah-fqaaa-aaaaa-aaaaq-cai'); @@ -136,6 +146,16 @@ function getFromTextTests(principalCanister: ActorSubclass<_SERVICE>): Test { expect(result.toText()).toBe(principal.toText()); }); + it('converts text representation of the anonymous principal to a principal', async () => { + const principal = Principal.fromText('2vxsx-fae'); + + const result = await principalCanister.principalFromText( + principal.toText() + ); + + expect(result.toText()).toBe(principal.toText()); + }); + it('converts "rrkah-fqaaa-aaaaa-aaaaq-cai" to a principal', async () => { const principal = Principal.fromText('rrkah-fqaaa-aaaaa-aaaaq-cai'); diff --git a/examples/robust_imports/package-lock.json b/examples/robust_imports/package-lock.json index 20bb71bf8d..a7601ed01a 100644 --- a/examples/robust_imports/package-lock.json +++ b/examples/robust_imports/package-lock.json @@ -12,7 +12,7 @@ "@dfinity/agent": "0.18.1", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "10.7.0", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -714,6 +714,22 @@ "js-sha256": "^0.9.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -3228,6 +3244,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4949,6 +4977,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5337,6 +5374,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -5380,6 +5419,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5477,7 +5925,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -6172,6 +6622,13 @@ "js-sha256": "^0.9.0" } }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -7952,6 +8409,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9277,6 +9743,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9542,6 +10014,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -9563,6 +10037,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9614,7 +10286,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.3.0", diff --git a/examples/robust_imports/src/azle_coverage/index.ts b/examples/robust_imports/src/azle_coverage/index.ts index 8e6f34891f..e18e6f93ec 100644 --- a/examples/robust_imports/src/azle_coverage/index.ts +++ b/examples/robust_imports/src/azle_coverage/index.ts @@ -265,7 +265,7 @@ export const isMangoTrickyToEat = kiwi( [], Mango(boysenberry), () => { - lemon.reply(true, blackberry); + lemon.reply({ data: true, candidType: blackberry }); }, { manual: true } ); diff --git a/examples/robust_imports/src/type_alias_decls/index.ts b/examples/robust_imports/src/type_alias_decls/index.ts index c3d6265149..db3b137953 100644 --- a/examples/robust_imports/src/type_alias_decls/index.ts +++ b/examples/robust_imports/src/type_alias_decls/index.ts @@ -190,7 +190,7 @@ export const getManualAlias = azle.query( [], types.DeepManualAlias(azle.float64), () => { - azle.ic.reply(9.87, azle.float64); + azle.ic.reply({ data: 9.87, candidType: azle.float64 }); }, { manual: true } ); diff --git a/examples/stable_memory/package-lock.json b/examples/stable_memory/package-lock.json index ea31dafc33..b68a16b4cc 100644 --- a/examples/stable_memory/package-lock.json +++ b/examples/stable_memory/package-lock.json @@ -12,7 +12,7 @@ "@dfinity/agent": "0.11.1", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "10.7.0", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -712,6 +712,22 @@ "dev": true, "peer": true }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -3226,6 +3242,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4947,6 +4975,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5335,6 +5372,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -5378,6 +5417,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5475,7 +5923,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -6168,6 +6618,13 @@ "dev": true, "peer": true }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -7948,6 +8405,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9273,6 +9739,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9538,6 +10010,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -9559,6 +10033,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9610,7 +10282,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.3.0", diff --git a/examples/stable_memory/src/index.ts b/examples/stable_memory/src/index.ts index ba99a3efc1..42ec090807 100644 --- a/examples/stable_memory/src/index.ts +++ b/examples/stable_memory/src/index.ts @@ -2,7 +2,6 @@ import { blob, Canister, ic, - nat32, nat64, query, update, @@ -12,30 +11,18 @@ import { const STABLE_BYTES_SIZE = 655_360; export default Canister({ - stableSize: query([], nat32, () => { + stableSize: query([], nat64, () => { return ic.stableSize(); }), - stable64Size: query([], nat64, () => { - return ic.stable64Size(); - }), - stableGrow: update([nat32], nat32, (newPages) => { + stableGrow: update([nat64], nat64, (newPages) => { return ic.stableGrow(newPages); }), - stable64Grow: update([nat64], nat64, (newPages) => { - return ic.stable64Grow(newPages); - }), - stableWrite: update([nat32, blob], Void, (offset, buf) => { + stableWrite: update([nat64, blob], Void, (offset, buf) => { ic.stableWrite(offset, buf); }), - stable64Write: update([nat64, blob], Void, (offset, buf) => { - ic.stable64Write(offset, buf); - }), - stableRead: query([nat32, nat32], blob, (offset, length) => { + stableRead: query([nat64, nat64], blob, (offset, length) => { return ic.stableRead(offset, length); }), - stable64Read: query([nat64, nat64], blob, (offset, length) => { - return ic.stable64Read(offset, length); - }), stableBytes: query([], blob, () => { return ic.stableBytes().slice(0, STABLE_BYTES_SIZE); }) diff --git a/examples/stable_memory/test/tests.ts b/examples/stable_memory/test/tests.ts index 48c1639877..f890939067 100644 --- a/examples/stable_memory/test/tests.ts +++ b/examples/stable_memory/test/tests.ts @@ -5,7 +5,6 @@ import { expect, it, Test } from 'azle/test'; import { _SERVICE } from './dfx_generated/stable_memory/stable_memory.did'; const PAGE_SIZE = 65_536; // This should currently remain constant -const MAX_STABLE_MEM_PAGES = 65_536; // This will always remain constant const MAX_STABLE64_MEM_PAGES = 6_553_600n; // (# Gib * 2^30) / PAGE_SIZE const STABLE_BYTES_SIZE = 655_360; @@ -14,18 +13,12 @@ export function getTests(stableMemoryCanister: ActorSubclass<_SERVICE>): Test { it('stable size', async () => { const result = await stableMemoryCanister.stableSize(); - expect(result).toBe(513); - }); - - it('stable64 size', async () => { - const result = await stableMemoryCanister.stable64Size(); - expect(result).toBe(513n); }); it('stable grow', async () => { const oldSize = await stableMemoryCanister.stableSize(); - const newPages = 5; + const newPages = 5n; const result = await stableMemoryCanister.stableGrow(newPages); const newSize = await stableMemoryCanister.stableSize(); @@ -33,16 +26,6 @@ export function getTests(stableMemoryCanister: ActorSubclass<_SERVICE>): Test { expect(newPages + oldSize).toBe(newSize); }); - it('stable64 grow', async () => { - const oldSize = await stableMemoryCanister.stable64Size(); - const newPages = 5n; - const result = await stableMemoryCanister.stable64Grow(newPages); - const newSize = await stableMemoryCanister.stable64Size(); - - expect(result).toBe(oldSize); - expect(newPages + oldSize).toBe(newSize); - }); - it('stable bytes', async () => { // TODO this test used to check that the entire stable memory was empty // TODO but with the stable filesystem we use with ic-wasi-polyfill @@ -54,54 +37,26 @@ export function getTests(stableMemoryCanister: ActorSubclass<_SERVICE>): Test { }); it('stable read/write no offset', async () => { - const offset = 0; + const offset = 0n; const buffer = new Uint8Array([0, 1, 2, 3, 4, 5]); await stableMemoryCanister.stableWrite(offset, buffer); const result = await stableMemoryCanister.stableRead( offset, - buffer.length + BigInt(buffer.length) ); expect(buffer).toStrictEqual(result); }); it('stable read/write', async () => { - const offset = 5; + const offset = 5n; const buffer = new Uint8Array([0, 1, 2, 3, 4, 5]); await stableMemoryCanister.stableWrite(offset, buffer); const result = await stableMemoryCanister.stableRead( - offset, - buffer.length - ); - - expect(buffer).toStrictEqual(result); - }); - - it('stable write out of bounds error', async () => { - const offset = PAGE_SIZE * MAX_STABLE_MEM_PAGES - 1; - const buffer = [0, 1, 2, 3, 4, 5, 6]; - - const rejectionMessage = /.*stable memory out of bounds.*/; - const expectedErrorMessage = new RegExp( - `Call was rejected:\\s*Request ID: [a-f0-9]{64}\\s*Reject code: 5\\s*Reject text: ${rejectionMessage.source}` - ); - - await expect( - stableMemoryCanister.stableWrite(offset, buffer) - ).rejects.toThrow(expectedErrorMessage); - }); - - it('stable64 read/write no offset', async () => { - const offset = 0n; - const buffer = new Uint8Array([0, 1, 2, 3, 4, 5]); - - await stableMemoryCanister.stable64Write(offset, buffer); - - const result = await stableMemoryCanister.stable64Read( offset, BigInt(buffer.length) ); @@ -109,21 +64,7 @@ export function getTests(stableMemoryCanister: ActorSubclass<_SERVICE>): Test { expect(buffer).toStrictEqual(result); }); - it('stable64 read/write', async () => { - const offset = 5n; - const buffer = new Uint8Array([0, 1, 2, 3, 4, 5]); - - await stableMemoryCanister.stable64Write(offset, buffer); - - const result = await stableMemoryCanister.stable64Read( - offset, - BigInt(buffer.length) - ); - - expect(buffer).toStrictEqual(result); - }); - - it('stable64 write out of bounds error', async () => { + it('stable write out of bounds error', async () => { const offset = BigInt(PAGE_SIZE) * MAX_STABLE64_MEM_PAGES - 1n; const buffer = new Uint8Array([0, 1, 2, 3, 4, 5, 6]); @@ -133,46 +74,24 @@ export function getTests(stableMemoryCanister: ActorSubclass<_SERVICE>): Test { ); await expect( - stableMemoryCanister.stable64Write(offset, buffer) + stableMemoryCanister.stableWrite(offset, buffer) ).rejects.toThrow(expectedErrorMessage); }); - it('stable grow to max', async () => { - const oldSize = await stableMemoryCanister.stableSize(); - const newPages = MAX_STABLE_MEM_PAGES - oldSize; - const result = await stableMemoryCanister.stableGrow(newPages); - const newSize = await stableMemoryCanister.stableSize(); - - expect(result).toBe(oldSize); - expect(newPages + oldSize).toBe(newSize); - }); - - it('stable grow out of memory', async () => { - // TODO change error messages back to nice ones once we figure that out - // const rejectionMessage = /Uncaught InternalError: Out of memory/ - const rejectionMessage = /.*OutOfMemory.*/; - const expectedErrorMessage = new RegExp( - `Call was rejected:\\s*Request ID: [a-f0-9]{64}\\s*Reject code: 5\\s*Reject text: ${rejectionMessage.source}` - ); - await expect(stableMemoryCanister.stableGrow(1)).rejects.toThrow( - expectedErrorMessage - ); - }); - - it.skip('stable64 grow to max', async () => { + it.skip('stable grow to max', async () => { // TODO this test used to run without panicking // TODO My guess is that the sizes are just too large to deal with on a local machine now // TODO so for the moment we just check to make sure that get an error from calling the API - const oldSize = await stableMemoryCanister.stable64Size(); + const oldSize = await stableMemoryCanister.stableSize(); const newPages = MAX_STABLE64_MEM_PAGES - oldSize; - const result = await stableMemoryCanister.stable64Grow(newPages); - const newSize = await stableMemoryCanister.stable64Size(); + const result = await stableMemoryCanister.stableGrow(newPages); + const newSize = await stableMemoryCanister.stableSize(); expect(result).toBe(oldSize); expect(newPages + oldSize).toBe(newSize); }); - it.skip('stable64 grow out of memory', async () => { + it.skip('stable grow out of memory', async () => { // TODO we are also turning this test off because it seems like we can't grow to the max memory anymore // TODO I am guessing this is because of the size of stable memory @@ -182,7 +101,7 @@ export function getTests(stableMemoryCanister: ActorSubclass<_SERVICE>): Test { const expectedErrorMessage = new RegExp( `Call was rejected:\\s*Request ID: [a-f0-9]{64}\\s*Reject code: 5\\s*Reject text: ${rejectionMessage.source}` ); - await expect(stableMemoryCanister.stable64Grow(1n)).rejects.toThrow( + await expect(stableMemoryCanister.stableGrow(1n)).rejects.toThrow( expectedErrorMessage ); }); diff --git a/property_tests/arbitraries/canister_arb.ts b/property_tests/arbitraries/canister_arb.ts index 57ea2f42dc..82f0c9cf92 100644 --- a/property_tests/arbitraries/canister_arb.ts +++ b/property_tests/arbitraries/canister_arb.ts @@ -71,7 +71,7 @@ export function CanisterArb< const initArgs = config.initMethod?.params.map((param) => { const value = param.value.value; return value.runtimeCandidTypeObject - .getIdl([]) + .getIdlType([]) .accept(new CliStringVisitor(), { value: value.agentArgumentValue }); @@ -81,7 +81,7 @@ export function CanisterArb< (param) => { const value = param.value.value; return value.runtimeCandidTypeObject - .getIdl([]) + .getIdlType([]) .accept(new CliStringVisitor(), { value: value.agentArgumentValue }); diff --git a/src/compiler/compile_typescript_code.ts b/src/compiler/compile_typescript_code.ts index 134a8f47ec..5d24a5b0f5 100644 --- a/src/compiler/compile_typescript_code.ts +++ b/src/compiler/compile_typescript_code.ts @@ -52,10 +52,10 @@ export async function compileTypeScriptToJavaScript( const canisterMethods = CanisterMethods.default !== undefined ? CanisterMethods.default() : Server(() => globalThis._azleNodeServer)(); globalThis.candidInfoFunction = () => { - const candidInfo = canisterMethods.getIdl([]).accept(new DidVisitor(), { + const candidInfo = canisterMethods.getIdlType([]).accept(new DidVisitor(), { ...getDefaultVisitorData(), isFirstService: true, - systemFuncs: canisterMethods.getSystemFunctionIdls() + systemFuncs: canisterMethods.getSystemFunctionIdlTypes() }); return JSON.stringify({ diff --git a/src/compiler/generate_candid_and_canister_methods.ts b/src/compiler/generate_candid_and_canister_methods.ts index 2e60f6a248..941f8c9991 100644 --- a/src/compiler/generate_candid_and_canister_methods.ts +++ b/src/compiler/generate_candid_and_canister_methods.ts @@ -70,7 +70,7 @@ export async function generateCandidAndCanisterMethods( stable64_read: (): void => {}, stable64_size: (): void => {}, stable64_write: (): void => {}, - time: () => 0n, + time: (): bigint => 0n, trap: (): void => {} } // env: { diff --git a/src/compiler/rust/canister/src/ic/call_raw.rs b/src/compiler/rust/canister/src/ic/call_raw.rs index 0201dc4817..3ecd8f7df5 100644 --- a/src/compiler/rust/canister/src/ic/call_raw.rs +++ b/src/compiler/rust/canister/src/ic/call_raw.rs @@ -1,5 +1,3 @@ -// TODO basically copied into call_raw128 - use wasmedge_quickjs::{AsObject, Context, JsFn, JsValue}; use crate::{run_event_loop, RUNTIME}; @@ -38,11 +36,11 @@ impl JsFn for NativeFunction { } else { panic!("conversion from JsValue to JsString failed") }; - let payment: u64 = payment_string.parse().unwrap(); + let payment: u128 = payment_string.parse().unwrap(); ic_cdk::spawn(async move { let call_result = - ic_cdk::api::call::call_raw(canister_id, &method, &args_raw, payment).await; + ic_cdk::api::call::call_raw128(canister_id, &method, &args_raw, payment).await; RUNTIME.with(|runtime| { let mut runtime = runtime.borrow_mut(); diff --git a/src/compiler/rust/canister/src/ic/call_raw128.rs b/src/compiler/rust/canister/src/ic/call_raw128.rs deleted file mode 100644 index bd36a7709d..0000000000 --- a/src/compiler/rust/canister/src/ic/call_raw128.rs +++ /dev/null @@ -1,125 +0,0 @@ -// TODO basically copied from call_raw - -use wasmedge_quickjs::{AsObject, Context, JsFn, JsValue}; - -use crate::{run_event_loop, RUNTIME}; - -pub struct NativeFunction; -impl JsFn for NativeFunction { - fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { - let promise_id = if let JsValue::String(js_string) = argv.get(0).unwrap() { - js_string.to_string() - } else { - panic!("conversion from JsValue to JsString failed") - }; - - let canister_id_bytes = if let JsValue::ArrayBuffer(js_array_buffer) = argv.get(1).unwrap() - { - js_array_buffer.to_vec() - } else { - panic!("conversion from JsValue to JsArrayBuffer failed") - }; - let canister_id = candid::Principal::from_slice(&canister_id_bytes); - - let method = if let JsValue::String(js_string) = argv.get(2).unwrap() { - js_string.to_string() - } else { - panic!("conversion from JsValue to JsString failed") - }; - - let args_raw = if let JsValue::ArrayBuffer(js_array_buffer) = argv.get(3).unwrap() { - js_array_buffer.to_vec() - } else { - panic!("conversion from JsValue to JsArrayBuffer failed") - }; - - let payment_string = if let JsValue::String(js_string) = argv.get(4).unwrap() { - js_string.to_string() - } else { - panic!("conversion from JsValue to JsString failed") - }; - let payment: u128 = payment_string.parse().unwrap(); - - ic_cdk::spawn(async move { - let call_result = - ic_cdk::api::call::call_raw128(canister_id, &method, &args_raw, payment).await; - - RUNTIME.with(|runtime| { - let mut runtime = runtime.borrow_mut(); - let runtime = runtime.as_mut().unwrap(); - - runtime.run_with_context(|context| { - let global = context.get_global(); - - let (should_resolve, js_value) = match &call_result { - Ok(candid_bytes) => { - let candid_bytes_js_value: JsValue = - context.new_array_buffer(candid_bytes).into(); - - (true, candid_bytes_js_value) - } - Err(err) => { - let err_js_value: JsValue = context - .new_error(&format!( - "Rejection code {rejection_code}, {error_message}", - rejection_code = (err.0 as i32).to_string(), - error_message = err.1 - )) - .into(); - - (false, err_js_value) - } - }; - - if should_resolve { - let resolve = global - .get("_azleResolveIds") - .to_obj() - .unwrap() - .get(format!("_resolve_{promise_id}").as_str()) - .to_function() - .unwrap(); - - let result = resolve.call(&[js_value.clone()]); - - // TODO error handling is mostly done in JS right now - // TODO we would really like wasmedge-quickjs to add - // TODO good error info to JsException and move error handling - // TODO out of our own code - match &result { - wasmedge_quickjs::JsValue::Exception(js_exception) => { - js_exception.dump_error(); - panic!("TODO needs error info"); - } - _ => run_event_loop(context), - }; - } else { - let reject = global - .get("_azleRejectIds") - .to_obj() - .unwrap() - .get(format!("_reject_{promise_id}").as_str()) - .to_function() - .unwrap(); - - let result = reject.call(&[js_value.clone()]); - - // TODO error handling is mostly done in JS right now - // TODO we would really like wasmedge-quickjs to add - // TODO good error info to JsException and move error handling - // TODO out of our own code - match &result { - wasmedge_quickjs::JsValue::Exception(js_exception) => { - js_exception.dump_error(); - panic!("TODO needs error info"); - } - _ => run_event_loop(context), - }; - } - }); - }); - }); - - JsValue::UnDefined - } -} diff --git a/src/compiler/rust/canister/src/ic/canister_balance.rs b/src/compiler/rust/canister/src/ic/canister_balance.rs index f775f0d608..f9a446b038 100644 --- a/src/compiler/rust/canister/src/ic/canister_balance.rs +++ b/src/compiler/rust/canister/src/ic/canister_balance.rs @@ -1,10 +1,12 @@ +// TODO it would be great to use an actual u128 conversion available from the bindings instead of using a string + use wasmedge_quickjs::{Context, JsFn, JsValue}; pub struct NativeFunction; impl JsFn for NativeFunction { fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { context - .new_string(&ic_cdk::api::canister_balance().to_string()) + .new_string(&ic_cdk::api::canister_balance128().to_string()) .into() } } diff --git a/src/compiler/rust/canister/src/ic/canister_balance128.rs b/src/compiler/rust/canister/src/ic/canister_balance128.rs deleted file mode 100644 index f9a446b038..0000000000 --- a/src/compiler/rust/canister/src/ic/canister_balance128.rs +++ /dev/null @@ -1,12 +0,0 @@ -// TODO it would be great to use an actual u128 conversion available from the bindings instead of using a string - -use wasmedge_quickjs::{Context, JsFn, JsValue}; - -pub struct NativeFunction; -impl JsFn for NativeFunction { - fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { - context - .new_string(&ic_cdk::api::canister_balance128().to_string()) - .into() - } -} diff --git a/src/compiler/rust/canister/src/ic/mod.rs b/src/compiler/rust/canister/src/ic/mod.rs index 154f58495d..589f237feb 100644 --- a/src/compiler/rust/canister/src/ic/mod.rs +++ b/src/compiler/rust/canister/src/ic/mod.rs @@ -2,13 +2,11 @@ mod accept_message; mod arg_data_raw; mod arg_data_raw_size; mod call_raw; -mod call_raw128; mod caller; mod candid_compiler; mod candid_decode; mod candid_encode; mod canister_balance; -mod canister_balance128; mod canister_version; mod clear_timer; mod data_certificate; @@ -17,11 +15,8 @@ mod instruction_counter; mod is_controller; mod method_name; mod msg_cycles_accept; -mod msg_cycles_accept128; mod msg_cycles_available; -mod msg_cycles_available128; mod msg_cycles_refunded; -mod msg_cycles_refunded128; mod notify_raw; mod performance_counter; mod print; @@ -32,10 +27,6 @@ mod reply_raw; mod set_certified_data; mod set_timer; mod set_timer_interval; -mod stable64_grow; -mod stable64_read; -mod stable64_size; -mod stable64_write; mod stable_b_tree_map_contains_key; mod stable_b_tree_map_get; mod stable_b_tree_map_init; @@ -86,13 +77,6 @@ pub fn register(context: &mut wasmedge_quickjs::Context) { context.new_function::("").into(), ); - ic.set( - "callRaw128", - context - .new_function::("") - .into(), - ); - ic.set( "caller", context.new_function::("").into(), @@ -126,13 +110,6 @@ pub fn register(context: &mut wasmedge_quickjs::Context) { .into(), ); - ic.set( - "canisterBalance128", - context - .new_function::("") - .into(), - ); - ic.set( "canisterVersion", context @@ -184,13 +161,6 @@ pub fn register(context: &mut wasmedge_quickjs::Context) { .into(), ); - ic.set( - "msgCyclesAccept128", - context - .new_function::("") - .into(), - ); - ic.set( "msgCyclesAvailable", context @@ -198,13 +168,6 @@ pub fn register(context: &mut wasmedge_quickjs::Context) { .into(), ); - ic.set( - "msgCyclesAvailable128", - context - .new_function::("") - .into(), - ); - ic.set( "msgCyclesRefunded", context @@ -212,13 +175,6 @@ pub fn register(context: &mut wasmedge_quickjs::Context) { .into(), ); - ic.set( - "msgCyclesRefunded128", - context - .new_function::("") - .into(), - ); - ic.set( "notifyRaw", context @@ -281,41 +237,6 @@ pub fn register(context: &mut wasmedge_quickjs::Context) { .into(), ); - ic.set( - "stable64Grow", - context - .new_function::("") - .into(), - ); - - ic.set( - "stable64Read", - context - .new_function::("") - .into(), - ); - - ic.set( - "stable64Size", - context - .new_function::("") - .into(), - ); - - ic.set( - "stable64Write", - context - .new_function::("") - .into(), - ); - - ic.set( - "stableBytes", - context - .new_function::("") - .into(), - ); - ic.set( "stableGrow", context @@ -344,6 +265,13 @@ pub fn register(context: &mut wasmedge_quickjs::Context) { .into(), ); + ic.set( + "stableBytes", + context + .new_function::("") + .into(), + ); + ic.set( "stableBTreeMapContainsKey", context diff --git a/src/compiler/rust/canister/src/ic/msg_cycles_accept.rs b/src/compiler/rust/canister/src/ic/msg_cycles_accept.rs index 25d9f9a19d..b24a220cbd 100644 --- a/src/compiler/rust/canister/src/ic/msg_cycles_accept.rs +++ b/src/compiler/rust/canister/src/ic/msg_cycles_accept.rs @@ -8,10 +8,10 @@ impl JsFn for NativeFunction { } else { panic!("conversion from JsValue to JsString failed") }; - let max_amount: u64 = max_amount_string.parse().unwrap(); + let max_amount: u128 = max_amount_string.parse().unwrap(); context - .new_string(&ic_cdk::api::call::msg_cycles_accept(max_amount).to_string()) + .new_string(&ic_cdk::api::call::msg_cycles_accept128(max_amount).to_string()) .into() } } diff --git a/src/compiler/rust/canister/src/ic/msg_cycles_accept128.rs b/src/compiler/rust/canister/src/ic/msg_cycles_accept128.rs deleted file mode 100644 index b24a220cbd..0000000000 --- a/src/compiler/rust/canister/src/ic/msg_cycles_accept128.rs +++ /dev/null @@ -1,17 +0,0 @@ -use wasmedge_quickjs::{Context, JsFn, JsValue}; - -pub struct NativeFunction; -impl JsFn for NativeFunction { - fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { - let max_amount_string = if let JsValue::String(js_string) = argv.get(0).unwrap() { - js_string.to_string() - } else { - panic!("conversion from JsValue to JsString failed") - }; - let max_amount: u128 = max_amount_string.parse().unwrap(); - - context - .new_string(&ic_cdk::api::call::msg_cycles_accept128(max_amount).to_string()) - .into() - } -} diff --git a/src/compiler/rust/canister/src/ic/msg_cycles_available.rs b/src/compiler/rust/canister/src/ic/msg_cycles_available.rs index ef318fc69e..0199135278 100644 --- a/src/compiler/rust/canister/src/ic/msg_cycles_available.rs +++ b/src/compiler/rust/canister/src/ic/msg_cycles_available.rs @@ -4,7 +4,7 @@ pub struct NativeFunction; impl JsFn for NativeFunction { fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { context - .new_string(&ic_cdk::api::call::msg_cycles_available().to_string()) + .new_string(&ic_cdk::api::call::msg_cycles_available128().to_string()) .into() } } diff --git a/src/compiler/rust/canister/src/ic/msg_cycles_available128.rs b/src/compiler/rust/canister/src/ic/msg_cycles_available128.rs deleted file mode 100644 index 0199135278..0000000000 --- a/src/compiler/rust/canister/src/ic/msg_cycles_available128.rs +++ /dev/null @@ -1,10 +0,0 @@ -use wasmedge_quickjs::{Context, JsFn, JsValue}; - -pub struct NativeFunction; -impl JsFn for NativeFunction { - fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { - context - .new_string(&ic_cdk::api::call::msg_cycles_available128().to_string()) - .into() - } -} diff --git a/src/compiler/rust/canister/src/ic/msg_cycles_refunded.rs b/src/compiler/rust/canister/src/ic/msg_cycles_refunded.rs index e1a972c015..1149d87206 100644 --- a/src/compiler/rust/canister/src/ic/msg_cycles_refunded.rs +++ b/src/compiler/rust/canister/src/ic/msg_cycles_refunded.rs @@ -4,7 +4,7 @@ pub struct NativeFunction; impl JsFn for NativeFunction { fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { context - .new_string(&ic_cdk::api::call::msg_cycles_refunded().to_string()) + .new_string(&ic_cdk::api::call::msg_cycles_refunded128().to_string()) .into() } } diff --git a/src/compiler/rust/canister/src/ic/msg_cycles_refunded128.rs b/src/compiler/rust/canister/src/ic/msg_cycles_refunded128.rs deleted file mode 100644 index 1149d87206..0000000000 --- a/src/compiler/rust/canister/src/ic/msg_cycles_refunded128.rs +++ /dev/null @@ -1,10 +0,0 @@ -use wasmedge_quickjs::{Context, JsFn, JsValue}; - -pub struct NativeFunction; -impl JsFn for NativeFunction { - fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { - context - .new_string(&ic_cdk::api::call::msg_cycles_refunded128().to_string()) - .into() - } -} diff --git a/src/compiler/rust/canister/src/ic/stable64_grow.rs b/src/compiler/rust/canister/src/ic/stable64_grow.rs deleted file mode 100644 index 8e648eee3d..0000000000 --- a/src/compiler/rust/canister/src/ic/stable64_grow.rs +++ /dev/null @@ -1,20 +0,0 @@ -use wasmedge_quickjs::{Context, JsFn, JsValue}; - -pub struct NativeFunction; -impl JsFn for NativeFunction { - fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { - let new_pages_string = if let JsValue::String(js_string) = argv.get(0).unwrap() { - js_string.to_string() - } else { - panic!("conversion from JsValue to JsString failed") - }; - - context - .new_string( - &ic_cdk::api::stable::stable64_grow(new_pages_string.parse().unwrap()) - .unwrap() - .to_string(), - ) - .into() - } -} diff --git a/src/compiler/rust/canister/src/ic/stable64_read.rs b/src/compiler/rust/canister/src/ic/stable64_read.rs deleted file mode 100644 index f187d5e086..0000000000 --- a/src/compiler/rust/canister/src/ic/stable64_read.rs +++ /dev/null @@ -1,24 +0,0 @@ -use wasmedge_quickjs::{Context, JsFn, JsValue}; - -pub struct NativeFunction; -impl JsFn for NativeFunction { - fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { - let offset_string = if let JsValue::String(js_string) = argv.get(0).unwrap() { - js_string.to_string() - } else { - panic!("conversion from JsValue to JsString failed") - }; - - let length_string = if let JsValue::String(js_string) = argv.get(1).unwrap() { - js_string.to_string() - } else { - panic!("conversion from JsValue to JsString failed") - }; - - let mut buf: Vec = vec![0; length_string.parse().unwrap()]; - - ic_cdk::api::stable::stable64_read(offset_string.parse().unwrap(), &mut buf); - - context.new_array_buffer(&buf).into() - } -} diff --git a/src/compiler/rust/canister/src/ic/stable64_size.rs b/src/compiler/rust/canister/src/ic/stable64_size.rs deleted file mode 100644 index 4b131d021b..0000000000 --- a/src/compiler/rust/canister/src/ic/stable64_size.rs +++ /dev/null @@ -1,10 +0,0 @@ -use wasmedge_quickjs::{Context, JsFn, JsValue}; - -pub struct NativeFunction; -impl JsFn for NativeFunction { - fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { - context - .new_string(&ic_cdk::api::stable::stable64_size().to_string()) - .into() - } -} diff --git a/src/compiler/rust/canister/src/ic/stable64_write.rs b/src/compiler/rust/canister/src/ic/stable64_write.rs deleted file mode 100644 index ac4318c223..0000000000 --- a/src/compiler/rust/canister/src/ic/stable64_write.rs +++ /dev/null @@ -1,22 +0,0 @@ -use wasmedge_quickjs::{Context, JsFn, JsValue}; - -pub struct NativeFunction; -impl JsFn for NativeFunction { - fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { - let offset_string = if let JsValue::String(js_string) = argv.get(0).unwrap() { - js_string.to_string() - } else { - panic!("conversion from JsValue to JsString failed") - }; - - let buf = if let JsValue::ArrayBuffer(js_array_buffer) = argv.get(1).unwrap() { - js_array_buffer.to_vec() - } else { - panic!("conversion from JsValue to JsArrayBuffer failed") - }; - - ic_cdk::api::stable::stable64_write(offset_string.parse().unwrap(), &buf); - - JsValue::UnDefined - } -} diff --git a/src/compiler/rust/canister/src/ic/stable_grow.rs b/src/compiler/rust/canister/src/ic/stable_grow.rs index cfe9763c6d..8e648eee3d 100644 --- a/src/compiler/rust/canister/src/ic/stable_grow.rs +++ b/src/compiler/rust/canister/src/ic/stable_grow.rs @@ -11,7 +11,7 @@ impl JsFn for NativeFunction { context .new_string( - &ic_cdk::api::stable::stable_grow(new_pages_string.parse().unwrap()) + &ic_cdk::api::stable::stable64_grow(new_pages_string.parse().unwrap()) .unwrap() .to_string(), ) diff --git a/src/compiler/rust/canister/src/ic/stable_read.rs b/src/compiler/rust/canister/src/ic/stable_read.rs index 5ea310b953..f187d5e086 100644 --- a/src/compiler/rust/canister/src/ic/stable_read.rs +++ b/src/compiler/rust/canister/src/ic/stable_read.rs @@ -4,20 +4,20 @@ pub struct NativeFunction; impl JsFn for NativeFunction { fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { let offset_string = if let JsValue::String(js_string) = argv.get(0).unwrap() { - js_string.to_string() // TODO it would be great to have a direct conversion to u64 but seems the bindings don't support it + js_string.to_string() } else { panic!("conversion from JsValue to JsString failed") }; let length_string = if let JsValue::String(js_string) = argv.get(1).unwrap() { - js_string.to_string() // TODO it would be great to have a direct conversion to u64 but seems the bindings don't support it + js_string.to_string() } else { panic!("conversion from JsValue to JsString failed") }; let mut buf: Vec = vec![0; length_string.parse().unwrap()]; - ic_cdk::api::stable::stable_read(offset_string.parse().unwrap(), &mut buf); + ic_cdk::api::stable::stable64_read(offset_string.parse().unwrap(), &mut buf); context.new_array_buffer(&buf).into() } diff --git a/src/compiler/rust/canister/src/ic/stable_size.rs b/src/compiler/rust/canister/src/ic/stable_size.rs index c1fe54bfe5..4b131d021b 100644 --- a/src/compiler/rust/canister/src/ic/stable_size.rs +++ b/src/compiler/rust/canister/src/ic/stable_size.rs @@ -4,7 +4,7 @@ pub struct NativeFunction; impl JsFn for NativeFunction { fn call(context: &mut Context, this_val: JsValue, argv: &[JsValue]) -> JsValue { context - .new_string(&ic_cdk::api::stable::stable_size().to_string()) + .new_string(&ic_cdk::api::stable::stable64_size().to_string()) .into() } } diff --git a/src/compiler/rust/canister/src/ic/stable_write.rs b/src/compiler/rust/canister/src/ic/stable_write.rs index 17763271ce..f9d67b3e06 100644 --- a/src/compiler/rust/canister/src/ic/stable_write.rs +++ b/src/compiler/rust/canister/src/ic/stable_write.rs @@ -15,7 +15,7 @@ impl JsFn for NativeFunction { panic!("conversion from JsValue to JsArrayBuffer failed") }; - ic_cdk::api::stable::stable_write(offset_string.parse().unwrap(), &buf); + ic_cdk::api::stable::stable64_write(offset_string.parse().unwrap(), &buf); JsValue::UnDefined } diff --git a/src/lib/candid/candid_type.ts b/src/lib/candid/candid_type.ts index 9c228d51c3..2184b2bd31 100644 --- a/src/lib/candid/candid_type.ts +++ b/src/lib/candid/candid_type.ts @@ -1,7 +1,7 @@ import { IDL } from '@dfinity/candid'; -import { Parent } from './to_idl'; +import { Parent } from './to_idl_type'; export interface CandidType { - getIdl(parents: Parent[]): IDL.Type; + getIdlType(parents: Parent[]): IDL.Type; } diff --git a/src/lib/candid/index.ts b/src/lib/candid/index.ts index 4b9215d1d5..c82181af81 100644 --- a/src/lib/candid/index.ts +++ b/src/lib/candid/index.ts @@ -1,7 +1,7 @@ export * from './candid_type'; export * from './manual'; export * from './recursive'; -export * from './to_idl'; +export * from './to_idl_type'; export * from './type_mapping'; export * from './types/constructed'; export * from './types/primitive'; diff --git a/src/lib/candid/recursive.ts b/src/lib/candid/recursive.ts index ad9ce12885..ae123ec116 100644 --- a/src/lib/candid/recursive.ts +++ b/src/lib/candid/recursive.ts @@ -7,7 +7,7 @@ export type _AzleRecursiveFunction = { (...args: any[]): CandidType; azleName?: string; isRecursive?: boolean; - getIdl?: (parents: Parent[]) => IDL.Type; + getIdlType?: (parents: Parent[]) => IDL.Type; }; export function Recursive(candidTypeCallback: any): any { @@ -25,14 +25,14 @@ export function Recursive(candidTypeCallback: any): any { result.isRecursive = true; // TODO make this function's return type explicit https://github.com/demergent-labs/azle/issues/1860 // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - result.getIdl = (parents: Parent[]) => { - const idl = IDL.Rec(); + result.getIdlType = (parents: Parent[]) => { + const idlType = IDL.Rec(); let filler = candidTypeCallback(); if (filler.isCanister) { filler = filler(result); } - idl.fill(filler.getIdl([...parents, { idl: idl, name }])); - return idl; + idlType.fill(filler.getIdlType([...parents, { idlType, name }])); + return idlType; }; return result; diff --git a/src/lib/candid/serde/decode.ts b/src/lib/candid/serde/decode.ts index df7dbba976..e4cd9d8f69 100644 --- a/src/lib/candid/serde/decode.ts +++ b/src/lib/candid/serde/decode.ts @@ -1,6 +1,6 @@ import { IDL } from '@dfinity/candid'; -import { CandidType, toIdl, toIdlArray } from '../../candid'; +import { CandidType, toIdlType, toIdlTypeArray } from '../../candid'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import { AzleOpt, AzleTuple, AzleVec } from '../types/constructed'; // Used for links in comments import { DecodeVisitor } from './visitors/decode_visitor'; @@ -32,27 +32,28 @@ function decodeSingle(candidType: CandidType, data: ArrayBuffer): any { // needs to be aligned so that this isn't an error. Both are representing // candid IDLs, either from the @dfinity/candid library or the // Azle-augmented ones - const idl = toIdl(candidType); + const idlType = toIdlType(candidType); - const idlIsAzleVoid = Array.isArray(idl); + // The candid type was AzleVoid if when converted to an Idl Type it is [] + const candidTypeWasAzleVoid = Array.isArray(idlType); - if (idlIsAzleVoid) { + if (candidTypeWasAzleVoid) { return undefined; } - const candidDecodedValue = IDL.decode([idl], data)[0] as any; + const candidDecodedValue = IDL.decode([idlType], data)[0] as any; - return idl.accept(new DecodeVisitor(), { + return idlType.accept(new DecodeVisitor(), { candidType: candidType, js_data: candidDecodedValue }); } function decodeMultiple(candidTypes: CandidType[], data: ArrayBuffer): any[] { - const idls = toIdlArray(candidTypes); - const decoded = IDL.decode(idls, data); - return idls.map((idl, index) => - idl.accept(new DecodeVisitor(), { + const idlTypes = toIdlTypeArray(candidTypes); + const decoded = IDL.decode(idlTypes, data); + return idlTypes.map((idlType, index) => + idlType.accept(new DecodeVisitor(), { candidType: candidTypes[index], js_data: decoded[index] }) diff --git a/src/lib/candid/serde/encode.ts b/src/lib/candid/serde/encode.ts index fdbdb12afe..f9cdf9b814 100644 --- a/src/lib/candid/serde/encode.ts +++ b/src/lib/candid/serde/encode.ts @@ -1,6 +1,6 @@ import { IDL } from '@dfinity/candid'; -import { CandidType, toIdl, toIdlArray } from '../../candid'; +import { CandidType, toIdlType, toIdlTypeArray } from '../../candid'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import { AzleOpt, AzleTuple, AzleVec } from '../types/constructed'; // Used for links in comments import { EncodeVisitor } from './visitors/encode_visitor'; @@ -33,30 +33,31 @@ export function encode( } function encodeSingle(candidType: CandidType, data: any): Uint8Array { - const idl = toIdl(candidType); + const idlType = toIdlType(candidType); - const idlIsAzleVoid = Array.isArray(idl); + // The candid type was AzleVoid if when converted to an Idl Type it is [] + const candidTypeWasAzleVoid = Array.isArray(idlType); - if (idlIsAzleVoid) { + if (candidTypeWasAzleVoid) { return new Uint8Array(IDL.encode([], [])); } - const encodeReadyKey = idl.accept(new EncodeVisitor(), { + const encodeReadyKey = idlType.accept(new EncodeVisitor(), { candidType: candidType, js_data: data }); - return new Uint8Array(IDL.encode([idl], [encodeReadyKey])); + return new Uint8Array(IDL.encode([idlType], [encodeReadyKey])); } function encodeMultiple(candidTypes: CandidType[], data: any[]): Uint8Array { - const idls = toIdlArray(candidTypes); + const idlTypes = toIdlTypeArray(candidTypes); const values = data.map((datum, index) => - idls[index].accept(new EncodeVisitor(), { + idlTypes[index].accept(new EncodeVisitor(), { candidType: candidTypes[index], js_data: datum }) ); - return new Uint8Array(IDL.encode(idls, values)); + return new Uint8Array(IDL.encode(idlTypes, values)); } diff --git a/src/lib/candid/serde/visitors/visit/record.ts b/src/lib/candid/serde/visitors/visit/record.ts index cd2a8c3bf5..be1148d8b6 100644 --- a/src/lib/candid/serde/visitors/visit/record.ts +++ b/src/lib/candid/serde/visitors/visit/record.ts @@ -9,13 +9,13 @@ export function visitRecord( fields: [string, IDL.Type][], data: VisitorData ): VisitorResult { - const candidFields = fields.reduce((acc, [memberName, memberIdl]) => { + const candidFields = fields.reduce((acc, [memberName, memberIdlTypes]) => { const fieldData = data.js_data[memberName]; const fieldClass = data.candidType[memberName]; return { ...acc, - [memberName]: memberIdl.accept(visitor, { + [memberName]: memberIdlTypes.accept(visitor, { js_data: fieldData, candidType: fieldClass }) diff --git a/src/lib/candid/serde/visitors/visit/variant/azle_variant.ts b/src/lib/candid/serde/visitors/visit/variant/azle_variant.ts index 4c20271eb7..0dd0f4feaf 100644 --- a/src/lib/candid/serde/visitors/visit/variant/azle_variant.ts +++ b/src/lib/candid/serde/visitors/visit/variant/azle_variant.ts @@ -10,7 +10,7 @@ export function visitAzleVariant( fields: [string, IDL.Type][], data: VisitorData ): Variant { - const candidFields = fields.reduce((acc, [memberName, memberIdl]) => { + const candidFields = fields.reduce((acc, [memberName, memberIdlTypes]) => { const fieldData = data.js_data[memberName]; const fieldClass = data.candidType[memberName]; if (fieldData === undefined) { @@ -19,7 +19,7 @@ export function visitAzleVariant( } return { ...acc, - [memberName]: memberIdl.accept(visitor, { + [memberName]: memberIdlTypes.accept(visitor, { candidType: fieldClass, js_data: fieldData }) diff --git a/src/lib/candid/to_idl.ts b/src/lib/candid/to_idl_type.ts similarity index 62% rename from src/lib/candid/to_idl.ts rename to src/lib/candid/to_idl_type.ts index cb510dfe1a..dc07441db7 100644 --- a/src/lib/candid/to_idl.ts +++ b/src/lib/candid/to_idl_type.ts @@ -3,11 +3,11 @@ import { IDL } from '@dfinity/candid'; import { CandidType } from './candid_type'; export type Parent = { - idl: IDL.RecClass; + idlType: IDL.RecClass; name: string; }; -export function toIdl( +export function toIdlType( candidType: CandidType, parents: Parent[] = [] ): IDL.Type { @@ -16,27 +16,27 @@ export function toIdl( (parent) => parent.name === candidType.azleName ); // If the parent isn't undefined (ie we found one with the same name) - // this is a recursive type and we should return the parent rec idl - // instead of calling getIdl + // this is a recursive type and we should return the parent rec idl type + // instead of calling getIdlType if (parent !== undefined) { - return parent.idl; + return parent.idlType; } } if ('isCanister' in candidType && candidType.isCanister) { - return toIdl((candidType as any)(), parents); + return toIdlType((candidType as any)(), parents); } - // All CandidTypes ought to have a getIdl function defined for them - return (candidType as any).getIdl(parents); + // All CandidTypes ought to have a getIdlType function defined for them + return (candidType as any).getIdlType(parents); } -export function toIdlArray( +export function toIdlTypeArray( candidTypes: CandidType | CandidType[], parents: Parent[] = [] ): IDL.Type[] { if (Array.isArray(candidTypes)) { - return candidTypes.map((value) => toIdl(value, parents)); + return candidTypes.map((value) => toIdlType(value, parents)); } - const idlType = toIdl(candidTypes, parents); + const idlType = toIdlType(candidTypes, parents); return Array.isArray(idlType) ? idlType : [idlType]; } diff --git a/src/lib/candid/types/constructed/blob.ts b/src/lib/candid/types/constructed/blob.ts index 8df7949404..f1985aa7e5 100644 --- a/src/lib/candid/types/constructed/blob.ts +++ b/src/lib/candid/types/constructed/blob.ts @@ -17,7 +17,7 @@ export class AzleBlob { return decode(this, bytes) as blob; } - static getIdl(): IDL.VecClass { + static getIdlType(): IDL.VecClass { return IDL.Vec(IDL.Nat8); } } diff --git a/src/lib/candid/types/constructed/opt.ts b/src/lib/candid/types/constructed/opt.ts index 1da7261071..50b07d27b3 100644 --- a/src/lib/candid/types/constructed/opt.ts +++ b/src/lib/candid/types/constructed/opt.ts @@ -3,7 +3,7 @@ import { IDL } from '@dfinity/candid'; import { CandidType } from '../../candid_type'; import { decode } from '../../serde/decode'; import { encode } from '../../serde/encode'; -import { Parent, toIdl } from '../../to_idl'; +import { Parent, toIdlType } from '../../to_idl_type'; import { TypeMapping } from '../../type_mapping'; import { RequireExactlyOne } from './variant'; @@ -52,7 +52,7 @@ export class AzleOpt { return decode(this, bytes); } - getIdl(parents: Parent[]): IDL.OptClass { - return IDL.Opt(toIdl(this.innerType, parents)); + getIdlType(parents: Parent[]): IDL.OptClass { + return IDL.Opt(toIdlType(this.innerType, parents)); } } diff --git a/src/lib/candid/types/constructed/record.ts b/src/lib/candid/types/constructed/record.ts index e9e1106c87..6ae7942970 100644 --- a/src/lib/candid/types/constructed/record.ts +++ b/src/lib/candid/types/constructed/record.ts @@ -3,9 +3,9 @@ import { IDL } from '@dfinity/candid'; import { CandidType } from '../../candid_type'; import { decode } from '../../serde/decode'; import { encode } from '../../serde/encode'; -import { Parent } from '../../to_idl'; +import { Parent } from '../../to_idl_type'; import { TypeMapping } from '../../type_mapping'; -import { CandidMap, toIdlMap } from './to_idl_map'; +import { CandidTypeMap, toIdlTypeMap } from './to_idl_map'; // TODO make this function's return type explicit https://github.com/demergent-labs/azle/issues/1860 // eslint-disable-next-line @typescript-eslint/explicit-function-return-type @@ -27,8 +27,8 @@ export function Record< fromBytes(bytes: Uint8Array) { return decode(this, bytes); }, - getIdl(parents: Parent[]): IDL.RecordClass { - return IDL.Record(toIdlMap(obj as CandidMap, parents)); + getIdlType(parents: Parent[]): IDL.RecordClass { + return IDL.Record(toIdlTypeMap(obj as CandidTypeMap, parents)); } }; } diff --git a/src/lib/candid/types/constructed/to_idl_map.ts b/src/lib/candid/types/constructed/to_idl_map.ts index 58c9353571..cdc7200f03 100644 --- a/src/lib/candid/types/constructed/to_idl_map.ts +++ b/src/lib/candid/types/constructed/to_idl_map.ts @@ -1,20 +1,23 @@ import { IDL } from '@dfinity/candid'; import { CandidType } from '../../candid_type'; -import { Parent, toIdl } from '../../to_idl'; +import { Parent, toIdlType } from '../../to_idl_type'; -export type CandidMap = { [key: string]: CandidType }; -export type IdlMap = { [key: string]: IDL.Type }; +export type CandidTypeMap = { [key: string]: CandidType }; +export type IdlTypeMap = { [key: string]: IDL.Type }; -export function toIdlMap(candidMap: CandidMap, parent: Parent[]): IdlMap { - const idlMap: IdlMap = {}; +export function toIdlTypeMap( + candidMap: CandidTypeMap, + parent: Parent[] +): IdlTypeMap { + const idlTypeMap: IdlTypeMap = {}; for (const key in candidMap) { if (Object.prototype.hasOwnProperty.call(candidMap, key)) { const candidType = candidMap[key]; - idlMap[key] = toIdl(candidType, parent); + idlTypeMap[key] = toIdlType(candidType, parent); } } - return idlMap; + return idlTypeMap; } diff --git a/src/lib/candid/types/constructed/tuple.ts b/src/lib/candid/types/constructed/tuple.ts index e3bdb4bf67..ff37cb3733 100644 --- a/src/lib/candid/types/constructed/tuple.ts +++ b/src/lib/candid/types/constructed/tuple.ts @@ -3,7 +3,7 @@ import { IDL } from '@dfinity/candid'; import { CandidType } from '../../candid_type'; import { decode } from '../../serde/decode'; import { encode } from '../../serde/encode'; -import { Parent, toIdl } from '../../to_idl'; +import { Parent, toIdlType } from '../../to_idl_type'; import { TypeMapping } from '../../type_mapping'; export class AzleTuple { @@ -30,11 +30,11 @@ export class AzleTuple { return decode(this, bytes); } - getIdl(parents: Parent[]): IDL.TupleClass { - const idls = this.innerTypes.map((value) => { - return toIdl(value, parents); + getIdlType(parents: Parent[]): IDL.TupleClass { + const idlTypes = this.innerTypes.map((value) => { + return toIdlType(value, parents); }); - return IDL.Tuple(...idls); + return IDL.Tuple(...idlTypes); } } diff --git a/src/lib/candid/types/constructed/variant.ts b/src/lib/candid/types/constructed/variant.ts index 1c76a36e54..a75381e9b6 100644 --- a/src/lib/candid/types/constructed/variant.ts +++ b/src/lib/candid/types/constructed/variant.ts @@ -4,7 +4,7 @@ import { CandidType } from '../../candid_type'; import { decode } from '../../serde/decode'; import { encode } from '../../serde/encode'; import { TypeMapping } from '../../type_mapping'; -import { CandidMap, toIdlMap } from './to_idl_map'; +import { CandidTypeMap, toIdlTypeMap } from './to_idl_map'; export type Variant< T extends { @@ -32,8 +32,8 @@ export function Variant< fromBytes(bytes: Uint8Array) { return decode(this, bytes); }, - getIdl(parents: any): IDL.VariantClass { - return IDL.Variant(toIdlMap(obj as CandidMap, parents)); + getIdlType(parents: any): IDL.VariantClass { + return IDL.Variant(toIdlTypeMap(obj as CandidTypeMap, parents)); } }; } diff --git a/src/lib/candid/types/constructed/vec.ts b/src/lib/candid/types/constructed/vec.ts index c74fa14425..95b3080d6a 100644 --- a/src/lib/candid/types/constructed/vec.ts +++ b/src/lib/candid/types/constructed/vec.ts @@ -3,7 +3,7 @@ import { IDL } from '@dfinity/candid'; import { CandidType } from '../../candid_type'; import { decode } from '../../serde/decode'; import { encode } from '../../serde/encode'; -import { Parent, toIdl } from '../../to_idl'; +import { Parent, toIdlType } from '../../to_idl_type'; import { TypeMapping } from '../../type_mapping'; export class AzleVec { @@ -26,8 +26,8 @@ export class AzleVec { return decode(this, bytes) as T[]; } - getIdl(parents: Parent[]): IDL.VecClass { - return IDL.Vec(toIdl(this.innerType, parents)); + getIdlType(parents: Parent[]): IDL.VecClass { + return IDL.Vec(toIdlType(this.innerType, parents)); } } diff --git a/src/lib/candid/types/primitive/bool.ts b/src/lib/candid/types/primitive/bool.ts index 9cdf586b3b..ead30ef3bb 100644 --- a/src/lib/candid/types/primitive/bool.ts +++ b/src/lib/candid/types/primitive/bool.ts @@ -17,7 +17,7 @@ export class AzleBool { return decode(this, bytes) as bool; } - static getIdl(): IDL.BoolClass { + static getIdlType(): IDL.BoolClass { return IDL.Bool; } } diff --git a/src/lib/candid/types/primitive/empty.ts b/src/lib/candid/types/primitive/empty.ts index 5137aedaa9..d394f52de0 100644 --- a/src/lib/candid/types/primitive/empty.ts +++ b/src/lib/candid/types/primitive/empty.ts @@ -17,7 +17,7 @@ export class AzleEmpty { return decode(this, bytes) as empty; } - static getIdl(): IDL.EmptyClass { + static getIdlType(): IDL.EmptyClass { return IDL.Empty; } } diff --git a/src/lib/candid/types/primitive/floats/float32.ts b/src/lib/candid/types/primitive/floats/float32.ts index 3fe3098155..ee73e35f28 100644 --- a/src/lib/candid/types/primitive/floats/float32.ts +++ b/src/lib/candid/types/primitive/floats/float32.ts @@ -17,7 +17,7 @@ export class AzleFloat32 { return decode(this, bytes) as float32; } - static getIdl(): IDL.FloatClass { + static getIdlType(): IDL.FloatClass { return IDL.Float32; } } diff --git a/src/lib/candid/types/primitive/floats/float64.ts b/src/lib/candid/types/primitive/floats/float64.ts index 2a7751911e..2019c41bb2 100644 --- a/src/lib/candid/types/primitive/floats/float64.ts +++ b/src/lib/candid/types/primitive/floats/float64.ts @@ -17,7 +17,7 @@ export class AzleFloat64 { return decode(this, bytes) as float64; } - static getIdl(): IDL.FloatClass { + static getIdlType(): IDL.FloatClass { return IDL.Float64; } } diff --git a/src/lib/candid/types/primitive/ints/int.ts b/src/lib/candid/types/primitive/ints/int.ts index 63cee2f4a6..09e982f94a 100644 --- a/src/lib/candid/types/primitive/ints/int.ts +++ b/src/lib/candid/types/primitive/ints/int.ts @@ -17,7 +17,7 @@ export class AzleInt { return decode(this, bytes) as int; } - static getIdl(): IDL.IntClass { + static getIdlType(): IDL.IntClass { return IDL.Int; } } diff --git a/src/lib/candid/types/primitive/ints/int16.ts b/src/lib/candid/types/primitive/ints/int16.ts index 5ccd935c53..3ec62a1563 100644 --- a/src/lib/candid/types/primitive/ints/int16.ts +++ b/src/lib/candid/types/primitive/ints/int16.ts @@ -17,7 +17,7 @@ export class AzleInt16 { return decode(this, bytes) as int16; } - static getIdl(): IDL.FixedIntClass { + static getIdlType(): IDL.FixedIntClass { return IDL.Int16; } } diff --git a/src/lib/candid/types/primitive/ints/int32.ts b/src/lib/candid/types/primitive/ints/int32.ts index 52f905b87f..7727e21a8f 100644 --- a/src/lib/candid/types/primitive/ints/int32.ts +++ b/src/lib/candid/types/primitive/ints/int32.ts @@ -17,7 +17,7 @@ export class AzleInt32 { return decode(this, bytes) as int32; } - static getIdl(): IDL.FixedIntClass { + static getIdlType(): IDL.FixedIntClass { return IDL.Int32; } } diff --git a/src/lib/candid/types/primitive/ints/int64.ts b/src/lib/candid/types/primitive/ints/int64.ts index fefd858261..0dfd291b13 100644 --- a/src/lib/candid/types/primitive/ints/int64.ts +++ b/src/lib/candid/types/primitive/ints/int64.ts @@ -17,7 +17,7 @@ export class AzleInt64 { return decode(this, bytes) as int64; } - static getIdl(): IDL.FixedIntClass { + static getIdlType(): IDL.FixedIntClass { return IDL.Int64; } } diff --git a/src/lib/candid/types/primitive/ints/int8.ts b/src/lib/candid/types/primitive/ints/int8.ts index 58cda65adc..93bf34db60 100644 --- a/src/lib/candid/types/primitive/ints/int8.ts +++ b/src/lib/candid/types/primitive/ints/int8.ts @@ -17,7 +17,7 @@ export class AzleInt8 { return decode(this, bytes) as int8; } - static getIdl(): IDL.FixedIntClass { + static getIdlType(): IDL.FixedIntClass { return IDL.Int8; } } diff --git a/src/lib/candid/types/primitive/nats/nat.ts b/src/lib/candid/types/primitive/nats/nat.ts index 586c316270..1f67982a4e 100644 --- a/src/lib/candid/types/primitive/nats/nat.ts +++ b/src/lib/candid/types/primitive/nats/nat.ts @@ -17,7 +17,7 @@ export class AzleNat { return decode(this, bytes) as nat; } - static getIdl(): IDL.NatClass { + static getIdlType(): IDL.NatClass { return IDL.Nat; } } diff --git a/src/lib/candid/types/primitive/nats/nat16.ts b/src/lib/candid/types/primitive/nats/nat16.ts index 04fb4b59c2..47744d3a86 100644 --- a/src/lib/candid/types/primitive/nats/nat16.ts +++ b/src/lib/candid/types/primitive/nats/nat16.ts @@ -17,7 +17,7 @@ export class AzleNat16 { return decode(this, bytes) as nat16; } - static getIdl(): IDL.FixedNatClass { + static getIdlType(): IDL.FixedNatClass { return IDL.Nat16; } } diff --git a/src/lib/candid/types/primitive/nats/nat32.ts b/src/lib/candid/types/primitive/nats/nat32.ts index 9c51b4b9bb..4d3bb433df 100644 --- a/src/lib/candid/types/primitive/nats/nat32.ts +++ b/src/lib/candid/types/primitive/nats/nat32.ts @@ -17,7 +17,7 @@ export class AzleNat32 { return decode(this, bytes) as nat32; } - static getIdl(): IDL.FixedNatClass { + static getIdlType(): IDL.FixedNatClass { return IDL.Nat32; } } diff --git a/src/lib/candid/types/primitive/nats/nat64.ts b/src/lib/candid/types/primitive/nats/nat64.ts index 3a9e3bfb4a..61d8055ebf 100644 --- a/src/lib/candid/types/primitive/nats/nat64.ts +++ b/src/lib/candid/types/primitive/nats/nat64.ts @@ -17,7 +17,7 @@ export class AzleNat64 { return decode(this, bytes) as nat64; } - static getIdl(): IDL.FixedNatClass { + static getIdlType(): IDL.FixedNatClass { return IDL.Nat64; } } diff --git a/src/lib/candid/types/primitive/nats/nat8.ts b/src/lib/candid/types/primitive/nats/nat8.ts index 6b6fee1ee7..fefc607c73 100644 --- a/src/lib/candid/types/primitive/nats/nat8.ts +++ b/src/lib/candid/types/primitive/nats/nat8.ts @@ -17,7 +17,7 @@ export class AzleNat8 { return decode(this, bytes) as nat8; } - static getIdl(): IDL.FixedNatClass { + static getIdlType(): IDL.FixedNatClass { return IDL.Nat8; } } diff --git a/src/lib/candid/types/primitive/null.ts b/src/lib/candid/types/primitive/null.ts index c7c49c4701..0006f9a2ed 100644 --- a/src/lib/candid/types/primitive/null.ts +++ b/src/lib/candid/types/primitive/null.ts @@ -17,7 +17,7 @@ export class AzleNull { return decode(this, bytes) as Null; } - static getIdl(): IDL.NullClass { + static getIdlType(): IDL.NullClass { return IDL.Null; } } diff --git a/src/lib/candid/types/primitive/reserved.ts b/src/lib/candid/types/primitive/reserved.ts index 7409eba949..b91ebb2ca4 100644 --- a/src/lib/candid/types/primitive/reserved.ts +++ b/src/lib/candid/types/primitive/reserved.ts @@ -17,7 +17,7 @@ export class AzleReserved { return decode(this, bytes); } - static getIdl(): IDL.ReservedClass { + static getIdlType(): IDL.ReservedClass { return IDL.Reserved; } } diff --git a/src/lib/candid/types/primitive/text.ts b/src/lib/candid/types/primitive/text.ts index f549bc02b2..d1c435772f 100644 --- a/src/lib/candid/types/primitive/text.ts +++ b/src/lib/candid/types/primitive/text.ts @@ -17,7 +17,7 @@ export class AzleText { return decode(this, bytes) as string; } - static getIdl(): IDL.TextClass { + static getIdlType(): IDL.TextClass { return IDL.Text; } } diff --git a/src/lib/candid/types/primitive/void.ts b/src/lib/candid/types/primitive/void.ts index 5817c3fda8..9ecb858517 100644 --- a/src/lib/candid/types/primitive/void.ts +++ b/src/lib/candid/types/primitive/void.ts @@ -17,7 +17,7 @@ export class AzleVoid { return decode(this, bytes) as undefined; } - static getIdl(): IDL.Type { + static getIdlType(): IDL.Type { return [] as unknown as IDL.Type; } } diff --git a/src/lib/candid/types/reference/func.ts b/src/lib/candid/types/reference/func.ts index 9a0e203ad1..5274949566 100644 --- a/src/lib/candid/types/reference/func.ts +++ b/src/lib/candid/types/reference/func.ts @@ -1,6 +1,6 @@ import { IDL } from '@dfinity/candid'; -import { CandidType, Parent, toIdlArray } from '../../index'; +import { CandidType, Parent, toIdlTypeArray } from '../../index'; import { decode } from '../../serde/decode'; import { encode } from '../../serde/encode'; import { Principal } from './principal'; @@ -29,10 +29,10 @@ export function Func( fromBytes(bytes: Uint8Array): Func { return decode(this, bytes) as Func; }, - getIdl(parents: Parent[]): IDL.FuncClass { + getIdlType(parents: Parent[]): IDL.FuncClass { return IDL.Func( - toIdlArray(paramCandidTypes, parents), - toIdlArray(returnCandidTypes, parents), + toIdlTypeArray(paramCandidTypes, parents), + toIdlTypeArray(returnCandidTypes, parents), modeToCandid[mode] ); } diff --git a/src/lib/candid/types/reference/principal.ts b/src/lib/candid/types/reference/principal.ts index 894ebf2b9a..9bbf74e258 100644 --- a/src/lib/candid/types/reference/principal.ts +++ b/src/lib/candid/types/reference/principal.ts @@ -3,7 +3,7 @@ import { Principal as DfinityPrincipal } from '@dfinity/principal'; import { decode } from '../../serde/decode'; import { encode } from '../../serde/encode'; -import { Parent } from '../../to_idl'; +import { Parent } from '../../to_idl_type'; export class Principal extends DfinityPrincipal { static _azleKind = 'Principal' as const; @@ -18,7 +18,7 @@ export class Principal extends DfinityPrincipal { return decode(this, bytes) as DfinityPrincipal; } - static getIdl(_parents: Parent[]): IDL.PrincipalClass { + static getIdlType(_parents: Parent[]): IDL.PrincipalClass { return IDL.Principal; } } diff --git a/src/lib/candid/types/reference/service/canister_function/index.ts b/src/lib/candid/types/reference/service/canister_function/index.ts index d2e2ba3d01..9584443efb 100644 --- a/src/lib/candid/types/reference/service/canister_function/index.ts +++ b/src/lib/candid/types/reference/service/canister_function/index.ts @@ -1,16 +1,14 @@ -// TODO make this function's return type explicit https://github.com/demergent-labs/azle/issues/1860 -/* eslint-disable @typescript-eslint/explicit-function-return-type */ import { IDL } from '@dfinity/candid'; import { CanisterMethodInfo } from '../../../../../canister_methods/types/canister_method_info'; import { ic } from '../../../../../ic'; -import { CandidType, Parent, toIdlArray } from '../../../../index'; +import { CandidType, Parent, toIdlTypeArray } from '../../../../index'; import { _AzleRecursiveFunction } from '../../../../recursive'; import { decode, encode } from '../../../../serde'; import { Principal } from '../../principal'; import { createQueryMethods, createUpdateMethods } from './query_update'; import { - createGetSystemFunctionIdlFunction, + createGetSystemFunctionIdlTypeFunction, createSystemMethod } from './system_methods'; @@ -28,11 +26,11 @@ type _AzleFunctionReturnType = { queries?: any[]; updates?: any[]; callbacks?: any; - getSystemFunctionIdls?: (parents: Parent[]) => IDL.FuncClass[]; - getIdl?: (parents: Parent[]) => IDL.Type; + getSystemFunctionIdlTypes?: (parents: Parent[]) => IDL.FuncClass[]; + getIdlType?: (parents: Parent[]) => IDL.Type; }; -type CallRawFunction = typeof ic.callRaw | typeof ic.callRaw128; +type CallRawFunction = typeof ic.callRaw; type NotifyRawFunction = typeof ic.notifyRaw; type FunctionInfo = { @@ -41,11 +39,20 @@ type FunctionInfo = { returnCandidType: CandidType; }; +type ServiceCall = ( + notify: boolean, + callFunction: CallRawFunction | NotifyRawFunction, + cycles: bigint, + args: any[] +) => void | Promise; + export interface ServiceFunctionInfo { [key: string]: FunctionInfo; } -export function createCanisterFunction(canisterOptions: CanisterOptions) { +export function createCanisterFunction( + canisterOptions: CanisterOptions +): _AzleFunctionReturnType { let canister = createCanisterFunctionBase(canisterOptions); canister.init = createSystemMethod('init', canisterOptions); canister.heartbeat = createSystemMethod('heartbeat', canisterOptions); @@ -58,18 +65,20 @@ export function createCanisterFunction(canisterOptions: CanisterOptions) { canister.queries = createQueryMethods(canisterOptions); canister.updates = createUpdateMethods(canisterOptions); canister.callbacks = createCallbacks(canisterOptions); - canister.getIdl = createGetIdlFunction(canisterOptions); - canister.getSystemFunctionIdls = - createGetSystemFunctionIdlFunction(canisterOptions); + canister.getIdlType = createGetIdlTypeFunction(canisterOptions); + canister.getSystemFunctionIdlTypes = + createGetSystemFunctionIdlTypeFunction(canisterOptions); return canister; } -function createGetIdlFunction(canisterOptions: CanisterOptions) { +function createGetIdlTypeFunction( + canisterOptions: CanisterOptions +): (parents: Parent[]) => IDL.ServiceClass { return (parents: Parent[]): IDL.ServiceClass => { const serviceFunctionInfo = canisterOptions as ServiceFunctionInfo; - // We don't want init, post upgrade, etc showing up in the idl + // We don't want init, post upgrade, etc showing up in the idl type const isQueryOrUpdate = (mode: string): boolean => { return mode === 'query' || mode === 'update'; }; @@ -82,7 +91,7 @@ function createGetIdlFunction(canisterOptions: CanisterOptions) { (accumulator, [methodName, functionInfo]) => { return { ...accumulator, - [methodName]: createUpdateOrQueryFunctionIdl( + [methodName]: createUpdateOrQueryFunctionIdlType( functionInfo, parents ) @@ -102,18 +111,26 @@ function createAnnotation(mode: 'query' | 'update'): string[] { return []; } -function createUpdateOrQueryFunctionIdl( +function createUpdateOrQueryFunctionIdlType( functionInfo: FunctionInfo, parents: Parent[] ): IDL.FuncClass { const annotations = createAnnotation(functionInfo.mode); - const paramIdls = toIdlArray(functionInfo.paramCandidTypes, parents); - const returnIdls = toIdlArray(functionInfo.returnCandidType, parents); + const paramIdlTypes = toIdlTypeArray( + functionInfo.paramCandidTypes, + parents + ); + const returnIdlType = toIdlTypeArray( + functionInfo.returnCandidType, + parents + ); - return IDL.Func(paramIdls, returnIdls, annotations); + return IDL.Func(paramIdlTypes, returnIdlType, annotations); } -function createCallbacks(canisterOptions: CanisterOptions) { +function createCallbacks( + canisterOptions: CanisterOptions +): Record any) | undefined> { return Object.entries(canisterOptions).reduce((acc, entry) => { const canisterMethod = entry[1]; @@ -140,7 +157,7 @@ function createCanisterFunctionBase( callFunction: CallRawFunction | NotifyRawFunction, cycles: bigint, args: any[] - ) => { + ): ReturnType => { return serviceCall( principal as any, key, @@ -165,7 +182,7 @@ function serviceCall( methodName: string, paramCandidTypes: CandidType[], returnCandidType: CandidType -) { +): ServiceCall { return ( notify: boolean, callFunction: CallRawFunction | NotifyRawFunction, @@ -182,7 +199,7 @@ function serviceCall( cycles ); } else { - return (async () => { + return (async (): Promise => { const encodedResult = await (callFunction as CallRawFunction)( canisterId, methodName, diff --git a/src/lib/candid/types/reference/service/canister_function/system_methods.ts b/src/lib/candid/types/reference/service/canister_function/system_methods.ts index 5b9f5174f0..ceb3342e7d 100644 --- a/src/lib/candid/types/reference/service/canister_function/system_methods.ts +++ b/src/lib/candid/types/reference/service/canister_function/system_methods.ts @@ -1,6 +1,6 @@ import { IDL } from '@dfinity/candid'; -import { Parent, toIdlArray } from '../../../../index'; +import { Parent, toIdlTypeArray } from '../../../../index'; import { _AzleRecursiveFunction } from '../../../../recursive'; import { CanisterOptions, ServiceFunctionInfo } from '.'; @@ -27,7 +27,7 @@ export function createSystemMethod( }; } -export function createGetSystemFunctionIdlFunction( +export function createGetSystemFunctionIdlTypeFunction( canisterOptions: CanisterOptions ) { return (parents: Parent[]): IDL.FuncClass[] => { @@ -38,19 +38,22 @@ export function createGetSystemFunctionIdlFunction( const mode = functionInfo.mode; const isSystemMethod = !(mode === 'update' || mode === 'query'); if (!isSystemMethod) { - // IDLs that are in update and query are already accounted for in the standard getIdl function + // IDLs that are in update and query are already accounted for in the standard getIdlType function return accumulator; } - const paramIdls = toIdlArray( + const paramIdlTypes = toIdlTypeArray( functionInfo.paramCandidTypes, parents ); - const returnIdl = toIdlArray( + const returnIdlType = toIdlTypeArray( functionInfo.returnCandidType, parents ); - return [...accumulator, IDL.Func(paramIdls, returnIdl, [mode])]; + return [ + ...accumulator, + IDL.Func(paramIdlTypes, returnIdlType, [mode]) + ]; }, [] as IDL.FuncClass[] ); diff --git a/src/lib/canister_methods/execute_method.ts b/src/lib/canister_methods/execute_method.ts index 7a66458c2e..ad3466a2da 100644 --- a/src/lib/canister_methods/execute_method.ts +++ b/src/lib/canister_methods/execute_method.ts @@ -33,7 +33,7 @@ export function executeMethod( result .then((result: any) => { if (!manual) { - ic.replyRaw(encode(returnCandidType, result)); + ic.reply({ raw: encode(returnCandidType, result) }); } // TODO this won't be accurate because we have most likely had @@ -45,7 +45,7 @@ export function executeMethod( }); } else { if (!manual) { - ic.replyRaw(encode(returnCandidType, result)); + ic.reply({ raw: encode(returnCandidType, result) }); } reportFinalInstructions(); diff --git a/src/lib/fetch/icp.ts b/src/lib/fetch/icp.ts index 9fc5feb0b8..62412cc551 100644 --- a/src/lib/fetch/icp.ts +++ b/src/lib/fetch/icp.ts @@ -13,7 +13,7 @@ export async function fetchIcp( const canisterMethod = url.pathname.replace('/', ''); const { body } = init ?? {}; - const { args, cycles, cycles128 } = (body ?? {}) as any; + const { args, cycles } = (body ?? {}) as any; const candidPath = determineCandidPath( canisterId, (body as any)?.candidPath @@ -47,20 +47,12 @@ export async function fetchIcp( const canisterPrincipal = Principal.fromText(canisterId); - const result = - cycles128 === undefined - ? await ic.callRaw( - canisterPrincipal, - canisterMethod, - argsRaw, - BigInt(cycles ?? 0) - ) - : await ic.callRaw128( - canisterPrincipal, - canisterMethod, - argsRaw, - BigInt(cycles128 ?? 0) - ); + const result = await ic.callRaw( + canisterPrincipal, + canisterMethod, + argsRaw, + BigInt(cycles ?? 0) + ); const decodedResult = IDL.decode(funcIdl.retTypes, result); diff --git a/src/lib/fetch/index.ts b/src/lib/fetch/index.ts index 25217dcf5a..a6fc896c4e 100644 --- a/src/lib/fetch/index.ts +++ b/src/lib/fetch/index.ts @@ -39,7 +39,6 @@ export function serialize(param: { candidPath?: string; args?: any[]; cycles?: number | bigint; - cycles128?: number | bigint; }): ArrayBuffer { return param as any; } diff --git a/src/lib/ic/arg_data_raw.ts b/src/lib/ic/arg_data_raw.ts index bd356b77ff..26b4969f66 100644 --- a/src/lib/ic/arg_data_raw.ts +++ b/src/lib/ic/arg_data_raw.ts @@ -5,7 +5,7 @@ import { blob } from '../candid/types/constructed/blob'; * @returns the argument data */ export function argDataRaw(): blob { - return globalThis._azleIc - ? new Uint8Array(globalThis._azleIc.argDataRaw()) - : (undefined as any); + return new Uint8Array( + globalThis._azleIc ? globalThis._azleIc.argDataRaw() : [] + ); } diff --git a/src/lib/ic/arg_data_raw_size.ts b/src/lib/ic/arg_data_raw_size.ts index 9e90ae7d45..c55a79da1a 100644 --- a/src/lib/ic/arg_data_raw_size.ts +++ b/src/lib/ic/arg_data_raw_size.ts @@ -5,7 +5,5 @@ import { nat32 } from '../candid/types/primitive/nats/nat32'; * @returns the data size */ export function argDataRawSize(): nat32 { - return globalThis._azleIc - ? Number(globalThis._azleIc.argDataRawSize()) - : (undefined as any); + return globalThis._azleIc ? Number(globalThis._azleIc.argDataRawSize()) : 0; } diff --git a/src/lib/ic/call.ts b/src/lib/ic/call.ts index 2149a5829d..7b35ee2eeb 100644 --- a/src/lib/ic/call.ts +++ b/src/lib/ic/call.ts @@ -1,7 +1,5 @@ import { nat } from '../candid/types/primitive/nats/nat'; -import { nat64 } from '../candid/types/primitive/nats/nat64'; import { callRaw } from './call_raw'; -import { callRaw128 } from './call_raw_128'; import { ArgsType } from './types/args_type'; import { ReturnTypeOf } from './types/return_type_of'; @@ -19,36 +17,22 @@ export function call any>( method: T, config?: { args?: ArgsType; - cycles?: nat64; - cycles128?: nat; + cycles?: nat; } ): ReturnTypeOf { if (globalThis._azleIc === undefined) { return undefined as any; } - const { callFunction, cycles } = getCallFunctionAndCycles( - config?.cycles, - config?.cycles128 - ); + const { callFunction, cycles } = getCallFunctionAndCycles(config?.cycles); return method(false, callFunction, cycles, config?.args ?? []); } -function getCallFunctionAndCycles( - cycles: nat64 | undefined, - cycles128: nat | undefined -): { +function getCallFunctionAndCycles(cycles: nat | undefined): { callFunction: any; cycles: bigint; } { - if (cycles128 !== undefined) { - return { - callFunction: callRaw128, - cycles: cycles128 - }; - } - return { callFunction: callRaw, cycles: cycles ?? 0n diff --git a/src/lib/ic/call_raw.ts b/src/lib/ic/call_raw.ts index 4b2536ce42..2e7ca74f8f 100644 --- a/src/lib/ic/call_raw.ts +++ b/src/lib/ic/call_raw.ts @@ -2,7 +2,7 @@ import { v4 } from 'uuid'; import { Principal } from '../'; import { blob } from '../candid/types/constructed/blob'; -import { nat64 } from '../candid/types/primitive/nats/nat64'; +import { nat } from '../candid/types/primitive/nats/nat'; import { text } from '../candid/types/primitive/text'; /** @@ -19,16 +19,16 @@ export function callRaw( canisterId: Principal, method: text, argsRaw: blob, - payment: nat64 + payment: nat ): Promise { if (globalThis._azleIc === undefined) { - return undefined as any; + return Promise.resolve(new Uint8Array()); } // TODO this should use a Result remember return new Promise((resolve, reject) => { if (globalThis._azleIc === undefined) { - return undefined as any; + return new Uint8Array(); } const promiseId = v4(); diff --git a/src/lib/ic/call_raw_128.ts b/src/lib/ic/call_raw_128.ts deleted file mode 100644 index f6e42240fd..0000000000 --- a/src/lib/ic/call_raw_128.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { v4 } from 'uuid'; - -import { Principal } from '../'; -import { blob } from '../candid/types/constructed/blob'; -import { nat } from '../candid/types/primitive/nats/nat'; -import { text } from '../candid/types/primitive/text'; - -/** - * Performs an asynchronous call to another canister using the [System API]( - * https://internetcomputer.org/docs/current/references/ic-interface-spec/#system-api-call) - * and returns the payload without serialization - * @param canisterId the principal of the canister to call - * @param method the method to call - * @param argsRaw the args to pass to the canister method - * @param payment the number of cycles to send with the call - * @returns - */ -export function callRaw128( - canisterId: Principal, - method: text, - argsRaw: blob, - payment: nat -): Promise { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - // TODO this should use a Result remember - return new Promise((resolve, reject) => { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - const promiseId = v4(); - const globalResolveId = `_resolve_${promiseId}`; - const globalRejectId = `_reject_${promiseId}`; - - // TODO perhaps we should be more robust - // TODO for example, we can keep the time with these - // TODO if they are over a certain amount old we can delete them - globalThis._azleResolveIds[globalResolveId] = ( - bytes: ArrayBuffer - ): void => { - resolve(new Uint8Array(bytes)); - - delete globalThis._azleResolveIds[globalResolveId]; - delete globalThis._azleRejectIds[globalRejectId]; - }; - - globalThis._azleRejectIds[globalRejectId] = (error: any): void => { - reject(error); - - delete globalThis._azleResolveIds[globalResolveId]; - delete globalThis._azleRejectIds[globalRejectId]; - }; - - const canisterIdBytes = canisterId.toUint8Array().buffer; - const argsRawBuffer = argsRaw.buffer; - const paymentString = payment.toString(); - - // TODO consider finally, what if deletion goes wrong - try { - globalThis._azleIc.callRaw128( - promiseId, - canisterIdBytes, - method, - argsRawBuffer, - paymentString - ); - } catch (error) { - delete globalThis._azleResolveIds[globalResolveId]; - delete globalThis._azleRejectIds[globalRejectId]; - throw error; - } - }); -} diff --git a/src/lib/ic/caller.ts b/src/lib/ic/caller.ts index 3d8d847f86..972f6d6ec3 100644 --- a/src/lib/ic/caller.ts +++ b/src/lib/ic/caller.ts @@ -6,7 +6,7 @@ import { Principal } from '../candid/types/reference/principal'; */ export function caller(): Principal { if (globalThis._azleIc === undefined) { - return undefined as any; + return Principal.fromHex('04'); } const callerBytes = globalThis._azleIc.caller(); diff --git a/src/lib/ic/candid_compiler.ts b/src/lib/ic/candid_compiler.ts index 75a523b705..83721c4419 100644 --- a/src/lib/ic/candid_compiler.ts +++ b/src/lib/ic/candid_compiler.ts @@ -7,7 +7,7 @@ import { text } from '../candid/types/primitive/text'; */ export function candidCompiler(candidPath: text): string { if (globalThis._azleIc === undefined) { - return undefined as any; + return ''; } return globalThis._azleIc.candidCompiler(candidPath); diff --git a/src/lib/ic/candid_decode.ts b/src/lib/ic/candid_decode.ts index bc0b35d4bc..75260c9490 100644 --- a/src/lib/ic/candid_decode.ts +++ b/src/lib/ic/candid_decode.ts @@ -8,7 +8,7 @@ import { text } from '../candid/types/primitive/text'; */ export function candidDecode(candidEncoded: blob): text { if (globalThis._azleIc === undefined) { - return undefined as any; + return ''; } return globalThis._azleIc.candidDecode(candidEncoded.buffer); diff --git a/src/lib/ic/candid_encode.ts b/src/lib/ic/candid_encode.ts index f60c086986..78d5e8e334 100644 --- a/src/lib/ic/candid_encode.ts +++ b/src/lib/ic/candid_encode.ts @@ -7,9 +7,7 @@ import { text } from '../candid/types/primitive/text'; * @returns the candid value as bytes */ export function candidEncode(candidString: text): blob { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return new Uint8Array(globalThis._azleIc.candidEncode(candidString)); + return new Uint8Array( + globalThis._azleIc ? globalThis._azleIc.candidEncode(candidString) : [] + ); } diff --git a/src/lib/ic/canister_balance.ts b/src/lib/ic/canister_balance.ts index a7e46706b0..04c97c4d72 100644 --- a/src/lib/ic/canister_balance.ts +++ b/src/lib/ic/canister_balance.ts @@ -6,7 +6,7 @@ import { nat64 } from '../candid/types/primitive/nats/nat64'; */ export function canisterBalance(): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt(globalThis._azleIc.canisterBalance()); diff --git a/src/lib/ic/canister_balance_128.ts b/src/lib/ic/canister_balance_128.ts deleted file mode 100644 index c6ffb76450..0000000000 --- a/src/lib/ic/canister_balance_128.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { nat } from '../candid/types/primitive/nats/nat'; - -/** - * Gets the amount of funds available in the canister - * @returns the number of cycles in the canister - */ -export function canisterBalance128(): nat { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return BigInt(globalThis._azleIc.canisterBalance128()); -} diff --git a/src/lib/ic/canister_version.ts b/src/lib/ic/canister_version.ts index 5e04d65070..7ce0af315e 100644 --- a/src/lib/ic/canister_version.ts +++ b/src/lib/ic/canister_version.ts @@ -7,7 +7,7 @@ import { nat64 } from '../candid/types/primitive/nats/nat64'; */ export function canisterVersion(): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt(globalThis._azleIc.canisterVersion()); diff --git a/src/lib/ic/chunk.ts b/src/lib/ic/chunk.ts index 6f5def20f3..5843b7e716 100644 --- a/src/lib/ic/chunk.ts +++ b/src/lib/ic/chunk.ts @@ -2,7 +2,7 @@ import { ic } from './'; export async function chunk(): Promise { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } await ic.callRaw(ic.id(), '_azle_chunk', ic.candidEncode('()'), 0n); diff --git a/src/lib/ic/clear_timer.ts b/src/lib/ic/clear_timer.ts index 77dbfa97ce..1ab50598e4 100644 --- a/src/lib/ic/clear_timer.ts +++ b/src/lib/ic/clear_timer.ts @@ -6,7 +6,7 @@ import { Void } from '../candid/types/primitive/void'; */ export function clearTimer(timerId: bigint): Void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } globalThis._azleIc.clearTimer(timerId.toString()); diff --git a/src/lib/ic/data_certificate.ts b/src/lib/ic/data_certificate.ts index 7ea0ee212f..7769dfdd4a 100644 --- a/src/lib/ic/data_certificate.ts +++ b/src/lib/ic/data_certificate.ts @@ -9,7 +9,7 @@ import { None, Opt, Some } from '../candid/types/constructed/opt'; */ export function dataCertificate(): Opt { if (globalThis._azleIc === undefined) { - return undefined as any; + return None; } const rawRustValue = globalThis._azleIc.dataCertificate(); diff --git a/src/lib/ic/id.ts b/src/lib/ic/id.ts index 207fc8eeef..1a35bd731f 100644 --- a/src/lib/ic/id.ts +++ b/src/lib/ic/id.ts @@ -6,7 +6,7 @@ import { Principal } from '../candid/types/reference/principal'; */ export function id(): Principal { if (globalThis._azleIc === undefined) { - return undefined as any; + return Principal.fromHex('04'); } // TODO consider bytes instead of string, just like with caller diff --git a/src/lib/ic/index.ts b/src/lib/ic/index.ts index 6d633b47d2..dde82a3bcb 100644 --- a/src/lib/ic/index.ts +++ b/src/lib/ic/index.ts @@ -3,13 +3,11 @@ import { argDataRaw } from './arg_data_raw'; import { argDataRawSize } from './arg_data_raw_size'; import { call } from './call'; import { callRaw } from './call_raw'; -import { callRaw128 } from './call_raw_128'; import { caller } from './caller'; import { candidCompiler } from './candid_compiler'; import { candidDecode } from './candid_decode'; import { candidEncode } from './candid_encode'; import { canisterBalance } from './canister_balance'; -import { canisterBalance128 } from './canister_balance_128'; import { canisterVersion } from './canister_version'; import { chunk } from './chunk'; import { clearTimer } from './clear_timer'; @@ -19,11 +17,8 @@ import { instructionCounter } from './instruction_counter'; import { isController } from './is_controller'; import { methodName } from './method_name'; import { msgCyclesAccept } from './msg_cycles_accept'; -import { msgCyclesAccept128 } from './msg_cycles_accept_128'; import { msgCyclesAvailable } from './msg_cycles_available'; -import { msgCyclesAvailable128 } from './msg_cycles_available_128'; import { msgCyclesRefunded } from './msg_cycles_refunded'; -import { msgCyclesRefunded128 } from './msg_cycles_refunded_128'; import { notify } from './notify'; import { notifyRaw } from './notify_raw'; import { performanceCounter } from './performance_counter'; @@ -32,15 +27,10 @@ import { reject } from './reject'; import { rejectCode } from './reject_code'; import { rejectMessage } from './reject_message'; import { reply } from './reply'; -import { replyRaw } from './reply_raw'; import { setCertifiedData } from './set_certified_data'; import { setOutgoingHttpOptions } from './set_outgoing_http_options'; import { setTimer } from './set_timer'; import { setTimerInterval } from './set_timer_interval'; -import { stable64Grow } from './stable_64_grow'; -import { stable64Read } from './stable_64_read'; -import { stable64Size } from './stable_64_size'; -import { stable64Write } from './stable_64_write'; import { stableBytes } from './stable_bytes'; import { stableGrow } from './stable_grow'; import { stableRead } from './stable_read'; @@ -58,13 +48,11 @@ export const ic = { argDataRaw, call, callRaw, - callRaw128, caller, candidCompiler, candidDecode, candidEncode, canisterBalance, - canisterBalance128, canisterVersion, chunk, clearTimer, @@ -74,11 +62,8 @@ export const ic = { isController, methodName, msgCyclesAccept, - msgCyclesAccept128, msgCyclesAvailable, - msgCyclesAvailable128, msgCyclesRefunded, - msgCyclesRefunded128, notify, notifyRaw, performanceCounter, @@ -87,7 +72,6 @@ export const ic = { rejectCode, rejectMessage, reply, - replyRaw, setCertifiedData, setOutgoingHttpOptions, setTimer, @@ -97,10 +81,6 @@ export const ic = { stableRead, stableSize, stableWrite, - stable64Grow, - stable64Read, - stable64Size, - stable64Write, time, trap }; diff --git a/src/lib/ic/instruction_counter.ts b/src/lib/ic/instruction_counter.ts index 6daaa3ddf7..ab6fccb527 100644 --- a/src/lib/ic/instruction_counter.ts +++ b/src/lib/ic/instruction_counter.ts @@ -10,7 +10,7 @@ import { nat64 } from '../candid/types/primitive/nats/nat64'; */ export function instructionCounter(): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt(globalThis._azleIc.instructionCounter()); diff --git a/src/lib/ic/is_controller.ts b/src/lib/ic/is_controller.ts index 7c47fec0da..2227dbd775 100644 --- a/src/lib/ic/is_controller.ts +++ b/src/lib/ic/is_controller.ts @@ -4,7 +4,7 @@ import { Principal } from '../candid/types/reference/principal'; /** Determine if a {@link Principal} is a controller of the canister. */ export function isController(principal: Principal): bool { if (globalThis._azleIc === undefined) { - return undefined as any; + return false; } return globalThis._azleIc.isController(principal.toUint8Array().buffer); diff --git a/src/lib/ic/method_name.ts b/src/lib/ic/method_name.ts index 52ef9d39b4..91f5c9e623 100644 --- a/src/lib/ic/method_name.ts +++ b/src/lib/ic/method_name.ts @@ -5,7 +5,5 @@ import { text } from '../candid/types/primitive/text'; * @returns the current canister method */ export function methodName(): text { - return globalThis._azleIc - ? globalThis._azleIc.methodName() - : (undefined as any); + return globalThis._azleIc ? globalThis._azleIc.methodName() : ''; } diff --git a/src/lib/ic/msg_cycles_accept.ts b/src/lib/ic/msg_cycles_accept.ts index c88ba0ffeb..8970582c86 100644 --- a/src/lib/ic/msg_cycles_accept.ts +++ b/src/lib/ic/msg_cycles_accept.ts @@ -7,7 +7,7 @@ import { nat64 } from '../candid/types/primitive/nats/nat64'; */ export function msgCyclesAccept(maxAmount: nat64): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const msgCyclesAcceptAmountMovedString = globalThis._azleIc.msgCyclesAccept( diff --git a/src/lib/ic/msg_cycles_accept_128.ts b/src/lib/ic/msg_cycles_accept_128.ts deleted file mode 100644 index 9f5bd1d8bd..0000000000 --- a/src/lib/ic/msg_cycles_accept_128.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { nat } from '../candid/types/primitive/nats/nat'; - -/** - * Moves cycles from the call to the canister balance - * @param maxAmount the max amount of cycles to move - * @returns the actual amount moved - */ -export function msgCyclesAccept128(maxAmount: nat): nat { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - const msgCyclesAccept128AmountMovedString = - globalThis._azleIc.msgCyclesAccept128(maxAmount.toString()); - - return BigInt(msgCyclesAccept128AmountMovedString); -} diff --git a/src/lib/ic/msg_cycles_available.ts b/src/lib/ic/msg_cycles_available.ts index 039e74c816..a2bda2c0f7 100644 --- a/src/lib/ic/msg_cycles_available.ts +++ b/src/lib/ic/msg_cycles_available.ts @@ -7,7 +7,7 @@ import { nat64 } from '../candid/types/primitive/nats/nat64'; */ export function msgCyclesAvailable(): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const msgCyclesAvailableAmountString = diff --git a/src/lib/ic/msg_cycles_available_128.ts b/src/lib/ic/msg_cycles_available_128.ts deleted file mode 100644 index a3293e3f9a..0000000000 --- a/src/lib/ic/msg_cycles_available_128.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { nat } from '../candid/types/primitive/nats/nat'; - -/** - * Returns the amount of cycles that were transferred by the caller of the - * current call, and is still available in this message - * @returns the amount of cycles - */ -export function msgCyclesAvailable128(): nat { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - const msgCyclesAvailable128AmountString = - globalThis._azleIc.msgCyclesAvailable128(); - - return BigInt(msgCyclesAvailable128AmountString); -} diff --git a/src/lib/ic/msg_cycles_refunded.ts b/src/lib/ic/msg_cycles_refunded.ts index 668ba67982..58ab70954d 100644 --- a/src/lib/ic/msg_cycles_refunded.ts +++ b/src/lib/ic/msg_cycles_refunded.ts @@ -7,7 +7,7 @@ import { nat64 } from '../candid/types/primitive/nats/nat64'; */ export function msgCyclesRefunded(): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const msgCyclesRefundedAmountString = diff --git a/src/lib/ic/msg_cycles_refunded_128.ts b/src/lib/ic/msg_cycles_refunded_128.ts deleted file mode 100644 index fdbb7fb63b..0000000000 --- a/src/lib/ic/msg_cycles_refunded_128.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { nat } from '../candid/types/primitive/nats/nat'; - -/** - * Returns the amount of cycles that came back with the response as a refund. - * The refund has already been added to the canister balance automatically. - * @returns the amount of cycles - */ -export function msgCyclesRefunded128(): nat { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - const msgCyclesRefunded128AmountString = - globalThis._azleIc.msgCyclesRefunded128(); - - return BigInt(msgCyclesRefunded128AmountString); -} diff --git a/src/lib/ic/notify.ts b/src/lib/ic/notify.ts index 23f4d03ff1..2a2fcb9295 100644 --- a/src/lib/ic/notify.ts +++ b/src/lib/ic/notify.ts @@ -40,7 +40,7 @@ export function notify any>( } ): Void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } return method(true, notifyRaw, config?.cycles ?? 0n, config?.args ?? []); diff --git a/src/lib/ic/notify_raw.ts b/src/lib/ic/notify_raw.ts index 80a925cc90..662c9ced71 100644 --- a/src/lib/ic/notify_raw.ts +++ b/src/lib/ic/notify_raw.ts @@ -19,7 +19,7 @@ export function notifyRaw( payment: nat ): Void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } const canisterIdBytes = canisterId.toUint8Array().buffer; diff --git a/src/lib/ic/performance_counter.ts b/src/lib/ic/performance_counter.ts index 5d67a8d981..1b8f1782ad 100644 --- a/src/lib/ic/performance_counter.ts +++ b/src/lib/ic/performance_counter.ts @@ -12,7 +12,7 @@ import { nat64 } from '../candid/types/primitive/nats/nat64'; */ export function performanceCounter(counterType: nat32): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt( diff --git a/src/lib/ic/reject_code.ts b/src/lib/ic/reject_code.ts index cad186ab33..96a14f7d14 100644 --- a/src/lib/ic/reject_code.ts +++ b/src/lib/ic/reject_code.ts @@ -7,7 +7,7 @@ import { RejectionCode } from '../system_types'; */ export function rejectCode(): RejectionCode { if (globalThis._azleIc === undefined) { - return undefined as any; + return { Unknown: null }; } const rejectCodeNumber = Number(globalThis._azleIc.rejectCode()); diff --git a/src/lib/ic/reject_message.ts b/src/lib/ic/reject_message.ts index bd54e33123..f24094047d 100644 --- a/src/lib/ic/reject_message.ts +++ b/src/lib/ic/reject_message.ts @@ -12,7 +12,5 @@ import { text } from '../candid/types/primitive/text'; * @returns the rejection message */ export function rejectMessage(): text { - return globalThis._azleIc - ? globalThis._azleIc.rejectMessage() - : (undefined as any); + return globalThis._azleIc ? globalThis._azleIc.rejectMessage() : ''; } diff --git a/src/lib/ic/reply.ts b/src/lib/ic/reply.ts index eaa5e50c88..b256e6d386 100644 --- a/src/lib/ic/reply.ts +++ b/src/lib/ic/reply.ts @@ -2,17 +2,43 @@ import { CandidType } from '../candid/candid_type'; import { encode } from '../candid/serde/encode'; import { Void } from '../candid/types/primitive/void'; +type ReplyInput = + | { + data: any; + candidType: CandidType; + } + | { + raw: Uint8Array; + }; + /** * Used to manually reply to an ingress message. Intended to be used in * canister methods with a {@link Manual} return type. - * @param reply the value with which to reply. Must by of type `T` where `T` + * @param reply the value with which to reply. Must be of type `T` where `T` * is the generic type supplied to `Manual`. Otherwise will result in an * uncaught `TypeError`. + * + * Optionally this can be used with the raw option in conjunction with + * {@link ic.candidEncode}. + * @example + * ```ts + * ic.reply({ + * raw: ic.candidEncode( + * '(record { "int" = 42; "text" = "text"; "bool" = true; "blob" = blob "raw bytes"; "variant" = variant { Medium } })' + * ) + * }); + * ) + * ``` */ -export function reply(data: any, type: CandidType): Void { +export function reply(input: ReplyInput): Void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } - return globalThis._azleIc.replyRaw(encode(type, data).buffer); + if ('raw' in input) { + return globalThis._azleIc.replyRaw(input.raw.buffer); + } else { + const { candidType: type, data } = input; + return globalThis._azleIc.replyRaw(encode(type, data).buffer); + } } diff --git a/src/lib/ic/reply_raw.ts b/src/lib/ic/reply_raw.ts deleted file mode 100644 index d8775ca73e..0000000000 --- a/src/lib/ic/reply_raw.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { blob } from '../candid/types/constructed/blob'; -import { Void } from '../candid/types/primitive/void'; - -/** - * Used to manually reply to an ingress message. Intended to be used in - * canister methods with a {@link Manual} return type. - * @param buf the value with which to reply. Intended to be used in conjunction with - * {@link ic.candidEncode}. - * @example - * ```ts - * $update; - * export function replyRaw(): Manual { - * ic.replyRaw( - * ic.candidEncode( - * '(record { "int" = 42; "text" = "text"; "bool" = true; "blob" = blob "raw bytes"; "variant" = variant { Medium } })' - * ) - * ); - * } - * ``` - */ -export function replyRaw(replyBuffer: blob): Void { - return globalThis._azleIc - ? globalThis._azleIc.replyRaw(replyBuffer.buffer) - : undefined; -} diff --git a/src/lib/ic/set_certified_data.ts b/src/lib/ic/set_certified_data.ts index 3898d5977f..a101c482df 100644 --- a/src/lib/ic/set_certified_data.ts +++ b/src/lib/ic/set_certified_data.ts @@ -25,7 +25,7 @@ import { Void } from '../candid/types/primitive/void'; */ export function setCertifiedData(data: blob): Void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } return globalThis._azleIc.setCertifiedData(data.buffer); diff --git a/src/lib/ic/set_timer.ts b/src/lib/ic/set_timer.ts index a53be1123e..ce1a78192d 100644 --- a/src/lib/ic/set_timer.ts +++ b/src/lib/ic/set_timer.ts @@ -14,7 +14,7 @@ export function setTimer( callback: () => void | Promise ): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const timerCallbackId = `_timer_${v4()}`; diff --git a/src/lib/ic/set_timer_interval.ts b/src/lib/ic/set_timer_interval.ts index b3d518c42a..c6d6e0cc43 100644 --- a/src/lib/ic/set_timer_interval.ts +++ b/src/lib/ic/set_timer_interval.ts @@ -14,7 +14,7 @@ export function setTimerInterval( callback: () => void | Promise ): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const timerCallbackId = `_interval_timer_${v4()}`; diff --git a/src/lib/ic/stable_64_grow.ts b/src/lib/ic/stable_64_grow.ts deleted file mode 100644 index 67253b1ffe..0000000000 --- a/src/lib/ic/stable_64_grow.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { nat64 } from '../candid/types/primitive/nats/nat64'; - -/** - * Attempts to grow the stable memory by `newPages`. - * Supports 64-bit addressed memory. - * @param newPages - * @returns the previous size that was reserved. - */ -export function stable64Grow(newPages: nat64): nat64 { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return BigInt(globalThis._azleIc.stable64Grow(newPages.toString())); -} diff --git a/src/lib/ic/stable_64_read.ts b/src/lib/ic/stable_64_read.ts deleted file mode 100644 index 5a54c76784..0000000000 --- a/src/lib/ic/stable_64_read.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { nat64 } from '../candid/types/primitive/nats/nat64'; - -/** - * Reads data from the stable memory location specified by an offset. - * Supports 64-bit addressed memory. - * @param offset the location from which to read - * @param length the length of buffer to read - * @returns the raw bytes in stable memory - */ -export function stable64Read(offset: nat64, length: nat64): Uint8Array { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return new Uint8Array( - globalThis._azleIc.stable64Read(offset.toString(), length.toString()) - ); -} diff --git a/src/lib/ic/stable_64_size.ts b/src/lib/ic/stable_64_size.ts deleted file mode 100644 index bc8ed9d40c..0000000000 --- a/src/lib/ic/stable_64_size.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { nat64 } from '../candid/types/primitive/nats/nat64'; - -/** - * Gets current size of the stable memory (in WASM pages). Supports 64-bit - * addressed memory. - * @returns the current memory size - */ -export function stable64Size(): nat64 { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return BigInt(globalThis._azleIc.stable64Size()); -} diff --git a/src/lib/ic/stable_64_write.ts b/src/lib/ic/stable_64_write.ts deleted file mode 100644 index 5bb54f741c..0000000000 --- a/src/lib/ic/stable_64_write.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { blob } from '../candid/types/constructed/blob'; -import { nat64 } from '../candid/types/primitive/nats/nat64'; - -/** - * Writes data to the stable memory location specified by an offset. - * Supports 64-bit addressed memory. - * - * **Warning:** this will panic if `offset` + `buffer.length` exceeds the - * current size of stable memory. Use {@link ic.stable64Grow} to request - * more stable memory if needed. - * @param offset the location at which to write - * @param buffer the data to write - */ -export function stable64Write(offset: nat64, buf: blob): void { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return globalThis._azleIc.stable64Write(offset.toString(), buf.buffer); -} diff --git a/src/lib/ic/stable_bytes.ts b/src/lib/ic/stable_bytes.ts index c3675d6e7d..1b358b9c80 100644 --- a/src/lib/ic/stable_bytes.ts +++ b/src/lib/ic/stable_bytes.ts @@ -8,9 +8,7 @@ import { blob } from '../candid/types/constructed/blob'; * @returns a copy of the stable memory */ export function stableBytes(): blob { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return new Uint8Array(globalThis._azleIc.stableBytes()); + return new Uint8Array( + globalThis._azleIc ? globalThis._azleIc.stableBytes() : [] + ); } diff --git a/src/lib/ic/stable_grow.ts b/src/lib/ic/stable_grow.ts index d70a823116..5cd87c8b6d 100644 --- a/src/lib/ic/stable_grow.ts +++ b/src/lib/ic/stable_grow.ts @@ -1,14 +1,15 @@ -import { nat32 } from '../candid/types/primitive/nats/nat32'; +import { nat64 } from '../candid/types/primitive/nats/nat64'; /** * Attempts to grow the stable memory by `newPages`. + * Supports 64-bit addressed memory. * @param newPages * @returns the previous size that was reserved. */ -export function stableGrow(newPages: nat32): nat32 { +export function stableGrow(newPages: nat64): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } - return Number(globalThis._azleIc.stableGrow(newPages.toString())); + return BigInt(globalThis._azleIc.stableGrow(newPages.toString())); } diff --git a/src/lib/ic/stable_read.ts b/src/lib/ic/stable_read.ts index 28e1a7d060..a0d89904af 100644 --- a/src/lib/ic/stable_read.ts +++ b/src/lib/ic/stable_read.ts @@ -1,14 +1,15 @@ -import { nat32 } from '../candid/types/primitive/nats/nat32'; +import { nat64 } from '../candid/types/primitive/nats/nat64'; /** * Reads data from the stable memory location specified by an offset + * Supports 64-bit addressed memory. * @param offset the location from which to read * @param length the length of buffer to read * @returns the raw bytes in stable memory */ -export function stableRead(offset: nat32, length: nat32): Uint8Array { +export function stableRead(offset: nat64, length: nat64): Uint8Array { if (globalThis._azleIc === undefined) { - return undefined as any; + return new Uint8Array(); } return new Uint8Array( diff --git a/src/lib/ic/stable_size.ts b/src/lib/ic/stable_size.ts index 0157145fc6..1ccd3cc43c 100644 --- a/src/lib/ic/stable_size.ts +++ b/src/lib/ic/stable_size.ts @@ -1,13 +1,14 @@ -import { nat32 } from '../candid/types/primitive/nats/nat32'; +import { nat64 } from '../candid/types/primitive/nats/nat64'; /** * Gets current size of the stable memory (in WASM pages) + * Supports 64-bit addressed memory. * @returns the current memory size */ -export function stableSize(): nat32 { +export function stableSize(): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } - return Number(globalThis._azleIc.stableSize()); + return BigInt(globalThis._azleIc.stableSize()); } diff --git a/src/lib/ic/stable_write.ts b/src/lib/ic/stable_write.ts index e44d3548cd..dd4afc31cc 100644 --- a/src/lib/ic/stable_write.ts +++ b/src/lib/ic/stable_write.ts @@ -1,8 +1,9 @@ import { blob } from '../candid/types/constructed/blob'; -import { nat32 } from '../candid/types/primitive/nats/nat32'; +import { nat64 } from '../candid/types/primitive/nats/nat64'; /** - * Writes data to the stable memory location specified by an offset + * Writes data to the stable memory location specified by an offset. + * Supports 64-bit addressed memory. * * **Warning:** this will panic if `offset` + `buffer.length` exceeds the * current size of stable memory. Use {@link ic.stableGrow} to request more @@ -10,9 +11,9 @@ import { nat32 } from '../candid/types/primitive/nats/nat32'; * @param offset the location at which to write * @param buffer the data to write */ -export function stableWrite(offset: nat32, buf: blob): void { +export function stableWrite(offset: nat64, buf: blob): void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } return globalThis._azleIc.stableWrite(offset.toString(), buf.buffer); diff --git a/src/lib/ic/time.ts b/src/lib/ic/time.ts index ce18b02de3..0255ad684f 100644 --- a/src/lib/ic/time.ts +++ b/src/lib/ic/time.ts @@ -6,7 +6,7 @@ import { nat64 } from '../candid/types/primitive/nats/nat64'; */ export function time(): nat64 { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt(globalThis._azleIc.time()); diff --git a/src/lib/ic/trap.ts b/src/lib/ic/trap.ts index ad12df7102..fe3f645481 100644 --- a/src/lib/ic/trap.ts +++ b/src/lib/ic/trap.ts @@ -8,7 +8,7 @@ import { text } from '../candid/types/primitive/text'; */ export function trap(message: text): empty { if (globalThis._azleIc === undefined) { - return undefined as never; + throw new Error(); } return globalThis._azleIc.trap(message); diff --git a/src/lib/ic/types/azle_ic.ts b/src/lib/ic/types/azle_ic.ts index 96e1b20076..aa52f44538 100644 --- a/src/lib/ic/types/azle_ic.ts +++ b/src/lib/ic/types/azle_ic.ts @@ -3,64 +3,49 @@ * we expose to the users. This is the interface for the rust functions. */ export type AzleIc = { - argDataRaw: () => ArrayBufferLike; + argDataRaw: () => ArrayBuffer; argDataRawSize: () => string; callRaw: ( promiseId: string, - canisterIdBytes: ArrayBufferLike, + canisterIdBytes: ArrayBuffer, method: string, - argsRaw: ArrayBufferLike, + argsRaw: ArrayBuffer, paymentString: string ) => void; - callRaw128: ( - promiseId: string, - canisterIdBytes: ArrayBufferLike, - method: string, - argsRaw: ArrayBufferLike, - paymentString: string - ) => void; - caller: () => ArrayBufferLike; + caller: () => ArrayBuffer; candidCompiler: (candidPath: string) => string; - candidDecode: (candidBytes: ArrayBufferLike) => string; - candidEncode: (candidString: string) => ArrayBufferLike; + candidDecode: (candidBytes: ArrayBuffer) => string; + candidEncode: (candidString: string) => ArrayBuffer; canisterBalance: () => string; - canisterBalance128: () => string; canisterVersion: () => string; clearTimer: (timerIdString: string) => void; - dataCertificate: () => ArrayBufferLike | undefined; + dataCertificate: () => ArrayBuffer | undefined; id: () => string; instructionCounter: () => string; - isController: (principalBytes: ArrayBufferLike) => boolean; + isController: (principalBytes: ArrayBuffer) => boolean; msgCyclesAccept: (maxAmountString: string) => string; - msgCyclesAccept128: (maxAmountString: string) => string; msgCyclesAvailable: () => string; - msgCyclesAvailable128: () => string; msgCyclesRefunded: () => string; - msgCyclesRefunded128: () => string; notifyRaw: ( - canisterIdBytes: ArrayBufferLike, + canisterIdBytes: ArrayBuffer, method: string, - argsRawBuffer: ArrayBufferLike, + argsRawBuffer: ArrayBuffer, paymentString: string ) => void; performanceCounter: (counterType: string) => string; rejectCode: () => string; - replyRaw: (bytes: ArrayBufferLike) => void; - setCertifiedData: (dataBytes: ArrayBufferLike) => void; + replyRaw: (bytes: ArrayBuffer) => void; + setCertifiedData: (dataBytes: ArrayBuffer) => void; setTimer: (delayString: string, timerCallbackId: string) => string; setTimerInterval: ( intervalString: string, timerCallbackId: string ) => string; - stableBytes: () => ArrayBufferLike; + stableBytes: () => ArrayBuffer; stableGrow: (newPages: string) => string; - stableRead: (offset: string, length: string) => ArrayBufferLike; + stableRead: (offset: string, length: string) => ArrayBuffer; stableSize: () => string; - stableWrite: (offset: string, buf: ArrayBufferLike) => void; - stable64Grow: (newPages: string) => string; - stable64Read: (offset: string, length: string) => ArrayBufferLike; - stable64Size: () => string; - stable64Write: (offset: string, buf: ArrayBufferLike) => void; + stableWrite: (offset: string, buf: ArrayBuffer) => void; time: () => string; // These calls aren't intercepted by our IC object, they go right to the // rust version and come out. Since they don't need to be intercepted I am @@ -76,23 +61,22 @@ export type AzleIc = { // corresponding raw version. The rust version is never called, we don't // have enough info about types to do so call: () => never; - call128: () => never; notify: () => never; reply: () => never; // Stable B Tree Map Functions stableBTreeMapInit: (memoryId: string) => void; stableBTreeMapContainsKey: ( memoryId: string, - encodedKey: ArrayBufferLike + encodedKey: ArrayBuffer ) => boolean; stableBTreeMapGet: ( memoryId: string, - encodedKey: ArrayBufferLike + encodedKey: ArrayBuffer ) => ArrayBuffer | undefined; stableBTreeMapInsert: ( memoryId: string, - encodedKey: ArrayBufferLike, - encodedValue: ArrayBufferLike + encodedKey: ArrayBuffer, + encodedValue: ArrayBuffer ) => ArrayBuffer | undefined; stableBTreeMapIsEmpty: (memoryId: string) => boolean; stableBTreeMapItems: ( @@ -108,7 +92,7 @@ export type AzleIc = { stableBTreeMapLen: (memoryId: string) => string; stableBTreeMapRemove( memoryId: string, - encodedKey: ArrayBufferLike + encodedKey: ArrayBuffer ): ArrayBuffer; stableBTreeMapValues: ( memoryId: string, diff --git a/src/lib/server.ts b/src/lib/server.ts index 8217cf62f2..6e94cb07dd 100644 --- a/src/lib/server.ts +++ b/src/lib/server.ts @@ -194,16 +194,16 @@ export async function httpHandler( } if (shouldUpgrade(httpRequest, query)) { - ic.reply( - { + ic.reply({ + data: { status_code: 204, headers: [], body: Uint8Array.from([]), streaming_strategy: None, upgrade: Some(true) }, - HttpResponse() - ); + candidType: HttpResponse() + }); return; } @@ -287,8 +287,8 @@ export async function httpHandler( // TODO this.res.getHeaders() seems to be missing some headers like Transfer-Encoding // TODO also Express in Node has more headers like Date, Connection, Keep-Alive // TODO Conection and Keep-Alive might just not make sense in our context - ic.reply( - { + ic.reply({ + data: { status_code: this.res.statusCode, headers: Object.entries(this.res.getHeaders()) .map((entry) => entry) @@ -310,8 +310,8 @@ export async function httpHandler( None: null } }, - HttpResponse() - ); + candidType: HttpResponse() + }); } } diff --git a/src/lib/stable/execute_with_candid_serde.ts b/src/lib/stable/execute_with_candid_serde.ts index 5cdfe1a435..cef7a68ee3 100644 --- a/src/lib/stable/execute_with_candid_serde.ts +++ b/src/lib/stable/execute_with_candid_serde.ts @@ -1,7 +1,7 @@ import { IDL } from '@dfinity/candid'; -import { ic } from '../ic'; import { handleUncaughtError } from './error'; +import { reply } from './ic_apis'; type CanisterMethodMode = | 'query' @@ -16,11 +16,11 @@ export function executeWithCandidSerde( mode: CanisterMethodMode, args: any[], callback: any, - paramIdls: IDL.Type[], - returnIdl: IDL.Type | undefined, + paramIdlTypes: IDL.Type[], + returnIdlType: IDL.Type | undefined, manual: boolean ): void { - const decodedArgs = IDL.decode(paramIdls, args[0]); + const decodedArgs = IDL.decode(paramIdlTypes, args[0]); const result = getResult(decodedArgs, callback); @@ -36,13 +36,7 @@ export function executeWithCandidSerde( result .then((result: any) => { if (!manual) { - if (returnIdl !== undefined) { - ic.replyRaw( - new Uint8Array(IDL.encode([returnIdl], [result])) - ); - } else { - ic.replyRaw(new Uint8Array(IDL.encode([], []))); - } + reply({ data: result, idlType: returnIdlType }); } }) .catch((error: any) => { @@ -50,11 +44,7 @@ export function executeWithCandidSerde( }); } else { if (!manual) { - if (returnIdl !== undefined) { - ic.replyRaw(new Uint8Array(IDL.encode([returnIdl], [result]))); - } else { - ic.replyRaw(new Uint8Array(IDL.encode([], []))); - } + reply({ data: result, idlType: returnIdlType }); } } } diff --git a/src/lib/stable/ic_apis/arg_data_raw.ts b/src/lib/stable/ic_apis/arg_data_raw.ts index 91ca958391..d27984e631 100644 --- a/src/lib/stable/ic_apis/arg_data_raw.ts +++ b/src/lib/stable/ic_apis/arg_data_raw.ts @@ -3,7 +3,7 @@ * @returns the argument data */ export function argDataRaw(): Uint8Array { - return globalThis._azleIc - ? new Uint8Array(globalThis._azleIc.argDataRaw()) - : (undefined as any); + return new Uint8Array( + globalThis._azleIc ? globalThis._azleIc.argDataRaw() : [] + ); } diff --git a/src/lib/stable/ic_apis/arg_data_raw_size.ts b/src/lib/stable/ic_apis/arg_data_raw_size.ts index ed5e1b23f3..ba22d91aeb 100644 --- a/src/lib/stable/ic_apis/arg_data_raw_size.ts +++ b/src/lib/stable/ic_apis/arg_data_raw_size.ts @@ -3,7 +3,5 @@ * @returns the data size */ export function argDataRawSize(): number { - return globalThis._azleIc - ? Number(globalThis._azleIc.argDataRawSize()) - : (undefined as any); + return globalThis._azleIc ? Number(globalThis._azleIc.argDataRawSize()) : 0; } diff --git a/src/lib/stable/ic_apis/call.ts b/src/lib/stable/ic_apis/call.ts index 6f982d8bdb..0643631f45 100644 --- a/src/lib/stable/ic_apis/call.ts +++ b/src/lib/stable/ic_apis/call.ts @@ -6,8 +6,8 @@ export async function call( canisterId: Principal | string, method: string, options?: { - paramIdls?: IDL.Type[]; - returnIdl?: IDL.Type; + paramIdlTypes?: IDL.Type[]; + returnIdlType?: IDL.Type; args?: any[]; payment?: bigint; raw?: Uint8Array; @@ -16,14 +16,14 @@ export async function call( // TODO this should use a Result remember return new Promise((resolve, reject) => { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } const promiseId = v4(); const globalResolveId = `_resolve_${promiseId}`; const globalRejectId = `_reject_${promiseId}`; - const returnIdl = options?.returnIdl; + const returnTypeIdl = options?.returnIdlType; const raw = options?.raw; // TODO perhaps we should be more robust @@ -34,10 +34,10 @@ export async function call( ): void => { if (raw !== undefined) { resolve(new Uint8Array(result)); - } else if (returnIdl === undefined) { - resolve(undefined); } else { - resolve(IDL.decode([returnIdl], result)[0]); + const idlType = + returnTypeIdl === undefined ? [] : [returnTypeIdl]; + resolve(IDL.decode(idlType, result)[0]); } delete globalThis._azleResolveIds[globalResolveId]; @@ -51,7 +51,7 @@ export async function call( delete globalThis._azleRejectIds[globalRejectId]; }; - const paramIdls = options?.paramIdls ?? []; + const paramIdlTypes = options?.paramIdlTypes ?? []; const args = options?.args ?? []; const payment = options?.payment ?? 0n; @@ -62,13 +62,13 @@ export async function call( const canisterIdBytes = canisterIdPrincipal.toUint8Array().buffer; const argsRawBuffer = raw === undefined - ? new Uint8Array(IDL.encode(paramIdls, args)).buffer + ? new Uint8Array(IDL.encode(paramIdlTypes, args)).buffer : raw.buffer; const paymentString = payment.toString(); // TODO consider finally, what if deletion goes wrong try { - globalThis._azleIc.callRaw128( + globalThis._azleIc.callRaw( promiseId, canisterIdBytes, method, diff --git a/src/lib/stable/ic_apis/caller.ts b/src/lib/stable/ic_apis/caller.ts index 655a928d5c..46bd7547c7 100644 --- a/src/lib/stable/ic_apis/caller.ts +++ b/src/lib/stable/ic_apis/caller.ts @@ -6,7 +6,7 @@ import { Principal } from '../'; */ export function caller(): Principal { if (globalThis._azleIc === undefined) { - return undefined as any; + return Principal.fromHex('04'); } const callerBytes = globalThis._azleIc.caller(); diff --git a/src/lib/stable/ic_apis/candid_compiler.ts b/src/lib/stable/ic_apis/candid_compiler.ts index a9c3b27a56..623bfee08d 100644 --- a/src/lib/stable/ic_apis/candid_compiler.ts +++ b/src/lib/stable/ic_apis/candid_compiler.ts @@ -5,7 +5,7 @@ */ export function candidCompiler(candidPath: string): string { if (globalThis._azleIc === undefined) { - return undefined as any; + return ''; } return globalThis._azleIc.candidCompiler(candidPath); diff --git a/src/lib/stable/ic_apis/candid_decode.ts b/src/lib/stable/ic_apis/candid_decode.ts index 363fa47f58..59f5d9f150 100644 --- a/src/lib/stable/ic_apis/candid_decode.ts +++ b/src/lib/stable/ic_apis/candid_decode.ts @@ -5,7 +5,7 @@ */ export function candidDecode(candidEncoded: Uint8Array): string { if (globalThis._azleIc === undefined) { - return undefined as any; + return ''; } return globalThis._azleIc.candidDecode(candidEncoded.buffer); diff --git a/src/lib/stable/ic_apis/candid_encode.ts b/src/lib/stable/ic_apis/candid_encode.ts index 07fc619071..2d514df12c 100644 --- a/src/lib/stable/ic_apis/candid_encode.ts +++ b/src/lib/stable/ic_apis/candid_encode.ts @@ -4,9 +4,7 @@ * @returns the candid value as bytes */ export function candidEncode(candidString: string): Uint8Array { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return new Uint8Array(globalThis._azleIc.candidEncode(candidString)); + return new Uint8Array( + globalThis._azleIc ? globalThis._azleIc.candidEncode(candidString) : [] + ); } diff --git a/src/lib/stable/ic_apis/canister_balance.ts b/src/lib/stable/ic_apis/canister_balance.ts index 24fb7f7f72..80e1fd7dcd 100644 --- a/src/lib/stable/ic_apis/canister_balance.ts +++ b/src/lib/stable/ic_apis/canister_balance.ts @@ -4,7 +4,7 @@ */ export function canisterBalance(): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt(globalThis._azleIc.canisterBalance()); diff --git a/src/lib/stable/ic_apis/canister_balance_128.ts b/src/lib/stable/ic_apis/canister_balance_128.ts deleted file mode 100644 index c46d525bf2..0000000000 --- a/src/lib/stable/ic_apis/canister_balance_128.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Gets the amount of funds available in the canister - * @returns the number of cycles in the canister - */ -export function canisterBalance128(): bigint { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return BigInt(globalThis._azleIc.canisterBalance128()); -} diff --git a/src/lib/stable/ic_apis/canister_version.ts b/src/lib/stable/ic_apis/canister_version.ts index 8a32f1533d..f8f968a467 100644 --- a/src/lib/stable/ic_apis/canister_version.ts +++ b/src/lib/stable/ic_apis/canister_version.ts @@ -5,7 +5,7 @@ */ export function canisterVersion(): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt(globalThis._azleIc.canisterVersion()); diff --git a/src/lib/stable/ic_apis/chunk.ts b/src/lib/stable/ic_apis/chunk.ts index 60016797e9..dedf4280ec 100644 --- a/src/lib/stable/ic_apis/chunk.ts +++ b/src/lib/stable/ic_apis/chunk.ts @@ -4,7 +4,7 @@ import { id } from './id'; export async function chunk(): Promise { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } await call(id(), '_azle_chunk', { raw: candidEncode('()'), payment: 0n }); diff --git a/src/lib/stable/ic_apis/clear_timer.ts b/src/lib/stable/ic_apis/clear_timer.ts index 56c4d391c2..de53b2000b 100644 --- a/src/lib/stable/ic_apis/clear_timer.ts +++ b/src/lib/stable/ic_apis/clear_timer.ts @@ -4,7 +4,7 @@ */ export function clearTimer(timerId: bigint): void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } globalThis._azleIc.clearTimer(timerId.toString()); diff --git a/src/lib/stable/ic_apis/data_certificate.ts b/src/lib/stable/ic_apis/data_certificate.ts index 3486c824c7..5c8133f7f9 100644 --- a/src/lib/stable/ic_apis/data_certificate.ts +++ b/src/lib/stable/ic_apis/data_certificate.ts @@ -6,7 +6,7 @@ */ export function dataCertificate(): [Uint8Array] | [] { if (globalThis._azleIc === undefined) { - return undefined as any; + return []; } const rawRustValue = globalThis._azleIc.dataCertificate(); diff --git a/src/lib/stable/ic_apis/id.ts b/src/lib/stable/ic_apis/id.ts index 4503b53688..2022f73834 100644 --- a/src/lib/stable/ic_apis/id.ts +++ b/src/lib/stable/ic_apis/id.ts @@ -6,7 +6,7 @@ import { Principal } from '..'; */ export function id(): Principal { if (globalThis._azleIc === undefined) { - return undefined as any; + return Principal.fromHex('04'); } // TODO consider bytes instead of string, just like with caller diff --git a/src/lib/stable/ic_apis/index.ts b/src/lib/stable/ic_apis/index.ts index ac6aa3eb86..5c53a6edeb 100644 --- a/src/lib/stable/ic_apis/index.ts +++ b/src/lib/stable/ic_apis/index.ts @@ -7,7 +7,6 @@ export { candidCompiler } from './candid_compiler'; export { candidDecode } from './candid_decode'; export { candidEncode } from './candid_encode'; export { canisterBalance } from './canister_balance'; -export { canisterBalance128 } from './canister_balance_128'; export { canisterVersion } from './canister_version'; export { chunk } from './chunk'; export { clearTimer } from './clear_timer'; @@ -17,28 +16,19 @@ export { instructionCounter } from './instruction_counter'; export { isController } from './is_controller'; export { methodName } from './method_name'; export { msgCyclesAccept } from './msg_cycles_accept'; -export { msgCyclesAccept128 } from './msg_cycles_accept_128'; export { msgCyclesAvailable } from './msg_cycles_available'; -export { msgCyclesAvailable128 } from './msg_cycles_available_128'; export { msgCyclesRefunded } from './msg_cycles_refunded'; -export { msgCyclesRefunded128 } from './msg_cycles_refunded_128'; export { notify } from './notify'; -export { notifyRaw } from './notify_raw'; export { performanceCounter } from './performance_counter'; export { print } from './print'; export { reject } from './reject'; export { rejectCode } from './reject_code'; export { rejectMessage } from './reject_message'; export { reply } from './reply'; -export { replyRaw } from './reply_raw'; export { setCertifiedData } from './set_certified_data'; export { setOutgoingHttpOptions } from './set_outgoing_http_options'; export { setTimer } from './set_timer'; export { setTimerInterval } from './set_timer_interval'; -export { stable64Grow } from './stable_64_grow'; -export { stable64Read } from './stable_64_read'; -export { stable64Size } from './stable_64_size'; -export { stable64Write } from './stable_64_write'; export { stableBytes } from './stable_bytes'; export { stableGrow } from './stable_grow'; export { stableRead } from './stable_read'; diff --git a/src/lib/stable/ic_apis/instruction_counter.ts b/src/lib/stable/ic_apis/instruction_counter.ts index 87cb77844d..a183d6b488 100644 --- a/src/lib/stable/ic_apis/instruction_counter.ts +++ b/src/lib/stable/ic_apis/instruction_counter.ts @@ -8,7 +8,7 @@ */ export function instructionCounter(): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt(globalThis._azleIc.instructionCounter()); diff --git a/src/lib/stable/ic_apis/is_controller.ts b/src/lib/stable/ic_apis/is_controller.ts index 8e95e698c8..781c972327 100644 --- a/src/lib/stable/ic_apis/is_controller.ts +++ b/src/lib/stable/ic_apis/is_controller.ts @@ -3,7 +3,7 @@ import { Principal } from '../'; /** Determine if a {@link Principal} is a controller of the canister. */ export function isController(principal: Principal): boolean { if (globalThis._azleIc === undefined) { - return undefined as any; + return false; } return globalThis._azleIc.isController(principal.toUint8Array().buffer); diff --git a/src/lib/stable/ic_apis/method_name.ts b/src/lib/stable/ic_apis/method_name.ts index 39c3128d44..4a9b9f206d 100644 --- a/src/lib/stable/ic_apis/method_name.ts +++ b/src/lib/stable/ic_apis/method_name.ts @@ -3,7 +3,5 @@ * @returns the current canister method */ export function methodName(): string { - return globalThis._azleIc - ? globalThis._azleIc.methodName() - : (undefined as any); + return globalThis._azleIc ? globalThis._azleIc.methodName() : ''; } diff --git a/src/lib/stable/ic_apis/msg_cycles_accept.ts b/src/lib/stable/ic_apis/msg_cycles_accept.ts index f204127dab..1b1be65179 100644 --- a/src/lib/stable/ic_apis/msg_cycles_accept.ts +++ b/src/lib/stable/ic_apis/msg_cycles_accept.ts @@ -5,7 +5,7 @@ */ export function msgCyclesAccept(maxAmount: bigint): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const msgCyclesAcceptAmountMovedString = globalThis._azleIc.msgCyclesAccept( diff --git a/src/lib/stable/ic_apis/msg_cycles_accept_128.ts b/src/lib/stable/ic_apis/msg_cycles_accept_128.ts deleted file mode 100644 index 95894da409..0000000000 --- a/src/lib/stable/ic_apis/msg_cycles_accept_128.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Moves cycles from the call to the canister balance - * @param maxAmount the max amount of cycles to move - * @returns the actual amount moved - */ -export function msgCyclesAccept128(maxAmount: bigint): bigint { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - const msgCyclesAccept128AmountMovedString = - globalThis._azleIc.msgCyclesAccept128(maxAmount.toString()); - - return BigInt(msgCyclesAccept128AmountMovedString); -} diff --git a/src/lib/stable/ic_apis/msg_cycles_available.ts b/src/lib/stable/ic_apis/msg_cycles_available.ts index 58b8d21569..c006c93b24 100644 --- a/src/lib/stable/ic_apis/msg_cycles_available.ts +++ b/src/lib/stable/ic_apis/msg_cycles_available.ts @@ -5,7 +5,7 @@ */ export function msgCyclesAvailable(): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const msgCyclesAvailableAmountString = diff --git a/src/lib/stable/ic_apis/msg_cycles_available_128.ts b/src/lib/stable/ic_apis/msg_cycles_available_128.ts deleted file mode 100644 index 891d9b1cf1..0000000000 --- a/src/lib/stable/ic_apis/msg_cycles_available_128.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Returns the amount of cycles that were transferred by the caller of the - * current call, and is still available in this message - * @returns the amount of cycles - */ -export function msgCyclesAvailable128(): bigint { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - const msgCyclesAvailable128AmountString = - globalThis._azleIc.msgCyclesAvailable128(); - - return BigInt(msgCyclesAvailable128AmountString); -} diff --git a/src/lib/stable/ic_apis/msg_cycles_refunded.ts b/src/lib/stable/ic_apis/msg_cycles_refunded.ts index ac5ff4c02a..f7efc3567a 100644 --- a/src/lib/stable/ic_apis/msg_cycles_refunded.ts +++ b/src/lib/stable/ic_apis/msg_cycles_refunded.ts @@ -5,7 +5,7 @@ */ export function msgCyclesRefunded(): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const msgCyclesRefundedAmountString = diff --git a/src/lib/stable/ic_apis/msg_cycles_refunded_128.ts b/src/lib/stable/ic_apis/msg_cycles_refunded_128.ts deleted file mode 100644 index cb42f079dd..0000000000 --- a/src/lib/stable/ic_apis/msg_cycles_refunded_128.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Returns the amount of cycles that came back with the response as a refund. - * The refund has already been added to the canister balance automatically. - * @returns the amount of cycles - */ -export function msgCyclesRefunded128(): bigint { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - const msgCyclesRefunded128AmountString = - globalThis._azleIc.msgCyclesRefunded128(); - - return BigInt(msgCyclesRefunded128AmountString); -} diff --git a/src/lib/stable/ic_apis/notify.ts b/src/lib/stable/ic_apis/notify.ts index 0b1aee7b37..878244e26a 100644 --- a/src/lib/stable/ic_apis/notify.ts +++ b/src/lib/stable/ic_apis/notify.ts @@ -12,25 +12,30 @@ export function notify( canisterId: Principal | string, method: string, options?: { - paramIdls?: IDL.Type[]; + paramIdlTypes?: IDL.Type[]; args?: any[]; payment?: bigint; + raw?: Uint8Array; } ): void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } - const paramIdls = options?.paramIdls ?? []; + const paramIdlTypes = options?.paramIdlTypes ?? []; const args = options?.args ?? []; const payment = options?.payment ?? 0n; + const raw = options?.raw; const canisterIdPrincipal = typeof canisterId === 'string' ? Principal.fromText(canisterId) : canisterId; const canisterIdBytes = canisterIdPrincipal.toUint8Array().buffer; - const argsRawBuffer = new Uint8Array(IDL.encode(paramIdls, args)).buffer; + const argsRawBuffer = + raw === undefined + ? new Uint8Array(IDL.encode(paramIdlTypes, args)).buffer + : raw.buffer; const paymentString = payment.toString(); return globalThis._azleIc.notifyRaw( diff --git a/src/lib/stable/ic_apis/notify_raw.ts b/src/lib/stable/ic_apis/notify_raw.ts deleted file mode 100644 index de706b66f0..0000000000 --- a/src/lib/stable/ic_apis/notify_raw.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Principal } from '../'; - -/** - * Like notify, but sends the argument as raw bytes, skipping Candid serialization. - * @param canisterId - * @param method - * @param argsRaw - * @param payment - * @returns - */ -export function notifyRaw( - canisterId: Principal, - method: string, - argsRaw: Uint8Array, - payment: bigint -): void { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - const canisterIdBytes = canisterId.toUint8Array().buffer; - const argsRawBuffer = argsRaw.buffer; - const paymentString = payment.toString(); - - return globalThis._azleIc.notifyRaw( - canisterIdBytes, - method, - argsRawBuffer, - paymentString - ); -} diff --git a/src/lib/stable/ic_apis/performance_counter.ts b/src/lib/stable/ic_apis/performance_counter.ts index 8ef6fd20ad..0e8553be3d 100644 --- a/src/lib/stable/ic_apis/performance_counter.ts +++ b/src/lib/stable/ic_apis/performance_counter.ts @@ -9,7 +9,7 @@ */ export function performanceCounter(counterType: number): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt( diff --git a/src/lib/stable/ic_apis/reject_code.ts b/src/lib/stable/ic_apis/reject_code.ts index cad186ab33..5a9d514cfc 100644 --- a/src/lib/stable/ic_apis/reject_code.ts +++ b/src/lib/stable/ic_apis/reject_code.ts @@ -1,4 +1,25 @@ -import { RejectionCode } from '../system_types'; +type RejectionCode = + | { + NoError: null; + } + | { + SysFatal: null; + } + | { + SysTransient: null; + } + | { + DestinationInvalid: null; + } + | { + CanisterReject: null; + } + | { + CanisterError: null; + } + | { + Unknown: null; + }; /** * Returns the rejection code from the most recently executed cross-canister @@ -7,7 +28,7 @@ import { RejectionCode } from '../system_types'; */ export function rejectCode(): RejectionCode { if (globalThis._azleIc === undefined) { - return undefined as any; + return { Unknown: null }; } const rejectCodeNumber = Number(globalThis._azleIc.rejectCode()); diff --git a/src/lib/stable/ic_apis/reject_message.ts b/src/lib/stable/ic_apis/reject_message.ts index 3dd1851cfb..ca627735e2 100644 --- a/src/lib/stable/ic_apis/reject_message.ts +++ b/src/lib/stable/ic_apis/reject_message.ts @@ -11,7 +11,5 @@ import { rejectCode } from './reject_code'; // Used for links in comments * @returns the rejection message */ export function rejectMessage(): string { - return globalThis._azleIc - ? globalThis._azleIc.rejectMessage() - : (undefined as any); + return globalThis._azleIc ? globalThis._azleIc.rejectMessage() : ''; } diff --git a/src/lib/stable/ic_apis/reply.ts b/src/lib/stable/ic_apis/reply.ts index 28e24534a1..9c26771436 100644 --- a/src/lib/stable/ic_apis/reply.ts +++ b/src/lib/stable/ic_apis/reply.ts @@ -1,5 +1,14 @@ import { IDL } from '..'; +type ReplyInput = + | { + data: T; + idlType?: IDL.Type; + } + | { + raw: Uint8Array; + }; + /** * Used to manually reply to an ingress message. Intended to be used in * canister methods with a {@link Manual} return type. @@ -7,15 +16,21 @@ import { IDL } from '..'; * is the generic type supplied to `Manual`. Otherwise will result in an * uncaught `TypeError`. */ -export function reply(data: T, type?: IDL.Type): void { +export function reply(input: ReplyInput): void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } - const encoded = - type === undefined - ? new Uint8Array(IDL.encode([], [])).buffer - : new Uint8Array(IDL.encode([type], [data])).buffer; + if ('raw' in input) { + return globalThis._azleIc.replyRaw(input.raw.buffer); + } else { + const idlType = input.idlType === undefined ? [] : [input.idlType]; + const data = + input.data === undefined && input.idlType === undefined + ? [] + : [input.data]; - return globalThis._azleIc.replyRaw(encoded); + // @ts-expect-error idl.d.ts specifies the wrong type for IDL.encode. It's actually a Uint8Array + return globalThis._azleIc.replyRaw(IDL.encode(idlType, data).buffer); + } } diff --git a/src/lib/stable/ic_apis/reply_raw.ts b/src/lib/stable/ic_apis/reply_raw.ts deleted file mode 100644 index 26c1b06804..0000000000 --- a/src/lib/stable/ic_apis/reply_raw.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Used to manually reply to an ingress message. Intended to be used in - * canister methods with a {@link Manual} return type. - * @param buf the value with which to reply. Intended to be used in conjunction with - * {@link ic.candidEncode}. - * @example - * ```ts - * $update; - * export function replyRaw(): Manual { - * ic.replyRaw( - * ic.candidEncode( - * '(record { "int" = 42; "text" = "text"; "bool" = true; "blob" = blob "raw bytes"; "variant" = variant { Medium } })' - * ) - * ); - * } - * ``` - */ -export function replyRaw(replyBuffer: Uint8Array): void { - return globalThis._azleIc - ? globalThis._azleIc.replyRaw(replyBuffer.buffer) - : undefined; -} diff --git a/src/lib/stable/ic_apis/set_certified_data.ts b/src/lib/stable/ic_apis/set_certified_data.ts index 481bbc5aca..85b2083f5f 100644 --- a/src/lib/stable/ic_apis/set_certified_data.ts +++ b/src/lib/stable/ic_apis/set_certified_data.ts @@ -22,7 +22,7 @@ */ export function setCertifiedData(data: Uint8Array): void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } return globalThis._azleIc.setCertifiedData(data.buffer); diff --git a/src/lib/stable/ic_apis/set_timer.ts b/src/lib/stable/ic_apis/set_timer.ts index a53be1123e..ce1a78192d 100644 --- a/src/lib/stable/ic_apis/set_timer.ts +++ b/src/lib/stable/ic_apis/set_timer.ts @@ -14,7 +14,7 @@ export function setTimer( callback: () => void | Promise ): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const timerCallbackId = `_timer_${v4()}`; diff --git a/src/lib/stable/ic_apis/set_timer_interval.ts b/src/lib/stable/ic_apis/set_timer_interval.ts index b3d518c42a..c6d6e0cc43 100644 --- a/src/lib/stable/ic_apis/set_timer_interval.ts +++ b/src/lib/stable/ic_apis/set_timer_interval.ts @@ -14,7 +14,7 @@ export function setTimerInterval( callback: () => void | Promise ): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } const timerCallbackId = `_interval_timer_${v4()}`; diff --git a/src/lib/stable/ic_apis/stable_64_grow.ts b/src/lib/stable/ic_apis/stable_64_grow.ts deleted file mode 100644 index d43a0a0830..0000000000 --- a/src/lib/stable/ic_apis/stable_64_grow.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Attempts to grow the stable memory by `newPages`. - * Supports 64-bit addressed memory. - * @param newPages - * @returns the previous size that was reserved. - */ -export function stable64Grow(newPages: bigint): bigint { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return BigInt(globalThis._azleIc.stable64Grow(newPages.toString())); -} diff --git a/src/lib/stable/ic_apis/stable_64_read.ts b/src/lib/stable/ic_apis/stable_64_read.ts deleted file mode 100644 index f6870bf7a9..0000000000 --- a/src/lib/stable/ic_apis/stable_64_read.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Reads data from the stable memory location specified by an offset. - * Supports 64-bit addressed memory. - * @param offset the location from which to read - * @param length the length of buffer to read - * @returns the raw bytes in stable memory - */ -export function stable64Read(offset: bigint, length: bigint): Uint8Array { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return new Uint8Array( - globalThis._azleIc.stable64Read(offset.toString(), length.toString()) - ); -} diff --git a/src/lib/stable/ic_apis/stable_64_size.ts b/src/lib/stable/ic_apis/stable_64_size.ts deleted file mode 100644 index 8b24f6c2a5..0000000000 --- a/src/lib/stable/ic_apis/stable_64_size.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Gets current size of the stable memory (in WASM pages). Supports 64-bit - * addressed memory. - * @returns the current memory size - */ -export function stable64Size(): bigint { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return BigInt(globalThis._azleIc.stable64Size()); -} diff --git a/src/lib/stable/ic_apis/stable_64_write.ts b/src/lib/stable/ic_apis/stable_64_write.ts deleted file mode 100644 index 19e3ca06c2..0000000000 --- a/src/lib/stable/ic_apis/stable_64_write.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Writes data to the stable memory location specified by an offset. - * Supports 64-bit addressed memory. - * - * **Warning:** this will panic if `offset` + `buffer.length` exceeds the - * current size of stable memory. Use {@link ic.stable64Grow} to request - * more stable memory if needed. - * @param offset the location at which to write - * @param buffer the data to write - */ -export function stable64Write(offset: bigint, buf: Uint8Array): void { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return globalThis._azleIc.stable64Write(offset.toString(), buf.buffer); -} diff --git a/src/lib/stable/ic_apis/stable_bytes.ts b/src/lib/stable/ic_apis/stable_bytes.ts index fa39acccd3..8e214a7fb5 100644 --- a/src/lib/stable/ic_apis/stable_bytes.ts +++ b/src/lib/stable/ic_apis/stable_bytes.ts @@ -6,9 +6,7 @@ * @returns a copy of the stable memory */ export function stableBytes(): Uint8Array { - if (globalThis._azleIc === undefined) { - return undefined as any; - } - - return new Uint8Array(globalThis._azleIc.stableBytes()); + return new Uint8Array( + globalThis._azleIc ? globalThis._azleIc.stableBytes() : [] + ); } diff --git a/src/lib/stable/ic_apis/stable_grow.ts b/src/lib/stable/ic_apis/stable_grow.ts index 91df34cb4f..02168162b7 100644 --- a/src/lib/stable/ic_apis/stable_grow.ts +++ b/src/lib/stable/ic_apis/stable_grow.ts @@ -1,12 +1,13 @@ /** * Attempts to grow the stable memory by `newPages`. + * Supports 64-bit addressed memory. * @param newPages * @returns the previous size that was reserved. */ -export function stableGrow(newPages: number): number { +export function stableGrow(newPages: bigint): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } - return Number(globalThis._azleIc.stableGrow(newPages.toString())); + return BigInt(globalThis._azleIc.stableGrow(newPages.toString())); } diff --git a/src/lib/stable/ic_apis/stable_read.ts b/src/lib/stable/ic_apis/stable_read.ts index 70145aa27f..f1d68549e0 100644 --- a/src/lib/stable/ic_apis/stable_read.ts +++ b/src/lib/stable/ic_apis/stable_read.ts @@ -1,12 +1,13 @@ /** - * Reads data from the stable memory location specified by an offset + * Reads data from the stable memory location specified by an offset. + * Supports 64-bit addressed memory. * @param offset the location from which to read * @param length the length of buffer to read * @returns the raw bytes in stable memory */ -export function stableRead(offset: number, length: number): Uint8Array { +export function stableRead(offset: bigint, length: bigint): Uint8Array { if (globalThis._azleIc === undefined) { - return undefined as any; + return new Uint8Array(); } return new Uint8Array( diff --git a/src/lib/stable/ic_apis/stable_size.ts b/src/lib/stable/ic_apis/stable_size.ts index c738eeb01c..3d140161ca 100644 --- a/src/lib/stable/ic_apis/stable_size.ts +++ b/src/lib/stable/ic_apis/stable_size.ts @@ -1,11 +1,12 @@ /** - * Gets current size of the stable memory (in WASM pages) + * Gets current size of the stable memory (in WASM pages). Supports 64-bit + * addressed memory. * @returns the current memory size */ -export function stableSize(): number { +export function stableSize(): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } - return Number(globalThis._azleIc.stableSize()); + return BigInt(globalThis._azleIc.stableSize()); } diff --git a/src/lib/stable/ic_apis/stable_write.ts b/src/lib/stable/ic_apis/stable_write.ts index a3922d6ebb..dc0ca27f6a 100644 --- a/src/lib/stable/ic_apis/stable_write.ts +++ b/src/lib/stable/ic_apis/stable_write.ts @@ -1,15 +1,16 @@ /** - * Writes data to the stable memory location specified by an offset + * Writes data to the stable memory location specified by an offset. + * Supports 64-bit addressed memory. * * **Warning:** this will panic if `offset` + `buffer.length` exceeds the - * current size of stable memory. Use {@link ic.stableGrow} to request more - * stable memory if needed. + * current size of stable memory. Use {@link stableGrow} to request + * more stable memory if needed. * @param offset the location at which to write * @param buffer the data to write */ -export function stableWrite(offset: number, buf: Uint8Array): void { +export function stableWrite(offset: bigint, buf: Uint8Array): void { if (globalThis._azleIc === undefined) { - return undefined as any; + return undefined; } return globalThis._azleIc.stableWrite(offset.toString(), buf.buffer); diff --git a/src/lib/stable/ic_apis/time.ts b/src/lib/stable/ic_apis/time.ts index e25887c304..e294b7616a 100644 --- a/src/lib/stable/ic_apis/time.ts +++ b/src/lib/stable/ic_apis/time.ts @@ -4,7 +4,7 @@ */ export function time(): bigint { if (globalThis._azleIc === undefined) { - return undefined as any; + return 0n; } return BigInt(globalThis._azleIc.time()); diff --git a/src/lib/stable/ic_apis/trap.ts b/src/lib/stable/ic_apis/trap.ts index 54512b2fcf..323e46e597 100644 --- a/src/lib/stable/ic_apis/trap.ts +++ b/src/lib/stable/ic_apis/trap.ts @@ -5,7 +5,7 @@ */ export function trap(message: string): never { if (globalThis._azleIc === undefined) { - return undefined as never; + throw new Error(); } return globalThis._azleIc.trap(message); diff --git a/src/lib/stable/index.ts b/src/lib/stable/index.ts index 5e9a4e3b8b..5cb984d995 100644 --- a/src/lib/stable/index.ts +++ b/src/lib/stable/index.ts @@ -8,7 +8,6 @@ export { inspectMessage } from './inspect_message'; export { postUpgrade } from './post_upgrade'; export { preUpgrade } from './pre_upgrade'; export { query } from './query'; -export * from './system_types'; export { update } from './update'; export * from '@dfinity/candid'; export * from '@dfinity/principal'; diff --git a/src/lib/stable/system_types/index.ts b/src/lib/stable/system_types/index.ts deleted file mode 100644 index 3cb190fab4..0000000000 --- a/src/lib/stable/system_types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './rejection_code'; -export * from './result'; diff --git a/src/lib/stable/system_types/rejection_code.ts b/src/lib/stable/system_types/rejection_code.ts deleted file mode 100644 index 5d7d29a98c..0000000000 --- a/src/lib/stable/system_types/rejection_code.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { IDL } from '@dfinity/candid'; - -/** - * Indicates an error was encountered during a canister method. - */ -export const RejectionCode = IDL.Variant({ - NoError: IDL.Null, - SysFatal: IDL.Null, - SysTransient: IDL.Null, - DestinationInvalid: IDL.Null, - CanisterReject: IDL.Null, - CanisterError: IDL.Null, - Unknown: IDL.Null -}); - -export type RejectionCode = - | { - NoError: null; - } - | { - SysFatal: null; - } - | { - SysTransient: null; - } - | { - DestinationInvalid: null; - } - | { - CanisterReject: null; - } - | { - CanisterError: null; - } - | { - Unknown: null; - }; diff --git a/src/lib/stable/system_types/result.ts b/src/lib/stable/system_types/result.ts deleted file mode 100644 index c4e9225958..0000000000 --- a/src/lib/stable/system_types/result.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IDL } from '..'; - -export function Result, E extends IDL.Type>( - Ok: T, - Err: E -): IDL.VariantClass { - return IDL.Variant({ - Ok: Ok, - Err: Err - }); -} - -export type Result = - | { - Ok: Ok; - } - | { - Err: Err; - }; diff --git a/src/lib/system_types/result.ts b/src/lib/system_types/result.ts index ec88cb8f87..5f0c37e099 100644 --- a/src/lib/system_types/result.ts +++ b/src/lib/system_types/result.ts @@ -1,7 +1,7 @@ import { IDL } from '@dfinity/candid'; import { CandidType } from '../candid/candid_type'; -import { Parent, toIdl } from '../candid/to_idl'; +import { Parent, toIdlType } from '../candid/to_idl_type'; import { RequireExactlyOne } from '../candid/types/constructed/variant'; export class AzleResult { @@ -13,10 +13,10 @@ export class AzleResult { Ok: T; Err: K; - getIdl(parents: Parent[]): IDL.VariantClass { + getIdlType(parents: Parent[]): IDL.VariantClass { return IDL.Variant({ - Ok: toIdl(this.Ok, parents), - Err: toIdl(this.Err, parents) + Ok: toIdlType(this.Ok, parents), + Err: toIdlType(this.Err, parents) }); } } diff --git a/static_canister_template.wasm b/static_canister_template.wasm index ca1af6757c..76bc1f26b4 100644 Binary files a/static_canister_template.wasm and b/static_canister_template.wasm differ diff --git a/tests/end_to_end/candid_rpc/class_syntax/async_await/src/async_await.ts b/tests/end_to_end/candid_rpc/class_syntax/async_await/src/async_await.ts index 130312d53d..b7930cd0bc 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/async_await/src/async_await.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/async_await/src/async_await.ts @@ -4,7 +4,7 @@ export default class { @update([], IDL.Vec(IDL.Nat8)) async getRandomnessDirectly(): Promise { return await call('aaaaa-aa', 'raw_rand', { - returnIdl: IDL.Vec(IDL.Nat8) + returnIdlType: IDL.Vec(IDL.Nat8) }); } @@ -28,7 +28,9 @@ export default class { @update([]) async returnPromiseVoid(): Promise { - await call('aaaaa-aa', 'raw_rand', { returnIdl: IDL.Vec(IDL.Nat8) }); + await call('aaaaa-aa', 'raw_rand', { + returnIdlType: IDL.Vec(IDL.Nat8) + }); } } @@ -45,5 +47,7 @@ async function getRandomnessLevel2(): Promise { } async function getRandomness(): Promise { - return await call('aaaaa-aa', 'raw_rand', { returnIdl: IDL.Vec(IDL.Nat8) }); + return await call('aaaaa-aa', 'raw_rand', { + returnIdlType: IDL.Vec(IDL.Nat8) + }); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/bitcoin/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/bitcoin/src/index.ts index 913eeda987..bcf121a5eb 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/bitcoin/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/bitcoin/src/index.ts @@ -17,8 +17,8 @@ export default class { @update([IDL.Text], Satoshi) async getBalance(address: string): Promise { return await call('aaaaa-aa', 'bitcoin_get_balance', { - paramIdls: [GetBalanceArgs], - returnIdl: Satoshi, + paramIdlTypes: [GetBalanceArgs], + returnIdlType: Satoshi, args: [ { address, @@ -33,8 +33,8 @@ export default class { @update([], IDL.Vec(MillisatoshiPerByte)) async getCurrentFeePercentiles(): Promise { return await call('aaaaa-aa', 'bitcoin_get_current_fee_percentiles', { - paramIdls: [GetCurrentFeePercentilesArgs], - returnIdl: IDL.Vec(MillisatoshiPerByte), + paramIdlTypes: [GetCurrentFeePercentilesArgs], + returnIdlType: IDL.Vec(MillisatoshiPerByte), args: [ { network: { regtest: null } @@ -47,8 +47,8 @@ export default class { @update([IDL.Text], GetUtxosResult) async getUtxos(address: string): Promise { return await call('aaaaa-aa', 'bitcoin_get_utxos', { - paramIdls: [GetUtxosArgs], - returnIdl: GetUtxosResult, + paramIdlTypes: [GetUtxosArgs], + returnIdlType: GetUtxosResult, args: [ { address, @@ -68,7 +68,7 @@ export default class { BITCOIN_CYCLE_COST_PER_TRANSACTION_BYTE; await call('aaaaa-aa', 'bitcoin_send_transaction', { - paramIdls: [SendTransactionArgs], + paramIdlTypes: [SendTransactionArgs], args: [ { transaction, diff --git a/tests/end_to_end/candid_rpc/class_syntax/call_raw/src/index.did b/tests/end_to_end/candid_rpc/class_syntax/call_raw/src/index.did index 0c6104d934..e4f21bbc36 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/call_raw/src/index.did +++ b/tests/end_to_end/candid_rpc/class_syntax/call_raw/src/index.did @@ -1,4 +1,3 @@ service: () -> { executeCallRaw: (principal, text, text, nat64) -> (text); - executeCallRaw128: (principal, text, text, nat) -> (text); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/call_raw/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/call_raw/src/index.ts index 74fc2b1b63..eaa0968425 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/call_raw/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/call_raw/src/index.ts @@ -15,19 +15,4 @@ export default class { return candidDecode(result); } - - @update([IDL.Principal, IDL.Text, IDL.Text, IDL.Nat], IDL.Text) - async executeCallRaw128( - canisterId: Principal, - method: string, - candidArgs: string, - payment: bigint - ): Promise { - const result = await call(canisterId, method, { - raw: candidEncode(candidArgs), - payment - }); - - return candidDecode(result); - } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/canister/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/canister/src/index.ts index abcbac72a4..5455d2035e 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/canister/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/canister/src/index.ts @@ -34,7 +34,7 @@ export default class { @update([Canister], IDL.Text) async canisterCrossCanisterCall(someCanister: Canister): Promise { - return await call(someCanister, 'update1', { returnIdl: IDL.Text }); + return await call(someCanister, 'update1', { returnIdlType: IDL.Text }); } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/ckbtc/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/ckbtc/package-lock.json index bfd91dd411..6a91d7457c 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/ckbtc/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/ckbtc/package-lock.json @@ -14,7 +14,7 @@ "ckbtc_end_to_end_test_functional_syntax": "file:../../../../../examples/ckbtc", "jest": "^29.7.0", "ts-jest": "^29.1.4", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -30,7 +30,7 @@ "@dfinity/identity": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.4", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -771,6 +771,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1487,6 +1503,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3387,6 +3405,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5105,6 +5135,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5493,6 +5532,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5536,6 +5577,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -5548,6 +5591,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -5651,7 +6103,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.2.0", diff --git a/tests/end_to_end/candid_rpc/class_syntax/ckbtc/wallet/backend/index.ts b/tests/end_to_end/candid_rpc/class_syntax/ckbtc/wallet/backend/index.ts index 359bdfc37a..ef7c1a3f07 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/ckbtc/wallet/backend/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/ckbtc/wallet/backend/index.ts @@ -19,8 +19,8 @@ export default class { @update([], IDL.Nat64) async getBalance(): Promise { return await call(getCkBtcPrincipal(), 'icrc1_balance_of', { - paramIdls: [Account], - returnIdl: IDL.Nat, + paramIdlTypes: [Account], + returnIdlType: IDL.Nat, args: [ { owner: id(), @@ -36,8 +36,8 @@ export default class { getMinterPrincipal(), 'update_balance', { - paramIdls: [UpdateBalanceArgs], - returnIdl: UpdateBalanceResult, + paramIdlTypes: [UpdateBalanceArgs], + returnIdlType: UpdateBalanceResult, args: [ { owner: [id()], @@ -55,8 +55,8 @@ export default class { @update([], IDL.Text) async getDepositAddress(): Promise { return await call(getMinterPrincipal(), 'get_btc_address', { - paramIdls: [GetBtcAddressArgs], - returnIdl: IDL.Text, + paramIdlTypes: [GetBtcAddressArgs], + returnIdlType: IDL.Text, args: [ { owner: [id()], @@ -70,8 +70,8 @@ export default class { @update([IDL.Text, IDL.Nat], TransferResult) async transfer(to: string, amount: bigint): Promise { return await call(getCkBtcPrincipal(), 'icrc1_transfer', { - paramIdls: [TransferArgs], - returnIdl: TransferResult, + paramIdlTypes: [TransferArgs], + returnIdlType: TransferResult, args: [ { from_subaccount: [ diff --git a/tests/end_to_end/candid_rpc/class_syntax/ckbtc/wallet/backend/minter.ts b/tests/end_to_end/candid_rpc/class_syntax/ckbtc/wallet/backend/minter.ts index bce9a42dde..e91764a9c0 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/ckbtc/wallet/backend/minter.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/ckbtc/wallet/backend/minter.ts @@ -1,4 +1,4 @@ -import { IDL, Result } from 'azle'; +import { IDL } from 'azle'; import { UpdateBalanceError, @@ -47,11 +47,13 @@ const UpdateBalanceError = IDL.Variant({ GenericError: IDL.Record({ error_message: IDL.Text, error_code: IDL.Nat64 }) }); -export const UpdateBalanceResult = Result( - IDL.Vec(UtxoStatus), - UpdateBalanceError -); -export type UpdateBalanceResult = Result; +export const UpdateBalanceResult = IDL.Variant({ + Ok: IDL.Vec(UtxoStatus), + Err: UpdateBalanceError +}); +export type UpdateBalanceResult = + | { Ok: UtxoStatus[] } + | { Err: UpdateBalanceError }; export const GetBtcAddressArgs = IDL.Record({ owner: IDL.Opt(IDL.Principal), diff --git a/tests/end_to_end/candid_rpc/class_syntax/composite_queries/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/composite_queries/package-lock.json index d9860544a3..5cec1b7fac 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/composite_queries/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/composite_queries/package-lock.json @@ -12,11 +12,12 @@ "composite_queries_end_to_end_test_functional_syntax": "file:../../../../../examples/composite_queries", "jest": "^29.7.0", "ts-jest": "^29.1.4", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, "../../../../../examples/composite_queries": { + "name": "composite_queries_end_to_end_test_functional_syntax", "dev": true, "dependencies": { "azle": "0.22.0" @@ -25,7 +26,7 @@ "@dfinity/agent": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.4", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -750,6 +751,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1466,6 +1483,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3319,6 +3338,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5037,6 +5068,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5425,6 +5465,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5468,6 +5510,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -5480,6 +5524,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5577,7 +6030,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.2.0", @@ -6306,6 +6761,13 @@ "@noble/hashes": "^1.3.1" } }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -6759,6 +7221,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -7659,7 +8123,7 @@ "azle": "0.22.0", "jest": "^29.7.0", "ts-jest": "^29.1.4", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -8152,6 +8616,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9477,6 +9950,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9742,6 +10221,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -9763,6 +10244,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" } @@ -9774,6 +10257,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9825,7 +10506,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.2.0", diff --git a/tests/end_to_end/candid_rpc/class_syntax/composite_queries/src/canister1/index.ts b/tests/end_to_end/candid_rpc/class_syntax/composite_queries/src/canister1/index.ts index ef72309c79..2833306f70 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/composite_queries/src/canister1/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/composite_queries/src/canister1/index.ts @@ -11,7 +11,7 @@ export default class { }) async simpleCompositeQuery(): Promise { return await call(canister2Id, 'simpleQuery', { - returnIdl: IDL.Text + returnIdlType: IDL.Text }); } @@ -21,7 +21,7 @@ export default class { }) async manualQuery(): Promise { return await call(canister2Id, 'manualQuery', { - returnIdl: IDL.Text + returnIdlType: IDL.Text }); } @@ -31,12 +31,12 @@ export default class { manual: true }) async totallyManualQuery(): Promise { - reply( - await call(canister2Id, 'manualQuery', { - returnIdl: IDL.Text + reply({ + data: await call(canister2Id, 'manualQuery', { + returnIdlType: IDL.Text }), - IDL.Text - ); + idlType: IDL.Text + }); } // Composite query calling another composite query @@ -45,7 +45,7 @@ export default class { }) async deepQuery(): Promise { return await call(canister2Id, 'deepQuery', { - returnIdl: IDL.Text + returnIdlType: IDL.Text }); } @@ -55,7 +55,7 @@ export default class { }) async updateQuery(): Promise { return await call(canister2Id, 'updateQuery', { - returnIdl: IDL.Text + returnIdlType: IDL.Text }); } @@ -63,7 +63,7 @@ export default class { @query([], IDL.Text) async simpleQuery(): Promise { return await call(canister2Id, 'simpleQuery', { - returnIdl: IDL.Text + returnIdlType: IDL.Text }); } @@ -71,7 +71,7 @@ export default class { @update([], IDL.Text) async simpleUpdate(): Promise { return await call(canister2Id, 'deepQuery', { - returnIdl: IDL.Text + returnIdlType: IDL.Text }); } @@ -126,12 +126,12 @@ function getCanister2Id(): string { async function incCanister(): Promise { return await call(id(), 'incCounter', { - returnIdl: IDL.Nat + returnIdlType: IDL.Nat }); } async function incCanister2(): Promise { return await call(canister2Id, 'incCounter', { - returnIdl: IDL.Nat + returnIdlType: IDL.Nat }); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/composite_queries/src/canister2/index.ts b/tests/end_to_end/candid_rpc/class_syntax/composite_queries/src/canister2/index.ts index 986d0198a8..49b33c198e 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/composite_queries/src/canister2/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/composite_queries/src/canister2/index.ts @@ -25,7 +25,10 @@ export default class { manual: true }) manualQuery(): void { - reply('Hello from Canister 2 manual query', IDL.Text); + reply({ + data: 'Hello from Canister 2 manual query', + idlType: IDL.Text + }); } @query([], IDL.Text, { @@ -33,7 +36,7 @@ export default class { }) async deepQuery(): Promise { return await call(canister3Id, 'deepQuery', { - returnIdl: IDL.Text + returnIdlType: IDL.Text }); } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/cross_canister_calls/src/canister1/index.ts b/tests/end_to_end/candid_rpc/class_syntax/cross_canister_calls/src/canister1/index.ts index 03f51a1797..d49de3b094 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/cross_canister_calls/src/canister1/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/cross_canister_calls/src/canister1/index.ts @@ -8,8 +8,8 @@ export default class { @update([IDL.Text, IDL.Text, IDL.Nat64], IDL.Nat64) async transfer(from: string, to: string, amount: bigint): Promise { return await call(canister2Id, 'transfer', { - paramIdls: [IDL.Text, IDL.Text, IDL.Nat64], - returnIdl: IDL.Nat64, + paramIdlTypes: [IDL.Text, IDL.Text, IDL.Nat64], + returnIdlType: IDL.Nat64, args: [from, to, amount] }); } @@ -17,8 +17,8 @@ export default class { @update([IDL.Text], IDL.Nat64) async balance(id: string): Promise { return await call(canister2Id, 'balance', { - paramIdls: [IDL.Text], - returnIdl: IDL.Nat64, + paramIdlTypes: [IDL.Text], + returnIdlType: IDL.Nat64, args: [id] }); } @@ -26,8 +26,8 @@ export default class { @update([AccountArgs], IDL.Opt(Account)) async account(args: AccountArgs): Promise<[Account] | []> { return await call(canister2Id, 'account', { - paramIdls: [AccountArgs], - returnIdl: IDL.Opt(Account), + paramIdlTypes: [AccountArgs], + returnIdlType: IDL.Opt(Account), args: [args] }); } @@ -35,7 +35,7 @@ export default class { @update([], IDL.Vec(Account)) async accounts(): Promise { return await call(canister2Id, 'accounts', { - returnIdl: IDL.Vec(Account) + returnIdlType: IDL.Vec(Account) }); } @@ -47,7 +47,7 @@ export default class { @update([]) sendNotification(): void { return notify(canister2Id, 'receiveNotification', { - paramIdls: [IDL.Text], + paramIdlTypes: [IDL.Text], args: ['This is the notification'], payment: 10n }); diff --git a/tests/end_to_end/candid_rpc/class_syntax/cycles/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/cycles/package-lock.json index b3777691ba..b52c2cbdd8 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/cycles/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/cycles/package-lock.json @@ -1,10 +1,9 @@ { - "name": "cycles_end_to_end_test_functional_syntax", + "name": "cycles", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "cycles_end_to_end_test_functional_syntax", "dependencies": { "azle": "0.22.0" }, diff --git a/tests/end_to_end/candid_rpc/class_syntax/cycles/src/cycles/index.did b/tests/end_to_end/candid_rpc/class_syntax/cycles/src/cycles/index.did index 0d3dfd51c0..867da2474e 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/cycles/src/cycles/index.did +++ b/tests/end_to_end/candid_rpc/class_syntax/cycles/src/cycles/index.did @@ -1,6 +1,4 @@ service: () -> { getCanisterBalance: () -> (nat64) query; - getCanisterBalance128: () -> (nat) query; receiveCycles: () -> (nat64); - receiveCycles128: () -> (nat); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/cycles/src/cycles/index.ts b/tests/end_to_end/candid_rpc/class_syntax/cycles/src/cycles/index.ts index b2b5ac36be..fc3060e0f5 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/cycles/src/cycles/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/cycles/src/cycles/index.ts @@ -1,11 +1,8 @@ import { canisterBalance, - canisterBalance128, IDL, msgCyclesAccept, - msgCyclesAccept128, msgCyclesAvailable, - msgCyclesAvailable128, query, update } from 'azle'; @@ -16,19 +13,8 @@ export default class { return msgCyclesAccept(msgCyclesAvailable() / 2n); } - // Moves all transferred cycles to the canister - @update([], IDL.Nat) - receiveCycles128(): bigint { - return msgCyclesAccept128(msgCyclesAvailable128() / 2n); - } - @query([], IDL.Nat64) getCanisterBalance(): bigint { return canisterBalance(); } - - @query([], IDL.Nat) - getCanisterBalance128(): bigint { - return canisterBalance128(); - } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/cycles/src/intermediary/index.did b/tests/end_to_end/candid_rpc/class_syntax/cycles/src/intermediary/index.did index 74274cb464..97916f215a 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/cycles/src/intermediary/index.did +++ b/tests/end_to_end/candid_rpc/class_syntax/cycles/src/intermediary/index.did @@ -1,8 +1,5 @@ service: () -> { getCanisterBalance: () -> (nat64) query; - getCanisterBalance128: () -> (nat) query; sendCycles: () -> (nat64); - sendCycles128: () -> (nat); - sendCycles128Notify: () -> (); sendCyclesNotify: () -> (); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/cycles/src/intermediary/index.ts b/tests/end_to_end/candid_rpc/class_syntax/cycles/src/intermediary/index.ts index 81048620b2..0baa7e8ef9 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/cycles/src/intermediary/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/cycles/src/intermediary/index.ts @@ -1,21 +1,11 @@ -import { - call, - canisterBalance, - canisterBalance128, - IDL, - msgCyclesRefunded128, - notify, - query, - trap, - update -} from 'azle'; +import { call, canisterBalance, IDL, notify, query, trap, update } from 'azle'; export default class { // Reports the number of cycles returned from the Cycles canister @update([], IDL.Nat64) async sendCycles(): Promise { return await call(getCyclesPrincipal(), 'receiveCycles', { - returnIdl: IDL.Nat64, + returnIdlType: IDL.Nat64, payment: 1_000_000n }); } @@ -27,32 +17,10 @@ export default class { }); } - // Reports the number of cycles returned from the Cycles canister - @update([], IDL.Nat) - async sendCycles128(): Promise { - await call(getCyclesPrincipal(), 'receiveCycles128', { - payment: 1_000_000n - }); - - return msgCyclesRefunded128(); - } - - @update([]) - sendCycles128Notify(): void { - return notify(getCyclesPrincipal(), 'receiveCycles128', { - payment: 1_000_000n - }); - } - @query([], IDL.Nat64) getCanisterBalance(): bigint { return canisterBalance(); } - - @query([], IDL.Nat) - getCanisterBalance128(): bigint { - return canisterBalance128(); - } } function getCyclesPrincipal(): string { diff --git a/tests/end_to_end/candid_rpc/class_syntax/ethereum_json_rpc/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/ethereum_json_rpc/src/index.ts index ee05175e5f..8f6f290cae 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/ethereum_json_rpc/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/ethereum_json_rpc/src/index.ts @@ -67,8 +67,8 @@ async function getBalance( PRINCIPAL, managementCanister.http_request, { - paramIdls: [HttpRequestArgs], - returnIdl: HttpResponse, + paramIdlTypes: [HttpRequestArgs], + returnIdlType: HttpResponse, args: [ { url, @@ -110,8 +110,8 @@ async function getBlockByNumber(url: string, number: number): Promise { PRINCIPAL, managementCanister.http_request, { - paramIdls: [HttpRequestArgs], - returnIdl: HttpResponse, + paramIdlTypes: [HttpRequestArgs], + returnIdlType: HttpResponse, args: [ { url, diff --git a/tests/end_to_end/candid_rpc/class_syntax/func_types/canisters/func_types/index.ts b/tests/end_to_end/candid_rpc/class_syntax/func_types/canisters/func_types/index.ts index 08fddef1d0..881db2bd8e 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/func_types/canisters/func_types/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/func_types/canisters/func_types/index.ts @@ -117,7 +117,7 @@ export default class { @update([], NotifierFunc) async getNotifierFromNotifiersCanister(): Promise { return await call(getNotifierPrincipal(), 'getNotifier', { - returnIdl: NotifierFunc + returnIdlType: NotifierFunc }); } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/heartbeat/src/heartbeat_async/index.ts b/tests/end_to_end/candid_rpc/class_syntax/heartbeat/src/heartbeat_async/index.ts index 26d8bd75db..c83c51f3c6 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/heartbeat/src/heartbeat_async/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/heartbeat/src/heartbeat_async/index.ts @@ -19,6 +19,6 @@ export default class { async function getRandomness(): Promise { return await call('aaaaa-aa', 'raw_rand', { - returnIdl: IDL.Vec(IDL.Nat8) + returnIdlType: IDL.Vec(IDL.Nat8) }); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/ic_api/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/ic_api/package-lock.json index 91906a5365..9793d81c47 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/ic_api/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/ic_api/package-lock.json @@ -1,10 +1,9 @@ { - "name": "ic_api_end_to_end_test_functional_syntax", + "name": "ic_api", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "ic_api_end_to_end_test_functional_syntax", "dependencies": { "azle": "0.22.0" }, @@ -18,6 +17,7 @@ } }, "../../../../../examples/ic_api": { + "name": "ic_api_end_to_end_test_functional_syntax", "dev": true, "dependencies": { "azle": "0.22.0" diff --git a/tests/end_to_end/candid_rpc/class_syntax/ic_api/src/index.did b/tests/end_to_end/candid_rpc/class_syntax/ic_api/src/index.did index 083bbc4846..c34322d244 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/ic_api/src/index.did +++ b/tests/end_to_end/candid_rpc/class_syntax/ic_api/src/index.did @@ -3,7 +3,6 @@ service: () -> { argDataRawSize: (vec nat8, int8, bool, text) -> (nat32) query; caller: () -> (principal) query; canisterBalance: () -> (nat64) query; - canisterBalance128: () -> (nat) query; canisterVersion: () -> (nat64) query; dataCertificate: () -> (opt vec nat8) query; dataCertificateNull: () -> (opt vec nat8); diff --git a/tests/end_to_end/candid_rpc/class_syntax/ic_api/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/ic_api/src/index.ts index 97ae2efebb..e370b14ec7 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/ic_api/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/ic_api/src/index.ts @@ -3,7 +3,6 @@ import { argDataRawSize, caller, canisterBalance, - canisterBalance128, canisterVersion, dataCertificate, id, @@ -95,12 +94,6 @@ export default class { return canisterBalance(); } - // returns the amount of cycles available in the canister - @query([], IDL.Nat) - canisterBalance128(): bigint { - return canisterBalance128(); - } - // returns the canister's version number @query([], IDL.Nat64) canisterVersion(): bigint { diff --git a/tests/end_to_end/candid_rpc/class_syntax/icrc/canisters/proxy/index.ts b/tests/end_to_end/candid_rpc/class_syntax/icrc/canisters/proxy/index.ts index e31fc35fb8..a4276fe946 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/icrc/canisters/proxy/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/icrc/canisters/proxy/index.ts @@ -17,57 +17,57 @@ export default class { @query([], IDL.Vec(IDL.Tuple(IDL.Text, Value)), { composite: true }) async icrc1_metadata(): Promise<[Text, Value][]> { return await call(getIcrcPrincipal(), 'icrc1_metadata', { - returnIdl: IDL.Vec(IDL.Tuple(IDL.Text, Value)) + returnIdlType: IDL.Vec(IDL.Tuple(IDL.Text, Value)) }); } @query([], IDL.Text, { composite: true }) async icrc1_name(): Promise { return await call(getIcrcPrincipal(), 'icrc1_name', { - returnIdl: IDL.Text + returnIdlType: IDL.Text }); } @query([], IDL.Nat8, { composite: true }) async icrc1_decimals(): Promise { return await call(getIcrcPrincipal(), 'icrc1_decimals', { - returnIdl: IDL.Nat8 + returnIdlType: IDL.Nat8 }); } @query([], IDL.Text, { composite: true }) async icrc1_symbol(): Promise { return await call(getIcrcPrincipal(), 'icrc1_symbol', { - returnIdl: IDL.Text + returnIdlType: IDL.Text }); } @query([], IDL.Nat, { composite: true }) async icrc1_fee(): Promise { return await call(getIcrcPrincipal(), 'icrc1_fee', { - returnIdl: IDL.Nat + returnIdlType: IDL.Nat }); } @query([], IDL.Nat, { composite: true }) async icrc1_total_supply(): Promise { return await call(getIcrcPrincipal(), 'icrc1_total_supply', { - returnIdl: IDL.Nat + returnIdlType: IDL.Nat }); } @query([], IDL.Opt(Account), { composite: true }) async icrc1_minting_account(): Promise<[Account] | []> { return await call(getIcrcPrincipal(), 'icrc1_minting_account', { - returnIdl: IDL.Opt(Account) + returnIdlType: IDL.Opt(Account) }); } @query([Account], IDL.Nat, { composite: true }) async icrc1_balance_of(account: Account): Promise { return await call(getIcrcPrincipal(), 'icrc1_balance_of', { - paramIdls: [Account], - returnIdl: IDL.Nat, + paramIdlTypes: [Account], + returnIdlType: IDL.Nat, args: [account] }); } @@ -75,8 +75,8 @@ export default class { @update([TransferArgs], TransferResult) async icrc1_transfer(transferArgs: TransferArgs): Promise { return await call(getIcrcPrincipal(), 'icrc1_transfer', { - paramIdls: [TransferArgs], - returnIdl: TransferResult, + paramIdlTypes: [TransferArgs], + returnIdlType: TransferResult, args: [transferArgs] }); } @@ -84,15 +84,15 @@ export default class { @query([], IDL.Vec(SupportedStandard), { composite: true }) async icrc1_supported_standards(): Promise { return await call(getIcrcPrincipal(), 'icrc1_supported_standards', { - returnIdl: IDL.Vec(SupportedStandard) + returnIdlType: IDL.Vec(SupportedStandard) }); } @update([ApproveArgs], ApproveResult) async icrc2_approve(approveArgs: ApproveArgs): Promise { return await call(getIcrcPrincipal(), 'icrc2_approve', { - paramIdls: [ApproveArgs], - returnIdl: ApproveResult, + paramIdlTypes: [ApproveArgs], + returnIdlType: ApproveResult, args: [approveArgs] }); } @@ -102,8 +102,8 @@ export default class { transferFromArgs: TransferFromArgs ): Promise { return await call(getIcrcPrincipal(), 'icrc2_transfer_from', { - paramIdls: [TransferFromArgs], - returnIdl: TransferFromResult, + paramIdlTypes: [TransferFromArgs], + returnIdlType: TransferFromResult, args: [transferFromArgs] }); } @@ -113,8 +113,8 @@ export default class { allowanceArgs: AllowanceArgs ): Promise { return await call(getIcrcPrincipal(), 'icrc2_allowance', { - paramIdls: [AllowanceArgs], - returnIdl: AllowanceResult, + paramIdlTypes: [AllowanceArgs], + returnIdlType: AllowanceResult, args: [allowanceArgs] }); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/ledger_canister/src/ledger_canister/index.ts b/tests/end_to_end/candid_rpc/class_syntax/ledger_canister/src/ledger_canister/index.ts index 84022cd9e1..d27a16bd9a 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/ledger_canister/src/ledger_canister/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/ledger_canister/src/ledger_canister/index.ts @@ -30,8 +30,8 @@ export default class { ? [] : [{ timestamp_nanos: createdAtTime[0] }]; return await call(getIcpCanisterPrincipal(), 'transfer', { - paramIdls: [TransferArgs], - returnIdl: TransferResult, + paramIdlTypes: [TransferArgs], + returnIdlType: TransferResult, args: [ { memo: 0n, @@ -52,8 +52,8 @@ export default class { @update([Address], Tokens) async getAccountBalance(address: Address): Promise { return await call(getIcpCanisterPrincipal(), 'account_balance', { - paramIdls: [AccountBalanceArgs], - returnIdl: Tokens, + paramIdlTypes: [AccountBalanceArgs], + returnIdlType: Tokens, args: [ { account: binaryAddressFromAddress(address) @@ -65,8 +65,8 @@ export default class { @update([], TransferFee) async getTransferFee(): Promise { return await call(getIcpCanisterPrincipal(), 'transfer_fee', { - paramIdls: [TransferFeeArg], - returnIdl: TransferFee, + paramIdlTypes: [TransferFeeArg], + returnIdlType: TransferFee, args: [{}] }); } @@ -76,8 +76,8 @@ export default class { getBlocksArgs: GetBlocksArgs ): Promise { return await call(getIcpCanisterPrincipal(), 'query_blocks', { - paramIdls: [GetBlocksArgs], - returnIdl: QueryBlocksResponse, + paramIdlTypes: [GetBlocksArgs], + returnIdlType: QueryBlocksResponse, args: [getBlocksArgs] }); } @@ -85,7 +85,7 @@ export default class { @update([], IDL.Text) async getSymbol(): Promise { const symbolResult = await call(getIcpCanisterPrincipal(), 'symbol', { - returnIdl: SymbolResult + returnIdlType: SymbolResult }); return symbolResult.symbol; @@ -94,7 +94,7 @@ export default class { @update([], IDL.Text) async getName(): Promise { const nameResult = await call(getIcpCanisterPrincipal(), 'name', { - returnIdl: NameResult + returnIdlType: NameResult }); return nameResult.name; @@ -105,7 +105,7 @@ export default class { const decimalsResult = await call( getIcpCanisterPrincipal(), 'decimals', - { returnIdl: DecimalsResult } + { returnIdlType: DecimalsResult } ); return decimalsResult.decimals; @@ -114,7 +114,7 @@ export default class { @update([], Archives) async getArchives(): Promise { return await call(getIcpCanisterPrincipal(), 'archives', { - returnIdl: Archives + returnIdlType: Archives }); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/management_canister/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/management_canister/package-lock.json index e1fde9ec4a..15d7279218 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/management_canister/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/management_canister/package-lock.json @@ -1,10 +1,9 @@ { - "name": "management_canister_end_to_end_test_functional_syntax", + "name": "management_canister", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "management_canister_end_to_end_test_functional_syntax", "dependencies": { "azle": "0.22.0" }, @@ -13,11 +12,12 @@ "jest": "^29.7.0", "management_canister_end_to_end_test_functional_syntax": "file:../../../../../examples/management_canister", "ts-jest": "^29.1.4", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, "../../../../../examples/management_canister": { + "name": "management_canister_end_to_end_test_functional_syntax", "dev": true, "dependencies": { "azle": "0.22.0" @@ -26,7 +26,7 @@ "@dfinity/agent": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -751,6 +751,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1467,6 +1483,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3316,6 +3334,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5038,6 +5068,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5426,6 +5465,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5469,6 +5510,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -5481,6 +5524,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5578,7 +6030,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.2.0", @@ -6307,6 +6761,13 @@ "@noble/hashes": "^1.3.1" } }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -6760,6 +7221,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -8142,6 +8605,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9049,7 +9521,7 @@ "azle": "0.22.0", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -9478,6 +9950,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9743,6 +10221,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -9764,6 +10244,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" } @@ -9775,6 +10257,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9826,7 +10506,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.2.0", diff --git a/tests/end_to_end/candid_rpc/class_syntax/management_canister/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/management_canister/src/index.ts index 11118b5b3d..fbbe51a289 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/management_canister/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/management_canister/src/index.ts @@ -46,7 +46,7 @@ export default class { @update([IDL.Principal], IDL.Bool) async executeUpdateSettings(canisterId: Principal): Promise { await call('aaaaa-aa', 'update_settings', { - paramIdls: [UpdateSettingsArgs], + paramIdlTypes: [UpdateSettingsArgs], args: [ { canister_id: canisterId, @@ -71,8 +71,8 @@ export default class { chunk: Uint8Array ): Promise { return await call('aaaaa-aa', 'upload_chunk', { - paramIdls: [UploadChunkArgs], - returnIdl: ChunkHash, + paramIdlTypes: [UploadChunkArgs], + returnIdlType: ChunkHash, args: [ { canister_id: canisterId, @@ -85,7 +85,7 @@ export default class { @update([IDL.Principal], IDL.Bool) async executeClearChunkStore(canisterId: Principal): Promise { await call('aaaaa-aa', 'clear_chunk_store', { - paramIdls: [ClearChunkStoreArgs], + paramIdlTypes: [ClearChunkStoreArgs], args: [ { canister_id: canisterId @@ -99,8 +99,8 @@ export default class { @update([IDL.Principal], StoredChunksResult) async getStoredChunks(canisterId: Principal): Promise { return await call('aaaaa-aa', 'stored_chunks', { - paramIdls: [StoredChunksArgs], - returnIdl: StoredChunksResult, + paramIdlTypes: [StoredChunksArgs], + returnIdlType: StoredChunksResult, args: [ { canister_id: canisterId @@ -115,7 +115,7 @@ export default class { wasmModule: Uint8Array ): Promise { await call('aaaaa-aa', 'install_code', { - paramIdls: [InstallCodeArgs], + paramIdlTypes: [InstallCodeArgs], args: [ { mode: { @@ -140,7 +140,7 @@ export default class { wasmModuleHash: Uint8Array ): Promise { await call('aaaaa-aa', 'install_chunked_code', { - paramIdls: [InstallChunkedCodeArgs], + paramIdlTypes: [InstallChunkedCodeArgs], args: [ { mode: { @@ -163,7 +163,7 @@ export default class { @update([IDL.Principal], IDL.Bool) async executeUninstallCode(canisterId: Principal): Promise { await call('aaaaa-aa', 'uninstall_code', { - paramIdls: [UninstallCodeArgs], + paramIdlTypes: [UninstallCodeArgs], args: [ { canister_id: canisterId, @@ -178,7 +178,7 @@ export default class { @update([IDL.Principal], IDL.Bool) async executeStartCanister(canisterId: Principal): Promise { await call('aaaaa-aa', 'start_canister', { - paramIdls: [StartCanisterArgs], + paramIdlTypes: [StartCanisterArgs], args: [ { canister_id: canisterId @@ -191,7 +191,7 @@ export default class { @update([IDL.Principal], IDL.Bool) async executeStopCanister(canisterId: Principal): Promise { await call('aaaaa-aa', 'stop_canister', { - paramIdls: [StopCanisterArgs], + paramIdlTypes: [StopCanisterArgs], args: [ { canister_id: canisterId @@ -205,8 +205,8 @@ export default class { @update([CanisterInfoArgs], CanisterInfoResult) async getCanisterInfo(args: CanisterInfoArgs): Promise { return await call('aaaaa-aa', 'canister_info', { - paramIdls: [CanisterInfoArgs], - returnIdl: CanisterInfoResult, + paramIdlTypes: [CanisterInfoArgs], + returnIdlType: CanisterInfoResult, args: [args] }); } @@ -216,8 +216,8 @@ export default class { args: CanisterStatusArgs ): Promise { return await call('aaaaa-aa', 'canister_status', { - paramIdls: [CanisterStatusArgs], - returnIdl: CanisterStatusResult, + paramIdlTypes: [CanisterStatusArgs], + returnIdlType: CanisterStatusResult, args: [args] }); } @@ -225,7 +225,7 @@ export default class { @update([IDL.Principal], IDL.Bool) async executeDeleteCanister(canisterId: Principal): Promise { await call('aaaaa-aa', 'delete_canister', { - paramIdls: [DeleteCanisterArgs], + paramIdlTypes: [DeleteCanisterArgs], args: [ { canister_id: canisterId @@ -239,7 +239,7 @@ export default class { @update([IDL.Principal], IDL.Bool) async executeDepositCycles(canisterId: Principal): Promise { await call('aaaaa-aa', 'deposit_cycles', { - paramIdls: [DepositCyclesArgs], + paramIdlTypes: [DepositCyclesArgs], args: [ { canister_id: canisterId @@ -254,7 +254,7 @@ export default class { @update([], IDL.Vec(IDL.Nat8)) async getRawRand(): Promise { return await call('aaaaa-aa', 'raw_rand', { - returnIdl: IDL.Vec(IDL.Nat8) + returnIdlType: IDL.Vec(IDL.Nat8) }); } // TODO we should test this like we test depositCycles @@ -264,8 +264,8 @@ export default class { 'aaaaa-aa', 'provisional_create_canister_with_cycles', { - paramIdls: [ProvisionalCreateCanisterWithCyclesArgs], - returnIdl: ProvisionalCreateCanisterWithCyclesResult, + paramIdlTypes: [ProvisionalCreateCanisterWithCyclesArgs], + returnIdlType: ProvisionalCreateCanisterWithCyclesResult, args: [ { amount: [], @@ -284,7 +284,7 @@ export default class { amount: bigint ): Promise { await call('aaaaa-aa', 'provisional_top_up_canister', { - paramIdls: [ProvisionalTopUpCanisterArgs], + paramIdlTypes: [ProvisionalTopUpCanisterArgs], args: [ { canister_id: canisterId, @@ -304,8 +304,8 @@ export default class { async function createCanister(): Promise { return await call('aaaaa-aa', 'create_canister', { - paramIdls: [CreateCanisterArgs], - returnIdl: CreateCanisterResult, + paramIdlTypes: [CreateCanisterArgs], + returnIdlType: CreateCanisterResult, args: [{ settings: [], sender_canister_version: [] }], payment: 50_000_000_000_000n }); diff --git a/tests/end_to_end/candid_rpc/class_syntax/manual_reply/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/manual_reply/package-lock.json index 13606cd2bd..eabbf8d41d 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/manual_reply/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/manual_reply/package-lock.json @@ -12,7 +12,7 @@ "jest": "^29.7.0", "manual_reply_end_to_end_test_functional_syntax": "file:../../../../../examples/manual_reply", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -26,7 +26,7 @@ "@dfinity/agent": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -751,6 +751,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1467,6 +1483,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3316,6 +3334,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5041,6 +5071,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5429,6 +5468,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5472,6 +5513,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -5484,6 +5527,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5581,7 +6033,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -6310,6 +6764,13 @@ "@noble/hashes": "^1.3.1" } }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -6763,6 +7224,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -8145,6 +8608,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9052,7 +9524,7 @@ "azle": "0.22.0", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -9481,6 +9953,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9746,6 +10224,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -9767,6 +10247,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" } @@ -9778,6 +10260,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9829,7 +10509,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.3.0", diff --git a/tests/end_to_end/candid_rpc/class_syntax/manual_reply/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/manual_reply/src/index.ts index c3f72b5fd2..a274f82852 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/manual_reply/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/manual_reply/src/index.ts @@ -1,12 +1,4 @@ -import { - candidEncode, - IDL, - query, - reject, - reply, - replyRaw, - update -} from 'azle'; +import { candidEncode, IDL, query, reject, reply, update } from 'azle'; const Options = IDL.Variant({ Small: IDL.Null, @@ -103,40 +95,40 @@ export default class { return; } - reply(message, IDL.Text); + reply({ data: message, idlType: IDL.Text }); } @update([], IDL.Vec(IDL.Nat8), { manual: true }) updateBlob(): void { - reply( - new Uint8Array([83, 117, 114, 112, 114, 105, 115, 101, 33]), - IDL.Vec(IDL.Nat8) - ); + reply({ + data: new Uint8Array([83, 117, 114, 112, 114, 105, 115, 101, 33]), + idlType: IDL.Vec(IDL.Nat8) + }); } @update([], IDL.Float32, { manual: true }) updateFloat32(): void { - reply(1245.678, IDL.Float32); + reply({ data: 1245.678, idlType: IDL.Float32 }); } @update([], IDL.Int8, { manual: true }) updateInt8(): void { - reply(-100, IDL.Int8); + reply({ data: -100, idlType: IDL.Int8 }); } @update([], IDL.Nat, { manual: true }) updateNat(): void { - reply(184467440737095516150n, IDL.Nat); + reply({ data: 184467440737095516150n, idlType: IDL.Nat }); } @update([], IDL.Null, { manual: true }) updateNull(): void { - reply(null, IDL.Null); + reply({ data: null, idlType: IDL.Null }); } @update([], undefined, { manual: true }) updateVoid(): void { - reply(undefined); + reply({ data: undefined }); } @update([], Element, { manual: true }) @@ -149,32 +141,32 @@ export default class { ], state: { Gas: { Elemental: null } } }; - reply(element, Element); + reply({ data: element, idlType: Element }); } @update([], IDL.Reserved, { manual: true }) updateReserved(): void { - reply(undefined, IDL.Reserved); + reply({ data: undefined, idlType: IDL.Reserved }); } @update([], IDL.Text, { manual: true }) updateString(): void { - reply('hello', IDL.Text); + reply({ data: 'hello', idlType: IDL.Text }); } @update([], Gas, { manual: true }) updateVariant(): void { const gas: Gas = { Toxic: null }; - reply(gas, Gas); + reply({ data: gas, idlType: Gas }); } @update([], RawReply, { manual: true }) replyRaw(): void { - replyRaw( - candidEncode( + reply({ + raw: candidEncode( '(record { "int" = 42; "text" = "text"; "bool" = true; "myBlob" = blob "Surprise!"; "myVariant" = variant { Medium } })' ) - ); + }); } // Queries @@ -185,40 +177,40 @@ export default class { return; } - reply(message, IDL.Text); + reply({ data: message, idlType: IDL.Text }); } @query([], IDL.Vec(IDL.Nat8), { manual: true }) queryBlob(): void { - reply( - new Uint8Array([83, 117, 114, 112, 114, 105, 115, 101, 33]), - IDL.Vec(IDL.Nat8) - ); + reply({ + data: new Uint8Array([83, 117, 114, 112, 114, 105, 115, 101, 33]), + idlType: IDL.Vec(IDL.Nat8) + }); } @query([], IDL.Float32, { manual: true }) queryFloat32(): void { - reply(1245.678, IDL.Float32); + reply({ data: 1245.678, idlType: IDL.Float32 }); } @query([], IDL.Int8, { manual: true }) queryInt8(): void { - reply(-100, IDL.Int8); + reply({ data: -100, idlType: IDL.Int8 }); } @query([], IDL.Nat, { manual: true }) queryNat(): void { - reply(184467440737095516150n, IDL.Nat); + reply({ data: 184467440737095516150n, idlType: IDL.Nat }); } @query([], IDL.Null, { manual: true }) queryNull(): void { - reply(null, IDL.Null); + reply({ data: null, idlType: IDL.Null }); } @query([], undefined, { manual: true }) queryVoid(): void { - reply(undefined); + reply({ data: undefined }); } @query([], Element, { manual: true }) @@ -232,23 +224,23 @@ export default class { state: { Gas: { Elemental: null } } }; - reply(element, Element); + reply({ data: element, idlType: Element }); } @query([], IDL.Reserved, { manual: true }) queryReserved(): void { - reply(undefined, IDL.Reserved); + reply({ data: undefined, idlType: IDL.Reserved }); } @query([], IDL.Text, { manual: true }) queryString(): void { - reply('hello', IDL.Text); + reply({ data: 'hello', idlType: IDL.Text }); } @query([], Gas, { manual: true }) queryVariant(): void { const gas: Gas = { Toxic: null }; - reply(gas, Gas); + reply({ data: gas, idlType: Gas }); } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/motoko_examples/threshold_ecdsa/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/motoko_examples/threshold_ecdsa/src/index.ts index 3d5a563ec6..e6446bcf1c 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/motoko_examples/threshold_ecdsa/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/motoko_examples/threshold_ecdsa/src/index.ts @@ -45,8 +45,8 @@ export default class { async function getPublicKeyResult(): Promise { return await call('aaaaa-aa', 'ecdsa_public_key', { - paramIdls: [EcdsaPublicKeyArgs], - returnIdl: EcdsaPublicKeyResult, + paramIdlTypes: [EcdsaPublicKeyArgs], + returnIdlType: EcdsaPublicKeyResult, args: [ { canister_id: [], @@ -64,8 +64,8 @@ async function getSignatureResult( messageHash: Uint8Array ): Promise { return await call('aaaaa-aa', 'sign_with_ecdsa', { - paramIdls: [SignWithEcdsaArgs], - returnIdl: SignWithEcdsaResult, + paramIdlTypes: [SignWithEcdsaArgs], + returnIdlType: SignWithEcdsaResult, args: [ { message_hash: messageHash, diff --git a/tests/end_to_end/candid_rpc/class_syntax/motoko_examples/whoami/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/motoko_examples/whoami/src/index.ts index e26c61a508..477d7d13de 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/motoko_examples/whoami/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/motoko_examples/whoami/src/index.ts @@ -47,7 +47,7 @@ class WhoAmI { // Return the principal identifier of this canister. @update([], IDL.Principal) async id(): Promise { - return await call(id(), 'whoami', { returnIdl: IDL.Principal }); + return await call(id(), 'whoami', { returnIdlType: IDL.Principal }); } // Return the principal identifier of this canister via the global `ic` object. // This is much quicker than `id()` above because it isn't making a cross- diff --git a/tests/end_to_end/candid_rpc/class_syntax/notify_raw/src/canister1/index.ts b/tests/end_to_end/candid_rpc/class_syntax/notify_raw/src/canister1/index.ts index 7fdd562192..67e691e430 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/notify_raw/src/canister1/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/notify_raw/src/canister1/index.ts @@ -1,16 +1,18 @@ -import { candidEncode, notifyRaw, Principal, trap, update } from 'azle'; +import { candidEncode, notify, Principal, trap, update } from 'azle'; export default class { @update([]) sendNotification(): void { - return notifyRaw( + return notify( Principal.fromText( process.env.CANISTER2_PRINCIPAL ?? trap('process.env.CANISTER2_PRINCIPAL is undefined') ), 'receiveNotification', - Uint8Array.from(candidEncode('()')), - 0n + { + raw: Uint8Array.from(candidEncode('()')), + payment: 0n + } ); } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/null_example/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/null_example/package-lock.json index e21a8e63f1..30538009a3 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/null_example/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/null_example/package-lock.json @@ -1,10 +1,9 @@ { - "name": "null_example_end_to_end_test_functional_syntax", + "name": "null_example", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "null_example_end_to_end_test_functional_syntax", "dependencies": { "azle": "0.22.0" }, @@ -13,7 +12,7 @@ "jest": "^29.7.0", "null_example_end_to_end_test_functional_syntax": "file:../../../../../examples/null_example", "ts-jest": "^29.1.5", - "ts-node": "10.7.0", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -27,7 +26,7 @@ "@dfinity/agent": "0.11.1", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "10.7.0", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -727,6 +726,22 @@ "dev": true, "peer": true }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -3241,6 +3256,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4966,6 +4993,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5354,6 +5390,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -5397,6 +5435,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5494,7 +5941,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -6187,6 +6636,13 @@ "dev": true, "peer": true }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -7967,6 +8423,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -8999,7 +9464,7 @@ "azle": "0.22.0", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "10.7.0", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -9303,6 +9768,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9568,6 +10039,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -9589,6 +10062,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9640,7 +10311,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.3.0", diff --git a/tests/end_to_end/candid_rpc/class_syntax/outgoing_http_requests/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/outgoing_http_requests/src/index.ts index 8069352c58..512eea0169 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/outgoing_http_requests/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/outgoing_http_requests/src/index.ts @@ -5,7 +5,7 @@ import { IDL, Principal, query, - replyRaw, + reply, update } from 'azle'; import { @@ -18,8 +18,8 @@ export default class { @update([], IDL.Text) async xkcd(): Promise { const httpResponse = await call('aaaaa-aa', 'http_request', { - paramIdls: [HttpRequestArgs], - returnIdl: HttpResponse, + paramIdlTypes: [HttpRequestArgs], + returnIdlType: HttpResponse, args: [ { url: `https://xkcd.com/642/info.0.json`, @@ -68,7 +68,7 @@ export default class { } ); - replyRaw(httpResponse); + reply({ raw: httpResponse }); } @query([HttpTransformArgs], HttpResponse) diff --git a/tests/end_to_end/candid_rpc/class_syntax/primitive_types/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/primitive_types/package-lock.json index 46fbcb4efc..fb4e069810 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/primitive_types/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/primitive_types/package-lock.json @@ -1,10 +1,9 @@ { - "name": "primitive_types_end_to_end_test_functional_syntax", + "name": "primitive_types", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "primitive_types_end_to_end_test_functional_syntax", "dependencies": { "azle": "0.22.0" }, @@ -13,7 +12,7 @@ "jest": "^29.7.0", "primitive_types_end_to_end_test_functional_syntax": "file:../../../../../examples/primitive_types", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -27,7 +26,7 @@ "@dfinity/agent": "^0.19.2", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "^10.9.1", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -638,6 +637,8 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -753,6 +754,22 @@ "@noble/hashes": "^1.3.1" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -1469,6 +1486,8 @@ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -3334,6 +3353,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5059,6 +5090,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5447,6 +5487,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -5490,6 +5532,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5587,7 +6038,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", diff --git a/tests/end_to_end/candid_rpc/class_syntax/recursion/src/recursion/index.ts b/tests/end_to_end/candid_rpc/class_syntax/recursion/src/recursion/index.ts index 052b3ca718..86545b1f12 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/recursion/src/recursion/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/recursion/src/recursion/index.ts @@ -251,8 +251,8 @@ export default class { myFullCanister: MyFullCanister ): Promise { return await call(myFullCanister, 'myQuery', { - paramIdls: [MyFullCanister], - returnIdl: MyFullCanister, + paramIdlTypes: [MyFullCanister], + returnIdlType: MyFullCanister, args: [myFullCanister] }); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/rejections/src/rejections/index.ts b/tests/end_to_end/candid_rpc/class_syntax/rejections/src/rejections/index.ts index 86309e5602..45fbb7e465 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/rejections/src/rejections/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/rejections/src/rejections/index.ts @@ -1,17 +1,43 @@ -import { - call, - IDL, - rejectCode, - RejectionCode, - rejectMessage, - update -} from 'azle'; +import { call, IDL, rejectCode, rejectMessage, update } from 'azle'; + +const RejectionCode = IDL.Variant({ + NoError: IDL.Null, + SysFatal: IDL.Null, + SysTransient: IDL.Null, + DestinationInvalid: IDL.Null, + CanisterReject: IDL.Null, + CanisterError: IDL.Null, + Unknown: IDL.Null +}); + +type RejectionCode = + | { + NoError: null; + } + | { + SysFatal: null; + } + | { + SysTransient: null; + } + | { + DestinationInvalid: null; + } + | { + CanisterReject: null; + } + | { + CanisterError: null; + } + | { + Unknown: null; + }; export default class { @update([], RejectionCode) async getRejectionCodeNoError(): Promise { await call(getSomeCanisterPrincipal(), 'accept', { - returnIdl: IDL.Bool + returnIdlType: IDL.Bool }); return rejectCode(); @@ -32,7 +58,7 @@ export default class { async getRejectionCodeCanisterReject(): Promise { try { await call(getSomeCanisterPrincipal(), 'reject', { - paramIdls: [IDL.Text], + paramIdlTypes: [IDL.Text], args: ['reject'] }); } catch (error) { @@ -57,7 +83,7 @@ export default class { async getRejectionMessage(message: string): Promise { try { await call(getSomeCanisterPrincipal(), 'reject', { - paramIdls: [IDL.Text], + paramIdlTypes: [IDL.Text], args: [message] }); } catch (error) { diff --git a/tests/end_to_end/candid_rpc/class_syntax/stable_memory/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/stable_memory/package-lock.json index e841bf3891..7edad45fc0 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/stable_memory/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/stable_memory/package-lock.json @@ -12,7 +12,7 @@ "jest": "^29.7.0", "stable_memory_end_to_end_test_functional_syntax": "file:../../../../../examples/stable_memory", "ts-jest": "^29.1.5", - "ts-node": "10.7.0", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -26,7 +26,7 @@ "@dfinity/agent": "0.11.1", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "10.7.0", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -726,6 +726,22 @@ "dev": true, "peer": true }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -3240,6 +3256,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -4961,6 +4989,15 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -5353,6 +5390,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -5396,6 +5435,415 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -5493,7 +5941,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -6186,6 +6636,13 @@ "dev": true, "peer": true }, + "@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.4", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", @@ -7966,6 +8423,15 @@ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true }, + "get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9291,6 +9757,12 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, "resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -9408,7 +9880,7 @@ "azle": "0.22.0", "jest": "^29.7.0", "ts-jest": "^29.1.5", - "ts-node": "10.7.0", + "tsx": "^4.15.7", "typescript": "^5.2.2" } }, @@ -9567,6 +10039,8 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "0.7.0", "@tsconfig/node10": "^1.0.7", @@ -9588,6 +10062,204 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "tsx": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz", + "integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==", + "dev": true, + "requires": { + "esbuild": "~0.21.5", + "fsevents": "~2.3.3", + "get-tsconfig": "^4.7.5" + }, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + } + } + }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -9639,7 +10311,9 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.3.0", diff --git a/tests/end_to_end/candid_rpc/class_syntax/stable_memory/src/index.did b/tests/end_to_end/candid_rpc/class_syntax/stable_memory/src/index.did index 3fdb8f4002..b367ded610 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/stable_memory/src/index.did +++ b/tests/end_to_end/candid_rpc/class_syntax/stable_memory/src/index.did @@ -1,11 +1,7 @@ service: () -> { - stable64Grow: (nat64) -> (nat64); - stable64Read: (nat64, nat64) -> (vec nat8) query; - stable64Size: () -> (nat64) query; - stable64Write: (nat64, vec nat8) -> (); stableBytes: () -> (vec nat8) query; - stableGrow: (nat32) -> (nat32); - stableRead: (nat32, nat32) -> (vec nat8) query; - stableSize: () -> (nat32) query; - stableWrite: (nat32, vec nat8) -> (); + stableGrow: (nat64) -> (nat64); + stableRead: (nat64, nat64) -> (vec nat8) query; + stableSize: () -> (nat64) query; + stableWrite: (nat64, vec nat8) -> (); } diff --git a/tests/end_to_end/candid_rpc/class_syntax/stable_memory/src/index.ts b/tests/end_to_end/candid_rpc/class_syntax/stable_memory/src/index.ts index 37676ec24c..5ef1c81bb1 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/stable_memory/src/index.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/stable_memory/src/index.ts @@ -1,10 +1,6 @@ import { IDL, query, - stable64Grow, - stable64Read, - stable64Size, - stable64Write, stableBytes, stableGrow, stableRead, @@ -16,44 +12,24 @@ import { const STABLE_BYTES_SIZE = 655_360; export default class StableCanister { - @query([], IDL.Nat32) - stableSize(): number { - return stableSize(); - } - @query([], IDL.Nat64) - stable64Size(): bigint { - return stable64Size(); - } - - @update([IDL.Nat32], IDL.Nat32) - stableGrow(newPages: number): number { - return stableGrow(newPages); + stableSize(): bigint { + return stableSize(); } @update([IDL.Nat64], IDL.Nat64) - stable64Grow(newPages: bigint): bigint { - return stable64Grow(newPages); - } - - @update([IDL.Nat32, IDL.Vec(IDL.Nat8)]) - stableWrite(offset: number, buf: Uint8Array): void { - stableWrite(offset, buf); + stableGrow(newPages: bigint): bigint { + return stableGrow(newPages); } @update([IDL.Nat64, IDL.Vec(IDL.Nat8)]) - stable64Write(offset: bigint, buf: Uint8Array): void { - stable64Write(offset, buf); - } - - @query([IDL.Nat32, IDL.Nat32], IDL.Vec(IDL.Nat8)) - stableRead(offset: number, length: number): Uint8Array { - return stableRead(offset, length); + stableWrite(offset: bigint, buf: Uint8Array): void { + stableWrite(offset, buf); } @query([IDL.Nat64, IDL.Nat64], IDL.Vec(IDL.Nat8)) - stable64Read(offset: bigint, length: bigint): Uint8Array { - return stable64Read(offset, length); + stableRead(offset: bigint, length: bigint): Uint8Array { + return stableRead(offset, length); } @query([], IDL.Vec(IDL.Nat8)) diff --git a/tests/end_to_end/candid_rpc/class_syntax/timers/src/timers.ts b/tests/end_to_end/candid_rpc/class_syntax/timers/src/timers.ts index 9e3b175b48..7371939c92 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/timers/src/timers.ts +++ b/tests/end_to_end/candid_rpc/class_syntax/timers/src/timers.ts @@ -126,5 +126,7 @@ async function repeatCrossCanisterTimerCallback(): Promise { } async function getRandomness(): Promise { - return await call('aaaaa-aa', 'raw_rand', { returnIdl: IDL.Vec(IDL.Nat8) }); + return await call('aaaaa-aa', 'raw_rand', { + returnIdlType: IDL.Vec(IDL.Nat8) + }); }