@learnpack/learnpack 5.0.10 → 5.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,8 @@ import { IConfig, IConfigObj } from "./config"
2
2
 
3
3
  export interface IPayload {
4
4
  email: string
5
+ user_id: number
6
+ token: string
5
7
  }
6
8
 
7
9
  export interface IStartProps {
package/src/utils/api.ts CHANGED
@@ -229,7 +229,7 @@ const APIError = (error: TypeError | string, code?: number) => {
229
229
  return _err
230
230
  }
231
231
 
232
- const sendBatchTelemetry = async function (url: string, body: object) {
232
+ const sendBatchTelemetry = async function (url: string, body: any) {
233
233
  if (!url) {
234
234
  return
235
235
  }
@@ -240,10 +240,17 @@ const sendBatchTelemetry = async function (url: string, body: object) {
240
240
  !Object.prototype.hasOwnProperty.call(session, "token") ||
241
241
  session.token === ""
242
242
  ) {
243
- Console.debug("No token found, skipping stream telemetry delivery")
243
+ Console.debug("No token found, skipping batch telemetry delivery")
244
+ return
245
+ }
246
+
247
+ if (!session || !session.user_id || session.user_id === "") {
248
+ Console.debug("No user_id found, skipping batch telemetry delivery")
244
249
  return
245
250
  }
246
251
 
252
+ body.user_id = session.user_id
253
+
247
254
  fetch(
248
255
  url,
249
256
  {
@@ -254,7 +261,7 @@ const sendBatchTelemetry = async function (url: string, body: object) {
254
261
  )
255
262
  .then(response => {
256
263
  Console.debug("Telemetry sent successfully")
257
- return response.text()
264
+ return response
258
265
  })
259
266
  .catch(error => {
260
267
  Console.debug("Error while sending batch Telemetry", error)
@@ -166,7 +166,8 @@ export const checkNotInstalledDependencies = async (
166
166
  Console.info("Checking needed dependencies...")
167
167
 
168
168
  const jsPluginsDependencies = ["jest@29.7.0", "jest-environment-jsdom@29.7.0"]
169
- const pyPluginsDependencies = ["pytest==6.2.5", "pytest-testdox", "mock"]
169
+ // pytest up to 6.2.5
170
+ const pyPluginsDependencies = ["pytest", "pytest-testdox", "mock"]
170
171
 
171
172
  const npmLsCommand = "npm ls jest jest-environment-jsdom -g"
172
173
 
@@ -221,8 +222,6 @@ return true
221
222
  }
222
223
 
223
224
  if (pytestNeeded) {
224
- console.log("Trying to install pytest dependencies")
225
-
226
225
  const { stdout, stderr } = await exec("pip list")
227
226
  if (stderr) {
228
227
  Console.error(`Error executing pip list. Use debug for more info`)