@restura/core 0.1.0-alpha.30 → 0.1.0-alpha.31

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.mjs CHANGED
@@ -1030,7 +1030,7 @@ var groupBySchema = z3.object({
1030
1030
  var whereDataSchema = z3.object({
1031
1031
  tableName: z3.string().optional(),
1032
1032
  columnName: z3.string().optional(),
1033
- operator: z3.enum(["=", "<", ">", "<=", ">=", "!=", "LIKE", "IN", "NOT IN", "STARTS WITH", "ENDS WITH"]).optional(),
1033
+ operator: z3.enum(["=", "<", ">", "<=", ">=", "!=", "LIKE", "IN", "NOT IN", "STARTS WITH", "ENDS WITH", "IS", "IS NOT"]).optional(),
1034
1034
  value: z3.string().or(z3.number()).optional(),
1035
1035
  custom: z3.string().optional(),
1036
1036
  conjunction: z3.enum(["AND", "OR"]).optional()
@@ -1465,9 +1465,15 @@ function getRequestData(req) {
1465
1465
  bodyData[attr] = attrList;
1466
1466
  }
1467
1467
  } else {
1468
- bodyData[attr] = ObjectUtils2.safeParse(bodyData[attr]);
1469
- if (isNaN(Number(bodyData[attr]))) continue;
1470
- bodyData[attr] = Number(bodyData[attr]);
1468
+ if (bodyData[attr] === "true") {
1469
+ bodyData[attr] = true;
1470
+ } else if (bodyData[attr] === "false") {
1471
+ bodyData[attr] = false;
1472
+ } else {
1473
+ bodyData[attr] = ObjectUtils2.safeParse(bodyData[attr]);
1474
+ if (isNaN(Number(bodyData[attr]))) continue;
1475
+ bodyData[attr] = Number(bodyData[attr]);
1476
+ }
1471
1477
  }
1472
1478
  }
1473
1479
  }
@@ -1582,8 +1588,8 @@ function SQL(strings, ...values) {
1582
1588
 
1583
1589
  // src/restura/sql/PsqlConnection.ts
1584
1590
  var PsqlConnection = class {
1585
- constructor() {
1586
- this.instanceId = crypto.randomUUID();
1591
+ constructor(instanceId) {
1592
+ this.instanceId = instanceId || crypto.randomUUID();
1587
1593
  }
1588
1594
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1589
1595
  async queryOne(query, options, requesterDetails) {
@@ -2813,8 +2819,8 @@ var restura = new ResturaEngine();
2813
2819
  import pg3 from "pg";
2814
2820
  var { Client: Client2 } = pg3;
2815
2821
  var PsqlTransaction = class extends PsqlConnection {
2816
- constructor(clientConfig) {
2817
- super();
2822
+ constructor(clientConfig, instanceId) {
2823
+ super(instanceId);
2818
2824
  this.clientConfig = clientConfig;
2819
2825
  this.client = new Client2(clientConfig);
2820
2826
  this.connectPromise = this.client.connect();