UNPKG

tsonik

Version:

A TypeScript client library for the Iconik API based on Swagger documentation

53 lines 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AssetResource = void 0; const base_1 = require("./base"); /** * Asset resource class for managing Iconik assets */ class AssetResource extends base_1.BaseResource { constructor(client) { super(client, '/API/assets/v1/assets'); } /** * Get a single asset by ID */ async getAsset(id) { return super.get(id); } /** * List assets with optional filters */ async listAssets(params) { return super.list(params); } /** * Create a new asset */ async createAsset(assetData) { if (!assetData.title || assetData.title.trim() === '') { throw new Error('Asset title is required'); } return super.create(assetData); } /** * Update an asset */ async updateAsset(id, assetData) { return super.update(id, assetData); } /** * Patch an asset with partial data */ async patchAsset(id, assetData) { return super.patch(id, assetData); } /** * Delete an asset */ async deleteAsset(id) { return super.delete(id); } } exports.AssetResource = AssetResource; //# sourceMappingURL=assets.js.map