1 import { ContentFormatVersion, type ItemRevision, ItemState, type SecureLinkItem } from '@proton/pass/types';
2 import { uniqueId } from '@proton/pass/utils/string/unique-id';
3 import { getEpoch } from '@proton/pass/utils/time/epoch';
4 import { encodeBase64URL, uint8ArrayToString } from '@proton/shared/lib/helpers/encoding';
6 export const buildSecureLink = (url: string, linkKey: Uint8Array) =>
7 `${url}#${encodeBase64URL(uint8ArrayToString(linkKey))}`;
9 /** Transforms a `SecureLinkItem` into a mocked `ItemRevision` for UI
10 * consumption. It's used to make SecureLinkItems compatible with components
11 * that expect `ItemRevision` objects. Only used for UI rendering purposes */
12 export const intoSecureLinkItemRevision = ({ item }: SecureLinkItem): ItemRevision => {
13 const now = getEpoch();
17 contentFormatVersion: ContentFormatVersion.Item,
28 state: ItemState.Active,