@balena/sbvr-types
Advanced tools
Comparing version 6.0.1-build-renovate-typescript-5-x-f9f2e48a065fa6a6c4939a44d210f4179e0e41a9-1 to 6.1.0-build-add-checksum-to-webresource-be6a1e9bacad51f99d685f491b3bf81545536adb-1
@@ -7,6 +7,6 @@ # Change Log | ||
# v6.0.1 | ||
## (2023-08-09) | ||
# v6.1.0 | ||
## (2023-09-01) | ||
* chore(deps): update dependency typescript to v5 [Self-hosted Renovate Bot] | ||
* Add checksum to WebResource [Otávio Jacobi] | ||
@@ -13,0 +13,0 @@ # v6.0.0 |
@@ -8,2 +8,3 @@ import type { CastNode, ExtractJSONPathAsTextNode, ReferencedFieldNode } from '@balena/abstract-sql-compiler'; | ||
size?: number; | ||
checksum?: string; | ||
}; | ||
@@ -25,2 +26,3 @@ export declare const types: { | ||
'Content Disposition': (referencedField: ReferencedFieldNode) => ExtractJSONPathAsTextNode; | ||
Checksum: (referencedField: ReferencedFieldNode) => ExtractJSONPathAsTextNode; | ||
Size: (referencedField: ReferencedFieldNode) => CastNode; | ||
@@ -27,0 +29,0 @@ }; |
@@ -18,2 +18,3 @@ "use strict"; | ||
<Property Name="size" Nullable="true" Type="Edm.Int64"/>\ | ||
<Property Name="checksum" Nullable="true" Type="Edm.String"/>\ | ||
</ComplexType>`, | ||
@@ -44,2 +45,7 @@ }, | ||
], | ||
Checksum: (referencedField) => [ | ||
'ExtractJSONPathAsText', | ||
referencedField, | ||
['TextArray', ['EmbeddedText', 'checksum']], | ||
], | ||
Size: (referencedField) => [ | ||
@@ -81,2 +87,3 @@ 'Cast', | ||
size: refData.size, | ||
checksum: refData.checksum, | ||
}; | ||
@@ -111,2 +118,5 @@ }; | ||
} | ||
if (value.checksum != null && typeof value.checksum !== 'string') { | ||
throw new Error('checksum must be a string or undefined'); | ||
} | ||
try { | ||
@@ -113,0 +123,0 @@ return JSON.stringify(value); |
{ | ||
"name": "@balena/sbvr-types", | ||
"version": "6.0.1-build-renovate-typescript-5-x-f9f2e48a065fa6a6c4939a44d210f4179e0e41a9-1", | ||
"version": "6.1.0-build-add-checksum-to-webresource-be6a1e9bacad51f99d685f491b3bf81545536adb-1", | ||
"description": "SBVR type definitions.", | ||
@@ -37,3 +37,3 @@ "main": "out", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.0.0" | ||
"typescript": "^4.9.3" | ||
}, | ||
@@ -59,4 +59,4 @@ "lint-staged": { | ||
"versionist": { | ||
"publishedAt": "2023-08-09T01:07:04.475Z" | ||
"publishedAt": "2023-09-01T00:18:47.804Z" | ||
} | ||
} |
@@ -14,2 +14,3 @@ import * as TypeUtils from '../type-utils'; | ||
size?: number; | ||
checksum?: string; | ||
}; | ||
@@ -30,2 +31,3 @@ | ||
<Property Name="size" Nullable="true" Type="Edm.Int64"/>\ | ||
<Property Name="checksum" Nullable="true" Type="Edm.String"/>\ | ||
</ComplexType>`, | ||
@@ -63,2 +65,9 @@ }, | ||
], | ||
Checksum: ( | ||
referencedField: ReferencedFieldNode, | ||
): ExtractJSONPathAsTextNode => [ | ||
'ExtractJSONPathAsText', | ||
referencedField, | ||
['TextArray', ['EmbeddedText', 'checksum']], | ||
], | ||
Size: (referencedField: ReferencedFieldNode): CastNode => [ | ||
@@ -106,2 +115,3 @@ 'Cast', | ||
size: refData.size, | ||
checksum: refData.checksum, | ||
}; | ||
@@ -145,2 +155,5 @@ }; | ||
} | ||
if (value.checksum != null && typeof value.checksum !== 'string') { | ||
throw new Error('checksum must be a string or undefined'); | ||
} | ||
try { | ||
@@ -147,0 +160,0 @@ return JSON.stringify(value); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
133382
2067