feat: init affine blob storage (#2045)

This commit is contained in:
Himself65
2023-04-20 03:23:41 -05:00
committed by GitHub
parent c08c587efb
commit 63f7b2556e
25 changed files with 828 additions and 448 deletions

View File

@@ -1,4 +1,3 @@
import { getLoginStorage } from '@affine/workspace/affine/login';
import type { AffinePublicWorkspace } from '@affine/workspace/type';
import { WorkspaceFlavour } from '@affine/workspace/type';
import { createEmptyBlockSuiteWorkspace } from '@affine/workspace/utils';
@@ -14,10 +13,9 @@ function createPublicWorkspace(
): AffinePublicWorkspace {
const blockSuiteWorkspace = createEmptyBlockSuiteWorkspace(
workspaceId,
(k: string) =>
// fixme: token could be expired
({ api: `api/workspace`, token: getLoginStorage()?.token }[k]),
WorkspaceFlavour.AFFINE,
{
workspaceApis: affineApis,
cachePrefix: WorkspaceFlavour.PUBLIC + (singlePage ? '-single-page' : ''),
}
);