Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ The first release.
- One action, `summary`, which returns the three counts and names nobody,
offered on the platform's own screens and, once an administrator arms it, to
connected apps.
- A `processing` declaration in the manifest: the purpose, the legal basis
(legitimate interest, with the interest stated), how long the data is kept
(it is not kept) and whose data it is (members and residents). The board
reads it on the consent screen, and a person can object to this processing
on its own.
- Swedish and English.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ is the reference. This is where this package meets each part of it.

| Part | Here |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Manifest | The `openbrf` field of [`package.json`](package.json): id, entries, permission, personal data, view, settings (all four field types) and the action. |
| Manifest | The `openbrf` field of [`package.json`](package.json): id, entries, permission, personal data, processing, view, settings (all four field types) and the action. |
| Server entry | [`src/server.ts`](src/server.ts), compiled by `tsc` to `dist/server.cjs`: one CommonJS file that requires only `@nestjs/common` and `zod`, which resolve to the host's own copies. |
| NestJS module | A provider with an `onModuleInit` hook, and a controller whose two routes the host mounts at `/api/plugin/occupancy/summary` and `/api/plugin/occupancy/apartments`. |
| Route input | `GET apartments` takes one query parameter, read with the host's zod. Anything else is answered with 400. |
Expand Down Expand Up @@ -87,7 +87,9 @@ The tests cover four things:
against every key the manifest, the view and the action name.

A Module Federation remote cannot be served by `vite dev`. To try the view in a
running instance, run `vite build --watch` and install the package there.
running instance, run `vite build --watch`, then `pnpm build:server` once the
first build has finished, and install the package there. The view build empties
`dist/`, so without the second step the package has no server bundle.

## Starting your own plugin from this one

Expand All @@ -99,11 +101,13 @@ The licence is MIT-0, so you can copy any of it without keeping a notice.
`useTranslation` reads in the view.
2. Rename the package and start your version at `0.1.0`.
3. Declare only what your code uses. The board sees `permissions`,
`personalData` and `actions` on the consent screen before anything is
downloaded, and a later version that asks for more is refused until the
board consents again.
4. Keep the server in one file, or bundle it into one. Keep `@nestjs/common`,
`@nestjs/core` and `zod` as peer dependencies and never bundle them, and
`personalData`, `actions` and `processing` on the consent screen before
anything is downloaded, and a later version that asks for more is refused
until the board consents again. `processing` says why the plugin handles
personal data: its purpose, legal basis, retention and whose data it is, in
Swedish and English.
4. Keep the server in one file, or bundle it into one. Keep `@nestjs/common`
and `zod` as peer dependencies and never bundle them, and
import `@openbrf/plugin-sdk` for types only. The package check refuses any
runtime dependency, and a bundle that requires another package or a
relative path.
Expand Down Expand Up @@ -137,8 +141,9 @@ tarball cannot be attached.

To have a version listed, open a pull request in
[`openbrf/catalog`](https://github.com/openbrf/catalog) that adds its entry
with the release's tarball URL, `sha512` and `bytes`. Copy the declaration from
the manifest exactly: the catalog's check compares the two.
with the release's tarball URL, `sha512` and `bytes`. Copy the fields the
catalog checks from the manifest exactly: the catalog's check compares them. It
does not compare `processing` yet.

## Licence

Expand Down
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@
"apartment",
"residency"
],
"processing": {
"purpose": {
"sv": "Visa styrelsen hur många lägenheter, boende och medlemmar föreningen har, och hur många boende och bostadsrättshavare varje lägenhet har, räknat bland de boende som tillägget kan se. Inga namn visas.",
"en": "Show the board how many apartments, residents and members the association has, and how many residents and tenant-owners each apartment has, counting only the residents the plugin can see. No names are shown."
},
"legalBasis": "legitimateInterest",
"legitimateInterest": {
"sv": "Styrelsens behov av en överblick över boendet för att förvalta föreningen.",
"en": "The board's need for an overview of who lives in the building in order to run the association."
},
"retention": {
"sv": "Ingenting sparas: uppgifterna läses ur registret varje gång vyn visas.",
"en": "Nothing is kept: the data is read from the register each time the view is shown."
},
"dataSubjects": [
"members",
"residents"
]
},
"view": {
"module": "./View",
"titleKey": "view.title"
Expand Down
Loading