@balena/abstract-sql-to-typescript
Advanced tools
Comparing version 5.0.2-build-renovate-major-22-node-aac5ea92ed261d752af8ec66f1da01f168d0e23b-1 to 6.0.0-build-joshbwlng-serial-eb21ca0852f1df689119a1039cd5637a20e5aaa1-1
{ | ||
"name": "@balena/abstract-sql-to-typescript", | ||
"version": "5.0.2", | ||
"version": "6.0.0", | ||
"description": "A translator for abstract sql into typescript types.", | ||
@@ -25,3 +25,3 @@ "type": "commonjs", | ||
"@balena/odata-to-abstract-sql": "^7.0.0", | ||
"@types/node": "^22.0.0", | ||
"@types/node": "^20.16.5", | ||
"common-tags": "^1.8.2" | ||
@@ -58,4 +58,4 @@ }, | ||
"versionist": { | ||
"publishedAt": "2024-10-29T01:04:05.484Z" | ||
"publishedAt": "2024-11-29T03:42:51.455Z" | ||
} | ||
} |
@@ -23,3 +23,10 @@ "use strict"; | ||
} | ||
switch (f.dataType) { | ||
let dataType = f.dataType; | ||
if (dataType === 'Serial' || | ||
(dataType === 'ForeignKey' && | ||
f.references != null && | ||
m.tables[f.references.resourceName].fields.find((field) => field.fieldName === f.references?.fieldName)?.dataType === 'Serial')) { | ||
dataType = 'Integer'; | ||
} | ||
switch (dataType) { | ||
case 'ConceptType': | ||
@@ -36,3 +43,3 @@ case 'ForeignKey': { | ||
default: | ||
return `Types['${f.dataType}']['${mode}']`; | ||
return `Types['${dataType}']['${mode}']`; | ||
} | ||
@@ -39,0 +46,0 @@ }; |
{ | ||
"name": "@balena/abstract-sql-to-typescript", | ||
"version": "5.0.2-build-renovate-major-22-node-aac5ea92ed261d752af8ec66f1da01f168d0e23b-1", | ||
"version": "6.0.0-build-joshbwlng-serial-eb21ca0852f1df689119a1039cd5637a20e5aaa1-1", | ||
"description": "A translator for abstract sql into typescript types.", | ||
@@ -25,3 +25,3 @@ "type": "commonjs", | ||
"@balena/odata-to-abstract-sql": "^7.0.0", | ||
"@types/node": "^22.0.0", | ||
"@types/node": "^20.16.5", | ||
"common-tags": "^1.8.2" | ||
@@ -58,4 +58,4 @@ }, | ||
"versionist": { | ||
"publishedAt": "2024-10-29T01:04:05.484Z" | ||
"publishedAt": "2024-11-29T03:42:51.455Z" | ||
} | ||
} |
@@ -50,3 +50,16 @@ import type { | ||
switch (f.dataType) { | ||
// Avoid exposing serial nature of Serial fields | ||
let dataType = f.dataType; | ||
if ( | ||
dataType === 'Serial' || | ||
(dataType === 'ForeignKey' && | ||
f.references != null && | ||
m.tables[f.references.resourceName].fields.find( | ||
(field) => field.fieldName === f.references?.fieldName, | ||
)?.dataType === 'Serial') | ||
) { | ||
dataType = 'Integer'; | ||
} | ||
switch (dataType) { | ||
case 'ConceptType': | ||
@@ -67,3 +80,3 @@ case 'ForeignKey': { | ||
default: | ||
return `Types['${f.dataType}']['${mode}']`; | ||
return `Types['${dataType}']['${mode}']`; | ||
} | ||
@@ -70,0 +83,0 @@ }; |
@@ -313,3 +313,3 @@ import type { AbstractSqlModel } from '@balena/abstract-sql-compiler'; | ||
modified_at: Types['Date Time']['Read']; | ||
id: Types['Serial']['Read']; | ||
id: Types['Integer']['Read']; | ||
}; | ||
@@ -319,3 +319,3 @@ Write: { | ||
modified_at: Types['Date Time']['Write']; | ||
id: Types['Serial']['Write']; | ||
id: Types['Integer']['Write']; | ||
}; | ||
@@ -328,3 +328,3 @@ } | ||
modified_at: Types['Date Time']['Read']; | ||
id: Types['Serial']['Read']; | ||
id: Types['Integer']['Read']; | ||
is_referenced_by__test?: Array<Test['Read']>; | ||
@@ -335,3 +335,3 @@ }; | ||
modified_at: Types['Date Time']['Write']; | ||
id: Types['Serial']['Write']; | ||
id: Types['Integer']['Write']; | ||
}; | ||
@@ -344,7 +344,7 @@ } | ||
modified_at: Types['Date Time']['Read']; | ||
id: Types['Serial']['Read']; | ||
id: Types['Integer']['Read']; | ||
a_date: Types['Date']['Read']; | ||
a_file: Types['WebResource']['Read']; | ||
parent: { __id: Parent['Read']['id'] } | [Parent['Read']]; | ||
references__other: { __id: Other['Read']['id'] } | [Other['Read']]; | ||
references__other: Types['Integer']['Read']; | ||
aliased__tag?: Array<TestTag['Read']>; | ||
@@ -359,7 +359,7 @@ references__test__has__tag_key?: Array<TestTag['Read']>; | ||
modified_at: Types['Date Time']['Write']; | ||
id: Types['Serial']['Write']; | ||
id: Types['Integer']['Write']; | ||
a_date: Types['Date']['Write']; | ||
a_file: Types['WebResource']['Write']; | ||
parent: Parent['Write']['id']; | ||
references__other: Other['Write']['id']; | ||
references__other: Types['Integer']['Write']; | ||
}; | ||
@@ -372,5 +372,5 @@ } | ||
modified_at: Types['Date Time']['Read']; | ||
test: { __id: Test['Read']['id'] } | [Test['Read']]; | ||
test: Types['Integer']['Read']; | ||
tag_key: Types['Short Text']['Read']; | ||
id: Types['Serial']['Read']; | ||
id: Types['Integer']['Read']; | ||
}; | ||
@@ -380,5 +380,5 @@ Write: { | ||
modified_at: Types['Date Time']['Write']; | ||
test: Test['Write']['id']; | ||
test: Types['Integer']['Write']; | ||
tag_key: Types['Short Text']['Write']; | ||
id: Types['Serial']['Write']; | ||
id: Types['Integer']['Write']; | ||
}; | ||
@@ -385,0 +385,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
459596
888
+ Added@types/node@20.17.13(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removed@types/node@22.10.6(transitive)
- Removedundici-types@6.20.0(transitive)
Updated@types/node@^20.16.5