Skip to content

Commit

Permalink
feat: expose item size for content entities (#1720)
Browse files Browse the repository at this point in the history
  • Loading branch information
abp6318 authored Nov 20, 2024
1 parent 9e39379 commit e4e6c86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/common/src/content/_internal/getPropertyMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export function getPropertyMap(): IPropertyMap[] {
storeKey: "item.licenseInfo",
});

map.push({
entityKey: "size",
storeKey: "item.size",
});

// features is intentionally left out

// TODO: look into composeContent() for what we can add here
Expand Down
7 changes: 7 additions & 0 deletions packages/common/src/core/types/IHubItemEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ export interface IHubItemEntity
*/
schemaVersion: number;

/**
* The size of the item in bytes
*
* Use `formatBytes` util in hub.js for all your formatting needs
*/
size?: number;

/**
* User configurable tags
*/
Expand Down

0 comments on commit e4e6c86

Please sign in to comment.