Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class Context {
maxzoom: getStyleMaxZoom(style),
minzoom: getStyleMinZoom(style),
estimatedSizeBytes: stats.size,
mapCreated: stats.ctimeMs,
mapCreatedAt: stats.ctimeMs,
}
}
getReader(mapId: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/map-share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class MapShare extends TypedEventTarget<
(baseUrl) => new URL(`${shareId}`, addTrailingSlash(baseUrl)).href,
),
receiverDeviceId,
mapShareCreated: Date.now(),
mapShareCreatedAt: Date.now(),
status: 'pending',
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function MapsRouter({ base = '/' }, ctx: Context) {
router.get<MapRequest>(`/:mapId/info`, async (request) => {
const info = await ctx.getMapInfo(request.params.mapId)
return {
created: info.mapCreated,
created: info.mapCreatedAt,
size: info.estimatedSizeBytes,
name: info.mapName,
}
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const MapInfo = T.Object({
),
minzoom: T.Number({ description: 'The minimum zoom level of the map data' }),
maxzoom: T.Number({ description: 'The maximum zoom level of the map data' }),
mapCreated: T.Number({
mapCreatedAt: T.Number({
description: 'Timestamp (ms since epoch) when the map was created',
}),
})
Expand All @@ -110,7 +110,7 @@ const MapShareBase = T.Intersect([
}),
shareId: ShareId,
mapShareUrls: MapShareUrls,
mapShareCreated: T.Number({
mapShareCreatedAt: T.Number({
description: 'Timestamp (ms since epoch) when the map share was created',
}),
}),
Expand Down
8 changes: 4 additions & 4 deletions test/map-shares.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ describe('Map Shares and Downloads', () => {
const share = await response.json()
const {
shareId,
mapShareCreated,
mapShareCreatedAt,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
mapCreated,
mapCreatedAt: mapCreated,
mapShareUrls,
...deterministic
} = share as MapShareState
expect(deterministic).toMatchSnapshot()
expect(mapShareCreated).toBeGreaterThanOrEqual(timeBeforeRequest)
expect(mapShareCreated).toBeLessThanOrEqual(Date.now())
expect(mapShareCreatedAt).toBeGreaterThanOrEqual(timeBeforeRequest)
expect(mapShareCreatedAt).toBeLessThanOrEqual(Date.now())
expect(mapShareUrls.length).toBeGreaterThanOrEqual(1)
expect(mapShareUrls[0]).toMatch(`/mapShares/${shareId}`)
expect(share).toHaveProperty('status', 'pending')
Expand Down