@bagelink/sdk 1.0.22 → 1.0.26

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.
package/dist/index.cjs CHANGED
@@ -49,7 +49,7 @@ function schemaToType(schema) {
49
49
  return "undefined";
50
50
  case "null":
51
51
  return "null";
52
- case undefined:
52
+ case void 0:
53
53
  return "any";
54
54
  default:
55
55
  console.log("Unknown type", schema.type);
@@ -61,7 +61,7 @@ function isOptional(schema) {
61
61
  const splitType = type.split(/\s+\|\s+/);
62
62
  const includesNull = splitType.includes("null");
63
63
  const includesUndefined = splitType.includes("undefined");
64
- return includesNull || includesUndefined || schema.default !== undefined;
64
+ return includesNull || includesUndefined || schema.default !== void 0;
65
65
  }
66
66
  function cleanOptionals(str) {
67
67
  return str.split(" | ").filter((t) => t !== "null" && t !== "undefined").join(" | ");
@@ -343,7 +343,7 @@ function generateFunctions(paths, baseUrl) {
343
343
  }, body);
344
344
  }
345
345
  for (const [parent, object] of Object.entries(body)) {
346
- tsString += `export const ${parent} = ${JSON.stringify(object, undefined, 2)};
346
+ tsString += `export const ${parent} = ${JSON.stringify(object, void 0, 2)};
347
347
  `;
348
348
  }
349
349
  Object.entries(functionsInventory).forEach(([key, value]) => {
@@ -469,7 +469,7 @@ class DataRequest {
469
469
  } catch (err) {
470
470
  console.log(err);
471
471
  this.bagel.onError?.(err);
472
- return undefined;
472
+ return void 0;
473
473
  }
474
474
  }
475
475
  item(id) {
@@ -506,7 +506,7 @@ class BagelAuth {
506
506
  this.bagel = bagel;
507
507
  this.bagel = bagel;
508
508
  }
509
- user = undefined;
509
+ user = void 0;
510
510
  async validateUser() {
511
511
  try {
512
512
  const { data: usr } = await axios.get("/users/me", {
@@ -554,7 +554,7 @@ class BagelAuth {
554
554
  this.bagel.onError?.(err);
555
555
  console.log(err);
556
556
  }
557
- this.user = undefined;
557
+ this.user = void 0;
558
558
  }
559
559
  async acceptInvite(token, user) {
560
560
  await axios.post(`/auth/accept-invite/${token}`, user);
@@ -584,7 +584,7 @@ class Bagel {
584
584
  axios.defaults.baseURL = this.host;
585
585
  this.onError = onError;
586
586
  }
587
- read_table = undefined;
587
+ read_table = void 0;
588
588
  data(table) {
589
589
  return new DataRequest(table, this);
590
590
  }
package/dist/index.mjs CHANGED
@@ -43,7 +43,7 @@ function schemaToType(schema) {
43
43
  return "undefined";
44
44
  case "null":
45
45
  return "null";
46
- case undefined:
46
+ case void 0:
47
47
  return "any";
48
48
  default:
49
49
  console.log("Unknown type", schema.type);
@@ -55,7 +55,7 @@ function isOptional(schema) {
55
55
  const splitType = type.split(/\s+\|\s+/);
56
56
  const includesNull = splitType.includes("null");
57
57
  const includesUndefined = splitType.includes("undefined");
58
- return includesNull || includesUndefined || schema.default !== undefined;
58
+ return includesNull || includesUndefined || schema.default !== void 0;
59
59
  }
60
60
  function cleanOptionals(str) {
61
61
  return str.split(" | ").filter((t) => t !== "null" && t !== "undefined").join(" | ");
@@ -337,7 +337,7 @@ function generateFunctions(paths, baseUrl) {
337
337
  }, body);
338
338
  }
339
339
  for (const [parent, object] of Object.entries(body)) {
340
- tsString += `export const ${parent} = ${JSON.stringify(object, undefined, 2)};
340
+ tsString += `export const ${parent} = ${JSON.stringify(object, void 0, 2)};
341
341
  `;
342
342
  }
343
343
  Object.entries(functionsInventory).forEach(([key, value]) => {
@@ -463,7 +463,7 @@ class DataRequest {
463
463
  } catch (err) {
464
464
  console.log(err);
465
465
  this.bagel.onError?.(err);
466
- return undefined;
466
+ return void 0;
467
467
  }
468
468
  }
469
469
  item(id) {
@@ -500,7 +500,7 @@ class BagelAuth {
500
500
  this.bagel = bagel;
501
501
  this.bagel = bagel;
502
502
  }
503
- user = undefined;
503
+ user = void 0;
504
504
  async validateUser() {
505
505
  try {
506
506
  const { data: usr } = await axios.get("/users/me", {
@@ -548,7 +548,7 @@ class BagelAuth {
548
548
  this.bagel.onError?.(err);
549
549
  console.log(err);
550
550
  }
551
- this.user = undefined;
551
+ this.user = void 0;
552
552
  }
553
553
  async acceptInvite(token, user) {
554
554
  await axios.post(`/auth/accept-invite/${token}`, user);
@@ -578,7 +578,7 @@ class Bagel {
578
578
  axios.defaults.baseURL = this.host;
579
579
  this.onError = onError;
580
580
  }
581
- read_table = undefined;
581
+ read_table = void 0;
582
582
  data(table) {
583
583
  return new DataRequest(table, this);
584
584
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/sdk",
3
3
  "type": "module",
4
- "version": "1.0.22",
4
+ "version": "1.0.26",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",