diff --git a/.github/workflows/release-title-edit.yml b/.github/workflows/release-title-edit.yml index c836f65..08b0ba4 100644 --- a/.github/workflows/release-title-edit.yml +++ b/.github/workflows/release-title-edit.yml @@ -2,14 +2,17 @@ name: Release PR Version on: # `edited` is not one of the default pull_request types, but it is the point of this - # workflow: retitling the release PR is how a maintainer picks an exact version. The - # other types keep the consistency check attached to the PR as it evolves. + # workflow: retitling the release PR is how a maintainer picks an exact version, and the + # check has to re-run on the new title. The other types keep the consistency check attached + # to the PR as it evolves. pull_request: types: [opened, reopened, edited, synchronize] -# Read-only by default; only the job that pushes the Release-As commit widens this. +# Read-only: the check reads the committed version, and polls the pull request while it waits +# for a re-render. permissions: contents: read + pull-requests: read jobs: version-consistency: @@ -25,30 +28,39 @@ jobs: # typo'd into the title still reaches the script and fails there, rather than falling out # of the guard and leaving no check at all — a missing check is not a failing one, and this # is the check the release PR's footer tells maintainers to wait for before merging. - # - # It is also what keeps the workflow from failing silently if the platform ever opens - # release PRs from a different account: the bridge below stops firing, but this check still - # runs, the retitled version and the committed one disagree, and it turns red. The merge is - # blocked loudly instead of releasing the old version. if: >- ${{ github.event.pull_request.base.ref == 'main' && startsWith(github.event.pull_request.title, 'release: ') }} runs-on: ubuntu-latest + # Bounds the wait below with room to spare; a re-render normally lands within a minute. + timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: # The version committed on the PR head is what merging would actually release. ref: ${{ github.event.pull_request.head.sha }} - # Fails while the title version and the committed version disagree — the window between - # a maintainer's retitle and the platform re-rendering the PR from it. Without this a - # merge in that window would tag a release whose own files self-report the old version, - # and a title release-please cannot parse would silently cut no release at all. + # A retitle is applied by the Scalar platform, which pushes a Release-As commit to the + # integration branch and re-renders the release PR at that version. Until it lands, the + # title and the committed version disagree, and a merge in that window would tag a release + # whose own files self-report the old version. + # + # So this waits rather than failing: the check stays pending, which blocks a merge just as + # a failure would where the check is required, but does not flash red on every retitle. It + # passes once the title and the committed version agree, and hands over once the head + # moves, since the re-render's push starts a run of its own on the new head. It never + # passes while the title still disagrees, even a newer title: the run started for that + # edit judges it, and a pass here would sit beside it on the same head. Only a re-render + # that never arrives, or a title that is not a version at all, fails it. - name: Compare the title version with the committed version env: # The title is human input, so it is bound through the environment (never # interpolated into the script) and matched against a strict semver pattern # before it is read. PR_TITLE: ${{ github.event.pull_request.title }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPOSITORY: ${{ github.repository }} + GH_TOKEN: ${{ github.token }} run: | pattern='^release: ((0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?)$' if [[ ! "$PR_TITLE" =~ $pattern ]]; then @@ -57,87 +69,25 @@ jobs: fi title_version="${BASH_REMATCH[1]}" manifest_version="$(jq -r '.["."]' .release-please-manifest.json)" - if [[ "$title_version" != "$manifest_version" ]]; then - echo "::error::Release PR title says $title_version but the pull request is versioned $manifest_version. Wait for the release PR to be re-rendered at $title_version before merging." - exit 1 - fi - echo "Release PR title and committed version agree on $title_version." - - apply-title-version: - name: Apply edited release version - # A human retitle of the open release PR is bridged into the canonical explicit-version - # mechanism (a Release-As commit on scalar-next, which the platform re-renders the - # release PR from). `changes.title` is only set when the title itself changed, and bot - # senders are ignored so the platform's own retitles cannot bounce back into another - # commit. - # - # Both signals are required here, unlike the read-only check above, and each covers what the - # other cannot. The author, because this job pushes with `contents: write` and a title is - # free text — anyone able to open a pull request against main could otherwise - # name a version and have it committed to scalar-next. `user.login` is set by GitHub when - # the pull request is opened and cannot be forged by whoever edits the title afterwards. - # The title, because those accounts open pull requests other than release PRs, and retitling - # one of those must not push a release. - # - # One login per platform deployment, since a repo generated by staging carries staging's - # app. Parenthesised because the group is ANDed with the title clause below: without the - # parens that `&&` would bind to the last login alone, letting the other accounts push a - # release off any title. Listed rather than matched on the shared `scalar-docs` stem — a - # prefix test would also admit any future `scalar-docs-*[bot]`, including someone else's. - if: >- - ${{ github.event.action == 'edited' - && github.event.changes.title != null - && github.event.sender.type != 'Bot' - && github.event.pull_request.state == 'open' - && github.event.pull_request.base.ref == 'main' - && (github.event.pull_request.user.login == 'scalar-docs[bot]' - || github.event.pull_request.user.login == 'scalar-docs-staging[bot]' - || github.event.pull_request.user.login == 'scalar-docs-development[bot]') - && startsWith(github.event.pull_request.title, 'release: ') }} - # One bridge run at a time per pull request, newest retitle wins. Two retitles in quick - # succession (a version typo corrected seconds later) would otherwise start two runs that - # both read the version committed on the PR head, both get past the no-op guard, and both - # push — and since each fetches scalar-next immediately before committing, the second - # push fast-forwards instead of failing. release-please honours the newest Release-As - # footer, so the release would land on whichever run happened to push last, not on the - # title the maintainer actually left behind. - concurrency: - group: release-title-edit-${{ github.event.pull_request.number }} - cancel-in-progress: true - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - # The PR head, so the version the pull request currently carries can be read before - # deciding whether anything needs to change. - ref: ${{ github.event.pull_request.head.sha }} - - name: Push a Release-As commit for the edited version - env: - PR_TITLE: ${{ github.event.pull_request.title }} - run: | - set -euo pipefail - pattern='^release: ((0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?)$' - if [[ ! "$PR_TITLE" =~ $pattern ]]; then - echo "::error::Release PR title must be \"release: X.Y.Z\" with a full semver version, got: $PR_TITLE" - exit 1 - fi - # Only ever a validated semver from here on, so it is safe in a commit message. - version="${BASH_REMATCH[1]}" - manifest_version="$(jq -r '.["."]' .release-please-manifest.json)" - # The re-rendered PR is retitled to the version it now carries; stopping here keeps - # that from producing an endless chain of Release-As commits. - if [[ "$version" == "$manifest_version" ]]; then - echo "This release PR already carries $version; nothing to do." + if [[ "$title_version" == "$manifest_version" ]]; then + echo "Release PR title and committed version agree on $title_version." exit 0 fi - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git fetch origin scalar-next - git checkout -B scalar-next origin/scalar-next - git commit --allow-empty -m "chore: release $version" -m "Release-As: $version" - # Plain (non-force) push: losing a race against a regeneration push fails loudly - # rather than discarding it, and the retitle can simply be repeated. - git push origin scalar-next - echo "Pushed Release-As: $version to scalar-next. The release PR will be re-rendered at that version." + echo "Release PR title says $title_version but the pull request is versioned $manifest_version. Waiting for it to be re-rendered at $title_version." + # Up to ten minutes: 60 polls, 10 seconds apart. + for _ in $(seq 60); do + sleep 10 + # A failed read is retried on the next poll rather than failing the check. + current="$(gh api "repos/$REPOSITORY/pulls/$PR_NUMBER" --jq '[.head.sha, .title] | @tsv')" || continue + IFS=$'\t' read -r current_sha current_title <<< "$current" + if [[ "$current_sha" != "$HEAD_SHA" ]]; then + echo "The release PR has a new head; the run for that push checks it." + exit 0 + fi + if [[ "$current_title" =~ $pattern && "${BASH_REMATCH[1]}" == "$manifest_version" ]]; then + echo "Release PR title and committed version agree on $manifest_version." + exit 0 + fi + done + echo "::error::Release PR title says $title_version but the pull request is still versioned $manifest_version after 10 minutes. Rebuild the SDK from the Scalar dashboard to re-render it." + exit 1 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0d1bebe..9464c4e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.6.0" + ".": "1.6.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 258d0d8..e5654d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [1.6.2](https://github.com/gumlet/nodejs-sdk/compare/v1.6.0...v1.6.2) (2026-10-25) + + +### ⚠ BREAKING CHANGES + +* **api:** 3 breaking changes to the SDK surface. + - Removed operation `folders.deleteAssets` (`POST /video/workspaces/{workspace_id}/remove-assets-from-folder`). + - Removed operation `channelViewers.delete` (`POST /channel/{video_workspace_id}/viewers/remove`). + - Removed operation `videoAnalytics.chartData` (`POST /insights/viewer-analytics`). +* **api:** query param `collection_id` on `videoPlaylists.listAll` is now required. + +### Features + +* **api:** remove operation folders.deleteAssets (+5 more changes) ([cdfdb94](https://github.com/gumlet/nodejs-sdk/commit/cdfdb946c605ce980ccc10051b5c7fd5aeffb675)) +* **api:** update SDK surface (2 changes) ([84a5153](https://github.com/gumlet/nodejs-sdk/commit/84a5153acedd56b85bedea34fe04ca6e0e297331)) + + +### Chores + +* **api:** regenerate SDK ([6cddfcf](https://github.com/gumlet/nodejs-sdk/commit/6cddfcfdc0a6d62f20e71a0ecd66b8ffcff0c60c)) +* release 1.6.2 ([76b3af8](https://github.com/gumlet/nodejs-sdk/commit/76b3af8e20198b608aafaacb0f708f303d808a2c)) + ## [1.6.0](https://github.com/gumlet/nodejs-sdk/compare/v1.5.5...v1.6.0) (2026-10-22) diff --git a/VERSIONING.md b/VERSIONING.md index f9cf7dd..dcde77a 100644 --- a/VERSIONING.md +++ b/VERSIONING.md @@ -36,12 +36,13 @@ not have picked — **edit the release PR title** to the version you want: release: 1.0.0 ``` -The `Release PR version` check turns red as soon as you save, because the version in the +The `Release PR version` check goes pending as soon as you save, because the version in the title no longer matches the version committed in the PR. The Scalar platform then re-renders the release PR at your version (changelog, manifest, and every version-bearing file), the title comes back as `release: 1.0.0`, and the check turns green. **Wait for it to be green before merging** — merging in between would tag a release whose own files still carry the -old version. +old version. The check only turns red if the title is not a full semver version, or if the +re-render has not arrived within 10 minutes. The git-native equivalent, if you would rather not touch the PR: push an empty commit with a `Release-As` footer to `scalar-next`. This is exactly what the title edit does for you. @@ -95,6 +96,6 @@ Releases work without this; it closes a window where one can go out at the wrong - **If this repository uses auto-merge, make the `Release PR version` check a required status check.** Auto-merge merges as soon as the checks that are *required* go green, with no - human present — so a check that is not required but still red at that moment stops + human present — so a check that is not required but still pending at that moment stops nothing, which is exactly the window between retitling a release PR and the platform re-rendering it. diff --git a/api.md b/api.md index 5d225a6..72e405b 100644 --- a/api.md +++ b/api.md @@ -622,7 +622,9 @@ Get all playlists for given workspace | Response | [`VideoPlaylistListAllResponse`](./src/resources/video-playlists.ts) | ```ts -const videoPlaylist = await client.videoPlaylists.listAll(); +const videoPlaylist = await client.videoPlaylists.listAll({ + collection_id: 'collectionId', +}); ``` ### Add asset to playlist @@ -1096,11 +1098,7 @@ Video workspaces are top-level entities in Gumlet. You can use them to organize | Response | [`VideoWorkspaceCreateResponse`](./src/resources/video-workspaces.ts) | ```ts -const videoWorkspace = await client.videoWorkspaces.create({ - name: 'zoom-workspace', - type: 'zoom', - zoom: { secret: 'yourSecret' }, -}); +const videoWorkspace = await client.videoWorkspaces.create({ name: 'My Workspace', type: 'direct-upload' }); ``` ### Update Workspace @@ -1221,11 +1219,11 @@ Remove one or more assets from their current folder assignment inside the worksp | Direction | Type | | --- | --- | -| Request | [`FolderDeleteAssetsParams`](./src/resources/folders.ts) | -| Response | [`FolderDeleteAssetsResponse`](./src/resources/folders.ts) | +| Request | [`FolderRemoveAssetsParams`](./src/resources/folders.ts) | +| Response | [`FolderRemoveAssetsResponse`](./src/resources/folders.ts) | ```ts -const folder = await client.folders.deleteAssets('workspaceId', { +const folder = await client.folders.removeAssets('workspaceId', { asset_ids: ['67e4f2b4403562dbea654301', '67e4f2bb403562dbea654302'], }); ``` @@ -1259,11 +1257,11 @@ Remove one or more viewers from a channel by email address. | Direction | Type | | --- | --- | -| Request | [`ChannelViewerDeleteParams`](./src/resources/channel-viewers.ts) | -| Response | [`ChannelViewerDeleteResponse`](./src/resources/channel-viewers.ts) | +| Request | [`ChannelViewerRemoveParams`](./src/resources/channel-viewers.ts) | +| Response | [`ChannelViewerRemoveResponse`](./src/resources/channel-viewers.ts) | ```ts -const channelViewer = await client.channelViewers.delete('videoWorkspaceId', { +const channelViewer = await client.channelViewers.remove('videoWorkspaceId', { emails: ['test@gumlet.com', 'test+2@gumlet.com'], }); ``` @@ -1309,11 +1307,11 @@ This endpoint retrieves viewer analytics data. This endpoint is use for deep ins | Direction | Type | | --- | --- | -| Request | [`VideoAnalyticChartDataParams`](./src/resources/video-analytics.ts) | -| Response | [`VideoAnalyticChartDataResponse`](./src/resources/video-analytics.ts) | +| Request | [`VideoAnalyticViewerDataParams`](./src/resources/video-analytics.ts) | +| Response | [`VideoAnalyticViewerDataResponse`](./src/resources/video-analytics.ts) | ```ts -const videoAnalytic = await client.videoAnalytics.chartData({ +const videoAnalytic = await client.videoAnalytics.viewerData({ metrics: ['views'], date_range: { start_at: '2024-01-01', diff --git a/package.json b/package.json index b4e3f01..11190eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gumlet/nodejs-sdk", - "version": "1.6.0", + "version": "1.6.2", "description": "Gumlet helps developers deliver online video and images. This API encompasses Gumlet Video, Image and Video Analytics functionality to help you build your products better and faster than ever before.", "author": "Gumlet", "repository": { diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json index ccc1231..6bf503b 100644 --- a/scalar-sdk.manifest.json +++ b/scalar-sdk.manifest.json @@ -1,7 +1,7 @@ { "name": "Gumlet", "slug": "gumlet", - "generatorVersion": "0.36.8", + "generatorVersion": "0.36.9", "servers": [ "https://api.gumlet.com/v1" ], @@ -5700,7 +5700,7 @@ "queryParamDetails": [ { "name": "collection_id", - "required": false, + "required": true, "style": "form", "explode": true } @@ -9713,7 +9713,8 @@ "linode", "backblaze", "cloudflare", - "zoom" + "zoom", + "data_localization" ], "publicBodyParams": [ "name", @@ -9731,7 +9732,8 @@ "linode", "backblaze", "cloudflare", - "zoom" + "zoom", + "data_localization" ], "bodyParamDetails": [ { @@ -9797,6 +9799,10 @@ { "name": "zoom", "required": false + }, + { + "name": "data_localization", + "required": false } ], "pathParamDetails": [], @@ -11014,8 +11020,8 @@ { "resource": "folders", "publicResource": "folders", - "operation": "deleteAssets", - "publicOperation": "deleteAssets", + "operation": "removeAssets", + "publicOperation": "removeAssets", "deprecated": false, "method": "POST", "path": "/video/workspaces/{workspace_id}/remove-assets-from-folder", @@ -11055,7 +11061,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "FolderDeleteAssetsParams" + "publicName": "FolderRemoveAssetsParams" }, "requestBody": { "contentType": "application/json", @@ -11262,8 +11268,8 @@ { "resource": "channelViewers", "publicResource": "channelViewers", - "operation": "delete", - "publicOperation": "delete", + "operation": "remove", + "publicOperation": "remove", "deprecated": false, "method": "POST", "path": "/channel/{video_workspace_id}/viewers/remove", @@ -11303,7 +11309,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "ChannelViewerDeleteParams" + "publicName": "ChannelViewerRemoveParams" }, "requestBody": { "contentType": "application/json", @@ -11645,8 +11651,8 @@ { "resource": "videoAnalytics", "publicResource": "videoAnalytics", - "operation": "chartData", - "publicOperation": "chartData", + "operation": "viewerData", + "publicOperation": "viewerData", "deprecated": false, "method": "POST", "path": "/insights/viewer-analytics", @@ -11711,7 +11717,7 @@ "publicCookieParams": [], "cookieParamDetails": [], "paramsModel": { - "publicName": "VideoAnalyticChartDataParams" + "publicName": "VideoAnalyticViewerDataParams" }, "requestBody": { "contentType": "application/json", diff --git a/src/client.ts b/src/client.ts index 24fcebd..38a718d 100644 --- a/src/client.ts +++ b/src/client.ts @@ -180,31 +180,31 @@ import { type FolderRetrieveResponse, type FolderUpdateResponse, type FolderDeleteResponse, - type FolderDeleteAssetsResponse, + type FolderRemoveAssetsResponse, type FolderCreateParams, type FolderListParams, type FolderRetrieveParams, type FolderUpdateParams, type FolderDeleteParams, - type FolderDeleteAssetsParams, + type FolderRemoveAssetsParams, } from './resources/folders'; import { ChannelViewers, type ChannelViewerInviteResponse, - type ChannelViewerDeleteResponse, + type ChannelViewerRemoveResponse, type ChannelViewerInviteCsvResponse, type ChannelViewerListSubscribersResponse, type ChannelViewerInviteParams, - type ChannelViewerDeleteParams, + type ChannelViewerRemoveParams, type ChannelViewerInviteCsvParams, type ChannelViewerListSubscribersParams, } from './resources/channel-viewers'; import { VideoAnalytics, - type VideoAnalyticChartDataResponse, + type VideoAnalyticViewerDataResponse, type VideoAnalyticBreakdownDataResponse, type VideoAnalyticAggregatedDataResponse, - type VideoAnalyticChartDataParams, + type VideoAnalyticViewerDataParams, type VideoAnalyticBreakdownDataParams, type VideoAnalyticAggregatedDataParams, } from './resources/video-analytics'; @@ -1267,33 +1267,33 @@ export declare namespace Gumlet { type FolderRetrieveResponse as FolderRetrieveResponse, type FolderUpdateResponse as FolderUpdateResponse, type FolderDeleteResponse as FolderDeleteResponse, - type FolderDeleteAssetsResponse as FolderDeleteAssetsResponse, + type FolderRemoveAssetsResponse as FolderRemoveAssetsResponse, type FolderCreateParams as FolderCreateParams, type FolderListParams as FolderListParams, type FolderRetrieveParams as FolderRetrieveParams, type FolderUpdateParams as FolderUpdateParams, type FolderDeleteParams as FolderDeleteParams, - type FolderDeleteAssetsParams as FolderDeleteAssetsParams, + type FolderRemoveAssetsParams as FolderRemoveAssetsParams, }; export { ChannelViewers as ChannelViewers, type ChannelViewerInviteResponse as ChannelViewerInviteResponse, - type ChannelViewerDeleteResponse as ChannelViewerDeleteResponse, + type ChannelViewerRemoveResponse as ChannelViewerRemoveResponse, type ChannelViewerInviteCsvResponse as ChannelViewerInviteCsvResponse, type ChannelViewerListSubscribersResponse as ChannelViewerListSubscribersResponse, type ChannelViewerInviteParams as ChannelViewerInviteParams, - type ChannelViewerDeleteParams as ChannelViewerDeleteParams, + type ChannelViewerRemoveParams as ChannelViewerRemoveParams, type ChannelViewerInviteCsvParams as ChannelViewerInviteCsvParams, type ChannelViewerListSubscribersParams as ChannelViewerListSubscribersParams, }; export { VideoAnalytics as VideoAnalytics, - type VideoAnalyticChartDataResponse as VideoAnalyticChartDataResponse, + type VideoAnalyticViewerDataResponse as VideoAnalyticViewerDataResponse, type VideoAnalyticBreakdownDataResponse as VideoAnalyticBreakdownDataResponse, type VideoAnalyticAggregatedDataResponse as VideoAnalyticAggregatedDataResponse, - type VideoAnalyticChartDataParams as VideoAnalyticChartDataParams, + type VideoAnalyticViewerDataParams as VideoAnalyticViewerDataParams, type VideoAnalyticBreakdownDataParams as VideoAnalyticBreakdownDataParams, type VideoAnalyticAggregatedDataParams as VideoAnalyticAggregatedDataParams, }; diff --git a/src/resources.ts b/src/resources.ts index 515d7fa..494586e 100644 --- a/src/resources.ts +++ b/src/resources.ts @@ -145,18 +145,18 @@ export type { FolderUpdateResponse, FolderDeleteParams, FolderDeleteResponse, - FolderDeleteAssetsParams, - FolderDeleteAssetsResponse, + FolderRemoveAssetsParams, + FolderRemoveAssetsResponse, ChannelViewerInviteParams, ChannelViewerInviteResponse, - ChannelViewerDeleteParams, - ChannelViewerDeleteResponse, + ChannelViewerRemoveParams, + ChannelViewerRemoveResponse, ChannelViewerInviteCsvParams, ChannelViewerInviteCsvResponse, ChannelViewerListSubscribersParams, ChannelViewerListSubscribersResponse, - VideoAnalyticChartDataParams, - VideoAnalyticChartDataResponse, + VideoAnalyticViewerDataParams, + VideoAnalyticViewerDataResponse, VideoAnalyticBreakdownDataParams, VideoAnalyticBreakdownDataResponse, VideoAnalyticAggregatedDataParams, diff --git a/src/resources/billing.ts b/src/resources/billing.ts index c14a2af..9c9a8e3 100644 --- a/src/resources/billing.ts +++ b/src/resources/billing.ts @@ -225,7 +225,7 @@ export interface BillingFetchUpcomingInvoiceResponse { */ next_invoice_date: string; /** - * Current month total amount in given currency. + * Current month total amount in given currency. This amount includes taxes. */ current_month_usage: string; /** @@ -241,7 +241,7 @@ export interface BillingFetchUpcomingInvoiceResponse { export namespace BillingFetchUpcomingInvoiceResponse { export interface UpcomingInvoice { /** - * Upcoming invoice amount without tax + * Upcoming invoice amount excluding tax */ subtotal: string; /** diff --git a/src/resources/channel-viewers.ts b/src/resources/channel-viewers.ts index f54af2d..bb88dfb 100644 --- a/src/resources/channel-viewers.ts +++ b/src/resources/channel-viewers.ts @@ -39,22 +39,22 @@ export class ChannelViewers extends APIResource { * Remove one or more viewers from a channel by email address. * * @param {string} videoWorkspaceID - Gumlet workspace ID. You can get it on Gumlet dashboard or retrieve it using list workspace API. - * @param {ChannelViewerDeleteParams} body - The request body to send. + * @param {ChannelViewerRemoveParams} body - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. - * @returns {APIPromise} 200 + * @returns {APIPromise} 200 * * @example * ```ts - * const channelViewer = await client.channelViewers.delete('videoWorkspaceId', { + * const channelViewer = await client.channelViewers.remove('videoWorkspaceId', { * emails: ['test@gumlet.com', 'test+2@gumlet.com'], * }); * ``` */ - delete( + remove( videoWorkspaceID: string, - body: ChannelViewerDeleteParams, + body: ChannelViewerRemoveParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.post(__scalarPath`/channel/${videoWorkspaceID}/viewers/remove`, { body, ...options }); } @@ -138,7 +138,7 @@ export interface ChannelViewerInviteResponse { success?: boolean; } -export interface ChannelViewerDeleteParams { +export interface ChannelViewerRemoveParams { /** * Email addresses of viewers to remove. A maximum of 200 viewers can be removed in one request. * @maxItems 200 @@ -146,7 +146,7 @@ export interface ChannelViewerDeleteParams { emails: Array; } -export interface ChannelViewerDeleteResponse { +export interface ChannelViewerRemoveResponse { success?: boolean; } @@ -230,11 +230,11 @@ export namespace ChannelViewerListSubscribersResponse { export declare namespace ChannelViewers { export { type ChannelViewerInviteResponse as ChannelViewerInviteResponse, - type ChannelViewerDeleteResponse as ChannelViewerDeleteResponse, + type ChannelViewerRemoveResponse as ChannelViewerRemoveResponse, type ChannelViewerInviteCsvResponse as ChannelViewerInviteCsvResponse, type ChannelViewerListSubscribersResponse as ChannelViewerListSubscribersResponse, type ChannelViewerInviteParams as ChannelViewerInviteParams, - type ChannelViewerDeleteParams as ChannelViewerDeleteParams, + type ChannelViewerRemoveParams as ChannelViewerRemoveParams, type ChannelViewerInviteCsvParams as ChannelViewerInviteCsvParams, type ChannelViewerListSubscribersParams as ChannelViewerListSubscribersParams, }; diff --git a/src/resources/folders.ts b/src/resources/folders.ts index fa361dd..74786f9 100644 --- a/src/resources/folders.ts +++ b/src/resources/folders.ts @@ -127,22 +127,22 @@ export class Folders extends APIResource { * Remove one or more assets from their current folder assignment inside the workspace. * * @param {string} workspaceID - Video workspace id. - * @param {FolderDeleteAssetsParams} body - The request body to send. + * @param {FolderRemoveAssetsParams} body - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. - * @returns {APIPromise} 200 + * @returns {APIPromise} 200 * * @example * ```ts - * const folder = await client.folders.deleteAssets('workspaceId', { + * const folder = await client.folders.removeAssets('workspaceId', { * asset_ids: ['67e4f2b4403562dbea654301', '67e4f2bb403562dbea654302'], * }); * ``` */ - deleteAssets( + removeAssets( workspaceID: string, - body: FolderDeleteAssetsParams, + body: FolderRemoveAssetsParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.post(__scalarPath`/video/workspaces/${workspaceID}/remove-assets-from-folder`, { body, ...options, @@ -420,11 +420,11 @@ export interface FolderDeleteResponse { message?: string; } -export interface FolderDeleteAssetsParams { +export interface FolderRemoveAssetsParams { asset_ids: Array; } -export interface FolderDeleteAssetsResponse { +export interface FolderRemoveAssetsResponse { message?: string; /** * @default 0 @@ -438,12 +438,12 @@ export declare namespace Folders { type FolderRetrieveResponse as FolderRetrieveResponse, type FolderUpdateResponse as FolderUpdateResponse, type FolderDeleteResponse as FolderDeleteResponse, - type FolderDeleteAssetsResponse as FolderDeleteAssetsResponse, + type FolderRemoveAssetsResponse as FolderRemoveAssetsResponse, type FolderCreateParams as FolderCreateParams, type FolderListParams as FolderListParams, type FolderRetrieveParams as FolderRetrieveParams, type FolderUpdateParams as FolderUpdateParams, type FolderDeleteParams as FolderDeleteParams, - type FolderDeleteAssetsParams as FolderDeleteAssetsParams, + type FolderRemoveAssetsParams as FolderRemoveAssetsParams, }; } diff --git a/src/resources/index.ts b/src/resources/index.ts index df53daf..c66e384 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -155,15 +155,15 @@ export type { FolderUpdateResponse, FolderDeleteParams, FolderDeleteResponse, - FolderDeleteAssetsParams, - FolderDeleteAssetsResponse, + FolderRemoveAssetsParams, + FolderRemoveAssetsResponse, } from './folders'; export { ChannelViewers } from './channel-viewers'; export type { ChannelViewerInviteParams, ChannelViewerInviteResponse, - ChannelViewerDeleteParams, - ChannelViewerDeleteResponse, + ChannelViewerRemoveParams, + ChannelViewerRemoveResponse, ChannelViewerInviteCsvParams, ChannelViewerInviteCsvResponse, ChannelViewerListSubscribersParams, @@ -171,8 +171,8 @@ export type { } from './channel-viewers'; export { VideoAnalytics } from './video-analytics'; export type { - VideoAnalyticChartDataParams, - VideoAnalyticChartDataResponse, + VideoAnalyticViewerDataParams, + VideoAnalyticViewerDataResponse, VideoAnalyticBreakdownDataParams, VideoAnalyticBreakdownDataResponse, VideoAnalyticAggregatedDataParams, diff --git a/src/resources/video-analytics.ts b/src/resources/video-analytics.ts index 927a324..52e1b25 100644 --- a/src/resources/video-analytics.ts +++ b/src/resources/video-analytics.ts @@ -8,13 +8,13 @@ export class VideoAnalytics extends APIResource { /** * This endpoint retrieves viewer analytics data. This endpoint is use for deep insights on the analytics data. * - * @param {VideoAnalyticChartDataParams} body - The request body to send. + * @param {VideoAnalyticViewerDataParams} body - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. - * @returns {APIPromise} 200 + * @returns {APIPromise} 200 * * @example * ```ts - * const videoAnalytic = await client.videoAnalytics.chartData({ + * const videoAnalytic = await client.videoAnalytics.viewerData({ * metrics: ['views'], * date_range: { * start_at: '2024-01-01', @@ -24,10 +24,10 @@ export class VideoAnalytics extends APIResource { * }); * ``` */ - chartData( - body: VideoAnalyticChartDataParams, + viewerData( + body: VideoAnalyticViewerDataParams, options?: RequestOptions, - ): APIPromise { + ): APIPromise { return this._client.post('/insights/viewer-analytics', { body, ...options }); } @@ -90,7 +90,7 @@ export class VideoAnalytics extends APIResource { } } -export interface VideoAnalyticChartDataParams { +export interface VideoAnalyticViewerDataParams { /** * Get data for one or more metrics in the same request. Supported values: `views`, `unique_views`, `impressions`, `completion_percent_by_views`, `playing_time`, `concurrent_users`, `widget_form_submitted`, and `cta_clicks`. */ @@ -107,7 +107,7 @@ export interface VideoAnalyticChartDataParams { /** * The timeframe to get the data for. The maximum range between start_at and end_at is 60 days. */ - date_range: VideoAnalyticChartDataParams.DateRange; + date_range: VideoAnalyticViewerDataParams.DateRange; /** * Gumlet workspace ID */ @@ -115,7 +115,7 @@ export interface VideoAnalyticChartDataParams { /** * Build *segments* of users using multiple filters on the data, `value` should be an *exact match* */ - filters?: Array; + filters?: Array; /** * Data can be grouped by `daily`, `weekly` or `monthly`. * @default daily @@ -124,14 +124,14 @@ export interface VideoAnalyticChartDataParams { /** * Group metrics by the selected dimension. You can select up to 3 dimensions for nested category results; results follow the selection order. */ - chart_dimension?: VideoAnalyticChartDataParams.ChartDimension; + chart_dimension?: VideoAnalyticViewerDataParams.ChartDimension; /** * Whether the request is to download the chart data */ download?: boolean; } -export namespace VideoAnalyticChartDataParams { +export namespace VideoAnalyticViewerDataParams { export interface DateRange { /** * Date in yyyy-MM-dd format @@ -225,14 +225,14 @@ export namespace VideoAnalyticChartDataParams { } } -export interface VideoAnalyticChartDataResponse { - views?: Array; - unique_views?: Array; - analytics_data?: VideoAnalyticChartDataResponse.AnalyticsData; +export interface VideoAnalyticViewerDataResponse { + views?: Array; + unique_views?: Array; + analytics_data?: VideoAnalyticViewerDataResponse.AnalyticsData; breakdowns?: Record; } -export namespace VideoAnalyticChartDataResponse { +export namespace VideoAnalyticViewerDataResponse { export interface View { /** * @default 0 @@ -566,10 +566,10 @@ export namespace VideoAnalyticAggregatedDataResponse { } export declare namespace VideoAnalytics { export { - type VideoAnalyticChartDataResponse as VideoAnalyticChartDataResponse, + type VideoAnalyticViewerDataResponse as VideoAnalyticViewerDataResponse, type VideoAnalyticBreakdownDataResponse as VideoAnalyticBreakdownDataResponse, type VideoAnalyticAggregatedDataResponse as VideoAnalyticAggregatedDataResponse, - type VideoAnalyticChartDataParams as VideoAnalyticChartDataParams, + type VideoAnalyticViewerDataParams as VideoAnalyticViewerDataParams, type VideoAnalyticBreakdownDataParams as VideoAnalyticBreakdownDataParams, type VideoAnalyticAggregatedDataParams as VideoAnalyticAggregatedDataParams, }; diff --git a/src/resources/video-assets.ts b/src/resources/video-assets.ts index 3dc7ea6..e23312e 100644 --- a/src/resources/video-assets.ts +++ b/src/resources/video-assets.ts @@ -1504,7 +1504,7 @@ export namespace VideoAssetRetrieveDetailsResponse { export interface VideoAssetUpdateParams { /** - * Asset Id + * Asset ID to update. This is a required parameter. */ asset_id: string; /** diff --git a/src/resources/video-playlists.ts b/src/resources/video-playlists.ts index 7b9eedb..5f1d918 100644 --- a/src/resources/video-playlists.ts +++ b/src/resources/video-playlists.ts @@ -30,17 +30,19 @@ export class VideoPlaylists extends APIResource { /** * Get all playlists for given workspace * - * @param {VideoPlaylistListAllParams} [query] - The parameters to send with the request. + * @param {VideoPlaylistListAllParams} query - The parameters to send with the request. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * @returns {APIPromise} 200 * * @example * ```ts - * const videoPlaylist = await client.videoPlaylists.listAll(); + * const videoPlaylist = await client.videoPlaylists.listAll({ + * collection_id: 'collectionId', + * }); * ``` */ listAll( - query: VideoPlaylistListAllParams | null | undefined = {}, + query: VideoPlaylistListAllParams, options?: RequestOptions, ): APIPromise { return this._client.get('/video/playlist', { query, ...options }); @@ -296,7 +298,7 @@ export interface VideoPlaylistListAllParams { /** * Workspace ID */ - collection_id?: string; + collection_id: string; } export type VideoPlaylistListAllResponse = diff --git a/src/resources/video-workspaces.ts b/src/resources/video-workspaces.ts index 0487674..4fc1f1a 100644 --- a/src/resources/video-workspaces.ts +++ b/src/resources/video-workspaces.ts @@ -37,11 +37,7 @@ export class VideoWorkspaces extends APIResource { * * @example * ```ts - * const videoWorkspace = await client.videoWorkspaces.create({ - * name: 'zoom-workspace', - * type: 'zoom', - * zoom: { secret: 'yourSecret' }, - * }); + * const videoWorkspace = await client.videoWorkspaces.create({ name: 'My Workspace', type: 'direct-upload' }); * ``` */ create( @@ -399,6 +395,11 @@ export interface VideoWorkspaceCreateParams { * This is a required field if workspace type is zoom. */ zoom?: VideoWorkspaceCreateParams.Zoom; + /** + * Data localization region + * @default us + */ + data_localization?: 'us' | 'in' | 'eu'; } export namespace VideoWorkspaceCreateParams { diff --git a/src/version.ts b/src/version.ts index e42b612..8b42f2d 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,3 +1,3 @@ // File generated from our OpenAPI spec by Scalar. See README.md for details. -export const VERSION = '1.6.0'; // x-release-please-version +export const VERSION = '1.6.2'; // x-release-please-version diff --git a/tests/smoke-test.ts b/tests/smoke-test.ts index 6f523b6..eda1e9f 100644 --- a/tests/smoke-test.ts +++ b/tests/smoke-test.ts @@ -655,17 +655,6 @@ const cases: { operation: 'listAll', method: 'GET', path: '/video/playlist', - label: 'required params', - run: async () => { - const videoPlaylist = await client.videoPlaylists.listAll(); - }, - }, - - { - operation: 'listAll', - method: 'GET', - path: '/video/playlist', - label: 'all params', run: async () => { const videoPlaylist = await client.videoPlaylists.listAll({ collection_id: 'collectionId', @@ -1195,9 +1184,8 @@ const cases: { path: '/video/workspaces', run: async () => { const videoWorkspace = await client.videoWorkspaces.create({ - name: 'zoom-workspace', - type: 'zoom', - zoom: { secret: 'yourSecret' }, + name: 'My Workspace', + type: 'direct-upload', }); }, }, @@ -1333,11 +1321,11 @@ const cases: { }, { - operation: 'deleteAssets', + operation: 'removeAssets', method: 'POST', path: '/video/workspaces/{workspace_id}/remove-assets-from-folder', run: async () => { - const folder = await client.folders.deleteAssets('workspaceId', { + const folder = await client.folders.removeAssets('workspaceId', { asset_ids: ['67e4f2b4403562dbea654301', '67e4f2bb403562dbea654302'], }); }, @@ -1359,11 +1347,11 @@ const cases: { }, { - operation: 'delete', + operation: 'remove', method: 'POST', path: '/channel/{video_workspace_id}/viewers/remove', run: async () => { - const channelViewer = await client.channelViewers.delete('videoWorkspaceId', { + const channelViewer = await client.channelViewers.remove('videoWorkspaceId', { emails: ['test@gumlet.com', 'test+2@gumlet.com'], }); }, @@ -1393,12 +1381,12 @@ const cases: { }, { - operation: 'chartData', + operation: 'viewerData', method: 'POST', path: '/insights/viewer-analytics', label: 'required params', run: async () => { - const videoAnalytic = await client.videoAnalytics.chartData({ + const videoAnalytic = await client.videoAnalytics.viewerData({ metrics: ['views'], date_range: { start_at: '2024-01-01', @@ -1410,12 +1398,12 @@ const cases: { }, { - operation: 'chartData', + operation: 'viewerData', method: 'POST', path: '/insights/viewer-analytics', label: 'all params', run: async () => { - const videoAnalytic = await client.videoAnalytics.chartData({ + const videoAnalytic = await client.videoAnalytics.viewerData({ metrics: ['views'], workspace_id: '', date_range: {