From a895ee87fcdafec5163313c62b6300e100ad5495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 19 Dec 2023 16:53:12 +0100 Subject: [PATCH] feat(core): Upgrade Rudderstack SDK (no-changelog) (#8090) This helps remove some of the older versions of transient dependencies, like axios 0.x and ioredis 4.x. ## Review / Merge checklist - [x] PR title and summary are descriptive. --- packages/cli/package.json | 2 +- packages/cli/src/telemetry/index.ts | 16 +-- pnpm-lock.yaml | 191 +++++++--------------------- 3 files changed, 51 insertions(+), 158 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 62785cd5c2..ed18b7aba9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -105,7 +105,7 @@ "@oclif/config": "1.18.17", "@oclif/core": "1.16.6", "@oclif/errors": "1.3.6", - "@rudderstack/rudder-sdk-node": "1.0.6", + "@rudderstack/rudder-sdk-node": "2.0.6", "@sentry/integrations": "7.87.0", "@sentry/node": "7.87.0", "axios": "1.6.2", diff --git a/packages/cli/src/telemetry/index.ts b/packages/cli/src/telemetry/index.ts index 158677c047..2f8d82ab11 100644 --- a/packages/cli/src/telemetry/index.ts +++ b/packages/cli/src/telemetry/index.ts @@ -59,7 +59,7 @@ export class Telemetry { const logLevel = config.getEnv('logs.level'); const { default: RudderStack } = await import('@rudderstack/rudder-sdk-node'); - this.rudderStack = new RudderStack(key, url, { logLevel }); + this.rudderStack = new RudderStack(key, { logLevel, dataPlaneUrl: url }); this.startPulse(); } @@ -152,16 +152,8 @@ export class Telemetry { async trackN8nStop(): Promise { clearInterval(this.pulseIntervalReference); - void this.track('User instance stopped'); - return new Promise(async (resolve) => { - await this.postHog.stop(); - - if (this.rudderStack) { - this.rudderStack.flush(resolve); - } else { - resolve(); - } - }); + await this.track('User instance stopped'); + await Promise.all([this.postHog.stop(), this.rudderStack?.flush()]); } async identify(traits?: { @@ -192,7 +184,7 @@ export class Telemetry { return new Promise((resolve) => { if (this.rudderStack) { const { user_id } = properties; - const updatedProperties: ITelemetryTrackProperties = { + const updatedProperties = { ...properties, instance_id: instanceId, version_cli: N8N_VERSION, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f68a8d1436..faa8fda0c0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -451,8 +451,8 @@ importers: specifier: 1.3.6 version: 1.3.6 '@rudderstack/rudder-sdk-node': - specifier: 1.0.6 - version: 1.0.6 + specifier: 2.0.6 + version: 2.0.6(tslib@2.6.1) '@sentry/integrations': specifier: 7.87.0 version: 7.87.0 @@ -6746,26 +6746,28 @@ packages: dev: true optional: true - /@rudderstack/rudder-sdk-node@1.0.6: - resolution: {integrity: sha512-kJYCXv6fRFbQrAp3hMsgRCnAa7RUBdbiGLBT9PcpQURi0VwHmD7mk3Ja7U4HDnL0EHXYJpPyx3oSonkklmPJ9Q==} - engines: {node: '>=4'} + /@rudderstack/rudder-sdk-node@2.0.6(tslib@2.6.1): + resolution: {integrity: sha512-WTYBbFk990w/k3VFJtns04EyhQZm1rTchaweJdBWVH3Owy63JczPJ+B340VulkV+I0IzzdUmlmuhv4ler/fWSg==} + engines: {node: '>=12'} + peerDependencies: + tslib: ^2.6.1 dependencies: - '@segment/loosely-validate-event': 2.0.0 - auto-changelog: 1.16.4 - axios: 0.21.4 - axios-retry: 3.3.1 - bull: 3.29.3 + axios: 1.6.0 + axios-retry: 3.7.0 + component-type: 1.2.1 + join-component: 1.1.0 lodash.clonedeep: 4.5.0 lodash.isstring: 4.0.1 md5: 2.3.0 ms: 2.1.3 remove-trailing-slash: 0.1.1 - serialize-javascript: 5.0.1 + serialize-javascript: 6.0.1 + tslib: 2.6.1 uuid: 8.3.2 - winston: 3.8.2 + optionalDependencies: + bull: 4.11.3 transitivePeerDependencies: - debug - - encoding - supports-color dev: false @@ -6807,13 +6809,6 @@ packages: string-argv: 0.3.1 dev: true - /@segment/loosely-validate-event@2.0.0: - resolution: {integrity: sha512-ZMCSfztDBqwotkl848ODgVcAmN4OItEWDCkshcKz0/W6gGSQayuuCtWV/MlodFivAZD793d6UgANd6wCXUfrIw==} - dependencies: - component-type: 1.2.1 - join-component: 1.1.0 - dev: false - /@selderee/plugin-htmlparser2@0.11.0: resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==} dependencies: @@ -11120,17 +11115,6 @@ packages: es-shim-unscopables: 1.0.0 dev: true - /array.prototype.reduce@1.0.4: - resolution: {integrity: sha512-WnM+AjG/DvLRLo4DDl+r+SvCzYtD2Jd9oeBYMcEaI7t3fFrHY9M53/wdLcTvmZNQ70IU6Htj0emFkZ5TS+lrdw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.22.1 - es-array-method-boxes-properly: 1.0.0 - is-string: 1.0.7 - dev: false - /arraybuffer.prototype.slice@1.0.1: resolution: {integrity: sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==} engines: {node: '>= 0.4'} @@ -11280,22 +11264,6 @@ packages: hasBin: true dev: true - /auto-changelog@1.16.4: - resolution: {integrity: sha512-h7diyELoq692AA4oqO50ULoYKIomUdzuQ+NW+eFPwIX0xzVbXEu9cIcgzZ3TYNVbpkGtcNKh51aRfAQNef7HVA==} - hasBin: true - dependencies: - commander: 5.1.0 - core-js: 3.31.0 - handlebars: 4.7.7 - lodash.uniqby: 4.7.0 - node-fetch: 2.6.8 - parse-github-url: 1.0.2 - regenerator-runtime: 0.13.11 - semver: 7.5.4 - transitivePeerDependencies: - - encoding - dev: false - /autoprefixer@10.4.14(postcss@8.4.31): resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==} engines: {node: ^10 || ^12 || >=14} @@ -11349,8 +11317,8 @@ packages: engines: {node: '>=4'} dev: true - /axios-retry@3.3.1: - resolution: {integrity: sha512-RohAUQTDxBSWLFEnoIG/6bvmy8l3TfpkclgStjl5MDCMBDgapAWCmr1r/9harQfWC8bzLC8job6UcL1A1Yc+/Q==} + /axios-retry@3.7.0: + resolution: {integrity: sha512-ZTnCkJbRtfScvwiRnoVskFAfvU0UG3xNcsjwTR0mawSbIJoothxn67gKsMaNAFHRXJ1RmuLhmZBzvyXi3+9WyQ==} dependencies: '@babel/runtime': 7.22.6 is-retry-allowed: 2.2.0 @@ -11399,6 +11367,16 @@ packages: - debug dev: false + /axios@1.6.0: + resolution: {integrity: sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==} + dependencies: + follow-redirects: 1.15.2(debug@4.3.4) + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + /babel-core@7.0.0-bridge.0(@babel/core@7.22.9): resolution: {integrity: sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==} peerDependencies: @@ -11836,24 +11814,6 @@ packages: engines: {node: '>=6'} dev: true - /bull@3.29.3: - resolution: {integrity: sha512-MOqV1dKLy1YQgP9m3lFolyMxaU+1+o4afzYYf0H4wNM+x/S0I1QPQfkgGlLiH00EyFrvSmeubeCYFP47rTfpjg==} - engines: {node: '>=10'} - dependencies: - cron-parser: 2.18.0 - debuglog: 1.0.1 - get-port: 5.1.1 - ioredis: 4.28.5 - lodash: 4.17.21 - p-timeout: 3.2.0 - promise.prototype.finally: 3.1.3 - semver: 7.5.4 - util.promisify: 1.1.1 - uuid: 8.3.2 - transitivePeerDependencies: - - supports-color - dev: false - /bull@4.10.2: resolution: {integrity: sha512-xa65xtWjQsLqYU/eNaXxq9VRG8xd6qNsQEjR7yjYuae05xKrzbVMVj2QgrYsTMmSs/vsqJjHqHSRRiW1+IkGXQ==} engines: {node: '>=12'} @@ -11871,6 +11831,22 @@ packages: - supports-color dev: false + /bull@4.11.3: + resolution: {integrity: sha512-DhS0XtiAuejkAY08iGOdDK35eex/yGNoezlWqGJTu9FqWFF/oBjUhpsusE9SXiI4culyDbOoFs+l3ar0VXhFqQ==} + engines: {node: '>=12'} + dependencies: + cron-parser: 4.7.0 + get-port: 5.1.1 + ioredis: 5.3.2 + lodash: 4.17.21 + msgpackr: 1.8.1 + semver: 7.5.4 + uuid: 8.3.2 + transitivePeerDependencies: + - supports-color + dev: false + optional: true + /busboy@1.6.0: resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} engines: {node: '>=10.16.0'} @@ -12720,6 +12696,7 @@ packages: /core-js@3.31.0: resolution: {integrity: sha512-NIp2TQSGfR6ba5aalZD+ZQ1fSxGhDo/s1w0nx3RYzf2pnJxt7YynxFlFScP6eV7+GZsKO95NSjGxyJsU3DZgeQ==} + dev: true /core-util-is@1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} @@ -12760,14 +12737,6 @@ packages: - ts-toolbelt dev: false - /cron-parser@2.18.0: - resolution: {integrity: sha512-s4odpheTyydAbTBQepsqd2rNWGa2iV3cyo8g7zbI2QQYGLVsfbhmwukayS1XHppe02Oy1fg7mg6xoaraVJeEcg==} - engines: {node: '>=0.8'} - dependencies: - is-nan: 1.3.2 - moment-timezone: 0.5.37 - dev: false - /cron-parser@4.7.0: resolution: {integrity: sha512-BdAELR+MCT2ZWsIBhZKDuUqIUCBjHHulPJnm53OfdRLA4EWBjva3R+KM5NeidJuGsNXdEcZkjC7SCnkW5rAFSA==} engines: {node: '>=12.0.0'} @@ -13774,10 +13743,6 @@ packages: has-property-descriptors: 1.0.0 dev: false - /es-array-method-boxes-properly@1.0.0: - resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} - dev: false - /es-get-iterator@1.1.3: resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} dependencies: @@ -16334,25 +16299,6 @@ packages: semver: 7.5.4 dev: true - /ioredis@4.28.5: - resolution: {integrity: sha512-3GYo0GJtLqgNXj4YhrisLaNNvWSNwSS2wS4OELGfGxH8I69+XfNdnmV1AyN+ZqMh0i7eX+SWjrwFKDBDgfBC1A==} - engines: {node: '>=6'} - dependencies: - cluster-key-slot: 1.1.1 - debug: 4.3.4(supports-color@8.1.1) - denque: 1.5.1 - lodash.defaults: 4.2.0 - lodash.flatten: 4.4.0 - lodash.isarguments: 3.1.0 - p-map: 2.1.0 - redis-commands: 1.7.0 - redis-errors: 1.2.0 - redis-parser: 3.0.0 - standard-as-callback: 2.1.0 - transitivePeerDependencies: - - supports-color - dev: false - /ioredis@5.2.4: resolution: {integrity: sha512-qIpuAEt32lZJQ0XyrloCRdlEdUUNGG9i0UOk6zgzK6igyudNWqEBxfH6OlbnOOoBBvr1WB02mm8fR55CnikRng==} engines: {node: '>=12.22.0'} @@ -18680,6 +18626,7 @@ packages: /lodash.flatten@4.4.0: resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} + dev: true /lodash.forin@4.4.0: resolution: {integrity: sha512-APldePP4yvGhMcplVxv9L+exdLHMRHRhH1Q9O70zRJMm9HbTm6zxaihXtNl+ICOBApeFWoH7jNmFr/L4XfWeiQ==} @@ -18768,6 +18715,7 @@ packages: /lodash.uniqby@4.7.0: resolution: {integrity: sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==} + dev: true /lodash.values@4.3.0: resolution: {integrity: sha512-r0RwvdCv8id9TUblb/O7rYPwVy6lerCbcawrfdo9iC/1t1wsNMJknO79WNBgwkH0hIeJ08jmvvESbFpNb4jH0Q==} @@ -20171,16 +20119,6 @@ packages: es-abstract: 1.22.1 dev: true - /object.getownpropertydescriptors@2.1.4: - resolution: {integrity: sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ==} - engines: {node: '>= 0.8'} - dependencies: - array.prototype.reduce: 1.0.4 - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.22.1 - dev: false - /object.groupby@1.0.1: resolution: {integrity: sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==} dependencies: @@ -20454,11 +20392,6 @@ packages: p-limit: 3.1.0 dev: true - /p-map@2.1.0: - resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} - engines: {node: '>=6'} - dev: false - /p-map@4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} @@ -20528,12 +20461,6 @@ packages: path-root: 0.1.1 dev: true - /parse-github-url@1.0.2: - resolution: {integrity: sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==} - engines: {node: '>=0.10.0'} - hasBin: true - dev: false - /parse-json@2.2.0: resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==} engines: {node: '>=0.10.0'} @@ -21308,15 +21235,6 @@ packages: retry: 0.12.0 dev: false - /promise.prototype.finally@3.1.3: - resolution: {integrity: sha512-EXRF3fC9/0gz4qkt/f5EP5iW4kj9oFpBICNpCNOb/52+8nlHIX07FPLbi/q4qYBQ1xZqivMzTpNQSnArVASolQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.22.1 - dev: false - /promise@1.3.0: resolution: {integrity: sha512-R9WrbTF3EPkVtWjp7B7umQGVndpsi+rsDAfrR4xAALQpFLa/+2OriecLhawxzvii2gd9+DZFwROWDuUUaqS5yA==} dependencies: @@ -22633,17 +22551,10 @@ packages: resolution: {integrity: sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==} dev: false - /serialize-javascript@5.0.1: - resolution: {integrity: sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==} - dependencies: - randombytes: 2.1.0 - dev: false - /serialize-javascript@6.0.1: resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} dependencies: randombytes: 2.1.0 - dev: true /serve-static@1.15.0: resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} @@ -24918,16 +24829,6 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - /util.promisify@1.1.1: - resolution: {integrity: sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw==} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - for-each: 0.3.3 - has-symbols: 1.0.3 - object.getownpropertydescriptors: 2.1.4 - dev: false - /util@0.12.5: resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} dependencies: