Skip to content

Commit b8f15a2

Browse files
release: v2.0.0 - expand SDK with new Media, Live, SigningKey, and Data APIs
1 parent 3539bb9 commit b8f15a2

File tree

738 files changed

+71739
-2897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

738 files changed

+71739
-2897
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This allows generated code to be indexed correctly
2+
*.ts linguist-generated=false

.gitignore

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1+
/models
2+
/models/errors
3+
/types
4+
/node_modules
5+
/examples/node_modules
6+
/lib
7+
/sdk
8+
/funcs
9+
/react-query
10+
/mcp-server
11+
/hooks
12+
/index.*
13+
/core.*
14+
/bin
15+
/cjs
16+
/esm
17+
/dist
18+
/.tsbuildinfo
19+
/.eslintcache
20+
/.tshy
21+
/.tshy-*
22+
/__tests__
23+
.DS_Store
24+
.DS_Store
25+
.env
26+
.env.local
27+
.env.*.local
128
node_modules
2-
dist
3-
utils
4-
/.cache
5-
**/.DS_Store

.npmignore

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1-
*
1+
**/*
2+
!/FUNCTIONS.md
3+
!/RUNTIMES.md
4+
!/REACT_QUERY.md
5+
!/**/*.ts
6+
!/**/*.js
7+
!/**/*.mjs
8+
!/**/*.json
9+
!/**/*.map
10+
11+
/eslint.config.mjs
12+
/cjs
13+
/.tshy
14+
/.tshy-*
15+
/__tests__

.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,68 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [1.0.2]
6-
- Updated `package.json` with keywords related to FastPix Node.js API SDK.
5+
## [2.0.0] - Major Feature Release
6+
This release introduces a wide set of new APIs, significantly expanding the SDK’s capabilities across **On Demand**, **Live Stream**, **SigningKeys**, and **Video Data** domains.
77

8-
## [1.0.1]
9-
- update `README.md`
8+
### Media API
9+
Extended functionality for managing media with advanced processing, playlist management, and DRM support:
10+
- `updateMediaSummary` - Generate video summaries for quick insights
11+
- `updateMediaChapters` - Automatically generate structured video chapters
12+
- `updateMediaNamedEntities` - Extract named entities for video intelligence
13+
- `updateMediaModeration` - Enable video moderation features for compliance
14+
- `addMediaTrack` - Add audio/subtitle tracks
15+
- `cancelUpload` - Cancel ongoing uploads gracefully
16+
- `updateMediaTrack` - Update audio/subtitle tracks
17+
- `deleteMediaTrack` - Remove audio/subtitle tracks
18+
- `generateSubtitleTrack` - Auto-generate subtitles
19+
- `updatedSourceAccess` - Update media source access permissions
20+
- `updatedMp4Support` - Toggle MP4 support for a media
21+
- `retrieveMediaInputInfo` - Fetch media input information
22+
- `listUploads` - Retrieve all unused upload URLs
23+
- `getMediaClips` - List clips of a media
24+
- Playlist Management:
25+
- `createAPlaylist`, `getAllPlaylists`, `getPlaylistById`, `updateAPlaylist`, `deleteAPlaylist`, `addMediaToPlaylist`, `changeMediaOrderInPlaylist`, `deleteMediaFromPlaylist`
26+
- DRM Management:
27+
- `getDrmConfiguration`, `getDrmConfigurationById`
1028

11-
## [1.0.0]
12-
- This SDK serves as a library for secure and efficient communication with the FastPix API.
29+
### Live API
30+
Added fine-grained stream control:
31+
- `enableLiveStream` - Enable a stream
32+
- `disableLiveStream` - Disable a stream
33+
- `completeLiveStream` - Mark a live stream as completed
34+
35+
### SigningKey API
36+
Introduced secure signing key management:
37+
- `createSigningKey` - Create signing keys for secure token usage
38+
- `listSigningKeys` - List available signing keys
39+
- `deleteSigningKey` - Revoke signing keys
40+
- `getSigningKeyById` - Retrieve signing key details
41+
42+
### Data API
43+
New analytics endpoints for tracking and measuring performance:
44+
- `listVideoViews` - List video views
45+
- `getVideoViewDetails` - Fetch detailed video view information
46+
- `listByTopContent` - Discover top-performing content
47+
- `getDataViewlistCurrentViewsGetTimeseriesViews` - Retrieve concurrent viewers timeseries
48+
- `getDataViewlistCurrentViewsFilter` - Breakdown concurrent viewers by dimension
49+
- `listDimensions` - List all available dimensions
50+
- `listFilterValuesForDimension` - List filter values per dimension
51+
- `listErrors` - Retrieve error logs
52+
- `listBreakdownValues` - Get breakdown metrics
53+
- `listOverallValues` - Get overall summary metrics
54+
- `getTimeseriesData` - Access timeseries data
55+
- `listComparisonValues` - Compare metrics across datasets
56+
57+
---
58+
59+
## [1.0.2] - Metadata Update
60+
- Updated `package.json` with keywords related to FastPix Node.js API SDK for better discoverability.
61+
62+
## [1.0.1] - Documentation Update
63+
- Improved `README.md` with clearer usage instructions and examples.
64+
65+
## [1.0.0] - Initial Release
66+
- First release of the FastPix Node.js API SDK.
67+
- Provides a robust foundation for interacting with the FastPix API.
1368
- **Media API**: Upload media, manage media assets (list, fetch, update, delete), and generate playback IDs.
14-
- **Live API**: Create, list, update, and delete live streams; generate and manage playback IDs; and simulcasting to multiple platforms.
69+
- **Live API**: Create, list, update, and delete live streams; generate and manage playback IDs; and simulcast to multiple platforms.

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Contributing to This Repository
2+
3+
Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.
4+
5+
## How to Report Issues
6+
7+
If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:
8+
9+
- A clear and descriptive title
10+
- Steps to reproduce the issue
11+
- Expected and actual behavior
12+
- Any relevant logs, screenshots, or error messages
13+
- Information about your environment (e.g., operating system, software versions)
14+
- For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed
15+
16+
## Issue Triage and Upstream Fixes
17+
18+
We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.
19+
20+
## Contact
21+
22+
If you have any questions or need further assistance, please feel free to reach out by opening an issue.
23+
24+
Thank you for your understanding and cooperation!
25+
26+
The Maintainers

FUNCTIONS.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Standalone Functions
2+
3+
> [!NOTE]
4+
> This section is useful if you are using a bundler and targetting browsers and
5+
> runtimes where the size of an application affects performance and load times.
6+
7+
Every method in this SDK is also available as a standalone function. This
8+
alternative API is suitable when targetting the browser or serverless runtimes
9+
and using a bundler to build your application since all unused functionality
10+
will be tree-shaken away. This includes code for unused methods, Zod schemas,
11+
encoding helpers and response handlers. The result is dramatically smaller
12+
impact on the application's final bundle size which grows very slowly as you use
13+
more and more functionality from this SDK.
14+
15+
Calling methods through the main SDK class remains a valid and generally more
16+
more ergonomic option. Standalone functions represent an optimisation for a
17+
specific category of applications.
18+
19+
## Example
20+
21+
```typescript
22+
import { FastpixCore } from "@fastpix/fastpix-node/core.js";
23+
import { inputVideoCreateMedia } from "@fastpix/fastpix-node/funcs/inputVideoCreateMedia.js";
24+
25+
// Use `FastpixCore` for best tree-shaking performance.
26+
// You can create one instance of it to use across an application.
27+
const fastpix = new FastpixCore({
28+
security: {
29+
username: "",
30+
password: "",
31+
},
32+
});
33+
34+
async function run() {
35+
const res = await inputVideoCreateMedia(fastpix, {
36+
inputs: [
37+
{
38+
type: "video",
39+
url: "https://static.fastpix.io/sample.mp4",
40+
},
41+
],
42+
metadata: {
43+
"key1": "value1",
44+
},
45+
accessPolicy: "public",
46+
});
47+
if (res.ok) {
48+
const { value: result } = res;
49+
console.log(result);
50+
} else {
51+
console.log("inputVideoCreateMedia failed:", res.error);
52+
}
53+
}
54+
55+
run();
56+
```
57+
58+
## Result types
59+
60+
Standalone functions differ from SDK methods in that they return a
61+
`Result<Value, Error>` type to capture _known errors_ and document them using
62+
the type system. By avoiding throwing errors, application code maintains clear
63+
control flow and error-handling become part of the regular flow of application
64+
code.
65+
66+
> We use the term "known errors" because standalone functions, and JavaScript
67+
> code in general, can still throw unexpected errors such as `TypeError`s,
68+
> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
69+
> something this SDK addresses in the future. Nevertheless, there is still a lot
70+
> of benefit from capturing most errors and turning them into values.
71+
72+
The second reason for this style of programming is because these functions will
73+
typically be used in front-end applications where exception throwing is
74+
sometimes discouraged or considered unidiomatic. React and similar ecosystems
75+
and libraries tend to promote this style of programming so that components
76+
render useful content under all states (loading, success, error and so on).
77+
78+
The general pattern when calling standalone functions looks like this:
79+
80+
```typescript
81+
import { Core } from "<sdk-package-name>";
82+
import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
83+
84+
const client = new Core();
85+
86+
async function run() {
87+
const result = await fetchSomething(client, { id: "123" });
88+
if (!result.ok) {
89+
// You can throw the error or handle it. It's your choice now.
90+
throw result.error;
91+
}
92+
93+
console.log(result.value);
94+
}
95+
96+
run();
97+
```
98+
99+
Notably, `result.error` above will have an explicit type compared to a try-catch
100+
variation where the error in the catch block can only be of type `unknown` (or
101+
`any` depending on your TypeScript settings).

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,4 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

0 commit comments

Comments
 (0)