@fett/synology-api 0.0.2-beta.2 → 0.0.2
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/lib/core.d.ts +23 -1
- package/lib/core.js +53 -20
- package/lib/errorcodes.d.ts +21 -4
- package/lib/errorcodes.js +27 -6
- package/lib/helpers.js +5 -8
- package/lib/modules/Api/Auth.js +13 -8
- package/lib/modules/Api/Info.js +4 -4
- package/lib/modules/AudioStation/Album.d.ts +17 -0
- package/lib/modules/AudioStation/Album.js +17 -0
- package/lib/modules/AudioStation/Artist.d.ts +16 -0
- package/lib/modules/AudioStation/Artist.js +16 -0
- package/lib/modules/AudioStation/Folder.d.ts +14 -0
- package/lib/modules/AudioStation/Folder.js +14 -0
- package/lib/modules/AudioStation/index.d.ts +4 -0
- package/lib/modules/AudioStation/index.js +6 -0
- package/lib/modules/Auth/AuthKey.js +2 -2
- package/lib/modules/Auth/Encryption.d.ts +8 -0
- package/lib/modules/Auth/Encryption.js +10 -0
- package/lib/modules/Auth/index.d.ts +2 -0
- package/lib/modules/Auth/index.js +3 -1
- package/lib/modules/Core/System.d.ts +159 -0
- package/lib/modules/Core/System.js +42 -0
- package/lib/modules/Core/User.d.ts +51 -0
- package/lib/modules/Core/User.js +33 -0
- package/lib/modules/Core/index.d.ts +14 -0
- package/lib/modules/Core/index.js +15 -0
- package/lib/modules/Docker/Container.d.ts +43 -0
- package/lib/modules/Docker/Container.js +13 -0
- package/lib/modules/Docker/Network.d.ts +0 -0
- package/lib/modules/Docker/Network.js +0 -0
- package/lib/modules/Docker/Project.d.ts +0 -0
- package/lib/modules/Docker/Project.js +0 -0
- package/lib/modules/Docker/Registry.d.ts +0 -0
- package/lib/modules/Docker/Registry.js +0 -0
- package/lib/modules/Docker/index.d.ts +7 -0
- package/lib/modules/Docker/index.js +8 -0
- package/lib/modules/FileStation/BackgroundTask.d.ts +50 -0
- package/lib/modules/FileStation/BackgroundTask.js +22 -0
- package/lib/modules/FileStation/CheckPermission.d.ts +10 -0
- package/lib/modules/FileStation/CheckPermission.js +13 -0
- package/lib/modules/FileStation/CopyMove.d.ts +33 -0
- package/lib/modules/FileStation/CopyMove.js +28 -0
- package/lib/modules/FileStation/CreateFolder.d.ts +15 -0
- package/lib/modules/FileStation/CreateFolder.js +12 -0
- package/lib/modules/FileStation/Delete.d.ts +54 -0
- package/lib/modules/FileStation/Delete.js +35 -0
- package/lib/modules/FileStation/DirSize.d.ts +20 -0
- package/lib/modules/FileStation/DirSize.js +28 -0
- package/lib/modules/FileStation/Download.d.ts +7 -0
- package/lib/modules/FileStation/Download.js +19 -0
- package/lib/modules/FileStation/Extract.d.ts +1 -0
- package/lib/modules/FileStation/Extract.js +1 -0
- package/lib/modules/FileStation/Favorite.d.ts +45 -0
- package/lib/modules/FileStation/Favorite.js +60 -0
- package/lib/modules/FileStation/List.d.ts +39 -11
- package/lib/modules/FileStation/List.js +14 -6
- package/lib/modules/FileStation/MD5.d.ts +15 -0
- package/lib/modules/FileStation/MD5.js +29 -0
- package/lib/modules/FileStation/Rename.d.ts +38 -0
- package/lib/modules/FileStation/Rename.js +14 -0
- package/lib/modules/FileStation/Search.d.ts +40 -0
- package/lib/modules/FileStation/Search.js +49 -0
- package/lib/modules/FileStation/Sharing.d.ts +69 -0
- package/lib/modules/FileStation/Sharing.js +64 -0
- package/lib/modules/FileStation/Thumb.d.ts +18 -0
- package/lib/modules/FileStation/Thumb.js +18 -0
- package/lib/modules/FileStation/Upload.d.ts +21 -0
- package/lib/modules/FileStation/Upload.js +44 -0
- package/lib/modules/FileStation/index.d.ts +52 -2
- package/lib/modules/FileStation/index.js +53 -3
- package/lib/modules/VideoStation/Library.d.ts +4 -5
- package/lib/modules/VideoStation/Streaming.d.ts +5 -6
- package/lib/modules/VideoStation/Streaming.js +39 -13
- package/lib/modules/VideoStation/index.js +1 -1
- package/lib/modules/index.d.ts +12 -10
- package/lib/modules/index.js +13 -12
- package/lib/types/apiInfo.d.ts +55 -4
- package/lib/types/apiInfo.js +62 -9
- package/lib/{utils.js → utils/common.js} +1 -1
- package/lib/utils/encryption.d.ts +12 -0
- package/lib/utils/encryption.js +38 -0
- package/lib/utils/env.d.ts +2 -0
- package/lib/utils/env.js +2 -0
- package/lib/utils/formData.d.ts +2 -0
- package/lib/utils/formData.js +19 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.js +4 -0
- package/package.json +7 -2
- package/lib/modules/VideoStation/HomeVideo.d.ts +0 -6
- package/lib/modules/VideoStation/HomeVideo.js +0 -10
- /package/lib/modules/{FileStation/File.d.ts → Docker/Image.d.ts} +0 -0
- /package/lib/modules/{FileStation/File.js → Docker/Image.js} +0 -0
- /package/lib/{utils.d.ts → utils/common.d.ts} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isNode } from "./env.js";
|
|
2
|
+
// detect environment and create FormData instance
|
|
3
|
+
export function createFormData() {
|
|
4
|
+
if (isNode) {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
6
|
+
const FormDataNode = require("form-data");
|
|
7
|
+
return new FormDataNode();
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return new FormData();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
// Node.js
|
|
14
|
+
export function getFormDataHeaders(formData) {
|
|
15
|
+
if (typeof formData.getHeaders === "function") {
|
|
16
|
+
return formData.getHeaders();
|
|
17
|
+
}
|
|
18
|
+
return {};
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fett/synology-api",
|
|
3
|
-
"version": "0.0.2
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "synology api for nodejs",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -51,11 +51,13 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@eslint/js": "^9.26.0",
|
|
54
|
+
"@vitest/coverage-v8": "3.2.2",
|
|
54
55
|
"concurrently": "^9.2.0",
|
|
55
56
|
"cross-env": "^7.0.3",
|
|
56
57
|
"eslint": "9.25.1",
|
|
57
58
|
"execa": "^9.6.0",
|
|
58
59
|
"globals": "^16.1.0",
|
|
60
|
+
"jsdom": "^26.1.0",
|
|
59
61
|
"prettier": "3.5.3",
|
|
60
62
|
"rimraf": "^6.0.1",
|
|
61
63
|
"rspress": "^1.44.0",
|
|
@@ -67,10 +69,13 @@
|
|
|
67
69
|
"vitest": "^3.1.3"
|
|
68
70
|
},
|
|
69
71
|
"dependencies": {
|
|
72
|
+
"axios": "^1.11.0",
|
|
70
73
|
"chalk": "^5.4.1",
|
|
71
74
|
"commander": "^14.0.0",
|
|
75
|
+
"form-data": "^4.0.4",
|
|
72
76
|
"fs-extra": "^11.3.0",
|
|
73
|
-
"
|
|
77
|
+
"http-proxy-agent": "^7.0.2",
|
|
78
|
+
"https-proxy-agent": "^7.0.6",
|
|
74
79
|
"ora": "^8.2.0"
|
|
75
80
|
},
|
|
76
81
|
"license": "MIT"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SynologyApiResponse } from "../../types/index.js";
|
|
2
|
-
export type VideoStationFileSetWatchStatusParams = {
|
|
3
|
-
id: number;
|
|
4
|
-
position: number;
|
|
5
|
-
};
|
|
6
|
-
export declare function getFileVideoInfo(params: VideoStationFileSetWatchStatusParams): Promise<SynologyApiResponse<any>>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|