@synopackageland/sdk 0.0.0-stage → 0.9.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/LICENSE +21 -0
- package/README.md +34 -2
- package/dist/i18n/authorization/de.json +37 -0
- package/dist/i18n/authorization/en.json +37 -0
- package/dist/i18n/authorization/es.json +37 -0
- package/dist/i18n/authorization/fr.json +37 -0
- package/dist/i18n/authorization/it.json +37 -0
- package/dist/i18n/authorization/ja.json +37 -0
- package/dist/i18n/authorization/ko.json +37 -0
- package/dist/i18n/authorization/zh-CN.json +37 -0
- package/dist/i18n/authorization/zh-TW.json +37 -0
- package/dist/i18n/background/de.json +75 -0
- package/dist/i18n/background/en.json +75 -0
- package/dist/i18n/background/es.json +75 -0
- package/dist/i18n/background/fr.json +75 -0
- package/dist/i18n/background/it.json +75 -0
- package/dist/i18n/background/ja.json +75 -0
- package/dist/i18n/background/ko.json +75 -0
- package/dist/i18n/background/zh-CN.json +75 -0
- package/dist/i18n/background/zh-TW.json +75 -0
- package/dist/i18n/delegate/de.json +49 -0
- package/dist/i18n/delegate/en.json +49 -0
- package/dist/i18n/delegate/es.json +49 -0
- package/dist/i18n/delegate/fr.json +49 -0
- package/dist/i18n/delegate/it.json +49 -0
- package/dist/i18n/delegate/ja.json +49 -0
- package/dist/i18n/delegate/ko.json +49 -0
- package/dist/i18n/delegate/zh-CN.json +49 -0
- package/dist/i18n/delegate/zh-TW.json +49 -0
- package/dist/i18n/files/de.json +41 -0
- package/dist/i18n/files/en.json +41 -0
- package/dist/i18n/files/es.json +41 -0
- package/dist/i18n/files/fr.json +41 -0
- package/dist/i18n/files/it.json +41 -0
- package/dist/i18n/files/ja.json +41 -0
- package/dist/i18n/files/ko.json +41 -0
- package/dist/i18n/files/zh-CN.json +41 -0
- package/dist/i18n/files/zh-TW.json +41 -0
- package/dist/i18n/identity/de.json +27 -0
- package/dist/i18n/identity/en.json +27 -0
- package/dist/i18n/identity/es.json +27 -0
- package/dist/i18n/identity/fr.json +27 -0
- package/dist/i18n/identity/it.json +27 -0
- package/dist/i18n/identity/ja.json +27 -0
- package/dist/i18n/identity/ko.json +27 -0
- package/dist/i18n/identity/zh-CN.json +27 -0
- package/dist/i18n/identity/zh-TW.json +27 -0
- package/dist/i18n/save/de.json +42 -0
- package/dist/i18n/save/en.json +42 -0
- package/dist/i18n/save/es.json +42 -0
- package/dist/i18n/save/fr.json +42 -0
- package/dist/i18n/save/it.json +42 -0
- package/dist/i18n/save/ja.json +42 -0
- package/dist/i18n/save/ko.json +42 -0
- package/dist/i18n/save/zh-CN.json +42 -0
- package/dist/i18n/save/zh-TW.json +42 -0
- package/dist/i18n/shell/de.json +4 -0
- package/dist/i18n/shell/en.json +4 -0
- package/dist/i18n/shell/es.json +4 -0
- package/dist/i18n/shell/fr.json +4 -0
- package/dist/i18n/shell/it.json +4 -0
- package/dist/i18n/shell/ja.json +4 -0
- package/dist/i18n/shell/ko.json +4 -0
- package/dist/i18n/shell/zh-CN.json +4 -0
- package/dist/i18n/shell/zh-TW.json +4 -0
- package/dist/index.js +2627 -0
- package/dist/src/authorization/AuthorizationGate.vue.d.ts +22 -0
- package/dist/src/authorization/i18n.d.ts +3 -0
- package/dist/src/background/BackgroundPanel.vue.d.ts +7 -0
- package/dist/src/background/i18n.d.ts +79 -0
- package/dist/src/background/picker-provider.d.ts +3 -0
- package/dist/src/background/request-key.d.ts +1 -0
- package/dist/src/context.d.ts +114 -0
- package/dist/src/delegate/BackgroundSavePanel.vue.d.ts +18 -0
- package/dist/src/delegate/DelegatePanel.vue.d.ts +7 -0
- package/dist/src/delegate/ExecutorSettings.vue.d.ts +13 -0
- package/dist/src/delegate/copy.d.ts +101 -0
- package/dist/src/delegate/executor-setup.d.ts +16 -0
- package/dist/src/delegate/facade.d.ts +8 -0
- package/dist/src/delegate/long-running.d.ts +74 -0
- package/dist/src/delegate/save-copy.d.ts +126 -0
- package/dist/src/delegate/scoped-picker.d.ts +3 -0
- package/dist/src/delegate/use-executor-setup.d.ts +4 -0
- package/dist/src/files/FileBrowser.vue.d.ts +17 -0
- package/dist/src/files/FilesPage.vue.d.ts +7 -0
- package/dist/src/files/transfers.d.ts +9 -0
- package/dist/src/i18n.d.ts +7 -0
- package/dist/src/identity/LoginPage.vue.d.ts +8 -0
- package/dist/src/identity/i18n.d.ts +31 -0
- package/dist/src/identity/session.d.ts +20 -0
- package/dist/src/index.d.ts +24 -0
- package/dist/src/nas/NasPicker.vue.d.ts +22 -0
- package/dist/src/nas/contract.d.ts +27 -0
- package/dist/src/nas/i18n.d.ts +2 -0
- package/dist/src/nas/locale.d.ts +45 -0
- package/dist/src/nas/provider.d.ts +3 -0
- package/dist/src/nas/use-request.d.ts +6 -0
- package/dist/src/portal/PortalSettings.vue.d.ts +7 -0
- package/dist/src/protocol/codec.d.ts +17 -0
- package/dist/src/protocol/v1.d.ts +518 -0
- package/dist/src/shell/AppShell.vue.d.ts +26 -0
- package/dist/src/shell/i18n.d.ts +7 -0
- package/dist/src/shell/pages.d.ts +7 -0
- package/dist/src/vue.d.ts +15 -0
- package/dist/style.css +1 -0
- package/dist/vue.js +2331 -0
- package/package.json +64 -4
- package/spec/protocol/v1/README.md +112 -0
- package/spec/protocol/v1/errors.json +454 -0
- package/spec/protocol/v1/schema/delegate.audit.json +11 -0
- package/spec/protocol/v1/schema/delegate.create.json +49 -0
- package/spec/protocol/v1/schema/delegate.disable.json +11 -0
- package/spec/protocol/v1/schema/delegate.enable.json +11 -0
- package/spec/protocol/v1/schema/delegate.list.json +11 -0
- package/spec/protocol/v1/schema/delegate.revoke.json +23 -0
- package/spec/protocol/v1/schema/files.cancelOperation.json +24 -0
- package/spec/protocol/v1/schema/files.checkPermission.json +30 -0
- package/spec/protocol/v1/schema/files.copy.json +42 -0
- package/spec/protocol/v1/schema/files.createFolder.json +38 -0
- package/spec/protocol/v1/schema/files.delete.json +36 -0
- package/spec/protocol/v1/schema/files.info.json +30 -0
- package/spec/protocol/v1/schema/files.list.json +30 -0
- package/spec/protocol/v1/schema/files.move.json +42 -0
- package/spec/protocol/v1/schema/files.moveFromStaging.json +47 -0
- package/spec/protocol/v1/schema/files.operationStatus.json +24 -0
- package/spec/protocol/v1/schema/files.read.json +35 -0
- package/spec/protocol/v1/schema/files.rename.json +35 -0
- package/spec/protocol/v1/schema/files.taskCancel.json +29 -0
- package/spec/protocol/v1/schema/files.taskStatus.json +29 -0
- package/spec/protocol/v1/schema/files.write.json +46 -0
- package/spec/protocol/v1/schema/root.run.json +19 -0
- package/spec/protocol/v1/schema/status.json +11 -0
- package/spec/protocol/v1/vectors/delegate.jsonl +16 -0
- package/spec/protocol/v1/vectors/envelope.jsonl +11 -0
- package/spec/protocol/v1/vectors/files.jsonl +10 -0
- package/spec/protocol/v1/vectors/status.jsonl +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.9.1",
|
|
4
|
+
"description": "Frontend SDK for DSM packages built with synopkgland: headless client and Vue components",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/synopackageland/syno-pkg-land-sdk/tree/main/ts#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/synopackageland/syno-pkg-land-sdk/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/synopackageland/syno-pkg-land-sdk.git",
|
|
13
|
+
"directory": "ts"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"*.css"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/src/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./vue": {
|
|
25
|
+
"types": "./dist/src/vue.d.ts",
|
|
26
|
+
"import": "./dist/vue.js"
|
|
27
|
+
},
|
|
28
|
+
"./vue/style.css": "./dist/style.css",
|
|
29
|
+
"./i18n/*": "./dist/i18n/*"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"spec"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"prepack": "test -d node_modules || { echo '@synopackageland/sdk: run npm ci before npm pack' >&2; exit 1; }; npm run build",
|
|
37
|
+
"build": "vite build && vue-tsc -p tsconfig.build.json && cp -R i18n dist/ && rm -rf spec && cp -R ../spec spec",
|
|
38
|
+
"typecheck": "vue-tsc --noEmit",
|
|
39
|
+
"test": "vitest run"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@lucide/vue": "^1.48.0",
|
|
43
|
+
"@synopackageland/ui": "^0.9.0",
|
|
44
|
+
"vue": "^3.5.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"@lucide/vue": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"@synopackageland/ui": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@lucide/vue": "1.48.0",
|
|
56
|
+
"@synopackageland/ui": "0.9.0",
|
|
57
|
+
"@types/node": "24.19.2",
|
|
58
|
+
"@vitejs/plugin-vue": "6.0.9",
|
|
59
|
+
"jsdom": "27.4.0",
|
|
60
|
+
"typescript": "5.9.3",
|
|
61
|
+
"vite": "7.3.6",
|
|
62
|
+
"vitest": "4.1.11",
|
|
63
|
+
"vue": "3.5.43",
|
|
64
|
+
"vue-tsc": "3.3.11"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Executor protocol v1
|
|
2
|
+
|
|
3
|
+
Since 0.9.0. The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD,
|
|
4
|
+
SHOULD NOT, RECOMMENDED, MAY and OPTIONAL are to be interpreted as described in
|
|
5
|
+
RFC 2119.
|
|
6
|
+
|
|
7
|
+
The executor is a root process that a DSM package ships next to its app. The
|
|
8
|
+
app asks it to act as a signed-in DSM user over a Unix socket. This directory
|
|
9
|
+
is the protocol: the executor in `../../../executor` and the Go client in
|
|
10
|
+
`../../../delegate` both conform to it, and `../../../conformance` checks
|
|
11
|
+
the executor against the vectors here.
|
|
12
|
+
|
|
13
|
+
| File | Contents |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `schema/<op>.json` | JSON Schema (draft 2020-12) of the `params` of each op, with `since` |
|
|
16
|
+
| `errors.json` | Every code: `code`, `kind`, `retryable`, `httpStatus`, `en`, `zh-TW`. The only source of codes; the Go constants are generated from it |
|
|
17
|
+
| `vectors/*.jsonl` | One request per line: `{name, request, policy, state, expect}` |
|
|
18
|
+
|
|
19
|
+
## Transport
|
|
20
|
+
|
|
21
|
+
1. The socket is `/run/synopkgland/<package>/executor.sock`. The executor MUST
|
|
22
|
+
accept a connection only from the package user or root (peer credentials).
|
|
23
|
+
2. A connection carries exactly one request and one response.
|
|
24
|
+
3. A request is one line of UTF-8 JSON ending in `\n`. A request line MUST NOT
|
|
25
|
+
exceed 64 KiB including the newline; the executor answers
|
|
26
|
+
`REQUEST_TOO_LARGE`.
|
|
27
|
+
4. The executor MUST answer one line of JSON ending in `\n` and close.
|
|
28
|
+
5. The executor SHOULD close a connection that sends nothing for 15 seconds.
|
|
29
|
+
|
|
30
|
+
## Request
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{"v":1,"op":"files.moveFromStaging","auth":{"dsm_cookie":"…","dsm_synotoken":"…"},"params":{…}}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- `v` MUST be `1`.
|
|
37
|
+
- `op` MUST be one of the ops with a schema in `schema/`. An unknown op is
|
|
38
|
+
`UNKNOWN_OP`; an op outside the approved policy is `POLICY_DENIED`.
|
|
39
|
+
- `auth` is OPTIONAL. When present it MUST contain only `dsm_cookie` and
|
|
40
|
+
`dsm_synotoken`. A present `auth` is always treated as caller
|
|
41
|
+
authentication, never ignored, even when empty. Ops whose schema says
|
|
42
|
+
`"auth": "required"` MUST be refused with `AUTH_DENIED` without a valid DSM
|
|
43
|
+
session.
|
|
44
|
+
- `params` MUST be an object valid against `schema/<op>.json`. A member that
|
|
45
|
+
belongs to another op is `INVALID_REQUEST`.
|
|
46
|
+
- The executor MUST refuse with `INVALID_REQUEST`: invalid UTF-8, duplicate
|
|
47
|
+
keys (compared with Unicode case folding), keys in `params` or `auth` other
|
|
48
|
+
than lowercase ASCII, digits and `_`, unknown members, and trailing data
|
|
49
|
+
after the object.
|
|
50
|
+
|
|
51
|
+
## Response
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{"ok":true,"result":{…}}
|
|
55
|
+
{"ok":false,"code":"SCOPE_DENIED","message":"scope denied"}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- `ok` is REQUIRED. On success `result` MUST be an object.
|
|
59
|
+
- On refusal `code` MUST be a code of kind `refusal` in `errors.json`.
|
|
60
|
+
Clients MUST match on `code`, never on `message`.
|
|
61
|
+
- A client MUST treat a reply that is not a JSON object with a boolean `ok`
|
|
62
|
+
as `EXECUTOR_PROTOCOL`, and an unreachable socket as
|
|
63
|
+
`EXECUTOR_UNAVAILABLE`. Codes of kind `client` are never sent by the
|
|
64
|
+
executor.
|
|
65
|
+
|
|
66
|
+
## Status
|
|
67
|
+
|
|
68
|
+
`status` answers `version` (`"1"`), `ready`, `disabled`, `executor_digest`
|
|
69
|
+
and `policy_digest`. The executor MUST NOT report the SDK version; the binary
|
|
70
|
+
digest MUST change only when the executor source changes.
|
|
71
|
+
|
|
72
|
+
## Grants
|
|
73
|
+
|
|
74
|
+
- A time-limited grant (`job_id`, `ttl_seconds` ≤ 30 days) covers the listed
|
|
75
|
+
`files.*` ops below `path`.
|
|
76
|
+
- An until-revoked grant (`destination`, `lifetime: "until-revoked"`) covers
|
|
77
|
+
only `files.moveFromStaging` into one directory. A new grant for the same
|
|
78
|
+
user and destination MUST revoke the previous one (`destination-replaced`).
|
|
79
|
+
- `files.taskStatus` and `files.taskCancel` follow the task's op and MUST NOT
|
|
80
|
+
be granted directly.
|
|
81
|
+
- An administrator MAY turn the integration off with `delegate.disable`; then
|
|
82
|
+
`delegate.create` and every `files.*` op MUST be refused with `disabled`.
|
|
83
|
+
|
|
84
|
+
## Asynchronous operations
|
|
85
|
+
|
|
86
|
+
`files.moveFromStaging` admits an operation keyed by `job_id`. Sending the same
|
|
87
|
+
`job_id` with the same input MUST return the existing operation; different
|
|
88
|
+
input MUST be `operation-conflict`. States: `queued`, `copying`, `committed`,
|
|
89
|
+
`canceled`, `interrupted`, `uncertain`. `files.operationStatus` and
|
|
90
|
+
`files.cancelOperation` report the operation; `code` and `reason` in it are
|
|
91
|
+
codes of kind `outcome` and `reason`.
|
|
92
|
+
|
|
93
|
+
## Vectors
|
|
94
|
+
|
|
95
|
+
Each line of `vectors/*.jsonl`:
|
|
96
|
+
|
|
97
|
+
| Member | Meaning |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `name` | Unique within its file |
|
|
100
|
+
| `request` | The request object, or a JSON string sent as the raw line (for malformed input) |
|
|
101
|
+
| `policy` | The approved policy the executor runs with |
|
|
102
|
+
| `state` | Executor state before the request: `disabled`, and `grants` (`id`, `username`, `key`, `path`) as until-revoked home grants |
|
|
103
|
+
| `expect` | The response. Objects match on the members listed; `"<any>"` matches any present value |
|
|
104
|
+
|
|
105
|
+
The vector DSM knows `alice` (uid 1205), `bob` (1206) and `admin` (1207, an
|
|
106
|
+
administrator). Their `dsm_cookie` is the user name and `dsm_synotoken` is
|
|
107
|
+
`contract-token`.
|
|
108
|
+
|
|
109
|
+
## Versioning
|
|
110
|
+
|
|
111
|
+
New ops and members are added with a `since` of the SDK release. The protocol
|
|
112
|
+
`v` changes only for an incompatible envelope change.
|
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Single source of protocol v1 codes. kind: refusal = response code with ok false; outcome = operation record code; reason = operation record reason; client = produced by a client, never sent by the executor. httpStatus is the status an HTTP adapter SHOULD use.",
|
|
3
|
+
"since": "0.9.0",
|
|
4
|
+
"codes": [
|
|
5
|
+
{
|
|
6
|
+
"code": "AUTH_DENIED",
|
|
7
|
+
"kind": "refusal",
|
|
8
|
+
"retryable": false,
|
|
9
|
+
"httpStatus": 401,
|
|
10
|
+
"en": "The DSM session in auth is missing, invalid or expired.",
|
|
11
|
+
"zh-TW": "auth 中的 DSM 工作階段缺少、無效或已過期。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"code": "INELIGIBLE",
|
|
15
|
+
"kind": "refusal",
|
|
16
|
+
"retryable": false,
|
|
17
|
+
"httpStatus": 403,
|
|
18
|
+
"en": "The DSM account cannot be delegated: system account, expired, or not the caller.",
|
|
19
|
+
"zh-TW": "此 DSM 帳號無法委派:系統帳號、已過期,或不是呼叫者本人。"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"code": "APP_DENIED",
|
|
23
|
+
"kind": "refusal",
|
|
24
|
+
"retryable": false,
|
|
25
|
+
"httpStatus": 403,
|
|
26
|
+
"en": "DSM Application Privileges do not allow the account to use the app or File Station.",
|
|
27
|
+
"zh-TW": "DSM 應用程式權限不允許此帳號使用 App 或 File Station。"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"code": "ADMIN_REQUIRED",
|
|
31
|
+
"kind": "refusal",
|
|
32
|
+
"retryable": false,
|
|
33
|
+
"httpStatus": 403,
|
|
34
|
+
"en": "The operation needs a DSM administrator.",
|
|
35
|
+
"zh-TW": "此操作需要 DSM 管理員。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"code": "DELEGATION_DENIED",
|
|
39
|
+
"kind": "refusal",
|
|
40
|
+
"retryable": false,
|
|
41
|
+
"httpStatus": 403,
|
|
42
|
+
"en": "The grant does not exist, belongs to another user or package, or was revoked.",
|
|
43
|
+
"zh-TW": "授權不存在、屬於其他使用者或套件,或已撤銷。"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"code": "SCOPE_DENIED",
|
|
47
|
+
"kind": "refusal",
|
|
48
|
+
"retryable": false,
|
|
49
|
+
"httpStatus": 403,
|
|
50
|
+
"en": "The path is outside the grant or the approved folder scope.",
|
|
51
|
+
"zh-TW": "路徑超出授權或已核准的資料夾範圍。"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"code": "POLICY_DENIED",
|
|
55
|
+
"kind": "refusal",
|
|
56
|
+
"retryable": false,
|
|
57
|
+
"httpStatus": 403,
|
|
58
|
+
"en": "The operation is not in the approved policy.",
|
|
59
|
+
"zh-TW": "此操作不在已核准的政策內。"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"code": "PEER_DENIED",
|
|
63
|
+
"kind": "refusal",
|
|
64
|
+
"retryable": false,
|
|
65
|
+
"httpStatus": 403,
|
|
66
|
+
"en": "The socket peer is not the package user or root.",
|
|
67
|
+
"zh-TW": "socket 對端不是套件使用者或 root。"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"code": "PERMISSION_DENIED",
|
|
71
|
+
"kind": "refusal",
|
|
72
|
+
"retryable": false,
|
|
73
|
+
"httpStatus": 403,
|
|
74
|
+
"en": "The delegated user cannot access the path in DSM.",
|
|
75
|
+
"zh-TW": "受委派的使用者在 DSM 中無法存取該路徑。"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"code": "UNKNOWN_OP",
|
|
79
|
+
"kind": "refusal",
|
|
80
|
+
"retryable": false,
|
|
81
|
+
"httpStatus": 400,
|
|
82
|
+
"en": "The executor does not know the operation.",
|
|
83
|
+
"zh-TW": "executor 不認得此操作。"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"code": "INVALID_REQUEST",
|
|
87
|
+
"kind": "refusal",
|
|
88
|
+
"retryable": false,
|
|
89
|
+
"httpStatus": 400,
|
|
90
|
+
"en": "The request or its params are not valid.",
|
|
91
|
+
"zh-TW": "請求或其 params 不合法。"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"code": "REQUEST_TOO_LARGE",
|
|
95
|
+
"kind": "refusal",
|
|
96
|
+
"retryable": false,
|
|
97
|
+
"httpStatus": 413,
|
|
98
|
+
"en": "The request line is larger than 64 KiB.",
|
|
99
|
+
"zh-TW": "請求行超過 64 KiB。"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"code": "EXECUTOR_PAUSED",
|
|
103
|
+
"kind": "refusal",
|
|
104
|
+
"retryable": true,
|
|
105
|
+
"httpStatus": 503,
|
|
106
|
+
"en": "The executor is paused, for example while the package stops or upgrades.",
|
|
107
|
+
"zh-TW": "executor 已暫停,例如套件停止或升級期間。"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"code": "STORAGE_ERROR",
|
|
111
|
+
"kind": "refusal",
|
|
112
|
+
"retryable": true,
|
|
113
|
+
"httpStatus": 500,
|
|
114
|
+
"en": "The executor could not read or write its protected state.",
|
|
115
|
+
"zh-TW": "executor 無法讀寫其受保護的狀態。"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"code": "INTERNAL",
|
|
119
|
+
"kind": "refusal",
|
|
120
|
+
"retryable": true,
|
|
121
|
+
"httpStatus": 500,
|
|
122
|
+
"en": "The executor failed unexpectedly.",
|
|
123
|
+
"zh-TW": "executor 發生非預期的失敗。"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"code": "WRITE_FAILED",
|
|
127
|
+
"kind": "refusal",
|
|
128
|
+
"retryable": true,
|
|
129
|
+
"httpStatus": 500,
|
|
130
|
+
"en": "The executor could not write the file.",
|
|
131
|
+
"zh-TW": "executor 無法寫入檔案。"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"code": "READ_FAILED",
|
|
135
|
+
"kind": "refusal",
|
|
136
|
+
"retryable": true,
|
|
137
|
+
"httpStatus": 500,
|
|
138
|
+
"en": "The executor could not copy the file into staging.",
|
|
139
|
+
"zh-TW": "executor 無法把檔案複製到 staging。"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"code": "DSM_FAILED",
|
|
143
|
+
"kind": "refusal",
|
|
144
|
+
"retryable": true,
|
|
145
|
+
"httpStatus": 502,
|
|
146
|
+
"en": "A DSM call made by the executor failed.",
|
|
147
|
+
"zh-TW": "executor 呼叫 DSM 失敗。"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"code": "ROOT_FAILED",
|
|
151
|
+
"kind": "refusal",
|
|
152
|
+
"retryable": false,
|
|
153
|
+
"httpStatus": 500,
|
|
154
|
+
"en": "The root operation exited with a non-zero status or failed to run.",
|
|
155
|
+
"zh-TW": "root 操作以非零狀態結束,或無法執行。"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"code": "NO_SPACE",
|
|
159
|
+
"kind": "refusal",
|
|
160
|
+
"retryable": false,
|
|
161
|
+
"httpStatus": 507,
|
|
162
|
+
"en": "The destination volume is full.",
|
|
163
|
+
"zh-TW": "目的地的儲存空間已滿。"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"code": "SCOPE_APPROVAL_STALE",
|
|
167
|
+
"kind": "refusal",
|
|
168
|
+
"retryable": false,
|
|
169
|
+
"httpStatus": 409,
|
|
170
|
+
"en": "The folder scope approval is out of date.",
|
|
171
|
+
"zh-TW": "資料夾範圍的核准已過期。"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"code": "IDENTITY_CHANGED",
|
|
175
|
+
"kind": "refusal",
|
|
176
|
+
"retryable": false,
|
|
177
|
+
"httpStatus": 409,
|
|
178
|
+
"en": "The DSM account or folder the grant is bound to changed.",
|
|
179
|
+
"zh-TW": "授權所綁定的 DSM 帳號或資料夾已變更。"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"code": "needs-scope-confirmation",
|
|
183
|
+
"kind": "refusal",
|
|
184
|
+
"retryable": false,
|
|
185
|
+
"httpStatus": 409,
|
|
186
|
+
"en": "An administrator must confirm the folder scope first.",
|
|
187
|
+
"zh-TW": "管理員必須先確認資料夾範圍。"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"code": "disabled",
|
|
191
|
+
"kind": "refusal",
|
|
192
|
+
"retryable": false,
|
|
193
|
+
"httpStatus": 409,
|
|
194
|
+
"en": "An administrator turned the integration off.",
|
|
195
|
+
"zh-TW": "管理員已關閉這項整合。"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"code": "invalid-destination",
|
|
199
|
+
"kind": "refusal",
|
|
200
|
+
"retryable": false,
|
|
201
|
+
"httpStatus": 400,
|
|
202
|
+
"en": "The destination key is not in the policy.",
|
|
203
|
+
"zh-TW": "目的地不在政策內。"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"code": "invalid-size",
|
|
207
|
+
"kind": "refusal",
|
|
208
|
+
"retryable": false,
|
|
209
|
+
"httpStatus": 400,
|
|
210
|
+
"en": "The size is missing, negative or too large.",
|
|
211
|
+
"zh-TW": "檔案大小缺少、為負數或過大。"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"code": "operation-conflict",
|
|
215
|
+
"kind": "refusal",
|
|
216
|
+
"retryable": false,
|
|
217
|
+
"httpStatus": 409,
|
|
218
|
+
"en": "The same job id was sent again with different input.",
|
|
219
|
+
"zh-TW": "相同的 job id 又以不同的輸入送出。"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"code": "operation-not-found",
|
|
223
|
+
"kind": "refusal",
|
|
224
|
+
"retryable": false,
|
|
225
|
+
"httpStatus": 404,
|
|
226
|
+
"en": "The operation is not known for this grant and caller.",
|
|
227
|
+
"zh-TW": "此授權與呼叫者沒有這項操作。"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"code": "destination-exists",
|
|
231
|
+
"kind": "refusal",
|
|
232
|
+
"retryable": false,
|
|
233
|
+
"httpStatus": 409,
|
|
234
|
+
"en": "A file with that name already exists and conflict does not allow replacing it.",
|
|
235
|
+
"zh-TW": "目的地已有同名檔案,且 conflict 不允許取代。"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"code": "invalid-path",
|
|
239
|
+
"kind": "refusal",
|
|
240
|
+
"retryable": false,
|
|
241
|
+
"httpStatus": 400,
|
|
242
|
+
"en": "A name or path is empty, reserved, too long or contains a forbidden character.",
|
|
243
|
+
"zh-TW": "名稱或路徑為空、保留字、過長或含禁止字元。"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"code": "path-too-deep",
|
|
247
|
+
"kind": "refusal",
|
|
248
|
+
"retryable": false,
|
|
249
|
+
"httpStatus": 400,
|
|
250
|
+
"en": "The name has more than 16 folders.",
|
|
251
|
+
"zh-TW": "名稱超過 16 層資料夾。"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"code": "destination-not-directory",
|
|
255
|
+
"kind": "refusal",
|
|
256
|
+
"retryable": false,
|
|
257
|
+
"httpStatus": 409,
|
|
258
|
+
"en": "A folder in the name exists as a file or symlink, or is on another volume.",
|
|
259
|
+
"zh-TW": "名稱中的某個資料夾其實是檔案或符號連結,或位於另一個磁碟區。"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"code": "name-too-long",
|
|
263
|
+
"kind": "refusal",
|
|
264
|
+
"retryable": false,
|
|
265
|
+
"httpStatus": 400,
|
|
266
|
+
"en": "The volume refused a name as too long.",
|
|
267
|
+
"zh-TW": "磁碟區認為名稱過長而拒絕。"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"code": "not-found",
|
|
271
|
+
"kind": "refusal",
|
|
272
|
+
"retryable": false,
|
|
273
|
+
"httpStatus": 404,
|
|
274
|
+
"en": "The path does not exist.",
|
|
275
|
+
"zh-TW": "路徑不存在。"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"code": "not-a-file",
|
|
279
|
+
"kind": "refusal",
|
|
280
|
+
"retryable": false,
|
|
281
|
+
"httpStatus": 400,
|
|
282
|
+
"en": "The path is a folder or a special file.",
|
|
283
|
+
"zh-TW": "路徑是資料夾或特殊檔案。"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"code": "recursive-required",
|
|
287
|
+
"kind": "refusal",
|
|
288
|
+
"retryable": false,
|
|
289
|
+
"httpStatus": 400,
|
|
290
|
+
"en": "The path is a folder and recursive is not set.",
|
|
291
|
+
"zh-TW": "路徑是資料夾,且未設定 recursive。"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"code": "recycle-bin-disabled",
|
|
295
|
+
"kind": "refusal",
|
|
296
|
+
"retryable": false,
|
|
297
|
+
"httpStatus": 409,
|
|
298
|
+
"en": "The Shared Folder has no recycle bin and permanent is not set.",
|
|
299
|
+
"zh-TW": "共用資料夾沒有資源回收筒,且未設定 permanent。"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"code": "task-not-found",
|
|
303
|
+
"kind": "refusal",
|
|
304
|
+
"retryable": false,
|
|
305
|
+
"httpStatus": 404,
|
|
306
|
+
"en": "The task belongs to another job, or the executor restarted.",
|
|
307
|
+
"zh-TW": "任務屬於其他工作,或 executor 已重新啟動。"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"code": "too-many-tasks",
|
|
311
|
+
"kind": "refusal",
|
|
312
|
+
"retryable": true,
|
|
313
|
+
"httpStatus": 429,
|
|
314
|
+
"en": "The executor already tracks 64 tasks.",
|
|
315
|
+
"zh-TW": "executor 已在追蹤 64 個任務。"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"code": "queue-full",
|
|
319
|
+
"kind": "refusal",
|
|
320
|
+
"retryable": true,
|
|
321
|
+
"httpStatus": 429,
|
|
322
|
+
"en": "The executor operation queue is full.",
|
|
323
|
+
"zh-TW": "executor 的操作佇列已滿。"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"code": "limit-exceeded",
|
|
327
|
+
"kind": "refusal",
|
|
328
|
+
"retryable": false,
|
|
329
|
+
"httpStatus": 413,
|
|
330
|
+
"en": "The file is larger than max_bytes.",
|
|
331
|
+
"zh-TW": "檔案超過 max_bytes。"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"code": "OPERATION_CANCELED",
|
|
335
|
+
"kind": "outcome",
|
|
336
|
+
"retryable": false,
|
|
337
|
+
"httpStatus": 409,
|
|
338
|
+
"en": "The operation was canceled; reason says why.",
|
|
339
|
+
"zh-TW": "操作已取消;reason 說明原因。"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"code": "CANCEL_REQUESTED",
|
|
343
|
+
"kind": "outcome",
|
|
344
|
+
"retryable": false,
|
|
345
|
+
"httpStatus": 202,
|
|
346
|
+
"en": "Cancel was requested and the copy has not stopped yet.",
|
|
347
|
+
"zh-TW": "已要求取消,複製尚未停止。"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"code": "CLEANUP_PENDING",
|
|
351
|
+
"kind": "outcome",
|
|
352
|
+
"retryable": true,
|
|
353
|
+
"httpStatus": 500,
|
|
354
|
+
"en": "The operation ended but its partial file is not removed yet.",
|
|
355
|
+
"zh-TW": "操作已結束,但部分檔案尚未清除。"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"code": "grant-revoked",
|
|
359
|
+
"kind": "reason",
|
|
360
|
+
"retryable": false,
|
|
361
|
+
"httpStatus": 409,
|
|
362
|
+
"en": "The grant was revoked.",
|
|
363
|
+
"zh-TW": "授權已撤銷。"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"code": "destination-replaced",
|
|
367
|
+
"kind": "reason",
|
|
368
|
+
"retryable": false,
|
|
369
|
+
"httpStatus": 409,
|
|
370
|
+
"en": "A newer grant replaced this destination.",
|
|
371
|
+
"zh-TW": "較新的授權取代了此目的地。"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"code": "integration-disabled",
|
|
375
|
+
"kind": "reason",
|
|
376
|
+
"retryable": false,
|
|
377
|
+
"httpStatus": 409,
|
|
378
|
+
"en": "An administrator disabled the integration.",
|
|
379
|
+
"zh-TW": "管理員停用了此整合。"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"code": "validation-denied",
|
|
383
|
+
"kind": "reason",
|
|
384
|
+
"retryable": false,
|
|
385
|
+
"httpStatus": 403,
|
|
386
|
+
"en": "The grant failed revalidation against DSM.",
|
|
387
|
+
"zh-TW": "授權未通過 DSM 的重新驗證。"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"code": "scope-changed",
|
|
391
|
+
"kind": "reason",
|
|
392
|
+
"retryable": false,
|
|
393
|
+
"httpStatus": 409,
|
|
394
|
+
"en": "The approved folder scope changed.",
|
|
395
|
+
"zh-TW": "已核准的資料夾範圍已變更。"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"code": "storage-error",
|
|
399
|
+
"kind": "reason",
|
|
400
|
+
"retryable": true,
|
|
401
|
+
"httpStatus": 500,
|
|
402
|
+
"en": "Protected state could not be written.",
|
|
403
|
+
"zh-TW": "受保護的狀態無法寫入。"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"code": "operation-canceled-by-user",
|
|
407
|
+
"kind": "reason",
|
|
408
|
+
"retryable": false,
|
|
409
|
+
"httpStatus": 409,
|
|
410
|
+
"en": "The owner canceled the operation.",
|
|
411
|
+
"zh-TW": "擁有者取消了操作。"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"code": "operation-deadline-exceeded",
|
|
415
|
+
"kind": "reason",
|
|
416
|
+
"retryable": true,
|
|
417
|
+
"httpStatus": 504,
|
|
418
|
+
"en": "The operation ran past its deadline.",
|
|
419
|
+
"zh-TW": "操作超過期限。"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"code": "EXECUTOR_UNAVAILABLE",
|
|
423
|
+
"kind": "client",
|
|
424
|
+
"retryable": true,
|
|
425
|
+
"httpStatus": 503,
|
|
426
|
+
"en": "The client could not connect to the executor socket.",
|
|
427
|
+
"zh-TW": "用戶端無法連到 executor socket。"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"code": "EXECUTOR_TIMEOUT",
|
|
431
|
+
"kind": "client",
|
|
432
|
+
"retryable": true,
|
|
433
|
+
"httpStatus": 504,
|
|
434
|
+
"en": "The executor did not answer in time.",
|
|
435
|
+
"zh-TW": "executor 未及時回應。"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"code": "EXECUTOR_TOO_LARGE",
|
|
439
|
+
"kind": "client",
|
|
440
|
+
"retryable": false,
|
|
441
|
+
"httpStatus": 413,
|
|
442
|
+
"en": "The request or reply is larger than 64 KiB.",
|
|
443
|
+
"zh-TW": "請求或回應超過 64 KiB。"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"code": "EXECUTOR_PROTOCOL",
|
|
447
|
+
"kind": "client",
|
|
448
|
+
"retryable": false,
|
|
449
|
+
"httpStatus": 502,
|
|
450
|
+
"en": "The executor reply is not a valid v1 response.",
|
|
451
|
+
"zh-TW": "executor 的回應不是有效的 v1 回應。"
|
|
452
|
+
}
|
|
453
|
+
]
|
|
454
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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/delegate.audit.json",
|
|
4
|
+
"title": "delegate.audit",
|
|
5
|
+
"description": "Administrator: read the audit log.",
|
|
6
|
+
"since": "0.9.0",
|
|
7
|
+
"auth": "required",
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {},
|
|
10
|
+
"additionalProperties": false
|
|
11
|
+
}
|