Self-hosted multi-platform broadcast newsroom for activist collectives: publishing pipeline with group approval and DST-proof scheduling, TweetDeck-style column wall with hostile-content-safe rendering, live control room with Auto Director, bridged chat governance with polls and quorum, distributed sandboxed transcode workers, encrypted content-addressed archive, monthly analytics. MIT licensed. See README.md and docs/.
7 lines
638 B
TypeScript
7 lines
638 B
TypeScript
export function publishingIdempotencyKey(parts: { workspaceId: string; draftId: string; attemptNo: string | bigint | number }): string {
|
|
if (!/^[A-Za-z0-9-]+$/.test(parts.workspaceId) || !/^[A-Za-z0-9-]+$/.test(parts.draftId)) throw new RangeError("invalid attempt identity");
|
|
if (typeof parts.attemptNo === "number" && !Number.isSafeInteger(parts.attemptNo)) throw new RangeError("unsafe attempt number");
|
|
const attempt = String(parts.attemptNo);
|
|
if (!/^[1-9][0-9]*$/.test(attempt)) throw new RangeError("attemptNo must be a positive decimal integer");
|
|
return `wp3:${parts.workspaceId}:${parts.draftId}:a${attempt}:publish`;
|
|
}
|