MCPcopy Create free account
hub / github.com/codeaashu/claude-code / createShare

Function createShare

web/lib/share-store.ts:34–59  ·  view source on GitHub ↗
(
  shareId: string,
  params: {
    conversation: Conversation;
    visibility: ShareVisibility;
    password?: string;
    expiry: ShareExpiry;
  }
)

Source from the content-addressed store, hash-verified

32const store = new Map<string, StoredShare>();
33
34export function createShare(
35 shareId: string,
36 params: {
37 conversation: Conversation;
38 visibility: ShareVisibility;
39 password?: string;
40 expiry: ShareExpiry;
41 }
42): StoredShare {
43 const expiryMs = EXPIRY_MS[params.expiry];
44 const now = Date.now();
45
46 const entry: StoredShare = {
47 id: shareId,
48 conversationId: params.conversation.id,
49 conversation: params.conversation,
50 visibility: params.visibility,
51 passwordHash: params.password ?? undefined,
52 expiry: params.expiry,
53 expiresAt: expiryMs !== null ? now + expiryMs : undefined,
54 createdAt: now,
55 };
56
57 store.set(shareId, entry);
58 return entry;
59}
60
61export function getShare(shareId: string): StoredShare | null {
62 const entry = store.get(shareId);

Callers 1

POSTFunction · 0.90

Calls 1

setMethod · 0.45

Tested by

no test coverage detected