mass-queue-types 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +8 -0
- package/.gitattributes +4 -0
- package/.yarnrc.yml +1 -0
- package/LICENSE +21 -0
- package/README.md +149 -0
- package/eslint.config.mjs +55 -0
- package/package.json +64 -0
- package/packages/actions/get_group_volume.ts +18 -0
- package/packages/actions/get_queue_items.ts +37 -0
- package/packages/actions/get_recommendations.ts +40 -0
- package/packages/actions/move_queue_item_down.ts +9 -0
- package/packages/actions/move_queue_item_next.ts +9 -0
- package/packages/actions/move_queue_item_up.ts +9 -0
- package/packages/actions/play_queue_item.ts +9 -0
- package/packages/actions/remove_queue_item.ts +9 -0
- package/packages/actions/send_command.ts +16 -0
- package/packages/actions/set_group_volume.ts +11 -0
- package/packages/actions/unfavorite_current_item.ts +10 -0
- package/packages/utils.ts +14 -0
- package/packages/ws/download_and_encode_image.ts +4 -0
- package/packages/ws/encode_images.ts +18 -0
- package/packages/ws/get_info.ts +32 -0
- package/rollup.config.dev.js +32 -0
- package/rollup.config.js +25 -0
- package/tsconfig.json +18 -0
package/.editorconfig
ADDED
package/.gitattributes
ADDED
package/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: node-modules
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Gábor Tolnai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
[![GitHub Release][release-shield]][release]
|
|
4
|
+
|
|
5
|
+
[![Maintainer][maintainer-shield]][maintainer]
|
|
6
|
+
[![GitHub Activity][activity-shield]][activity]
|
|
7
|
+
[![License][license-shield]][license]
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
[release-shield]: https://img.shields.io/github/release/droans/mass-queue-types.svg?style=for-the-badge
|
|
12
|
+
[release]: https://github.com/droans/mass-queue-types/releases
|
|
13
|
+
[license-shield]: https://img.shields.io/github/license/droans/mass-queue-types?style=for-the-badge
|
|
14
|
+
[license]: LICENSE
|
|
15
|
+
[maintainer-shield]: https://img.shields.io/badge/maintainer-droans-blue.svg?style=for-the-badge
|
|
16
|
+
[maintainer]: https://github.com/droans
|
|
17
|
+
[activity-shield]: https://img.shields.io/github/last-commit/droans/mass-queue-types?style=for-the-badge
|
|
18
|
+
[activity]: https://github.com/droans/mass-queue-types/commits/main
|
|
19
|
+
|
|
20
|
+
# Music Assistant Queue Actions Types
|
|
21
|
+
|
|
22
|
+
Typescript types and interfaces for the [Music Assistant Queue Actions](https://github.com/droans/mass_queue)
|
|
23
|
+
|
|
24
|
+
# Table of Contents
|
|
25
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
26
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
27
|
+
|
|
28
|
+
- [Installation](#installation)
|
|
29
|
+
- [Configuration](#configuration)
|
|
30
|
+
- [Base Config](#base-config)
|
|
31
|
+
- [Entity Config](#entity-config)
|
|
32
|
+
- [Entity Hidden Elements Config](#entity-hidden-elements-config)
|
|
33
|
+
- [Music Player Config](#music-player-config)
|
|
34
|
+
- [Music Player Hidden Elements Config](#music-player-hidden-elements-config)
|
|
35
|
+
- [Music Player Layout Config](#music-player-layout-config)
|
|
36
|
+
- [Queue Config](#queue-config)
|
|
37
|
+
- [Queue Hidden Elements Config](#queue-hidden-elements-config)
|
|
38
|
+
- [Media Browser Config](#media-browser-config)
|
|
39
|
+
- [Media Browser Hidden Elements Config](#media-browser-hidden-elements-config)
|
|
40
|
+
- [Favorites Config](#favorites-config)
|
|
41
|
+
- [Recommendations Config](#recommendations-config)
|
|
42
|
+
- [Sections Config](#sections-config)
|
|
43
|
+
- [Section Item Config](#section-item-config)
|
|
44
|
+
- [Players Config](#players-config)
|
|
45
|
+
- [Players Hidden Elements Config](#players-hidden-elements-config)
|
|
46
|
+
- [FAQs](#faqs)
|
|
47
|
+
- [The card won't display at all or won't display properly!](#the-card-wont-display-at-all-or-wont-display-properly)
|
|
48
|
+
- [The media browser won't display any items for:](#the-media-browser-wont-display-any-items-for)
|
|
49
|
+
- [I'm not seeing any artwork in the queue or media browser!](#im-not-seeing-any-artwork-in-the-queue-or-media-browser)
|
|
50
|
+
- [How do I theme the card?](#how-do-i-theme-the-card)
|
|
51
|
+
- [Can this card work in my local language?](#can-this-card-work-in-my-local-language)
|
|
52
|
+
- [I am having issues with this card on my iOS/OSX device but it works fine elsewhere.](#i-am-having-issues-with-this-card-on-my-iososx-device-but-it-works-fine-elsewhere)
|
|
53
|
+
- [I have other questions or issues not addressed](#i-have-other-questions-or-issues-not-addressed)
|
|
54
|
+
- [Contributing](#contributing)
|
|
55
|
+
- [Developing](#developing)
|
|
56
|
+
|
|
57
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
58
|
+
|
|
59
|
+
# Installation
|
|
60
|
+
|
|
61
|
+
1. Add `@droans/mass-queue-actions` to your package.json file or run `npm i @droans/mass-queue-actions`
|
|
62
|
+
|
|
63
|
+
# Usage
|
|
64
|
+
|
|
65
|
+
## Service Schemas
|
|
66
|
+
All service schemas are available as PARTIAL (service data only) or FULL (entire service call) schemas. Full will only work when calling `hass.callWS` due to the function schemas.
|
|
67
|
+
|
|
68
|
+
**Use FULL when...**
|
|
69
|
+
* You are calling `hass.callWS`.
|
|
70
|
+
* You want complete validation, including the `type`, `domain`, `service`, and (if applicable), `return_response`.
|
|
71
|
+
|
|
72
|
+
**Use PARTIAL when...**
|
|
73
|
+
* You are calling `hass.callService`.
|
|
74
|
+
* You only want to validate the service data being passed.
|
|
75
|
+
|
|
76
|
+
### Available service schemas
|
|
77
|
+
|
|
78
|
+
All `mass_queue` services have schemas available:
|
|
79
|
+
* `get_group_volume`
|
|
80
|
+
* `get_queue_items`
|
|
81
|
+
* `get_recommendations`
|
|
82
|
+
* `move_queue_item_down`
|
|
83
|
+
* `move_queue_item_next`
|
|
84
|
+
* `move_queue_item_up`
|
|
85
|
+
* `play_queue_item`
|
|
86
|
+
* `remove_queue_item`
|
|
87
|
+
* `send_command`
|
|
88
|
+
* `set_group_volume`
|
|
89
|
+
* `unfavorite_current_item`
|
|
90
|
+
|
|
91
|
+
## Response Schemas
|
|
92
|
+
There are only a few services in Music Assistant Queue Actions which can return a service response. All of these are available.
|
|
93
|
+
|
|
94
|
+
Like with Service Schemas, these are available as PARTIAL (response data only) or FULL (data inside the `response` key).
|
|
95
|
+
|
|
96
|
+
### Available service response schemas:
|
|
97
|
+
* `get_group_volume`
|
|
98
|
+
* `get_queue_items`
|
|
99
|
+
* `get_recommendations`
|
|
100
|
+
|
|
101
|
+
## Websocket Commands
|
|
102
|
+
Music Assistant Queue Actions supports a handful of WebSocket commands which aren't available as service calls. All of them have their service and response schemas available.
|
|
103
|
+
|
|
104
|
+
### Available WebSocket schemas:
|
|
105
|
+
* `mass_queue/download_and_encode_image`
|
|
106
|
+
* **NOTE**: No response schema is available since this only returns a string
|
|
107
|
+
* `mass_queue/encode_images`
|
|
108
|
+
* `mass_queue.get_info`
|
|
109
|
+
|
|
110
|
+
# FAQs
|
|
111
|
+
|
|
112
|
+
## I would like to sponsor you/the card and/or pay to add a new feature!
|
|
113
|
+
|
|
114
|
+
While I appreciate it, I am not going to accept any funding.
|
|
115
|
+
|
|
116
|
+
When someone funds development, there's often an implied belief that the card will keep being developed or the maintainer will provide new projects. I want to be able to drop development on this card when I feel that it is complete. I do not want people to feel misled, cheated, or that I should prioritize their wants over anything else. This card is something I created for myself
|
|
117
|
+
|
|
118
|
+
## I have other questions or issues not addressed
|
|
119
|
+
|
|
120
|
+
Check the [repository issues](https://github.com/droans/mass-queue-types/issues) to see if your question has already been asked. If not, feel free to [submit a new issue](https://github.com/droans/mass-queue-types/issues/new).
|
|
121
|
+
|
|
122
|
+
# Contributing
|
|
123
|
+
|
|
124
|
+
I am happy to accept any new contributions to this repository. Feel free to fork and submit pull requests.
|
|
125
|
+
|
|
126
|
+
# Developing
|
|
127
|
+
|
|
128
|
+
This card uses `corepack` for development and relies on Node 22.
|
|
129
|
+
|
|
130
|
+
### Clone the repository:
|
|
131
|
+
```bash
|
|
132
|
+
git clone https://github.com/droans/mass-queue-types
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Set up the environment
|
|
136
|
+
Switch to Node 22:
|
|
137
|
+
```bash
|
|
138
|
+
nvm use 22
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Install `corepack`:
|
|
142
|
+
```bash
|
|
143
|
+
npm install corepack
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Install dependencies:
|
|
147
|
+
```bash
|
|
148
|
+
yarn install
|
|
149
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
import prettierConfig from "eslint-config-prettier";
|
|
3
|
+
import globals from "globals";
|
|
4
|
+
import tseslint from "typescript-eslint";
|
|
5
|
+
import wc from 'eslint-plugin-wc';
|
|
6
|
+
const rootConfigFiles = [".prettierrc.js", "eslint.config.mjs"];
|
|
7
|
+
|
|
8
|
+
export default tseslint.config(
|
|
9
|
+
{ ignores: ["dist", "node_modules/*"] },
|
|
10
|
+
// apply default config
|
|
11
|
+
prettierConfig,
|
|
12
|
+
eslint.configs.recommended,
|
|
13
|
+
tseslint.configs.strictTypeChecked,
|
|
14
|
+
tseslint.configs.stylisticTypeChecked,
|
|
15
|
+
{
|
|
16
|
+
plugins: {
|
|
17
|
+
wc: wc,
|
|
18
|
+
},
|
|
19
|
+
rules: {
|
|
20
|
+
...wc.configs.recommended.rules,
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
// default language/parser options
|
|
24
|
+
{
|
|
25
|
+
languageOptions: {
|
|
26
|
+
parserOptions: {
|
|
27
|
+
projectService: {
|
|
28
|
+
allowDefaultProject: rootConfigFiles,
|
|
29
|
+
},
|
|
30
|
+
tsconfigRootDir: import.meta.dirname,
|
|
31
|
+
},
|
|
32
|
+
globals: {
|
|
33
|
+
...globals.browser,
|
|
34
|
+
...globals.node,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
// individual rule overrides
|
|
39
|
+
{
|
|
40
|
+
rules: {
|
|
41
|
+
"no-console": "warn",
|
|
42
|
+
"@typescript-eslint/no-unnecessary-condition": "off",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
// disable type checking for root config files
|
|
46
|
+
{
|
|
47
|
+
files: rootConfigFiles,
|
|
48
|
+
...tseslint.configs.disableTypeChecked,
|
|
49
|
+
languageOptions: { sourceType: "commonjs" },
|
|
50
|
+
rules: {
|
|
51
|
+
...tseslint.configs.disableTypeChecked.rules,
|
|
52
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
);
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mass-queue-types",
|
|
3
|
+
"description": "Custom Types and Interfaces for Music Assistant Queue Actions",
|
|
4
|
+
"repository": "https://github.com/droans/mass-queue-types",
|
|
5
|
+
"author": "Michael Carroll",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"module": "mass-queue-types.js",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"home-assistant",
|
|
10
|
+
"homeassistant",
|
|
11
|
+
"hass",
|
|
12
|
+
"hacs",
|
|
13
|
+
"lovelace",
|
|
14
|
+
"custom-cards",
|
|
15
|
+
"music-assistant",
|
|
16
|
+
"mass_queue",
|
|
17
|
+
"mass",
|
|
18
|
+
"music",
|
|
19
|
+
"media",
|
|
20
|
+
"player",
|
|
21
|
+
"assistant"
|
|
22
|
+
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@eslint/js": "9.39.1",
|
|
27
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
28
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
29
|
+
"@rollup/plugin-terser": "^0.4.0",
|
|
30
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
|
32
|
+
"@typescript-eslint/parser": "^8.46.4",
|
|
33
|
+
"eslint": "9.21.0",
|
|
34
|
+
"eslint-config-prettier": "10.1.8",
|
|
35
|
+
"eslint-plugin-jest": "29.1.0",
|
|
36
|
+
"eslint-plugin-wc": "^3.0.1",
|
|
37
|
+
"prettier": "^3.6.2",
|
|
38
|
+
"rollup": "^4.53.2",
|
|
39
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
|
40
|
+
"rollup-plugin-serve": "^3.0.0",
|
|
41
|
+
"typescript": "5.8.2",
|
|
42
|
+
"typescript-eslint": "8.26.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "yarn rollup",
|
|
46
|
+
"prettier": "prettier ./src --write",
|
|
47
|
+
"lint": "eslint packages/**/*.ts --max-warnings 0 --no-warn-ignored",
|
|
48
|
+
"full": "echo 'Generating TOC' && yarn docs && echo 'Running Prettier' && yarn prettier && echo 'Linting' && yarn lint",
|
|
49
|
+
"docs": "doctoc ./README.md --maxlevel 2"
|
|
50
|
+
},
|
|
51
|
+
"packageManager": "yarn@4.9.1",
|
|
52
|
+
"prettier": {
|
|
53
|
+
"printWidth": 80,
|
|
54
|
+
"tabWidth": 2,
|
|
55
|
+
"useTabs": false,
|
|
56
|
+
"semi": true,
|
|
57
|
+
"singleQuote": false,
|
|
58
|
+
"trailingComma": "all",
|
|
59
|
+
"bracketSpacing": true,
|
|
60
|
+
"bracketSameLine": false,
|
|
61
|
+
"arrowParens": "always",
|
|
62
|
+
"endOfLine": "lf"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { baseMassQueueServiceWithResponseSchema } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
export interface getGroupVolumePartialServiceResponse {
|
|
4
|
+
volume_level: number
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface getGroupVolumeServiceResponse {
|
|
8
|
+
response: getGroupVolumePartialSchema
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface getGroupVolumePartialSchema {
|
|
12
|
+
entity: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface getGroupVolumeServiceSchema extends baseMassQueueServiceWithResponseSchema {
|
|
16
|
+
service: "get_group_volume",
|
|
17
|
+
service_data: getGroupVolumePartialSchema,
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { baseMassQueueServiceWithResponseSchema } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
export interface queueItem {
|
|
4
|
+
media_title: string;
|
|
5
|
+
media_album_name: string;
|
|
6
|
+
media_artist: string;
|
|
7
|
+
media_content_id: string;
|
|
8
|
+
playing: boolean;
|
|
9
|
+
queue_item_id: string;
|
|
10
|
+
media_image: string;
|
|
11
|
+
local_image_encoded?: string;
|
|
12
|
+
show_action_buttons: boolean;
|
|
13
|
+
show_artist_name: boolean;
|
|
14
|
+
show_move_up_next: boolean;
|
|
15
|
+
favorite: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type queueItems = queueItem[];
|
|
19
|
+
|
|
20
|
+
type getQueueItemsPartialResponse = Record<string, queueItems>;
|
|
21
|
+
|
|
22
|
+
export interface getQueueItemsServiceResponse {
|
|
23
|
+
response: getQueueItemsPartialResponse
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface getQueueItemsPartialSchema {
|
|
27
|
+
entity: string;
|
|
28
|
+
limit_before?: number;
|
|
29
|
+
limit_after?: number;
|
|
30
|
+
limt?: number;
|
|
31
|
+
offset?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface getQueueItemsServiceSchema extends baseMassQueueServiceWithResponseSchema {
|
|
35
|
+
service: "get_queue_items",
|
|
36
|
+
service_data: getQueueItemsPartialSchema,
|
|
37
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { baseMassQueueServiceWithResponseSchema } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
export interface recommendationItem {
|
|
4
|
+
item_id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
sort_name: string;
|
|
7
|
+
uri: string;
|
|
8
|
+
media_type: string;
|
|
9
|
+
image: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type recommendationItems = recommendationItem[];
|
|
13
|
+
|
|
14
|
+
export interface recommendationSection {
|
|
15
|
+
item_id: string;
|
|
16
|
+
provider: string;
|
|
17
|
+
sort_name: string;
|
|
18
|
+
name: string;
|
|
19
|
+
uri: string;
|
|
20
|
+
icon: string;
|
|
21
|
+
image: string | null;
|
|
22
|
+
items: recommendationItems;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface getRecommendationsPartialServiceResponse {
|
|
26
|
+
response: recommendationSection[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface getRecommendationsServiceResponse {
|
|
30
|
+
response: getRecommendationsPartialServiceResponse;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface getRecommendationsPartialSchema {
|
|
34
|
+
entity: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface getRecommendationsServiceSchema extends baseMassQueueServiceWithResponseSchema {
|
|
38
|
+
service: "get_recommendations",
|
|
39
|
+
service_data: getRecommendationsPartialSchema,
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { baseMassQueueServiceSchema } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
type dataSchema = Record<string, any>;
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export interface sendCommandPartialSchema {
|
|
8
|
+
command: string;
|
|
9
|
+
config_entry_id: string;
|
|
10
|
+
data: dataSchema | null | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface sendCommandServiceSchema extends baseMassQueueServiceSchema {
|
|
14
|
+
service: "send_command",
|
|
15
|
+
service_data: sendCommandPartialSchema,
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { baseMassQueueServiceSchema } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
export interface setGroupVolumePartialSchema {
|
|
4
|
+
entity: string;
|
|
5
|
+
volume_level: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface setGroupVolumeServiceSchema extends baseMassQueueServiceSchema {
|
|
9
|
+
service: "set_group_volume",
|
|
10
|
+
service_data: setGroupVolumePartialSchema,
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { baseMassQueueServiceSchema } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
export interface unfavoriteCurrentItemPartialSchema {
|
|
4
|
+
entity: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface unfavoriteCurrentItemServiceSchema extends baseMassQueueServiceSchema {
|
|
8
|
+
service: "unfavorite_current_item",
|
|
9
|
+
service_data: unfavoriteCurrentItemPartialSchema,
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface baseMassQueueServiceSchema {
|
|
2
|
+
type: "call_service",
|
|
3
|
+
domain: "mass_queue",
|
|
4
|
+
service: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface baseMassQueueServiceWithResponseSchema extends baseMassQueueServiceSchema {
|
|
8
|
+
return_response: true;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface queueItemPartialSchema {
|
|
12
|
+
entity: string;
|
|
13
|
+
queue_item_id: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface encodeImagesWSServiceSchema {
|
|
2
|
+
type: "mass_queue/encode_images";
|
|
3
|
+
entity_id: string;
|
|
4
|
+
images: string[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface imageData {
|
|
8
|
+
provider: string;
|
|
9
|
+
path: string;
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
[str: string]: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface encodedImageData extends imageData {
|
|
15
|
+
encoded: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type encodeImagesWSServiceResponse = encodedImageData[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface getInfoWSServiceSchema {
|
|
2
|
+
type: "mass_queue/get_info";
|
|
3
|
+
entity_id: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface getInfoWSResponseSchema {
|
|
7
|
+
available: boolean;
|
|
8
|
+
can_group_with: string[];
|
|
9
|
+
connection: {
|
|
10
|
+
configuration_url: string;
|
|
11
|
+
url: string;
|
|
12
|
+
};
|
|
13
|
+
entries: {
|
|
14
|
+
music_assistant: string;
|
|
15
|
+
mass_queue: string;
|
|
16
|
+
};
|
|
17
|
+
features: string[];
|
|
18
|
+
manufacturer: string;
|
|
19
|
+
model: string;
|
|
20
|
+
name: string;
|
|
21
|
+
player_id: string;
|
|
22
|
+
provider: string;
|
|
23
|
+
queue_id: string;
|
|
24
|
+
server: {
|
|
25
|
+
connection: {
|
|
26
|
+
url: string;
|
|
27
|
+
websocket: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
synced_to: string|null
|
|
31
|
+
type: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import typescript from '@rollup/plugin-typescript';
|
|
2
|
+
import commonjs from 'rollup-plugin-commonjs';
|
|
3
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
4
|
+
import serve from 'rollup-plugin-serve';
|
|
5
|
+
import terser from '@rollup/plugin-terser';
|
|
6
|
+
import json from '@rollup/plugin-json';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
input: ['src/main.ts'],
|
|
10
|
+
output: {
|
|
11
|
+
file: '../www/mass-queue-types.js',
|
|
12
|
+
format: 'es',
|
|
13
|
+
},
|
|
14
|
+
plugins: [
|
|
15
|
+
nodeResolve(),
|
|
16
|
+
commonjs(),
|
|
17
|
+
typescript(),
|
|
18
|
+
json(),
|
|
19
|
+
terser(),
|
|
20
|
+
serve({
|
|
21
|
+
contentBase: '../www',
|
|
22
|
+
host: '0.0.0.0',
|
|
23
|
+
port: 5001,
|
|
24
|
+
headers: {
|
|
25
|
+
'Access-Control-Allow-Origin': '*',
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
],
|
|
29
|
+
onwarn(warning, warn) {
|
|
30
|
+
warn(warning);
|
|
31
|
+
},
|
|
32
|
+
};
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import typescript from '@rollup/plugin-typescript';
|
|
2
|
+
import commonjs from 'rollup-plugin-commonjs';
|
|
3
|
+
import nodeResolve from '@rollup/plugin-node-resolve';
|
|
4
|
+
import terser from '@rollup/plugin-terser';
|
|
5
|
+
import json from '@rollup/plugin-json';
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{
|
|
9
|
+
input: 'src/main.ts',
|
|
10
|
+
output: {
|
|
11
|
+
file: './dist/mass-queue-types.js',
|
|
12
|
+
format: 'es',
|
|
13
|
+
},
|
|
14
|
+
plugins: [
|
|
15
|
+
nodeResolve(),
|
|
16
|
+
commonjs(),
|
|
17
|
+
typescript(),
|
|
18
|
+
json(),
|
|
19
|
+
terser(),
|
|
20
|
+
],
|
|
21
|
+
onwarn(warning, warn) {
|
|
22
|
+
warn(warning);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
];
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2021",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"lib": ["es2021", "dom", "dom.iterable"],
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"noUnusedParameters": true,
|
|
9
|
+
"noImplicitReturns": true,
|
|
10
|
+
"noFallthroughCasesInSwitch": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"noImplicitAny": false,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"experimentalDecorators": true,
|
|
16
|
+
},
|
|
17
|
+
"include": ["packages"]
|
|
18
|
+
}
|