@synopackageland/cli 0.3.10 → 0.4.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 +57 -9
- package/dist/bin.js +1 -2
- package/dist/build-spk/generator.d.ts +0 -3
- package/dist/build-spk/generator.js +138 -287
- package/dist/build-spk/native-lifecycle.js +0 -3
- package/dist/build-spk/native-payload.js +0 -1
- package/dist/build-spk/notices.d.ts +5 -0
- package/dist/build-spk/notices.js +60 -0
- package/dist/cli.js +178 -151
- package/dist/compose/analyze.d.ts +1 -2
- package/dist/compose/analyze.js +5 -48
- package/dist/contract/unsupported-types.d.ts +10 -0
- package/dist/contract/unsupported-types.js +49 -0
- package/dist/contract/validate.js +25 -2
- package/dist/contract/web-launch.js +0 -2
- package/dist/deploy/deploy.d.ts +1 -4
- package/dist/deploy/deploy.js +45 -156
- package/dist/deploy/homes-values.js +1 -1
- package/dist/deploy/plan.d.ts +18 -0
- package/dist/deploy/plan.js +54 -0
- package/dist/deploy/spk-version.d.ts +2 -14
- package/dist/deploy/spk-version.js +25 -111
- package/dist/dev.d.ts +1 -3
- package/dist/dev.js +14 -28
- package/dist/error-registry.js +830 -862
- package/dist/host/dsm-client.js +12 -272
- package/dist/host/dsm-port-profile.d.ts +0 -1
- package/dist/host/dsm-port-profile.js +0 -2
- package/dist/host/types.d.ts +1 -83
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -6
- package/dist/info.d.ts +0 -1
- package/dist/info.js +3 -10
- package/dist/init.d.ts +15 -1
- package/dist/init.js +128 -12
- package/dist/log.js +2 -3
- package/dist/native/validate.js +0 -1
- package/dist/standalone/binary.d.ts +9 -0
- package/dist/standalone/binary.js +67 -0
- package/dist/standalone/build.d.ts +25 -0
- package/dist/standalone/build.js +110 -0
- package/dist/standalone/daemon.d.ts +23 -0
- package/dist/standalone/daemon.js +114 -0
- package/dist/standalone/dsm-window.d.ts +26 -0
- package/dist/standalone/dsm-window.js +291 -0
- package/dist/standalone/helper-inventory.d.ts +16 -0
- package/dist/standalone/helper-inventory.js +2 -0
- package/dist/standalone/helper.d.ts +21 -0
- package/dist/standalone/helper.js +105 -0
- package/dist/standalone/host-adapter.d.ts +5 -0
- package/dist/standalone/host-adapter.js +148 -0
- package/dist/standalone/host-platform.d.ts +13 -0
- package/dist/standalone/host-platform.js +42 -0
- package/dist/standalone/host-types.d.ts +49 -0
- package/dist/standalone/host-types.js +1 -0
- package/dist/standalone/i18n.d.ts +28 -0
- package/dist/standalone/i18n.js +161 -0
- package/dist/standalone/inspect-helper.d.ts +6 -0
- package/dist/standalone/inspect-helper.js +88 -0
- package/dist/standalone/inspect-spk.d.ts +23 -0
- package/dist/standalone/inspect-spk.js +209 -0
- package/dist/standalone/lifecycle-helper.d.ts +2 -0
- package/dist/standalone/lifecycle-helper.js +12 -0
- package/dist/standalone/lifecycle.d.ts +3 -0
- package/dist/standalone/lifecycle.js +53 -0
- package/dist/standalone/manifest.d.ts +73 -0
- package/dist/standalone/manifest.js +279 -0
- package/dist/standalone/reopen-events.d.ts +2 -0
- package/dist/standalone/reopen-events.js +28 -0
- package/dist/standalone/root-messages.d.ts +7 -0
- package/dist/standalone/root-messages.js +259 -0
- package/dist/standalone/root-ops.d.ts +42 -0
- package/dist/standalone/root-ops.js +101 -0
- package/dist/standalone/root-window.d.ts +36 -0
- package/dist/standalone/root-window.js +302 -0
- package/dist/standalone/spk.d.ts +23 -0
- package/dist/standalone/spk.js +192 -0
- package/dist/template-paths.d.ts +2 -0
- package/dist/template-paths.js +9 -0
- package/dist/templates/_daemon/fixture_linux_test.go +15 -0
- package/dist/templates/_daemon/fixture_other_test.go +7 -0
- package/dist/templates/_daemon/go.mod +3 -0
- package/dist/templates/_daemon/main.go +608 -0
- package/dist/templates/_daemon/main_test.go +242 -0
- package/dist/templates/_daemon/process_linux.go +55 -0
- package/dist/templates/_daemon/process_linux_test.go +161 -0
- package/dist/templates/_daemon/process_other.go +14 -0
- package/dist/templates/_daemon/testdata/child.go +41 -0
- package/dist/templates/_shared/GO-LICENSE +27 -0
- package/dist/templates/_shared/GO-PATENTS +22 -0
- package/dist/templates/_shared/LICENSES/TEMPLATE.txt +21 -0
- package/dist/templates/_shared/notice-overrides/index.json +14 -0
- package/dist/templates/_shared/notice-overrides/utils-0.4.2-LICENSE +21 -0
- package/dist/templates/_shared/notice-overrides/utils-0.5.0-LICENSE +21 -0
- package/dist/templates/_shared/third-party-notices.mjs +51 -0
- package/dist/templates/binary/synology-app.yaml +7 -0
- package/dist/templates/hello-files/compose.yaml +0 -1
- package/dist/templates/hello-web/compose.yaml +13 -10
- package/dist/templates/hello-web/html/app.js +1 -23
- package/dist/templates/hello-web/html/index.html +1 -3
- package/dist/templates/hello-web-page/compose.yaml +13 -10
- package/dist/templates/hello-web-page/html/app.js +1 -23
- package/dist/templates/hello-web-page/html/index.html +1 -3
- package/dist/templates/native-go/README.md +324 -0
- package/dist/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +59 -0
- package/dist/templates/native-go/backend/cmd/app/main.go +49 -0
- package/dist/templates/native-go/backend/cmd/dsm-readonly-probe/main_linux.go +46 -0
- package/dist/templates/native-go/backend/cmd/helper/main.go +38 -0
- package/dist/templates/native-go/backend/go.mod +7 -0
- package/dist/templates/native-go/backend/go.sum +4 -0
- package/dist/templates/native-go/backend/internal/api/binary.go +154 -0
- package/dist/templates/native-go/backend/internal/api/binary_test.go +165 -0
- package/dist/templates/native-go/backend/internal/api/errors.go +33 -0
- package/dist/templates/native-go/backend/internal/api/registry.go +104 -0
- package/dist/templates/native-go/backend/internal/api/registry_test.go +329 -0
- package/dist/templates/native-go/backend/internal/api/server.go +159 -0
- package/dist/templates/native-go/backend/internal/app/nas_cgi_artifact_test.go +121 -0
- package/dist/templates/native-go/backend/internal/app/nas_refusal_test.go +46 -0
- package/dist/templates/native-go/backend/internal/app/root_none.go +9 -0
- package/dist/templates/native-go/backend/internal/app/routes.go +138 -0
- package/dist/templates/native-go/backend/internal/app/routes_test.go +172 -0
- package/dist/templates/native-go/backend/internal/dsm/auth.go +118 -0
- package/dist/templates/native-go/backend/internal/dsm/auth_test.go +139 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/collector_linux.go +335 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/collector_linux_test.go +41 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/protocol.go +179 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/protocol_test.go +29 -0
- package/dist/templates/native-go/backend/internal/helper/cohort.go +393 -0
- package/dist/templates/native-go/backend/internal/helper/cohort_publication.go +18 -0
- package/dist/templates/native-go/backend/internal/helper/cohort_publication_test.go +105 -0
- package/dist/templates/native-go/backend/internal/helper/cohort_test.go +372 -0
- package/dist/templates/native-go/backend/internal/helper/control.go +424 -0
- package/dist/templates/native-go/backend/internal/helper/control_test.go +250 -0
- package/dist/templates/native-go/backend/internal/helper/data_contract.go +242 -0
- package/dist/templates/native-go/backend/internal/helper/data_contract_test.go +51 -0
- package/dist/templates/native-go/backend/internal/helper/data_decode.go +184 -0
- package/dist/templates/native-go/backend/internal/helper/data_decode_pointer_test.go +30 -0
- package/dist/templates/native-go/backend/internal/helper/data_protocol.go +416 -0
- package/dist/templates/native-go/backend/internal/helper/data_protocol_test.go +449 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_linux.go +139 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_linux_test.go +121 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux.go +95 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux_test.go +56 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_bridge_linux.go +144 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_bridge_linux_test.go +89 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_home_linux.go +107 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_home_linux_test.go +82 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_probe_transport_linux.go +151 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_probe_transport_linux_test.go +66 -0
- package/dist/templates/native-go/backend/internal/helper/grant_authority.go +516 -0
- package/dist/templates/native-go/backend/internal/helper/grant_authority_contract.go +88 -0
- package/dist/templates/native-go/backend/internal/helper/grant_authority_test.go +510 -0
- package/dist/templates/native-go/backend/internal/helper/grant_cohort.go +389 -0
- package/dist/templates/native-go/backend/internal/helper/grant_cohort_test.go +239 -0
- package/dist/templates/native-go/backend/internal/helper/grant_delivery.go +49 -0
- package/dist/templates/native-go/backend/internal/helper/grant_delivery_methods.go +273 -0
- package/dist/templates/native-go/backend/internal/helper/grant_delivery_test.go +322 -0
- package/dist/templates/native-go/backend/internal/helper/grant_operation_contract.go +47 -0
- package/dist/templates/native-go/backend/internal/helper/grant_readonly_test.go +180 -0
- package/dist/templates/native-go/backend/internal/helper/grant_repository_linux.go +415 -0
- package/dist/templates/native-go/backend/internal/helper/grant_repository_linux_test.go +468 -0
- package/dist/templates/native-go/backend/internal/helper/grant_rpc.go +147 -0
- package/dist/templates/native-go/backend/internal/helper/grant_rpc_test.go +51 -0
- package/dist/templates/native-go/backend/internal/helper/grant_snapshot.go +75 -0
- package/dist/templates/native-go/backend/internal/helper/grant_supervisor_linux.go +134 -0
- package/dist/templates/native-go/backend/internal/helper/grant_supervisor_linux_test.go +254 -0
- package/dist/templates/native-go/backend/internal/helper/lease.go +112 -0
- package/dist/templates/native-go/backend/internal/helper/lease_linux.go +44 -0
- package/dist/templates/native-go/backend/internal/helper/lease_other.go +8 -0
- package/dist/templates/native-go/backend/internal/helper/lifecycle.go +234 -0
- package/dist/templates/native-go/backend/internal/helper/lifecycle_test.go +473 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot.go +284 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot_repository_linux.go +74 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot_repository_linux_test.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot_test.go +210 -0
- package/dist/templates/native-go/backend/internal/helper/nas_shipped_refusal_linux_test.go +97 -0
- package/dist/templates/native-go/backend/internal/helper/native_discovery.go +79 -0
- package/dist/templates/native-go/backend/internal/helper/native_identity.go +89 -0
- package/dist/templates/native-go/backend/internal/helper/native_provider.go +159 -0
- package/dist/templates/native-go/backend/internal/helper/native_provider_test.go +421 -0
- package/dist/templates/native-go/backend/internal/helper/observation.go +204 -0
- package/dist/templates/native-go/backend/internal/helper/observation_health_test.go +115 -0
- package/dist/templates/native-go/backend/internal/helper/observation_reload_budget_test.go +117 -0
- package/dist/templates/native-go/backend/internal/helper/observation_test.go +196 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic.go +109 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_linux.go +76 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_linux_test.go +124 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_test.go +98 -0
- package/dist/templates/native-go/backend/internal/helper/operation_bootstrap_linux.go +193 -0
- package/dist/templates/native-go/backend/internal/helper/operation_credentials_linux.go +56 -0
- package/dist/templates/native-go/backend/internal/helper/operation_linux.go +480 -0
- package/dist/templates/native-go/backend/internal/helper/operation_linux_test.go +528 -0
- package/dist/templates/native-go/backend/internal/helper/peer_linux.go +44 -0
- package/dist/templates/native-go/backend/internal/helper/peer_other.go +7 -0
- package/dist/templates/native-go/backend/internal/helper/process_linux.go +177 -0
- package/dist/templates/native-go/backend/internal/helper/process_other.go +5 -0
- package/dist/templates/native-go/backend/internal/helper/publication_test.go +178 -0
- package/dist/templates/native-go/backend/internal/helper/read_stream_cohort_linux_test.go +156 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer_linux.go +109 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer_linux_test.go +118 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer_test.go +177 -0
- package/dist/templates/native-go/backend/internal/helper/readonly.go +105 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_admission.go +85 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_cohort_linux_test.go +253 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_linux_test.go +378 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_mount_linux.go +65 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_mount_proxy_linux.go +113 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_operations_linux.go +168 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_resolver_linux.go +241 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_test.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_identity.go +252 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_identity_contract.go +105 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_identity_test.go +406 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_invalidation.go +200 -0
- package/dist/templates/native-go/backend/internal/helper/repair.go +132 -0
- package/dist/templates/native-go/backend/internal/helper/repair_test.go +271 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_actor_acl_linux_test.go +303 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_actor_fixture_linux_test.go +184 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_actor_races_linux_test.go +231 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_fixture_contract_linux_test.go +18 -0
- package/dist/templates/native-go/backend/internal/helper/server_linux.go +124 -0
- package/dist/templates/native-go/backend/internal/helper/status.go +334 -0
- package/dist/templates/native-go/backend/internal/helper/status_test.go +288 -0
- package/dist/templates/native-go/backend/internal/helper/supervision.go +107 -0
- package/dist/templates/native-go/backend/internal/helper/supervision_test.go +124 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_frame.go +76 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_frame_linux_test.go +69 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_frame_test.go +107 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_linux.go +363 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_linux_test.go +913 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_socket_eof_test.go +74 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_socket_test.go +45 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/create.json +23 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/frames.json +67 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/grant-store.json +52 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/intent.json +20 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/list.json +20 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/publish.json +20 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/read.json +22 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/stat.json +22 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/write-stream.json +22 -0
- package/dist/templates/native-go/backend/internal/helper/unit_connection.go +75 -0
- package/dist/templates/native-go/backend/internal/helper/unit_connection_linux_test.go +135 -0
- package/dist/templates/native-go/backend/internal/helper/unit_connection_test.go +133 -0
- package/dist/templates/native-go/backend/internal/helper/unit_frame_test.go +32 -0
- package/dist/templates/native-go/backend/internal/helper/unit_linux.go +364 -0
- package/dist/templates/native-go/backend/internal/helper/unit_linux_test.go +46 -0
- package/dist/templates/native-go/backend/internal/helper/unit_mechanisms_linux_test.go +217 -0
- package/dist/templates/native-go/backend/internal/helper/unit_padding_linux_test.go +178 -0
- package/dist/templates/native-go/backend/internal/helper/unit_query_linux.go +111 -0
- package/dist/templates/native-go/backend/internal/helper/unit_reload_linux_test.go +372 -0
- package/dist/templates/native-go/backend/internal/helper/unit_reload_sequence_linux_test.go +232 -0
- package/dist/templates/native-go/backend/internal/helper/write.go +77 -0
- package/dist/templates/native-go/backend/internal/helper/write_admission.go +260 -0
- package/dist/templates/native-go/backend/internal/helper/write_admission_test.go +135 -0
- package/dist/templates/native-go/backend/internal/helper/write_cohort_linux_test.go +218 -0
- package/dist/templates/native-go/backend/internal/helper/write_files_linux.go +202 -0
- package/dist/templates/native-go/backend/internal/helper/write_files_linux_test.go +199 -0
- package/dist/templates/native-go/backend/internal/helper/write_intent_linux.go +116 -0
- package/dist/templates/native-go/backend/internal/helper/write_intent_linux_test.go +74 -0
- package/dist/templates/native-go/backend/internal/helper/write_operation_linux.go +245 -0
- package/dist/templates/native-go/backend/internal/helper/write_test.go +53 -0
- package/dist/templates/native-go/dsm-package.yaml +58 -0
- package/dist/templates/native-go/gitignore +1 -0
- package/dist/templates/native-go/i18n/glossary.json +662 -0
- package/dist/templates/native-go/i18n/messages/de.json +28 -0
- package/dist/templates/native-go/i18n/messages/en.json +28 -0
- package/dist/templates/native-go/i18n/messages/es.json +28 -0
- package/dist/templates/native-go/i18n/messages/fr.json +28 -0
- package/dist/templates/native-go/i18n/messages/it.json +28 -0
- package/dist/templates/native-go/i18n/messages/ja.json +28 -0
- package/dist/templates/native-go/i18n/messages/ko.json +28 -0
- package/dist/templates/native-go/i18n/messages/zh-CN.json +28 -0
- package/dist/templates/native-go/i18n/messages/zh-TW.json +28 -0
- package/dist/templates/native-go/ui/app.css +35 -0
- package/dist/templates/native-go/ui/app.js +101 -0
- package/dist/templates/native-go-better-auth/backend/internal/app/identity.go +208 -0
- package/dist/templates/native-go-better-auth/backend/internal/app/identity_test.go +113 -0
- package/dist/templates/native-go-better-auth/node/app.mjs +72 -0
- package/dist/templates/native-go-better-auth/node/build.mjs +4 -0
- package/dist/templates/native-go-better-auth/node/package-lock.json +862 -0
- package/dist/templates/native-go-better-auth/node/package.json +1 -0
- package/dist/templates/native-go-better-auth/node/test/auth.test.mjs +31 -0
- package/dist/templates/native-go-integration/backend/internal/app/identity_none.go +6 -0
- package/dist/templates/native-go-integration/backend/internal/app/personal.go +203 -0
- package/dist/templates/native-go-integration/backend/internal/app/personal_test.go +119 -0
- package/dist/templates/native-go-root/backend/internal/app/root.go +107 -0
- package/dist/templates/native-go-root/backend/internal/app/root_test.go +124 -0
- package/dist/templates/native-go-root/root/whoami.sh +6 -0
- package/dist/templates/native-go-vue/README.md +224 -0
- package/dist/templates/native-go-vue/frontend/DESIGN.md +78 -0
- package/dist/templates/native-go-vue/frontend/package-lock.json +2410 -0
- package/dist/templates/native-go-vue/frontend/package.json +6 -0
- package/dist/templates/native-go-vue/frontend/src/App.vue +159 -0
- package/dist/templates/native-go-vue/frontend/src/context.ts +56 -0
- package/dist/templates/native-go-vue/frontend/src/main.ts +29 -0
- package/dist/templates/native-go-vue/frontend/src/nas/NasGrantSettings.vue +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/NasPathPicker.vue +106 -0
- package/dist/templates/native-go-vue/frontend/src/nas/NasUnavailable.vue +20 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/de.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/en.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/es.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/fr.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/it.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/ja.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/ko.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/zh-CN.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/zh-TW.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n.ts +38 -0
- package/dist/templates/native-go-vue/frontend/src/nas/mock-provider.ts +119 -0
- package/dist/templates/native-go-vue/frontend/src/nas/provider.ts +59 -0
- package/dist/templates/native-go-vue/frontend/src/nas/use-request.ts +27 -0
- package/dist/templates/native-go-vue/frontend/src/style.css +31 -0
- package/dist/templates/native-go-vue/frontend/test/apps.test.ts +190 -0
- package/dist/templates/native-go-vue/frontend/test/nas-provider.test.ts +81 -0
- package/dist/templates/native-go-vue/frontend/test/nas-request.test.ts +21 -0
- package/dist/templates/native-go-vue/frontend/test/nas-ui.test.ts +261 -0
- package/dist/templates/native-go-vue/frontend/tsconfig.json +1 -0
- package/dist/templates/native-go-vue/frontend/vite.config.ts +10 -0
- package/dist/templates/native-go-vue/gitignore +2 -0
- package/dist/types.d.ts +1 -1
- package/dist/validate.js +11 -7
- package/package.json +5 -8
- package/schema/synology-app.schema.json +36 -37
- package/skills/SKILL.md +4 -48
- package/skills/reference/create.md +11 -83
- package/skills/reference/deploy.md +7 -78
- package/skills/reference/diagnose.md +4 -101
- package/skills/reference/files.md +5 -41
- package/skills/reference/identity.md +3 -29
- package/skills/reference/wrap.md +0 -2
- package/templates/_daemon/fixture_linux_test.go +15 -0
- package/templates/_daemon/fixture_other_test.go +7 -0
- package/templates/_daemon/go.mod +3 -0
- package/templates/_daemon/main.go +608 -0
- package/templates/_daemon/main_test.go +242 -0
- package/templates/_daemon/process_linux.go +55 -0
- package/templates/_daemon/process_linux_test.go +161 -0
- package/templates/_daemon/process_other.go +14 -0
- package/templates/_daemon/testdata/child.go +41 -0
- package/templates/_shared/GO-LICENSE +27 -0
- package/templates/_shared/GO-PATENTS +22 -0
- package/templates/_shared/LICENSES/TEMPLATE.txt +21 -0
- package/templates/_shared/notice-overrides/index.json +14 -0
- package/templates/_shared/notice-overrides/utils-0.4.2-LICENSE +21 -0
- package/templates/_shared/notice-overrides/utils-0.5.0-LICENSE +21 -0
- package/templates/_shared/third-party-notices.mjs +51 -0
- package/templates/binary/synology-app.yaml +7 -0
- package/templates/hello-files/compose.yaml +0 -1
- package/templates/hello-web/compose.yaml +13 -10
- package/templates/hello-web/html/app.js +1 -23
- package/templates/hello-web/html/index.html +1 -3
- package/templates/hello-web-page/compose.yaml +13 -10
- package/templates/hello-web-page/html/app.js +1 -23
- package/templates/hello-web-page/html/index.html +1 -3
- package/templates/native-go/README.md +324 -0
- package/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +59 -0
- package/templates/native-go/backend/cmd/app/main.go +49 -0
- package/templates/native-go/backend/cmd/dsm-readonly-probe/main_linux.go +46 -0
- package/templates/native-go/backend/cmd/helper/main.go +38 -0
- package/templates/native-go/backend/go.mod +7 -0
- package/templates/native-go/backend/go.sum +4 -0
- package/templates/native-go/backend/internal/api/binary.go +154 -0
- package/templates/native-go/backend/internal/api/binary_test.go +165 -0
- package/templates/native-go/backend/internal/api/errors.go +33 -0
- package/templates/native-go/backend/internal/api/registry.go +104 -0
- package/templates/native-go/backend/internal/api/registry_test.go +329 -0
- package/templates/native-go/backend/internal/api/server.go +159 -0
- package/templates/native-go/backend/internal/app/nas_cgi_artifact_test.go +121 -0
- package/templates/native-go/backend/internal/app/nas_refusal_test.go +46 -0
- package/templates/native-go/backend/internal/app/root_none.go +9 -0
- package/templates/native-go/backend/internal/app/routes.go +138 -0
- package/templates/native-go/backend/internal/app/routes_test.go +172 -0
- package/templates/native-go/backend/internal/dsm/auth.go +118 -0
- package/templates/native-go/backend/internal/dsm/auth_test.go +139 -0
- package/templates/native-go/backend/internal/dsmprobe/collector_linux.go +335 -0
- package/templates/native-go/backend/internal/dsmprobe/collector_linux_test.go +41 -0
- package/templates/native-go/backend/internal/dsmprobe/protocol.go +179 -0
- package/templates/native-go/backend/internal/dsmprobe/protocol_test.go +29 -0
- package/templates/native-go/backend/internal/helper/cohort.go +393 -0
- package/templates/native-go/backend/internal/helper/cohort_publication.go +18 -0
- package/templates/native-go/backend/internal/helper/cohort_publication_test.go +105 -0
- package/templates/native-go/backend/internal/helper/cohort_test.go +372 -0
- package/templates/native-go/backend/internal/helper/control.go +424 -0
- package/templates/native-go/backend/internal/helper/control_test.go +250 -0
- package/templates/native-go/backend/internal/helper/data_contract.go +242 -0
- package/templates/native-go/backend/internal/helper/data_contract_test.go +51 -0
- package/templates/native-go/backend/internal/helper/data_decode.go +184 -0
- package/templates/native-go/backend/internal/helper/data_decode_pointer_test.go +30 -0
- package/templates/native-go/backend/internal/helper/data_protocol.go +416 -0
- package/templates/native-go/backend/internal/helper/data_protocol_test.go +449 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_linux.go +139 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_linux_test.go +121 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux.go +95 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux_test.go +56 -0
- package/templates/native-go/backend/internal/helper/dsm_bridge_linux.go +144 -0
- package/templates/native-go/backend/internal/helper/dsm_bridge_linux_test.go +89 -0
- package/templates/native-go/backend/internal/helper/dsm_home_linux.go +107 -0
- package/templates/native-go/backend/internal/helper/dsm_home_linux_test.go +82 -0
- package/templates/native-go/backend/internal/helper/dsm_probe_transport_linux.go +151 -0
- package/templates/native-go/backend/internal/helper/dsm_probe_transport_linux_test.go +66 -0
- package/templates/native-go/backend/internal/helper/grant_authority.go +516 -0
- package/templates/native-go/backend/internal/helper/grant_authority_contract.go +88 -0
- package/templates/native-go/backend/internal/helper/grant_authority_test.go +510 -0
- package/templates/native-go/backend/internal/helper/grant_cohort.go +389 -0
- package/templates/native-go/backend/internal/helper/grant_cohort_test.go +239 -0
- package/templates/native-go/backend/internal/helper/grant_delivery.go +49 -0
- package/templates/native-go/backend/internal/helper/grant_delivery_methods.go +273 -0
- package/templates/native-go/backend/internal/helper/grant_delivery_test.go +322 -0
- package/templates/native-go/backend/internal/helper/grant_operation_contract.go +47 -0
- package/templates/native-go/backend/internal/helper/grant_readonly_test.go +180 -0
- package/templates/native-go/backend/internal/helper/grant_repository_linux.go +415 -0
- package/templates/native-go/backend/internal/helper/grant_repository_linux_test.go +468 -0
- package/templates/native-go/backend/internal/helper/grant_rpc.go +147 -0
- package/templates/native-go/backend/internal/helper/grant_rpc_test.go +51 -0
- package/templates/native-go/backend/internal/helper/grant_snapshot.go +75 -0
- package/templates/native-go/backend/internal/helper/grant_supervisor_linux.go +134 -0
- package/templates/native-go/backend/internal/helper/grant_supervisor_linux_test.go +254 -0
- package/templates/native-go/backend/internal/helper/lease.go +112 -0
- package/templates/native-go/backend/internal/helper/lease_linux.go +44 -0
- package/templates/native-go/backend/internal/helper/lease_other.go +8 -0
- package/templates/native-go/backend/internal/helper/lifecycle.go +234 -0
- package/templates/native-go/backend/internal/helper/lifecycle_test.go +473 -0
- package/templates/native-go/backend/internal/helper/managed_pilot.go +284 -0
- package/templates/native-go/backend/internal/helper/managed_pilot_repository_linux.go +74 -0
- package/templates/native-go/backend/internal/helper/managed_pilot_repository_linux_test.go +40 -0
- package/templates/native-go/backend/internal/helper/managed_pilot_test.go +210 -0
- package/templates/native-go/backend/internal/helper/nas_shipped_refusal_linux_test.go +97 -0
- package/templates/native-go/backend/internal/helper/native_discovery.go +79 -0
- package/templates/native-go/backend/internal/helper/native_identity.go +89 -0
- package/templates/native-go/backend/internal/helper/native_provider.go +159 -0
- package/templates/native-go/backend/internal/helper/native_provider_test.go +421 -0
- package/templates/native-go/backend/internal/helper/observation.go +204 -0
- package/templates/native-go/backend/internal/helper/observation_health_test.go +115 -0
- package/templates/native-go/backend/internal/helper/observation_reload_budget_test.go +117 -0
- package/templates/native-go/backend/internal/helper/observation_test.go +196 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic.go +109 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_linux.go +76 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_linux_test.go +124 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_test.go +98 -0
- package/templates/native-go/backend/internal/helper/operation_bootstrap_linux.go +193 -0
- package/templates/native-go/backend/internal/helper/operation_credentials_linux.go +56 -0
- package/templates/native-go/backend/internal/helper/operation_linux.go +480 -0
- package/templates/native-go/backend/internal/helper/operation_linux_test.go +528 -0
- package/templates/native-go/backend/internal/helper/peer_linux.go +44 -0
- package/templates/native-go/backend/internal/helper/peer_other.go +7 -0
- package/templates/native-go/backend/internal/helper/process_linux.go +177 -0
- package/templates/native-go/backend/internal/helper/process_other.go +5 -0
- package/templates/native-go/backend/internal/helper/publication_test.go +178 -0
- package/templates/native-go/backend/internal/helper/read_stream_cohort_linux_test.go +156 -0
- package/templates/native-go/backend/internal/helper/read_transfer.go +40 -0
- package/templates/native-go/backend/internal/helper/read_transfer_linux.go +109 -0
- package/templates/native-go/backend/internal/helper/read_transfer_linux_test.go +118 -0
- package/templates/native-go/backend/internal/helper/read_transfer_test.go +177 -0
- package/templates/native-go/backend/internal/helper/readonly.go +105 -0
- package/templates/native-go/backend/internal/helper/readonly_admission.go +85 -0
- package/templates/native-go/backend/internal/helper/readonly_cohort_linux_test.go +253 -0
- package/templates/native-go/backend/internal/helper/readonly_linux_test.go +378 -0
- package/templates/native-go/backend/internal/helper/readonly_mount_linux.go +65 -0
- package/templates/native-go/backend/internal/helper/readonly_mount_proxy_linux.go +113 -0
- package/templates/native-go/backend/internal/helper/readonly_operations_linux.go +168 -0
- package/templates/native-go/backend/internal/helper/readonly_resolver_linux.go +241 -0
- package/templates/native-go/backend/internal/helper/readonly_test.go +40 -0
- package/templates/native-go/backend/internal/helper/relaxed_identity.go +252 -0
- package/templates/native-go/backend/internal/helper/relaxed_identity_contract.go +105 -0
- package/templates/native-go/backend/internal/helper/relaxed_identity_test.go +406 -0
- package/templates/native-go/backend/internal/helper/relaxed_invalidation.go +200 -0
- package/templates/native-go/backend/internal/helper/repair.go +132 -0
- package/templates/native-go/backend/internal/helper/repair_test.go +271 -0
- package/templates/native-go/backend/internal/helper/s1r_actor_acl_linux_test.go +303 -0
- package/templates/native-go/backend/internal/helper/s1r_actor_fixture_linux_test.go +184 -0
- package/templates/native-go/backend/internal/helper/s1r_actor_races_linux_test.go +231 -0
- package/templates/native-go/backend/internal/helper/s1r_fixture_contract_linux_test.go +18 -0
- package/templates/native-go/backend/internal/helper/server_linux.go +124 -0
- package/templates/native-go/backend/internal/helper/status.go +334 -0
- package/templates/native-go/backend/internal/helper/status_test.go +288 -0
- package/templates/native-go/backend/internal/helper/supervision.go +107 -0
- package/templates/native-go/backend/internal/helper/supervision_test.go +124 -0
- package/templates/native-go/backend/internal/helper/supervisor_frame.go +76 -0
- package/templates/native-go/backend/internal/helper/supervisor_frame_linux_test.go +69 -0
- package/templates/native-go/backend/internal/helper/supervisor_frame_test.go +107 -0
- package/templates/native-go/backend/internal/helper/supervisor_linux.go +363 -0
- package/templates/native-go/backend/internal/helper/supervisor_linux_test.go +913 -0
- package/templates/native-go/backend/internal/helper/supervisor_socket_eof_test.go +74 -0
- package/templates/native-go/backend/internal/helper/supervisor_socket_test.go +45 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/create.json +23 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/frames.json +67 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/grant-store.json +52 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/intent.json +20 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/list.json +20 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/publish.json +20 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/read.json +22 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/stat.json +22 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/write-stream.json +22 -0
- package/templates/native-go/backend/internal/helper/unit_connection.go +75 -0
- package/templates/native-go/backend/internal/helper/unit_connection_linux_test.go +135 -0
- package/templates/native-go/backend/internal/helper/unit_connection_test.go +133 -0
- package/templates/native-go/backend/internal/helper/unit_frame_test.go +32 -0
- package/templates/native-go/backend/internal/helper/unit_linux.go +364 -0
- package/templates/native-go/backend/internal/helper/unit_linux_test.go +46 -0
- package/templates/native-go/backend/internal/helper/unit_mechanisms_linux_test.go +217 -0
- package/templates/native-go/backend/internal/helper/unit_padding_linux_test.go +178 -0
- package/templates/native-go/backend/internal/helper/unit_query_linux.go +111 -0
- package/templates/native-go/backend/internal/helper/unit_reload_linux_test.go +372 -0
- package/templates/native-go/backend/internal/helper/unit_reload_sequence_linux_test.go +232 -0
- package/templates/native-go/backend/internal/helper/write.go +77 -0
- package/templates/native-go/backend/internal/helper/write_admission.go +260 -0
- package/templates/native-go/backend/internal/helper/write_admission_test.go +135 -0
- package/templates/native-go/backend/internal/helper/write_cohort_linux_test.go +218 -0
- package/templates/native-go/backend/internal/helper/write_files_linux.go +202 -0
- package/templates/native-go/backend/internal/helper/write_files_linux_test.go +199 -0
- package/templates/native-go/backend/internal/helper/write_intent_linux.go +116 -0
- package/templates/native-go/backend/internal/helper/write_intent_linux_test.go +74 -0
- package/templates/native-go/backend/internal/helper/write_operation_linux.go +245 -0
- package/templates/native-go/backend/internal/helper/write_test.go +53 -0
- package/templates/native-go/dsm-package.yaml +58 -0
- package/templates/native-go/gitignore +1 -0
- package/templates/native-go/i18n/glossary.json +662 -0
- package/templates/native-go/i18n/messages/de.json +28 -0
- package/templates/native-go/i18n/messages/en.json +28 -0
- package/templates/native-go/i18n/messages/es.json +28 -0
- package/templates/native-go/i18n/messages/fr.json +28 -0
- package/templates/native-go/i18n/messages/it.json +28 -0
- package/templates/native-go/i18n/messages/ja.json +28 -0
- package/templates/native-go/i18n/messages/ko.json +28 -0
- package/templates/native-go/i18n/messages/zh-CN.json +28 -0
- package/templates/native-go/i18n/messages/zh-TW.json +28 -0
- package/templates/native-go/ui/app.css +35 -0
- package/templates/native-go/ui/app.js +101 -0
- package/templates/native-go-better-auth/backend/internal/app/identity.go +208 -0
- package/templates/native-go-better-auth/backend/internal/app/identity_test.go +113 -0
- package/templates/native-go-better-auth/node/app.mjs +72 -0
- package/templates/native-go-better-auth/node/build.mjs +4 -0
- package/templates/native-go-better-auth/node/package-lock.json +862 -0
- package/templates/native-go-better-auth/node/package.json +1 -0
- package/templates/native-go-better-auth/node/test/auth.test.mjs +31 -0
- package/templates/native-go-integration/backend/internal/app/identity_none.go +6 -0
- package/templates/native-go-integration/backend/internal/app/personal.go +203 -0
- package/templates/native-go-integration/backend/internal/app/personal_test.go +119 -0
- package/templates/native-go-root/backend/internal/app/root.go +107 -0
- package/templates/native-go-root/backend/internal/app/root_test.go +124 -0
- package/templates/native-go-root/root/whoami.sh +6 -0
- package/templates/native-go-vue/README.md +224 -0
- package/templates/native-go-vue/frontend/DESIGN.md +78 -0
- package/templates/native-go-vue/frontend/package-lock.json +2410 -0
- package/templates/native-go-vue/frontend/package.json +6 -0
- package/templates/native-go-vue/frontend/src/App.vue +159 -0
- package/templates/native-go-vue/frontend/src/context.ts +56 -0
- package/templates/native-go-vue/frontend/src/main.ts +29 -0
- package/templates/native-go-vue/frontend/src/nas/NasGrantSettings.vue +74 -0
- package/templates/native-go-vue/frontend/src/nas/NasPathPicker.vue +106 -0
- package/templates/native-go-vue/frontend/src/nas/NasUnavailable.vue +20 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/de.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/en.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/es.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/fr.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/it.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/ja.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/ko.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/zh-CN.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/zh-TW.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n.ts +38 -0
- package/templates/native-go-vue/frontend/src/nas/mock-provider.ts +119 -0
- package/templates/native-go-vue/frontend/src/nas/provider.ts +59 -0
- package/templates/native-go-vue/frontend/src/nas/use-request.ts +27 -0
- package/templates/native-go-vue/frontend/src/style.css +31 -0
- package/templates/native-go-vue/frontend/test/apps.test.ts +190 -0
- package/templates/native-go-vue/frontend/test/nas-provider.test.ts +81 -0
- package/templates/native-go-vue/frontend/test/nas-request.test.ts +21 -0
- package/templates/native-go-vue/frontend/test/nas-ui.test.ts +261 -0
- package/templates/native-go-vue/frontend/tsconfig.json +1 -0
- package/templates/native-go-vue/frontend/vite.config.ts +10 -0
- package/templates/native-go-vue/gitignore +2 -0
- package/dist/attestation/app-package.d.ts +0 -86
- package/dist/attestation/app-package.js +0 -206
- package/dist/attestation/install-on-host.d.ts +0 -14
- package/dist/attestation/install-on-host.js +0 -52
- package/dist/attestation/keyring.d.ts +0 -21
- package/dist/attestation/keyring.js +0 -168
- package/dist/attestation/platform-service.d.ts +0 -70
- package/dist/attestation/platform-service.js +0 -250
- package/dist/build-spk/broker-glue.d.ts +0 -16
- package/dist/build-spk/broker-glue.js +0 -40
- package/dist/deploy/catalog-publish.d.ts +0 -3
- package/dist/deploy/catalog-publish.js +0 -7
- package/dist/doctor.d.ts +0 -22
- package/dist/doctor.js +0 -822
- package/dist/error-collector.d.ts +0 -2
- package/dist/error-collector.js +0 -46
- package/dist/host/broker-paths.d.ts +0 -1
- package/dist/host/broker-paths.js +0 -1
- package/dist/host/broker-upgrade-preflight.d.ts +0 -61
- package/dist/host/broker-upgrade-preflight.js +0 -156
- package/dist/host/digests.d.ts +0 -5
- package/dist/host/digests.js +0 -63
- package/dist/host/fake-nas.d.ts +0 -49
- package/dist/host/fake-nas.js +0 -193
- package/dist/mock-broker/bootstrap.d.ts +0 -2
- package/dist/mock-broker/bootstrap.js +0 -8
- package/dist/mock-broker/files.d.ts +0 -60
- package/dist/mock-broker/files.js +0 -408
- package/dist/mock-broker/oidc.d.ts +0 -31
- package/dist/mock-broker/oidc.js +0 -161
- package/dist/mock-broker/path.d.ts +0 -9
- package/dist/mock-broker/path.js +0 -50
- package/dist/mock-broker/server.d.ts +0 -19
- package/dist/mock-broker/server.js +0 -350
- package/dist/publish/build-ledger.d.ts +0 -22
- package/dist/publish/build-ledger.js +0 -26
- package/dist/publish/community-path.d.ts +0 -6
- package/dist/publish/community-path.js +0 -41
- package/dist/publish/curated-release.d.ts +0 -78
- package/dist/publish/curated-release.js +0 -883
- package/dist/publish/file-build-ledger.d.ts +0 -18
- package/dist/publish/file-build-ledger.js +0 -268
- package/dist/publish/github-pr.d.ts +0 -25
- package/dist/publish/github-pr.js +0 -85
- package/dist/publish/github-repo.d.ts +0 -8
- package/dist/publish/github-repo.js +0 -21
- package/dist/publish/platform-service-release.d.ts +0 -60
- package/dist/publish/platform-service-release.js +0 -333
- package/dist/publish/preflight.d.ts +0 -24
- package/dist/publish/preflight.js +0 -138
- package/dist/publish/publish.d.ts +0 -27
- package/dist/publish/publish.js +0 -136
- package/dist/publish/sync-definition.d.ts +0 -4
- package/dist/publish/sync-definition.js +0 -48
- package/dist/release-bin.d.ts +0 -2
- package/dist/release-bin.js +0 -23
- package/dist/templates/hello-web/html/sdk.js +0 -68
- package/dist/templates/hello-web-page/html/sdk.js +0 -68
- package/dist/templates/native/synology-app.yaml +0 -7
- package/dist/test-host.d.ts +0 -15
- package/dist/test-host.js +0 -37
- package/templates/hello-web/html/sdk.js +0 -68
- package/templates/hello-web-page/html/sdk.js +0 -68
- package/templates/native/synology-app.yaml +0 -7
- /package/dist/templates/{native → binary}/native.yaml +0 -0
- /package/templates/{native → binary}/native.yaml +0 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import {expect, test, vi} from 'vitest'
|
|
3
|
+
import {nextTick} from 'vue'
|
|
4
|
+
import {mount} from '../src/main'
|
|
5
|
+
import {createMockNasService} from '../src/nas/mock-provider'
|
|
6
|
+
import {catalogs, nasCopy, format, errorCopy} from '../src/nas/i18n'
|
|
7
|
+
import type {NasProvider} from '../src/nas/provider'
|
|
8
|
+
import type {Context} from '../src/context'
|
|
9
|
+
|
|
10
|
+
async function settle() {for(let i=0;i<20;i++){await Promise.resolve();await nextTick()}await new Promise(r=>setTimeout(r,25))}
|
|
11
|
+
function click(root:HTMLElement, text:string) {const b=[...root.querySelectorAll('button')].find(b=>b.textContent?.trim()===text || b.getAttribute('aria-label')===text);expect(b,text).toBeTruthy();b!.click()}
|
|
12
|
+
function fixture(nas:NasProvider | undefined, user='normal1', locale='en') {
|
|
13
|
+
const root=document.createElement('div');document.body.append(root)
|
|
14
|
+
const reopen:Array<()=>void>=[]
|
|
15
|
+
const ctx={locale,reopen(fn:()=>void){reopen.push(fn)},call:vi.fn(async(method:string)=> {
|
|
16
|
+
if(method==='app.status') return {package:'SamePackage',version:'1',user,admin:user==='admin'}
|
|
17
|
+
if(method==='integration.status') return {state:'not-enabled',reason:'not-requested',packageRunning:'unknown',scheduler:'not-probed'}
|
|
18
|
+
throw {code:'unknown_method'}
|
|
19
|
+
})} as Context
|
|
20
|
+
const app=mount(root,ctx,{nasProvider:nas})
|
|
21
|
+
return {root,app,ctx,reopen}
|
|
22
|
+
}
|
|
23
|
+
function cleanup(...fixtures:ReturnType<typeof fixture>[]) {for(const f of fixtures){f.app.unmount();f.root.remove()}}
|
|
24
|
+
|
|
25
|
+
test('managed account pilot stays visibly off with maintenance and approval restrictions',async()=> {
|
|
26
|
+
const f=fixture(createMockNasService().connect('admin'),'admin')
|
|
27
|
+
try {
|
|
28
|
+
await settle()
|
|
29
|
+
expect(f.root.textContent).toContain('Managed account pilot: off')
|
|
30
|
+
expect(f.root.textContent).toContain('Account changes or unverified identity revoke access')
|
|
31
|
+
expect(f.root.textContent).toContain('Enabling this pilot is unavailable in this build')
|
|
32
|
+
expect([...f.root.querySelectorAll('button')].some(b=>b.textContent?.includes('Enable managed'))).toBe(false)
|
|
33
|
+
} finally {cleanup(f)}
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
test('nine complete catalogs resolve DSM locale aliases with English fallback',()=> {
|
|
37
|
+
expect(Object.keys(catalogs)).toEqual(['en','zh-TW','zh-CN','ja','ko','de','fr','es','it'])
|
|
38
|
+
for(const catalog of Object.values(catalogs)) {
|
|
39
|
+
expect(Object.keys(catalog).sort()).toEqual(Object.keys(catalogs.en).sort())
|
|
40
|
+
expect(Object.values(catalog).every(s=>typeof s==='string' && s.trim().length>0)).toBe(true)
|
|
41
|
+
for(const key of Object.keys(catalogs.en) as Array<keyof typeof catalogs.en>) {
|
|
42
|
+
expect(catalog[key].match(/\{\w+\}/g) ?? []).toEqual(catalogs.en[key].match(/\{\w+\}/g) ?? [])
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
expect(nasCopy('cht')).toEqual(catalogs['zh-TW'])
|
|
46
|
+
expect(nasCopy('zh_CN')).toEqual(catalogs['zh-CN'])
|
|
47
|
+
expect(nasCopy('unknown')).toEqual(catalogs.en)
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
test('account changes discard the bound provider UI and its pending candidate context',async()=> {
|
|
51
|
+
const provider=createMockNasService().connect('normal1'), cancel=vi.spyOn(provider,'cancel'), f=fixture(provider)
|
|
52
|
+
try {
|
|
53
|
+
await settle();click(f.root,'Choose my folder');await settle()
|
|
54
|
+
f.ctx.call=vi.fn(async(method:string)=>method==='app.status'?{package:'SamePackage',version:'1',user:'normal2',admin:false}:{state:'not-enabled',reason:'not-requested',packageRunning:'unknown',scheduler:'not-probed'})
|
|
55
|
+
f.reopen.forEach(fn=>fn());await settle()
|
|
56
|
+
expect(f.root.textContent).toContain('normal2')
|
|
57
|
+
expect(f.root.querySelector('[role="dialog"]')).toBeNull()
|
|
58
|
+
expect(f.root.textContent).not.toContain('Choose my folder')
|
|
59
|
+
expect(cancel).toHaveBeenCalled()
|
|
60
|
+
} finally {cleanup(f)}
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
test('all nine locale UIs localize dialog controls and allow keyboard review without mouse-only actions',async()=> {
|
|
64
|
+
for(const locale of Object.keys(catalogs)) {
|
|
65
|
+
const copy=nasCopy(locale), f=fixture(createMockNasService().connect('normal1'),'normal1',locale)
|
|
66
|
+
try {
|
|
67
|
+
await settle();click(f.root,copy.choosePersonal);await settle()
|
|
68
|
+
const selected=[...f.root.querySelectorAll('button')].find(b=>b.getAttribute('aria-label')===format(copy.select,'Projects'))!
|
|
69
|
+
selected.focus();expect(document.activeElement).toBe(selected)
|
|
70
|
+
// Native Button remains a keyboard-activatable button (browser verifies Enter).
|
|
71
|
+
expect(selected.tagName).toBe('BUTTON');selected.click();await settle()
|
|
72
|
+
click(f.root,copy.review);await settle();expect(f.root.textContent).toContain(copy.persistent)
|
|
73
|
+
expect(f.root.querySelector(`button[aria-label="${copy.close}"]`)).toBeTruthy()
|
|
74
|
+
click(f.root,copy.cancel);await settle()
|
|
75
|
+
} finally {cleanup(f)}
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
test('home unavailable is recoverable and native diagnostics are never rendered',async()=> {
|
|
80
|
+
const provider=createMockNasService({homeAvailable:false}).connect('normal1'), f=fixture(provider)
|
|
81
|
+
try {
|
|
82
|
+
await settle();click(f.root,'Choose my folder');await settle()
|
|
83
|
+
expect(f.root.textContent).toContain('Required native identity or permission proof is unavailable')
|
|
84
|
+
provider.begin=async()=>{throw {code:'unknown',message:'/volume1/private-secret stderr'}}
|
|
85
|
+
click(f.root,'Retry');await settle()
|
|
86
|
+
expect(f.root.textContent).toContain('The request failed')
|
|
87
|
+
expect(f.root.textContent).not.toMatch(/private-secret|stderr/)
|
|
88
|
+
} finally {cleanup(f)}
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
test('picker browse, separate selection/summary, cancel, empty and confirm use injected provider only',async()=> {
|
|
92
|
+
const service=createMockNasService(), provider=service.connect('normal1'), cancel=vi.spyOn(provider,'cancel'), f=fixture(provider)
|
|
93
|
+
try {
|
|
94
|
+
await settle();click(f.root,'Choose my folder');await settle()
|
|
95
|
+
expect(f.root.textContent).toContain('Mock preview')
|
|
96
|
+
expect(f.root.querySelector('[role="dialog"]')).toBeTruthy()
|
|
97
|
+
click(f.root,'Select Projects');await settle()
|
|
98
|
+
expect(f.root.textContent).not.toContain('Persistent access')
|
|
99
|
+
click(f.root,'Review access');await settle()
|
|
100
|
+
expect(f.root.textContent).toContain('Persistent access')
|
|
101
|
+
click(f.root,'Cancel');await settle()
|
|
102
|
+
expect(cancel).toHaveBeenCalled()
|
|
103
|
+
expect(await provider.grants(new AbortController().signal)).toEqual([])
|
|
104
|
+
click(f.root,'Choose my folder');await settle();click(f.root,'Open Empty folder');await settle()
|
|
105
|
+
expect(f.root.textContent).toContain('This folder is empty')
|
|
106
|
+
click(f.root,'Back');await settle();click(f.root,'Select Projects');await settle();click(f.root,'Review access');await settle();click(f.root,'Confirm access');await settle()
|
|
107
|
+
expect(f.root.querySelector('[role="dialog"]')).toBeNull()
|
|
108
|
+
expect(f.root.textContent).toContain('Active')
|
|
109
|
+
} finally {cleanup(f)}
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
test('two same-package apps retain local modality, unique ARIA IDs and cancellation isolation',async()=> {
|
|
113
|
+
const service=createMockNasService(), a=fixture(service.connect('normal1')), b=fixture(service.connect('normal2'))
|
|
114
|
+
const body=document.body.getAttribute('style')
|
|
115
|
+
try {
|
|
116
|
+
await settle();click(a.root,'Choose my folder');click(b.root,'Choose my folder');await settle()
|
|
117
|
+
const ids=[...document.querySelectorAll('[id]')].map(n=>n.id).filter(Boolean)
|
|
118
|
+
expect(new Set(ids).size).toBe(ids.length)
|
|
119
|
+
for(const f of [a,b]) {
|
|
120
|
+
const dialog=f.root.querySelector('[role="dialog"]')!
|
|
121
|
+
expect(dialog.hasAttribute('aria-modal')).toBe(false)
|
|
122
|
+
for(const name of ['aria-labelledby','aria-describedby']) expect(f.root.querySelector(`[id="${dialog.getAttribute(name)}"]`)).toBeTruthy()
|
|
123
|
+
}
|
|
124
|
+
expect(getComputedStyle(b.root).pointerEvents).not.toBe('none')
|
|
125
|
+
click(a.root,'Cancel');await settle()
|
|
126
|
+
expect(a.root.querySelector('[role="dialog"]')).toBeNull()
|
|
127
|
+
expect(b.root.querySelector('[role="dialog"]')).toBeTruthy()
|
|
128
|
+
expect(document.body.getAttribute('style')).toBe(body)
|
|
129
|
+
} finally {cleanup(a,b)}
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
test('intent expiry is actionable; revoked but not drained never claims transfers stopped',async()=> {
|
|
133
|
+
let now=1000
|
|
134
|
+
const service=createMockNasService({now:()=>now,drained:false}), provider=service.connect('normal1'), f=fixture(provider)
|
|
135
|
+
try {
|
|
136
|
+
await settle();click(f.root,'Choose my folder');await settle();click(f.root,'Select Projects');await settle();click(f.root,'Review access');await settle()
|
|
137
|
+
now+=30_000;click(f.root,'Confirm access');await settle()
|
|
138
|
+
expect(f.root.textContent).toContain('expired')
|
|
139
|
+
expect(await provider.grants(new AbortController().signal)).toEqual([])
|
|
140
|
+
click(f.root,'Cancel');await settle();click(f.root,'Choose my folder');await settle();click(f.root,'Select Projects');await settle();click(f.root,'Review access');await settle();click(f.root,'Confirm access');await settle()
|
|
141
|
+
click(f.root,'Revoke');await settle()
|
|
142
|
+
expect(f.root.textContent).toContain('already sent or written')
|
|
143
|
+
click(f.root,'Confirm revoke');await settle()
|
|
144
|
+
expect(f.root.textContent).toContain('Revoked; stopping transfers')
|
|
145
|
+
} finally {cleanup(f)}
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
test('unmount aborts late browse and cancels its context without creating a grant',async()=> {
|
|
149
|
+
const provider=createMockNasService().connect('normal1'), base=provider.list.bind(provider)
|
|
150
|
+
let resolve!:()=>void, requestSignal!:AbortSignal
|
|
151
|
+
provider.list=async(...args)=>{requestSignal=args[3];await new Promise<void>(r=>resolve=r);return base(...args)}
|
|
152
|
+
const cancel=vi.spyOn(provider,'cancel'), f=fixture(provider)
|
|
153
|
+
await settle();click(f.root,'Choose my folder');await settle();f.app.unmount()
|
|
154
|
+
expect(requestSignal.aborted).toBe(true);expect(cancel).toHaveBeenCalled()
|
|
155
|
+
resolve();await settle();expect(f.root.childElementCount).toBe(0);f.root.remove()
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
test('late begin after close is canceled and rapid double review consumes one intent',async()=> {
|
|
159
|
+
const provider=createMockNasService().connect('normal1'), begin=provider.begin.bind(provider)
|
|
160
|
+
let release!:()=>void
|
|
161
|
+
provider.begin=async(kind,signal)=>{await new Promise<void>(r=>release=r);return begin(kind,new AbortController().signal)}
|
|
162
|
+
const cancel=vi.spyOn(provider,'cancel'), prepare=vi.spyOn(provider,'prepare'), f=fixture(provider)
|
|
163
|
+
try {
|
|
164
|
+
await settle();click(f.root,'Choose my folder');await settle();click(f.root,'Cancel');await settle()
|
|
165
|
+
release();await settle();expect(cancel).toHaveBeenCalled();expect(f.root.querySelector('[role="dialog"]')).toBeNull()
|
|
166
|
+
provider.begin=begin
|
|
167
|
+
click(f.root,'Choose my folder');await settle();click(f.root,'Select Projects');await settle()
|
|
168
|
+
click(f.root,'Review access');click(f.root,'Review access');await settle()
|
|
169
|
+
expect(prepare).toHaveBeenCalledTimes(1)
|
|
170
|
+
} finally {cleanup(f)}
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
test('long folder names stay text, and revoked without Q uses pending cleanup copy',async()=> {
|
|
174
|
+
const name='<img src=x onerror=alert(1)> '+ '\u5e74\u5ea6\u5831\u544a'.repeat(20)
|
|
175
|
+
const provider=createMockNasService({personalFolders:[name]}).connect('normal1'), f=fixture(provider)
|
|
176
|
+
try {
|
|
177
|
+
await settle();click(f.root,'Choose my folder');await settle()
|
|
178
|
+
expect(f.root.textContent).toContain(name);expect(f.root.querySelector('img')).toBeNull()
|
|
179
|
+
click(f.root,'Cancel');await settle()
|
|
180
|
+
provider.settings=async()=>({canManageShared:false,items:[{grantId:'fixture',revision:2,scopeKind:'user-personal',displayName:name,targetKind:'directory',actions:['nas.files.read'],effectiveState:'revoked',createdAt:1000,canRevoke:true,cleanupRequired:true}]})
|
|
181
|
+
click(f.root,'Refresh access');await settle()
|
|
182
|
+
expect(f.root.textContent).toContain('Revoked; cleanup needs verification')
|
|
183
|
+
expect(f.root.textContent).toContain('Read files')
|
|
184
|
+
expect(f.root.textContent).not.toContain('List folders')
|
|
185
|
+
} finally {cleanup(f)}
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
test('S8 production defaults display unavailable for normal/admin even when lifecycle is ready',async()=> {
|
|
190
|
+
for(const user of ['normal1','admin']) for(const locale of Object.keys(catalogs)) {
|
|
191
|
+
const f=fixture(undefined,user,locale),copy=nasCopy(locale)
|
|
192
|
+
try {
|
|
193
|
+
f.ctx.call=vi.fn(async(method:string)=> {
|
|
194
|
+
if(method==='app.status') return {package:'SamePackage',version:'1',user,admin:user==='admin'}
|
|
195
|
+
if(method==='integration.status') return {state:'ready',packageRunning:'running',scheduler:'ready'}
|
|
196
|
+
if(method==='personal.list') return {items:[]}
|
|
197
|
+
throw {code:'unknown_method'}
|
|
198
|
+
})
|
|
199
|
+
f.reopen.forEach(fn=>fn());await settle()
|
|
200
|
+
expect(f.root.textContent).toContain(copy.unavailableMessage)
|
|
201
|
+
expect(f.root.textContent).toContain(copy.pilotUnavailable)
|
|
202
|
+
expect(f.root.textContent).toContain(copy.noUnlock)
|
|
203
|
+
expect(f.root.textContent).not.toContain(copy.choosePersonal)
|
|
204
|
+
expect(f.root.textContent).not.toContain(copy.chooseShared)
|
|
205
|
+
expect(f.root.textContent).not.toContain(copy.emptyGrant)
|
|
206
|
+
expect(f.ctx.call.mock.calls.some(([method])=>method.startsWith('nas.'))).toBe(false)
|
|
207
|
+
} finally {cleanup(f)}
|
|
208
|
+
}
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
test('S8 unavailable connected providers are ignored; only development mocks have a picker',async()=> {
|
|
212
|
+
const connected=createMockNasService().connect('normal1')
|
|
213
|
+
Object.defineProperty(connected,'mode',{value:'connected'})
|
|
214
|
+
const settings=vi.spyOn(connected,'settings'),f=fixture(connected)
|
|
215
|
+
try {
|
|
216
|
+
await settle()
|
|
217
|
+
expect(f.root.textContent).toContain(nasCopy('en').unavailableMessage)
|
|
218
|
+
expect(f.root.textContent).not.toContain('Choose my folder')
|
|
219
|
+
expect(settings).not.toHaveBeenCalled()
|
|
220
|
+
} finally {cleanup(f)}
|
|
221
|
+
})
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
test('S8 safe error codes distinguish missing proof, denial, missing method and app authentication',()=> {
|
|
225
|
+
for(const copy of Object.values(catalogs)) {
|
|
226
|
+
for(const [code,key] of [['unavailable','errorNativeProof'],['denied','errorDenied'],['unknown_method','errorUnknownMethod'],['unsupported','errorUnsupported'],['session_required','errorSession'],['auth_unavailable','errorAuthentication']] as const) {
|
|
227
|
+
expect(errorCopy({code,message:'/volume1/private cookie=sid'},copy)).toBe(copy[key])
|
|
228
|
+
expect(errorCopy({code,message:'/volume1/private cookie=sid'},copy)).not.toMatch(/volume1|cookie=sid/)
|
|
229
|
+
}
|
|
230
|
+
expect(new Set(['unavailable','denied','unknown_method','unsupported'].map(code=>errorCopy({code},copy))).size).toBe(4)
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
test('S8 app request failures use localized safe-code copy without native diagnostics',async()=> {
|
|
236
|
+
for(const code of ['denied','unknown_method','unavailable','unsupported','session_required','auth_unavailable']) {
|
|
237
|
+
const f=fixture(undefined,'normal1','cht')
|
|
238
|
+
try {
|
|
239
|
+
await settle()
|
|
240
|
+
f.ctx.call=vi.fn(async()=>{throw {code,message:'/volume1/private cookie=sid'}})
|
|
241
|
+
f.reopen.forEach(fn=>fn());await settle()
|
|
242
|
+
expect(f.root.querySelector('[role="alert"]')?.textContent).toBe(errorCopy({code},nasCopy('cht')))
|
|
243
|
+
expect(f.root.textContent).not.toMatch(/volume1|cookie=sid/)
|
|
244
|
+
} finally {cleanup(f)}
|
|
245
|
+
}
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
test('S1R risk and reauthorization are disclosed in nine unavailable UIs without data actions',async()=> {
|
|
249
|
+
for(const locale of Object.keys(catalogs)) {
|
|
250
|
+
const copy=nasCopy(locale) as any, f=fixture(undefined,'normal1',locale)
|
|
251
|
+
try {
|
|
252
|
+
await settle()
|
|
253
|
+
for(const key of ['relaxedRisk','relaxedReauthorize','relaxedPermissions']) {
|
|
254
|
+
expect(copy[key],`${locale}:${key}`).toBeTypeOf('string')
|
|
255
|
+
expect(f.root.textContent).toContain(copy[key])
|
|
256
|
+
}
|
|
257
|
+
expect(f.root.textContent).not.toContain(copy.choosePersonal)
|
|
258
|
+
expect(f.ctx.call.mock.calls.some(([method])=>method.startsWith('nas.'))).toBe(false)
|
|
259
|
+
} finally {cleanup(f)}
|
|
260
|
+
}
|
|
261
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"compilerOptions":{"target":"ES2022","module":"ESNext","moduleResolution":"Bundler","resolveJsonModule":true,"strict":true,"lib":["ES2022","DOM"],"skipLibCheck":true,"types":["vite/client"]},"include":["src/**/*.ts","src/**/*.vue","vite.config.ts"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import vue from '@vitejs/plugin-vue'
|
|
3
|
+
// @ts-expect-error The shared notice tool is a plain Node module.
|
|
4
|
+
import { writeThirdPartyNotices } from './third-party-notices.mjs'
|
|
5
|
+
export default defineConfig(({command}) => ({
|
|
6
|
+
plugins: [vue(), {name: 'dependency-notices', closeBundle() {writeThirdPartyNotices('.', 'dist/LICENSES', {ui: true})}}],
|
|
7
|
+
// Library mode must replace Vue dependency env guards for the DSM browser.
|
|
8
|
+
define: command === 'build' ? {'process.env.NODE_ENV': JSON.stringify('production')} : {},
|
|
9
|
+
build: {lib: {entry: 'src/main.ts', formats: ['iife'], name: 'DsmVueApp', fileName: () => 'app.js'}, cssCodeSplit: false, rollupOptions: {output: {assetFileNames: 'app.[ext]'}}},
|
|
10
|
+
}))
|
package/dist/types.d.ts
CHANGED
|
@@ -56,4 +56,4 @@ export interface ComposeDocument {
|
|
|
56
56
|
secrets?: Record<string, unknown>;
|
|
57
57
|
[key: string]: unknown;
|
|
58
58
|
}
|
|
59
|
-
export type TemplateName = "hello-web" | "hello-web-page" | "hello-files" | "compose-import" | "native";
|
|
59
|
+
export type TemplateName = "hello-web" | "hello-web-page" | "hello-files" | "compose-import" | "binary" | "native-go";
|
package/dist/validate.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { contractSpan, makeError } from "./errors.js";
|
|
4
|
+
import { collectInstallParameters, getValuePosition, loadContract } from "./contract/load.js";
|
|
4
5
|
import { validateContract } from "./contract/validate.js";
|
|
6
|
+
import { findListingUnsupportedInstallTypes } from "./contract/unsupported-types.js";
|
|
5
7
|
import { collectComposeInterpolations, collectVolumeSourceInterpolations, loadCompose, validateAdminPortMapping, validateComposeHostBinds, validateComposeNumericCommandArgs, validateComposeRunAs, validateComposeSecurity, } from "./compose/analyze.js";
|
|
6
8
|
import { loadNative } from "./native/load.js";
|
|
7
9
|
import { validateNative } from "./native/validate.js";
|
|
@@ -16,6 +18,14 @@ export function validateProject(project, options = {}) {
|
|
|
16
18
|
const nativeFile = NATIVE_FILENAME;
|
|
17
19
|
const parsed = loadContract(project.contractPath);
|
|
18
20
|
errors.push(...validateContract(parsed, contractFile));
|
|
21
|
+
if (profile === "listing") {
|
|
22
|
+
for (const { name, type, code } of findListingUnsupportedInstallTypes(parsed.contract)) {
|
|
23
|
+
const pos = getValuePosition(parsed.doc, ["install", name, "type"]) ??
|
|
24
|
+
getValuePosition(parsed.doc, ["install", name]) ??
|
|
25
|
+
{ line: 1, column: 1 };
|
|
26
|
+
errors.push(makeError(code, contractSpan(contractFile, pos.line, pos.column, `install.${name}.type`), `Install Parameter「${name}」的 type: ${type} 只能由 synopkgland deploy 在管理員 session 取得安裝當下的 Share 清單快照;Package Center/Package Source listing 不支援。`, "請使用 synopkgland deploy --host <name>,由管理員 session 在安裝時取得 Share 清單快照;此型別不能透過 Package Center 或 Package Source listing 上架。"));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
19
29
|
const hasCompose = existsSync(project.composePath);
|
|
20
30
|
const nativePath = project.nativePath ?? join(project.root, NATIVE_FILENAME);
|
|
21
31
|
const hasNative = existsSync(nativePath);
|
|
@@ -130,12 +140,6 @@ export function validateProject(project, options = {}) {
|
|
|
130
140
|
suggestion: `請在 compose.yaml 以 \${${name}} 引用此參數。`,
|
|
131
141
|
});
|
|
132
142
|
}
|
|
133
|
-
if (param.type === "dsm_user") {
|
|
134
|
-
// In dynamic route, dsm_user is automatically injected into Compose by generator.
|
|
135
|
-
// If a Compose manually writes user, COMPOSE_USER_CONFLICTS_DSM_USER is emitted.
|
|
136
|
-
// Referenced for error-registry emitter compatibility.
|
|
137
|
-
const _unused = "INSTALL_DSM_USER_UNREFERENCED";
|
|
138
|
-
}
|
|
139
143
|
}
|
|
140
144
|
const warnings = errors.filter((item) => item.severity === "warning");
|
|
141
145
|
const hardErrors = errors.filter((item) => item.severity !== "warning");
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Syno Package Land Developer Kit CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"synopkgland": "./dist/bin.js"
|
|
8
|
-
"synopkgland-release": "./dist/release-bin.js"
|
|
7
|
+
"synopkgland": "./dist/bin.js"
|
|
9
8
|
},
|
|
10
9
|
"files": [
|
|
11
10
|
"dist",
|
|
@@ -14,16 +13,13 @@
|
|
|
14
13
|
"skills"
|
|
15
14
|
],
|
|
16
15
|
"scripts": {
|
|
17
|
-
"build": "tsc && node scripts/copy-templates.mjs",
|
|
16
|
+
"build": "rm -rf dist && tsc && node scripts/copy-templates.mjs",
|
|
18
17
|
"test": "npm run build && node --import tsx --test test/**/*.test.ts",
|
|
19
18
|
"prepublishOnly": "npm run build"
|
|
20
19
|
},
|
|
21
20
|
"dependencies": {
|
|
22
|
-
"@synopackageland/dev-sdk": "^0.2.0",
|
|
23
|
-
"@synopackageland/package-source": "^0.2.1",
|
|
24
21
|
"ajv": "^8.17.1",
|
|
25
22
|
"commander": "^13.1.0",
|
|
26
|
-
"jose": "^6.0.10",
|
|
27
23
|
"tar": "^7.4.3",
|
|
28
24
|
"yaml": "^2.7.0"
|
|
29
25
|
},
|
|
@@ -35,5 +31,6 @@
|
|
|
35
31
|
"publishConfig": {
|
|
36
32
|
"access": "public",
|
|
37
33
|
"registry": "https://registry.npmjs.org"
|
|
38
|
-
}
|
|
34
|
+
},
|
|
35
|
+
"license": "MIT"
|
|
39
36
|
}
|
|
@@ -59,14 +59,24 @@
|
|
|
59
59
|
"properties": {
|
|
60
60
|
"type": {
|
|
61
61
|
"type": "string",
|
|
62
|
-
"enum": [
|
|
62
|
+
"enum": [
|
|
63
|
+
"string",
|
|
64
|
+
"boolean",
|
|
65
|
+
"secret",
|
|
66
|
+
"shared_folder",
|
|
67
|
+
"dsm_user",
|
|
68
|
+
"homes",
|
|
69
|
+
"posix_all_shares"
|
|
70
|
+
]
|
|
63
71
|
},
|
|
64
72
|
"default": {},
|
|
65
73
|
"generate": {
|
|
66
74
|
"type": "boolean"
|
|
67
75
|
}
|
|
68
76
|
},
|
|
69
|
-
"required": [
|
|
77
|
+
"required": [
|
|
78
|
+
"type"
|
|
79
|
+
]
|
|
70
80
|
}
|
|
71
81
|
},
|
|
72
82
|
"integration": {
|
|
@@ -77,7 +87,10 @@
|
|
|
77
87
|
"properties": {
|
|
78
88
|
"launch": {
|
|
79
89
|
"type": "string",
|
|
80
|
-
"enum": [
|
|
90
|
+
"enum": [
|
|
91
|
+
"dsm-window",
|
|
92
|
+
"new-page"
|
|
93
|
+
],
|
|
81
94
|
"description": "Web App Launch Mode. dsm-window opens a DSM Application Window at the Trusted App Entry; new-page uses Package Center Open. Omit for dsm-window. Headless apps omit this field."
|
|
82
95
|
},
|
|
83
96
|
"cookies": {
|
|
@@ -89,47 +102,33 @@
|
|
|
89
102
|
}
|
|
90
103
|
},
|
|
91
104
|
"additionalProperties": true
|
|
92
|
-
},
|
|
93
|
-
"identity": {
|
|
94
|
-
"type": "object",
|
|
95
|
-
"additionalProperties": false,
|
|
96
|
-
"required": ["mode"],
|
|
97
|
-
"properties": {
|
|
98
|
-
"mode": {
|
|
99
|
-
"type": "string",
|
|
100
|
-
"enum": ["broker-managed"],
|
|
101
|
-
"description": "v1 identity mode. SDK Apps omit oidc_compat; wrap-existing may add it."
|
|
102
|
-
},
|
|
103
|
-
"oidc_compat": {
|
|
104
|
-
"type": "object",
|
|
105
|
-
"additionalProperties": false,
|
|
106
|
-
"required": ["redirect_path"],
|
|
107
|
-
"properties": {
|
|
108
|
-
"redirect_path": {
|
|
109
|
-
"type": "string",
|
|
110
|
-
"pattern": "^/(?!/)(?!.*\\.\\.)[^\\s?#:]*$",
|
|
111
|
-
"description": "App-owned OIDC callback path. No scheme, host, query, or '..'."
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
105
|
}
|
|
117
106
|
},
|
|
118
|
-
"additionalProperties":
|
|
119
|
-
},
|
|
120
|
-
"permissions": {
|
|
121
|
-
"type": "object"
|
|
107
|
+
"additionalProperties": false
|
|
122
108
|
},
|
|
109
|
+
"permissions": false,
|
|
123
110
|
"privilege": {
|
|
124
111
|
"type": "object",
|
|
125
112
|
"additionalProperties": false,
|
|
126
113
|
"properties": {
|
|
127
|
-
"privileged": {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"
|
|
131
|
-
|
|
132
|
-
|
|
114
|
+
"privileged": {
|
|
115
|
+
"type": "boolean"
|
|
116
|
+
},
|
|
117
|
+
"host_network": {
|
|
118
|
+
"type": "boolean"
|
|
119
|
+
},
|
|
120
|
+
"host_pid": {
|
|
121
|
+
"type": "boolean"
|
|
122
|
+
},
|
|
123
|
+
"host_ipc": {
|
|
124
|
+
"type": "boolean"
|
|
125
|
+
},
|
|
126
|
+
"devices": {
|
|
127
|
+
"type": "boolean"
|
|
128
|
+
},
|
|
129
|
+
"cap_add": {
|
|
130
|
+
"type": "boolean"
|
|
131
|
+
}
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
134
|
},
|
package/skills/SKILL.md
CHANGED
|
@@ -1,51 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
name: synopkgland
|
|
3
|
-
description: Agent Authoring for Syno Package Land — create, validate, and Inner Loop deploy a Personal App to the author's NAS with synopkgland CLI. Load when the user wants to build a DSM app from a brief, scaffold from templates, validate App Contract + Compose, deploy with Local Attestation, or diagnose analyzer/deploy/readiness failures. Not for Curated publish, SSH to NAS, or inventing platform fields.
|
|
4
|
-
version: 0.1.0
|
|
5
|
-
---
|
|
1
|
+
# Independent Synology SPKs
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
Use this guide to initialize, build and inspect own applications or upstream OSS as independent packages. 禁止發明已完成的登入橋接、逐使用者檔案 ACL 或新身分平台。
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
Start with `synopkgland init -t native-go`, `synopkgland init --binary`, or `synopkgland init -t compose-import`. Read reference/create.md or reference/wrap.md, then reference/deploy.md. Native CGI session checks belong to the package. Container authentication belongs to upstream; fixed service credentials govern mounted data access.
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
2. **永遠先讀**本檔 `SKILL.md`。
|
|
13
|
-
3. 依任務載入 `reference/*.md`(見下表)。不要一次讀完全部。
|
|
14
|
-
|
|
15
|
-
| 階段 | 檔案 | 何時 |
|
|
16
|
-
| --- | --- | --- |
|
|
17
|
-
| 建立 | `reference/create.md` | 從零或一句話需求 |
|
|
18
|
-
| 封裝 | `reference/wrap.md` | 已有 `compose.yaml` 或要補契約 |
|
|
19
|
-
| 身分 | `reference/identity.md` | 需要 DSM 登入/Open |
|
|
20
|
-
| 檔案 | `reference/files.md` | 需要 NAS 檔案 |
|
|
21
|
-
| 部署 | `reference/deploy.md` | 要 `deploy` 到 NAS |
|
|
22
|
-
| 排查 | `reference/diagnose.md` | `validate`/`deploy`/Open 失敗 |
|
|
23
|
-
|
|
24
|
-
也可用 `synopkgland skill list`、`synopkgland skill show <id>` 在終端機檢視。
|
|
25
|
-
|
|
26
|
-
## 權威邊界(必守)
|
|
27
|
-
|
|
28
|
-
- **權威**:`synology-app.yaml` schema(`packages/app-cli/schema/synology-app.schema.json`)、`synopkgland validate`/analyzer 錯誤碼、repo 測試。Skill 只是操作介面。
|
|
29
|
-
- **禁止發明欄位**:不得新增 schema 沒有的 top-level 或 `install` 型別;不得自創第二套 Compose/SPK DSL。不確定時先 `synopkgland inspect` 或讀模板,再 `validate`。
|
|
30
|
-
- **禁止洩漏 secret**:不得把 DSM 密碼、signing key、API token 寫進 Git、`compose.yaml` environment、`.env` commit、或對話紀錄。NAS 憑證用 synoagentcli profile 或本機環境變數,由 CLI 讀取。
|
|
31
|
-
- **不要讀 ADR** 當預設步驟;需要決策時 skill 才指向規格。
|
|
32
|
-
- **不要宣稱** 15 分鐘黃金路徑已通過、公開 SDK 已 freeze、或 `inner-loop` 全綠。
|
|
33
|
-
|
|
34
|
-
## 典型流程
|
|
35
|
-
|
|
36
|
-
```text
|
|
37
|
-
一句話需求
|
|
38
|
-
→ reference/create.md(選模板、最少問題)
|
|
39
|
-
→ synopkgland init -t hello-web|hello-web-page|hello-files|compose-import
|
|
40
|
-
→ synopkgland dev(本機 mock)
|
|
41
|
-
→ synopkgland validate
|
|
42
|
-
→ synopkgland test
|
|
43
|
-
→ reference/deploy.md → synopkgland deploy --host <nas>
|
|
44
|
-
→ synopkgland info --host <nas>;DSM Open
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
失敗時載入 `reference/diagnose.md`;依錯誤碼修契約或 Compose,**不要猜**。
|
|
48
|
-
|
|
49
|
-
## CLI 專案根
|
|
50
|
-
|
|
51
|
-
`synopkgland` 從 cwd 向上找 `synology-app.yaml`,或 `--project <dir>`。v1 不做 monorepo workspace 協定。載入 `.env` 亦從 cwd 向上找,在非專案目錄執行指令時應配合 `--project`(來源:docs/impl/STATUS.md 關鍵教訓 15)。
|
|
7
|
+
Never install, uninstall, publish or modify NAS data without task authorization. Prefer validate, inspect and deploy --dry-run for reviewable artifacts.
|
|
@@ -1,93 +1,21 @@
|
|
|
1
1
|
# 建立(Create)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
先選擇 `native-go`(Go CGI + DSM 視窗)、`binary`(預建服務程式)或 `compose-import`(上游容器)。`hello-web` 與 `hello-web-page` 分別示範 DSM 視窗及新分頁入口;`hello-files` 示範 Share 與固定 run-as 使用者。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
| `hello-web` | 第一個「DSM 帳號打開」的 Web App(DSM 視窗) | 身分;`launch: dsm-window`;**不**開廣域 `files.*` |
|
|
10
|
-
| `hello-web-page` | Web App 以 Package Center Open 開新分頁 | 身分;`launch: new-page` |
|
|
11
|
-
| `hello-files` | 讀寫管理員選的 Shared Folder | 身分 + 必填 `install` shared_folder |
|
|
12
|
-
| `compose-import` | 已有 `compose.yaml` | 保留映像/upstream 的 container target;只把 host source 換成 `${PARAM}`;Share 安裝時選 |
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
synopkgland init -t hello-web [目錄]
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
產物:`synology-app.yaml`、`compose.yaml`、README。需要程式碼時在同一專案加最小 Web App;v1 官方範例用 TypeScript + `@synopackageland/dev-sdk`。
|
|
19
|
-
|
|
20
|
-
## Published port 分配
|
|
21
|
-
|
|
22
|
-
`hello-web` 與 `hello-web-page` 模板的預設 `adminport` 是 **18333**。這個預設值在 2026-08-24 由 8080 調整而來,因為 8080 在真實 NAS 上常被既有容器使用;它只降低碰撞機率,不能保證該 port 一定可用。
|
|
23
|
-
|
|
24
|
-
`adminport` 是 NAS 上的 published host port,必須和 `compose.yaml` 的 host-side published port 對應。若同一台 NAS 上有多個測試或正式 instance,每個 package/instance 都要分配獨立的 published port;**同一台 NAS 上不要重用同一個 port**。可挑選尚未被既有服務使用的高位 port,例如 19xxx 範圍(`19160` 只是示例),並記錄每個 instance 的分配。
|
|
25
|
-
|
|
26
|
-
例如把模板 instance 改用 19160 時,`synology-app.yaml` 與 Compose 的 host-side port 要一起改,容器內 target 仍依原本 Compose/映像設定:
|
|
27
|
-
|
|
28
|
-
```yaml
|
|
29
|
-
# synology-app.yaml
|
|
30
|
-
adminport: 19160
|
|
31
|
-
|
|
32
|
-
# compose.yaml
|
|
33
|
-
ports:
|
|
34
|
-
- "19160:18333"
|
|
5
|
+
```sh
|
|
6
|
+
synopkgland init -t native-go --package MyApp my-app
|
|
7
|
+
synopkgland init --binary service
|
|
8
|
+
synopkgland init -t compose-import upstream-app
|
|
35
9
|
```
|
|
36
10
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
包現成 Compose 時,先用 `inspect` 看原本的 volume mapping。容器路徑跟 Compose/映像的 upstream target 走,不要為了套平台範例改成 `/data`;只把 host source 換成 `${PARAM}`。原有的 upstream named volume 要保留在頂層 `volumes:`。需要既有 Share 時宣告 `install.<PARAM>.type: shared_folder`,管理員在安裝時選這台 NAS 的 Share。
|
|
40
|
-
|
|
41
|
-
### `posix_all_shares`
|
|
42
|
-
|
|
43
|
-
當 App 必須在安裝當下掛載這台 NAS 目前列出的每一個共用資料夾時,宣告 `install.<NAME>.type: posix_all_shares`,並把 `${NAME}` 作為完整 Compose volume source,例如 `${NAME}:/shares:ro`。Package Center wizard 會以 `SYNO.Core.Share.list` 的 multi-select 讓管理員再次確認;這是最大警告:容器可讀(或依 Compose 模式讀寫)所有列出的 Share,安裝後新建的共用資料夾不會自動加入,由管理員決定是否安裝。不要在契約或 Compose 寫 `/volume*`、domain、實體 path;`CLI deploy` 未給 `--param NAME=...` 時會用管理員 session 重新列出當下的 Share,preinst 只解析清單,不掃描檔案系統。
|
|
44
|
-
|
|
45
|
-
## 路線判準:零設定(Static Zero-Config)vs Dynamic vs Broker
|
|
46
|
-
|
|
47
|
-
Syno Package Land 在打包 Compose App 時,依契約與 Compose 內容自動分類為不同路線:
|
|
48
|
-
|
|
49
|
-
| 路線 | 條件與特徵 | 適用環境 |
|
|
50
|
-
| --- | --- | --- |
|
|
51
|
-
| **零設定(Static Zero-Config)** | 靜態、低權限、無 `${...}` 插值(除專案相對路徑 `./html` bind 外)、單一 published port 對應 `adminport`。由 DSM 原生 `docker-project` 與 `webservice` resource worker 直接接管。 | Personal 與 **Curated 上架均支援** |
|
|
52
|
-
| **Dynamic** | 宣告了 string/boolean 的 `install` 參數,在 Compose 內以 `${NAME}` 引用;preinst carrier 以 0600 寫入 `$SYNOPKG_PKGINST_TEMP_DIR/compose/.env` 供 DSM worker 載入。 | Personal 支援(Curated 暫限已支援子集) |
|
|
53
|
-
| **Broker-installer(拒收於 Curated)** | 包含 `${SYNOPKG_PKGVAR}` 等平台 bind、需要 root 啟動的映像(例如官方 nginx)、未宣告參數的插值等。 | Personal 會警告;**Curated 上架直接拒收(`CURATED_BROKER_ROUTE_FORBIDDEN`)** |
|
|
54
|
-
|
|
55
|
-
### Curated 拒絕 Broker-installer 路線與零設定寫法
|
|
56
|
-
|
|
57
|
-
Rootless Broker 不支援 Container Manager 操作,因此 Curated 上架不接受 Broker-installer 路線:
|
|
58
|
-
- 官方 `nginx:alpine` 這類需要 root 權限啟動的 image 在 DSM Container Manager 注入 package UID 後會直接 `ExitCode 1` 起不來。
|
|
59
|
-
- `${SYNOPKG_PKGVAR}` 等平台 bind 應改用 named volume,或改用 D1 dynamic route 的 string/boolean 參數。
|
|
60
|
-
- Web 服務推薦使用可由任意 UID 執行的映像檔與專案相對路徑 bind(模板寫法):
|
|
61
|
-
|
|
62
|
-
```yaml
|
|
63
|
-
# 推薦的零設定 compose.yaml 寫法(參考 hello-web 模板)
|
|
64
|
-
services:
|
|
65
|
-
web:
|
|
66
|
-
image: busybox:1.36
|
|
67
|
-
command: ["sh","-c","httpd -f -p 18333 -h /usr/share/nginx/html"]
|
|
68
|
-
ports:
|
|
69
|
-
- "18333:18333"
|
|
70
|
-
volumes:
|
|
71
|
-
- "./html:/usr/share/nginx/html:ro"
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
(來源:docs/impl/STATUS.md A31、packages/app-cli/templates/hello-web/compose.yaml)
|
|
75
|
-
|
|
76
|
-
### Compose 變數未定義與執行身分限制
|
|
77
|
-
|
|
78
|
-
- **未定義變數會導致 DSM Worker 靜默失敗**:Compose 內引用的環境變數若未在契約 `install` 宣告或未提供預設值,DSM `docker-project` worker 會直接失敗,套件呈現 `broken 150` 且 `worker_msg` 為空。(來源:docs/impl/dynamic-compose-d3-runbook.md「DSM 事實」第 4 條、docs/impl/STATUS.md 關鍵教訓 11)
|
|
79
|
-
- **容器以 Package UID 執行**:DSM worker 會注入 `user: <package-uid>:<package-gid>`。以 root 擁有的 Docker named volume 會因為無寫入權限而報錯;容器如需寫入目錄,請寫入 `/tmp` 或由映像建立 package UID 可寫的目錄。(來源:docs/impl/STATUS.md 關鍵教訓 19)
|
|
11
|
+
容器沿用上游登入。包現成 Compose 時保留 upstream target,只把 host source 換成 `${PARAM}`;管理員在安裝時選 Share。不要硬編碼 NAS 路徑,不要以固定 UID/GID 冒充逐使用者 ACL。
|
|
80
12
|
|
|
81
|
-
##
|
|
13
|
+
## Published port
|
|
82
14
|
|
|
83
|
-
|
|
84
|
-
2. **顯示名稱**(`displayname`)。
|
|
85
|
-
3. **要不要碰 NAS 檔案** — 若要,預設走 Shared Folder(`hello-files`),不要默默加 `files.read`/`files.write`/`files.delete`(見 `files.md`)。
|
|
86
|
-
4. **已有 Compose 嗎** — 有則 `compose-import` + `inspect`。
|
|
15
|
+
hello-web 預設 published port 是 18333。每個 package/instance 都要分配獨立的 port;同一台 NAS 上不要重用。可挑選未使用的 19xxx 高位 port,例如 19160;同時修改 contract adminport 與 Compose published port,保留容器內 target。
|
|
87
16
|
|
|
88
|
-
|
|
17
|
+
## 建置與檢查
|
|
89
18
|
|
|
90
|
-
|
|
19
|
+
執行 validate、build-spk、inspect --spk,再看 deploy --dry-run。Go CGI 每包驗證 DSM session,root 模式只提供固定管理員核准工作。容器必須使用已建置映像;不支援的特權 host 存取、secret/config 與 build stanza 會拒絕。
|
|
91
20
|
|
|
92
|
-
|
|
93
|
-
- 要上 NAS:讀 `deploy.md`
|
|
21
|
+
安裝前讀 deploy.md。需要資料或登入時讀 files.md、identity.md;不加入尚未實作的 bridge。
|