orange-orm 5.2.0 → 5.2.2

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/context7.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "url": "https://context7.com/alfateam/orange-orm",
3
+ "public_key": "pk_v292Vzg1bhPxLyzV6GwIu"
4
+ }
@@ -6270,6 +6270,10 @@ function requireColumn () {
6270
6270
  return c;
6271
6271
  };
6272
6272
 
6273
+ c.jsonOf = function() {
6274
+ return c.json();
6275
+ };
6276
+
6273
6277
  c.guid = function() {
6274
6278
  requireGuid()(column);
6275
6279
  return c;
package/dist/index.mjs CHANGED
@@ -6271,6 +6271,10 @@ function requireColumn () {
6271
6271
  return c;
6272
6272
  };
6273
6273
 
6274
+ c.jsonOf = function() {
6275
+ return c.json();
6276
+ };
6277
+
6274
6278
  c.guid = function() {
6275
6279
  requireGuid()(column);
6276
6280
  return c;
@@ -16958,28 +16962,19 @@ function requireFormatJSONIn () {
16958
16962
  return formatJSONIn_1;
16959
16963
  }
16960
16964
 
16961
- var encodeJSON;
16962
- var hasRequiredEncodeJSON;
16965
+ var encodeJSON$1;
16966
+ var hasRequiredEncodeJSON$1;
16963
16967
 
16964
- function requireEncodeJSON () {
16965
- if (hasRequiredEncodeJSON) return encodeJSON;
16966
- hasRequiredEncodeJSON = 1;
16967
- function encode(arg) {
16968
- if (Array.isArray(arg))
16969
- return new JsonBArrayParam(arg);
16970
- else
16971
- return arg;
16968
+ function requireEncodeJSON$1 () {
16969
+ if (hasRequiredEncodeJSON$1) return encodeJSON$1;
16970
+ hasRequiredEncodeJSON$1 = 1;
16971
+ function encode(value) {
16972
+ // Bun SQL rejects proxied objects as PG params; normalize to plain JSON value.
16973
+ return JSON.parse(JSON.stringify(value));
16972
16974
  }
16973
16975
 
16974
- class JsonBArrayParam {
16975
- constructor(actualArray) { this.actualArray = actualArray; }
16976
- toPostgres() {
16977
- return JSON.stringify(this.actualArray);
16978
- }
16979
- }
16980
-
16981
- encodeJSON = encode;
16982
- return encodeJSON;
16976
+ encodeJSON$1 = encode;
16977
+ return encodeJSON$1;
16983
16978
  }
16984
16979
 
16985
16980
  var newTransaction$9;
@@ -16998,7 +16993,7 @@ function requireNewTransaction$9 () {
16998
16993
  var limitAndOffset = requireLimitAndOffset$4();
16999
16994
  var formatDateOut = requireFormatDateOut$3();
17000
16995
  var formatJSONIn = requireFormatJSONIn();
17001
- var encodeJSON = requireEncodeJSON();
16996
+ var encodeJSON = requireEncodeJSON$1();
17002
16997
  var insertSql = requireInsertSql$4();
17003
16998
  var insert = requireInsert$4();
17004
16999
  var quote = requireQuote$4();
@@ -17463,6 +17458,30 @@ function requireEncodeBoolean$4 () {
17463
17458
  return encodeBoolean_1$4;
17464
17459
  }
17465
17460
 
17461
+ var encodeJSON;
17462
+ var hasRequiredEncodeJSON;
17463
+
17464
+ function requireEncodeJSON () {
17465
+ if (hasRequiredEncodeJSON) return encodeJSON;
17466
+ hasRequiredEncodeJSON = 1;
17467
+ function encode(arg) {
17468
+ if (Array.isArray(arg))
17469
+ return new JsonBArrayParam(arg);
17470
+ else
17471
+ return arg;
17472
+ }
17473
+
17474
+ class JsonBArrayParam {
17475
+ constructor(actualArray) { this.actualArray = actualArray; }
17476
+ toPostgres() {
17477
+ return JSON.stringify(this.actualArray);
17478
+ }
17479
+ }
17480
+
17481
+ encodeJSON = encode;
17482
+ return encodeJSON;
17483
+ }
17484
+
17466
17485
  var newTransaction$8;
17467
17486
  var hasRequiredNewTransaction$8;
17468
17487
 
package/docs/changelog.md CHANGED
@@ -1,4 +1,8 @@
1
1
  ## Changelog
2
+ __5.2.2__
3
+ Bugfix: jsonOf<T>() exists in type definitions but is missing at runtime [#166](https://github.com/alfateam/orange-orm/issues/166)
4
+ __5.2.1__
5
+ Bugfix: Bun Postgres fails on proxied JSON params [#158](https://github.com/alfateam/orange-orm/issues/158)
2
6
  __5.2.0__
3
7
  Distinct aggregates via `distinct()` [#119](https://github.com/alfateam/orange-orm/issues/119)
4
8
  Column-to-column filters (incl. `contains`, `startsWith`, `endsWith`) [#150](htps://github.com/alfateam/orange-orm/issues/150)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orange-orm",
3
- "version": "5.2.0",
3
+ "version": "5.2.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -128,13 +128,13 @@
128
128
  "@rollup/plugin-commonjs": "^28.0.2",
129
129
  "@rollup/plugin-json": "^6.1.0",
130
130
  "@rollup/plugin-node-resolve": "^13.0.0",
131
- "@typescript-eslint/eslint-plugin": "^6.x",
132
- "@typescript-eslint/parser": "^6.x",
131
+ "@typescript-eslint/eslint-plugin": "^8.56.1",
132
+ "@typescript-eslint/parser": "^8.56.1",
133
133
  "@vitest/coverage-v8": "^3.2.4",
134
134
  "better-sqlite3": "^12.6.2",
135
135
  "cors": "^2.8.5",
136
136
  "eslint": "^8.57.0",
137
- "eslint-plugin-jest": "^27.1.7",
137
+ "eslint-plugin-jest": "^29.15.0",
138
138
  "express": "^4.18.2",
139
139
  "hono": "^4.8.2",
140
140
  "msnodesqlv8": "^4.1.0",
@@ -0,0 +1,6 @@
1
+ function encode(value) {
2
+ // Bun SQL rejects proxied objects as PG params; normalize to plain JSON value.
3
+ return JSON.parse(JSON.stringify(value));
4
+ }
5
+
6
+ module.exports = encode;
@@ -8,7 +8,7 @@ var selectForUpdateSql = require('../pg/selectForUpdateSql');
8
8
  var limitAndOffset = require('../pg/limitAndOffset');
9
9
  var formatDateOut = require('../pg/formatDateOut');
10
10
  var formatJSONIn = require('./formatJSONIn');
11
- var encodeJSON = require('../pg/encodeJSON');
11
+ var encodeJSON = require('./encodeJSON');
12
12
  var insertSql = require('../pg/insertSql');
13
13
  var insert = require('../pg/insert');
14
14
  var quote = require('../pg/quote');
@@ -13,6 +13,10 @@ function defineColumn(column, table) {
13
13
  return c;
14
14
  };
15
15
 
16
+ c.jsonOf = function() {
17
+ return c.json();
18
+ };
19
+
16
20
  c.guid = function() {
17
21
  require('./column/guid')(column);
18
22
  return c;