@boldvideo/bold-js 0.5.0 → 0.6.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/.github/workflows/ci.yml +8 -6
- package/CHANGELOG.md +24 -0
- package/package.json +4 -1
- package/src/index.ts +21 -1
- package/src/lib/types.ts +169 -4
package/.github/workflows/ci.yml
CHANGED
|
@@ -10,10 +10,10 @@ jobs:
|
|
|
10
10
|
test:
|
|
11
11
|
name: Test on Node ${{ matrix.node-version }}
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
strategy:
|
|
15
15
|
matrix:
|
|
16
|
-
node-version: [
|
|
16
|
+
node-version: [20.x, 22.x, 24.x]
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
19
|
- name: Checkout code
|
|
@@ -67,7 +67,7 @@ jobs:
|
|
|
67
67
|
- name: Use Node.js
|
|
68
68
|
uses: actions/setup-node@v4
|
|
69
69
|
with:
|
|
70
|
-
node-version:
|
|
70
|
+
node-version: 22.x
|
|
71
71
|
cache: 'pnpm'
|
|
72
72
|
|
|
73
73
|
- name: Install dependencies
|
|
@@ -80,9 +80,11 @@ jobs:
|
|
|
80
80
|
run: |
|
|
81
81
|
echo "Bundle sizes:"
|
|
82
82
|
ls -lh dist/
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
# Warn if bundle exceeds 50KB (adjust threshold as needed)
|
|
85
|
-
size=$(
|
|
85
|
+
size=$(node -e "console.log(require('fs').statSync('dist/index.js').size)")
|
|
86
86
|
if [ $size -gt 51200 ]; then
|
|
87
|
-
echo "⚠️ Warning: Bundle size exceeds 50KB"
|
|
87
|
+
echo "⚠️ Warning: Bundle size exceeds 50KB (current: ${size} bytes)"
|
|
88
|
+
else
|
|
89
|
+
echo "✅ Bundle size OK: ${size} bytes"
|
|
88
90
|
fi
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @boldvideo/bold-js
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add complete type definitions for Settings and Video API responses
|
|
8
|
+
|
|
9
|
+
**Settings updates:**
|
|
10
|
+
|
|
11
|
+
- Add `portal` object with display, layout, navigation, and theme settings
|
|
12
|
+
- Add `portal.navigation.show_header` field (BOLD-687)
|
|
13
|
+
- Add `account` object with nested AI configuration
|
|
14
|
+
- Add top-level fields: `favicon_url`, `logo_dark_url`, `logo_url`, `version`
|
|
15
|
+
- Add `theme_config` with dark/light theme definitions
|
|
16
|
+
- Expand `meta_data` to include `social_graph_image_url`
|
|
17
|
+
- Maintain backward compatibility with flat AI fields
|
|
18
|
+
|
|
19
|
+
**Video updates:**
|
|
20
|
+
|
|
21
|
+
- Add missing fields: `chapters`, `attachments`, `download_urls`, `transcript`
|
|
22
|
+
- Add `internal_id`, `playback_speed`, `subtitles`, `tags`, `cta`
|
|
23
|
+
- Fix `meta_data` type from array to object
|
|
24
|
+
- Replace incorrect `transcription` field with correct `transcript` field
|
|
25
|
+
- Mark optional fields appropriately
|
|
26
|
+
|
|
3
27
|
## 0.5.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boldvideo/bold-js",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"type": "module",
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=20.0.0"
|
|
11
|
+
},
|
|
9
12
|
"repository": {
|
|
10
13
|
"type": "git",
|
|
11
14
|
"url": "https://github.com/boldvideo/bold-js"
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,22 @@
|
|
|
1
1
|
export { createClient } from "lib/client";
|
|
2
|
-
export
|
|
2
|
+
export type {
|
|
3
|
+
Video,
|
|
4
|
+
VideoAttachment,
|
|
5
|
+
VideoDownloadUrls,
|
|
6
|
+
VideoSubtitles,
|
|
7
|
+
VideoTranscript,
|
|
8
|
+
VideoMetadata,
|
|
9
|
+
Playlist,
|
|
10
|
+
MenuItem,
|
|
11
|
+
Settings,
|
|
12
|
+
Portal,
|
|
13
|
+
PortalDisplay,
|
|
14
|
+
PortalLayout,
|
|
15
|
+
PortalNavigation,
|
|
16
|
+
PortalTheme,
|
|
17
|
+
AssistantConfig,
|
|
18
|
+
ThemeConfig,
|
|
19
|
+
ThemeColors,
|
|
20
|
+
Account,
|
|
21
|
+
AccountAI,
|
|
22
|
+
} from "./lib/types";
|
package/src/lib/types.ts
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
|
+
export type VideoAttachment = {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
file_url: string;
|
|
5
|
+
file_size?: number;
|
|
6
|
+
file_type?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type VideoDownloadUrls = {
|
|
10
|
+
mp4?: string;
|
|
11
|
+
audio?: string;
|
|
12
|
+
legacy_mp4?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type VideoSubtitles = {
|
|
16
|
+
label: string;
|
|
17
|
+
url: string;
|
|
18
|
+
engine?: string;
|
|
19
|
+
language: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type VideoTranscript = {
|
|
23
|
+
text: string;
|
|
24
|
+
json: any;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type VideoMetadata = {
|
|
28
|
+
description: string;
|
|
29
|
+
title: string;
|
|
30
|
+
image: string | null;
|
|
31
|
+
};
|
|
32
|
+
|
|
1
33
|
export type Video = {
|
|
34
|
+
// Existing fields (kept as-is)
|
|
2
35
|
captions: string;
|
|
3
36
|
captions_label: string;
|
|
4
37
|
captions_lang: string;
|
|
@@ -6,16 +39,44 @@ export type Video = {
|
|
|
6
39
|
duration: number;
|
|
7
40
|
id: string;
|
|
8
41
|
imported_from: string | null;
|
|
9
|
-
legacy_video_url:
|
|
10
|
-
meta_data: [];
|
|
42
|
+
legacy_video_url: string | null;
|
|
11
43
|
playback_id: string;
|
|
12
44
|
published_at: string;
|
|
13
45
|
stream_url: string;
|
|
14
46
|
teaser: string | null;
|
|
15
47
|
thumbnail: string;
|
|
16
48
|
title: string;
|
|
17
|
-
transcription: string;
|
|
18
49
|
type: string;
|
|
50
|
+
|
|
51
|
+
// Fixed: meta_data should be an object, not array
|
|
52
|
+
meta_data: VideoMetadata;
|
|
53
|
+
|
|
54
|
+
// New: Chapters in WEBVTT format
|
|
55
|
+
chapters?: string;
|
|
56
|
+
|
|
57
|
+
// New: Attachments array
|
|
58
|
+
attachments?: VideoAttachment[];
|
|
59
|
+
|
|
60
|
+
// New: Call-to-action (can be null)
|
|
61
|
+
cta?: any | null;
|
|
62
|
+
|
|
63
|
+
// New: Download URLs object
|
|
64
|
+
download_urls?: VideoDownloadUrls;
|
|
65
|
+
|
|
66
|
+
// New: Internal ID
|
|
67
|
+
internal_id?: string;
|
|
68
|
+
|
|
69
|
+
// New: Playback speed
|
|
70
|
+
playback_speed?: number;
|
|
71
|
+
|
|
72
|
+
// New: Subtitles object
|
|
73
|
+
subtitles?: VideoSubtitles;
|
|
74
|
+
|
|
75
|
+
// New: Tags array
|
|
76
|
+
tags?: string[];
|
|
77
|
+
|
|
78
|
+
// New: Transcript object (replaces transcription)
|
|
79
|
+
transcript?: VideoTranscript;
|
|
19
80
|
};
|
|
20
81
|
|
|
21
82
|
export type Playlist = {
|
|
@@ -34,19 +95,123 @@ export type MenuItem = {
|
|
|
34
95
|
url: string;
|
|
35
96
|
};
|
|
36
97
|
|
|
98
|
+
export type PortalDisplay = {
|
|
99
|
+
show_chapters: boolean;
|
|
100
|
+
show_transcripts: boolean;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type AssistantConfig = {
|
|
104
|
+
headline: string;
|
|
105
|
+
subheadline: string;
|
|
106
|
+
suggestions: string[];
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export type PortalLayout = {
|
|
110
|
+
assistant_config: AssistantConfig | null;
|
|
111
|
+
show_playlists: boolean;
|
|
112
|
+
type: string;
|
|
113
|
+
videos_limit: number;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export type PortalNavigation = {
|
|
117
|
+
show_ai_search: boolean;
|
|
118
|
+
show_header: boolean;
|
|
119
|
+
show_search: boolean;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export type PortalTheme = {
|
|
123
|
+
background: string;
|
|
124
|
+
font_body: string;
|
|
125
|
+
font_header: string;
|
|
126
|
+
foreground: string;
|
|
127
|
+
logo_height: number;
|
|
128
|
+
logo_url: string;
|
|
129
|
+
logo_width: number;
|
|
130
|
+
primary: string;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type Portal = {
|
|
134
|
+
display: PortalDisplay;
|
|
135
|
+
layout: PortalLayout;
|
|
136
|
+
navigation: PortalNavigation;
|
|
137
|
+
theme: PortalTheme;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export type ThemeColors = {
|
|
141
|
+
background: string;
|
|
142
|
+
border: string;
|
|
143
|
+
card: string;
|
|
144
|
+
"card-foreground": string;
|
|
145
|
+
destructive: string;
|
|
146
|
+
"destructive-foreground": string;
|
|
147
|
+
foreground: string;
|
|
148
|
+
input: string;
|
|
149
|
+
muted: string;
|
|
150
|
+
"muted-foreground": string;
|
|
151
|
+
popover: string;
|
|
152
|
+
"popover-foreground": string;
|
|
153
|
+
primary: string;
|
|
154
|
+
"primary-foreground": string;
|
|
155
|
+
ring: string;
|
|
156
|
+
secondary: string;
|
|
157
|
+
"secondary-foreground": string;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export type ThemeConfig = {
|
|
161
|
+
dark: ThemeColors;
|
|
162
|
+
light: ThemeColors;
|
|
163
|
+
radius: string;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export type AccountAI = {
|
|
167
|
+
avatar_url: string;
|
|
168
|
+
enabled: boolean;
|
|
169
|
+
greeting: string;
|
|
170
|
+
name: string;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export type Account = {
|
|
174
|
+
ai: AccountAI;
|
|
175
|
+
name: string;
|
|
176
|
+
slug: string;
|
|
177
|
+
};
|
|
178
|
+
|
|
37
179
|
export type Settings = {
|
|
180
|
+
// Existing top-level arrays
|
|
38
181
|
featured_playlists: Playlist[];
|
|
39
182
|
menu_items: MenuItem[];
|
|
183
|
+
|
|
184
|
+
// Existing flat AI fields (kept for backward compatibility)
|
|
40
185
|
ai_avatar: string;
|
|
41
186
|
ai_name: string;
|
|
42
187
|
ai_greeting?: string;
|
|
43
188
|
has_ai: boolean;
|
|
189
|
+
|
|
190
|
+
// New: Account object with nested AI config
|
|
191
|
+
account: Account;
|
|
192
|
+
|
|
193
|
+
// New: Top-level URL fields
|
|
194
|
+
favicon_url?: string;
|
|
195
|
+
logo_dark_url?: string;
|
|
196
|
+
logo_url?: string;
|
|
197
|
+
|
|
198
|
+
// Updated: meta_data with additional fields
|
|
44
199
|
meta_data: {
|
|
45
200
|
channel_name: string;
|
|
46
201
|
description: string;
|
|
47
|
-
image: string;
|
|
202
|
+
image: string | null;
|
|
48
203
|
no_seo: boolean;
|
|
204
|
+
social_graph_image_url?: string;
|
|
49
205
|
title: string;
|
|
50
206
|
title_suffix: string;
|
|
51
207
|
};
|
|
208
|
+
|
|
209
|
+
// New: Portal object with all nested structures
|
|
210
|
+
portal: Portal;
|
|
211
|
+
|
|
212
|
+
// New: Theme configuration
|
|
213
|
+
theme_config: ThemeConfig;
|
|
214
|
+
|
|
215
|
+
// New: API version
|
|
216
|
+
version: string;
|
|
52
217
|
};
|