Tactical Media Broadcast Hub — initial release
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/.
This commit is contained in:
commit
aa5e262f3a
880 changed files with 111042 additions and 0 deletions
63
packages/connector-example/src/index.ts
Normal file
63
packages/connector-example/src/index.ts
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/**
|
||||
* Reference connector: the minimal honest implementation. Every real
|
||||
* connector copies this shape and fills in a provider API.
|
||||
*/
|
||||
import type {
|
||||
ConnectorCapabilities,
|
||||
ConnectorConnection,
|
||||
NormalizedIdentity,
|
||||
NormalizedPost,
|
||||
Publication,
|
||||
} from "@tactical-media-broadcast-hub/core";
|
||||
import {
|
||||
assertValidManifest,
|
||||
type ConnectorManifest,
|
||||
type PlatformConnector,
|
||||
} from "@tactical-media-broadcast-hub/connector-sdk";
|
||||
|
||||
const CAPABILITIES: ConnectorCapabilities = {
|
||||
publishText: true,
|
||||
};
|
||||
|
||||
export function createExampleConnector(): PlatformConnector {
|
||||
const manifest: ConnectorManifest = {
|
||||
id: "example",
|
||||
displayName: "Example (reference connector)",
|
||||
capabilities: CAPABILITIES,
|
||||
connectionFields: [
|
||||
{ name: "apiToken", label: "API token", required: true, secret: true },
|
||||
],
|
||||
};
|
||||
|
||||
return {
|
||||
manifest: () => {
|
||||
assertValidManifest(manifest);
|
||||
return manifest;
|
||||
},
|
||||
|
||||
async authorize() {
|
||||
throw new Error("example connector does not implement OAuth");
|
||||
},
|
||||
|
||||
async getIdentity(connection: ConnectorConnection): Promise<NormalizedIdentity> {
|
||||
return {
|
||||
provider: manifest.id,
|
||||
remoteId: connection.id,
|
||||
handle: "example@example",
|
||||
displayName: "Example Account",
|
||||
};
|
||||
},
|
||||
|
||||
async publish(connection: ConnectorConnection, post: NormalizedPost): Promise<Publication> {
|
||||
return {
|
||||
id: `pub-${post.text.length}`,
|
||||
workspaceId: connection.workspaceId,
|
||||
draftId: "direct",
|
||||
connectionId: connection.id,
|
||||
remoteId: `remote-${post.text.length}`,
|
||||
publishedAt: new Date(),
|
||||
providerMetadata: post.providerMetadata,
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue