From 4a04cad3da8375c04c61923ecb1711afa37f6aaf Mon Sep 17 00:00:00 2001 From: David Vitor Antonio Date: Tue, 12 Sep 2023 12:50:21 -0300 Subject: [PATCH 1/2] fix(engine): lock sqlite version --- packages/engine/package.json | 2 +- yarn.lock | 328 +++++++++++++++++++++++++++++------ 2 files changed, 275 insertions(+), 55 deletions(-) diff --git a/packages/engine/package.json b/packages/engine/package.json index e4505813e..29ebbc689 100644 --- a/packages/engine/package.json +++ b/packages/engine/package.json @@ -39,7 +39,7 @@ "pg": "^8.7.1", "redlock": "^4.2.0", "semver": "^7.3.5", - "sqlite3": "^5.0.2", + "sqlite3": "5.0.2", "uuid": "^8.3.2", "yn": "^4.0.0" } diff --git a/yarn.lock b/yarn.lock index 1a78dc353..0d8cfdd1e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2376,7 +2376,7 @@ __metadata: pg: ^8.7.1 redlock: ^4.2.0 semver: ^7.3.5 - sqlite3: ^5.0.2 + sqlite3: 5.0.2 uuid: ^8.3.2 yn: ^4.0.0 languageName: unknown @@ -3517,25 +3517,6 @@ __metadata: languageName: node linkType: hard -"@mapbox/node-pre-gyp@npm:^1.0.0": - version: 1.0.11 - resolution: "@mapbox/node-pre-gyp@npm:1.0.11" - dependencies: - detect-libc: ^2.0.0 - https-proxy-agent: ^5.0.0 - make-dir: ^3.1.0 - node-fetch: ^2.6.7 - nopt: ^5.0.0 - npmlog: ^5.0.1 - rimraf: ^3.0.2 - semver: ^7.3.5 - tar: ^6.1.11 - bin: - node-pre-gyp: bin/node-pre-gyp - checksum: b848f6abc531a11961d780db813cc510ca5a5b6bf3184d72134089c6875a91c44d571ba6c1879470020803f7803609e7b2e6e429651c026fe202facd11d444b8 - languageName: node - linkType: hard - "@mapbox/node-pre-gyp@npm:^1.0.8": version: 1.0.10 resolution: "@mapbox/node-pre-gyp@npm:1.0.10" @@ -9334,6 +9315,15 @@ __metadata: languageName: node linkType: hard +"block-stream@npm:*": + version: 0.0.9 + resolution: "block-stream@npm:0.0.9" + dependencies: + inherits: ~2.0.0 + checksum: 72733cbb816181b7c92449e7b650247c02122f743526ce9d948ff68afc27d8709106cd62f2c876c6d8cd3977e0204a014f38d22805974008039bd3bed35f2cbd + languageName: node + linkType: hard + "bluebird@npm:3.7.2, bluebird@npm:^3.3.5, bluebird@npm:^3.5.5, bluebird@npm:^3.7.2": version: 3.7.2 resolution: "bluebird@npm:3.7.2" @@ -10155,7 +10145,7 @@ __metadata: languageName: node linkType: hard -"chownr@npm:^1.1.1": +"chownr@npm:^1.1.1, chownr@npm:^1.1.4": version: 1.1.4 resolution: "chownr@npm:1.1.4" checksum: 115648f8eb38bac5e41c3857f3e663f9c39ed6480d1349977c4d96c95a47266fcacc5a5aabf3cb6c481e22d72f41992827db47301851766c4fd77ac21a4f081d @@ -11570,7 +11560,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:^3.0.0, debug@npm:^3.1.0, debug@npm:^3.1.1, debug@npm:^3.2.7": +"debug@npm:^3.0.0, debug@npm:^3.1.0, debug@npm:^3.1.1, debug@npm:^3.2.6, debug@npm:^3.2.7": version: 3.2.7 resolution: "debug@npm:3.2.7" dependencies: @@ -11803,7 +11793,7 @@ __metadata: languageName: node linkType: hard -"detect-libc@npm:^1.0.3": +"detect-libc@npm:^1.0.2, detect-libc@npm:^1.0.3": version: 1.0.3 resolution: "detect-libc@npm:1.0.3" bin: @@ -13971,6 +13961,15 @@ __metadata: languageName: node linkType: hard +"fs-minipass@npm:^1.2.7": + version: 1.2.7 + resolution: "fs-minipass@npm:1.2.7" + dependencies: + minipass: ^2.6.0 + checksum: 40fd46a2b5dcb74b3a580269f9a0c36f9098c2ebd22cef2e1a004f375b7b665c11f1507ec3f66ee6efab5664109f72d0a74ea19c3370842214c3da5168d6fdd7 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -14053,6 +14052,18 @@ __metadata: languageName: node linkType: hard +"fstream@npm:^1.0.0, fstream@npm:^1.0.12": + version: 1.0.12 + resolution: "fstream@npm:1.0.12" + dependencies: + graceful-fs: ^4.1.2 + inherits: ~2.0.0 + mkdirp: ">=0.5 0" + rimraf: 2 + checksum: e6998651aeb85fd0f0a8a68cec4d05a3ada685ecc4e3f56e0d063d0564a4fc39ad11a856f9020f926daf869fc67f7a90e891def5d48e4cadab875dc313094536 + languageName: node + linkType: hard + "function-bind@npm:^1.1.1": version: 1.1.1 resolution: "function-bind@npm:1.1.1" @@ -14399,6 +14410,20 @@ __metadata: languageName: node linkType: hard +"glob@npm:^7.0.3": + version: 7.2.3 + resolution: "glob@npm:7.2.3" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^3.1.1 + once: ^1.3.0 + path-is-absolute: ^1.0.0 + checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133 + languageName: node + linkType: hard + "global-dirs@npm:^3.0.0": version: 3.0.0 resolution: "global-dirs@npm:3.0.0" @@ -15178,7 +15203,7 @@ __metadata: languageName: node linkType: hard -"iconv-lite@npm:0.4.24": +"iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.4": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24" dependencies: @@ -15242,6 +15267,15 @@ __metadata: languageName: node linkType: hard +"ignore-walk@npm:^3.0.1": + version: 3.0.4 + resolution: "ignore-walk@npm:3.0.4" + dependencies: + minimatch: ^3.0.4 + checksum: 9e9c5ef6c3e0ed7ef5d797991abb554dbb7e60d5fedf6cf05c7129819689eba2b462f625c6e3561e0fc79841904eb829565513eeeab1b44f4fbec4d3146b1a8d + languageName: node + linkType: hard + "ignore@npm:^4.0.3, ignore@npm:^4.0.6": version: 4.0.6 resolution: "ignore@npm:4.0.6" @@ -15323,7 +15357,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.0, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.1, inherits@npm:~2.0.3, inherits@npm:~2.0.4": +"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.0, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4, inherits@npm:~2.0.0, inherits@npm:~2.0.1, inherits@npm:~2.0.3, inherits@npm:~2.0.4": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -18334,7 +18368,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.3": +"minimatch@npm:^3.0.3, minimatch@npm:^3.1.1": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -18426,6 +18460,16 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^2.6.0, minipass@npm:^2.9.0": + version: 2.9.0 + resolution: "minipass@npm:2.9.0" + dependencies: + safe-buffer: ^5.1.2 + yallist: ^3.0.0 + checksum: 077b66f31ba44fd5a0d27d12a9e6a86bff8f97a4978dedb0373167156b5599fadb6920fdde0d9f803374164d810e05e8462ce28e86abbf7f0bea293a93711fc6 + languageName: node + linkType: hard + "minipass@npm:^3.0.0, minipass@npm:^3.1.0, minipass@npm:^3.1.1, minipass@npm:^3.1.3": version: 3.1.6 resolution: "minipass@npm:3.1.6" @@ -18435,6 +18479,15 @@ __metadata: languageName: node linkType: hard +"minizlib@npm:^1.3.3": + version: 1.3.3 + resolution: "minizlib@npm:1.3.3" + dependencies: + minipass: ^2.9.0 + checksum: b0425c04d2ae6aad5027462665f07cc0d52075f7fa16e942b4611115f9b31f02924073b7221be6f75929d3c47ab93750c63f6dc2bbe8619ceacb3de1f77732c0 + languageName: node + linkType: hard + "minizlib@npm:^2.0.0, minizlib@npm:^2.1.1": version: 2.1.2 resolution: "minizlib@npm:2.1.2" @@ -18480,6 +18533,17 @@ __metadata: languageName: node linkType: hard +"mkdirp@npm:>=0.5 0, mkdirp@npm:^0.5.0": + version: 0.5.6 + resolution: "mkdirp@npm:0.5.6" + dependencies: + minimist: ^1.2.6 + bin: + mkdirp: bin/cmd.js + checksum: 0c91b721bb12c3f9af4b77ebf73604baf350e64d80df91754dc509491ae93bf238581e59c7188360cec7cb62fc4100959245a42cfe01834efedc5e9d068376c2 + languageName: node + linkType: hard + "mkdirp@npm:^0.5.1, mkdirp@npm:^0.5.3, mkdirp@npm:^0.5.5": version: 0.5.5 resolution: "mkdirp@npm:0.5.5" @@ -18717,6 +18781,19 @@ __metadata: languageName: node linkType: hard +"needle@npm:^2.2.1": + version: 2.9.1 + resolution: "needle@npm:2.9.1" + dependencies: + debug: ^3.2.6 + iconv-lite: ^0.4.4 + sax: ^1.2.4 + bin: + needle: ./bin/needle + checksum: 746ae3a3782f0a057ff304a98843cc6f2009f978a0fad0c3e641a9d46d0b5702bb3e197ba08aecd48678067874a991c4f5fc320c7e51a4c041d9dd3441146cf0 + languageName: node + linkType: hard + "negotiator@npm:0.6.2, negotiator@npm:^0.6.2": version: 0.6.2 resolution: "negotiator@npm:0.6.2" @@ -18785,7 +18862,7 @@ __metadata: languageName: node linkType: hard -"node-addon-api@npm:^3.2.1": +"node-addon-api@npm:^3.0.0, node-addon-api@npm:^3.2.1": version: 3.2.1 resolution: "node-addon-api@npm:3.2.1" dependencies: @@ -18794,15 +18871,6 @@ __metadata: languageName: node linkType: hard -"node-addon-api@npm:^4.2.0": - version: 4.3.0 - resolution: "node-addon-api@npm:4.3.0" - dependencies: - node-gyp: latest - checksum: 3de396e23cc209f539c704583e8e99c148850226f6e389a641b92e8967953713228109f919765abc1f4355e801e8f41842f96210b8d61c7dcc10a477002dcf00 - languageName: node - linkType: hard - "node-dir@npm:^0.1.10": version: 0.1.17 resolution: "node-dir@npm:0.1.17" @@ -18854,7 +18922,29 @@ __metadata: languageName: node linkType: hard -"node-gyp@npm:8.x, node-gyp@npm:latest": +"node-gyp@npm:3.x": + version: 3.8.0 + resolution: "node-gyp@npm:3.8.0" + dependencies: + fstream: ^1.0.0 + glob: ^7.0.3 + graceful-fs: ^4.1.2 + mkdirp: ^0.5.0 + nopt: 2 || 3 + npmlog: 0 || 1 || 2 || 3 || 4 + osenv: 0 + request: ^2.87.0 + rimraf: 2 + semver: ~5.3.0 + tar: ^2.0.0 + which: 1 + bin: + node-gyp: ./bin/node-gyp.js + checksum: e99d740db6f5462cfd2f03fdfa89bae7e509e37f158d78a2fec0c858984cceb801723510656110d8f1d0ecf69cc2ceba8b477d22aac3e69ce8094db19dff6b2b + languageName: node + linkType: hard + +"node-gyp@npm:latest": version: 8.4.1 resolution: "node-gyp@npm:8.4.1" dependencies: @@ -18912,6 +19002,26 @@ __metadata: languageName: node linkType: hard +"node-pre-gyp@npm:^0.11.0": + version: 0.11.0 + resolution: "node-pre-gyp@npm:0.11.0" + dependencies: + detect-libc: ^1.0.2 + mkdirp: ^0.5.1 + needle: ^2.2.1 + nopt: ^4.0.1 + npm-packlist: ^1.1.6 + npmlog: ^4.0.2 + rc: ^1.2.7 + rimraf: ^2.6.1 + semver: ^5.3.0 + tar: ^4 + bin: + node-pre-gyp: ./bin/node-pre-gyp + checksum: b0db47eb6594d6a6844efa2ee75a12c772a22109f67dd864d6bc14538752c1c336e8d640af3a6f92504ac67d68be5aa186a5de169e1e0626df58f003ff2a8133 + languageName: node + linkType: hard + "node-releases@npm:^2.0.1": version: 2.0.1 resolution: "node-releases@npm:2.0.1" @@ -18936,6 +19046,29 @@ __metadata: languageName: node linkType: hard +"nopt@npm:2 || 3": + version: 3.0.6 + resolution: "nopt@npm:3.0.6" + dependencies: + abbrev: 1 + bin: + nopt: ./bin/nopt.js + checksum: 7f8579029a0d7cb3341c6b1610b31e363f708b7aaaaf3580e3ec5ae8528d1f3a79d350d8bfa331776e6c6703a5a148b72edd9b9b4c1dd55874d8e70e963d1e20 + languageName: node + linkType: hard + +"nopt@npm:^4.0.1": + version: 4.0.3 + resolution: "nopt@npm:4.0.3" + dependencies: + abbrev: 1 + osenv: ^0.1.4 + bin: + nopt: bin/nopt.js + checksum: 66cd3b6021fc8130fc201236bc3dce614fc86988b78faa91377538b09d57aad9ba4300b5d6a01dc93d6c6f2c170f81cc893063d496d108150b65191beb4a50a4 + languageName: node + linkType: hard + "nopt@npm:^5.0.0": version: 5.0.0 resolution: "nopt@npm:5.0.0" @@ -19008,6 +19141,33 @@ __metadata: languageName: node linkType: hard +"npm-bundled@npm:^1.0.1": + version: 1.1.2 + resolution: "npm-bundled@npm:1.1.2" + dependencies: + npm-normalize-package-bin: ^1.0.1 + checksum: 6e599155ef28d0b498622f47f1ba189dfbae05095a1ed17cb3a5babf961e965dd5eab621f0ec6f0a98de774e5836b8f5a5ee639010d64f42850a74acec3d4d09 + languageName: node + linkType: hard + +"npm-normalize-package-bin@npm:^1.0.1": + version: 1.0.1 + resolution: "npm-normalize-package-bin@npm:1.0.1" + checksum: ae7f15155a1e3ace2653f12ddd1ee8eaa3c84452fdfbf2f1943e1de264e4b079c86645e2c55931a51a0a498cba31f70022a5219d5665fbcb221e99e58bc70122 + languageName: node + linkType: hard + +"npm-packlist@npm:^1.1.6": + version: 1.4.8 + resolution: "npm-packlist@npm:1.4.8" + dependencies: + ignore-walk: ^3.0.1 + npm-bundled: ^1.0.1 + npm-normalize-package-bin: ^1.0.1 + checksum: 85f764bd0fb516cff34afb4b60ea925ef218cfbdf02d05cda0c115ca30b932b9e0f78bdb186e09d26dd17f983ee1d5aee7ba44b5db84ff3c4c5e73524b537084 + languageName: node + linkType: hard + "npm-run-path@npm:^2.0.0": version: 2.0.2 resolution: "npm-run-path@npm:2.0.2" @@ -19026,7 +19186,7 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:^4.0.1": +"npmlog@npm:0 || 1 || 2 || 3 || 4, npmlog@npm:^4.0.1, npmlog@npm:^4.0.2": version: 4.1.2 resolution: "npmlog@npm:4.1.2" dependencies: @@ -19365,13 +19525,30 @@ __metadata: languageName: node linkType: hard -"os-homedir@npm:^1.0.1": +"os-homedir@npm:^1.0.0, os-homedir@npm:^1.0.1": version: 1.0.2 resolution: "os-homedir@npm:1.0.2" checksum: af609f5a7ab72de2f6ca9be6d6b91a599777afc122ac5cad47e126c1f67c176fe9b52516b9eeca1ff6ca0ab8587fe66208bc85e40a3940125f03cdb91408e9d2 languageName: node linkType: hard +"os-tmpdir@npm:^1.0.0": + version: 1.0.2 + resolution: "os-tmpdir@npm:1.0.2" + checksum: 5666560f7b9f10182548bf7013883265be33620b1c1b4a4d405c25be2636f970c5488ff3e6c48de75b55d02bde037249fe5dbfbb4c0fb7714953d56aed062e6d + languageName: node + linkType: hard + +"osenv@npm:0, osenv@npm:^0.1.4": + version: 0.1.5 + resolution: "osenv@npm:0.1.5" + dependencies: + os-homedir: ^1.0.0 + os-tmpdir: ^1.0.0 + checksum: 779d261920f2a13e5e18cf02446484f12747d3f2ff82280912f52b213162d43d312647a40c332373cbccd5e3fb8126915d3bfea8dde4827f70f82da76e52d359 + languageName: node + linkType: hard + "ospath@npm:^1.2.2": version: 1.2.2 resolution: "ospath@npm:1.2.2" @@ -22088,7 +22265,7 @@ __metadata: languageName: node linkType: hard -"request@npm:^2.88.2": +"request@npm:^2.87.0, request@npm:^2.88.2": version: 2.88.2 resolution: "request@npm:2.88.2" dependencies: @@ -22313,7 +22490,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^2.2.8, rimraf@npm:^2.5.4, rimraf@npm:^2.6.1, rimraf@npm:^2.6.3": +"rimraf@npm:2, rimraf@npm:^2.2.8, rimraf@npm:^2.5.4, rimraf@npm:^2.6.1, rimraf@npm:^2.6.3": version: 2.7.1 resolution: "rimraf@npm:2.7.1" dependencies: @@ -22431,7 +22608,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.1, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.1, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:^5.2.1, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -22502,7 +22679,7 @@ __metadata: languageName: node linkType: hard -"sax@npm:>=0.6.0": +"sax@npm:>=0.6.0, sax@npm:^1.2.4": version: 1.2.4 resolution: "sax@npm:1.2.4" checksum: d3df7d32b897a2c2f28e941f732c71ba90e27c24f62ee918bd4d9a8cfb3553f2f81e5493c7f0be94a11c1911b643a9108f231dd6f60df3fa9586b5d2e3e9e1fe @@ -22625,6 +22802,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^5.3.0": + version: 5.7.2 + resolution: "semver@npm:5.7.2" + bin: + semver: bin/semver + checksum: fb4ab5e0dd1c22ce0c937ea390b4a822147a9c53dbd2a9a0132f12fe382902beef4fbf12cf51bb955248d8d15874ce8cd89532569756384f994309825f10b686 + languageName: node + linkType: hard + "semver@npm:^6.0.0, semver@npm:^6.1.1, semver@npm:^6.1.2, semver@npm:^6.3.0": version: 6.3.0 resolution: "semver@npm:6.3.0" @@ -22634,6 +22820,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:~5.3.0": + version: 5.3.0 + resolution: "semver@npm:5.3.0" + bin: + semver: ./bin/semver + checksum: 2717b14299c76a4b35aec0aafebca22a3644da2942d2a4095f26e36d77a9bbe17a9a3a5199795f83edd26323d5c22024a2d9d373a038dec4e023156fa166d314 + languageName: node + linkType: hard + "send@npm:0.17.1": version: 0.17.1 resolution: "send@npm:0.17.1" @@ -23302,23 +23497,22 @@ __metadata: languageName: node linkType: hard -"sqlite3@npm:^5.0.2": - version: 5.1.6 - resolution: "sqlite3@npm:5.1.6" +"sqlite3@npm:5.0.2": + version: 5.0.2 + resolution: "sqlite3@npm:5.0.2" dependencies: - "@mapbox/node-pre-gyp": ^1.0.0 - node-addon-api: ^4.2.0 - node-gyp: 8.x - tar: ^6.1.11 + node-addon-api: ^3.0.0 + node-gyp: 3.x + node-pre-gyp: ^0.11.0 peerDependencies: - node-gyp: 8.x + node-gyp: 3.x dependenciesMeta: node-gyp: optional: true peerDependenciesMeta: node-gyp: optional: true - checksum: ea640628843e37a63dfb4bd2c8429dbd7aab845c1a8204574dca3aac61486ab65bc0abfd99b48f1cead1f783171c6111c0cc4115335d5b95bb0b4eb44db162d5 + checksum: 28ef541b3289c3a154c538f268c9e2656d1f5cc6c768bb6173b83037c02d1b889047f88233bc2e801885cea7e4c184d3a0d5b23ddced6fd6e192dc69c21a8961 languageName: node linkType: hard @@ -23972,6 +24166,32 @@ __metadata: languageName: node linkType: hard +"tar@npm:^2.0.0": + version: 2.2.2 + resolution: "tar@npm:2.2.2" + dependencies: + block-stream: "*" + fstream: ^1.0.12 + inherits: 2 + checksum: c0c3727d529077423cf771f9f9c06edaaff82034d05d685806d3cee69d334ee8e6f394ee8d02dbd294cdecb95bb22625703279caff24bdb90b17e59de03a4733 + languageName: node + linkType: hard + +"tar@npm:^4": + version: 4.4.19 + resolution: "tar@npm:4.4.19" + dependencies: + chownr: ^1.1.4 + fs-minipass: ^1.2.7 + minipass: ^2.9.0 + minizlib: ^1.3.3 + mkdirp: ^0.5.5 + safe-buffer: ^5.2.1 + yallist: ^3.1.1 + checksum: 423c8259b17f8f612cef9c96805d65f90ba9a28e19be582cd9d0fcb217038219f29b7547198e8fd617da5f436376d6a74b99827acd1238d2f49cf62330f9664e + languageName: node + linkType: hard + "tar@npm:^6.0.2, tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.1.11 resolution: "tar@npm:6.1.11" @@ -25778,7 +25998,7 @@ __metadata: languageName: node linkType: hard -"which@npm:^1.2.12, which@npm:^1.2.9": +"which@npm:1, which@npm:^1.2.12, which@npm:^1.2.9": version: 1.3.1 resolution: "which@npm:1.3.1" dependencies: @@ -26032,7 +26252,7 @@ __metadata: languageName: node linkType: hard -"yallist@npm:^3.0.2": +"yallist@npm:^3.0.0, yallist@npm:^3.0.2, yallist@npm:^3.1.1": version: 3.1.1 resolution: "yallist@npm:3.1.1" checksum: 48f7bb00dc19fc635a13a39fe547f527b10c9290e7b3e836b9a8f1ca04d4d342e85714416b3c2ab74949c9c66f9cebb0473e6bc353b79035356103b47641285d From 47ffeedb7a9fc2863d363abe6f57da7d82d7e45f Mon Sep 17 00:00:00 2001 From: David Vitor Antonio Date: Tue, 23 Jan 2024 17:45:17 -0300 Subject: [PATCH 2/2] feat(twillio): add message delay config --- packages/channels/src/twilio/config.ts | 4 +++- packages/channels/src/twilio/senders/common.ts | 8 ++++++++ packages/server/src/channels/api.ts | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/channels/src/twilio/config.ts b/packages/channels/src/twilio/config.ts index ee4d450f4..91286477a 100644 --- a/packages/channels/src/twilio/config.ts +++ b/packages/channels/src/twilio/config.ts @@ -4,9 +4,11 @@ import { ChannelConfig } from '../base/config' export interface TwilioConfig extends ChannelConfig { accountSID: string authToken: string + messageDelay?: string } export const TwilioConfigSchema = { accountSID: Joi.string().regex(/^AC.*/).required(), - authToken: Joi.string().required() + authToken: Joi.string().required(), + messageDelay: Joi.string().optional() } diff --git a/packages/channels/src/twilio/senders/common.ts b/packages/channels/src/twilio/senders/common.ts index 7a7378d9f..ab472c66b 100644 --- a/packages/channels/src/twilio/senders/common.ts +++ b/packages/channels/src/twilio/senders/common.ts @@ -1,3 +1,4 @@ +import ms from 'ms' import { CommonSender } from '../../base/senders/common' import { TwilioContext } from '../context' @@ -9,6 +10,13 @@ export class TwilioCommonSender extends CommonSender { from: context.identity, to: context.sender }) + + const { messageDelay } = context.state.config + if (messageDelay) { + // depending on the account it might be required to limit the rps to each number + // usually this is an issue for carousels + await new Promise((resolve) => setTimeout(resolve, ms(messageDelay))) + } } } } diff --git a/packages/server/src/channels/api.ts b/packages/server/src/channels/api.ts index be3964875..c373b6962 100644 --- a/packages/server/src/channels/api.ts +++ b/packages/server/src/channels/api.ts @@ -34,7 +34,7 @@ export class ChannelApi { channel.on('message', async (e) => this.handleChannelMessage(channel, e)) channel.on('proactive', async (e) => this.handleChannelProactive(channel, e)) - await channel.setup(router) + await channel.setup(router, channel.logger) } }