@blinkdotnew/sdk 0.12.2 → 0.12.3

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.js CHANGED
@@ -1314,28 +1314,6 @@ var BlinkAuth = class {
1314
1314
  };
1315
1315
 
1316
1316
  // src/database.ts
1317
- function castSQLiteValue(value) {
1318
- if (value && typeof value === "object" && value.type === "null") {
1319
- return null;
1320
- }
1321
- return value;
1322
- }
1323
- function castSQLiteRecord(record) {
1324
- if (record === null || record === void 0) {
1325
- return record;
1326
- }
1327
- if (Array.isArray(record)) {
1328
- return record.map((item) => castSQLiteRecord(item));
1329
- }
1330
- if (typeof record === "object") {
1331
- const casted = {};
1332
- for (const [key, value] of Object.entries(record)) {
1333
- casted[key] = castSQLiteValue(value);
1334
- }
1335
- return casted;
1336
- }
1337
- return castSQLiteValue(record);
1338
- }
1339
1317
  var BlinkTable = class {
1340
1318
  constructor(tableName, httpClient) {
1341
1319
  this.tableName = tableName;
@@ -1354,7 +1332,7 @@ var BlinkTable = class {
1354
1332
  if (!result) {
1355
1333
  throw new Error("Failed to create record");
1356
1334
  }
1357
- return castSQLiteRecord(result);
1335
+ return result;
1358
1336
  }
1359
1337
  /**
1360
1338
  * Create multiple records
@@ -1366,7 +1344,7 @@ var BlinkTable = class {
1366
1344
  { returning: options.returning !== false }
1367
1345
  );
1368
1346
  const records = Array.isArray(response.data) ? response.data : [response.data];
1369
- return castSQLiteRecord(records);
1347
+ return records;
1370
1348
  }
1371
1349
  /**
1372
1350
  * Upsert a single record (insert or update on conflict)
@@ -1391,7 +1369,7 @@ var BlinkTable = class {
1391
1369
  if (!result) {
1392
1370
  throw new Error("Failed to upsert record");
1393
1371
  }
1394
- return castSQLiteRecord(result);
1372
+ return result;
1395
1373
  }
1396
1374
  /**
1397
1375
  * Upsert multiple records
@@ -1413,7 +1391,7 @@ var BlinkTable = class {
1413
1391
  }
1414
1392
  );
1415
1393
  const records = Array.isArray(response.data) ? response.data : [response.data];
1416
- return castSQLiteRecord(records);
1394
+ return records;
1417
1395
  }
1418
1396
  /**
1419
1397
  * Get a single record by ID
@@ -1428,7 +1406,7 @@ var BlinkTable = class {
1428
1406
  if (records.length === 0) {
1429
1407
  return null;
1430
1408
  }
1431
- return castSQLiteRecord(records[0]);
1409
+ return records[0] || null;
1432
1410
  }
1433
1411
  /**
1434
1412
  * List records with filtering, sorting, and pagination
@@ -1438,7 +1416,7 @@ var BlinkTable = class {
1438
1416
  const searchParams = queryParams;
1439
1417
  const response = await this.httpClient.dbGet(this.tableName, searchParams);
1440
1418
  const records = response.data;
1441
- return castSQLiteRecord(records);
1419
+ return records;
1442
1420
  }
1443
1421
  /**
1444
1422
  * Update a single record by ID
@@ -1457,7 +1435,7 @@ var BlinkTable = class {
1457
1435
  if (!records || records.length === 0) {
1458
1436
  throw new Error(`Record with id ${id} not found`);
1459
1437
  }
1460
- return castSQLiteRecord(records[0]);
1438
+ return records[0];
1461
1439
  }
1462
1440
  /**
1463
1441
  * Update multiple records
package/dist/index.mjs CHANGED
@@ -1312,28 +1312,6 @@ var BlinkAuth = class {
1312
1312
  };
1313
1313
 
1314
1314
  // src/database.ts
1315
- function castSQLiteValue(value) {
1316
- if (value && typeof value === "object" && value.type === "null") {
1317
- return null;
1318
- }
1319
- return value;
1320
- }
1321
- function castSQLiteRecord(record) {
1322
- if (record === null || record === void 0) {
1323
- return record;
1324
- }
1325
- if (Array.isArray(record)) {
1326
- return record.map((item) => castSQLiteRecord(item));
1327
- }
1328
- if (typeof record === "object") {
1329
- const casted = {};
1330
- for (const [key, value] of Object.entries(record)) {
1331
- casted[key] = castSQLiteValue(value);
1332
- }
1333
- return casted;
1334
- }
1335
- return castSQLiteValue(record);
1336
- }
1337
1315
  var BlinkTable = class {
1338
1316
  constructor(tableName, httpClient) {
1339
1317
  this.tableName = tableName;
@@ -1352,7 +1330,7 @@ var BlinkTable = class {
1352
1330
  if (!result) {
1353
1331
  throw new Error("Failed to create record");
1354
1332
  }
1355
- return castSQLiteRecord(result);
1333
+ return result;
1356
1334
  }
1357
1335
  /**
1358
1336
  * Create multiple records
@@ -1364,7 +1342,7 @@ var BlinkTable = class {
1364
1342
  { returning: options.returning !== false }
1365
1343
  );
1366
1344
  const records = Array.isArray(response.data) ? response.data : [response.data];
1367
- return castSQLiteRecord(records);
1345
+ return records;
1368
1346
  }
1369
1347
  /**
1370
1348
  * Upsert a single record (insert or update on conflict)
@@ -1389,7 +1367,7 @@ var BlinkTable = class {
1389
1367
  if (!result) {
1390
1368
  throw new Error("Failed to upsert record");
1391
1369
  }
1392
- return castSQLiteRecord(result);
1370
+ return result;
1393
1371
  }
1394
1372
  /**
1395
1373
  * Upsert multiple records
@@ -1411,7 +1389,7 @@ var BlinkTable = class {
1411
1389
  }
1412
1390
  );
1413
1391
  const records = Array.isArray(response.data) ? response.data : [response.data];
1414
- return castSQLiteRecord(records);
1392
+ return records;
1415
1393
  }
1416
1394
  /**
1417
1395
  * Get a single record by ID
@@ -1426,7 +1404,7 @@ var BlinkTable = class {
1426
1404
  if (records.length === 0) {
1427
1405
  return null;
1428
1406
  }
1429
- return castSQLiteRecord(records[0]);
1407
+ return records[0] || null;
1430
1408
  }
1431
1409
  /**
1432
1410
  * List records with filtering, sorting, and pagination
@@ -1436,7 +1414,7 @@ var BlinkTable = class {
1436
1414
  const searchParams = queryParams;
1437
1415
  const response = await this.httpClient.dbGet(this.tableName, searchParams);
1438
1416
  const records = response.data;
1439
- return castSQLiteRecord(records);
1417
+ return records;
1440
1418
  }
1441
1419
  /**
1442
1420
  * Update a single record by ID
@@ -1455,7 +1433,7 @@ var BlinkTable = class {
1455
1433
  if (!records || records.length === 0) {
1456
1434
  throw new Error(`Record with id ${id} not found`);
1457
1435
  }
1458
- return castSQLiteRecord(records[0]);
1436
+ return records[0];
1459
1437
  }
1460
1438
  /**
1461
1439
  * Update multiple records
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkdotnew/sdk",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "Blink TypeScript SDK for client-side applications - Zero-boilerplate CRUD + auth + AI + analytics + notifications for modern SaaS/AI apps",
5
5
  "keywords": [
6
6
  "blink",