Files
bitvid/dist/js/nostr/viewEventBindings.js
T
google-labs-jules[bot]andPR0M3TH3AN 0bfa3b08e8 fix(ci): fix netlify deployment by building to dist
- Move from root publishing to clean `dist/` directory
- Create `scripts/build-dist.mjs` to orchestrate build and copy assets
- Update `package.json` build script
- Update `netlify.toml` to publish `dist/`
- Ignore `dist/` in `.gitignore`

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-29 09:07:15 +00:00

43 lines
1.1 KiB
JavaScript

// js/nostr/viewEventBindings.js
import { nostrClient } from "./defaultClient.js";
function ensureOptionalBinding(methodName, errorMessage) {
const handler =
nostrClient && typeof nostrClient[methodName] === "function"
? nostrClient[methodName]
: null;
if (!handler) {
throw new Error(errorMessage);
}
return handler;
}
export function recordVideoView(...args) {
return nostrClient.recordVideoView(...args);
}
export function listVideoViewEvents(...args) {
const handler = ensureOptionalBinding(
"listVideoViewEvents",
"Video view listing is unavailable in this build."
);
return handler.apply(nostrClient, args);
}
export function subscribeVideoViewEvents(...args) {
const handler = ensureOptionalBinding(
"subscribeVideoViewEvents",
"Video view subscriptions are unavailable in this build."
);
return handler.apply(nostrClient, args);
}
export function countVideoViewEvents(...args) {
const handler = ensureOptionalBinding(
"countVideoViewEvents",
"Video view counting is unavailable in this build."
);
return handler.apply(nostrClient, args);
}