@synopackageland/sdk 0.49.3 → 0.49.5

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
@@ -39,6 +39,14 @@ if (!ctx.webApi) throw new Error('DSM window required')
39
39
  const data = await ctx.webApi('SYNO.Core.Service.PortInfo', 'load', 1, {})
40
40
  ```
41
41
 
42
+ Pass WebAPI values, not JSON text: DSM's window channel JSON-encodes every
43
+ value itself, so `{path: ['/home/a']}` is right and
44
+ `{path: JSON.stringify(['/home/a'])}` reaches DSM as a string (DSM 7.4 answers
45
+ 401). Where the SDK calls WebAPI itself it sends the session token in the
46
+ `X-SYNO-TOKEN` header, never in a POST body, which DSM refuses (119, on 7.1.1 as on 7.4.1); a
47
+ native download form, which cannot set a header, puts it in its same-origin
48
+ query.
49
+
42
50
  `readDsmPorts(ctx)` already prefers this channel and returns `[]` on refusal,
43
51
  unavailable data or its five-second deadline. It uses a same-origin token
44
52
  request only without a window channel. `createNasProvider(ctx)` and executor
@@ -0,0 +1,15 @@
1
+ const o = 3e5;
2
+ function a(e = 3e5) {
3
+ return e + 2e3;
4
+ }
5
+ function r(e) {
6
+ if (e.fullPage !== void 0) return e.fullPage;
7
+ if (!e.host) throw new Error("isFullPage: the context has neither fullPage nor host; pass fullPage (true for a page of its own), or a host (createStandaloneHost() outside DSM)");
8
+ const t = e.host.platform();
9
+ return t.host !== "dsm" || t.dsmStandalone === !0;
10
+ }
11
+ export {
12
+ o as D,
13
+ a as c,
14
+ r as i
15
+ };