@openbrf/plugin-sdk 1.0.0 → 1.4.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.
Files changed (104) hide show
  1. package/README.md +95 -0
  2. package/dist/abort-signal.d.ts +23 -0
  3. package/dist/abort-signal.d.ts.map +1 -0
  4. package/dist/abort-signal.js +2 -0
  5. package/dist/abort-signal.js.map +1 -0
  6. package/dist/action-refusal.d.ts +101 -0
  7. package/dist/action-refusal.d.ts.map +1 -0
  8. package/dist/action-refusal.js +96 -0
  9. package/dist/action-refusal.js.map +1 -0
  10. package/dist/action-schema.d.ts.map +1 -1
  11. package/dist/action-schema.js +4 -1
  12. package/dist/action-schema.js.map +1 -1
  13. package/dist/actions.d.ts +94 -6
  14. package/dist/actions.d.ts.map +1 -1
  15. package/dist/actions.js.map +1 -1
  16. package/dist/blocks.d.ts +310 -0
  17. package/dist/blocks.d.ts.map +1 -0
  18. package/dist/blocks.js +185 -0
  19. package/dist/blocks.js.map +1 -0
  20. package/dist/catalog.d.ts +1092 -41
  21. package/dist/catalog.d.ts.map +1 -1
  22. package/dist/catalog.js +472 -15
  23. package/dist/catalog.js.map +1 -1
  24. package/dist/entitlements.d.ts +117 -0
  25. package/dist/entitlements.d.ts.map +1 -0
  26. package/dist/entitlements.js +62 -0
  27. package/dist/entitlements.js.map +1 -0
  28. package/dist/extensions.d.ts +183 -0
  29. package/dist/extensions.d.ts.map +1 -0
  30. package/dist/extensions.js +67 -0
  31. package/dist/extensions.js.map +1 -0
  32. package/dist/finances.d.ts +294 -0
  33. package/dist/finances.d.ts.map +1 -0
  34. package/dist/finances.js +56 -0
  35. package/dist/finances.js.map +1 -0
  36. package/dist/findings.d.ts +92 -1
  37. package/dist/findings.d.ts.map +1 -1
  38. package/dist/findings.js +91 -0
  39. package/dist/findings.js.map +1 -1
  40. package/dist/host.d.ts +729 -4
  41. package/dist/host.d.ts.map +1 -1
  42. package/dist/host.js +54 -0
  43. package/dist/host.js.map +1 -1
  44. package/dist/imports.d.ts +104 -0
  45. package/dist/imports.d.ts.map +1 -0
  46. package/dist/imports.js +70 -0
  47. package/dist/imports.js.map +1 -0
  48. package/dist/index.d.ts +17 -7
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +15 -6
  51. package/dist/index.js.map +1 -1
  52. package/dist/localized-text.d.ts +18 -0
  53. package/dist/localized-text.d.ts.map +1 -0
  54. package/dist/localized-text.js +17 -0
  55. package/dist/localized-text.js.map +1 -0
  56. package/dist/manifest.d.ts +859 -0
  57. package/dist/manifest.d.ts.map +1 -1
  58. package/dist/manifest.js +957 -12
  59. package/dist/manifest.js.map +1 -1
  60. package/dist/package-check.d.ts.map +1 -1
  61. package/dist/package-check.js +9 -1
  62. package/dist/package-check.js.map +1 -1
  63. package/dist/permissions.d.ts +170 -11
  64. package/dist/permissions.d.ts.map +1 -1
  65. package/dist/permissions.js +210 -2
  66. package/dist/permissions.js.map +1 -1
  67. package/dist/recipients.d.ts +139 -0
  68. package/dist/recipients.d.ts.map +1 -0
  69. package/dist/recipients.js +223 -0
  70. package/dist/recipients.js.map +1 -0
  71. package/dist/records.d.ts +130 -0
  72. package/dist/records.d.ts.map +1 -0
  73. package/dist/records.js +85 -0
  74. package/dist/records.js.map +1 -0
  75. package/dist/require-capability.d.ts +37 -0
  76. package/dist/require-capability.d.ts.map +1 -0
  77. package/dist/require-capability.js +88 -0
  78. package/dist/require-capability.js.map +1 -0
  79. package/dist/settings-schema.d.ts +35 -0
  80. package/dist/settings-schema.d.ts.map +1 -1
  81. package/dist/settings-schema.js +55 -2
  82. package/dist/settings-schema.js.map +1 -1
  83. package/package.json +4 -4
  84. package/src/abort-signal.ts +22 -0
  85. package/src/action-refusal.ts +178 -0
  86. package/src/action-schema.ts +4 -1
  87. package/src/actions.ts +103 -6
  88. package/src/blocks.ts +289 -0
  89. package/src/catalog.ts +630 -72
  90. package/src/entitlements.ts +150 -0
  91. package/src/extensions.ts +212 -0
  92. package/src/finances.ts +317 -0
  93. package/src/findings.ts +94 -0
  94. package/src/host.ts +768 -4
  95. package/src/imports.ts +135 -0
  96. package/src/index.ts +209 -0
  97. package/src/localized-text.ts +19 -0
  98. package/src/manifest.ts +1231 -12
  99. package/src/package-check.ts +15 -0
  100. package/src/permissions.ts +223 -3
  101. package/src/recipients.ts +294 -0
  102. package/src/records.ts +172 -0
  103. package/src/require-capability.ts +106 -0
  104. package/src/settings-schema.ts +64 -2
package/src/findings.ts CHANGED
@@ -45,6 +45,24 @@ export const PLUGIN_FINDING_REASONS = [
45
45
  "actions-widened",
46
46
  /** An action the manifest declares could not be registered. */
47
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",
48
66
  /** One of its providers reaches for a core service a plugin may not hold. */
49
67
  "forbidden-injection",
50
68
  /**
@@ -53,6 +71,54 @@ export const PLUGIN_FINDING_REASONS = [
53
71
  * audience every issued token carries, so moving it would strand them all.
54
72
  */
55
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",
56
122
  ] as const;
57
123
 
58
124
  export type PluginFindingReason = (typeof PLUGIN_FINDING_REASONS)[number];
@@ -69,3 +135,31 @@ export type PluginFindingReason = (typeof PLUGIN_FINDING_REASONS)[number];
69
135
  export type PluginFindingDetail = Readonly<
70
136
  Record<string, string | number | readonly string[]>
71
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
+ /** A plugin with a device route offers an extension point accepting contact details. */
162
+ "device-route-extension-point-contact",
163
+ ] as const;
164
+
165
+ export type PluginManifestRule = (typeof PLUGIN_MANIFEST_RULES)[number];