-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1738 from balena-io/v6-number-image-image-size-
Fix v6 image.image_size no longer being a number
- Loading branch information
Showing
8 changed files
with
139 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import SbvrTypes from '@balena/sbvr-types'; | ||
import type * as TypeUtils from '@balena/sbvr-types/out/type-utils.js'; | ||
|
||
// We use the TsTypes as the type name here so that it doesn't conflict later | ||
// when we augment the @balena/sbvr-types Types type. | ||
type TsTypes = TypeUtils.TsTypes<number, number>; | ||
export { TsTypes as Types }; | ||
export type DbWriteType = number; | ||
|
||
// Augmenting is necessary so that the TS v6-model.ts compiles properly | ||
declare module '@balena/sbvr-types' { | ||
export interface Types { | ||
'Numeric Big Integer': TsTypes; | ||
} | ||
} | ||
|
||
// @ts-expect-error we are augmenting SbvrTypes w/ Numeric Big Integer | ||
SbvrTypes.default['Numeric Big Integer'] = { | ||
...SbvrTypes.default['Big Integer'], | ||
|
||
fetchProcessing(data) { | ||
const processedData = | ||
SbvrTypes.default['Big Integer'].fetchProcessing(data); | ||
if (processedData == null) { | ||
return processedData; | ||
} | ||
return parseInt(processedData, 10); | ||
}, | ||
|
||
validate: SbvrTypes.default.Integer.validate, | ||
} satisfies TypeUtils.SbvrType<TsTypes['Read'], TsTypes['Write'], DbWriteType>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"release1_image1": { | ||
"user": "admin", | ||
"service": "app1_service1", | ||
"releases": [ "release1" ], | ||
"image_size": "75123123123", | ||
"project_type": "Dockerfile.template", | ||
"build_log": "This is also the build log", | ||
"status": "success" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"app1_service1": { | ||
"user": "admin", | ||
"application": "app1", | ||
"service_name": "app1_service1" | ||
} | ||
} |