@bitzonegaming/roleplay-engine-sdk
Version:
Roleplay Engine SDK
98 lines (97 loc) • 5.53 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CameraApi = void 0;
class CameraApi {
constructor(client) {
this.client = client;
}
/**
* It creates a new camera for use on the server.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:write:world<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:world<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Create camera
* @param {CreateCameraRequest} request
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
createCamera(request, options) {
return this.client.post({
url: 'cameras',
data: request,
options,
});
}
/**
* It updates an existing camera on the server.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:write:world<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:world<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Update camera
* @param {string} cameraId
* @param {AccountAuthRequest} request
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
updateCamera(cameraId, request, options) {
return this.client.put({
url: `cameras/${cameraId}`,
data: request,
options,
});
}
/**
* It returns a camera by its ID. If noCache is true, it will not use the cache.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:read:world<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: read:world<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Get camera by ID
* @param {string} cameraId
* @param {Object} [query] Query parameters.
* @param {boolean} [query.noCache] If `true`, the request will not use the cache.
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getCameraById(cameraId, query, options) {
return this.client.get({
url: `cameras/${cameraId}`,
query,
options,
});
}
/**
* It returns a list of cameras based on the provided filters. If noCache is true, it will not use the cache.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:read:world<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: read:world<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Get cameras
* @param {Object} [query] Query parameters.
* @param {CameraType} [query.type] Filter cameras by type (e.g., 'STATIC', 'FOLLOW', 'ORBIT', 'CINEMATIC').
* @param {boolean} [query.enabled] Filter cameras by their enabled status.
* @param {boolean} [query.noCache] If `true`, the request will not use the cache.
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
getCameras(query, options) {
return this.client.get({
url: `cameras`,
query,
options,
});
}
/**
* It enables a camera for the server by its ID.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:write:world<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:world<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Enable camera
* @param {string} cameraId
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
enableCamera(cameraId, options) {
return this.client.put({
url: `cameras/${cameraId}/enabled`,
options,
});
}
/**
* It disables a camera for the server by its ID.<br/>This endpoint performs server-level operations. The token does not need to be associated with any account or character.<br/><b>Account Policies</b>: account_policy:write:world<br/><br/> This endpoint requires authorization, and supports following token types:<br/>🔓 [API Key] <b>Required Scopes</b>: write:world<br/>🔓 [SSO Token]<br/>🔓 [Access Token]<br/>🔓 [Session Token]
* @summary Disable camera
* @param {string} cameraId
* @param {*} [options] Override http request option.
* @throws {EngineError}
*/
disableCamera(cameraId, options) {
return this.client.put({
url: `cameras/${cameraId}/disabled`,
options,
});
}
}
exports.CameraApi = CameraApi;