iobroker.script-restore 0.0.1 → 0.0.3

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![Logo](admin/script-restore.png)
1
+ ![Logo](admin/script-restore.svg)
2
2
  # ioBroker.script-restore
3
3
 
4
4
  [![NPM version](https://img.shields.io/npm/v/iobroker.script-restore.svg)](https://www.npmjs.com/package/iobroker.script-restore)
@@ -12,127 +12,73 @@
12
12
 
13
13
  ## script-restore adapter for ioBroker
14
14
 
15
- Restore ioBroker scripts from backup archives
16
-
17
- ## Developer manual
18
- This section is intended for the developer. It can be deleted later.
19
-
20
- ### DISCLAIMER
21
-
22
- Please make sure that you consider copyrights and trademarks when you use names or logos of a company and add a disclaimer to your README.
23
- You can check other adapters for examples or ask in the developer community. Using a name or logo of a company without permission may cause legal problems for you.
24
-
25
- ### Getting started
26
-
27
- You are almost done, only a few steps left:
28
- 1. Create a new repository on GitHub with the name `ioBroker.script-restore`
29
- 1. Initialize the current folder as a new git repository:
30
- ```bash
31
- git init -b main
32
- git add .
33
- git commit -m "Initial commit"
34
- ```
35
- 1. Link your local repository with the one on GitHub:
36
- ```bash
37
- git remote add origin https://github.com/ipod86/ioBroker.script-restore
38
- ```
39
-
40
- 1. Push all files to the GitHub repo:
41
- ```bash
42
- git push origin main
43
- ```
44
- 1. Add a new secret under https://github.com/ipod86/ioBroker.script-restore/settings/secrets. It must be named `AUTO_MERGE_TOKEN` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens.
45
-
46
- 1. Head over to [src/main.ts](src/main.ts) and start programming!
47
-
48
- ### Best Practices
49
- We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should
50
- check them out. If you're already experienced, you should also take a look at them - you might learn something new :)
51
-
52
- ### State Roles
53
- When creating state objects, it is important to use the correct role for the state. The role defines how the state should be interpreted by visualizations and other adapters. For a list of available roles and their meanings, please refer to the [state roles documentation](https://www.iobroker.net/#en/documentation/dev/stateroles.md).
54
-
55
- **Important:** Do not invent your own custom role names. If you need a role that is not part of the official list, please contact the ioBroker developer community for guidance and discussion about adding new roles.
56
-
57
- ### Scripts in `package.json`
58
- Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>`
59
- | Script name | Description |
60
- |-------------|-------------|
61
- | `build` | Compile the TypeScript sources. |
62
- | `watch` | Compile the TypeScript sources and watch for changes. |
63
- | `test:ts` | Executes the tests you defined in `*.test.ts` files. |
64
- | `test:package` | Ensures your `package.json` and `io-package.json` are valid. |
65
- | `test:integration` | Tests the adapter startup with an actual instance of ioBroker. |
66
- | `test` | Performs a minimal test run on package files and your tests. |
67
- | `check` | Performs a type-check on your code (without compiling anything). |
68
- | `lint` | Runs `ESLint` to check your code for formatting errors and potential bugs. |
69
- | `translate` | Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details. |
70
- | `release` | Creates a new release, see [`@alcalzone/release-script`](https://github.com/AlCalzone/release-script#usage) for more details. |
71
-
72
- ### Configuring the compilation
73
- The adapter template uses [esbuild](https://esbuild.github.io/) to compile TypeScript and/or React code. You can configure many compilation settings
74
- either in `tsconfig.json` or by changing options for the build tasks. These options are described in detail in the
75
- [`@iobroker/adapter-dev` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files).
76
-
77
- ### Writing tests
78
- When done right, testing code is invaluable, because it gives you the
79
- confidence to change your code while knowing exactly if and when
80
- something breaks. A good read on the topic of test-driven development
81
- is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92.
82
- Although writing tests before the code might seem strange at first, but it has very
83
- clear upsides.
84
-
85
- The template provides you with basic tests for the adapter startup and package files.
86
- It is recommended that you add your own tests into the mix.
87
-
88
- ### Publishing the adapter
89
- Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form
90
- `v<major>.<minor>.<patch>`. We **strongly recommend** that you do. The necessary steps are described in `.github/workflows/test-and-release.yml`.
91
-
92
- Since you installed the release script, you can create a new
93
- release simply by calling:
94
- ```bash
95
- npm run release
96
- ```
97
- Additional command line options for the release script are explained in the
98
- [release-script documentation](https://github.com/AlCalzone/release-script#command-line).
99
-
100
- To get your adapter released in ioBroker, please refer to the documentation
101
- of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository).
102
-
103
- ### Test the adapter manually on a local ioBroker installation
104
- In order to install the adapter locally without publishing, the following steps are recommended:
105
- 1. Create a GitHub repository for your adapter if you haven't already
106
- 1. Push your code to the GitHub repository
107
- 1. Use the ioBroker Admin interface or command line to install the adapter from GitHub:
108
- * **Via Admin UI**: Go to the "Adapters" tab, click on "Custom Install" (GitHub icon), and enter your repository URL:
109
- ```
110
- https://github.com/ipod86/ioBroker.script-restore
111
- ```
112
- You can also install from a specific branch by adding `#branchname` at the end:
113
- ```
114
- https://github.com/ipod86/ioBroker.script-restore#dev
115
- ```
116
- * **Via Command Line**: Install using the `iob` command:
117
- ```bash
118
- iob url https://github.com/ipod86/ioBroker.script-restore
119
- ```
120
- Or from a specific branch:
121
- ```bash
122
- iob url https://github.com/ipod86/ioBroker.script-restore#dev
123
- ```
124
-
125
- For later updates:
126
- 1. Push your changes to GitHub
127
- 1. Repeat the installation steps above (via Admin UI or `iob url` command) to update the adapter
15
+ Browse and recover individual scripts from ioBroker backup archives — without restoring the entire backup.
16
+
17
+ ## Description
18
+
19
+ The script-restore adapter adds a tab to the ioBroker admin interface that lets you open backup archives and browse all contained JavaScript, TypeScript, Blockly and Rules scripts. You can view the source code of each script and download or copy it individually.
20
+
21
+ The archive is parsed entirely in the browser — no files are written to disk during browsing.
22
+
23
+ **Note:** This adapter does not automatically restore scripts into ioBroker. It only allows you to view and download them so you can manually re-import them via the JavaScript adapter.
24
+
25
+ ## Features
26
+
27
+ - Browse backup archives directly from the ioBroker admin tab
28
+ - Load local backup files from the backup directory (default: `/opt/iobroker/backups`)
29
+ - Upload archive files directly from your computer
30
+ - Supported formats: `.tar.gz`, `.tar`, `.json`, `.jsonl`
31
+ - Tree view of all scripts organized by folder
32
+ - Search across all script names
33
+ - View source code with syntax highlighting (JS/TS/Blockly/Rules)
34
+ - Copy source code to clipboard or download as file
35
+ - Fully browser-based parsing no server roundtrip for uploads
36
+
37
+ ## Configuration
38
+
39
+ | Setting | Description | Default |
40
+ |---------|-------------|---------|
41
+ | Backup path | Directory where ioBroker backup files are stored | `/opt/iobroker/backups` |
42
+
43
+ ## Usage
44
+
45
+ ### Loading a local backup file
46
+
47
+ 1. Open the **Script Restore** tab in ioBroker admin
48
+ 2. Click the **Local files** dropdown
49
+ 3. Select a backup file from the list scripts are loaded automatically
50
+
51
+ ### Uploading a backup file
52
+
53
+ 1. Open the **Script Restore** tab in ioBroker admin
54
+ 2. Click **Upload archive** and select a file from your computer
55
+ 3. The archive is parsed in the browser and all scripts are displayed
56
+
57
+ ### Viewing and downloading scripts
58
+
59
+ - Click a script in the tree to view its source code
60
+ - Use the **Copy** button to copy the source to the clipboard
61
+ - Use the **Download** button to save the script as a file
62
+
63
+ ## Supported backup formats
64
+
65
+ | Format | Description |
66
+ |--------|-------------|
67
+ | `.tar.gz` | Standard ioBroker backup (`iobroker_YYYY-MM-DD-HH-mm_SS_backupiobroker.tar.gz`) |
68
+ | `.tar` | Uncompressed tar archive |
69
+ | `.json` | JavaScript adapter script export |
70
+ | `.jsonl` | ioBroker objects export (JSON lines) |
128
71
 
129
72
  ## Changelog
73
+
130
74
  <!--
131
75
  Placeholder for the next version (at the beginning of the line):
132
76
  ### **WORK IN PROGRESS**
133
77
  -->
134
-
135
78
  ### **WORK IN PROGRESS**
79
+ * (ipod86) update README, fix SVG icon dimensions, add full language translations
80
+
81
+ ### 0.0.1 (2026-04-06)
136
82
  * (ipod86) initial release
137
83
 
138
84
  ## License
@@ -156,4 +102,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
156
102
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
157
103
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
158
104
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
159
- SOFTWARE.
105
+ SOFTWARE.
@@ -55,7 +55,7 @@
55
55
 
56
56
  <div class="row">
57
57
  <div class="col s12 m4 l2">
58
- <img src="script-restore.png" class="logo">
58
+ <img src="script-restore.svg" class="logo">
59
59
  </div>
60
60
  </div>
61
61