@synopackageland/sdk 0.10.11 → 0.11.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/README.md +28 -1
- package/dist/i18n/portal/de.json +6 -1
- package/dist/i18n/portal/en.json +6 -1
- package/dist/i18n/portal/es.json +6 -1
- package/dist/i18n/portal/fr.json +6 -1
- package/dist/i18n/portal/it.json +6 -1
- package/dist/i18n/portal/ja.json +6 -1
- package/dist/i18n/portal/ko.json +6 -1
- package/dist/i18n/portal/zh-CN.json +6 -1
- package/dist/i18n/portal/zh-TW.json +6 -1
- package/dist/i18n/shell/de.json +3 -1
- package/dist/i18n/shell/en.json +3 -1
- package/dist/i18n/shell/es.json +3 -1
- package/dist/i18n/shell/fr.json +3 -1
- package/dist/i18n/shell/it.json +3 -1
- package/dist/i18n/shell/ja.json +3 -1
- package/dist/i18n/shell/ko.json +3 -1
- package/dist/i18n/shell/zh-CN.json +3 -1
- package/dist/i18n/shell/zh-TW.json +3 -1
- package/dist/index.js +1403 -1337
- package/dist/src/delegate/ExecutorConsent.vue.d.ts +2 -0
- package/dist/src/delegate/executor-setup.d.ts +4 -0
- package/dist/src/delegate/use-scope-approval.d.ts +4 -0
- package/dist/src/portal/PortalSettings.vue.d.ts +5 -4
- package/dist/src/protocol/v1.d.ts +19 -3
- package/dist/src/shell/PageInfo.vue.d.ts +23 -0
- package/dist/src/shell/i18n.d.ts +2 -0
- package/dist/src/shell/page-info.d.ts +7 -0
- package/dist/src/vue.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/vue.js +1778 -1644
- package/package.json +3 -3
- package/spec/protocol/v1/README.md +27 -0
- package/spec/protocol/v1/errors.json +8 -0
- package/spec/protocol/v1/schema/delegate.create.json +3 -4
- package/spec/protocol/v1/schema/webapi.call.json +41 -0
- package/spec/protocol/v1/vectors/webapi.jsonl +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
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",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@lucide/vue": "^1.48.0",
|
|
47
|
-
"@synopackageland/ui": "^0.9.
|
|
47
|
+
"@synopackageland/ui": "^0.9.10",
|
|
48
48
|
"vue": "^3.5.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@lucide/vue": "1.48.0",
|
|
60
|
-
"@synopackageland/ui": "0.9.
|
|
60
|
+
"@synopackageland/ui": "0.9.10",
|
|
61
61
|
"@types/node": "24.19.2",
|
|
62
62
|
"@vitejs/plugin-vue": "6.0.9",
|
|
63
63
|
"jsdom": "27.4.0",
|
|
@@ -447,3 +447,30 @@ administrator). Their `dsm_cookie` is the user name and `dsm_synotoken` is
|
|
|
447
447
|
|
|
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
|
+
|
|
451
|
+
## JSON WebAPI grants (since 0.11.0)
|
|
452
|
+
|
|
453
|
+
`webapi.call` MUST execute only an exact API/method/version in the grant's named
|
|
454
|
+
`webapi` policy profile, with `runner` fixed to its owner. A profile has `purpose`
|
|
455
|
+
and `apis` (API -> method -> integer version array). It is part of the approved
|
|
456
|
+
policy digest. Grants MUST additionally pin their profile and revalidate the
|
|
457
|
+
account, UID, Application Privileges and original-address rules on every call.
|
|
458
|
+
`delegate.create` with only `webapi.call` uses `scope` as the profile name and
|
|
459
|
+
MUST omit file path/destination fields. It accepts job-bound TTL up to 30 days
|
|
460
|
+
or `lifetime:"until-revoked"`; all other grant rules remain unchanged. Mixing
|
|
461
|
+
file and WebAPI operations MUST be refused. Revoke and the integration disable
|
|
462
|
+
switch MUST fence WebAPI admission and drain admitted calls before acknowledging.
|
|
463
|
+
|
|
464
|
+
Core, Auth, API/Entry dispatch, FileStation and administrative namespaces/methods
|
|
465
|
+
MUST be refused even if declared (executor/README.md lists the permanent denylist).
|
|
466
|
+
Routing, runner, authentication and identity arguments MUST be refused. The
|
|
467
|
+
encoded params object MUST be at most 32 KiB, the JSON DSM envelope at most
|
|
468
|
+
48 KiB, and the call deadline at most 10 seconds including account revalidation.
|
|
469
|
+
Duplicate JSON keys MUST be refused. The wire frame remains at most 64 KiB.
|
|
470
|
+
Every admitted call MUST be audited without recording params/results.
|
|
471
|
+
|
|
472
|
+
Protocol success returns the full DSM success/error envelope. No automatic
|
|
473
|
+
mutation retries are permitted. A dispatched call whose execution/reply/audit
|
|
474
|
+
cannot be confirmed MUST answer `WEBAPI_UNCERTAIN` (nonretryable); client
|
|
475
|
+
transport failure MAY also hide a completed operation. Binary/streaming replies
|
|
476
|
+
MUST be refused. These bounds and semantics also apply to until-revoked grants.
|
|
@@ -513,6 +513,14 @@
|
|
|
513
513
|
"httpStatus": 502,
|
|
514
514
|
"en": "The executor reply is not a valid v1 response.",
|
|
515
515
|
"zh-TW": "executor 的回應不是有效的 v1 回應。"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"code": "WEBAPI_UNCERTAIN",
|
|
519
|
+
"kind": "refusal",
|
|
520
|
+
"retryable": false,
|
|
521
|
+
"httpStatus": 502,
|
|
522
|
+
"en": "The WebAPI outcome is unknown: execution, reply validation or audit completion failed. Do not automatically retry a mutation.",
|
|
523
|
+
"zh-TW": "WebAPI 結果不確定:執行、回覆驗證或稽核完成失敗。請勿自動重試寫入操作。"
|
|
516
524
|
}
|
|
517
525
|
]
|
|
518
526
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://github.com/synopackageland/syno-pkg-land-sdk/spec/protocol/v1/schema/delegate.create.json",
|
|
4
4
|
"title": "delegate.create",
|
|
5
|
-
"description": "Create a time-limited grant (job_id, ttl_seconds) or an until-revoked destination grant (destination, lifetime).",
|
|
5
|
+
"description": "Create a time-limited grant (job_id, ttl_seconds) or an until-revoked destination grant (destination, lifetime). Since 0.11.0: ops [webapi.call], scope is a named WebAPI profile, omit path/destination; job_id + ttl_seconds or lifetime until-revoked.",
|
|
6
6
|
"since": "0.9.0",
|
|
7
7
|
"auth": "required",
|
|
8
8
|
"type": "object",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"minItems": 1,
|
|
17
17
|
"items": {
|
|
18
18
|
"type": "string",
|
|
19
|
-
"pattern": "^files\\."
|
|
19
|
+
"pattern": "^(files\\.|webapi\\.call$)"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"scope": {
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"additionalProperties": false,
|
|
44
44
|
"required": [
|
|
45
45
|
"ops",
|
|
46
|
-
"scope"
|
|
47
|
-
"path"
|
|
46
|
+
"scope"
|
|
48
47
|
]
|
|
49
48
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/synopackageland/syno-pkg-land-sdk/spec/protocol/v1/schema/webapi.call.json",
|
|
4
|
+
"title": "webapi.call",
|
|
5
|
+
"description": "Call an exact approved JSON WebAPI as the profile grant owner. Never retried; the result is the full DSM success/error envelope.",
|
|
6
|
+
"since": "0.11.0",
|
|
7
|
+
"auth": "optional",
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"delegation_id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
13
|
+
},
|
|
14
|
+
"job_id": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"api": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"method": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"version": {
|
|
24
|
+
"type": "integer",
|
|
25
|
+
"minimum": 1,
|
|
26
|
+
"maximum": 65535
|
|
27
|
+
},
|
|
28
|
+
"params": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "JSON API arguments, at most 32768 encoded bytes; authentication, runner and dispatch keys are forbidden."
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": [
|
|
34
|
+
"delegation_id",
|
|
35
|
+
"api",
|
|
36
|
+
"method",
|
|
37
|
+
"version",
|
|
38
|
+
"params"
|
|
39
|
+
],
|
|
40
|
+
"additionalProperties": false
|
|
41
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{"name":"timed","request":{"v":1,"op":"delegate.create","auth":{"dsm_cookie":"alice","dsm_synotoken":"contract-token","remote_addr":"192.0.2.1"},"params":{"ops":["webapi.call"],"scope":"calendar","job_id":"j1","ttl_seconds":60}},"policy":{"v":1,"package":"contract","app":"app","operations":["status","delegate.create","delegate.list","delegate.revoke","webapi.call"],"webapi":{"calendar":{"purpose":"Create calendar reminders","apis":{"SYNO.Cal.Event":{"list":[6],"create":[6],"delete":[6]}}}}},"state":{},"expect":{"ok":true,"result":{"delegation_id":"<any>","scope":"calendar"}}}
|
|
2
|
+
{"name":"until-revoked","request":{"v":1,"op":"delegate.create","auth":{"dsm_cookie":"alice","dsm_synotoken":"contract-token","remote_addr":"192.0.2.1"},"params":{"ops":["webapi.call"],"scope":"calendar","lifetime":"until-revoked"}},"policy":{"v":1,"package":"contract","app":"app","operations":["status","delegate.create","delegate.list","delegate.revoke","webapi.call"],"webapi":{"calendar":{"purpose":"Create calendar reminders","apis":{"SYNO.Cal.Event":{"list":[6],"create":[6],"delete":[6]}}}}},"state":{},"expect":{"ok":true,"result":{"delegation_id":"<any>","scope":"calendar"}}}
|
|
3
|
+
{"name":"reject-files-mix","request":{"v":1,"op":"delegate.create","auth":{"dsm_cookie":"alice","dsm_synotoken":"contract-token","remote_addr":"192.0.2.1"},"params":{"ops":["webapi.call","files.list"],"scope":"calendar","job_id":"j1","ttl_seconds":60}},"policy":{"v":1,"package":"contract","app":"app","operations":["status","delegate.create","delegate.list","delegate.revoke","webapi.call"],"webapi":{"calendar":{"purpose":"Create calendar reminders","apis":{"SYNO.Cal.Event":{"list":[6],"create":[6],"delete":[6]}}}}},"state":{},"expect":{"ok":false,"code":"INVALID_REQUEST"}}
|