@synopackageland/cli 0.42.0 → 0.42.2
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/CHANGELOG.md +17 -1
- package/README.md +1 -1
- package/assets/go/route-audit/main.go +23 -3
- package/dist/cli.js +2 -0
- package/dist/error-registry.js +1 -1
- package/dist/runtime/sdk-source.d.ts +1 -1
- package/dist/runtime/sdk-source.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.42.2 (2026-11-01)
|
|
4
|
+
|
|
5
|
+
- Pin SDK 0.42.0 for CLI-owned runtime defaults (daemon controllers, Compose
|
|
6
|
+
planning and installer context); it reuses the executor/v0.39.0 inventory.
|
|
7
|
+
Explicit App SDK declarations still take precedence; templates stay ~0.37.0.
|
|
8
|
+
- The route audit accepts `api.WithObserver` (SDK 0.42.0) around the CGI root,
|
|
9
|
+
like `api.WithRequestDeadline`; only its handler argument is followed, and a
|
|
10
|
+
private handler wrapped in it is still refused.
|
|
11
|
+
- The route audit no longer resolves the selected name of a selector
|
|
12
|
+
(`pkg.Config`, `value.Method`) as a name of the App's own package, which
|
|
13
|
+
made an App type and all its methods look reachable from a private handler.
|
|
14
|
+
|
|
15
|
+
## 0.42.1 (2026-11-01)
|
|
16
|
+
|
|
17
|
+
- Add `--version` and `-V` to report the installed CLI version.
|
|
18
|
+
- Register the installed-App approval diagnostic as `CTL_APP_NEEDS_APPROVAL`
|
|
19
|
+
with the App-scoped approve command, replacing the retired error entry.
|
|
4
20
|
|
|
5
21
|
## 0.42.0 (2026-11-01)
|
|
6
22
|
|
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ alongside npm lockfiles. Do not disable checksum verification for public SDK
|
|
|
89
89
|
packages. Private mirrors can use explicitly configured Go authentication and
|
|
90
90
|
checksum settings; a failed fetch reports `SDK_DOWNLOAD_FAILED`.
|
|
91
91
|
|
|
92
|
-
The CLI pins SDK 0.
|
|
92
|
+
The CLI pins SDK 0.42.0 for its daemon controllers, Compose planning and installer
|
|
93
93
|
context. Explicit App SDK declarations take precedence. Templates use ~0.37.0
|
|
94
94
|
and retain their own scaffold SDK pins; none declare daemon ingress.
|
|
95
95
|
Every App method must be declared in the permissions table. Dynamic names and
|
|
@@ -118,6 +118,21 @@ type source struct {
|
|
|
118
118
|
file *ast.File
|
|
119
119
|
path, pkg string
|
|
120
120
|
imports map[string]string
|
|
121
|
+
// selected are the Sel identifiers of selector expressions (pkg.Name,
|
|
122
|
+
// value.Field, value.Method). They name nothing in this package: the
|
|
123
|
+
// selector itself is resolved through imports, never as a local name.
|
|
124
|
+
selected map[*ast.Ident]bool
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
func selectedNames(file *ast.File) map[*ast.Ident]bool {
|
|
128
|
+
out := map[*ast.Ident]bool{}
|
|
129
|
+
ast.Inspect(file, func(n ast.Node) bool {
|
|
130
|
+
if sel, ok := n.(*ast.SelectorExpr); ok {
|
|
131
|
+
out[sel.Sel] = true
|
|
132
|
+
}
|
|
133
|
+
return true
|
|
134
|
+
})
|
|
135
|
+
return out
|
|
121
136
|
}
|
|
122
137
|
|
|
123
138
|
// Follow the handler argument through local declarations and factories. A
|
|
@@ -176,6 +191,9 @@ func boundaryHandlers(sources []source) map[ast.Node]bool {
|
|
|
176
191
|
key := ""
|
|
177
192
|
switch v := n.(type) {
|
|
178
193
|
case *ast.Ident:
|
|
194
|
+
if s.selected[v] {
|
|
195
|
+
return true
|
|
196
|
+
}
|
|
179
197
|
key = s.pkg + "." + v.Name
|
|
180
198
|
if v.Obj != nil {
|
|
181
199
|
// A parameter or receiver carries a value built elsewhere.
|
|
@@ -242,7 +260,9 @@ func reusesBoundary(expr ast.Node, owner source, sources []source, safe map[ast.
|
|
|
242
260
|
switch sel.Sel.Name {
|
|
243
261
|
case "NewServerWithPermissions":
|
|
244
262
|
return false
|
|
245
|
-
case "WithRequestDeadline", "WithDescription":
|
|
263
|
+
case "WithRequestDeadline", "WithDescription", "WithObserver":
|
|
264
|
+
// WithObserver's callback runs after the SDK answered; only its
|
|
265
|
+
// handler argument can serve the request.
|
|
246
266
|
return len(call.Args) > 0 && reusesBoundary(call.Args[0], owner, sources, safe, seen)
|
|
247
267
|
}
|
|
248
268
|
}
|
|
@@ -298,7 +318,7 @@ func reusesBoundary(expr ast.Node, owner source, sources []source, safe map[ast.
|
|
|
298
318
|
}
|
|
299
319
|
}
|
|
300
320
|
return false
|
|
301
|
-
} else {
|
|
321
|
+
} else if !owner.selected[id] {
|
|
302
322
|
targetPackage, targetName = owner.pkg, id.Name
|
|
303
323
|
}
|
|
304
324
|
}
|
|
@@ -502,7 +522,7 @@ func main() {
|
|
|
502
522
|
}
|
|
503
523
|
imports[alias] = module
|
|
504
524
|
}
|
|
505
|
-
sources = append(sources, source{file, path, pkg, imports})
|
|
525
|
+
sources = append(sources, source{file, path, pkg, imports, selectedNames(file)})
|
|
506
526
|
}
|
|
507
527
|
safe := boundaryHandlers(sources)
|
|
508
528
|
for _, src := range sources {
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { nasFlags, withNasOptions } from './nas/options.js';
|
|
2
2
|
import { upstreamRepository, upstreamMaintainer } from './upstream-attribution.js';
|
|
3
3
|
import { Command, CommanderError } from "commander";
|
|
4
|
+
import { CLI_VERSION } from "./cli-version.js";
|
|
4
5
|
import { existsSync, readFileSync, renameSync, statSync } from "node:fs";
|
|
5
6
|
import { createHash } from "node:crypto";
|
|
6
7
|
import { basename, resolve, dirname, join } from "node:path";
|
|
@@ -322,6 +323,7 @@ async function runCliWithin(argv) {
|
|
|
322
323
|
const program = new Command()
|
|
323
324
|
.name("synopkgland")
|
|
324
325
|
.description("Syno Package Land Developer Kit CLI")
|
|
326
|
+
.version(CLI_VERSION)
|
|
325
327
|
.option("--project <dir>", "App project root")
|
|
326
328
|
.option("--strict-tls", "Verify NAS CA, hostname, validity and recorded certificate")
|
|
327
329
|
.option("--ca <file>", "Verify NAS HTTPS with a PEM CA file")
|
package/dist/error-registry.js
CHANGED
|
@@ -33,7 +33,7 @@ export const ERROR_REGISTRY = {
|
|
|
33
33
|
INIT_HEALTH_INVALID: { code: "INIT_HEALTH_INVALID", description: "The Compose readiness selection is invalid.", suggestion: "Supply both --health-path and --health-status with the actual endpoint and expected 2xx response; redirects are not followed." },
|
|
34
34
|
INIT_UPSTREAM_IMAGE_REQUIRED: { code: "INIT_UPSTREAM_IMAGE_REQUIRED", description: "The official upstream image repository was not selected.", suggestion: "Use init --upstream-fork --upstream-image <official-repository> for Compose." },
|
|
35
35
|
INIT_UPSTREAM_IMAGE_INVALID: { code: "INIT_UPSTREAM_IMAGE_INVALID", description: "The upstream image repository is invalid.", suggestion: "Supply the official repository without a tag or digest; upgrade.sh selects the matching release and resolves its digest." },
|
|
36
|
-
|
|
36
|
+
CTL_APP_NEEDS_APPROVAL: { "code": "CTL_APP_NEEDS_APPROVAL", "description": "The installed App needs approval or re-approval.", "suggestion": "Run synopkgland ctl list --app <package-id> --approve-installed --host <host>." },
|
|
37
37
|
COMPOSE_HEALTH_REQUIRED: { code: "COMPOSE_HEALTH_REQUIRED", description: "Compose web readiness was not selected.", suggestion: "Set compose.web.health.path and expected 2xx status for the actual App; redirects are not followed." },
|
|
38
38
|
CTL_UNSUPPORTED_BACKEND: { "code": "CTL_UNSUPPORTED_BACKEND", "description": "Automatic descriptions require a native SDK backend.", "suggestion": "Disable ctl for binary/Compose wrappers or implement the public contract separately." },
|
|
39
39
|
CTL_DESCRIBE_REQUIRED: { "code": "CTL_DESCRIBE_REQUIRED", "description": "The Go backend has no build-only registry exporter.", "suggestion": "Update the native template and implement --describe using api.DescribeRoutes." },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { goPrivateCovers } from './go-env.js';
|
|
2
2
|
import { type ExecutorManifest } from './sdk-executor-manifest.js';
|
|
3
3
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
4
|
-
export declare const DEFAULT_SDK_VERSION = "0.
|
|
4
|
+
export declare const DEFAULT_SDK_VERSION = "0.42.0";
|
|
5
5
|
export declare const SDK_PACKAGE = "@synopackageland/sdk";
|
|
6
6
|
export declare const SDK_MODULE = "github.com/synopackageland/syno-pkg-land-sdk";
|
|
7
7
|
export declare const EXECUTOR_MODULE = "github.com/synopackageland/syno-pkg-land-sdk/executor";
|
|
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
|
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { readExecutorManifest, predatesExecutorManifest } from './sdk-executor-manifest.js';
|
|
7
7
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
8
|
-
export const DEFAULT_SDK_VERSION = '0.
|
|
8
|
+
export const DEFAULT_SDK_VERSION = '0.42.0';
|
|
9
9
|
export const SDK_PACKAGE = '@synopackageland/sdk';
|
|
10
10
|
export const SDK_MODULE = 'github.com/synopackageland/syno-pkg-land-sdk';
|
|
11
11
|
export const EXECUTOR_MODULE = `${SDK_MODULE}/executor`;
|