From 55a4dd0c6c39975eecc90d75a0afb93b9000d7ba Mon Sep 17 00:00:00 2001 From: belopash Date: Thu, 13 Jun 2024 22:24:11 +0500 Subject: [PATCH] use clone package --- common/config/rush/pnpm-lock.yaml | 106 +++++++++++------- typeorm/typeorm-store/package.json | 4 +- typeorm/typeorm-store/src/utils/cacheMap.ts | 5 +- typeorm/typeorm-store/src/utils/misc.ts | 47 -------- .../typeorm-store/src/utils/stateManager.ts | 6 +- 5 files changed, 73 insertions(+), 95 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 017975960..f987d5981 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -365,6 +365,9 @@ dependencies: camelcase: specifier: ^6.3.0 version: 6.3.0 + clone: + specifier: ~2.1.2 + version: 2.1.2 commander: specifier: ^11.1.0 version: 11.1.0 @@ -425,6 +428,9 @@ dependencies: prom-client: specifier: ^14.2.0 version: 14.2.0 + rfdc: + specifier: ~1.4.1 + version: 1.4.1 semver: specifier: ^7.5.4 version: 7.6.0 @@ -2548,6 +2554,10 @@ packages: '@types/node': 18.19.31 dev: false + /@types/clone@2.1.4: + resolution: {integrity: sha512-NKRWaEGaVGVLnGLB2GazvDaZnyweW9FJLLFL5LhywGJB3aqGMT9R/EUoJoSRP4nzofYnZysuDmrEJtJdAqUOtQ==} + dev: false + /@types/connect@3.4.38: resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} dependencies: @@ -3383,6 +3393,11 @@ packages: mimic-response: 1.0.1 dev: false + /clone@2.1.2: + resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} + engines: {node: '>=0.8'} + dev: false + /cluster-key-slot@1.1.2: resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} engines: {node: '>=0.10.0'} @@ -5502,6 +5517,10 @@ packages: engines: {node: '>= 4'} dev: false + /rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + dev: false + /rollup@4.14.2: resolution: {integrity: sha512-WkeoTWvuBoFjFAhsEOHKRoZ3r9GfTyhh7Vff1zwebEFLEFjT1lG3784xEgKiTa7E+e70vsC81roVL2MP4tgEEQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -6532,7 +6551,7 @@ packages: dev: false file:projects/astar-erc20.tgz(supports-color@8.1.1)(ts-node@10.9.2): - resolution: {integrity: sha512-fqUQYw2QOvqPIa3TEHmaQSQIzf/TRnu92b/cwDihlmlfYV+UwTc/bLpCnBTfDbJWlQ5rPJmY7FJYTzK0zGYIXA==, tarball: file:projects/astar-erc20.tgz} + resolution: {integrity: sha512-nM8FzKINL+LRE3dJYPRcmDUYQylhViG8sv0ITeHvNrThiTwoRw3Is01eRofsmCanLrxKP7sedWQK7+LKLph1gQ==, tarball: file:projects/astar-erc20.tgz} id: file:projects/astar-erc20.tgz name: '@rush-temp/astar-erc20' version: 0.0.0 @@ -6566,7 +6585,7 @@ packages: dev: false file:projects/balances.tgz(supports-color@8.1.1): - resolution: {integrity: sha512-SOIUJD5nBTiOJbTTG9/nx3HAQooJusXGXe6BI7vv1DeSc1UclmhexzZV3VYQim5NRST0DwbsNciDxgh6TqQMEQ==, tarball: file:projects/balances.tgz} + resolution: {integrity: sha512-sVXMA5Q+CTTaWSY0dP6Jy4wuAmKFA7YYb6Phg+Giep32Wo4MhuVqkzfHf2awB1pf+G3A6b0Yn/LmeQsyT6OCLQ==, tarball: file:projects/balances.tgz} id: file:projects/balances.tgz name: '@rush-temp/balances' version: 0.0.0 @@ -6617,7 +6636,7 @@ packages: dev: false file:projects/borsh-bench.tgz: - resolution: {integrity: sha512-4thNgEQETqf3DVQzlFeKdaEBDQDU4C+hLDMDCpzCcBwsbfcTGrh4bqxYZjKHKba2Sl0ZVg2MCiBUuOK6Ujo+wA==, tarball: file:projects/borsh-bench.tgz} + resolution: {integrity: sha512-0xnTzo1dLljgeDpBDXNZwF8r3oM/EyDvJVrdGQq4dq2QPCswCKdFCMubp071rmcJzeZJqbZ7e/FH3tb4bFCgBg==, tarball: file:projects/borsh-bench.tgz} name: '@rush-temp/borsh-bench' version: 0.0.0 dependencies: @@ -6655,7 +6674,7 @@ packages: dev: false file:projects/data-test.tgz: - resolution: {integrity: sha512-XOjgnQzgt0Awd6ZhQK3peOHMglZ9SsH+AHiiREw9Hfds8LCeTp4OhlflLe/QHK3JZInGTdKBHtyNBqkYfReq+g==, tarball: file:projects/data-test.tgz} + resolution: {integrity: sha512-DGiTWToHQch/bYReq5oI0mNGC0LM/WuMe8uwkU1a5sADzS+aX68lIypYVvIkRgpJEfcmOfsa1RgL2mata3AbJg==, tarball: file:projects/data-test.tgz} name: '@rush-temp/data-test' version: 0.0.0 dependencies: @@ -6669,7 +6688,7 @@ packages: dev: false file:projects/erc20-transfers.tgz(supports-color@8.1.1)(ts-node@10.9.2): - resolution: {integrity: sha512-ch12dYQwXZ0AJw/99dxAR9eUhAMZXkOX4f20B7hqoEQavSFASWMOPZ9l6LB1lH3YnS5fBgrgn6dyIjLc9McCSA==, tarball: file:projects/erc20-transfers.tgz} + resolution: {integrity: sha512-AN4uyAnmQuT4N8ns6IAYjw2p6f1suGPLwX/Sj1CrIJ69zUuAK5qPd+dYEDfwKm0FiEbB5/pJya/CQCl3M3tvpw==, tarball: file:projects/erc20-transfers.tgz} id: file:projects/erc20-transfers.tgz name: '@rush-temp/erc20-transfers' version: 0.0.0 @@ -6703,7 +6722,7 @@ packages: dev: false file:projects/evm-abi.tgz(supports-color@8.1.1): - resolution: {integrity: sha512-KGidYnAntwDgonJGlDFpUjhlPahyM1xgkj4cHOnpxVypF7wnahUo3AYG8A++9koD2KQBSmxsFsNaljj2Lgn5rA==, tarball: file:projects/evm-abi.tgz} + resolution: {integrity: sha512-YOB7H12nuCatlWP8NECCnDDpRL7l8wBxH2BauIZQ/4rGNf5zgemknH8DemVjO1wsk5aqx2Nm2lPUw6oF29e4OQ==, tarball: file:projects/evm-abi.tgz} id: file:projects/evm-abi.tgz name: '@rush-temp/evm-abi' version: 0.0.0 @@ -6733,7 +6752,7 @@ packages: dev: false file:projects/evm-codec.tgz(supports-color@8.1.1): - resolution: {integrity: sha512-w1XelVKp/Sb6coGaQYXQw1ho/4UxFlZ2bc9xidnxatDY7yUNGn0TgBOI49OFEPvThDFYCuutY0j9Qre2aWRI4w==, tarball: file:projects/evm-codec.tgz} + resolution: {integrity: sha512-lcRV7X5lEKL8SNPHDvavJN1SAqUq/x+I6b2ArX49I0fLdmmxia0Hw5zKtA4TrbxTFnq9hIfQSgsLrHlzOS8VNg==, tarball: file:projects/evm-codec.tgz} id: file:projects/evm-codec.tgz name: '@rush-temp/evm-codec' version: 0.0.0 @@ -6762,7 +6781,7 @@ packages: dev: false file:projects/evm-processor.tgz: - resolution: {integrity: sha512-QjnluQmW9FI9zI51Kl3xpjK91z7O8taHttj2mMHO3J61beFmSbFgO1iIlUaXOm5f6AQecuxbXAN5+hBKkqm36w==, tarball: file:projects/evm-processor.tgz} + resolution: {integrity: sha512-RoOv+nclQlx/zDAnZmmyDfvG//UkB7b7zkir+M19TX944SsX4BbskPMYBqGX4oIweT+62cOYGD2GYPEBt+Nr9g==, tarball: file:projects/evm-processor.tgz} name: '@rush-temp/evm-processor' version: 0.0.0 dependencies: @@ -6771,7 +6790,7 @@ packages: dev: false file:projects/evm-typegen.tgz: - resolution: {integrity: sha512-HsCgpWkqSwWLDXiToIldaqNXQzUWuC1zviMI7Beb81eRL6Nur5KPU+JJkdRf24EkxOf2XNTCl0evhr8gwVLcdg==, tarball: file:projects/evm-typegen.tgz} + resolution: {integrity: sha512-12v7+7DuFV5DfWMjr7F9EUlsd3Fi2VbiZ8Br9WgclQP5Gg1UpZiZVF7J7fTV9reX1U+I7In+lHEKHh8yRx1DlA==, tarball: file:projects/evm-typegen.tgz} name: '@rush-temp/evm-typegen' version: 0.0.0 dependencies: @@ -6798,7 +6817,7 @@ packages: dev: false file:projects/fuel-data.tgz: - resolution: {integrity: sha512-dNmf9p1d7ilXI4tRNCaUHdDxXbIk3PyT+8bCidHbgofS8t3ZKVw+YdQ2HvRp5slbJ6NnHWAb1YcjYFLGlPp1RQ==, tarball: file:projects/fuel-data.tgz} + resolution: {integrity: sha512-VuXVfyKxlcvaYVTCI0RBJ9qYRwGT/XEGDXqzc3Pa4TttUquQFO0bWB47slxgPiBHYAIgd9/ZejW0DO+UM9k5Fw==, tarball: file:projects/fuel-data.tgz} name: '@rush-temp/fuel-data' version: 0.0.0 dependencies: @@ -6807,7 +6826,7 @@ packages: dev: false file:projects/fuel-dump.tgz: - resolution: {integrity: sha512-uYwx3hc4Vc/pskvTl2RhFp49KzH4YztbdoN+yPoYPzfQdWUgvOrX1/ZDWcWkR9ccjbOvbDBSr6St1EeLeigqjw==, tarball: file:projects/fuel-dump.tgz} + resolution: {integrity: sha512-9j6rLrBfJ5ko3as3QmZH5HnzGM05+CksWCTgZi0FOLMoB336JOgzLCGNTgR/BMTdgcccDjgKqIsvWB/OOSQFpg==, tarball: file:projects/fuel-dump.tgz} name: '@rush-temp/fuel-dump' version: 0.0.0 dependencies: @@ -6816,7 +6835,7 @@ packages: dev: false file:projects/fuel-indexer.tgz(supports-color@8.1.1)(ts-node@10.9.2): - resolution: {integrity: sha512-Lpgs5YWKEUwa4RNULHVdGAkwD1ls4hig8fs18fS4Fs6w776hw7v0W1H1Pp+fByqX1o677tITg06nUULpc7pvhA==, tarball: file:projects/fuel-indexer.tgz} + resolution: {integrity: sha512-5/wI8rl+4dPJDnKYxprkRahZQBggGZ8PFIb++U/Ux8iviuzSgrcTp5QXpbBP0hNSMRItg+EXlEuZ9soH7a+7zg==, tarball: file:projects/fuel-indexer.tgz} id: file:projects/fuel-indexer.tgz name: '@rush-temp/fuel-indexer' version: 0.0.0 @@ -6847,7 +6866,7 @@ packages: dev: false file:projects/fuel-ingest.tgz: - resolution: {integrity: sha512-J4qwkpMsR9v3Tffp05tQWXnRkVKXz0Z22nItSqsz58H8xCWhAXOXs5vuc4AfSvwn/J7wDlR8P+PX1kyT7husjQ==, tarball: file:projects/fuel-ingest.tgz} + resolution: {integrity: sha512-S0MBibhUnPHGEZDmPXeg7Ty0n9KUy8unbwc0KwyFsM6wZPTtLxY7vvEI/fyRE776Zwv1PQC0v05AB7HCNDvrvQ==, tarball: file:projects/fuel-ingest.tgz} name: '@rush-temp/fuel-ingest' version: 0.0.0 dependencies: @@ -6856,7 +6875,7 @@ packages: dev: false file:projects/fuel-normalization.tgz: - resolution: {integrity: sha512-zBSLvem3QcfHry+1tXc/dxvGX/0lL6MtwYjIw8P3mtENMychDho9FwQvOwNt5gAg2qgvJEgSef3GW98ESUjspg==, tarball: file:projects/fuel-normalization.tgz} + resolution: {integrity: sha512-5OC0ntR4l4na/fJyUnjuN7pGx2eF5ice4qg/Ct9VtcqKt3oCVlO6hU2JORMwU1xQRFYq1QQK1pujEucrsnj+pQ==, tarball: file:projects/fuel-normalization.tgz} name: '@rush-temp/fuel-normalization' version: 0.0.0 dependencies: @@ -6865,7 +6884,7 @@ packages: dev: false file:projects/fuel-objects.tgz: - resolution: {integrity: sha512-GWl3yKfrwUeqbl/ov+0AXha8FTkye7hl/uD0jK4pEh9+8d8xGX4fkMclBx/YLNy9JCryPiCtX6kEXNE9sH/74w==, tarball: file:projects/fuel-objects.tgz} + resolution: {integrity: sha512-OJ8Vr2eQP+TmuJ3L2Asj8hxegmNn8aT21XGf+FChQ7SWYEj+VqMtMtpYAqjtG8U5Gyk7wuobahNHuVMVwZFBjg==, tarball: file:projects/fuel-objects.tgz} name: '@rush-temp/fuel-objects' version: 0.0.0 dependencies: @@ -6874,7 +6893,7 @@ packages: dev: false file:projects/fuel-stream.tgz: - resolution: {integrity: sha512-ETASw7qHqdaZlb3lVXkwLg/hnuH8BNlisS5DtM/BE/f2jk6s6fD+ruqa6XKPonNI0NbcJE+ajfUaODjBRNaP+g==, tarball: file:projects/fuel-stream.tgz} + resolution: {integrity: sha512-Mh5LbXoIpmruRVgdRvjZsWUBL6Rws5EMnloykA7f/GgTyqPNbpr1PAw8rqxN7BnD1wqJv38BptByeu3A2dA5pw==, tarball: file:projects/fuel-stream.tgz} name: '@rush-temp/fuel-stream' version: 0.0.0 dependencies: @@ -6901,7 +6920,7 @@ packages: dev: false file:projects/graphql-server.tgz(supports-color@8.1.1)(ts-node@10.9.2): - resolution: {integrity: sha512-Em4HlNc1XsbxZlBDWgi/kyzr3bKi+aey58DMFrJIhpdbZWuUnFVWQUx2MEH5Gd8G+7CJUNOnM8sLI3Y5rcghPg==, tarball: file:projects/graphql-server.tgz} + resolution: {integrity: sha512-yQm2KmgdGJjxe5XLuqx2vUc9DJFc7+WIXiZR81nCke0HlCjZrlrZ5IV6TreN7TQdBNeQ2iAQEnyHxnCGmpFyOQ==, tarball: file:projects/graphql-server.tgz} id: file:projects/graphql-server.tgz name: '@rush-temp/graphql-server' version: 0.0.0 @@ -7005,7 +7024,7 @@ packages: dev: false file:projects/openreader.tgz(supports-color@8.1.1): - resolution: {integrity: sha512-1puqNG9tXqqbQFfGZ7BlcGGLqKiEd6QyjBVyjzkvaW+OQIe1Bwauo/bGl12rBmo/dmREuXfKcMRu3d38noDNdA==, tarball: file:projects/openreader.tgz} + resolution: {integrity: sha512-1yTnDvAUuWzyPC2bH2BZUtYhRMgK7Yh1MDnWwEyBjEhkhrJp/oqZ+8LbN8GpWREaQusvqQn+0U5PLiWqSjfNrw==, tarball: file:projects/openreader.tgz} id: file:projects/openreader.tgz name: '@rush-temp/openreader' version: 0.0.0 @@ -7050,7 +7069,7 @@ packages: dev: false file:projects/raw-archive-validator.tgz: - resolution: {integrity: sha512-q+OGPdLgI3fMid3VGwbwha6STqbMNcC51DlCT89DHIN5L8yJCeT6J9J3xhYRZcjdi/y5FDHH+q/X1VBnI74V2g==, tarball: file:projects/raw-archive-validator.tgz} + resolution: {integrity: sha512-cNBWqHaHWG16Os44defUv2B8FunEseiZFZU3OiNCh6FQXMi2lDWfIVUZ1ls920y/ZImJKBeSWiJ3SAM2b7tp7Q==, tarball: file:projects/raw-archive-validator.tgz} name: '@rush-temp/raw-archive-validator' version: 0.0.0 dependencies: @@ -7089,7 +7108,7 @@ packages: dev: false file:projects/shibuya-psp22.tgz(supports-color@8.1.1)(ts-node@10.9.2): - resolution: {integrity: sha512-UrElinCriyBs2rDud5OJBuRr5TSOQEPviv/aaVCOiiPomNkWReqxRZ1dfKpC2Ab6WaTo+FJ2Kp7Vs48Uz/bF/Q==, tarball: file:projects/shibuya-psp22.tgz} + resolution: {integrity: sha512-1t8Hsg3mW5H7WUZGfcgmUAO08W1QcSQr3t8fkH9E1QhlngZFRh3zCmnETKAcINB5O5qqvzPXEqo9rR7cZv27cQ==, tarball: file:projects/shibuya-psp22.tgz} id: file:projects/shibuya-psp22.tgz name: '@rush-temp/shibuya-psp22' version: 0.0.0 @@ -7120,7 +7139,7 @@ packages: dev: false file:projects/solana-dump.tgz: - resolution: {integrity: sha512-j0NXfhUpCwqsp+WJN5lPFcKUCQNLg1sO48TlJiVRh3oqbrqbk/2YAL1HpbT7IYiUTwjBTDH80t/kq12iIWr0Og==, tarball: file:projects/solana-dump.tgz} + resolution: {integrity: sha512-YzB/1GR4S3BsjfuX2DrapDSm4fimLkLyx2oOxatzkl5Pwgl7IWNNY1MnGcKkvFnRhLZoV8QnCjS+R49BYtiwHw==, tarball: file:projects/solana-dump.tgz} name: '@rush-temp/solana-dump' version: 0.0.0 dependencies: @@ -7129,7 +7148,7 @@ packages: dev: false file:projects/solana-example.tgz(supports-color@8.1.1)(ts-node@10.9.2): - resolution: {integrity: sha512-weRsJJ5qlielUcNWVf7Y/cbsnB1lPnwD3teFDjELKZaehmqAMX3C0rMNp1yLjokpgPk9z4avMmR0QcyjNQ1zZQ==, tarball: file:projects/solana-example.tgz} + resolution: {integrity: sha512-Ns7M8TC//cSLfJybpLFsop3TVKD33gDaCcfjs6VUh/UDsMpEPOmxyGEXmYzujPpmpc/7GD7iBXJ52kZ/po/fHg==, tarball: file:projects/solana-example.tgz} id: file:projects/solana-example.tgz name: '@rush-temp/solana-example' version: 0.0.0 @@ -7160,7 +7179,7 @@ packages: dev: false file:projects/solana-ingest.tgz: - resolution: {integrity: sha512-7cgYeih8AyL9y/y8nq61M44dK9XjxJwQPC1Ydb4Fp12AzwYL8T7ZhJmCVXBr+LIIYLi3USr4hHBgxg3fgxeZMw==, tarball: file:projects/solana-ingest.tgz} + resolution: {integrity: sha512-jfOG8LHbabxvfyr66/F9IvuwLO7XdSE4dEdlPZhrjoq+m7k0gtJ16QVTKDuhAA4U8qOqwtQicuzfPKy+df3iPQ==, tarball: file:projects/solana-ingest.tgz} name: '@rush-temp/solana-ingest' version: 0.0.0 dependencies: @@ -7169,7 +7188,7 @@ packages: dev: false file:projects/solana-normalization.tgz: - resolution: {integrity: sha512-O//+YPMmLqlNLdWYmga/ACWv49TMqzDMJB2iiJZRZzicUODmqFhhq7aY/ZQQe8NV/HrCS19cNomP7YQXHKfVHg==, tarball: file:projects/solana-normalization.tgz} + resolution: {integrity: sha512-y3093dWykFo9bW4AiRNqNSi1DFFvPjEnrr6aMN7Xgwrg86DmvVLhTLJRYk0MUiGp/nD4+WJKOIOd9qkzAy283w==, tarball: file:projects/solana-normalization.tgz} name: '@rush-temp/solana-normalization' version: 0.0.0 dependencies: @@ -7178,7 +7197,7 @@ packages: dev: false file:projects/solana-objects.tgz: - resolution: {integrity: sha512-LZrDlFBde7ywNHYsqlBnWktjLa4aPw2z8ARdoyfh3P3cMoBwtONGnUc33cVb2Jhp+tMlQ1v4mo4RJVqYXuHoGg==, tarball: file:projects/solana-objects.tgz} + resolution: {integrity: sha512-69rX5eue8et5dXGe4uInoFAfW/D5liK8cfcuQX34asOQXKP53i921uSBQDLvbvoxi4JkwGeQur7AjTeKXfLmWQ==, tarball: file:projects/solana-objects.tgz} name: '@rush-temp/solana-objects' version: 0.0.0 dependencies: @@ -7187,7 +7206,7 @@ packages: dev: false file:projects/solana-rpc-data.tgz: - resolution: {integrity: sha512-6wx7ff9zAv3F9wPMB24SuL4EEQYKASBuhMp/nQZvISkEBOFTFnQ1l5N9y+vUY1aMU7+MM6fsvHlLcmUSpd4p9Q==, tarball: file:projects/solana-rpc-data.tgz} + resolution: {integrity: sha512-OjV0jXCULMC0mll8sJlnUEs/WLflfyg8H6RdS0bw1qSzlUrxPWzEKYrP+axvlLwvdnCpZnceYHi4ePa0lqzFfA==, tarball: file:projects/solana-rpc-data.tgz} name: '@rush-temp/solana-rpc-data' version: 0.0.0 dependencies: @@ -7196,7 +7215,7 @@ packages: dev: false file:projects/solana-rpc.tgz: - resolution: {integrity: sha512-WIGmFLuy0IfwhHSITTAvY4ayHzUzgCDci2JvCf1OrOSRTvcOHvswF/Ubmh4BGz2hsIw1/vOndBvCTg2wQx3Pcg==, tarball: file:projects/solana-rpc.tgz} + resolution: {integrity: sha512-+UyXUQwPC520Mt3cwmiJ5CclgON5Fvc7Zw2HVyI/uhME8d2/iSNwjaEsFvYlSZanqfK2mp6IORum0QOZN/d+Tg==, tarball: file:projects/solana-rpc.tgz} name: '@rush-temp/solana-rpc' version: 0.0.0 dependencies: @@ -7205,7 +7224,7 @@ packages: dev: false file:projects/solana-stream.tgz: - resolution: {integrity: sha512-DAb2WWlb+uDB6ze1prkOsHKWXH9cAzkWxh2LubZIDlQTfi2cYkiwYBdvA6yYCUraW1177YVffKzN8I+9gGV6qA==, tarball: file:projects/solana-stream.tgz} + resolution: {integrity: sha512-jNA0VI23u7Z8mdSYSATMKKz5d8Y/ckdo2oRgON+a22cQSvIqRXGbX8yp2RGYK47YkL2pEhfZ6o1GX9il4bxmeA==, tarball: file:projects/solana-stream.tgz} name: '@rush-temp/solana-stream' version: 0.0.0 dependencies: @@ -7215,7 +7234,7 @@ packages: dev: false file:projects/solana-typegen.tgz: - resolution: {integrity: sha512-370CDKZNivGBMfcnWSmTnEuy4qEi1ZetBEtM9eJrWMBMfLkbcQ3oeKdPWpzzl0isSPy8YJxe1/rYKPfkymv0IQ==, tarball: file:projects/solana-typegen.tgz} + resolution: {integrity: sha512-LSlfR1IVH+qzkPzeDnDL7VHsbCNSf6ClQKsMxn4lXcwjYI6dbX2RcWJX+/ImZnWCYJ1k+RtRSN+n6akiAsKcBA==, tarball: file:projects/solana-typegen.tgz} name: '@rush-temp/solana-typegen' version: 0.0.0 dependencies: @@ -7248,7 +7267,7 @@ packages: dev: false file:projects/substrate-data-raw.tgz: - resolution: {integrity: sha512-o7h09auR6YZ/ZQViKLAM8fuEq+PFlk/DCQWH2ShJ1AwsGuZzAesha2oGdUNt56RxFtdAQk9hM6ySbDwuNI8aFw==, tarball: file:projects/substrate-data-raw.tgz} + resolution: {integrity: sha512-T9oA/jEt/x9WA4O38M/74iZ+IbAFzbhCfjX3dVThJIV66mpXhvhXHfN8Fj9kNe4jIjphtU7rWHZE6jvtNcfvGw==, tarball: file:projects/substrate-data-raw.tgz} name: '@rush-temp/substrate-data-raw' version: 0.0.0 dependencies: @@ -7257,7 +7276,7 @@ packages: dev: false file:projects/substrate-data.tgz: - resolution: {integrity: sha512-Omt2Tp505it+SDM9tReb6zEjWGvOzEab4mbbs6FpKiPSupM5+eMkCA1trn9rp/Pk+QUvkuv0CNn7r/HXb7sU2A==, tarball: file:projects/substrate-data.tgz} + resolution: {integrity: sha512-qQHwx9m0DMmQPIwS+4hqTdxToovLJAEukLYTqZQCyF/qnAkFC9ozmyfkuOSkz+chcAbrryouJHwxQgn6xdKMYQ==, tarball: file:projects/substrate-data.tgz} name: '@rush-temp/substrate-data' version: 0.0.0 dependencies: @@ -7268,7 +7287,7 @@ packages: dev: false file:projects/substrate-dump.tgz: - resolution: {integrity: sha512-Tn+o7bwXWDzCZbWQv7qAlxkpcNVjW6Sz7kKk7CXIKPwPwd3QunYTw60IasBuq0rJHTVVCew3GGCb5ipapXMjdQ==, tarball: file:projects/substrate-dump.tgz} + resolution: {integrity: sha512-FUJ19MipnL80R+xikPlYWNL85EWS5DFFMnvL09LgAxi2JjvfoBfvY2jUuUkezEpn0hOFyFrGFKozEnc3kEcAUw==, tarball: file:projects/substrate-dump.tgz} name: '@rush-temp/substrate-dump' version: 0.0.0 dependencies: @@ -7277,7 +7296,7 @@ packages: dev: false file:projects/substrate-ingest.tgz: - resolution: {integrity: sha512-N0gpgIiC5rj1kQIIwMqPMrIGwbtvQ3kMzX3s548N1ZMw7usv+MjgbYJSw0744o54ETZ8KOH2YTI1rZHcimmn7A==, tarball: file:projects/substrate-ingest.tgz} + resolution: {integrity: sha512-XmCLuG8FqnRe5pUUb1gM23NSJbtZxrryH1ubHztSHGhQwZPYRAC6kysLH2srxF99OkuxVCdWPywDtNCW0i0Ddg==, tarball: file:projects/substrate-ingest.tgz} name: '@rush-temp/substrate-ingest' version: 0.0.0 dependencies: @@ -7305,7 +7324,7 @@ packages: dev: false file:projects/substrate-processor.tgz: - resolution: {integrity: sha512-3fvboYXqkBYCSH13tnzyK522VPy+3hhHtSSYJPFFDVuSokA2/flhEciSiPsxc2vemX8BVdvcuanPaFP2dJG1eQ==, tarball: file:projects/substrate-processor.tgz} + resolution: {integrity: sha512-wZi9NLCMCfG3NgxjRylCKqUkV9tZ/re41pzUYpo+srZ+G/PQIz202lM5hcyi3QBvg9Z3/s/ix/18xI2iNrYoIA==, tarball: file:projects/substrate-processor.tgz} name: '@rush-temp/substrate-processor' version: 0.0.0 dependencies: @@ -7314,7 +7333,7 @@ packages: dev: false file:projects/substrate-runtime.tgz: - resolution: {integrity: sha512-ndbIQwyTh3t+Q5AiXk/oawuGVHqQWsCZcTfuPYx++EGYNRcFfYvM3kf9AvFYV0xuptoXTew+VnTHeWlnz0i+pQ==, tarball: file:projects/substrate-runtime.tgz} + resolution: {integrity: sha512-BQmKHPLpPHo90qwSymGADy8dhzW4n+upTa5fynp5DnRKiGm5cy/KYEI0bHj9h6mXfxidsNCpPauSmD6PzwPhmw==, tarball: file:projects/substrate-runtime.tgz} name: '@rush-temp/substrate-runtime' version: 0.0.0 dependencies: @@ -7327,7 +7346,7 @@ packages: dev: false file:projects/substrate-typegen.tgz: - resolution: {integrity: sha512-qXKZIoyz64qLhPMU063hgMeRtGvknlgU7T33O85IY1Fh4KKjaXz9xj8RbHVVso94EB0oktedgqT6JZyzXGtJYw==, tarball: file:projects/substrate-typegen.tgz} + resolution: {integrity: sha512-q6W2NzSV3iKpBeBoQ9qA4z1wawx10JZZ2wT5zIpYnl38NjD+1cn5Di3arUbWHsAo6FU33poRVP83Hs0ctH0Z/Q==, tarball: file:projects/substrate-typegen.tgz} name: '@rush-temp/substrate-typegen' version: 0.0.0 dependencies: @@ -7337,7 +7356,7 @@ packages: dev: false file:projects/typeorm-codegen.tgz: - resolution: {integrity: sha512-NHbOI/JYD7iz4i03UWvMKIZ0d7VbLZB5adSLmkK7nFKjkBFUlDjGoGrMI3CkVO3ToL4VA6s5oujD3nKAykCccA==, tarball: file:projects/typeorm-codegen.tgz} + resolution: {integrity: sha512-6cdUKkYHaSNAZtjWrOQCYCKWnHdWEDzy3GV3jxO1PpDd6ySXiujA5ZsPWOAMSINVs3bfu9tpwvTnvXRZTjjTqw==, tarball: file:projects/typeorm-codegen.tgz} name: '@rush-temp/typeorm-codegen' version: 0.0.0 dependencies: @@ -7347,7 +7366,7 @@ packages: dev: false file:projects/typeorm-config.tgz(pg@8.11.5)(supports-color@8.1.1)(ts-node@10.9.2): - resolution: {integrity: sha512-wKT5CJd1nmlelB6/N9XlgRr89zsY3ZUZ0hxeWxflFK0CXHEpoCAuH9NOue6qpVdTFDDCSVuzgW2pHJhcbHLRwQ==, tarball: file:projects/typeorm-config.tgz} + resolution: {integrity: sha512-QfGFyFFGo+xz1wg5RR7Ez1YZ632lb960Jza+E40D+qHkGjs3R6/6nd4n5AVbPA/hseDGLFFgdYAGCSEYPzdtDQ==, tarball: file:projects/typeorm-config.tgz} id: file:projects/typeorm-config.tgz name: '@rush-temp/typeorm-config' version: 0.0.0 @@ -7377,7 +7396,7 @@ packages: dev: false file:projects/typeorm-migration.tgz(pg@8.11.5)(supports-color@8.1.1)(ts-node@10.9.2): - resolution: {integrity: sha512-1qIAhun15pIWQR53FR4r9vGfopSAqEkhZwOYC1rlNoIzHd+szSGv5+T9VhrT3qd4nnIJsnTNMnu6D2aRRDEI5Q==, tarball: file:projects/typeorm-migration.tgz} + resolution: {integrity: sha512-pMPW0qPmab6ZlrE5VibdnG+OeyQWdrFy81mL+YkoiMhqHbvwLjGRauthM5Bj7hiGcrXSgRU74FUHQWaY5gC87Q==, tarball: file:projects/typeorm-migration.tgz} id: file:projects/typeorm-migration.tgz name: '@rush-temp/typeorm-migration' version: 0.0.0 @@ -7409,17 +7428,20 @@ packages: dev: false file:projects/typeorm-store.tgz(supports-color@8.1.1)(ts-node@10.9.2): - resolution: {integrity: sha512-sXhxNVktY6PiOA0HiRCYo8dJlsT4AH259wOZ3ledM0FnVRV+6XxQ6Btbd2Yw/9N74raYn5FeRyhSYcewH0Zjmg==, tarball: file:projects/typeorm-store.tgz} + resolution: {integrity: sha512-Joq7km/6OnWAsR29wWfxfKSX7WKZSCNe6EPzJ42LuUQeIhwSB9l4ScgD5QHKLwGfG5dpS+0WUHeT9GvVMv5Qkg==, tarball: file:projects/typeorm-store.tgz} id: file:projects/typeorm-store.tgz name: '@rush-temp/typeorm-store' version: 0.0.0 dependencies: + '@types/clone': 2.1.4 '@types/mocha': 10.0.6 '@types/node': 18.19.31 '@types/pg': 8.11.5 + clone: 2.1.2 expect: 29.7.0 mocha: 10.4.0 pg: 8.11.5 + rfdc: 1.4.1 typeorm: 0.3.20(pg@8.11.5)(supports-color@8.1.1)(ts-node@10.9.2) typescript: 5.3.3 transitivePeerDependencies: @@ -7515,7 +7537,7 @@ packages: dev: false file:projects/util-internal-dump-cli.tgz: - resolution: {integrity: sha512-RSNg1RNaDTjBXo1gBwOQrhwSB2t1yHPPm6Dtt7dORMcWod2AubPtG+JRXodw5FsulKMKL+EQ2CYGjTNycboxrA==, tarball: file:projects/util-internal-dump-cli.tgz} + resolution: {integrity: sha512-xgG4eXDo6rW+fJukgdy7UofH0WOSwoJBYu894LYJq7BscGyFgA5vg4hPB7Oyngt1WOQUalKiolKFsIpPCXaqZQ==, tarball: file:projects/util-internal-dump-cli.tgz} name: '@rush-temp/util-internal-dump-cli' version: 0.0.0 dependencies: @@ -7559,7 +7581,7 @@ packages: dev: false file:projects/util-internal-ingest-cli.tgz: - resolution: {integrity: sha512-ACgY+iOdRYoLQhT1B1ys26kxz8WNBf1TP8trLw+yXUyM8tSZ6rg5VXM3raB89TO38vGBTOVC1Xw/2V9/lmiwzA==, tarball: file:projects/util-internal-ingest-cli.tgz} + resolution: {integrity: sha512-aUnjqkCZ1K036D1WsGDalurA8VO5LOChQxgqrTXNHZwIsNU92wERfGdHQ8IkfXDQ/n7TcL/MRd1fNjS6HzftWg==, tarball: file:projects/util-internal-ingest-cli.tgz} name: '@rush-temp/util-internal-ingest-cli' version: 0.0.0 dependencies: diff --git a/typeorm/typeorm-store/package.json b/typeorm/typeorm-store/package.json index f467708cd..1faa34e44 100644 --- a/typeorm/typeorm-store/package.json +++ b/typeorm/typeorm-store/package.json @@ -20,13 +20,15 @@ "dependencies": { "@subsquid/typeorm-config": "^4.1.1", "@subsquid/util-internal": "^3.2.0", - "@subsquid/logger": "^1.3.3" + "@subsquid/logger": "^1.3.3", + "clone": "^2.1.2" }, "peerDependencies": { "typeorm": "^0.3.17", "@subsquid/big-decimal": "^1.0.0" }, "devDependencies": { + "@types/clone": "^2.1.4", "@types/mocha": "^10.0.6", "@types/node": "^18.18.14", "@types/pg": "^8.10.9", diff --git a/typeorm/typeorm-store/src/utils/cacheMap.ts b/typeorm/typeorm-store/src/utils/cacheMap.ts index 7a9af0233..a166ae774 100644 --- a/typeorm/typeorm-store/src/utils/cacheMap.ts +++ b/typeorm/typeorm-store/src/utils/cacheMap.ts @@ -1,6 +1,7 @@ import {EntityMetadata} from 'typeorm' -import {copy, EntityLiteral} from './misc' +import {EntityLiteral} from './misc' import {Logger} from '@subsquid/logger' +import clone from 'clone' export class CachedEntity { constructor(public value: E | null = null) {} @@ -63,7 +64,7 @@ export class CacheMap { for (const column of metadata.nonVirtualColumns) { const objectColumnValue = column.getEntityValue(entity) if (isNew || objectColumnValue !== undefined) { - column.setEntityValue(cachedEntity, copy(objectColumnValue ?? null)) + column.setEntityValue(cachedEntity, clone(objectColumnValue ?? null)) } } diff --git a/typeorm/typeorm-store/src/utils/misc.ts b/typeorm/typeorm-store/src/utils/misc.ts index c293f9baa..353fd50b2 100644 --- a/typeorm/typeorm-store/src/utils/misc.ts +++ b/typeorm/typeorm-store/src/utils/misc.ts @@ -17,53 +17,6 @@ export function* splitIntoBatches(list: T[], maxBatchSize: number): Generator } } -const copiedObjects = new WeakMap() - -export function copy(obj: T): T { - if (typeof obj !== 'object' || obj == null) { - return obj - } - - if (copiedObjects.has(obj)) { - return copiedObjects.get(obj) - } else if (obj instanceof Date) { - return new Date(obj) as any - } else if (Array.isArray(obj)) { - const clone = obj.map((i) => copy(i)) - copiedObjects.set(obj, clone) - return clone as any - } else if (obj instanceof Map) { - const clone = new Map(Array.from(obj).map((i) => copy(i))) - copiedObjects.set(obj, clone) - return clone as any - } else if (obj instanceof Set) { - const clone = new Set(Array.from(obj).map((i) => copy(i))) - copiedObjects.set(obj, clone) - return clone as any - } else if (ArrayBuffer.isView(obj)) { - return copyBuffer(obj) - } else { - const clone = Object.create(Object.getPrototypeOf(obj)) - copiedObjects.set(obj, clone) - - for (const k in obj) { - if (obj.hasOwnProperty(k)) { - clone[k] = copy(obj[k]) - } - } - - return clone - } -} - -function copyBuffer(buf: any) { - if (buf instanceof Buffer) { - return Buffer.from(buf) - } else { - return new buf.constructor(buf.buffer.slice(), buf.byteOffset, buf.length) - } -} - export function mergeRelations( a: FindOptionsRelations, b: FindOptionsRelations diff --git a/typeorm/typeorm-store/src/utils/stateManager.ts b/typeorm/typeorm-store/src/utils/stateManager.ts index 86de1e102..c1311fccb 100644 --- a/typeorm/typeorm-store/src/utils/stateManager.ts +++ b/typeorm/typeorm-store/src/utils/stateManager.ts @@ -2,9 +2,9 @@ import {Logger} from '@subsquid/logger' import {EntityManager, EntityMetadata, FindOptionsRelations} from 'typeorm' import {CacheMap} from './cacheMap' import assert from 'assert' -import {copy, EntityLiteral} from './misc' -import {sortMetadatasInCommitOrder} from './commitOrder' +import {EntityLiteral} from './misc' import {unexpectedCase} from '@subsquid/util-internal' +import clone from 'clone' export enum ChangeType { Insert = 'insert', @@ -50,7 +50,7 @@ export class StateManager { for (const column of metadata.nonVirtualColumns) { const objectColumnValue = column.getEntityValue(entity) if (objectColumnValue !== undefined) { - column.setEntityValue(clonedEntity, copy(objectColumnValue)) + column.setEntityValue(clonedEntity, clone(objectColumnValue)) } }