@nocobase/app-plugin-releases 0.1.0-beta.0 → 0.1.0-beta.10
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 +201 -0
- package/README.md +47 -0
- package/dist/client/components/app-operations.d.ts +10 -0
- package/dist/client/components/app-operations.d.ts.map +1 -0
- package/dist/client/components/app-operations.js +26 -0
- package/dist/client/components/app-operations.js.map +1 -0
- package/dist/client/components/runtime-policy-fields.d.ts +7 -1
- package/dist/client/components/runtime-policy-fields.d.ts.map +1 -1
- package/dist/client/components/runtime-policy-fields.js +19 -5
- package/dist/client/components/runtime-policy-fields.js.map +1 -1
- package/dist/client/hooks/use-app-summary.d.ts +11 -0
- package/dist/client/hooks/use-app-summary.d.ts.map +1 -0
- package/dist/client/hooks/use-app-summary.js +108 -0
- package/dist/client/hooks/use-app-summary.js.map +1 -0
- package/dist/client/lib/app-operations.d.ts +7 -0
- package/dist/client/lib/app-operations.d.ts.map +1 -0
- package/dist/client/lib/app-operations.js +27 -0
- package/dist/client/lib/app-operations.js.map +1 -0
- package/dist/client/locales/de-DE.d.ts +5 -0
- package/dist/client/locales/de-DE.d.ts.map +1 -0
- package/dist/client/locales/de-DE.js +812 -0
- package/dist/client/locales/de-DE.js.map +1 -0
- package/dist/client/locales/en-US.d.ts +17 -0
- package/dist/client/locales/en-US.d.ts.map +1 -1
- package/dist/client/locales/en-US.js +17 -0
- package/dist/client/locales/en-US.js.map +1 -1
- package/dist/client/locales/es-ES.d.ts +5 -0
- package/dist/client/locales/es-ES.d.ts.map +1 -0
- package/dist/client/locales/es-ES.js +818 -0
- package/dist/client/locales/es-ES.js.map +1 -0
- package/dist/client/locales/fr-FR.d.ts +5 -0
- package/dist/client/locales/fr-FR.d.ts.map +1 -0
- package/dist/client/locales/fr-FR.js +818 -0
- package/dist/client/locales/fr-FR.js.map +1 -0
- package/dist/client/locales/id-ID.d.ts +5 -0
- package/dist/client/locales/id-ID.d.ts.map +1 -0
- package/dist/client/locales/id-ID.js +812 -0
- package/dist/client/locales/id-ID.js.map +1 -0
- package/dist/client/locales/index.d.ts.map +1 -1
- package/dist/client/locales/index.js +8 -0
- package/dist/client/locales/index.js.map +1 -1
- package/dist/client/locales/ja-JP.d.ts +5 -0
- package/dist/client/locales/ja-JP.d.ts.map +1 -0
- package/dist/client/locales/ja-JP.js +812 -0
- package/dist/client/locales/ja-JP.js.map +1 -0
- package/dist/client/locales/pt-BR.d.ts +5 -0
- package/dist/client/locales/pt-BR.d.ts.map +1 -0
- package/dist/client/locales/pt-BR.js +818 -0
- package/dist/client/locales/pt-BR.js.map +1 -0
- package/dist/client/locales/vi-VN.d.ts +5 -0
- package/dist/client/locales/vi-VN.d.ts.map +1 -0
- package/dist/client/locales/vi-VN.js +812 -0
- package/dist/client/locales/vi-VN.js.map +1 -0
- package/dist/client/locales/zh-CN.d.ts.map +1 -1
- package/dist/client/locales/zh-CN.js +17 -0
- package/dist/client/locales/zh-CN.js.map +1 -1
- package/dist/client/locales/zh-TW.d.ts +5 -0
- package/dist/client/locales/zh-TW.d.ts.map +1 -0
- package/dist/client/locales/zh-TW.js +812 -0
- package/dist/client/locales/zh-TW.js.map +1 -0
- package/dist/client/pages/app-page.d.ts.map +1 -1
- package/dist/client/pages/app-page.js +26 -16
- package/dist/client/pages/app-page.js.map +1 -1
- package/dist/client/pages/new-app-page.d.ts.map +1 -1
- package/dist/client/pages/new-app-page.js +15 -3
- package/dist/client/pages/new-app-page.js.map +1 -1
- package/dist/database/migrations/.manifest.json +6 -2
- package/dist/database/migrations/202610020001_rel_create_tables.js +1 -1
- package/dist/database/migrations/202610020001_rel_create_tables.js.map +1 -1
- package/dist/database/migrations/202610260002_rel_bound_artifact_keys.d.ts +4 -0
- package/dist/database/migrations/202610260002_rel_bound_artifact_keys.d.ts.map +1 -0
- package/dist/database/migrations/202610260002_rel_bound_artifact_keys.js +51 -0
- package/dist/database/migrations/202610260002_rel_bound_artifact_keys.js.map +1 -0
- package/dist/server/artifact-config.d.ts +9 -0
- package/dist/server/artifact-config.d.ts.map +1 -0
- package/dist/server/artifact-config.js +49 -0
- package/dist/server/artifact-config.js.map +1 -0
- package/dist/server/composition.d.ts +6 -0
- package/dist/server/composition.d.ts.map +1 -1
- package/dist/server/composition.js +7 -1
- package/dist/server/composition.js.map +1 -1
- package/dist/server/config.d.ts +7 -1
- package/dist/server/config.d.ts.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/locales/de-DE.d.ts +5 -0
- package/dist/server/locales/de-DE.d.ts.map +1 -0
- package/dist/server/locales/de-DE.js +133 -0
- package/dist/server/locales/de-DE.js.map +1 -0
- package/dist/server/locales/es-ES.d.ts +5 -0
- package/dist/server/locales/es-ES.d.ts.map +1 -0
- package/dist/server/locales/es-ES.js +133 -0
- package/dist/server/locales/es-ES.js.map +1 -0
- package/dist/server/locales/fr-FR.d.ts +5 -0
- package/dist/server/locales/fr-FR.d.ts.map +1 -0
- package/dist/server/locales/fr-FR.js +133 -0
- package/dist/server/locales/fr-FR.js.map +1 -0
- package/dist/server/locales/id-ID.d.ts +5 -0
- package/dist/server/locales/id-ID.d.ts.map +1 -0
- package/dist/server/locales/id-ID.js +133 -0
- package/dist/server/locales/id-ID.js.map +1 -0
- package/dist/server/locales/index.d.ts.map +1 -1
- package/dist/server/locales/index.js +8 -0
- package/dist/server/locales/index.js.map +1 -1
- package/dist/server/locales/ja-JP.d.ts +5 -0
- package/dist/server/locales/ja-JP.d.ts.map +1 -0
- package/dist/server/locales/ja-JP.js +133 -0
- package/dist/server/locales/ja-JP.js.map +1 -0
- package/dist/server/locales/pt-BR.d.ts +5 -0
- package/dist/server/locales/pt-BR.d.ts.map +1 -0
- package/dist/server/locales/pt-BR.js +133 -0
- package/dist/server/locales/pt-BR.js.map +1 -0
- package/dist/server/locales/vi-VN.d.ts +5 -0
- package/dist/server/locales/vi-VN.d.ts.map +1 -0
- package/dist/server/locales/vi-VN.js +133 -0
- package/dist/server/locales/vi-VN.js.map +1 -0
- package/dist/server/locales/zh-TW.d.ts +5 -0
- package/dist/server/locales/zh-TW.d.ts.map +1 -0
- package/dist/server/locales/zh-TW.js +133 -0
- package/dist/server/locales/zh-TW.js.map +1 -0
- package/dist/server/providers/releases.d.ts.map +1 -1
- package/dist/server/providers/releases.js +7 -5
- package/dist/server/providers/releases.js.map +1 -1
- package/dist/server/routes/schemas.d.ts.map +1 -1
- package/dist/server/routes/schemas.js +207 -85
- package/dist/server/routes/schemas.js.map +1 -1
- package/dist/server/services/artifact.d.ts.map +1 -1
- package/dist/server/services/artifact.js +1 -2
- package/dist/server/services/artifact.js.map +1 -1
- package/dist/server/services/config-file.js +1 -1
- package/dist/server/services/releases.d.ts +2 -0
- package/dist/server/services/releases.d.ts.map +1 -1
- package/dist/server/services/releases.js +7 -4
- package/dist/server/services/releases.js.map +1 -1
- package/dist/server/services/validation.d.ts +2 -0
- package/dist/server/services/validation.d.ts.map +1 -1
- package/dist/server/services/validation.js +8 -0
- package/dist/server/services/validation.js.map +1 -1
- package/package.json +18 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,206 @@
|
|
|
1
1
|
# @nocobase/app-plugin-releases
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4b36a3d: Complete runtime timer inheritance labels in every supported client locale so the release management package builds and the settings remain translated.
|
|
8
|
+
- 10120a1: Let newly created apps inherit environment runtime timer defaults until a timer is explicitly customized.
|
|
9
|
+
- Updated dependencies [62da032]
|
|
10
|
+
- @nocobase/app-client@4.0.0-beta.1
|
|
11
|
+
- @nocobase/app-server@3.0.0-beta.1
|
|
12
|
+
- @nocobase/app-plugin-authentication@2.0.0-beta.12
|
|
13
|
+
- @nocobase/app-plugin-authorization@1.0.0-beta.30
|
|
14
|
+
|
|
15
|
+
## 0.1.0-beta.9
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 1952789: Complete all ten supported languages in plugin and example plugin catalogues, including model suggestions and test Web Push notifications. Align calendars and invitation emails, support locale-specific plural forms, and validate resource loading and formatting.
|
|
20
|
+
|
|
21
|
+
Correct joined translation text and distinguish configuration save actions, refund stages, and domain-specific operation labels.
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [1952789]
|
|
24
|
+
- Updated dependencies [06e53be]
|
|
25
|
+
- @nocobase/app-plugin-authentication@2.0.0-beta.12
|
|
26
|
+
- @nocobase/app-plugin-authorization@1.0.0-beta.30
|
|
27
|
+
- @nocobase/i18n@2.0.0-beta.1
|
|
28
|
+
- @nocobase/authorization@1.0.0-beta.15
|
|
29
|
+
- @nocobase/app-client@4.0.0-beta.0
|
|
30
|
+
|
|
31
|
+
## 0.1.0-beta.8
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- 1952789: Require explicitly declared realtime topics and authorize dynamic resources before subscription and delivery. Isolate the server core behind a broker contract, retain the application adapter and service tokens, and handle asynchronous publication throughout plugins and examples. Add acknowledged browser subscriptions, bounded recovery and heartbeat handling, shared React refresh helpers, original-session revalidation, transport limits, and usage documentation. The included adapter remains in-process; events are transient and clients recover by refetching after acknowledgement.
|
|
36
|
+
- 7afd595: Remove Refine from the client runtime
|
|
37
|
+
|
|
38
|
+
The application shell no longer mounts Refine. `@nocobase/app-client` drops `app.refine`, `app.refineConfig`, `AppClientRefineConfig`, `AppClientRefineRegistry`, `AppClientRefineSetters`, `AppClientRefineSetterValue` and the provider-context methods `runWithProviderContext` and `runWithProviderContextAsync`, which existed only to attribute Refine settings to the provider that made them. Nothing in the repository read what was registered there: a title set through `app.refine.setOptions` never reached the page, and Refine resources never produced a menu entry.
|
|
39
|
+
|
|
40
|
+
Refine also created the TanStack Query cache that pages read through `useQueryClient()`; `AppClientProviders` now creates it in the same place, the same way, so pages and plugins behave as before. `@tanstack/react-query` becomes a peer dependency of `@nocobase/app-client` and joins the identity-sensitive packages that plugins must declare as peers.
|
|
41
|
+
|
|
42
|
+
`@nocobase/i18n/client` drops `createRefineI18nProvider`, `CreateRefineI18nProviderOptions` and `RefineI18nProvider`. `@nocobase/app-plugin-repository-example` drops its Client ServiceProvider and the `./client/providers` export, which only registered Refine resources.
|
|
43
|
+
|
|
44
|
+
`nocobase build` builds the client with `vite build` instead of `refine build`, and `@nocobase/app-cli` no longer lists `@refinedev/cli` as an optional peer. The Default and Examples templates remove every `@refinedev/*` development dependency. The development and plugin Skills no longer mention Refine, and the upgrade Skill explains how an existing application removes its `this.app.refine` calls and Refine packages.
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [1952789]
|
|
47
|
+
- Updated dependencies [1952789]
|
|
48
|
+
- Updated dependencies [1952789]
|
|
49
|
+
- Updated dependencies [1952789]
|
|
50
|
+
- Updated dependencies [1952789]
|
|
51
|
+
- Updated dependencies [7afd595]
|
|
52
|
+
- @nocobase/app-client@4.0.0-beta.0
|
|
53
|
+
- @nocobase/app-host@0.1.0-beta.17
|
|
54
|
+
- @nocobase/app-host-docker@0.1.0-beta.2
|
|
55
|
+
- @nocobase/app-plugin-authentication@2.0.0-beta.11
|
|
56
|
+
- @nocobase/app-plugin-authorization@1.0.0-beta.29
|
|
57
|
+
- @nocobase/app-server@3.0.0-beta.0
|
|
58
|
+
- @nocobase/i18n@2.0.0-beta.0
|
|
59
|
+
- @nocobase/authorization@1.0.0-beta.14
|
|
60
|
+
- @nocobase/config@0.1.0-beta.3
|
|
61
|
+
- @nocobase/db@1.0.0-beta.21
|
|
62
|
+
- @nocobase/service-provider@0.0.2-beta.2
|
|
63
|
+
|
|
64
|
+
## 0.1.0-beta.7
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- 22717d7: Support synchronous custom driver factories alongside existing configuration objects in `drive.disks`. Create drivers lazily through the shared application Drive provider, preserve Flydrive caching and fakes, and reject factory references where release artifacts require serializable Host configuration. Ship the `nocobase-drive` Skill with filesystem, S3, native Aliyun OSS, and custom driver guides, and direct application guidance to that shared documentation. Consumers reading disk configuration fields must narrow out factory functions first.
|
|
69
|
+
- Updated dependencies [22717d7]
|
|
70
|
+
- @nocobase/drive@0.1.0-beta.7
|
|
71
|
+
- @nocobase/app-server@2.0.0-beta.9
|
|
72
|
+
- @nocobase/app-plugin-authentication@2.0.0-beta.10
|
|
73
|
+
|
|
74
|
+
## 0.1.0-beta.6
|
|
75
|
+
|
|
76
|
+
### Minor Changes
|
|
77
|
+
|
|
78
|
+
- fe81e4b: Allow releases.artifact to reference a named drive disk with an optional relative artifact key prefix. The referenced disk is validated with the drive's own rules and must be private. Repeated slashes in the prefix are collapsed. Preserve full disk configurations and existing artifact keys when changing the prefix.
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- 49f61b9: Show optional settings permissions separately from business actions in CLI identity output, and explain run-token-only permissions. Add available-command typo suggestions, a hint for truncated text, and clean shutdown when a pipe closes early. Describe route schema inputs so generated CLI help and reference tables explain their parameters. The manifest identity and whoami JSON result gain an optional settings list; command admission and authorization are unchanged.
|
|
83
|
+
- Updated dependencies [98b3862]
|
|
84
|
+
- Updated dependencies [89648ee]
|
|
85
|
+
- Updated dependencies [fe81e4b]
|
|
86
|
+
- Updated dependencies [1cdbaf4]
|
|
87
|
+
- Updated dependencies [5fe8773]
|
|
88
|
+
- Updated dependencies [b22d999]
|
|
89
|
+
- Updated dependencies [0037dd2]
|
|
90
|
+
- Updated dependencies [c0b7537]
|
|
91
|
+
- Updated dependencies [eb4b081]
|
|
92
|
+
- Updated dependencies [14b7aec]
|
|
93
|
+
- Updated dependencies [49f61b9]
|
|
94
|
+
- Updated dependencies [0037dd2]
|
|
95
|
+
- @nocobase/db@1.0.0-beta.21
|
|
96
|
+
- @nocobase/drive@0.1.0-beta.6
|
|
97
|
+
- @nocobase/app-host@0.1.0-beta.16
|
|
98
|
+
- @nocobase/app-client@3.0.0-beta.2
|
|
99
|
+
- @nocobase/app-server@2.0.0-beta.8
|
|
100
|
+
- @nocobase/app-plugin-authentication@2.0.0-beta.10
|
|
101
|
+
- @nocobase/app-plugin-authorization@1.0.0-beta.28
|
|
102
|
+
- @nocobase/authorization@1.0.0-beta.14
|
|
103
|
+
- @nocobase/app-host-docker@0.1.0-beta.1
|
|
104
|
+
- @nocobase/config@0.1.0-beta.3
|
|
105
|
+
- @nocobase/i18n@1.0.0-beta.7
|
|
106
|
+
- @nocobase/service-provider@0.0.2-beta.2
|
|
107
|
+
|
|
108
|
+
## 0.1.0-beta.5
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- 943a9a8: Fix MySQL installation of the agents and releases plugins by removing the unused directory/status index and limiting archive artifact keys to 172 characters while preserving full-value uniqueness. Add a Collection builder inspection method and forward migrations to converge existing installations without truncating data; oversized legacy artifact keys stop the upgrade before any column or index change. Rebuild the existing artifact-key unique index within the migration transaction on SQL Server so indexed legacy columns can be shortened while retaining uniqueness, nullable behavior and the actual index name under custom naming configurations.
|
|
113
|
+
|
|
114
|
+
This fix edits the released migrations `202610020003_ag_create_runs` and `202610020001_rel_create_tables` because their oversized indexes prevent fresh MySQL installations from reaching a later repair migration. Existing installations should expect checksum warnings on the next `nocobase db apply`; installations using `onChecksumMismatch: error` stop instead. After reviewing these exact changes, use `nocobase db repair --dry-run` and then `nocobase db repair` to acknowledge the new checksums, followed by `nocobase db apply` to perform the forward schema changes. Repairing checksums alone does not upgrade the schema. The forward corrections are irreversible because restoring the old indexes would make MySQL installations invalid again. See the plugins' `docs/mysql-installation-upgrade.md` for the upgrade and failed-installation recovery procedure.
|
|
115
|
+
|
|
116
|
+
- Updated dependencies [69e212c]
|
|
117
|
+
- Updated dependencies [943a9a8]
|
|
118
|
+
- Updated dependencies [943a9a8]
|
|
119
|
+
- Updated dependencies [1cd749c]
|
|
120
|
+
- Updated dependencies [bdb0581]
|
|
121
|
+
- Updated dependencies [9b946f4]
|
|
122
|
+
- @nocobase/app-server@2.0.0-beta.7
|
|
123
|
+
- @nocobase/db@1.0.0-beta.20
|
|
124
|
+
- @nocobase/app-plugin-authentication@2.0.0-beta.9
|
|
125
|
+
- @nocobase/app-plugin-authorization@1.0.0-beta.27
|
|
126
|
+
|
|
127
|
+
## 0.1.0-beta.4
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- 693e43d: Update agent guidance to refer to the renamed `nocobase-app-plugin-development` Skill.
|
|
132
|
+
- Updated dependencies [d54dd59]
|
|
133
|
+
- @nocobase/app-plugin-authentication@2.0.0-beta.7
|
|
134
|
+
|
|
135
|
+
## 0.1.0-beta.3
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- cf23bfe: Republish every package so the `latest` dist-tag points at its current beta release, matching `beta`.
|
|
140
|
+
- Updated dependencies [cf23bfe]
|
|
141
|
+
- @nocobase/app-client@3.0.0-beta.1
|
|
142
|
+
- @nocobase/app-host@0.1.0-beta.15
|
|
143
|
+
- @nocobase/app-host-docker@0.1.0-beta.1
|
|
144
|
+
- @nocobase/app-plugin-authentication@2.0.0-beta.6
|
|
145
|
+
- @nocobase/app-plugin-authorization@1.0.0-beta.27
|
|
146
|
+
- @nocobase/app-server@2.0.0-beta.4
|
|
147
|
+
- @nocobase/authorization@1.0.0-beta.13
|
|
148
|
+
- @nocobase/config@0.1.0-beta.3
|
|
149
|
+
- @nocobase/db@1.0.0-beta.19
|
|
150
|
+
- @nocobase/drive@0.1.0-beta.5
|
|
151
|
+
- @nocobase/i18n@1.0.0-beta.7
|
|
152
|
+
- @nocobase/logging@0.1.0-beta.7
|
|
153
|
+
- @nocobase/secrets@0.1.0-beta.1
|
|
154
|
+
- @nocobase/service-provider@0.0.2-beta.2
|
|
155
|
+
|
|
156
|
+
## 0.1.0-beta.2
|
|
157
|
+
|
|
158
|
+
### Minor Changes
|
|
159
|
+
|
|
160
|
+
- c796cb9: Remove the Settings and Dev route surfaces. `@nocobase/app-client` no longer exports `defineSettingsRoutes()`, `defineDevRoutes()`, `isAppClientSettingsRouteGroup()`, `isAppClientDevRouteGroup()` or their definition, contribution and registered-route types, and the resolved runtime no longer carries `settingsRouteTree`, `devRouteTree`, `settings`, `settingGroups`, `devRoutes` or `devRouteGroups`. `AppClientSettingsRouteNavigation` is renamed `AppClientRouteNavigation` and `AppClientSettingIcon` is renamed `AppClientRouteIcon`. A contribution to any parent other than `app` now fails registration with a message that names `defineAppRoutes()`. Plugins contribute no settings or dev pages; an application that wants a configuration page declares it with `defineAppRoutes()` in its own navigation, for example under a Settings group.
|
|
161
|
+
|
|
162
|
+
The default and examples templates drop the settings layout, the `/settings/*` route, the dev route plumbing, and the Settings and Inbox buttons in the header; the `/inbox` page and the inbox block stay. The examples template no longer registers `@nocobase/app-plugin-departments-example`, which is removed. Upgrading an application means removing `defineSettingsRoutes([])` from `client/routes.ts`, the `settingsRouteTree` and `devRouteTree` props passed to `AppRouter`, and any settings layout it kept, and moving its own settings pages to `defineAppRoutes()`. Every package that depends on or peers with `@nocobase/app-client` is released again so that its published range accepts `3.0.0-beta.0`.
|
|
163
|
+
|
|
164
|
+
### Patch Changes
|
|
165
|
+
|
|
166
|
+
- c796cb9: Remove the AI employee packages from the repository
|
|
167
|
+
|
|
168
|
+
`@nocobase/app-plugin-ai-employee`, `@nocobase/ai-employee` and `@nocobase/app-plugin-ai-employee-example` were already deprecated and no template installed them; they are now deleted and will not be released again. The Default and Examples templates drop `@nocobase/ai-employee-avatars`, which only the plugin's avatars used.
|
|
169
|
+
|
|
170
|
+
Generated plugins' `AGENTS.md` and the copies shipped with existing plugins no longer list `@nocobase/ai-employee` among the identity-sensitive packages. The HTTP API references in the application development Skill use other plugins for their examples, and the upgrade Skill tells an application that still depends on the removed packages to review their usage before removing them, because the runtime will move past what their peer ranges accept.
|
|
171
|
+
|
|
172
|
+
`pnpm build` no longer copies `ai/skills` into `dist/ai/skills`. The AI employee plugin was the only reader of that directory; an application that keeps Skills there for another purpose has to copy them itself, for example from a build hook.
|
|
173
|
+
|
|
174
|
+
- c796cb9: Remove NocoBase Hub. `@nocobase/app-plugin-hub`, `@nocobase/app-template-hub` and `@nocobase/hub-cli` are no longer published, and every package that offered or described the Hub drops it.
|
|
175
|
+
|
|
176
|
+
Breaking for `@nocobase/app-installer`: it installs, upgrades and rolls back from a deployment archive only. `install --template`, `install --keep-source`, `upgrade --to`, `upgrade --rebuild`, `upgrade --keep-source` and `status --offline` are removed, as are the `latest` and `updateAvailable` members of the `status` result and the `rebuilt` and `notes` members of the `upgrade` result. An installation an earlier version built from the published Hub template is refused with `STATE_UNSUPPORTED`; manage it with the app-installer version that installed it. The error codes that only a template build reported (`PNPM_MISSING`, `PNPM_UNSUPPORTED`, `REGISTRY_UNREACHABLE`, `VERSION_NOT_FOUND`, `DISK_LOW`, `CREATE_FAILED`, `DRIVER_INSTALL_FAILED` and `BUILD_FAILED`) are no longer produced, and pm2 always kills the process tree of an application it stops.
|
|
177
|
+
|
|
178
|
+
Breaking for `@nocobase/create-app`: `--template hub` is no longer a template name, and a generated application no longer gets a `.env`.
|
|
179
|
+
|
|
180
|
+
The Default template no longer depends on `@nocobase/hub-cli`, so an application generated from it has no `pnpm nocobase hub` commands. An application upgraded from an earlier version that published to a Hub removes the dependency with `pnpm nocobase package remove @nocobase/hub-cli` and deletes `.nocobase/hub.json`; the `nocobase-app-upgrade` Skill describes the steps. The application Skills, the plugins' documentation and the in-app test notification text no longer mention the Hub.
|
|
181
|
+
|
|
182
|
+
- Updated dependencies [c796cb9]
|
|
183
|
+
- Updated dependencies [c796cb9]
|
|
184
|
+
- Updated dependencies [c796cb9]
|
|
185
|
+
- Updated dependencies [98e79a5]
|
|
186
|
+
- Updated dependencies [fb7b576]
|
|
187
|
+
- @nocobase/app-server@2.0.0-beta.3
|
|
188
|
+
- @nocobase/app-plugin-authentication@2.0.0-beta.3
|
|
189
|
+
- @nocobase/app-plugin-authorization@1.0.0-beta.26
|
|
190
|
+
- @nocobase/app-client@3.0.0-beta.0
|
|
191
|
+
- @nocobase/i18n@1.0.0-beta.6
|
|
192
|
+
- @nocobase/app-host-docker@0.1.0-beta.0
|
|
193
|
+
- @nocobase/authorization@1.0.0-beta.12
|
|
194
|
+
- @nocobase/config@0.1.0-beta.2
|
|
195
|
+
- @nocobase/db@1.0.0-beta.18
|
|
196
|
+
- @nocobase/service-provider@0.0.2-beta.1
|
|
197
|
+
|
|
198
|
+
## 0.1.0-beta.1
|
|
199
|
+
|
|
200
|
+
### Patch Changes
|
|
201
|
+
|
|
202
|
+
- 3380f9d: Update application lifecycle buttons from the current runtime state, explain unavailable operations, and refresh visible application pages automatically with retry and stale-response protection.
|
|
203
|
+
|
|
3
204
|
## 0.1.0-beta.0
|
|
4
205
|
|
|
5
206
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -20,6 +20,53 @@ Environment credentials and registry passwords are sealed with the application's
|
|
|
20
20
|
|
|
21
21
|
Client: list `@nocobase/app-plugin-releases/client`. Pass `routes: false` and use `@nocobase/app-plugin-releases/client/pages` to place the pages yourself; otherwise they mount at `/releases` and `/release-environments` (paths are options), with an App's page at `:appId` (Overview, Deployments, Variables, Settings) and an environment's at `:environmentId` (Overview, Variables, Settings) below them, the tab in `?tab=`. An application that mounts the pages elsewhere provides `ReleasesPathsContext` (or wraps them with `withReleasesPaths`) so they link to one another.
|
|
22
22
|
|
|
23
|
+
## Artifact storage
|
|
24
|
+
|
|
25
|
+
`releases.artifact` accepts either a complete disk configuration or `{ disk: <name>, prefix?: <prefix> }`. A reference selects the named disk from the application's final `drive.disks` configuration; it never falls back to `drive.default`. Only `disk` and `prefix` are allowed in a reference: configure drivers, credentials and other storage options on the disk itself. The referenced disk is validated by `@nocobase/drive` with the same rules as any other disk, so options the driver defaults, such as `forcePathStyle` and `supportsACL` on S3, may be omitted. The referenced disk must have `visibility: private`: release archives carry server code and configuration templates, and on a public disk who can read them is decided by the storage itself, such as an S3 bucket policy when the disk has no ACL support, rather than by this plugin's permission checks, so a public disk is rejected at startup.
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
drive:
|
|
29
|
+
default: local
|
|
30
|
+
disks:
|
|
31
|
+
local:
|
|
32
|
+
driver: fs
|
|
33
|
+
location: storage/files
|
|
34
|
+
visibility: private
|
|
35
|
+
oss:
|
|
36
|
+
driver: s3
|
|
37
|
+
bucket: release-archives
|
|
38
|
+
region: auto
|
|
39
|
+
endpoint: https://s3.example.com
|
|
40
|
+
forcePathStyle: true
|
|
41
|
+
supportsACL: false
|
|
42
|
+
visibility: private
|
|
43
|
+
credentials: {} # Uses the S3 default credential provider chain.
|
|
44
|
+
releases:
|
|
45
|
+
artifact:
|
|
46
|
+
disk: oss
|
|
47
|
+
prefix: releases
|
|
48
|
+
dataDir: storage/releases
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Use `disk: local` to store archives on the filesystem. A prefix is relative to the disk root: `releases` stores new uploads and promoted archives at `releases/<appId>/<releaseId>.tar.gz` on both filesystem and S3 disks. Omit `prefix` or set it to an empty string to use the root; repeated `/` characters are collapsed into one, so `releases//archives` is `releases/archives`, and trailing `/` characters are removed. Absolute paths, backslashes, `.` or `..` path segments and control characters are rejected. The complete artifact key, including the prefix, must fit the database limit of 172 characters; uploads and promotions reject longer keys before writing files. A prefix organizes files; it is not a permission boundary.
|
|
52
|
+
|
|
53
|
+
Existing complete configurations continue to work:
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
releases:
|
|
57
|
+
artifact:
|
|
58
|
+
driver: fs
|
|
59
|
+
location: storage/artifacts
|
|
60
|
+
visibility: private
|
|
61
|
+
dataDir: storage/releases
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The plugin copies referenced disk configuration without changing `drive.disks`. Both managed Hosts receive the resolved complete configuration; prefixes are applied only when generating new artifact keys. Changing the prefix on the same disk leaves existing records and files in place: old releases still deploy, roll back, promote and delete using their recorded keys. Changing the disk requires the operator to migrate existing files. Invalid references fail before services or Hosts are initialized, and configuration errors never include credentials.
|
|
65
|
+
|
|
66
|
+
Applications composing services directly with `createReleases({ config, drive, ... })` pass the final `AppDriveConfig` as the optional `drive` argument when `config.artifact` references a named disk. Existing callers with a complete artifact disk configuration need no changes.
|
|
67
|
+
|
|
68
|
+
Drive also accepts synchronous driver factories in `drive.disks`, but release artifact references require serializable disk configuration objects for the Hosts. Referencing a factory fails before Host initialization without invoking the factory. Configure an object disk for release artifacts; factories remain available for application file storage.
|
|
69
|
+
|
|
23
70
|
## CI and API keys with a scope
|
|
24
71
|
|
|
25
72
|
The plugin has no keys of its own. The API is authenticated by the application, which accepts a person's session or an API key, and opts into scoped keys (`auth.required({ scopedKeys: true })`). A request made with a scoped key (or any key of a service account) carries the key's `KeyScope` on its identity, and `callerOf` turns it into a `key` caller: its permissions are cut down to what the scope covers, and the Apps it reaches to the ones the scope picked (`keyScope.objects('rel.apps')`), for listing as well as every App check.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { AppSummary } from '../../shared/releases.js';
|
|
3
|
+
import { type AppOperation } from '../lib/app-operations.js';
|
|
4
|
+
export declare function AppOperations({ summary, busy, stale, onRun, }: {
|
|
5
|
+
readonly summary: AppSummary;
|
|
6
|
+
readonly busy: string | null;
|
|
7
|
+
readonly stale: boolean;
|
|
8
|
+
readonly onRun: (operation: AppOperation) => void;
|
|
9
|
+
}): ReactElement;
|
|
10
|
+
//# sourceMappingURL=app-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-operations.d.ts","sourceRoot":"","sources":["../../../client/components/app-operations.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAC;AAGjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,0BAA0B,CAAC;AAgBlC,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,IAAI,CAAC;CACnD,GAAG,YAAY,CAmDf"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from '@nocobase/i18n/client';
|
|
3
|
+
import { PlayIcon, RotateCwIcon, SquareIcon } from 'lucide-react';
|
|
4
|
+
import { useId } from 'react';
|
|
5
|
+
import { ACCESS_NAMESPACE } from '../../shared/access.js';
|
|
6
|
+
import { operationDisabledReason, } from '../lib/app-operations.js';
|
|
7
|
+
import { Button } from './ui/button.js';
|
|
8
|
+
import { Spinner } from './ui/spinner.js';
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from './ui/tooltip.js';
|
|
10
|
+
const ICONS = {
|
|
11
|
+
start: _jsx(PlayIcon, { "data-icon": 'inline-start' }),
|
|
12
|
+
stop: _jsx(SquareIcon, { "data-icon": 'inline-start' }),
|
|
13
|
+
restart: _jsx(RotateCwIcon, { "data-icon": 'inline-start' }),
|
|
14
|
+
};
|
|
15
|
+
export function AppOperations({ summary, busy, stale, onRun, }) {
|
|
16
|
+
const { t } = useTranslation(ACCESS_NAMESPACE);
|
|
17
|
+
const descriptionId = useId();
|
|
18
|
+
return (_jsx(TooltipProvider, { children: ['start', 'stop', 'restart'].map((operation) => {
|
|
19
|
+
const reason = operationDisabledReason(summary, operation, busy !== null, stale);
|
|
20
|
+
return (_jsxs(Tooltip, { disabled: !reason, children: [_jsxs(TooltipTrigger, { "aria-describedby": reason ? `${descriptionId}-${operation}` : undefined, render: _jsx(Button, { variant: 'outline', "aria-label": t(`ui.operate.${operation}`), disabled: !!reason, focusableWhenDisabled: true, className: 'data-disabled:opacity-50', onClick: () => {
|
|
21
|
+
if (!reason)
|
|
22
|
+
onRun(operation);
|
|
23
|
+
} }), children: [busy === operation ? (_jsx(Spinner, { "data-icon": 'inline-start' })) : (ICONS[operation]), t(`ui.operate.${operation}`)] }), reason ? (_jsx(TooltipContent, { id: `${descriptionId}-${operation}`, role: 'tooltip', children: t(`ui.operate.disabled.${reason}`) })) : null] }, operation));
|
|
24
|
+
}) }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=app-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-operations.js","sourceRoot":"","sources":["../../../client/components/app-operations.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,KAAK,EAAqC,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EACL,uBAAuB,GAExB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,KAAK,GAA8C;IACvD,KAAK,EAAE,KAAC,QAAQ,iBAAW,cAAc,GAAG;IAC5C,IAAI,EAAE,KAAC,UAAU,iBAAW,cAAc,GAAG;IAC7C,OAAO,EAAE,KAAC,YAAY,iBAAW,cAAc,GAAG;CACnD,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,EAC5B,OAAO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C;QACJ,CAAC,CAAC,GACc,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import { type RuntimePolicyDraft } from '../lib/runtime-policy.js';
|
|
3
|
-
export declare function RuntimePolicyFields({ value, onChange, supported, }: {
|
|
3
|
+
export declare function RuntimePolicyFields({ value, onChange, supported, timerModes, onTimerModesChange, }: {
|
|
4
4
|
readonly value: RuntimePolicyDraft;
|
|
5
5
|
readonly onChange: (value: RuntimePolicyDraft) => void;
|
|
6
6
|
/** Whether the environment's driver honours the policy. */
|
|
7
7
|
readonly supported?: boolean;
|
|
8
|
+
/** In a new App, each blank timer may inherit independently or explicitly be off. */
|
|
9
|
+
readonly timerModes?: {
|
|
10
|
+
readonly idle: 'inherit' | 'custom';
|
|
11
|
+
readonly dormant: 'inherit' | 'custom';
|
|
12
|
+
};
|
|
13
|
+
readonly onTimerModesChange?: (modes: NonNullable<typeof timerModes>) => void;
|
|
8
14
|
}): ReactElement;
|
|
9
15
|
//# sourceMappingURL=runtime-policy-fields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-policy-fields.d.ts","sourceRoot":"","sources":["../../../client/components/runtime-policy-fields.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAsBlC,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,SAAgB,
|
|
1
|
+
{"version":3,"file":"runtime-policy-fields.d.ts","sourceRoot":"","sources":["../../../client/components/runtime-policy-fields.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAsBlC,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,SAAgB,EAChB,UAAU,EACV,kBAAkB,GACnB,EAAE;IACD,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACvD,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,qFAAqF;IACrF,QAAQ,CAAC,UAAU,CAAC,EAAE;QACpB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;QACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ,CAAC;KACxC,CAAC;IACF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,UAAU,CAAC,KAAK,IAAI,CAAC;CAC/E,GAAG,YAAY,CAsIf"}
|
|
@@ -10,17 +10,31 @@ import { parsePolicyDraft, } from '../lib/runtime-policy.js';
|
|
|
10
10
|
import { Field, FieldDescription, FieldError, FieldGroup, FieldLabel, } from './ui/field.js';
|
|
11
11
|
import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, } from './ui/input-group.js';
|
|
12
12
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from './ui/select.js';
|
|
13
|
-
export function RuntimePolicyFields({ value, onChange, supported = true, }) {
|
|
13
|
+
export function RuntimePolicyFields({ value, onChange, supported = true, timerModes, onTimerModesChange, }) {
|
|
14
14
|
const { t } = useTranslation(ACCESS_NAMESPACE);
|
|
15
|
-
const
|
|
15
|
+
const effectiveValue = timerModes
|
|
16
|
+
? {
|
|
17
|
+
...value,
|
|
18
|
+
idleStopMinutes: timerModes.idle === 'inherit' ? '' : value.idleStopMinutes,
|
|
19
|
+
dormantAfterHours: timerModes.dormant === 'inherit' ? '' : value.dormantAfterHours,
|
|
20
|
+
}
|
|
21
|
+
: value;
|
|
22
|
+
const parsed = parsePolicyDraft(effectiveValue);
|
|
16
23
|
const items = ['eager', 'onDemand'].map((activation) => ({
|
|
17
24
|
value: activation,
|
|
18
25
|
label: t(`ui.policy.activation.${activation}`),
|
|
19
26
|
}));
|
|
20
|
-
return (_jsxs(FieldGroup, { className: 'gap-4', children: [_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: 'rel-policy-activation', children: t('ui.policy.activationLabel') }), _jsxs(Select, { items: items, value: value.activation, onValueChange: (next) => onChange({ ...value, activation: next ?? 'eager' }), children: [_jsx(SelectTrigger, { id: 'rel-policy-activation', className: 'w-full', children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { className: 'w-auto max-w-[min(var(--container-sm),var(--available-width))] min-w-(--anchor-width) [&_[data-slot=select-item]>:first-child]:whitespace-normal', children: items.map((item) => (_jsx(SelectItem, { value: item.value, children: item.label }, item.value))) })] }), _jsx(FieldDescription, { children: t(`ui.policy.activationHint.${value.activation}`) })] }), _jsxs("div", { className: 'grid gap-4 sm:grid-cols-2', children: [_jsxs(Field, { "data-invalid": parsed.errors?.idle ? true : undefined, children: [_jsx(FieldLabel, { htmlFor: 'rel-policy-idle', children: t('ui.policy.idleLabel') }), _jsxs(InputGroup, { children: [_jsx(InputGroupInput, { id: 'rel-policy-idle', inputMode: 'numeric', value: value.idleStopMinutes, placeholder: t('ui.policy.neverIdle'), "aria-invalid": parsed.errors?.idle ? true : undefined, onChange: (event) => onChange({ ...value, idleStopMinutes: event.target.value }) }), _jsx(InputGroupAddon, { align: 'inline-end', children: _jsx(InputGroupText, { children: t('ui.policy.minutes') }) })] }), parsed.errors?.idle ? (_jsx(FieldError, { children: t(`ui.policy.errors.${parsed.errors.idle}`, {
|
|
27
|
+
return (_jsxs(FieldGroup, { className: 'gap-4', children: [_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: 'rel-policy-activation', children: t('ui.policy.activationLabel') }), _jsxs(Select, { items: items, value: value.activation, onValueChange: (next) => onChange({ ...value, activation: next ?? 'eager' }), children: [_jsx(SelectTrigger, { id: 'rel-policy-activation', className: 'w-full', children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { className: 'w-auto max-w-[min(var(--container-sm),var(--available-width))] min-w-(--anchor-width) [&_[data-slot=select-item]>:first-child]:whitespace-normal', children: items.map((item) => (_jsx(SelectItem, { value: item.value, children: item.label }, item.value))) })] }), _jsx(FieldDescription, { children: t(`ui.policy.activationHint.${value.activation}`) })] }), _jsxs("div", { className: 'grid gap-4 sm:grid-cols-2', children: [_jsxs(Field, { "data-invalid": parsed.errors?.idle ? true : undefined, children: [_jsx(FieldLabel, { htmlFor: 'rel-policy-idle', children: t('ui.policy.idleLabel') }), timerModes ? (_jsx(TimerModeSelect, { id: 'rel-policy-idle-mode', label: t('ui.policy.idleModeLabel'), value: timerModes.idle, onChange: (idle) => onTimerModesChange?.({ ...timerModes, idle }), t: t })) : null, _jsxs(InputGroup, { children: [_jsx(InputGroupInput, { id: 'rel-policy-idle', inputMode: 'numeric', value: timerModes?.idle === 'inherit' ? '' : value.idleStopMinutes, placeholder: t('ui.policy.neverIdle'), disabled: timerModes?.idle === 'inherit', "aria-invalid": parsed.errors?.idle ? true : undefined, onChange: (event) => onChange({ ...value, idleStopMinutes: event.target.value }) }), _jsx(InputGroupAddon, { align: 'inline-end', children: _jsx(InputGroupText, { children: t('ui.policy.minutes') }) })] }), parsed.errors?.idle ? (_jsx(FieldError, { children: t(`ui.policy.errors.${parsed.errors.idle}`, {
|
|
21
28
|
max: APP_POLICY_LIMITS.idleStopMinutes.max,
|
|
22
|
-
}) })) : null] }), _jsxs(Field, { "data-invalid": parsed.errors?.dormant ? true : undefined, children: [_jsx(FieldLabel, { htmlFor: 'rel-policy-dormant', children: t('ui.policy.dormantLabel') }), _jsxs(InputGroup, { children: [_jsx(InputGroupInput, { id: 'rel-policy-dormant', inputMode: 'decimal', value: value.dormantAfterHours, placeholder: t('ui.policy.neverDormant'), "aria-invalid": parsed.errors?.dormant ? true : undefined, onChange: (event) => onChange({ ...value, dormantAfterHours: event.target.value }) }), _jsx(InputGroupAddon, { align: 'inline-end', children: _jsx(InputGroupText, { children: t('ui.policy.hours') }) })] }), parsed.errors?.dormant ? (_jsx(FieldError, { children: t(`ui.policy.errors.${parsed.errors.dormant}`, {
|
|
29
|
+
}) })) : null] }), _jsxs(Field, { "data-invalid": parsed.errors?.dormant ? true : undefined, children: [_jsx(FieldLabel, { htmlFor: 'rel-policy-dormant', children: t('ui.policy.dormantLabel') }), timerModes ? (_jsx(TimerModeSelect, { id: 'rel-policy-dormant-mode', label: t('ui.policy.dormantModeLabel'), value: timerModes.dormant, onChange: (dormant) => onTimerModesChange?.({ ...timerModes, dormant }), t: t })) : null, _jsxs(InputGroup, { children: [_jsx(InputGroupInput, { id: 'rel-policy-dormant', inputMode: 'decimal', value: timerModes?.dormant === 'inherit' ? '' : value.dormantAfterHours, placeholder: t('ui.policy.neverDormant'), disabled: timerModes?.dormant === 'inherit', "aria-invalid": parsed.errors?.dormant ? true : undefined, onChange: (event) => onChange({ ...value, dormantAfterHours: event.target.value }) }), _jsx(InputGroupAddon, { align: 'inline-end', children: _jsx(InputGroupText, { children: t('ui.policy.hours') }) })] }), parsed.errors?.dormant ? (_jsx(FieldError, { children: t(`ui.policy.errors.${parsed.errors.dormant}`, {
|
|
23
30
|
max: APP_POLICY_LIMITS.dormantAfterHours.max,
|
|
24
|
-
}) })) : null] })] }), _jsx(FieldDescription, { children: supported ? t('ui.policy.timersHint') : t('ui.policy.unsupported') })] }));
|
|
31
|
+
}) })) : null] })] }), _jsx(FieldDescription, { children: supported ? t('ui.policy.timersHint') : t('ui.policy.unsupported') }), timerModes ? (_jsx(FieldDescription, { children: t('ui.policy.customTimerHint') })) : null] }));
|
|
32
|
+
}
|
|
33
|
+
function TimerModeSelect({ id, label, value, onChange, t, }) {
|
|
34
|
+
const items = ['inherit', 'custom'].map((mode) => ({
|
|
35
|
+
value: mode,
|
|
36
|
+
label: t(`ui.policy.timerMode.${mode}`),
|
|
37
|
+
}));
|
|
38
|
+
return (_jsxs(Select, { items: items, value: value, onValueChange: (next) => next && onChange(next), children: [_jsx(SelectTrigger, { id: id, "aria-label": label, className: 'w-full', children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: items.map((item) => (_jsx(SelectItem, { value: item.value, children: item.label }, item.value))) })] }));
|
|
25
39
|
}
|
|
26
40
|
//# sourceMappingURL=runtime-policy-fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-policy-fields.js","sourceRoot":"","sources":["../../../client/components/runtime-policy-fields.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACL,iBAAiB,GAElB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gBAAgB,GAEjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,eAAe,EACf,eAAe,EACf,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAExB,MAAM,UAAU,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"runtime-policy-fields.js","sourceRoot":"","sources":["../../../client/components/runtime-policy-fields.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACL,iBAAiB,GAElB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gBAAgB,GAEjB,MAA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ED,SAAS,eAAe,CAAC,EACvB,EAAE,EACF,KAAK,EACL,KAAK,EACL,QAAQ,EACR,CAAC,GAOF;IACC,MAAM,KAAK,GAAI,CAAC,SAAS,EAAE,QAAQ,CAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5D,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,CAAC,CAAC,uBAAuB,IAAI,EAAE,CAAC;KACxC,CAAC,CAAC,CAAC;IACJ,OAAO,CACL,MAAC,MAAM,IACL,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,aAE/C,KAAC,aAAa,IAAC,EAAE,EAAE,EAAE,gBAAc,KAAK,EAAE,SAAS,EAAC,QAAQ,YAC1D,KAAC,WAAW,KAAG,GACD,EAChB,KAAC,aAAa,cACX,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,KAAC,UAAU,IAAkB,KAAK,EAAE,IAAI,CAAC,KAAK,YAC3C,IAAI,CAAC,KAAK,IADI,IAAI,CAAC,KAAK,CAEd,CACd,CAAC,GACY,IACT,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AppSummary } from '../../shared/releases.js';
|
|
2
|
+
interface AppSummaryLoader {
|
|
3
|
+
readonly data: AppSummary | undefined;
|
|
4
|
+
readonly error: unknown;
|
|
5
|
+
readonly loading: boolean;
|
|
6
|
+
readonly reload: () => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
/** One request at a time, including manual refreshes and refreshes after mutations. */
|
|
9
|
+
export declare function useAppSummary(appId: string, load: () => Promise<AppSummary>, onDeploymentChanged: () => void): AppSummaryLoader;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=use-app-summary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-app-summary.d.ts","sourceRoot":"","sources":["../../../client/hooks/use-app-summary.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAU3D,UAAU,gBAAgB;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED,uFAAuF;AACvF,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,EAC/B,mBAAmB,EAAE,MAAM,IAAI,GAC9B,gBAAgB,CAmGlB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ApiClientError } from '@nocobase/app-client';
|
|
2
|
+
import { useCallback, useEffect, useEffectEvent, useRef, useState, } from 'react';
|
|
3
|
+
import { appRefreshDelay } from '../lib/app-operations.js';
|
|
4
|
+
/** One request at a time, including manual refreshes and refreshes after mutations. */
|
|
5
|
+
export function useAppSummary(appId, load, onDeploymentChanged) {
|
|
6
|
+
const [state, setState] = useState({ appId, loading: true });
|
|
7
|
+
const reloadRef = useRef(async () => undefined);
|
|
8
|
+
const fetchLatest = useEffectEvent(load);
|
|
9
|
+
const deploymentChanged = useEffectEvent(onDeploymentChanged);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
let active = true;
|
|
12
|
+
let latest;
|
|
13
|
+
let timer;
|
|
14
|
+
let inFlight;
|
|
15
|
+
let revision = 0;
|
|
16
|
+
let queued = false;
|
|
17
|
+
let failures = 0;
|
|
18
|
+
let denied = false;
|
|
19
|
+
const clearTimer = () => {
|
|
20
|
+
clearTimeout(timer);
|
|
21
|
+
timer = undefined;
|
|
22
|
+
};
|
|
23
|
+
const schedule = () => {
|
|
24
|
+
clearTimer();
|
|
25
|
+
if (!active || denied || document.hidden)
|
|
26
|
+
return;
|
|
27
|
+
const delay = failures
|
|
28
|
+
? Math.min(5000 * 2 ** (failures - 1), 30_000)
|
|
29
|
+
: appRefreshDelay(latest);
|
|
30
|
+
timer = setTimeout(() => void refresh(), delay);
|
|
31
|
+
};
|
|
32
|
+
const drain = async () => {
|
|
33
|
+
do {
|
|
34
|
+
queued = false;
|
|
35
|
+
const requestRevision = revision;
|
|
36
|
+
setState((previous) => ({
|
|
37
|
+
appId,
|
|
38
|
+
data: latest,
|
|
39
|
+
error: previous.appId === appId ? previous.error : undefined,
|
|
40
|
+
loading: true,
|
|
41
|
+
}));
|
|
42
|
+
try {
|
|
43
|
+
const next = await fetchLatest();
|
|
44
|
+
if (!active || requestRevision !== revision)
|
|
45
|
+
continue;
|
|
46
|
+
const changed = latest &&
|
|
47
|
+
((latest.hasPendingDeployment && !next.hasPendingDeployment) ||
|
|
48
|
+
latest.app.currentDeploymentId !== next.app.currentDeploymentId);
|
|
49
|
+
latest = next;
|
|
50
|
+
failures = 0;
|
|
51
|
+
denied = false;
|
|
52
|
+
setState({ appId, data: next, loading: false });
|
|
53
|
+
if (changed)
|
|
54
|
+
deploymentChanged();
|
|
55
|
+
}
|
|
56
|
+
catch (reason) {
|
|
57
|
+
if (!active || requestRevision !== revision)
|
|
58
|
+
continue;
|
|
59
|
+
failures += 1;
|
|
60
|
+
denied =
|
|
61
|
+
reason instanceof ApiClientError &&
|
|
62
|
+
(reason.status === 401 || reason.status === 403);
|
|
63
|
+
setState({
|
|
64
|
+
appId,
|
|
65
|
+
data: latest,
|
|
66
|
+
error: reason ?? new Error('Request failed.'),
|
|
67
|
+
loading: false,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
} while (active && queued);
|
|
71
|
+
};
|
|
72
|
+
const refresh = () => {
|
|
73
|
+
if (!active)
|
|
74
|
+
return Promise.resolve();
|
|
75
|
+
clearTimer();
|
|
76
|
+
revision += 1;
|
|
77
|
+
queued = true;
|
|
78
|
+
if (!inFlight) {
|
|
79
|
+
inFlight = drain().finally(() => {
|
|
80
|
+
inFlight = undefined;
|
|
81
|
+
schedule();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return inFlight;
|
|
85
|
+
};
|
|
86
|
+
const visibilityChanged = () => {
|
|
87
|
+
clearTimer();
|
|
88
|
+
if (!document.hidden && !denied)
|
|
89
|
+
void refresh();
|
|
90
|
+
};
|
|
91
|
+
reloadRef.current = refresh;
|
|
92
|
+
document.addEventListener('visibilitychange', visibilityChanged);
|
|
93
|
+
void refresh();
|
|
94
|
+
return () => {
|
|
95
|
+
active = false;
|
|
96
|
+
clearTimer();
|
|
97
|
+
document.removeEventListener('visibilitychange', visibilityChanged);
|
|
98
|
+
};
|
|
99
|
+
}, [appId]);
|
|
100
|
+
const reload = useCallback(() => reloadRef.current(), []);
|
|
101
|
+
return {
|
|
102
|
+
data: state.appId === appId ? state.data : undefined,
|
|
103
|
+
error: state.appId === appId ? state.error : undefined,
|
|
104
|
+
loading: state.appId !== appId || state.loading,
|
|
105
|
+
reload,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=use-app-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-app-summary.js","sourceRoot":"","sources":["../../../client/hooks/use-app-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,WAAW,EACX,SAAS,EACT,cAAc,EACd,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAgB3D,uFAAuF;AACvF,MAAM,UAAU,aAAa,CAC3B,KAAa,EACb,IAA+B,EAC/B,mBAA+B;IAE/B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,EAAE,KAAK,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CAAC,SAAS;QACpD,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QACtD,OAAO,EAAE,KAAK,CAAC,KAAK,KAAK,KAAK,IAAI,KAAK,CAAC,OAAO;QAC/C,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AppSummary } from '../../shared/releases.js';
|
|
2
|
+
export type AppOperation = 'start' | 'stop' | 'restart';
|
|
3
|
+
export type OperationDisabledReason = 'busy' | 'unavailable' | 'deploying' | 'starting' | 'notDeployed' | 'alreadyRunning' | 'notRunning';
|
|
4
|
+
/** Permission controls visibility; runtime state controls whether a visible operation is useful. */
|
|
5
|
+
export declare function operationDisabledReason(summary: AppSummary, operation: AppOperation, busy: boolean, stale: boolean): OperationDisabledReason | undefined;
|
|
6
|
+
export declare function appRefreshDelay(summary: AppSummary | undefined): number;
|
|
7
|
+
//# sourceMappingURL=app-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-operations.d.ts","sourceRoot":"","sources":["../../../client/lib/app-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAExD,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,aAAa,GACb,WAAW,GACX,UAAU,GACV,aAAa,GACb,gBAAgB,GAChB,YAAY,CAAC;AAEjB,oGAAoG;AACpG,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,GACb,uBAAuB,GAAG,SAAS,CAerC;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAMvE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Permission controls visibility; runtime state controls whether a visible operation is useful. */
|
|
2
|
+
export function operationDisabledReason(summary, operation, busy, stale) {
|
|
3
|
+
if (busy)
|
|
4
|
+
return 'busy';
|
|
5
|
+
if (stale ||
|
|
6
|
+
!summary.runtime.available ||
|
|
7
|
+
summary.runtime.state === 'unknown')
|
|
8
|
+
return 'unavailable';
|
|
9
|
+
if (summary.hasPendingDeployment)
|
|
10
|
+
return 'deploying';
|
|
11
|
+
if (!summary.app.currentDeploymentId)
|
|
12
|
+
return 'notDeployed';
|
|
13
|
+
const state = summary.runtime.state;
|
|
14
|
+
if (state === 'pending' || state === 'starting')
|
|
15
|
+
return 'starting';
|
|
16
|
+
if (operation === 'start')
|
|
17
|
+
return state === 'running' ? 'alreadyRunning' : undefined;
|
|
18
|
+
return state === 'running' ? undefined : 'notRunning';
|
|
19
|
+
}
|
|
20
|
+
export function appRefreshDelay(summary) {
|
|
21
|
+
return summary?.hasPendingDeployment ||
|
|
22
|
+
summary?.runtime.state === 'starting' ||
|
|
23
|
+
summary?.runtime.state === 'pending'
|
|
24
|
+
? 1500
|
|
25
|
+
: 5000;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=app-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-operations.js","sourceRoot":"","sources":["../../../client/lib/app-operations.ts"],"names":[],"mappings":"AAaA,oGAAoG;AACpG,MAAM,UAAU,uBAAuB,CACrC,OAAmB,EACnB,SAAuB,EACvB,IAAa,EACb,KAAc;IAEd,IAAI,IAAI;QAAE,OAAO,MAAM,CAAC;IACxB,IACE,KAAK;QACL,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS;QAC1B,OAAO,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS;QAEnC,OAAO,aAAa,CAAC;IACvB,IAAI,OAAO,CAAC,oBAAoB;QAAE,OAAO,WAAW,CAAC;IACrD,IAAI,C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