@boldvideo/bold-js 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/index.cjs +299 -0
- package/dist/index.d.ts +197 -0
- package/dist/index.js +265 -0
- package/package.json +1 -1
- package/thoughts/shared/plans/2025-10-22-BOLD-759-portal-color-scheme.md +272 -0
- package/thoughts/shared/research/2025-10-22-BOLD-759-portal-color-scheme-settings.md +215 -0
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.github/dependabot.yml +0 -11
- package/.github/workflow/main.yml +0 -21
- package/.github/workflow/publish.yml +0 -29
- package/.github/workflows/changeset-release.yml +0 -51
- package/.github/workflows/ci.yml +0 -90
- package/.github/workflows/release.yml +0 -83
- package/CLAUDE.md +0 -76
- package/CONTRIBUTING.md +0 -103
- package/SECURITY.md +0 -66
- package/src/index.ts +0 -22
- package/src/lib/client.ts +0 -53
- package/src/lib/fetchers.ts +0 -96
- package/src/lib/tracking.ts +0 -117
- package/src/lib/types.ts +0 -217
- package/src/util/throttle.ts +0 -29
- package/tsconfig.json +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @boldvideo/bold-js
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `color_scheme` field to Portal type (BOLD-759)
|
|
8
|
+
|
|
9
|
+
Added optional `color_scheme` field to the Portal type to support theme configuration:
|
|
10
|
+
|
|
11
|
+
- `'toggle'`: Show theme toggle, allow user to switch between light/dark
|
|
12
|
+
- `'light'`: Force light mode, hide theme toggle
|
|
13
|
+
- `'dark'`: Force dark mode, hide theme toggle
|
|
14
|
+
|
|
15
|
+
This field is already returned by the API and consumed by the Next.js starter. The type definition now matches the API response.
|
|
16
|
+
|
|
17
|
+
## 0.6.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Fix missing compiled dist files in published package by adding .npmignore
|
|
22
|
+
|
|
3
23
|
## 0.6.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __export = (target, all) => {
|
|
26
|
+
for (var name in all)
|
|
27
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
|
+
};
|
|
29
|
+
var __copyProps = (to, from, except, desc) => {
|
|
30
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
|
+
for (let key of __getOwnPropNames(from))
|
|
32
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
33
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
|
+
}
|
|
35
|
+
return to;
|
|
36
|
+
};
|
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
38
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
39
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
40
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
41
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
42
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
43
|
+
mod
|
|
44
|
+
));
|
|
45
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
46
|
+
var __async = (__this, __arguments, generator) => {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
var fulfilled = (value) => {
|
|
49
|
+
try {
|
|
50
|
+
step(generator.next(value));
|
|
51
|
+
} catch (e) {
|
|
52
|
+
reject(e);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var rejected = (value) => {
|
|
56
|
+
try {
|
|
57
|
+
step(generator.throw(value));
|
|
58
|
+
} catch (e) {
|
|
59
|
+
reject(e);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
63
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// src/index.ts
|
|
68
|
+
var src_exports = {};
|
|
69
|
+
__export(src_exports, {
|
|
70
|
+
createClient: () => createClient
|
|
71
|
+
});
|
|
72
|
+
module.exports = __toCommonJS(src_exports);
|
|
73
|
+
|
|
74
|
+
// src/lib/client.ts
|
|
75
|
+
var import_axios = __toESM(require("axios"), 1);
|
|
76
|
+
|
|
77
|
+
// src/lib/fetchers.ts
|
|
78
|
+
function get(client, url) {
|
|
79
|
+
return __async(this, null, function* () {
|
|
80
|
+
try {
|
|
81
|
+
const res = yield client.get(url);
|
|
82
|
+
if (res.status !== 200) {
|
|
83
|
+
throw new Error(`Unexpected response status: ${res.status}`);
|
|
84
|
+
}
|
|
85
|
+
return res.data;
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error(`Error fetching data from URL: ${url}`, error);
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function fetchSettings(client) {
|
|
93
|
+
return (videoLimit = 12) => __async(this, null, function* () {
|
|
94
|
+
try {
|
|
95
|
+
return yield get(
|
|
96
|
+
client,
|
|
97
|
+
`settings?limit=${videoLimit}`
|
|
98
|
+
);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.error(`Error fetching settings with limit: ${videoLimit}`, error);
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function fetchVideos(client) {
|
|
106
|
+
return (videoLimit = 12) => __async(this, null, function* () {
|
|
107
|
+
try {
|
|
108
|
+
return yield get(
|
|
109
|
+
client,
|
|
110
|
+
`videos/latest?limit=${videoLimit}`
|
|
111
|
+
);
|
|
112
|
+
} catch (error) {
|
|
113
|
+
console.error(`Error fetching videos with limit: ${videoLimit}`, error);
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function searchVideos(client) {
|
|
119
|
+
return (term) => __async(this, null, function* () {
|
|
120
|
+
try {
|
|
121
|
+
return yield get(client, `videos?query=${term}`);
|
|
122
|
+
} catch (error) {
|
|
123
|
+
console.error(`Error searching for videos with term: ${term}`, error);
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function fetchVideo(client) {
|
|
129
|
+
return (id) => __async(this, null, function* () {
|
|
130
|
+
try {
|
|
131
|
+
return yield get(client, `videos/${id}`);
|
|
132
|
+
} catch (error) {
|
|
133
|
+
console.error(`Error fetching video with ID: ${id}`, error);
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function fetchPlaylists(client) {
|
|
139
|
+
return () => __async(this, null, function* () {
|
|
140
|
+
try {
|
|
141
|
+
return yield get(client, "playlists");
|
|
142
|
+
} catch (error) {
|
|
143
|
+
console.error("Error fetching playlists", error);
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function fetchPlaylist(client) {
|
|
149
|
+
return (id) => __async(this, null, function* () {
|
|
150
|
+
try {
|
|
151
|
+
return yield get(client, `playlists/${id}`);
|
|
152
|
+
} catch (error) {
|
|
153
|
+
console.error(`Error fetching playlist with ID: ${id}`, error);
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// src/util/throttle.ts
|
|
160
|
+
var throttle = (fn, delay) => {
|
|
161
|
+
let wait = false;
|
|
162
|
+
let timeout;
|
|
163
|
+
let cancelled = false;
|
|
164
|
+
return [
|
|
165
|
+
(...args) => {
|
|
166
|
+
if (cancelled)
|
|
167
|
+
return void 0;
|
|
168
|
+
if (wait)
|
|
169
|
+
return void 0;
|
|
170
|
+
const val = fn(...args);
|
|
171
|
+
wait = true;
|
|
172
|
+
timeout = window.setTimeout(() => {
|
|
173
|
+
wait = false;
|
|
174
|
+
}, delay);
|
|
175
|
+
return val;
|
|
176
|
+
},
|
|
177
|
+
() => {
|
|
178
|
+
cancelled = true;
|
|
179
|
+
clearTimeout(timeout);
|
|
180
|
+
}
|
|
181
|
+
];
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// src/lib/tracking.ts
|
|
185
|
+
function sendEvent(client, eventName, data, debug) {
|
|
186
|
+
const payload = {
|
|
187
|
+
n: eventName,
|
|
188
|
+
u: data.url,
|
|
189
|
+
usr: data.userId,
|
|
190
|
+
d: data.domain,
|
|
191
|
+
ua: data.userAgent,
|
|
192
|
+
w: data.deviceWidth,
|
|
193
|
+
vid: (data == null ? void 0 : data.videoId) || void 0,
|
|
194
|
+
vt: data.title,
|
|
195
|
+
vdur: (data == null ? void 0 : data.videoDuration) || void 0,
|
|
196
|
+
time: (data == null ? void 0 : data.currentTime) || void 0
|
|
197
|
+
};
|
|
198
|
+
if (debug)
|
|
199
|
+
console.log(`Bold SDK - Logging event '${eventName}'`, payload);
|
|
200
|
+
client.post("/event", payload);
|
|
201
|
+
}
|
|
202
|
+
var [throttledSendEvent] = throttle(sendEvent, 5e3);
|
|
203
|
+
function trackEvent(client, userId, options) {
|
|
204
|
+
return (video, event) => {
|
|
205
|
+
var _a;
|
|
206
|
+
const eventDetails = __spreadProps(__spreadValues({}, basicInfos()), {
|
|
207
|
+
userId,
|
|
208
|
+
videoId: video.id,
|
|
209
|
+
title: video.title,
|
|
210
|
+
videoDuration: video.duration,
|
|
211
|
+
currentTime: ((_a = event.target) == null ? void 0 : _a.currentTime) || 0
|
|
212
|
+
});
|
|
213
|
+
if (event.type == "timeupdate" || event.type == "time-update") {
|
|
214
|
+
throttledSendEvent(
|
|
215
|
+
client,
|
|
216
|
+
getEventName(event),
|
|
217
|
+
eventDetails,
|
|
218
|
+
options.debug
|
|
219
|
+
);
|
|
220
|
+
} else {
|
|
221
|
+
sendEvent(client, getEventName(event), eventDetails, options.debug);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function trackPageView(client, userId, options) {
|
|
226
|
+
return (title) => {
|
|
227
|
+
const eventDetails = __spreadProps(__spreadValues({}, basicInfos()), {
|
|
228
|
+
userId,
|
|
229
|
+
title
|
|
230
|
+
});
|
|
231
|
+
sendEvent(client, "page_view", eventDetails, options.debug);
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function getEventName(event) {
|
|
235
|
+
switch (event.type) {
|
|
236
|
+
case "pause":
|
|
237
|
+
return "video_pause";
|
|
238
|
+
case "play":
|
|
239
|
+
return "video_resume";
|
|
240
|
+
case "loadedmetadata":
|
|
241
|
+
case "loaded-metadata":
|
|
242
|
+
return "video_load";
|
|
243
|
+
case "time-update":
|
|
244
|
+
case "timeupdate":
|
|
245
|
+
return "video_progress";
|
|
246
|
+
default:
|
|
247
|
+
return "unknown_event";
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function basicInfos() {
|
|
251
|
+
return {
|
|
252
|
+
url: location.href,
|
|
253
|
+
domain: location.hostname,
|
|
254
|
+
referrer: document.referrer || null,
|
|
255
|
+
deviceWidth: window.innerWidth,
|
|
256
|
+
userAgent: navigator.userAgent
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// src/lib/client.ts
|
|
261
|
+
function createClient(apiKey, options = { debug: false }) {
|
|
262
|
+
var _a;
|
|
263
|
+
if (!apiKey || typeof apiKey !== "string") {
|
|
264
|
+
throw new Error("API key is missing or invalid");
|
|
265
|
+
}
|
|
266
|
+
const { debug } = options;
|
|
267
|
+
const apiClientOptions = {
|
|
268
|
+
baseURL: (_a = options.baseURL) != null ? _a : "https://app.boldvideo.io/api/v1/",
|
|
269
|
+
headers: {
|
|
270
|
+
Authorization: apiKey
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
let apiClient;
|
|
274
|
+
try {
|
|
275
|
+
apiClient = import_axios.default.create(apiClientOptions);
|
|
276
|
+
} catch (error) {
|
|
277
|
+
console.error("Error creating API client", error);
|
|
278
|
+
throw error;
|
|
279
|
+
}
|
|
280
|
+
const userId = [...Array(30)].map(() => Math.random().toString(36)[2]).join("");
|
|
281
|
+
return {
|
|
282
|
+
settings: fetchSettings(apiClient),
|
|
283
|
+
videos: {
|
|
284
|
+
list: fetchVideos(apiClient),
|
|
285
|
+
get: fetchVideo(apiClient),
|
|
286
|
+
search: searchVideos(apiClient)
|
|
287
|
+
},
|
|
288
|
+
playlists: {
|
|
289
|
+
list: fetchPlaylists(apiClient),
|
|
290
|
+
get: fetchPlaylist(apiClient)
|
|
291
|
+
},
|
|
292
|
+
trackEvent: trackEvent(apiClient, userId, { debug }),
|
|
293
|
+
trackPageView: trackPageView(apiClient, userId, { debug })
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
297
|
+
0 && (module.exports = {
|
|
298
|
+
createClient
|
|
299
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
type VideoAttachment = {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
file_url: string;
|
|
5
|
+
file_size?: number;
|
|
6
|
+
file_type?: string;
|
|
7
|
+
};
|
|
8
|
+
type VideoDownloadUrls = {
|
|
9
|
+
mp4?: string;
|
|
10
|
+
audio?: string;
|
|
11
|
+
legacy_mp4?: string;
|
|
12
|
+
};
|
|
13
|
+
type VideoSubtitles = {
|
|
14
|
+
label: string;
|
|
15
|
+
url: string;
|
|
16
|
+
engine?: string;
|
|
17
|
+
language: string;
|
|
18
|
+
};
|
|
19
|
+
type VideoTranscript = {
|
|
20
|
+
text: string;
|
|
21
|
+
json: any;
|
|
22
|
+
};
|
|
23
|
+
type VideoMetadata = {
|
|
24
|
+
description: string;
|
|
25
|
+
title: string;
|
|
26
|
+
image: string | null;
|
|
27
|
+
};
|
|
28
|
+
type Video = {
|
|
29
|
+
captions: string;
|
|
30
|
+
captions_label: string;
|
|
31
|
+
captions_lang: string;
|
|
32
|
+
description: string | null;
|
|
33
|
+
duration: number;
|
|
34
|
+
id: string;
|
|
35
|
+
imported_from: string | null;
|
|
36
|
+
legacy_video_url: string | null;
|
|
37
|
+
playback_id: string;
|
|
38
|
+
published_at: string;
|
|
39
|
+
stream_url: string;
|
|
40
|
+
teaser: string | null;
|
|
41
|
+
thumbnail: string;
|
|
42
|
+
title: string;
|
|
43
|
+
type: string;
|
|
44
|
+
meta_data: VideoMetadata;
|
|
45
|
+
chapters?: string;
|
|
46
|
+
attachments?: VideoAttachment[];
|
|
47
|
+
cta?: any | null;
|
|
48
|
+
download_urls?: VideoDownloadUrls;
|
|
49
|
+
internal_id?: string;
|
|
50
|
+
playback_speed?: number;
|
|
51
|
+
subtitles?: VideoSubtitles;
|
|
52
|
+
tags?: string[];
|
|
53
|
+
transcript?: VideoTranscript;
|
|
54
|
+
};
|
|
55
|
+
type Playlist = {
|
|
56
|
+
description?: string;
|
|
57
|
+
id: string;
|
|
58
|
+
is_private: boolean;
|
|
59
|
+
title: string;
|
|
60
|
+
type: string;
|
|
61
|
+
videos: Video[];
|
|
62
|
+
};
|
|
63
|
+
type MenuItem = {
|
|
64
|
+
icon: string;
|
|
65
|
+
is_ext: boolean;
|
|
66
|
+
label: string;
|
|
67
|
+
url: string;
|
|
68
|
+
};
|
|
69
|
+
type PortalDisplay = {
|
|
70
|
+
show_chapters: boolean;
|
|
71
|
+
show_transcripts: boolean;
|
|
72
|
+
};
|
|
73
|
+
type AssistantConfig = {
|
|
74
|
+
headline: string;
|
|
75
|
+
subheadline: string;
|
|
76
|
+
suggestions: string[];
|
|
77
|
+
};
|
|
78
|
+
type PortalLayout = {
|
|
79
|
+
assistant_config: AssistantConfig | null;
|
|
80
|
+
show_playlists: boolean;
|
|
81
|
+
type: string;
|
|
82
|
+
videos_limit: number;
|
|
83
|
+
};
|
|
84
|
+
type PortalNavigation = {
|
|
85
|
+
show_ai_search: boolean;
|
|
86
|
+
show_header: boolean;
|
|
87
|
+
show_search: boolean;
|
|
88
|
+
};
|
|
89
|
+
type PortalTheme = {
|
|
90
|
+
background: string;
|
|
91
|
+
font_body: string;
|
|
92
|
+
font_header: string;
|
|
93
|
+
foreground: string;
|
|
94
|
+
logo_height: number;
|
|
95
|
+
logo_url: string;
|
|
96
|
+
logo_width: number;
|
|
97
|
+
primary: string;
|
|
98
|
+
};
|
|
99
|
+
type Portal = {
|
|
100
|
+
color_scheme?: 'toggle' | 'light' | 'dark';
|
|
101
|
+
display: PortalDisplay;
|
|
102
|
+
layout: PortalLayout;
|
|
103
|
+
navigation: PortalNavigation;
|
|
104
|
+
theme: PortalTheme;
|
|
105
|
+
};
|
|
106
|
+
type ThemeColors = {
|
|
107
|
+
background: string;
|
|
108
|
+
border: string;
|
|
109
|
+
card: string;
|
|
110
|
+
"card-foreground": string;
|
|
111
|
+
destructive: string;
|
|
112
|
+
"destructive-foreground": string;
|
|
113
|
+
foreground: string;
|
|
114
|
+
input: string;
|
|
115
|
+
muted: string;
|
|
116
|
+
"muted-foreground": string;
|
|
117
|
+
popover: string;
|
|
118
|
+
"popover-foreground": string;
|
|
119
|
+
primary: string;
|
|
120
|
+
"primary-foreground": string;
|
|
121
|
+
ring: string;
|
|
122
|
+
secondary: string;
|
|
123
|
+
"secondary-foreground": string;
|
|
124
|
+
};
|
|
125
|
+
type ThemeConfig = {
|
|
126
|
+
dark: ThemeColors;
|
|
127
|
+
light: ThemeColors;
|
|
128
|
+
radius: string;
|
|
129
|
+
};
|
|
130
|
+
type AccountAI = {
|
|
131
|
+
avatar_url: string;
|
|
132
|
+
enabled: boolean;
|
|
133
|
+
greeting: string;
|
|
134
|
+
name: string;
|
|
135
|
+
};
|
|
136
|
+
type Account = {
|
|
137
|
+
ai: AccountAI;
|
|
138
|
+
name: string;
|
|
139
|
+
slug: string;
|
|
140
|
+
};
|
|
141
|
+
type Settings = {
|
|
142
|
+
featured_playlists: Playlist[];
|
|
143
|
+
menu_items: MenuItem[];
|
|
144
|
+
ai_avatar: string;
|
|
145
|
+
ai_name: string;
|
|
146
|
+
ai_greeting?: string;
|
|
147
|
+
has_ai: boolean;
|
|
148
|
+
account: Account;
|
|
149
|
+
favicon_url?: string;
|
|
150
|
+
logo_dark_url?: string;
|
|
151
|
+
logo_url?: string;
|
|
152
|
+
meta_data: {
|
|
153
|
+
channel_name: string;
|
|
154
|
+
description: string;
|
|
155
|
+
image: string | null;
|
|
156
|
+
no_seo: boolean;
|
|
157
|
+
social_graph_image_url?: string;
|
|
158
|
+
title: string;
|
|
159
|
+
title_suffix: string;
|
|
160
|
+
};
|
|
161
|
+
portal: Portal;
|
|
162
|
+
theme_config: ThemeConfig;
|
|
163
|
+
version: string;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
type ClientOptions = {
|
|
167
|
+
baseURL?: string;
|
|
168
|
+
debug: boolean;
|
|
169
|
+
};
|
|
170
|
+
declare function createClient(apiKey: string, options?: ClientOptions): {
|
|
171
|
+
settings: (videoLimit?: number) => Promise<{
|
|
172
|
+
data: Settings;
|
|
173
|
+
}>;
|
|
174
|
+
videos: {
|
|
175
|
+
list: (videoLimit?: number) => Promise<{
|
|
176
|
+
data: Video[];
|
|
177
|
+
}>;
|
|
178
|
+
get: (id: string) => Promise<{
|
|
179
|
+
data: Video;
|
|
180
|
+
}>;
|
|
181
|
+
search: (term: string) => Promise<{
|
|
182
|
+
data: Video[];
|
|
183
|
+
}>;
|
|
184
|
+
};
|
|
185
|
+
playlists: {
|
|
186
|
+
list: () => Promise<{
|
|
187
|
+
data: Playlist[];
|
|
188
|
+
}>;
|
|
189
|
+
get: (id: string) => Promise<{
|
|
190
|
+
data: Playlist;
|
|
191
|
+
}>;
|
|
192
|
+
};
|
|
193
|
+
trackEvent: (video: any, event: Event) => void;
|
|
194
|
+
trackPageView: (title: string) => void;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export { Account, AccountAI, AssistantConfig, MenuItem, Playlist, Portal, PortalDisplay, PortalLayout, PortalNavigation, PortalTheme, Settings, ThemeColors, ThemeConfig, Video, VideoAttachment, VideoDownloadUrls, VideoMetadata, VideoSubtitles, VideoTranscript, createClient };
|