Skip to content

Commit e675a3f

Browse files
committed
upgrade typescript and fix types in buffers to meet new requirements (microsoft/TypeScript#59417)
Signed-off-by: Steve Cassidy <steve@fieldnote.au>
1 parent f44b806 commit e675a3f

12 files changed

Lines changed: 21595 additions & 2069 deletions

File tree

api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@
103103
"sinon": "^17.0.1",
104104
"supertest": "^6.3.3",
105105
"ts-node": "10.9.1",
106-
"typescript": "^5.5.4"
106+
"typescript": "^5.9.2"
107107
}
108108
}

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"jss": "^10.10.0",
162162
"msw": "^2.3.1",
163163
"node-gyp": "^9.3.1",
164-
"typescript": "^5.5.4",
164+
"typescript": "^5.9.2",
165165
"type-fest": "^4.20.0",
166166
"vite": "^7.1.3",
167167
"vitest": "^2.1.8",

app/src/gui/fields/TakePhoto.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ async function base64ImageToBlob(image: Photo): Promise<Blob> {
5959

6060
// Convert base64 to buffer
6161
const buffer = Buffer.from(image.base64String, 'base64');
62+
// typescript now wants us to specify the type of buffer
63+
const content = new Uint8Array(buffer);
6264

6365
// Create blob from buffer
64-
return new Blob([buffer], {
66+
return new Blob([content], {
6567
type: `image/${image.format}`,
6668
});
6769
}

infrastructure/aws-cdk/lib/util/mono.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export const getPathHash = (
3535
const hash = crypto.createHash('sha256');
3636

3737
const processFile = (filePath: string) => {
38-
const content = fs.readFileSync(filePath);
38+
const buffer = fs.readFileSync(filePath);
39+
const content = new Uint8Array(buffer);
3940
hash.update(filePath);
4041
hash.update(content);
4142
};

infrastructure/aws-cdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"jest": "^29.7.0",
2828
"ts-jest": "^29.1.2",
2929
"ts-node": "^10.9.2",
30-
"typescript": "^5.5.4"
30+
"typescript": "^5.9.2"
3131
},
3232
"dependencies": {
3333
"@cloudcomponents/cdk-static-website": "^2.0.0",

infrastructure/aws-cdk/src/deregister-lambda/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"devDependencies": {
1616
"@types/aws-lambda": "^8.10.92",
1717
"@types/node": "^14.14.31",
18-
"typescript": "^5.5.4"
18+
"typescript": "^5.9.2"
1919
}
2020
}

library/data-model/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@
7070
"pouchdb-adapter-memory": "^9.0.0",
7171
"pouchdb-find": "^9.0.0",
7272
"ts-jest": "^29.0.5",
73-
"typescript": "^5.5.4"
73+
"typescript": "^5.9.2"
7474
}
7575
}

library/data-model/src/data_storage/attachments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function attachment_to_file(
115115
attachment: PouchDB.Core.Attachment
116116
): File {
117117
const content_type = attachment.content_type;
118-
const data = (attachment as PouchDB.Core.FullAttachment).data;
118+
const data = (attachment as PouchDB.Core.FullAttachment).data as Blob;
119119
return new File([data], name, {type: content_type});
120120
}
121121

0 commit comments

Comments
 (0)