@dolbyio/dolbyio-rest-apis-client
Version:
Node.JS wrapper for the Dolby OptiView REST APIs
139 lines (138 loc) • 6.87 kB
TypeScript
import { ActivePublishTokenResponse, CreatePublishToken, PublishToken, UpdatePublishToken, DisablePublishTokenResponse, ListPublishTokensSortOptions, ListPublishTokensByNameSortOptions, ListPublishTokensByClusterSortOptions } from './types/publishToken';
/**
* Gets the specified publish token.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-read-token/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param tokenId Identifier of the publish token to read.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a {@link PublishToken} object.
*/
export declare const getToken: (apiSecret: string, tokenId: number) => Promise<PublishToken>;
/**
* ## Deletes the publish token
*
* Deletes token specified by the token's ID. The Token ID can be found using the {@link listTokens | List Tokens API} or in the API response of {@link createToken | Create Token API}.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-delete-token/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param tokenId Identifier of the publish token to delete.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a flag to indicate if the operation succeeded or not.
*/
export declare const deleteToken: (apiSecret: string, tokenId: number) => Promise<boolean>;
/**
* ## Updates the publish token
*
* Update token stream information as well as updates token itself.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-2-update-token/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param tokenId Identifier of the publish token to update.
* @param publishToken Settings of the publish token to update.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a {@link PublishToken} object.
*/
export declare const updateToken: (apiSecret: string, tokenId: number, publishToken: UpdatePublishToken) => Promise<PublishToken>;
/**
* Lists all publish tokens with specific sorting and pagination.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-list-tokens/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param options Options to sort the response.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link PublishToken} objects.
*/
export declare const listTokens: (apiSecret: string, options: ListPublishTokensSortOptions) => Promise<PublishToken[]>;
/**
* ## List Publish Tokens By Name
*
* List all tokens with specific sorting and pagination that matches given token name or stream name.
* Tokens with wildcard stream names are excluded from the responses.
* If response array is empty, you have reached the end of the list ordering.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-list-tokens-by-name/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param options Options to sort the response.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link PublishToken} objects.
*/
export declare const listTokensByName: (apiSecret: string, options: ListPublishTokensByNameSortOptions) => Promise<PublishToken[]>;
/**
* ## List Publish Tokens By Cluster
*
* List all tokens with specific sorting and pagination that matches given cluster region.
* If response array is empty, you have reached the end of the list ordering.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-list-tokens-by-cluster/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param options Options to sort the response.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link PublishToken} objects.
*/
export declare const listTokensByCluster: (apiSecret: string, options: ListPublishTokensByClusterSortOptions) => Promise<PublishToken[]>;
/**
* ## Creates a publish token
*
* Creates new token given a label and associated stream name(s).
* Stream names are limited to 128 characters.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-create-token/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param publishToken Information about the new publish token.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a {@link PublishToken} object.
*/
export declare const createToken: (apiSecret: string, publishToken: CreatePublishToken) => Promise<PublishToken>;
/**
* Gets the Publish Token ID of an active stream by its Stream ID.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-get-active-token-by-stream-id/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param streamId Stream ID for which to get the publish token IDs.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a {@link ActivePublishTokenResponse} object.
*/
export declare const getActivePublishTokenId: (apiSecret: string, streamId: string) => Promise<ActivePublishTokenResponse>;
/**
* Gets all Publish Token IDs for active streams on the account.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-get-all-active-tokens-by-account/}
*
* @param apiSecret The API Secret used to authenticate this request.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a {@link ActivePublishTokenResponse} object.
*/
export declare const getAllActivePublishTokenId: (apiSecret: string) => Promise<ActivePublishTokenResponse>;
/**
* Disables Publish Token(s) by their Token ID. An array of Token IDs can be used for bulk disable.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-disable-tokens/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param tokenIds List of token IDs to disable.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a {@link DisablePublishTokenResponse} object.
*/
export declare const disableToken: (apiSecret: string, tokenIds: number[]) => Promise<DisablePublishTokenResponse>;
/**
* ## Sync restreams
*
* Apply any re-stream configuration changes for running streams immediately.
*
* @see {@link https://optiview.dolby.com/docs/millicast/api/publish-token-v-1-sync-restream/}
*
* @param apiSecret The API Secret used to authenticate this request.
* @param tokenId Identifier of the publish token to sync.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a flag to indicate if the operation succeeded or not.
*/
export declare const syncRestream: (apiSecret: string, tokenId: string) => Promise<boolean>;