initiative-plugin-sdk 5.0.0 → 7.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/README.md +200 -7
- package/dist/build.d.ts +5 -5
- package/dist/build.js +140 -10
- package/dist/build.js.map +1 -1
- package/dist/client.d.ts +68 -3
- package/dist/client.js +71 -1
- package/dist/client.js.map +1 -1
- package/dist/contract.d.ts +259 -4
- package/dist/contract.js +28 -2
- package/dist/contract.js.map +1 -1
- package/dist/define.d.ts +176 -6
- package/dist/define.js +7 -2
- package/dist/define.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +2 -0
- package/dist/jsx-dev-runtime.js +3 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.d.ts +28 -0
- package/dist/jsx-runtime.js +20 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +1 -1
- package/dist/manifest.js.map +1 -1
- package/dist/pack.js +1 -2
- package/dist/pack.js.map +1 -1
- package/dist/parts.d.ts +43 -0
- package/dist/parts.js +63 -0
- package/dist/parts.js.map +1 -0
- package/dist/plugin-api.generated.d.ts +1 -3
- package/dist/plugin-api.generated.js +1 -1
- package/dist/plugin-api.generated.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +51 -11
- package/dist/server.js.map +1 -1
- package/dist/tokens.d.ts +27 -4
- package/dist/tokens.js +34 -5
- package/dist/tokens.js.map +1 -1
- package/dist/validate.d.ts +4 -2
- package/dist/validate.js +86 -6
- package/dist/validate.js.map +1 -1
- package/manifest.contract.json +439 -3
- package/package.json +15 -3
- package/schemas/plugin-api.json +3 -36
- package/schemas/plugin-manifest.json +435 -2
package/dist/contract.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* from, and the shape of every object it defines, so this package's types
|
|
9
9
|
* cannot describe a manifest the schema refuses, nor miss a term it allows.
|
|
10
10
|
*/
|
|
11
|
-
export const FEATURES = ["dashboards", "endpoints", "pages", "widgets"];
|
|
11
|
+
export const FEATURES = ["actions", "dashboards", "endpoints", "fields", "pages", "parts", "widgets"];
|
|
12
12
|
export const PROTOCOLS = [1];
|
|
13
13
|
export const CONNECTION_SCOPES = ["interactive", "static"];
|
|
14
14
|
export const FLOW_TYPES = ["oauth2"];
|
|
@@ -28,6 +28,9 @@ export const ACTOR_KINDS = ["installation", "member"];
|
|
|
28
28
|
export const SCOPES = ["projects:read", "projects:write", "files:read", "files:write", "queues:read", "queues:write", "counter_groups:read", "counter_groups:write", "calendars:read", "calendars:write", "dashboards:read", "dashboards:write", "posts:read", "posts:write", "galleries:read", "galleries:write", "wikis:read", "wikis:write", "comments:read", "comments:write", "relationships:read", "relationships:write", "tags:read", "tags:write", "properties:read", "properties:write", "sharing:read", "sharing:write", "members:read", "initiatives:read", "initiatives:moderate", "community:admin"];
|
|
29
29
|
export const SURFACE_SCOPES = ["community", "initiative"];
|
|
30
30
|
export const PAGE_CAPABILITIES = ["camera", "clipboard-read", "clipboard-write", "display-capture", "fullscreen", "geolocation", "microphone"];
|
|
31
|
+
export const ITEM_KINDS = ["task", "calendar_event", "queue_item", "counter", "gallery_image", "post"];
|
|
32
|
+
export const FIELD_KINDS = ["text", "number", "date", "datetime", "link", "badge", "progress", "checkbox"];
|
|
33
|
+
export const TONES = ["accent", "positive", "negative", "warning", "neutral", "muted"];
|
|
31
34
|
export const LISTING_KINDS = ["plugin", "dashboard"];
|
|
32
35
|
export const HTTP_METHODS = ["DELETE", "GET", "PATCH", "POST", "PUT"];
|
|
33
36
|
export const PAGE_LIMITS = ["refuse", "truncate"];
|
|
@@ -54,6 +57,19 @@ export const CAPS = {
|
|
|
54
57
|
returnsPerEndpoint: 24,
|
|
55
58
|
pages: 12,
|
|
56
59
|
pageCapabilities: 8,
|
|
60
|
+
fields: 32,
|
|
61
|
+
parts: 16,
|
|
62
|
+
actions: 16,
|
|
63
|
+
partNodes: 50,
|
|
64
|
+
partDepth: 4,
|
|
65
|
+
metadataKeyLength: 64,
|
|
66
|
+
metadataValueBytes: 8192,
|
|
67
|
+
metadataLookupLength: 255,
|
|
68
|
+
metadataKeysPerObject: 32,
|
|
69
|
+
metadataBytesPerObject: 65536,
|
|
70
|
+
installMetadataKeys: 256,
|
|
71
|
+
installMetadataBytes: 1048576,
|
|
72
|
+
partsPlacedPerItem: 3,
|
|
57
73
|
bundledDashboards: 8,
|
|
58
74
|
dashboardWidgets: 50,
|
|
59
75
|
dashboardGridColumns: 12,
|
|
@@ -121,6 +137,7 @@ export const CHARSETS = {
|
|
|
121
137
|
version: "0123456789.-+abcdefghijklmnopqrstuvwxyz",
|
|
122
138
|
artwork: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/._-",
|
|
123
139
|
queryName: "-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[]_abcdefghijklmnopqrstuvwxyz~",
|
|
140
|
+
metadataKey: "._0123456789abcdefghijklmnopqrstuvwxyz",
|
|
124
141
|
};
|
|
125
142
|
/**
|
|
126
143
|
* Every field the contract declares, by the object that owns it.
|
|
@@ -148,6 +165,15 @@ export const FIELDS = {
|
|
|
148
165
|
endpoint: ["id", "label", "description", "returns", "group", "needs_subject", "direction", "params", "actors", "admin_only", "public", "requires", "cache_ttl_seconds", "identity", "unavailable", "request", "steps", "map", "errors"],
|
|
149
166
|
widget: ["id", "meta", "module_source", "endpoints", "sample_data", "requires"],
|
|
150
167
|
page: ["id", "path", "name", "scopes", "admin_only", "capabilities", "requires"],
|
|
168
|
+
field: ["key", "name", "kind", "on", "description", "tone", "requires"],
|
|
169
|
+
sectionNode: ["type", "props", "children"],
|
|
170
|
+
stackNode: ["type", "props", "children"],
|
|
171
|
+
fieldNode: ["type", "props"],
|
|
172
|
+
valueNode: ["type", "props"],
|
|
173
|
+
textNode: ["type", "props"],
|
|
174
|
+
buttonNode: ["type", "props"],
|
|
175
|
+
part: ["id", "name", "on", "tree", "description", "requires"],
|
|
176
|
+
action: ["id", "name", "endpoint", "on", "confirm", "menu", "requires"],
|
|
151
177
|
bundledDashboard: ["uid", "public_id", "name", "description", "layout", "widgets"],
|
|
152
178
|
bundledDashboardWidget: ["id", "type", "title", "grid", "binding"],
|
|
153
179
|
endpointIdentity: ["kind", "key"],
|
|
@@ -164,6 +190,6 @@ export const FIELDS = {
|
|
|
164
190
|
healthState: ["status", "when", "state"],
|
|
165
191
|
webhookEvent: ["when", "emit", "map"],
|
|
166
192
|
webhookStatus: ["when", "connection", "state"],
|
|
167
|
-
manifest: ["plugin_kind", "service", "features", "default_name", "minimum_age", "min_plugin_api", "hosts", "auth", "vendor", "connections", "webhooks", "schedules", "endpoints", "community_summary", "widgets", "pages", "dashboards"],
|
|
193
|
+
manifest: ["plugin_kind", "service", "features", "default_name", "minimum_age", "min_plugin_api", "hosts", "auth", "vendor", "connections", "webhooks", "schedules", "endpoints", "community_summary", "widgets", "pages", "dashboards", "fields", "parts", "actions"],
|
|
168
194
|
};
|
|
169
195
|
//# sourceMappingURL=contract.js.map
|
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,MAAM,CAAC,MAAM,QAAQ,GAAuB,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,MAAM,CAAC,MAAM,QAAQ,GAAuB,CAAC,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;AAG1H,MAAM,CAAC,MAAM,SAAS,GAAwB,CAAC,CAAC,CAAC,CAAC;AAGlD,MAAM,CAAC,MAAM,iBAAiB,GAA+B,CAAC,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U,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC;IACxG,gBAAgB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC;IAC5D,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC;IAC7F,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;IACrC,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC;IAChE,gBAAgB,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC;IAChD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;IACxC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;IACrC,aAAa,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC;IAC9C,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;CAC9P,CAAC"}
|
package/dist/define.d.ts
CHANGED
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Endpoints are named by their key. The manifest id is `plugin.<publicId>.<key>`,
|
|
19
19
|
* and everywhere a definition refers to an endpoint (a widget, a sample, a
|
|
20
|
-
* parameter's `options_from`, a bundled dashboard, `communitySummary
|
|
21
|
-
* key.
|
|
20
|
+
* parameter's `options_from`, a bundled dashboard, `communitySummary`, an
|
|
21
|
+
* action) it uses the key.
|
|
22
22
|
*/
|
|
23
|
-
import type {
|
|
23
|
+
import type { CommunityStatus } from "./tokens.js";
|
|
24
|
+
import type { Action, ActorKind, PluginScope, BundledDashboard, BundledDashboardWidget, Connection, Page, Endpoint, EndpointParam, EndpointReturn, ErrorRule, Expression, Field, ItemKind, Manifest, Part, RequestStep, ReturnValueType, Scope, Vendor, VendorAuth, VendorRequest, WebhookEvent, Webhooks, Widget } from "./contract.js";
|
|
24
25
|
import type { Client } from "./client.js";
|
|
25
26
|
/**
|
|
26
27
|
* What every handler is handed as `context`: the value given to `createPlugin`.
|
|
@@ -72,10 +73,20 @@ export type Actor = {
|
|
|
72
73
|
kind: "member";
|
|
73
74
|
member: string;
|
|
74
75
|
};
|
|
76
|
+
/** One of Initiative's items, by its kind and id. */
|
|
77
|
+
export interface ItemRef {
|
|
78
|
+
type: ItemKind;
|
|
79
|
+
id: number;
|
|
80
|
+
}
|
|
75
81
|
/** What every handler is handed. */
|
|
76
82
|
export interface Call {
|
|
77
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* The community, by the reference this plug-in knows it by. It survives
|
|
85
|
+
* uninstall and reinstall, so it is what your rows key on.
|
|
86
|
+
*/
|
|
78
87
|
installation: string;
|
|
88
|
+
/** Where the community stands. Anything but `active` means hold back. */
|
|
89
|
+
community_status: CommunityStatus;
|
|
79
90
|
/** Initiative, acting as whoever the call is for. */
|
|
80
91
|
client: Client;
|
|
81
92
|
context: PluginContext;
|
|
@@ -92,6 +103,10 @@ export interface EndpointCall<P> extends Call {
|
|
|
92
103
|
initiative: number | null;
|
|
93
104
|
/** Connection id → the handle Initiative gives a token for, where the call depends on one. */
|
|
94
105
|
connections: Record<string, string>;
|
|
106
|
+
/** On a call one of the plug-in's actions made: the reader who ran it, by this installation's reference for them. */
|
|
107
|
+
viewer: string | null;
|
|
108
|
+
/** On a call one of the plug-in's actions made: the item it was run on. */
|
|
109
|
+
subject: ItemRef | null;
|
|
95
110
|
}
|
|
96
111
|
/** What a handler answers with. `actor` says whose credential ran it; absent, the call's actor. */
|
|
97
112
|
export interface Outcome<R> {
|
|
@@ -173,11 +188,53 @@ export interface ScheduleCall extends Call {
|
|
|
173
188
|
/** When this schedule last succeeded for the installation (ISO 8601), or null the first time. */
|
|
174
189
|
since: string | null;
|
|
175
190
|
}
|
|
176
|
-
/**
|
|
191
|
+
/** What `community_status` is sent, whenever the community's standing changes. */
|
|
192
|
+
export interface CommunityStatusCall extends Call {
|
|
193
|
+
/** The standing it changed to. The same value `community_status` now carries. */
|
|
194
|
+
status: CommunityStatus;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* What `entitlement` is sent: the deployment's entitlement issuer's statement
|
|
198
|
+
* of what this community holds of the plug-in. Absent an issuer, it is never
|
|
199
|
+
* sent.
|
|
200
|
+
*/
|
|
201
|
+
export interface EntitlementCall extends Call {
|
|
202
|
+
/**
|
|
203
|
+
* Rises with every new statement for this community. Keep the highest you
|
|
204
|
+
* have seen and ignore a lower one: statements may arrive more than once and
|
|
205
|
+
* out of order.
|
|
206
|
+
*/
|
|
207
|
+
version: number;
|
|
208
|
+
/**
|
|
209
|
+
* The statement itself, replacing the last one whole. Its keys are agreed
|
|
210
|
+
* between your plug-in and the issuer; Initiative carries them unread.
|
|
211
|
+
*/
|
|
212
|
+
values: Record<string, unknown>;
|
|
213
|
+
}
|
|
214
|
+
/** The names of the hooks about a community's install, rather than a connection. */
|
|
215
|
+
export declare const COMMUNITY_HOOKS: readonly ["installed", "uninstalled", "erase", "community_status", "entitlement"];
|
|
216
|
+
export type CommunityHook = (typeof COMMUNITY_HOOKS)[number];
|
|
217
|
+
/**
|
|
218
|
+
* The hooks Initiative calls while it runs connections and receives the
|
|
219
|
+
* vendor's webhooks, and as a community installs, leaves, erases, changes
|
|
220
|
+
* standing or changes what it holds of the plug-in.
|
|
221
|
+
*/
|
|
177
222
|
export interface Hooks {
|
|
178
223
|
after_connect?: (call: AfterConnectCall) => Promise<AfterConnectAnswer>;
|
|
179
224
|
revoke?: (call: RevokeCall) => Promise<void>;
|
|
180
225
|
webhook?: (call: WebhookCall) => Promise<void>;
|
|
226
|
+
/** The community installed the plug-in, or installed it again under the same references. */
|
|
227
|
+
installed?: (call: Call) => Promise<void>;
|
|
228
|
+
/** The community uninstalled the plug-in. Its references stand: it may come back. */
|
|
229
|
+
uninstalled?: (call: Call) => Promise<void>;
|
|
230
|
+
/**
|
|
231
|
+
* Delete everything you hold about the community. Once this answers,
|
|
232
|
+
* Initiative forgets the community's references for your plug-in, and a
|
|
233
|
+
* later install starts afresh. Throwing has it asked again.
|
|
234
|
+
*/
|
|
235
|
+
erase?: (call: Call) => Promise<void>;
|
|
236
|
+
community_status?: (call: CommunityStatusCall) => Promise<void>;
|
|
237
|
+
entitlement?: (call: EntitlementCall) => Promise<void>;
|
|
181
238
|
}
|
|
182
239
|
export interface ScheduleDeclaration {
|
|
183
240
|
/** A whole number of minutes (`15m`) or hours (`6h`). */
|
|
@@ -212,6 +269,11 @@ type ReadName<E> = {
|
|
|
212
269
|
direction: "read";
|
|
213
270
|
} ? K : never;
|
|
214
271
|
}[keyof E] & string;
|
|
272
|
+
type WriteName<E> = {
|
|
273
|
+
[K in keyof E]: E[K] extends {
|
|
274
|
+
direction: "write";
|
|
275
|
+
} ? K : never;
|
|
276
|
+
}[keyof E] & string;
|
|
215
277
|
type EmitName<E> = {
|
|
216
278
|
[K in keyof E]: E[K] extends {
|
|
217
279
|
direction: "emit";
|
|
@@ -240,6 +302,10 @@ export interface WidgetDeclaration<E> extends Omit<Widget, "id" | "module_source
|
|
|
240
302
|
[K in ReadName<E>]?: Result<ReturnsOf<E[K]>>;
|
|
241
303
|
};
|
|
242
304
|
}
|
|
305
|
+
/** Something a reader runs on one item. `endpoint` names a write endpoint by its key. */
|
|
306
|
+
export interface ActionDeclaration<E> extends Omit<Action, "id" | "endpoint"> {
|
|
307
|
+
endpoint: WriteName<E>;
|
|
308
|
+
}
|
|
243
309
|
export interface DashboardDeclaration<E, W> extends Omit<BundledDashboard, "widgets"> {
|
|
244
310
|
widgets: Array<Omit<BundledDashboardWidget, "type" | "binding"> & {
|
|
245
311
|
type: keyof W & string;
|
|
@@ -261,6 +327,17 @@ export interface ListingDeclaration {
|
|
|
261
327
|
description?: string;
|
|
262
328
|
/** The listing's picture, relative to the plug-in's package. */
|
|
263
329
|
avatar: string;
|
|
330
|
+
/**
|
|
331
|
+
* Screenshots for the listing page, in order: at most 12, each a PNG, JPEG,
|
|
332
|
+
* WebP, GIF, AVIF or SVG file relative to the plug-in's package, with `alt`
|
|
333
|
+
* text of 1 to 300 characters describing it for someone who cannot see it.
|
|
334
|
+
* The registry signs each one, like the avatar. Only a registry listing
|
|
335
|
+
* carries them; `pack` leaves them out.
|
|
336
|
+
*/
|
|
337
|
+
images?: Array<{
|
|
338
|
+
path: string;
|
|
339
|
+
alt: string;
|
|
340
|
+
}>;
|
|
264
341
|
version: string;
|
|
265
342
|
/** The oldest Initiative release this version runs on. */
|
|
266
343
|
minAppVersion?: string;
|
|
@@ -273,7 +350,6 @@ export interface ListingDeclaration {
|
|
|
273
350
|
image?: string;
|
|
274
351
|
/** The most the plug-in may ever be granted. Absent: its `scopes`. */
|
|
275
352
|
scopeCeiling?: Array<Scope | PluginScope>;
|
|
276
|
-
referenceSectors?: string[];
|
|
277
353
|
/**
|
|
278
354
|
* The Docker Compose service an operator copies to run the image beside
|
|
279
355
|
* Initiative. `service` is the fragment, YAML text of at most 4096
|
|
@@ -287,6 +363,94 @@ export interface ListingDeclaration {
|
|
|
287
363
|
service: string;
|
|
288
364
|
baseUrl: string;
|
|
289
365
|
};
|
|
366
|
+
/**
|
|
367
|
+
* What a deployment needs to run the container on its own, without code of
|
|
368
|
+
* its own for it. A container plug-in's only, and only in a package somebody
|
|
369
|
+
* reviewed: the public registry refuses a listing that carries one. It holds
|
|
370
|
+
* nothing that raises a privilege; resources, network rules, hostnames and
|
|
371
|
+
* every key stay the deployment's. See {@link RuntimeDeclaration}.
|
|
372
|
+
*/
|
|
373
|
+
runtime?: RuntimeDeclaration;
|
|
374
|
+
}
|
|
375
|
+
/** What the deployment fills a {@link RuntimeDeclaration.facts} variable with. */
|
|
376
|
+
export type RuntimeFact =
|
|
377
|
+
/** Initiative's public URL. */
|
|
378
|
+
"app_url"
|
|
379
|
+
/** Initiative's public origin. */
|
|
380
|
+
| "app_origin"
|
|
381
|
+
/** Initiative's API, as outside callers reach it. */
|
|
382
|
+
| "app_api_public"
|
|
383
|
+
/** Initiative's API, from inside the deployment. */
|
|
384
|
+
| "app_api_internal"
|
|
385
|
+
/** This plug-in's own origin, where it serves framed pages (needs `pages`). */
|
|
386
|
+
| "page_origin"
|
|
387
|
+
/** The port below. */
|
|
388
|
+
| "port";
|
|
389
|
+
export interface RuntimeDeclaration {
|
|
390
|
+
/** Its short name in a deployment: a DNS label of at most 20 characters, unique in a package. */
|
|
391
|
+
name: string;
|
|
392
|
+
/** The port it serves HTTP on, 1024 or higher. */
|
|
393
|
+
port: number;
|
|
394
|
+
health: {
|
|
395
|
+
ready: string;
|
|
396
|
+
live: string;
|
|
397
|
+
startupSeconds?: number;
|
|
398
|
+
};
|
|
399
|
+
/** How long it needs to drain after SIGTERM, 5 to 300 seconds. */
|
|
400
|
+
stopGraceSeconds?: number;
|
|
401
|
+
/** It changes its database schema as it starts, so two copies never start together. */
|
|
402
|
+
migratesOnStart?: boolean;
|
|
403
|
+
/** It serves pages Initiative frames, at an origin of its own. */
|
|
404
|
+
pages?: boolean;
|
|
405
|
+
/** Paths outside callers reach on the deployment's shared plug-in host. */
|
|
406
|
+
publicPaths?: string[];
|
|
407
|
+
/** Environment variables the deployment fills with what it knows of itself. */
|
|
408
|
+
facts?: Record<string, RuntimeFact>;
|
|
409
|
+
/** Environment variables only the operator fills, by name. */
|
|
410
|
+
settings?: Array<{
|
|
411
|
+
env: string;
|
|
412
|
+
required?: boolean;
|
|
413
|
+
}>;
|
|
414
|
+
/** Where the private key its copy signs with goes. */
|
|
415
|
+
signingKey?: {
|
|
416
|
+
env: string;
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* Its own Postgres. The deployment runs it, backs it up, and gives each role
|
|
420
|
+
* a login; `provisionSql`, a file in the image, creates them, given each
|
|
421
|
+
* role's password as the psql variable `<id>_password`.
|
|
422
|
+
*/
|
|
423
|
+
database?: {
|
|
424
|
+
minMajor?: number;
|
|
425
|
+
dsnScheme?: "postgresql" | "postgresql+asyncpg" | "postgresql+psycopg" | "postgres";
|
|
426
|
+
roles: Array<{
|
|
427
|
+
id: string;
|
|
428
|
+
login: string;
|
|
429
|
+
env: string;
|
|
430
|
+
}>;
|
|
431
|
+
provisionSql: string;
|
|
432
|
+
};
|
|
433
|
+
/** Values the deployment generates once and keeps. */
|
|
434
|
+
secrets?: Array<{
|
|
435
|
+
id: string;
|
|
436
|
+
kind: "random_alnum_32" | "random_bytes_32" | "hex_32" | "rsa_private_key_pem";
|
|
437
|
+
env: string;
|
|
438
|
+
}>;
|
|
439
|
+
metrics?: {
|
|
440
|
+
path: string;
|
|
441
|
+
tokenEnv: string;
|
|
442
|
+
};
|
|
443
|
+
/** Shared secrets with Initiative's own services, honoured for a deployment's own publishers only. */
|
|
444
|
+
integrations?: {
|
|
445
|
+
billing?: {
|
|
446
|
+
hmacEnv: string;
|
|
447
|
+
hmacPreviousEnv?: string;
|
|
448
|
+
publicKeyEnv: string;
|
|
449
|
+
};
|
|
450
|
+
bundledChannel?: {
|
|
451
|
+
env: string;
|
|
452
|
+
};
|
|
453
|
+
};
|
|
290
454
|
}
|
|
291
455
|
export interface PluginDefinition<E, W> {
|
|
292
456
|
/** `<publisher>.<slug>`. */
|
|
@@ -323,6 +487,12 @@ export interface PluginDefinition<E, W> {
|
|
|
323
487
|
/** Pages and panels, keyed by page id. */
|
|
324
488
|
pages?: Record<string, PageDeclaration>;
|
|
325
489
|
dashboards?: DashboardDeclaration<E, W>[];
|
|
490
|
+
/** How the plug-in's metadata is shown on items, keyed by metadata key. */
|
|
491
|
+
fields?: Record<string, Omit<Field, "key">>;
|
|
492
|
+
/** Pieces of items' pages and views, keyed by part id. A `tree` may be written as JSX (`initiative-plugin-sdk/parts`). */
|
|
493
|
+
parts?: Record<string, Omit<Part, "id">>;
|
|
494
|
+
/** What a reader may run on an item, keyed by action id. */
|
|
495
|
+
actions?: Record<string, ActionDeclaration<E>>;
|
|
326
496
|
listing?: ListingDeclaration;
|
|
327
497
|
}
|
|
328
498
|
/** Any plug-in's definition, as the server and the build read it. */
|
package/dist/define.js
CHANGED
|
@@ -17,13 +17,15 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Endpoints are named by their key. The manifest id is `plugin.<publicId>.<key>`,
|
|
19
19
|
* and everywhere a definition refers to an endpoint (a widget, a sample, a
|
|
20
|
-
* parameter's `options_from`, a bundled dashboard, `communitySummary
|
|
21
|
-
* key.
|
|
20
|
+
* parameter's `options_from`, a bundled dashboard, `communitySummary`, an
|
|
21
|
+
* action) it uses the key.
|
|
22
22
|
*/
|
|
23
23
|
import { FEATURES } from "./contract.js";
|
|
24
24
|
export function defineEndpoint(endpoint) {
|
|
25
25
|
return endpoint;
|
|
26
26
|
}
|
|
27
|
+
/** The names of the hooks about a community's install, rather than a connection. */
|
|
28
|
+
export const COMMUNITY_HOOKS = ["installed", "uninstalled", "erase", "community_status", "entitlement"];
|
|
27
29
|
/** The plug-in, declared once. */
|
|
28
30
|
export function definePlugin(definition) {
|
|
29
31
|
return definition;
|
|
@@ -62,6 +64,9 @@ export function manifestOf(plugin, modules = {}) {
|
|
|
62
64
|
binding: { ...widget.binding, endpoint_id: id(widget.binding.endpoint_id) },
|
|
63
65
|
})),
|
|
64
66
|
})),
|
|
67
|
+
fields: listOf(plugin.fields, (key, field) => ({ key, ...field })),
|
|
68
|
+
parts: listOf(plugin.parts, (key, part) => ({ id: key, ...part })),
|
|
69
|
+
actions: listOf(plugin.actions, (key, action) => ({ id: key, ...action, endpoint: id(action.endpoint) })),
|
|
65
70
|
};
|
|
66
71
|
const present = Object.fromEntries(Object.entries(blocks).filter(([, value]) => value !== undefined));
|
|
67
72
|
return {
|
package/dist/define.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.js","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA8BH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+IzC,MAAM,UAAU,cAAc,CAAC,QAA6B;IAC1D,OAAO,QAAQ,CAAC;AAClB,CAAC;AAoED,oFAAoF;AACpF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,kBAAkB,EAAE,aAAa,CAAU,CAAC;AA0QjH,kCAAkC;AAClC,MAAM,UAAU,YAAY,CAG1B,UAAkC;IAClC,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,iCAAiC;AACjC,MAAM,UAAU,UAAU,CAAC,MAA4B,EAAE,IAAY;IACnE,OAAO,UAAU,MAAM,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,MAAiB,EAAE,OAAO,GAA2B,EAAE;IAChF,MAAM,EAAE,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACtD,MAAM,MAAM,GAAsB;QAChC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC;QAC1F,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI;YAC3B,GAAG,MAAM,CAA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;QACJ,CAAC;;YAAM,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC1B,CAAC;IACD,OAAO,GAA0B,CAAC;AACpC,CAAC;AAED,SAAS,QAAQ,CACf,GAAW,EACX,MAA8B,EAC9B,MAAc,EACd,EAA4B;IAE5B,MAAM,GAAG,GAA4B,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;IACjD,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACpD,IAAI,KAAK,KAAK,QAAQ;YAAE,GAAG,CAAC,aAAa,GAAG,MAAM,CAAC;aAC9C,IAAI,KAAK,KAAK,WAAW;YAAE,GAAG,CAAC,SAAS,GAAI,KAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aACvE,IAAI,KAAK,KAAK,aAAa,EAAE,CAAC;YACjC,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QACpH,CAAC;;YAAM,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IAC5B,CAAC;IACD,OAAO,GAAwB,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.js","sourceRoot":"","sources":["../src/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAE9G,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,EAAY,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `initiative-plugin-sdk/jsx-runtime`: JSX for a part's tree, with no React.
|
|
3
|
+
*
|
|
4
|
+
* Point TypeScript and esbuild at it with `"jsx": "react-jsx"` and
|
|
5
|
+
* `"jsxImportSource": "initiative-plugin-sdk"`, or with a file's own
|
|
6
|
+
* `@jsxImportSource initiative-plugin-sdk` pragma. Each element calls its
|
|
7
|
+
* component from `initiative-plugin-sdk/parts`, which builds the node; the
|
|
8
|
+
* build evaluates the definition, so the manifest holds only the data. `key`
|
|
9
|
+
* is JSX's own and is not passed on.
|
|
10
|
+
*/
|
|
11
|
+
import type { PartNode } from "./contract.js";
|
|
12
|
+
import { Fragment } from "./parts.js";
|
|
13
|
+
export { Fragment };
|
|
14
|
+
type Component = (props: any) => PartNode | PartNode[];
|
|
15
|
+
export declare function jsx(type: Component, props: Record<string, unknown>): PartNode | PartNode[];
|
|
16
|
+
export { jsx as jsxs };
|
|
17
|
+
export declare namespace JSX {
|
|
18
|
+
type Element = PartNode;
|
|
19
|
+
type ElementType = Component;
|
|
20
|
+
interface ElementChildrenAttribute {
|
|
21
|
+
children: {};
|
|
22
|
+
}
|
|
23
|
+
interface IntrinsicAttributes {
|
|
24
|
+
key?: string | number;
|
|
25
|
+
}
|
|
26
|
+
interface IntrinsicElements {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `initiative-plugin-sdk/jsx-runtime`: JSX for a part's tree, with no React.
|
|
3
|
+
*
|
|
4
|
+
* Point TypeScript and esbuild at it with `"jsx": "react-jsx"` and
|
|
5
|
+
* `"jsxImportSource": "initiative-plugin-sdk"`, or with a file's own
|
|
6
|
+
* `@jsxImportSource initiative-plugin-sdk` pragma. Each element calls its
|
|
7
|
+
* component from `initiative-plugin-sdk/parts`, which builds the node; the
|
|
8
|
+
* build evaluates the definition, so the manifest holds only the data. `key`
|
|
9
|
+
* is JSX's own and is not passed on.
|
|
10
|
+
*/
|
|
11
|
+
import { Fragment } from "./parts.js";
|
|
12
|
+
export { Fragment };
|
|
13
|
+
export function jsx(type, props) {
|
|
14
|
+
if (typeof type !== "function") {
|
|
15
|
+
throw new TypeError(`<${String(type)}> is not a part: build one from initiative-plugin-sdk/parts`);
|
|
16
|
+
}
|
|
17
|
+
return type(props);
|
|
18
|
+
}
|
|
19
|
+
export { jsx as jsxs };
|
|
20
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,CAAC;AAIpB,MAAM,UAAU,GAAG,CAAC,IAAe,EAAE,KAA8B;IACjE,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,SAAS,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;IACrG,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC;AAED,OAAO,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* which plug-in API contract a manifest's `min_plugin_api` runs on.
|
|
5
5
|
*/
|
|
6
6
|
export * from "./contract.js";
|
|
7
|
-
export { definePlugin, defineEndpoint, type Actor, type AfterConnectAnswer, type AfterConnectCall, type PluginContext, type PluginDefinition, type Call, type CallableEndpoint, type DashboardDeclaration, type EmittedEndpoint, type EndpointCall, type EndpointDeclaration, type Handoff, type Hooks, type ListingDeclaration, type Outcome, type PageCall, type PageDeclaration, type Params, type ParamSpec, type ParamValue, type Result, type ReturnSpec, type RevokeCall, type ScheduleCall, type ScheduleDeclaration, type WebhookCall, type WidgetDeclaration, } from "./define.js";
|
|
7
|
+
export { definePlugin, defineEndpoint, type ActionDeclaration, type Actor, type AfterConnectAnswer, type AfterConnectCall, type PluginContext, type PluginDefinition, type Call, type CallableEndpoint, type CommunityHook, type CommunityStatusCall, type EntitlementCall, COMMUNITY_HOOKS, type DashboardDeclaration, type EmittedEndpoint, type EndpointCall, type EndpointDeclaration, type Handoff, type Hooks, type ItemRef, type ListingDeclaration, type Outcome, type PageCall, type PageDeclaration, type Params, type ParamSpec, type ParamValue, type Result, type ReturnSpec, type RevokeCall, type RuntimeDeclaration, type RuntimeFact, type ScheduleCall, type ScheduleDeclaration, type WebhookCall, type WidgetDeclaration, } from "./define.js";
|
|
8
8
|
export { MANIFEST_PATH, manifestSchema, validateDocument, validateManifest, type PluginDocument, type ValidationProblem, } from "./validate.js";
|
|
9
9
|
export { pluginApiCompatible } from "./plugin-api.js";
|
|
10
10
|
export type { Jwks, PublicJwk } from "./keys.js";
|
package/dist/manifest.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* which plug-in API contract a manifest's `min_plugin_api` runs on.
|
|
5
5
|
*/
|
|
6
6
|
export * from "./contract.js";
|
|
7
|
-
export { definePlugin, defineEndpoint, } from "./define.js";
|
|
7
|
+
export { definePlugin, defineEndpoint, COMMUNITY_HOOKS, } from "./define.js";
|
|
8
8
|
export { MANIFEST_PATH, manifestSchema, validateDocument, validateManifest, } from "./validate.js";
|
|
9
9
|
export { pluginApiCompatible } from "./plugin-api.js";
|
|
10
10
|
//# sourceMappingURL=manifest.js.map
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,cAAc,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC;AAE9B,OAAO,EACL,YAAY,EACZ,cAAc,EAYd,eAAe,GAwBhB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/pack.js
CHANGED
|
@@ -27,8 +27,7 @@ export function listingFile(plugin, manifest, root) {
|
|
|
27
27
|
if (!listing)
|
|
28
28
|
throw new Error("pack needs the plug-in's listing: declare `listing` in its definition");
|
|
29
29
|
const avatar = KEPT_PICTURES.test(listing.avatar) ? readFileSync(resolve(root, listing.avatar)) : null;
|
|
30
|
-
|
|
31
|
-
const { reference_sectors: _sectors, ...registration } = registrationOf(plugin);
|
|
30
|
+
const registration = registrationOf(plugin);
|
|
32
31
|
return {
|
|
33
32
|
avatar,
|
|
34
33
|
listing: {
|
package/dist/pack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../src/pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,cAAc,EAAqB,MAAM,YAAY,CAAC;AAcrE,wEAAwE;AACxE,MAAM,UAAU,GAAG,4BAA4B,CAAC;AAChD,MAAM,aAAa,GAAG,0BAA0B,CAAC;AAQjD,oEAAoE;AACpE,MAAM,UAAU,WAAW,CAAC,MAAoB,EAAE,QAAkB,EAAE,IAAY;IAChF,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IACvG,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,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EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAC5B,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,KAAe,CAAC,OAAO,IAAI,CAAC,CAAC;QACtD,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,OAAQ,CAAC;IACrD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,IAAI,OAAO,OAAO,CAAC,CAAC;IAChF,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACpE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB;QACE,SAAS,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,KAAK,MAAM,CAAC,QAAQ,IAAI,OAAO,SAAS,MAAM,CAAC,GAAG,EAAE;QAC1F,MAAM,CAAC,MAAM;YACX,CAAC,CAAC,+BAA+B,OAAO,8DAA8D;YACtG,CAAC,CAAC,GAAG,OAAO,oFAAoF;QAClG,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACF,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/parts.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `initiative-plugin-sdk/parts`: the components a part's tree is built from.
|
|
3
|
+
*
|
|
4
|
+
* Each builds one node of the contract's {@link PartNode} tree: plain data,
|
|
5
|
+
* which the manifest carries and Initiative draws with its own component of
|
|
6
|
+
* the same name. Called directly or written as JSX through
|
|
7
|
+
* `initiative-plugin-sdk/jsx-runtime`, they build the same data:
|
|
8
|
+
*
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Section title={{ en: "Demo" }}>
|
|
11
|
+
* <Field field="demo.link" />
|
|
12
|
+
* <Button action="new-link" />
|
|
13
|
+
* </Section>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* is `{ type: "section", props: { title: { en: "Demo" } }, children: [
|
|
17
|
+
* { type: "field", props: { field: "demo.link" } }, { type: "button", props:
|
|
18
|
+
* { action: "new-link" } }] }`. A field or an action is named by its key or id.
|
|
19
|
+
*/
|
|
20
|
+
import type { ButtonNode, FieldNode, PartNode, SectionNode, StackNode, TextNode, ValueNode } from "./contract.js";
|
|
21
|
+
/** What a section or a stack holds: nodes, lists of them, and nothing (`null`, `false`) where a condition left one out. */
|
|
22
|
+
export type PartChild = PartNode | readonly PartChild[] | null | undefined | boolean;
|
|
23
|
+
type Props<N extends PartNode> = NonNullable<N extends {
|
|
24
|
+
props?: infer P;
|
|
25
|
+
} ? P : never>;
|
|
26
|
+
type Holding = {
|
|
27
|
+
children?: PartChild;
|
|
28
|
+
};
|
|
29
|
+
/** A titled group, which the reader may fold. */
|
|
30
|
+
export declare function Section(props: Props<SectionNode> & Holding): PartNode;
|
|
31
|
+
/** Nodes side by side (`direction="row"`) or one above another. */
|
|
32
|
+
export declare function Stack(props: Props<StackNode> & Holding): PartNode;
|
|
33
|
+
/** A field's label and its value. */
|
|
34
|
+
export declare function Field(props: Props<FieldNode>): PartNode;
|
|
35
|
+
/** A field's value alone. */
|
|
36
|
+
export declare function Value(props: Props<ValueNode>): PartNode;
|
|
37
|
+
/** Words the plug-in wrote. */
|
|
38
|
+
export declare function Text(props: Props<TextNode>): PartNode;
|
|
39
|
+
/** A button running one of the plug-in's actions. */
|
|
40
|
+
export declare function Button(props: Props<ButtonNode>): PartNode;
|
|
41
|
+
/** `<>…</>`: its children, taken into the node that holds them. */
|
|
42
|
+
export declare function Fragment({ children }: Holding): PartNode[];
|
|
43
|
+
export {};
|