@synopackageland/sdk 0.49.5 → 0.50.1
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 +86 -27
- package/dist/index.js +709 -668
- package/dist/src/client.d.ts +12 -0
- package/dist/src/dsm/https.d.ts +6 -0
- package/dist/src/dsm/session.d.ts +2 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/shell/app-pages.d.ts +10 -3
- package/dist/src/shell/slot-content.d.ts +15 -0
- package/dist/style.css +1 -1
- package/dist/vue.js +1651 -1576
- package/executor-manifest.json +1 -1
- package/package.json +5 -3
- package/spec/protocol/v1/README.md +17 -17
package/executor-manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.1",
|
|
4
4
|
"description": "Frontend SDK for DSM packages built with synopkgland: headless client and Vue components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/synopackageland/syno-pkg-land-sdk/tree/main/ts#readme",
|
|
@@ -43,11 +43,13 @@
|
|
|
43
43
|
"build": "node ../scripts/executor-manifest.mjs --check && vite build && vue-tsc -p tsconfig.build.json && cp -R i18n dist/ && rm -rf spec && cp -R ../spec spec",
|
|
44
44
|
"typecheck": "vue-tsc --noEmit",
|
|
45
45
|
"test": "vitest run",
|
|
46
|
-
"test:browser": "node test/browser/picker-layout.mjs"
|
|
46
|
+
"test:browser": "node test/browser/picker-layout.mjs && node test/browser/shell-layout.mjs",
|
|
47
|
+
"gates": "bash ../scripts/gate.sh",
|
|
48
|
+
"gates:full": "bash ../scripts/gate.sh --full"
|
|
47
49
|
},
|
|
48
50
|
"peerDependencies": {
|
|
49
51
|
"@lucide/vue": "^1.48.0",
|
|
50
|
-
"@synopackageland/ui": ">=0.10.1 <0.
|
|
52
|
+
"@synopackageland/ui": ">=0.10.1 <0.21.0",
|
|
51
53
|
"vue": "^3.5.0"
|
|
52
54
|
},
|
|
53
55
|
"peerDependenciesMeta": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Executor protocol v1
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD,
|
|
4
4
|
SHOULD NOT, RECOMMENDED, MAY and OPTIONAL are to be interpreted as described in
|
|
5
5
|
RFC 2119.
|
|
6
6
|
|
|
@@ -30,7 +30,7 @@ the executor against the vectors here.
|
|
|
30
30
|
|
|
31
31
|
## Timeouts
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Every layer between the browser and a root program waits
|
|
34
34
|
longer than the layer it calls, so the inner answer, or the inner refusal,
|
|
35
35
|
arrives before the outer layer gives up. The margin is 10 seconds between
|
|
36
36
|
the executor and its client and between the client and the request; the
|
|
@@ -61,13 +61,13 @@ reasons are recorded in `scripts/timeout-allowlist.json`.
|
|
|
61
61
|
- `op` MUST be one of the ops with a schema in `schema/`. An unknown op is
|
|
62
62
|
`UNKNOWN_OP`; an op outside the approved policy is `POLICY_DENIED`.
|
|
63
63
|
- `auth` is OPTIONAL. When present it MUST contain only `dsm_cookie`,
|
|
64
|
-
`dsm_synotoken` and `remote_addr
|
|
64
|
+
`dsm_synotoken` and `remote_addr`, the browser's address
|
|
65
65
|
(REMOTE_ADDR). DSM's Application Privileges are evaluated for that address;
|
|
66
66
|
an op that checks them MUST be refused with `APP_DENIED` when a present
|
|
67
67
|
`auth` has no usable `remote_addr`. A grant records the `remote_addr` of the
|
|
68
68
|
`delegate.create` that made it (creating it again records the new one), and
|
|
69
|
-
an operation records the address of its `files.moveFromStaging
|
|
70
|
-
|
|
69
|
+
an operation records the address of its `files.moveFromStaging`. A request
|
|
70
|
+
without `auth` under a grant, and the operation's
|
|
71
71
|
background revalidation, are checked from that recorded address; work with no
|
|
72
72
|
recorded address is checked as coming from 127.0.0.1. A present `auth` is
|
|
73
73
|
always treated as caller authentication, never ignored, even when empty. Ops whose schema says
|
|
@@ -112,7 +112,7 @@ reasons are recorded in `scripts/timeout-allowlist.json`.
|
|
|
112
112
|
## Status
|
|
113
113
|
|
|
114
114
|
`status` answers `version` (`"1"`), `ready`, `disabled`, `executor_digest`
|
|
115
|
-
and `policy_digest`. With `auth`
|
|
115
|
+
and `policy_digest`. With `auth` it also answers `allowed`:
|
|
116
116
|
whether DSM's Application Privileges let the caller use the App and File
|
|
117
117
|
Station from `remote_addr`, the check `delegate.create` makes; an invalid
|
|
118
118
|
session is `AUTH_DENIED`. A CGI sends the caller's `auth` so an App the
|
|
@@ -136,7 +136,7 @@ the tasks back itself.
|
|
|
136
136
|
|
|
137
137
|
## Application Portal
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
A policy MAY carry `"portal": {"application": "<display name>",
|
|
140
140
|
"alias": "<default alias>"}` together with both `portal.register` and
|
|
141
141
|
`portal.unregister`; a policy with only some of the three is invalid. The
|
|
142
142
|
executor then registers the App's Application Portal entry the way DSM's
|
|
@@ -169,7 +169,7 @@ packages.
|
|
|
169
169
|
|
|
170
170
|
## Root programs
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
Each `root` entry pins a program by its SHA-256 digest; a bare
|
|
173
173
|
digest is a script `root.run` may run with the defaults. The object form is
|
|
174
174
|
`{"digest", "kind", "schema", "run"}`: `kind` `script` (`root/<name>.sh`) or
|
|
175
175
|
`binary` (`root/<name>`), `schema` a closed JSON Schema subset for its params,
|
|
@@ -223,7 +223,7 @@ Every root program, whatever starts it:
|
|
|
223
223
|
|
|
224
224
|
## Root jobs
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
`root.start`, `root.jobs.list`, `root.jobs.get` and
|
|
227
227
|
`root.jobs.stop` come together in `operations`. Each requires an administrator
|
|
228
228
|
session whose Application Privileges allow the App, like `root.run`; any such
|
|
229
229
|
administrator sees and stops every job of the package.
|
|
@@ -299,7 +299,7 @@ The job reports on fd 5 and is told to stop on fd 4; both are pipes.
|
|
|
299
299
|
|
|
300
300
|
## Package stop step
|
|
301
301
|
|
|
302
|
-
|
|
302
|
+
A policy MAY carry `"stop": "<name>"`, naming a `root` entry the
|
|
303
303
|
executor runs when the package stops, after its jobs ended, with no session.
|
|
304
304
|
Its argument is `prepare-upgrade` when the package account wrote `upgrade`
|
|
305
305
|
to `var/executor/stop-reason` before the stop request (the
|
|
@@ -315,7 +315,7 @@ entry, which may pin the same digest under another name.
|
|
|
315
315
|
|
|
316
316
|
## Package start step
|
|
317
317
|
|
|
318
|
-
|
|
318
|
+
A policy MAY carry `"start": "<name>"`, naming a `root` entry
|
|
319
319
|
the executor runs once after each install or upgrade, with no session:
|
|
320
320
|
|
|
321
321
|
- The executor MUST run it at the first start of a package version (the
|
|
@@ -353,7 +353,7 @@ MUST NOT expect its result. The App reads it from `status`.
|
|
|
353
353
|
|
|
354
354
|
## Root state directory
|
|
355
355
|
|
|
356
|
-
|
|
356
|
+
A policy with `"root_state": true` gives its root programs a
|
|
357
357
|
directory only root can read: `/volumeN/@synopkgland/<package>`, root:root
|
|
358
358
|
0700, on the volume that holds the package's `var` (DSM's
|
|
359
359
|
`/volumeN/@appdata/<package>`); `/volumeN/@synopkgland` is root:root 0755.
|
|
@@ -366,7 +366,7 @@ the step the executor deletes it for `delete-state` and keeps it for
|
|
|
366
366
|
|
|
367
367
|
## Uninstall purge step
|
|
368
368
|
|
|
369
|
-
|
|
369
|
+
A policy MAY carry `"purge": "<name>"`, naming one of its `root`
|
|
370
370
|
ops as the App's root step at uninstall; any other value makes the policy
|
|
371
371
|
invalid. Approving that policy is the administrator's consent that the op
|
|
372
372
|
runs as root at uninstall, with no session.
|
|
@@ -398,8 +398,8 @@ runs as root at uninstall, with no session.
|
|
|
398
398
|
Application Privileges, scope, directory identity and write permission
|
|
399
399
|
against DSM. A failure the user or an administrator can undo MUST fail only
|
|
400
400
|
that operation and MUST keep the grant: `PERMISSION_DENIED` (the ACL refuses
|
|
401
|
-
the write), `not-found` (the granted folder is not at its path) and
|
|
402
|
-
|
|
401
|
+
the write), `not-found` (the granted folder is not at its path) and
|
|
402
|
+
`APP_DENIED` (an Application Privileges rule refuses the account from
|
|
403
403
|
the checked address). Once the cause is fixed, a new operation under the same
|
|
404
404
|
grant succeeds. Any other revalidation failure (`DELEGATION_DENIED`,
|
|
405
405
|
`INELIGIBLE`, `SCOPE_DENIED`, including a different folder at the granted
|
|
@@ -448,7 +448,7 @@ administrator). Their `dsm_cookie` is the user name and `dsm_synotoken` is
|
|
|
448
448
|
New ops and members are added with a `since` of the SDK release. The protocol
|
|
449
449
|
`v` changes only for an incompatible envelope change.
|
|
450
450
|
|
|
451
|
-
## JSON WebAPI grants
|
|
451
|
+
## JSON WebAPI grants
|
|
452
452
|
|
|
453
453
|
`webapi.call` MUST execute only an exact API/method/version in the grant's named
|
|
454
454
|
`webapi` policy profile, with `runner` fixed to its owner. A profile has `purpose`
|
|
@@ -475,7 +475,7 @@ cannot be confirmed MUST answer `WEBAPI_UNCERTAIN` (nonretryable); client
|
|
|
475
475
|
transport failure MAY also hide a completed operation. Binary/streaming replies
|
|
476
476
|
MUST be refused. These bounds and semantics also apply to until-revoked grants.
|
|
477
477
|
|
|
478
|
-
## Raw WebAPI extension
|
|
478
|
+
## Raw WebAPI extension
|
|
479
479
|
|
|
480
480
|
The JSON-only restriction above applies to the default response mode. An explicit
|
|
481
481
|
`response_type:"raw"` MUST require a positive, approved profile `raw_max_bytes`
|