diff --git a/server/community-store.ts b/server/community-store.ts index a16cc55..c5f59b6 100644 --- a/server/community-store.ts +++ b/server/community-store.ts @@ -367,14 +367,13 @@ export function addShapes( ids.push(id); d.shapes[id] = { type: (shape.type as string) || 'geo', - id, x: (shape.x as number) ?? 100, y: (shape.y as number) ?? 100, width: (shape.width as number) ?? 300, height: (shape.height as number) ?? 200, rotation: (shape.rotation as number) ?? 0, ...shape, - id, // ensure id override + id, } as ShapeData; } }); diff --git a/server/encryptid-sdk.d.ts b/server/encryptid-sdk.d.ts new file mode 100644 index 0000000..b74ef52 --- /dev/null +++ b/server/encryptid-sdk.d.ts @@ -0,0 +1,26 @@ +declare module '@encryptid/sdk/server' { + export function verifyEncryptIDToken(token: string): Promise; + export function evaluateSpaceAccess( + slug: string, + token: string | null, + method: string, + options: { getSpaceConfig: (slug: string) => Promise }, + ): Promise<{ allowed: boolean; readOnly: boolean; reason?: string; claims?: EncryptIDClaims }>; + export function extractToken(headers: Headers): string | null; + export function authenticateWSUpgrade(req: Request): Promise; + + export interface EncryptIDClaims { + sub: string; + username?: string; + iat?: number; + exp?: number; + [key: string]: unknown; + } + + export interface SpaceAuthConfig { + spaceSlug: string; + visibility: string; + ownerDID?: string; + app?: string; + } +} diff --git a/tsconfig.json b/tsconfig.json index 8a21a42..77166bd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,5 +21,5 @@ } }, "include": ["**/*.ts", "vite.config.ts"], - "exclude": ["node_modules/**/*", "dist/**/*"] + "exclude": ["node_modules/**/*", "dist/**/*", "src/encryptid/**/*"] }