@openbrf/plugin-sdk 0.0.0-stage → 1.0.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/dist/action-schema.d.ts +42 -0
- package/dist/action-schema.d.ts.map +1 -0
- package/dist/action-schema.js +64 -0
- package/dist/action-schema.js.map +1 -0
- package/dist/actions.d.ts +199 -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/catalog.d.ts +315 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +203 -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/findings.d.ts +67 -0
- package/dist/findings.d.ts.map +1 -0
- package/dist/findings.js +57 -0
- package/dist/findings.js.map +1 -0
- package/dist/host.d.ts +208 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +41 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -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/manifest.d.ts +392 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +324 -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 +65 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +69 -0
- package/dist/permissions.js.map +1 -0
- package/dist/settings-schema.d.ts +95 -0
- package/dist/settings-schema.d.ts.map +1 -0
- package/dist/settings-schema.js +219 -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/action-schema.ts +86 -0
- package/src/actions.ts +247 -0
- package/src/api-version.ts +28 -0
- package/src/catalog.ts +236 -0
- package/src/define-plugin.ts +18 -0
- package/src/findings.ts +71 -0
- package/src/host.ts +240 -0
- package/src/index.ts +123 -0
- package/src/integrity.ts +125 -0
- package/src/manifest.ts +385 -0
- package/src/module.ts +38 -0
- package/src/package-check.ts +894 -0
- package/src/permissions.ts +75 -0
- package/src/settings-schema.ts +272 -0
- package/src/standard-schema.ts +39 -0
- package/README.md +0 -3
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The plugin manifest.
|
|
4
|
+
*
|
|
5
|
+
* It lives in the `openbrf` field of the plugin's own package.json rather
|
|
6
|
+
* than in a separate file: npm already installs package.json, already
|
|
7
|
+
* validates its name and version, and already refuses to install a package
|
|
8
|
+
* without one. A second manifest file could go missing, disagree with the
|
|
9
|
+
* package it sits in, or be left behind by a partial extraction, and the
|
|
10
|
+
* loader would have to decide which of the two to believe.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A plugin id.
|
|
14
|
+
*
|
|
15
|
+
* Used as a URL segment (`/api/plugin/<id>/...`), an i18n namespace
|
|
16
|
+
* (`plugin-<id>`), a database key and a directory name, so it is restricted to
|
|
17
|
+
* what is safe in all four. In particular it may not contain a dot or a
|
|
18
|
+
* slash: a plugin id is resolved against paths, and `..` must not be
|
|
19
|
+
* expressible.
|
|
20
|
+
*/
|
|
21
|
+
export declare const pluginIdSchema: z.ZodString;
|
|
22
|
+
export declare const pluginEntrySchema: z.ZodObject<{
|
|
23
|
+
server: z.ZodOptional<z.ZodString>;
|
|
24
|
+
client: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
/**
|
|
27
|
+
* One action the plugin proposes.
|
|
28
|
+
*
|
|
29
|
+
* Declared in the manifest rather than at registration, because the board reads
|
|
30
|
+
* it on the install consent screen before anything has been downloaded, and
|
|
31
|
+
* nothing that can refuse a plugin may run after the code that executes it. The
|
|
32
|
+
* plugin's bundle supplies the schemas and the handler; what it may ask for is
|
|
33
|
+
* settled here.
|
|
34
|
+
*
|
|
35
|
+
* `capability` is a free string because this package cannot import the core
|
|
36
|
+
* capability union - it is published to plugin authors and the union is the
|
|
37
|
+
* instance's. It is resolved against the real list at the boot gate, which also
|
|
38
|
+
* refuses the ones no action of any kind may hold.
|
|
39
|
+
*/
|
|
40
|
+
export declare const pluginActionSchema: z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
capability: z.ZodString;
|
|
43
|
+
effect: z.ZodEnum<{
|
|
44
|
+
delete: "delete";
|
|
45
|
+
read: "read";
|
|
46
|
+
write: "write";
|
|
47
|
+
}>;
|
|
48
|
+
personalData: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
49
|
+
account: "account";
|
|
50
|
+
apartment: "apartment";
|
|
51
|
+
auditTrail: "auditTrail";
|
|
52
|
+
email: "email";
|
|
53
|
+
financial: "financial";
|
|
54
|
+
freeText: "freeText";
|
|
55
|
+
health: "health";
|
|
56
|
+
name: "name";
|
|
57
|
+
personalIdentityNumber: "personalIdentityNumber";
|
|
58
|
+
phone: "phone";
|
|
59
|
+
photograph: "photograph";
|
|
60
|
+
postalAddress: "postalAddress";
|
|
61
|
+
protected: "protected";
|
|
62
|
+
residency: "residency";
|
|
63
|
+
}>>>;
|
|
64
|
+
surfaces: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
65
|
+
ai: "ai";
|
|
66
|
+
mcp: "mcp";
|
|
67
|
+
ui: "ui";
|
|
68
|
+
}>>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
/**
|
|
71
|
+
* The declared actions, as every boundary that reads them must read them.
|
|
72
|
+
*
|
|
73
|
+
* One schema rather than the same array written twice, because the invariant
|
|
74
|
+
* below has to hold at both: the catalog entry the consent screen renders from,
|
|
75
|
+
* and the manifest the loader enforces against it.
|
|
76
|
+
*
|
|
77
|
+
* An id appears once. Two declarations sharing one id are not a redundancy that
|
|
78
|
+
* sorts itself out - each of the three places that reads them resolves the
|
|
79
|
+
* collision differently. The binder takes the LAST, through a Map; consent
|
|
80
|
+
* compares canonical strings as a SET, so reordering the pair leaves the
|
|
81
|
+
* comparison equal and asks the board nothing; and arming stores the bare id,
|
|
82
|
+
* which names both. A republished version that only swapped the order of a
|
|
83
|
+
* duplicated pair would therefore keep its arming and go live at the OTHER
|
|
84
|
+
* declaration's capability, personal data and surfaces, with nobody having
|
|
85
|
+
* decided that. An action is one operation with one capability; two of them
|
|
86
|
+
* wearing one id is not a declaration this can read.
|
|
87
|
+
*
|
|
88
|
+
* Undefaulted, so each use site says for itself whether an absent list means
|
|
89
|
+
* "none declared" or "you did not answer". A manifest and a catalog entry mean
|
|
90
|
+
* the first and add `.default([])`; the install request means the second, since
|
|
91
|
+
* a board's echo that silently became an empty list would read as consent to no
|
|
92
|
+
* action at all - and a plugin that declares one would then be refused with a
|
|
93
|
+
* mismatch nothing the board could do would satisfy.
|
|
94
|
+
*/
|
|
95
|
+
export declare const pluginActionsSchema: z.ZodArray<z.ZodObject<{
|
|
96
|
+
id: z.ZodString;
|
|
97
|
+
capability: z.ZodString;
|
|
98
|
+
effect: z.ZodEnum<{
|
|
99
|
+
delete: "delete";
|
|
100
|
+
read: "read";
|
|
101
|
+
write: "write";
|
|
102
|
+
}>;
|
|
103
|
+
personalData: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
104
|
+
account: "account";
|
|
105
|
+
apartment: "apartment";
|
|
106
|
+
auditTrail: "auditTrail";
|
|
107
|
+
email: "email";
|
|
108
|
+
financial: "financial";
|
|
109
|
+
freeText: "freeText";
|
|
110
|
+
health: "health";
|
|
111
|
+
name: "name";
|
|
112
|
+
personalIdentityNumber: "personalIdentityNumber";
|
|
113
|
+
phone: "phone";
|
|
114
|
+
photograph: "photograph";
|
|
115
|
+
postalAddress: "postalAddress";
|
|
116
|
+
protected: "protected";
|
|
117
|
+
residency: "residency";
|
|
118
|
+
}>>>;
|
|
119
|
+
surfaces: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
120
|
+
ai: "ai";
|
|
121
|
+
mcp: "mcp";
|
|
122
|
+
ui: "ui";
|
|
123
|
+
}>>>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
/**
|
|
126
|
+
* The declared actions over a given reading of one action.
|
|
127
|
+
*
|
|
128
|
+
* The manifest reads an action as `pluginActionSchema` does; the catalog index
|
|
129
|
+
* reads the same fields strictly, because the index refuses a field its
|
|
130
|
+
* version does not define. Both keep the rule above, which is why the list is
|
|
131
|
+
* built here rather than written again.
|
|
132
|
+
*/
|
|
133
|
+
export declare function declaredActionsSchema<T extends z.ZodType<{
|
|
134
|
+
id: string;
|
|
135
|
+
}>>(action: T): z.ZodArray<T>;
|
|
136
|
+
/**
|
|
137
|
+
* The public name a declared action is offered under.
|
|
138
|
+
*
|
|
139
|
+
* The plugin's id with dashes folded to underscores, then the action's id. The
|
|
140
|
+
* folding has a consequence worth knowing: a plugin `a-b` declaring `c` and a
|
|
141
|
+
* plugin `a` declaring `b_c` compose the same name, so the registry refuses the
|
|
142
|
+
* second one to arrive and docs/plugin-contract.md says so.
|
|
143
|
+
*/
|
|
144
|
+
export declare function composedActionName(pluginId: string, actionId: string): string;
|
|
145
|
+
export declare const pluginManifestSchema: z.ZodObject<{
|
|
146
|
+
apiVersion: z.ZodInt;
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
entry: z.ZodObject<{
|
|
149
|
+
server: z.ZodOptional<z.ZodString>;
|
|
150
|
+
client: z.ZodOptional<z.ZodString>;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
permissions: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
153
|
+
"addressBook:read": "addressBook:read";
|
|
154
|
+
"addressBook:readContact": "addressBook:readContact";
|
|
155
|
+
"jobs:schedule": "jobs:schedule";
|
|
156
|
+
"mail:send": "mail:send";
|
|
157
|
+
"sms:send": "sms:send";
|
|
158
|
+
}>>>;
|
|
159
|
+
personalData: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
160
|
+
apartment: "apartment";
|
|
161
|
+
email: "email";
|
|
162
|
+
name: "name";
|
|
163
|
+
phone: "phone";
|
|
164
|
+
residency: "residency";
|
|
165
|
+
}>>>;
|
|
166
|
+
settingsSchema: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
168
|
+
key: z.ZodString;
|
|
169
|
+
labelKey: z.ZodString;
|
|
170
|
+
hintKey: z.ZodOptional<z.ZodString>;
|
|
171
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
172
|
+
type: z.ZodLiteral<"text">;
|
|
173
|
+
default: z.ZodOptional<z.ZodString>;
|
|
174
|
+
minLength: z.ZodOptional<z.ZodInt>;
|
|
175
|
+
maxLength: z.ZodOptional<z.ZodInt>;
|
|
176
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
177
|
+
key: z.ZodString;
|
|
178
|
+
labelKey: z.ZodString;
|
|
179
|
+
hintKey: z.ZodOptional<z.ZodString>;
|
|
180
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
181
|
+
type: z.ZodLiteral<"number">;
|
|
182
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
integer: z.ZodDefault<z.ZodBoolean>;
|
|
186
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
+
key: z.ZodString;
|
|
188
|
+
labelKey: z.ZodString;
|
|
189
|
+
hintKey: z.ZodOptional<z.ZodString>;
|
|
190
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
191
|
+
type: z.ZodLiteral<"boolean">;
|
|
192
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
193
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
194
|
+
key: z.ZodString;
|
|
195
|
+
labelKey: z.ZodString;
|
|
196
|
+
hintKey: z.ZodOptional<z.ZodString>;
|
|
197
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
198
|
+
type: z.ZodLiteral<"select">;
|
|
199
|
+
default: z.ZodOptional<z.ZodString>;
|
|
200
|
+
options: z.ZodArray<z.ZodObject<{
|
|
201
|
+
value: z.ZodString;
|
|
202
|
+
labelKey: z.ZodString;
|
|
203
|
+
}, z.core.$strip>>;
|
|
204
|
+
}, z.core.$strip>], "type">>;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
view: z.ZodOptional<z.ZodObject<{
|
|
207
|
+
module: z.ZodDefault<z.ZodString>;
|
|
208
|
+
titleKey: z.ZodString;
|
|
209
|
+
}, z.core.$strip>>;
|
|
210
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
211
|
+
id: z.ZodString;
|
|
212
|
+
capability: z.ZodString;
|
|
213
|
+
effect: z.ZodEnum<{
|
|
214
|
+
delete: "delete";
|
|
215
|
+
read: "read";
|
|
216
|
+
write: "write";
|
|
217
|
+
}>;
|
|
218
|
+
personalData: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
219
|
+
account: "account";
|
|
220
|
+
apartment: "apartment";
|
|
221
|
+
auditTrail: "auditTrail";
|
|
222
|
+
email: "email";
|
|
223
|
+
financial: "financial";
|
|
224
|
+
freeText: "freeText";
|
|
225
|
+
health: "health";
|
|
226
|
+
name: "name";
|
|
227
|
+
personalIdentityNumber: "personalIdentityNumber";
|
|
228
|
+
phone: "phone";
|
|
229
|
+
photograph: "photograph";
|
|
230
|
+
postalAddress: "postalAddress";
|
|
231
|
+
protected: "protected";
|
|
232
|
+
residency: "residency";
|
|
233
|
+
}>>>;
|
|
234
|
+
surfaces: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
235
|
+
ai: "ai";
|
|
236
|
+
mcp: "mcp";
|
|
237
|
+
ui: "ui";
|
|
238
|
+
}>>>;
|
|
239
|
+
}, z.core.$strip>>>;
|
|
240
|
+
oauthProtectedResource: z.ZodOptional<z.ZodString>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
export type PluginManifest = z.infer<typeof pluginManifestSchema>;
|
|
243
|
+
export type PluginActionDeclaration = z.infer<typeof pluginActionSchema>;
|
|
244
|
+
export type PluginEntry = z.infer<typeof pluginEntrySchema>;
|
|
245
|
+
/**
|
|
246
|
+
* Dependency fields npm installs at install time.
|
|
247
|
+
*
|
|
248
|
+
* The installer omits peer, dev and optional dependencies and runs no scripts,
|
|
249
|
+
* but it still hands npm the package: anything listed here would send that npm
|
|
250
|
+
* to a registry, which an instance never contacts. optionalDependencies is
|
|
251
|
+
* listed although it is omitted, because a package relying on one being
|
|
252
|
+
* present works in development and quietly not on an instance.
|
|
253
|
+
*/
|
|
254
|
+
export declare const RUNTIME_DEPENDENCY_FIELDS: readonly ["dependencies", "optionalDependencies", "bundleDependencies", "bundledDependencies"];
|
|
255
|
+
/** Package names in a dependency field, whether a map or npm's bundle list. */
|
|
256
|
+
export declare function dependencyNames(value: unknown): string[];
|
|
257
|
+
/** Whether a dependency field is an empty map or an empty list. */
|
|
258
|
+
export declare function isEmptyDependencyField(value: unknown): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* The subset of package.json the loader reads. Everything else in the file is
|
|
261
|
+
* npm's business, apart from the dependency fields, which must name nothing.
|
|
262
|
+
*/
|
|
263
|
+
export declare const pluginPackageSchema: z.ZodObject<{
|
|
264
|
+
name: z.ZodString;
|
|
265
|
+
version: z.ZodString;
|
|
266
|
+
openbrf: z.ZodObject<{
|
|
267
|
+
apiVersion: z.ZodInt;
|
|
268
|
+
id: z.ZodString;
|
|
269
|
+
entry: z.ZodObject<{
|
|
270
|
+
server: z.ZodOptional<z.ZodString>;
|
|
271
|
+
client: z.ZodOptional<z.ZodString>;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
permissions: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
274
|
+
"addressBook:read": "addressBook:read";
|
|
275
|
+
"addressBook:readContact": "addressBook:readContact";
|
|
276
|
+
"jobs:schedule": "jobs:schedule";
|
|
277
|
+
"mail:send": "mail:send";
|
|
278
|
+
"sms:send": "sms:send";
|
|
279
|
+
}>>>;
|
|
280
|
+
personalData: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
281
|
+
apartment: "apartment";
|
|
282
|
+
email: "email";
|
|
283
|
+
name: "name";
|
|
284
|
+
phone: "phone";
|
|
285
|
+
residency: "residency";
|
|
286
|
+
}>>>;
|
|
287
|
+
settingsSchema: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
289
|
+
key: z.ZodString;
|
|
290
|
+
labelKey: z.ZodString;
|
|
291
|
+
hintKey: z.ZodOptional<z.ZodString>;
|
|
292
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
293
|
+
type: z.ZodLiteral<"text">;
|
|
294
|
+
default: z.ZodOptional<z.ZodString>;
|
|
295
|
+
minLength: z.ZodOptional<z.ZodInt>;
|
|
296
|
+
maxLength: z.ZodOptional<z.ZodInt>;
|
|
297
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
298
|
+
key: z.ZodString;
|
|
299
|
+
labelKey: z.ZodString;
|
|
300
|
+
hintKey: z.ZodOptional<z.ZodString>;
|
|
301
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
302
|
+
type: z.ZodLiteral<"number">;
|
|
303
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
305
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
integer: z.ZodDefault<z.ZodBoolean>;
|
|
307
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
308
|
+
key: z.ZodString;
|
|
309
|
+
labelKey: z.ZodString;
|
|
310
|
+
hintKey: z.ZodOptional<z.ZodString>;
|
|
311
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
312
|
+
type: z.ZodLiteral<"boolean">;
|
|
313
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
314
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
315
|
+
key: z.ZodString;
|
|
316
|
+
labelKey: z.ZodString;
|
|
317
|
+
hintKey: z.ZodOptional<z.ZodString>;
|
|
318
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
319
|
+
type: z.ZodLiteral<"select">;
|
|
320
|
+
default: z.ZodOptional<z.ZodString>;
|
|
321
|
+
options: z.ZodArray<z.ZodObject<{
|
|
322
|
+
value: z.ZodString;
|
|
323
|
+
labelKey: z.ZodString;
|
|
324
|
+
}, z.core.$strip>>;
|
|
325
|
+
}, z.core.$strip>], "type">>;
|
|
326
|
+
}, z.core.$strip>>;
|
|
327
|
+
view: z.ZodOptional<z.ZodObject<{
|
|
328
|
+
module: z.ZodDefault<z.ZodString>;
|
|
329
|
+
titleKey: z.ZodString;
|
|
330
|
+
}, z.core.$strip>>;
|
|
331
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
332
|
+
id: z.ZodString;
|
|
333
|
+
capability: z.ZodString;
|
|
334
|
+
effect: z.ZodEnum<{
|
|
335
|
+
delete: "delete";
|
|
336
|
+
read: "read";
|
|
337
|
+
write: "write";
|
|
338
|
+
}>;
|
|
339
|
+
personalData: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
340
|
+
account: "account";
|
|
341
|
+
apartment: "apartment";
|
|
342
|
+
auditTrail: "auditTrail";
|
|
343
|
+
email: "email";
|
|
344
|
+
financial: "financial";
|
|
345
|
+
freeText: "freeText";
|
|
346
|
+
health: "health";
|
|
347
|
+
name: "name";
|
|
348
|
+
personalIdentityNumber: "personalIdentityNumber";
|
|
349
|
+
phone: "phone";
|
|
350
|
+
photograph: "photograph";
|
|
351
|
+
postalAddress: "postalAddress";
|
|
352
|
+
protected: "protected";
|
|
353
|
+
residency: "residency";
|
|
354
|
+
}>>>;
|
|
355
|
+
surfaces: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
356
|
+
ai: "ai";
|
|
357
|
+
mcp: "mcp";
|
|
358
|
+
ui: "ui";
|
|
359
|
+
}>>>;
|
|
360
|
+
}, z.core.$strip>>>;
|
|
361
|
+
oauthProtectedResource: z.ZodOptional<z.ZodString>;
|
|
362
|
+
}, z.core.$strip>;
|
|
363
|
+
dependencies: z.ZodOptional<z.ZodUnknown>;
|
|
364
|
+
optionalDependencies: z.ZodOptional<z.ZodUnknown>;
|
|
365
|
+
bundleDependencies: z.ZodOptional<z.ZodUnknown>;
|
|
366
|
+
bundledDependencies: z.ZodOptional<z.ZodUnknown>;
|
|
367
|
+
}, z.core.$strip>;
|
|
368
|
+
export type PluginPackage = z.infer<typeof pluginPackageSchema>;
|
|
369
|
+
export interface ManifestParseFailure {
|
|
370
|
+
ok: false;
|
|
371
|
+
/** One line per problem, already naming the field. */
|
|
372
|
+
issues: string[];
|
|
373
|
+
}
|
|
374
|
+
export type ManifestParseResult = {
|
|
375
|
+
ok: true;
|
|
376
|
+
value: PluginPackage;
|
|
377
|
+
} | ManifestParseFailure;
|
|
378
|
+
/**
|
|
379
|
+
* Parses a plugin's package.json.
|
|
380
|
+
*
|
|
381
|
+
* Returns a result rather than throwing, because the only caller that matters
|
|
382
|
+
* is the boot-time scan, and a malformed plugin directory must be skipped and
|
|
383
|
+
* reported rather than being allowed to take the register offline (ADR 0003).
|
|
384
|
+
* A thrown error would make "skip and report" the caller's discipline instead
|
|
385
|
+
* of the function's contract.
|
|
386
|
+
*/
|
|
387
|
+
export declare function parsePluginPackage(input: unknown): ManifestParseResult;
|
|
388
|
+
/** Convenience for a plugin's own CI: throws with every problem at once. */
|
|
389
|
+
export declare function assertPluginPackage(input: unknown): PluginPackage;
|
|
390
|
+
/** The api version a plugin authored against this SDK should declare. */
|
|
391
|
+
export declare const CURRENT_PLUGIN_API_VERSION = 1;
|
|
392
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,aAOxB,CAAC;AAqBJ,eAAO,MAAM,iBAAiB;;;iBAiB3B,CAAC;AAoBJ;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM7B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAA4C,CAAC;AAE7E;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EACvE,MAAM,EAAE,CAAC,iBAkBV;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkE7B,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,YACpC,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,CACb,CAAC;AAEX,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAKxD;AAED,mEAAmE;AACnE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAS9D;AA6BD;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,KAAK,CAAC;IACV,sDAAsD;IACtD,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,MAAM,mBAAmB,GAC7B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,GAAG,oBAAoB,CAAC;AAE5D;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CAWtE;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAQjE;AAED,yEAAyE;AACzE,eAAO,MAAM,0BAA0B,IAAqB,CAAC"}
|