@synopackageland/sdk 0.11.0 → 0.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/sdk",
3
- "version": "0.11.0",
3
+ "version": "0.12.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",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@lucide/vue": "^1.48.0",
47
- "@synopackageland/ui": "^0.9.10",
47
+ "@synopackageland/ui": "^0.10.1",
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.10",
60
+ "@synopackageland/ui": "0.10.1",
61
61
  "@types/node": "24.19.2",
62
62
  "@vitejs/plugin-vue": "6.0.9",
63
63
  "jsdom": "27.4.0",
@@ -474,3 +474,16 @@ mutation retries are permitted. A dispatched call whose execution/reply/audit
474
474
  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
+
478
+ ## Raw WebAPI extension (since 0.12.1)
479
+
480
+ The JSON-only restriction above applies to the default response mode. An explicit
481
+ `response_type:"raw"` MUST require a positive, approved profile `raw_max_bytes`
482
+ (1..67108864), pinned by policy and user consent. The executor MUST parse bounded
483
+ CGI headers, refuse redirects, enforce the body limit without truncation, and
484
+ return `response_type`, `content_type`, `size`, `sha256` and exactly one of
485
+ base64 `body` (at most 32768 bytes decoded) or a package-private `staging` handle.
486
+ It MUST NOT raise frame limits. Staging MUST be App-owned 0600 under a private
487
+ 0700 package directory. The App MUST verify size/hash and unlink after reading.
488
+ Header, execution, spool cleanup and error rules are specified in
489
+ [the raw contract](../../../docs/webapi-raw.md).
@@ -2,11 +2,16 @@
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/webapi.call.json",
4
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.",
5
+ "description": "Call an exact approved WebAPI as the profile grant owner. JSON returns the DSM envelope; raw (since 0.12.1) requires profile raw_max_bytes and returns content_type, size, sha256 and base64 body or private staging handle. Never retried.",
6
6
  "since": "0.11.0",
7
7
  "auth": "optional",
8
8
  "type": "object",
9
9
  "properties": {
10
+ "response_type": {
11
+ "type": "string",
12
+ "enum": ["json", "raw"],
13
+ "description": "Defaults to json. Raw requires an explicitly approved raw_max_bytes profile."
14
+ },
10
15
  "delegation_id": {
11
16
  "type": "string",
12
17
  "pattern": "^[a-f0-9]{64}$"
@@ -1,3 +1,4 @@
1
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
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
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"}}
4
+ {"name":"raw-profile-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]}},"raw_max_bytes":26214400}}},"state":{},"expect":{"ok":true,"result":{"delegation_id":"<any>","scope":"calendar"}}}