@oino-ts/db 0.4.0 → 0.4.1

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.
@@ -39,7 +39,7 @@ class OINODbModelSet {
39
39
  _encodeAndHashFieldValue(field, value, contentType, primaryKeyValues, rowIdSeed) {
40
40
  let result;
41
41
  if (field.fieldParams.isPrimaryKey || field.fieldParams.isForeignKey) {
42
- if (value && (field instanceof index_js_1.OINONumberDataField) && (this.datamodel.api.hashid)) {
42
+ if (value && (field instanceof index_js_1.OINONumberDataField) && (this.datamodel.api.hashid) && ((this.sqlParams?.aggregate === undefined) || (this.sqlParams.aggregate.isAggregated(field) == false))) {
43
43
  value = this.datamodel.api.hashid.encode(value, rowIdSeed);
44
44
  }
45
45
  if (field.fieldParams.isPrimaryKey) {
@@ -36,7 +36,7 @@ export class OINODbModelSet {
36
36
  _encodeAndHashFieldValue(field, value, contentType, primaryKeyValues, rowIdSeed) {
37
37
  let result;
38
38
  if (field.fieldParams.isPrimaryKey || field.fieldParams.isForeignKey) {
39
- if (value && (field instanceof OINONumberDataField) && (this.datamodel.api.hashid)) {
39
+ if (value && (field instanceof OINONumberDataField) && (this.datamodel.api.hashid) && ((this.sqlParams?.aggregate === undefined) || (this.sqlParams.aggregate.isAggregated(field) == false))) {
40
40
  value = this.datamodel.api.hashid.encode(value, rowIdSeed);
41
41
  }
42
42
  if (field.fieldParams.isPrimaryKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oino-ts/db",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "OINO TS library package for publishing an SQL database tables as a REST API.",
5
5
  "author": "Matias Kiviniemi (pragmatta)",
6
6
  "license": "MPL-2.0",
@@ -19,12 +19,12 @@
19
19
  "module": "./dist/esm/index.js",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "dependencies": {
22
- "@oino-ts/common": "0.4.0"
22
+ "@oino-ts/common": "0.4.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^20.14.10",
26
26
  "@types/bun": "^1.1.14",
27
- "@oino-ts/types": "0.4.0",
27
+ "@oino-ts/types": "0.4.1",
28
28
  "typedoc": "^0.25.13"
29
29
  },
30
30
  "files": [
@@ -44,7 +44,7 @@ export class OINODbModelSet {
44
44
  private _encodeAndHashFieldValue(field:OINODbDataField, value:string|null, contentType:OINOContentType, primaryKeyValues:string[], rowIdSeed:string):string {
45
45
  let result:string
46
46
  if (field.fieldParams.isPrimaryKey || field.fieldParams.isForeignKey) {
47
- if (value && (field instanceof OINONumberDataField) && (this.datamodel.api.hashid)) {
47
+ if (value && (field instanceof OINONumberDataField) && (this.datamodel.api.hashid) && ((this.sqlParams?.aggregate === undefined) || (this.sqlParams.aggregate.isAggregated(field) == false))) {
48
48
  value = this.datamodel.api.hashid.encode(value, rowIdSeed)
49
49
  }
50
50
  if (field.fieldParams.isPrimaryKey) {