@openbrf/plugin-sdk 0.0.0-stage → 1.2.0
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 +661 -0
- package/LICENSE-EXCEPTION.md +28 -0
- package/README.md +94 -2
- package/dist/abort-signal.d.ts +23 -0
- package/dist/abort-signal.d.ts.map +1 -0
- package/dist/abort-signal.js +2 -0
- package/dist/abort-signal.js.map +1 -0
- package/dist/action-refusal.d.ts +101 -0
- package/dist/action-refusal.d.ts.map +1 -0
- package/dist/action-refusal.js +96 -0
- package/dist/action-refusal.js.map +1 -0
- package/dist/action-schema.d.ts +42 -0
- package/dist/action-schema.d.ts.map +1 -0
- package/dist/action-schema.js +67 -0
- package/dist/action-schema.js.map +1 -0
- package/dist/actions.d.ts +287 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +68 -0
- package/dist/actions.js.map +1 -0
- package/dist/api-version.d.ts +23 -0
- package/dist/api-version.d.ts.map +1 -0
- package/dist/api-version.js +27 -0
- package/dist/api-version.js.map +1 -0
- package/dist/blocks.d.ts +310 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +185 -0
- package/dist/blocks.js.map +1 -0
- package/dist/catalog.d.ts +707 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +567 -0
- package/dist/catalog.js.map +1 -0
- package/dist/define-plugin.d.ts +14 -0
- package/dist/define-plugin.d.ts.map +1 -0
- package/dist/define-plugin.js +15 -0
- package/dist/define-plugin.js.map +1 -0
- package/dist/entitlements.d.ts +117 -0
- package/dist/entitlements.d.ts.map +1 -0
- package/dist/entitlements.js +62 -0
- package/dist/entitlements.js.map +1 -0
- package/dist/extensions.d.ts +183 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +67 -0
- package/dist/extensions.js.map +1 -0
- package/dist/finances.d.ts +294 -0
- package/dist/finances.d.ts.map +1 -0
- package/dist/finances.js +56 -0
- package/dist/finances.js.map +1 -0
- package/dist/findings.d.ts +156 -0
- package/dist/findings.d.ts.map +1 -0
- package/dist/findings.js +146 -0
- package/dist/findings.js.map +1 -0
- package/dist/host.d.ts +827 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +80 -0
- package/dist/host.js.map +1 -0
- package/dist/imports.d.ts +104 -0
- package/dist/imports.d.ts.map +1 -0
- package/dist/imports.js +70 -0
- package/dist/imports.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/integrity.d.ts +38 -0
- package/dist/integrity.d.ts.map +1 -0
- package/dist/integrity.js +105 -0
- package/dist/integrity.js.map +1 -0
- package/dist/localized-text.d.ts +18 -0
- package/dist/localized-text.d.ts.map +1 -0
- package/dist/localized-text.js +17 -0
- package/dist/localized-text.js.map +1 -0
- package/dist/manifest.d.ts +1122 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +1118 -0
- package/dist/manifest.js.map +1 -0
- package/dist/module.d.ts +35 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +2 -0
- package/dist/module.js.map +1 -0
- package/dist/package-check.d.ts +66 -0
- package/dist/package-check.d.ts.map +1 -0
- package/dist/package-check.js +755 -0
- package/dist/package-check.js.map +1 -0
- package/dist/permissions.d.ts +224 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +277 -0
- package/dist/permissions.js.map +1 -0
- package/dist/recipients.d.ts +139 -0
- package/dist/recipients.d.ts.map +1 -0
- package/dist/recipients.js +223 -0
- package/dist/recipients.js.map +1 -0
- package/dist/records.d.ts +130 -0
- package/dist/records.d.ts.map +1 -0
- package/dist/records.js +85 -0
- package/dist/records.js.map +1 -0
- package/dist/require-capability.d.ts +37 -0
- package/dist/require-capability.d.ts.map +1 -0
- package/dist/require-capability.js +88 -0
- package/dist/require-capability.js.map +1 -0
- package/dist/settings-schema.d.ts +130 -0
- package/dist/settings-schema.d.ts.map +1 -0
- package/dist/settings-schema.js +272 -0
- package/dist/settings-schema.js.map +1 -0
- package/dist/standard-schema.d.ts +43 -0
- package/dist/standard-schema.d.ts.map +1 -0
- package/dist/standard-schema.js +2 -0
- package/dist/standard-schema.js.map +1 -0
- package/package.json +55 -3
- package/src/abort-signal.ts +22 -0
- package/src/action-refusal.ts +178 -0
- package/src/action-schema.ts +89 -0
- package/src/actions.ts +344 -0
- package/src/api-version.ts +28 -0
- package/src/blocks.ts +289 -0
- package/src/catalog.ts +679 -0
- package/src/define-plugin.ts +18 -0
- package/src/entitlements.ts +150 -0
- package/src/extensions.ts +212 -0
- package/src/finances.ts +317 -0
- package/src/findings.ts +163 -0
- package/src/host.ts +894 -0
- package/src/imports.ts +135 -0
- package/src/index.ts +316 -0
- package/src/integrity.ts +125 -0
- package/src/localized-text.ts +19 -0
- package/src/manifest.ts +1412 -0
- package/src/module.ts +38 -0
- package/src/package-check.ts +894 -0
- package/src/permissions.ts +295 -0
- package/src/recipients.ts +294 -0
- package/src/records.ts +172 -0
- package/src/require-capability.ts +106 -0
- package/src/settings-schema.ts +334 -0
- package/src/standard-schema.ts +39 -0
package/src/findings.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a plugin on the data volume is not running.
|
|
3
|
+
*
|
|
4
|
+
* A finding travels as one of these codes plus the values its sentence needs,
|
|
5
|
+
* never as a sentence composed by the host. The interface is Swedish by
|
|
6
|
+
* default and this package is English, so what a board reads has to be a
|
|
7
|
+
* translation of the code: a sentence written where the finding is produced
|
|
8
|
+
* reaches the board panel in the language the server happens to be written in.
|
|
9
|
+
*
|
|
10
|
+
* Listed as values rather than as a bare union so a caller can walk them and
|
|
11
|
+
* prove it has a sentence for each. Part of the contract rather than an
|
|
12
|
+
* implementation detail - docs/plugin-contract.md lists the same set, and a
|
|
13
|
+
* plugin author reading why their package was skipped is reading one of these.
|
|
14
|
+
*/
|
|
15
|
+
export const PLUGIN_FINDING_REASONS = [
|
|
16
|
+
/** The `openbrf` field failed validation. */
|
|
17
|
+
"manifest-invalid",
|
|
18
|
+
/** Built against a contract version this instance does not implement. */
|
|
19
|
+
"api-version-unsupported",
|
|
20
|
+
/** A declared entry file is not in the package. */
|
|
21
|
+
"entry-missing",
|
|
22
|
+
/** The server bundle does not export `createPlugin`. */
|
|
23
|
+
"entry-invalid",
|
|
24
|
+
/** `createPlugin` returned no NestJS dynamic module. */
|
|
25
|
+
"module-invalid",
|
|
26
|
+
/** Its module declares behaviour a plugin may not register. */
|
|
27
|
+
"module-refused",
|
|
28
|
+
/** Its module could not be built into the application. */
|
|
29
|
+
"module-failed",
|
|
30
|
+
/** The package carries its own copy of a host package it must share. */
|
|
31
|
+
"module-identity",
|
|
32
|
+
/** It asks for more than was consented to. */
|
|
33
|
+
"permissions-widened",
|
|
34
|
+
/** It handles a personal-data category that was not consented to. */
|
|
35
|
+
"personal-data-widened",
|
|
36
|
+
/** On the volume with no record of consent. */
|
|
37
|
+
"not-consented",
|
|
38
|
+
/** Switched off in the admin interface. */
|
|
39
|
+
"disabled",
|
|
40
|
+
/** It threw while being loaded. */
|
|
41
|
+
"load-failed",
|
|
42
|
+
/** Recorded as installed but not present. */
|
|
43
|
+
"not-on-volume",
|
|
44
|
+
/** The installed version declares an action the board did not consent to. */
|
|
45
|
+
"actions-widened",
|
|
46
|
+
/** An action the manifest declares could not be registered. */
|
|
47
|
+
"action-refused",
|
|
48
|
+
/**
|
|
49
|
+
* The installed version says otherwise than the board consented to about
|
|
50
|
+
* whether it is an AI package, in either direction.
|
|
51
|
+
*/
|
|
52
|
+
"ai-changed",
|
|
53
|
+
/**
|
|
54
|
+
* The installed version reads another entitlement than the board consented
|
|
55
|
+
* to, may present the licence to a service the board was not told of, or
|
|
56
|
+
* declares a key of its issuer's the board has not consented to.
|
|
57
|
+
*/
|
|
58
|
+
"licence-widened",
|
|
59
|
+
/**
|
|
60
|
+
* The installed version names another issuer of its licence than the board
|
|
61
|
+
* consented to, or no longer declares a key the board consented to.
|
|
62
|
+
*/
|
|
63
|
+
"licence-issuer-changed",
|
|
64
|
+
/** It registered a website block its manifest does not declare. */
|
|
65
|
+
"block-refused",
|
|
66
|
+
/** One of its providers reaches for a core service a plugin may not hold. */
|
|
67
|
+
"forbidden-injection",
|
|
68
|
+
/**
|
|
69
|
+
* It declares the OAuth protected resource, and another installed plugin
|
|
70
|
+
* already does. The one installed first keeps it: the resource URL is the
|
|
71
|
+
* audience every issued token carries, so moving it would strand them all.
|
|
72
|
+
*/
|
|
73
|
+
"oauth-resource-conflict",
|
|
74
|
+
/**
|
|
75
|
+
* A plugin it extends is not installed, not loaded, or switched off. The
|
|
76
|
+
* detail names it. An addon does not serve while its host plugin does not.
|
|
77
|
+
*/
|
|
78
|
+
"extension-host-missing",
|
|
79
|
+
/** A plugin it extends declares no such extension point. */
|
|
80
|
+
"extension-point-unknown",
|
|
81
|
+
/**
|
|
82
|
+
* A point it extends is at another major version than the one it was
|
|
83
|
+
* written for.
|
|
84
|
+
*/
|
|
85
|
+
"extension-version-unsupported",
|
|
86
|
+
/** It hands over a category of personal data the point does not accept. */
|
|
87
|
+
"extension-personal-data-refused",
|
|
88
|
+
/**
|
|
89
|
+
* Of it and a plugin it extends, one puts blocks on the website and the
|
|
90
|
+
* other holds a permission that reads the register. The detail names
|
|
91
|
+
* those permissions.
|
|
92
|
+
*/
|
|
93
|
+
"extension-permission-refused",
|
|
94
|
+
/**
|
|
95
|
+
* It puts blocks on the website, and a plugin it extends handles personal
|
|
96
|
+
* data. The detail names those categories.
|
|
97
|
+
*/
|
|
98
|
+
"extension-host-personal-data-refused",
|
|
99
|
+
/**
|
|
100
|
+
* The plugins joined to it by extensions, through one host plugin or
|
|
101
|
+
* several, hold one that puts blocks on the website and one that reads the
|
|
102
|
+
* address book. The detail names both.
|
|
103
|
+
*/
|
|
104
|
+
"extension-group-refused",
|
|
105
|
+
/**
|
|
106
|
+
* It declares an extension point, or extends one, in a way the board has not
|
|
107
|
+
* consented to.
|
|
108
|
+
*/
|
|
109
|
+
"extensions-widened",
|
|
110
|
+
/** A definition or contribution it registered could not be accepted. */
|
|
111
|
+
"extension-refused",
|
|
112
|
+
/**
|
|
113
|
+
* The installed version declares a recipient the board did not consent to:
|
|
114
|
+
* a new one, one at another origin, or one receiving more personal data.
|
|
115
|
+
*/
|
|
116
|
+
"recipients-widened",
|
|
117
|
+
/**
|
|
118
|
+
* The installed version declares a device route the board has not consented
|
|
119
|
+
* to, or moves one (ADR 0031).
|
|
120
|
+
*/
|
|
121
|
+
"device-routes-widened",
|
|
122
|
+
] as const;
|
|
123
|
+
|
|
124
|
+
export type PluginFindingReason = (typeof PLUGIN_FINDING_REASONS)[number];
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The values a finding's sentence is completed with.
|
|
128
|
+
*
|
|
129
|
+
* Identifiers, paths, numbers and what a thrown error said - never a sentence,
|
|
130
|
+
* and never personal data. A list stays a list rather than being joined here,
|
|
131
|
+
* because its members can have sentences of their own: a board told that a
|
|
132
|
+
* package handles a category it never agreed to has to read that category in
|
|
133
|
+
* its own language, not as `residency`.
|
|
134
|
+
*/
|
|
135
|
+
export type PluginFindingDetail = Readonly<
|
|
136
|
+
Record<string, string | number | readonly string[]>
|
|
137
|
+
>;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The manifest rules whose refusal a board reads in its own language.
|
|
141
|
+
*
|
|
142
|
+
* A manifest that fails validation is reported as `manifest-invalid`, and
|
|
143
|
+
* what Zod says about a field is English for the plugin's author. The rules
|
|
144
|
+
* below are not about one field: they hold two declarations against each
|
|
145
|
+
* other, and a board reading why a package was skipped needs to be told which
|
|
146
|
+
* in a sentence of its own. So the refusal carries the code with the English
|
|
147
|
+
* line, and the interface translates the code. Any other problem stays the
|
|
148
|
+
* English line, which is what an author fixes the package from.
|
|
149
|
+
*/
|
|
150
|
+
export const PLUGIN_MANIFEST_RULES = [
|
|
151
|
+
/** A device route overlaps the OAuth protected resource. */
|
|
152
|
+
"device-route-overlaps-oauth-resource",
|
|
153
|
+
/** A plugin with a device route also reads the register or the finances. */
|
|
154
|
+
"device-route-reads-register",
|
|
155
|
+
/** A plugin with a website block also reads the register or the finances. */
|
|
156
|
+
"blocks-read-register",
|
|
157
|
+
/** A plugin with a device route also proposes imports. */
|
|
158
|
+
"device-route-proposes-import",
|
|
159
|
+
/** A plugin with a website block also proposes imports. */
|
|
160
|
+
"blocks-propose-import",
|
|
161
|
+
] as const;
|
|
162
|
+
|
|
163
|
+
export type PluginManifestRule = (typeof PLUGIN_MANIFEST_RULES)[number];
|