Registry / devops / mass-queue-types

mass-queue-types

JSON →
library1.1.3jsnpmunverified

TypeScript type definitions and interfaces for Music Assistant Queue Actions, a custom integration for Home Assistant. Version 1.1.3 provides Zod-based schemas for service calls, responses, and WebSocket commands (e.g., get_queue_items, play_queue_item). Released on GitHub under the MIT license, maintained by droans. Differentiates by offering both PARTIAL (service data only) and FULL (complete call validation) schemas, plus response schemas for the three services that return data. Intended for developers building Home Assistant custom cards or automations involving Music Assistant queues.

npm install mass-queue-types
INSTALL
IMPORT
SIG · MASS-QUEUE-TYPES
M
mass-queue-types
devopsjavascriptv1.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ServiceSchemas
import { ServiceSchemas } from '@droans/mass-queue-types'
const ServiceSchemas = require('@droans/mass-queue-types')
ESM-only package; CommonJS require will fail.
ResponseSchemas
import { ResponseSchemas } from '@droans/mass-queue-types'
import { ResponseSchemas } from 'mass-queue-types'
Package is scoped under @droans. Use the full scoped name.
get_queue_items
import { get_queue_items } from '@droans/mass-queue-types'
import { getQueueItems } from '@droans/mass-queue-types'
Exported names use snake_case to match Home Assistant service names.

Shows importing service and response schemas, inferring TypeScript types, and validating both PARTIAL and FULL schemas.

import { ServiceSchemas, ResponseSchemas } from '@droans/mass-queue-types'; import { z } from 'zod'; // TypeScript type from a service schema (PARTIAL – only service data) type GetQueueItemsData = z.infer<typeof ServiceSchemas.get_queue_items>; // Validate a service call const data: GetQueueItemsData = { entity_id: 'media_player.kitchen', }; const parsed = ServiceSchemas.get_queue_items.parse(data); // FULL schema includes type/domain/service for callWS const fullSchema = ServiceSchemas.get_queue_items.FULL; const fullData = fullSchema.parse({ type: 'call_service', domain: 'mass_queue', service: 'get_queue_items', service_data: { entity_id: 'media_player.kitchen' }, return_response: true, }); // Response schema (PARTIAL – just response data) const responseData = { entity_id: 'media_player.kitchen', queue_items: [ { queue_item_id: '123', title: 'Song', artist: 'Artist', duration: 240, image_hash: 'abc', }, ], }; type GetQueueItemsResponse = z.infer<typeof ResponseSchemas.get_queue_items>; const parsedResponse = ResponseSchemas.get_queue_items.parse(responseData);
Debug
Known issues
breakingPackage is ESM-only; Node.js must be configured for ES modules ("type": "module" in package.json or .mjs extension).
fix
Set 'type': 'module' in your package.json or use .mjs files.
affects: >=1.0.0
deprecatedThe older v0.x package '@droans/mass-queue-actions' uses CommonJS and is not maintained. All future updates are on '@droans/mass-queue-types'.
fix
Update imports to '@droans/mass-queue-types' and switch to ESM.
affects: >=1.0.0
gotchaResponse schemas are only available for get_group_volume, get_queue_items, and get_recommendations. Other services do not have response schemas.
fix
Only use ResponseSchemas for those three services. For others, expect no response data.
affects: >=1.0.0
gotchaWebSocket command schemas use a different import path pattern (e.g., 'mass_queue/download_and_encode_image'). Not all commands have response schemas.
fix
Check the documentation for each WebSocket command's schema availability.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/@droans/mass-queue-types/dist/index.js from ... not supported.
Using CommonJS require() with ESM-only package.
fix
Use import syntax or set "type": "module" in package.json.
Module not found: Can't resolve '@droans/mass-queue-types'
Package not installed (e.g., missing npm install) or wrong package name.
fix
Run 'npm install @droans/mass-queue-types' and ensure you use the scoped name with @droans prefix.
TypeError: ServiceSchemas.get_queue_items.parse is not a function
Importing the wrong symbol; 'get_queue_items' might be a Zod type, not a schema.
fix
Import ServiceSchemas and access .get_queue_items: import { ServiceSchemas } from '@droans/mass-queue-types'. Use ServiceSchemas.get_queue_items.parse(...).
Upgrade
Version history
1.1.3latest on npm
Audit
Dependencies
zodrequiredAll schemas are Zod objects; required for type validation at runtime.
Agent activity
2 hits · last 30 days
node
2
Resources
mass-queue-types — npm install mass-queue-types · libregistry