@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
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The association's finances, as a plugin may read them, record a delivery
|
|
3
|
+
* against them and hear about them.
|
|
4
|
+
*
|
|
5
|
+
* What is here is the free half of the boundary ROADMAP.md publishes: the
|
|
6
|
+
* notices and charges core already records, read on the same masking rules as
|
|
7
|
+
* the files the board hands over, a receipt that says one of them was
|
|
8
|
+
* delivered, and an event that says one was issued. What carries them out of
|
|
9
|
+
* Open BRF - an accounting system, a bankgiro file, a reminder - is the
|
|
10
|
+
* plugin's own work.
|
|
11
|
+
*
|
|
12
|
+
* Three rules hold on every member here regardless of permission, and they are
|
|
13
|
+
* the address book's (`PluginAddressBook`) read for money:
|
|
14
|
+
*
|
|
15
|
+
* A person with protected personal data is never named. A notice for their
|
|
16
|
+
* household carries its apartment and its amount and withholds every name;
|
|
17
|
+
* a charge on them carries its date and its amount and withholds who, where
|
|
18
|
+
* and why. The row says so with a `withheld` branch rather than an empty
|
|
19
|
+
* string, so a reader cannot take a withheld value for an absent one.
|
|
20
|
+
*
|
|
21
|
+
* A personal identity number is never returned. No row carries one.
|
|
22
|
+
*
|
|
23
|
+
* There is no payment state, because core records none. Nothing here says
|
|
24
|
+
* whether a notice was paid, what is outstanding or what a balance is, and a
|
|
25
|
+
* delivery receipt is not that either: the accounting system settles the
|
|
26
|
+
* debt, and a second answer to whether something was paid is worse than none.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* One delivery of a notice or a charge, as the plugin that made it recorded it.
|
|
30
|
+
*
|
|
31
|
+
* A receipt says that something left the association by a route, at a time,
|
|
32
|
+
* under a reference the receiving system knows it by. It never says that the
|
|
33
|
+
* money arrived, and it is not a status: a notice may carry several receipts,
|
|
34
|
+
* from several plugins, and none of them changes the notice.
|
|
35
|
+
*/
|
|
36
|
+
export interface PluginDeliveryReceipt {
|
|
37
|
+
id: string;
|
|
38
|
+
/** The plugin that recorded it. */
|
|
39
|
+
pluginId: string;
|
|
40
|
+
/**
|
|
41
|
+
* The route, in the recording plugin's own word for it: `fortnox`,
|
|
42
|
+
* `autogiro`, `email`. Lowercase letters, digits and hyphens, at most 32.
|
|
43
|
+
*/
|
|
44
|
+
channel: string;
|
|
45
|
+
/**
|
|
46
|
+
* What the receiving system calls it, or the statement that it is withheld.
|
|
47
|
+
*
|
|
48
|
+
* Withheld on every receipt another plugin recorded: a plugin reads its own
|
|
49
|
+
* references only. And withheld with the row it is on: on a notice whose
|
|
50
|
+
* holders are withheld and a charge whose party or reason is, by the
|
|
51
|
+
* register as it stands at the read rather than when the receipt was
|
|
52
|
+
* recorded. A reference is the recording plugin's free text, and one written
|
|
53
|
+
* while a household could be named can name it as well as the names can.
|
|
54
|
+
* The receipt itself stays, so a plugin can still tell that the row was
|
|
55
|
+
* delivered.
|
|
56
|
+
*/
|
|
57
|
+
reference: PluginDeliveryReference;
|
|
58
|
+
/** When it was delivered, as the plugin stated it. An ISO 8601 instant. */
|
|
59
|
+
deliveredAt: string;
|
|
60
|
+
/** When the receipt was recorded. An ISO 8601 instant. */
|
|
61
|
+
recordedAt: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* What the receiving system calls a delivery - a voucher number, a file name, a
|
|
65
|
+
* message id, at most 128 characters - or the statement that it is withheld.
|
|
66
|
+
*/
|
|
67
|
+
export type PluginDeliveryReference = {
|
|
68
|
+
state: "visible";
|
|
69
|
+
text: string;
|
|
70
|
+
} | {
|
|
71
|
+
state: "withheld";
|
|
72
|
+
};
|
|
73
|
+
/** What a plugin states when it records a delivery. */
|
|
74
|
+
export interface PluginDeliveryReceiptInput {
|
|
75
|
+
target: {
|
|
76
|
+
kind: "feeNotice";
|
|
77
|
+
id: string;
|
|
78
|
+
} | {
|
|
79
|
+
kind: "memberCharge";
|
|
80
|
+
id: string;
|
|
81
|
+
};
|
|
82
|
+
channel: string;
|
|
83
|
+
reference: string;
|
|
84
|
+
/** When it was delivered. Now, when left out; never a time still to come. */
|
|
85
|
+
deliveredAt?: Date;
|
|
86
|
+
}
|
|
87
|
+
/** Who a notice names, or the statement that the names are withheld. */
|
|
88
|
+
export type PluginFeeNoticeHolders = {
|
|
89
|
+
state: "visible";
|
|
90
|
+
/** The tenant-owners' names, in the register's own order. */
|
|
91
|
+
names: string[];
|
|
92
|
+
} | {
|
|
93
|
+
state: "withheld";
|
|
94
|
+
};
|
|
95
|
+
/** One apartment's notice in one run (avi). */
|
|
96
|
+
export interface PluginFeeNotice {
|
|
97
|
+
id: string;
|
|
98
|
+
apartment: {
|
|
99
|
+
id: string;
|
|
100
|
+
/** "<street> <number> <apartment number>". Never withheld. */
|
|
101
|
+
label: string;
|
|
102
|
+
number: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* The tenant-owners holding the apartment when the period closed. Withheld
|
|
106
|
+
* where anybody in the household carries protected personal data or has had
|
|
107
|
+
* processing restricted (GDPR art. 18).
|
|
108
|
+
*/
|
|
109
|
+
holders: PluginFeeNoticeHolders;
|
|
110
|
+
/** Kronor with two decimals: "3450.50". What was billed, never a balance. */
|
|
111
|
+
amount: string;
|
|
112
|
+
paymentReference: string;
|
|
113
|
+
deliveries: PluginDeliveryReceipt[];
|
|
114
|
+
}
|
|
115
|
+
/** A fee notification run (avisering) without its notices. */
|
|
116
|
+
export interface PluginFeeNotificationSummary {
|
|
117
|
+
id: string;
|
|
118
|
+
/** The period billed, inclusive at both ends. "YYYY-MM-DD". */
|
|
119
|
+
from: string;
|
|
120
|
+
to: string;
|
|
121
|
+
/** The due date the board stated. Nothing in core computes from it. */
|
|
122
|
+
dueOn: string;
|
|
123
|
+
/** When the run was issued. An ISO 8601 instant. */
|
|
124
|
+
issuedAt: string;
|
|
125
|
+
/** How many notices the run carries. */
|
|
126
|
+
notices: number;
|
|
127
|
+
/** The sum of what was billed, as kronor with two decimals. */
|
|
128
|
+
total: string;
|
|
129
|
+
}
|
|
130
|
+
/** A fee notification run with its notices. */
|
|
131
|
+
export interface PluginFeeNotification extends Omit<PluginFeeNotificationSummary, "notices"> {
|
|
132
|
+
notices: PluginFeeNotice[];
|
|
133
|
+
}
|
|
134
|
+
/** Who a charge is on, or the statement that it is withheld. */
|
|
135
|
+
export type PluginMemberChargeParty = {
|
|
136
|
+
kind: "person";
|
|
137
|
+
state: "visible";
|
|
138
|
+
personId: string;
|
|
139
|
+
name: string;
|
|
140
|
+
/**
|
|
141
|
+
* Where they held a residency on the day of the charge, as the debiting
|
|
142
|
+
* list prints it, or null where they held none.
|
|
143
|
+
*/
|
|
144
|
+
apartment: string | null;
|
|
145
|
+
} | {
|
|
146
|
+
/**
|
|
147
|
+
* A person the plugin is not told about: one carrying protected personal
|
|
148
|
+
* data, one whose processing is restricted (GDPR art. 18), or one the
|
|
149
|
+
* register no longer holds.
|
|
150
|
+
*/
|
|
151
|
+
kind: "person";
|
|
152
|
+
state: "withheld";
|
|
153
|
+
} | {
|
|
154
|
+
kind: "apartment";
|
|
155
|
+
/** Null once the apartment has been corrected out of the register. */
|
|
156
|
+
apartmentId: string | null;
|
|
157
|
+
apartment: string | null;
|
|
158
|
+
};
|
|
159
|
+
/** The board's own words for a charge, or the statement they are withheld. */
|
|
160
|
+
export type PluginMemberChargeReason = {
|
|
161
|
+
state: "visible";
|
|
162
|
+
text: string;
|
|
163
|
+
} | {
|
|
164
|
+
state: "withheld";
|
|
165
|
+
};
|
|
166
|
+
/** One charge to a member or an apartment (debitering). */
|
|
167
|
+
export interface PluginMemberCharge {
|
|
168
|
+
id: string;
|
|
169
|
+
/** "YYYY-MM-DD" on the association's own calendar. */
|
|
170
|
+
chargedOn: string;
|
|
171
|
+
chargedTo: PluginMemberChargeParty;
|
|
172
|
+
/** Kronor with two decimals. What was charged, never a balance. */
|
|
173
|
+
amount: string;
|
|
174
|
+
vatTreatment: "EXEMPT" | "RATE";
|
|
175
|
+
/** Whole percent, and null exactly when the treatment is EXEMPT. */
|
|
176
|
+
vatRatePercent: number | null;
|
|
177
|
+
/**
|
|
178
|
+
* Withheld with the party, and on a charge to a household where somebody
|
|
179
|
+
* protected or restricted lived on the day of the charge: what the board
|
|
180
|
+
* wrote about a household can say who lives in it as well as a name can.
|
|
181
|
+
*/
|
|
182
|
+
reason: PluginMemberChargeReason;
|
|
183
|
+
/** "YYYY-MM-DD" the basis went to the economic manager, or null. */
|
|
184
|
+
handedToManagerOn: string | null;
|
|
185
|
+
deliveries: PluginDeliveryReceipt[];
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The events the host delivers, by type, with the version it delivers.
|
|
189
|
+
*
|
|
190
|
+
* A version moves when a field is removed or changes meaning; a field added
|
|
191
|
+
* keeps it. The host lists what it delivers in
|
|
192
|
+
* `host.finances.events.supported`, so a plugin built against a newer SDK can
|
|
193
|
+
* tell an event this instance will never send from one that has not happened.
|
|
194
|
+
*/
|
|
195
|
+
export declare const PLUGIN_FINANCE_EVENTS: {
|
|
196
|
+
readonly "feeNotification.issued": 1;
|
|
197
|
+
readonly "memberCharge.recorded": 1;
|
|
198
|
+
readonly "memberCharge.corrected": 1;
|
|
199
|
+
readonly "memberCharge.removed": 1;
|
|
200
|
+
};
|
|
201
|
+
export type PluginFinanceEventType = keyof typeof PLUGIN_FINANCE_EVENTS;
|
|
202
|
+
interface PluginFinanceEventBase {
|
|
203
|
+
/** Unique per event, and the same on every redelivery of it. */
|
|
204
|
+
eventId: string;
|
|
205
|
+
/** When the act was committed. An ISO 8601 instant. */
|
|
206
|
+
occurredAt: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Something happened to the association's finances.
|
|
210
|
+
*
|
|
211
|
+
* Identifiers only. An event carries nothing that names a person or states a
|
|
212
|
+
* figure, so it needs no masking of its own: the plugin reads the row through
|
|
213
|
+
* `host.finances`, on the same rules as every other read.
|
|
214
|
+
*/
|
|
215
|
+
export type PluginFinanceEvent = (PluginFinanceEventBase & {
|
|
216
|
+
type: "feeNotification.issued";
|
|
217
|
+
version: 1;
|
|
218
|
+
notificationId: string;
|
|
219
|
+
}) | (PluginFinanceEventBase & {
|
|
220
|
+
type: "memberCharge.recorded" | "memberCharge.corrected";
|
|
221
|
+
version: 1;
|
|
222
|
+
chargeId: string;
|
|
223
|
+
}) | (PluginFinanceEventBase & {
|
|
224
|
+
type: "memberCharge.removed";
|
|
225
|
+
version: 1;
|
|
226
|
+
/** The charge is gone; only its id is left to say which one it was. */
|
|
227
|
+
chargeId: string;
|
|
228
|
+
});
|
|
229
|
+
export interface PluginFinanceEvents {
|
|
230
|
+
/** What this host delivers, by type and version. */
|
|
231
|
+
readonly supported: Readonly<Record<string, number>>;
|
|
232
|
+
/**
|
|
233
|
+
* Receives every finance event from now on.
|
|
234
|
+
*
|
|
235
|
+
* Call it once, from `onModuleInit`. Delivery is at least once, from a queue
|
|
236
|
+
* the host keeps for this plugin, and the event is enqueued in the same
|
|
237
|
+
* transaction as the act it reports - so an act that rolled back never
|
|
238
|
+
* produces one and one that committed always does. A handler that throws is
|
|
239
|
+
* retried; one that keeps throwing has the event dropped once the retries
|
|
240
|
+
* are spent. Order is not guaranteed. Ignore a `type` you do not know.
|
|
241
|
+
*
|
|
242
|
+
* Events reach a plugin that is serving and subscribed when the act
|
|
243
|
+
* commits. A plugin switched off, or not yet subscribed, misses them, and
|
|
244
|
+
* reads what it missed with `notifications()` and `charges()` when it starts.
|
|
245
|
+
*/
|
|
246
|
+
subscribe(handler: (event: PluginFinanceEvent) => Promise<void> | void): Promise<void>;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* The association's finances, scoped to what the plugin declared.
|
|
250
|
+
*
|
|
251
|
+
* The reads and the events require finances:read; recording a delivery
|
|
252
|
+
* requires finances:recordDelivery.
|
|
253
|
+
*/
|
|
254
|
+
export interface PluginFinances {
|
|
255
|
+
/** The fee notification runs, newest period first. */
|
|
256
|
+
notifications(): Promise<PluginFeeNotificationSummary[]>;
|
|
257
|
+
/** One run with its notices, or null where there is no such run. */
|
|
258
|
+
notification(id: string): Promise<PluginFeeNotification | null>;
|
|
259
|
+
/**
|
|
260
|
+
* The charges dated within a period, both ends inclusive, as "YYYY-MM-DD".
|
|
261
|
+
* In date order, and in the order they were entered within a day.
|
|
262
|
+
*/
|
|
263
|
+
charges(period: {
|
|
264
|
+
from: string;
|
|
265
|
+
to: string;
|
|
266
|
+
}): Promise<PluginMemberCharge[]>;
|
|
267
|
+
/** One charge, or null where there is no such charge. */
|
|
268
|
+
charge(id: string): Promise<PluginMemberCharge | null>;
|
|
269
|
+
/**
|
|
270
|
+
* Records that a notice or a charge was delivered, and returns the receipt.
|
|
271
|
+
*
|
|
272
|
+
* Idempotent: the same target, channel and reference from the same plugin
|
|
273
|
+
* returns the receipt already recorded rather than a second one, so a job
|
|
274
|
+
* retried after a crash cannot record one delivery twice. A reference that
|
|
275
|
+
* holds a Swedish personal identity number is refused.
|
|
276
|
+
*
|
|
277
|
+
* The receipt returned carries the reference visible: it is what the plugin
|
|
278
|
+
* has just stated. A later read withholds it with the row it is on.
|
|
279
|
+
*/
|
|
280
|
+
recordDelivery(input: PluginDeliveryReceiptInput): Promise<PluginDeliveryReceipt>;
|
|
281
|
+
events: PluginFinanceEvents;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* A delivery the host would not record, and why.
|
|
285
|
+
*
|
|
286
|
+
* `reason` is stable and meant for the plugin's own code; the message is
|
|
287
|
+
* English for the server log.
|
|
288
|
+
*/
|
|
289
|
+
export declare class PluginDeliveryRefusedError extends Error {
|
|
290
|
+
readonly reason: "target-not-found" | "channel-invalid" | "reference-invalid" | "reference-holds-personal-identity-number" | "delivered-at-invalid" | "delivered-in-the-future";
|
|
291
|
+
constructor(reason: "target-not-found" | "channel-invalid" | "reference-invalid" | "reference-holds-personal-identity-number" | "delivered-at-invalid" | "delivered-in-the-future", message: string);
|
|
292
|
+
}
|
|
293
|
+
export {};
|
|
294
|
+
//# sourceMappingURL=finances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finances.d.ts","sourceRoot":"","sources":["../src/finances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;;OAWG;IACH,SAAS,EAAE,uBAAuB,CAAC;IACnC,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GACjC;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,U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G,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;IAChE;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAC7E,yDAAyD;IACzD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IACvD;;;;;;;;;;OAUG;IACH,cAAc,CACZ,KAAK,EAAE,0BAA0B,GAChC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAClC,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IAEjD,QAAQ,CAAC,MAAM,EACX,kBAAkB,GAClB,iBAAiB,GACjB,mBAAmB,GACnB,0CAA0C,GAC1C,sBAAsB,GACtB,yBAAyB;IAP/B,YACW,MAAM,EACX,kBAAkB,GAClB,iBAAiB,GACjB,mBAAmB,GACnB,0CAA0C,GAC1C,sBAAsB,GACtB,yBAAyB,EAC7B,OAAO,EAAE,MAAM,EAIhB;CACF"}
|
package/dist/finances.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The association's finances, as a plugin may read them, record a delivery
|
|
3
|
+
* against them and hear about them.
|
|
4
|
+
*
|
|
5
|
+
* What is here is the free half of the boundary ROADMAP.md publishes: the
|
|
6
|
+
* notices and charges core already records, read on the same masking rules as
|
|
7
|
+
* the files the board hands over, a receipt that says one of them was
|
|
8
|
+
* delivered, and an event that says one was issued. What carries them out of
|
|
9
|
+
* Open BRF - an accounting system, a bankgiro file, a reminder - is the
|
|
10
|
+
* plugin's own work.
|
|
11
|
+
*
|
|
12
|
+
* Three rules hold on every member here regardless of permission, and they are
|
|
13
|
+
* the address book's (`PluginAddressBook`) read for money:
|
|
14
|
+
*
|
|
15
|
+
* A person with protected personal data is never named. A notice for their
|
|
16
|
+
* household carries its apartment and its amount and withholds every name;
|
|
17
|
+
* a charge on them carries its date and its amount and withholds who, where
|
|
18
|
+
* and why. The row says so with a `withheld` branch rather than an empty
|
|
19
|
+
* string, so a reader cannot take a withheld value for an absent one.
|
|
20
|
+
*
|
|
21
|
+
* A personal identity number is never returned. No row carries one.
|
|
22
|
+
*
|
|
23
|
+
* There is no payment state, because core records none. Nothing here says
|
|
24
|
+
* whether a notice was paid, what is outstanding or what a balance is, and a
|
|
25
|
+
* delivery receipt is not that either: the accounting system settles the
|
|
26
|
+
* debt, and a second answer to whether something was paid is worse than none.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The events the host delivers, by type, with the version it delivers.
|
|
30
|
+
*
|
|
31
|
+
* A version moves when a field is removed or changes meaning; a field added
|
|
32
|
+
* keeps it. The host lists what it delivers in
|
|
33
|
+
* `host.finances.events.supported`, so a plugin built against a newer SDK can
|
|
34
|
+
* tell an event this instance will never send from one that has not happened.
|
|
35
|
+
*/
|
|
36
|
+
export const PLUGIN_FINANCE_EVENTS = {
|
|
37
|
+
"feeNotification.issued": 1,
|
|
38
|
+
"memberCharge.recorded": 1,
|
|
39
|
+
"memberCharge.corrected": 1,
|
|
40
|
+
"memberCharge.removed": 1,
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* A delivery the host would not record, and why.
|
|
44
|
+
*
|
|
45
|
+
* `reason` is stable and meant for the plugin's own code; the message is
|
|
46
|
+
* English for the server log.
|
|
47
|
+
*/
|
|
48
|
+
export class PluginDeliveryRefusedError extends Error {
|
|
49
|
+
reason;
|
|
50
|
+
constructor(reason, message) {
|
|
51
|
+
super(message);
|
|
52
|
+
this.reason = reason;
|
|
53
|
+
this.name = "PluginDeliveryRefusedError";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=finances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finances.js","sourceRoot":"","sources":["../src/finances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAoKH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,wBAAwB,EAAE,CAAC;IAC3B,uBAAuB,EAAE,CAAC;IAC1B,wBAAwB,EAAE,CAAC;IAC3B,sBAAsB,EAAE,CAAC;CACjB,CAAC;AA6FX;;;;;GAKG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAExC,MAAM;IADjB,YACW,MAMoB,EAC7B,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;sBATN,MAAM;QAUf,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,156 @@
|
|
|
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 declare const PLUGIN_FINDING_REASONS: readonly [
|
|
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
|
+
export type PluginFindingReason = (typeof PLUGIN_FINDING_REASONS)[number];
|
|
123
|
+
/**
|
|
124
|
+
* The values a finding's sentence is completed with.
|
|
125
|
+
*
|
|
126
|
+
* Identifiers, paths, numbers and what a thrown error said - never a sentence,
|
|
127
|
+
* and never personal data. A list stays a list rather than being joined here,
|
|
128
|
+
* because its members can have sentences of their own: a board told that a
|
|
129
|
+
* package handles a category it never agreed to has to read that category in
|
|
130
|
+
* its own language, not as `residency`.
|
|
131
|
+
*/
|
|
132
|
+
export type PluginFindingDetail = Readonly<Record<string, string | number | readonly string[]>>;
|
|
133
|
+
/**
|
|
134
|
+
* The manifest rules whose refusal a board reads in its own language.
|
|
135
|
+
*
|
|
136
|
+
* A manifest that fails validation is reported as `manifest-invalid`, and
|
|
137
|
+
* what Zod says about a field is English for the plugin's author. The rules
|
|
138
|
+
* below are not about one field: they hold two declarations against each
|
|
139
|
+
* other, and a board reading why a package was skipped needs to be told which
|
|
140
|
+
* in a sentence of its own. So the refusal carries the code with the English
|
|
141
|
+
* line, and the interface translates the code. Any other problem stays the
|
|
142
|
+
* English line, which is what an author fixes the package from.
|
|
143
|
+
*/
|
|
144
|
+
export declare const PLUGIN_MANIFEST_RULES: readonly [
|
|
145
|
+
/** A device route overlaps the OAuth protected resource. */
|
|
146
|
+
"device-route-overlaps-oauth-resource",
|
|
147
|
+
/** A plugin with a device route also reads the register or the finances. */
|
|
148
|
+
"device-route-reads-register",
|
|
149
|
+
/** A plugin with a website block also reads the register or the finances. */
|
|
150
|
+
"blocks-read-register",
|
|
151
|
+
/** A plugin with a device route also proposes imports. */
|
|
152
|
+
"device-route-proposes-import",
|
|
153
|
+
/** A plugin with a website block also proposes imports. */
|
|
154
|
+
"blocks-propose-import"];
|
|
155
|
+
export type PluginManifestRule = (typeof PLUGIN_MANIFEST_RULES)[number];
|
|
156
|
+
//# sourceMappingURL=findings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findings.d.ts","sourceRoot":"","sources":["../src/findings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB;AACjC,6CAA6C;AAC7C,kBAAkB;AAClB,yEAAyE;AACzE,yBAAyB;AACzB,mDAAmD;AACnD,eAAe;AACf,wDAAwD;AACxD,eAAe;AACf,wDAAwD;AACxD,gBAAgB;AAChB,+DAA+D;AAC/D,gBAAgB;AAChB,0DAA0D;AAC1D,eAAe;AACf,wEAAwE;AACxE,iBAAiB;AACjB,8CAA8C;AAC9C,qBAAqB;AACrB,qEAAqE;AACrE,uBAAuB;AACvB,+CAA+C;AAC/C,eAAe;AACf,2CAA2C;AAC3C,UAAU;AACV,mCAAmC;AACnC,aAAa;AACb,6CAA6C;AAC7C,eAAe;AACf,6EAA6E;AAC7E,iBAAiB;AACjB,+DAA+D;AAC/D,gBAAgB;AAChB;;;GAGG;AACH,YAAY;AACZ;;;;GAIG;AACH,iBAAiB;AACjB;;;GAGG;AACH,wBAAwB;AACxB,mEAAmE;AACnE,eAAe;AACf,6EAA6E;AAC7E,qBAAqB;AACrB;;;;GAIG;AACH,yBAAyB;AACzB;;;GAGG;AACH,wBAAwB;AACxB,4DAA4D;AAC5D,yBAAyB;AACzB;;;GAGG;AACH,+BAA+B;AAC/B,2EAA2E;AAC3E,iCAAiC;AACjC;;;;GAIG;AACH,8BAA8B;AAC9B;;;GAGG;AACH,sCAAsC;AACtC;;;;GAIG;AACH,yBAAyB;AACzB;;;GAGG;AACH,oBAAoB;AACpB,wEAAwE;AACxE,mBAAmB;AACnB;;;GAGG;AACH,oBAAoB;AACpB;;;GAGG;AACH,uBAAuB,CACf,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CACxC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC,CACpD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB;AAChC,4DAA4D;AAC5D,sCAAsC;AACtC,4EAA4E;AAC5E,6BAA6B;AAC7B,6EAA6E;AAC7E,sBAAsB;AACtB,0DAA0D;AAC1D,8BAA8B;AAC9B,2DAA2D;AAC3D,uBAAuB,CACf,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/findings.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
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
|
+
];
|
|
123
|
+
/**
|
|
124
|
+
* The manifest rules whose refusal a board reads in its own language.
|
|
125
|
+
*
|
|
126
|
+
* A manifest that fails validation is reported as `manifest-invalid`, and
|
|
127
|
+
* what Zod says about a field is English for the plugin's author. The rules
|
|
128
|
+
* below are not about one field: they hold two declarations against each
|
|
129
|
+
* other, and a board reading why a package was skipped needs to be told which
|
|
130
|
+
* in a sentence of its own. So the refusal carries the code with the English
|
|
131
|
+
* line, and the interface translates the code. Any other problem stays the
|
|
132
|
+
* English line, which is what an author fixes the package from.
|
|
133
|
+
*/
|
|
134
|
+
export const PLUGIN_MANIFEST_RULES = [
|
|
135
|
+
/** A device route overlaps the OAuth protected resource. */
|
|
136
|
+
"device-route-overlaps-oauth-resource",
|
|
137
|
+
/** A plugin with a device route also reads the register or the finances. */
|
|
138
|
+
"device-route-reads-register",
|
|
139
|
+
/** A plugin with a website block also reads the register or the finances. */
|
|
140
|
+
"blocks-read-register",
|
|
141
|
+
/** A plugin with a device route also proposes imports. */
|
|
142
|
+
"device-route-proposes-import",
|
|
143
|
+
/** A plugin with a website block also proposes imports. */
|
|
144
|
+
"blocks-propose-import",
|
|
145
|
+
];
|
|
146
|
+
//# sourceMappingURL=findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findings.js","sourceRoot":"","sources":["../src/findings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,6CAA6C;IAC7C,kBAAkB;IAClB,yEAAyE;IACzE,yBAAyB;IACzB,mDAAmD;IACnD,eAAe;IACf,wDAAwD;IACxD,eAAe;IACf,wDAAwD;IACxD,gBAAgB;IAChB,+DAA+D;IAC/D,gBAAgB;IAChB,0DAA0D;IAC1D,eAAe;IACf,wEAAwE;IACxE,iBAAiB;IAC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