@selfhelp/shared 1.30.0 → 1.31.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/CHANGELOG.md +41 -0
- package/dist/index.d.mts +14 -82
- package/dist/index.d.ts +14 -82
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/inlineFormat-Duu5VLMU.d.mts +73 -0
- package/dist/inlineFormat-Duu5VLMU.d.ts +73 -0
- package/dist/{manifest-DRlcSvvy.d.mts → manifest-DWHD0PQA.d.mts} +124 -1
- package/dist/{manifest-DRlcSvvy.d.ts → manifest-DWHD0PQA.d.ts} +124 -1
- package/dist/plugin-sdk/index.d.mts +210 -10
- package/dist/plugin-sdk/index.d.ts +210 -10
- package/dist/plugin-sdk/index.js +174 -2
- package/dist/plugin-sdk/index.mjs +171 -2
- package/dist/plugin-sdk/sync-map.d.mts +22 -0
- package/dist/plugin-sdk/sync-map.d.ts +22 -0
- package/dist/plugin-sdk/sync-map.js +58 -0
- package/dist/plugin-sdk/sync-map.mjs +33 -0
- package/dist/registry/index.d.mts +2 -2
- package/dist/registry/index.d.ts +2 -2
- package/dist/{styles.registry-DnIJqEzM.d.mts → styles.registry-B2cyNdo3.d.mts} +26 -1
- package/dist/{styles.registry-C2ACy7H0.d.ts → styles.registry-G_KUYGPv.d.ts} +26 -1
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/plugin-sdk/__tests__/define-sync.test.ts +106 -0
- package/src/plugin-sdk/__tests__/exports.test.ts +29 -0
- package/src/plugin-sdk/__tests__/host-services.test.ts +96 -6
- package/src/plugin-sdk/__tests__/sync-map.test.ts +48 -0
- package/src/plugin-sdk/__tests__/version.test.ts +9 -0
- package/src/plugin-sdk/host-services.ts +106 -0
- package/src/plugin-sdk/index.ts +24 -0
- package/src/plugin-sdk/manifest.ts +142 -0
- package/src/plugin-sdk/sync-map.ts +61 -0
- package/src/plugin-sdk/types.ts +89 -5
- package/src/plugin-sdk/version.ts +19 -2
- package/src/sync/__tests__/sync.test.ts +19 -0
- package/src/sync/sync.ts +3 -2
- package/src/sync/types.ts +9 -6
- package/src/types/api/form-lists.ts +16 -1
- package/src/types/api/forms.ts +10 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-platform inline-formatting helpers for CMS content fields.
|
|
3
|
+
*
|
|
4
|
+
* ## Why
|
|
5
|
+
*
|
|
6
|
+
* CMS authors can apply lightweight inline formatting (Ctrl+B bold, Ctrl+I
|
|
7
|
+
* italic, Ctrl+U underline, links) to content fields whose field type allows it
|
|
8
|
+
* (`markdown-inline`). The editor stores that as a tiny HTML subset
|
|
9
|
+
* (`<strong>`/`<b>`, `<em>`/`<i>`, `<u>`, `<a>`), often wrapped in block tags
|
|
10
|
+
* (`<p>`, `<div>`) that markdown processing leaves behind.
|
|
11
|
+
*
|
|
12
|
+
* Web can render that subset as real inline HTML, but React Native `<Text>`
|
|
13
|
+
* cannot render HTML at all — so historically mobile (and several web leaf slots)
|
|
14
|
+
* stripped everything to plain text and the bold was lost. To carry the same
|
|
15
|
+
* formatting to BOTH platforms we parse the subset once, here, into a flat list
|
|
16
|
+
* of {@link IInlineNode} runs. Each platform then renders the runs natively:
|
|
17
|
+
*
|
|
18
|
+
* - web → a fragment of `<strong>/<em>/<u>/<a>` (see frontend `InlineRich`)
|
|
19
|
+
* - mobile → nested `<Text>` with `fontWeight`/`fontStyle`/`textDecorationLine`
|
|
20
|
+
* (see mobile `InlineText`)
|
|
21
|
+
*
|
|
22
|
+
* ## Scope (deliberately tiny + safe)
|
|
23
|
+
*
|
|
24
|
+
* Only the inline subset above survives. **Block** tags (`<p>`, `<div>`,
|
|
25
|
+
* `<h1>`…`<h6>`, `<ul>`/`<ol>`/`<li>`, `<blockquote>`, `<br>`) collapse to a
|
|
26
|
+
* single space — an inline text slot (a label, a paragraph run) cannot lay out
|
|
27
|
+
* block structure, and flattening matches the old strip behaviour. Any other tag
|
|
28
|
+
* is dropped while keeping its inner text. HTML entities are decoded.
|
|
29
|
+
*
|
|
30
|
+
* ## JSON-aware (HARD)
|
|
31
|
+
*
|
|
32
|
+
* Some content fields legitimately hold JSON (config blobs, table/segmented
|
|
33
|
+
* data). Those are read via `readField`, not these helpers, but as a safety net
|
|
34
|
+
* a value that parses as JSON is returned untouched so structured payloads are
|
|
35
|
+
* never mangled.
|
|
36
|
+
*
|
|
37
|
+
* This module is the canonical home the style docs refer to; the web
|
|
38
|
+
* `stripHtmlTags` and mobile `stripHtmlToText` local copies mirror
|
|
39
|
+
* {@link stripHtmlToText} and are folded into this once consumers adopt it.
|
|
40
|
+
*/
|
|
41
|
+
/** A single run of text with the inline formatting that applies to it. */
|
|
42
|
+
interface IInlineNode {
|
|
43
|
+
text: string;
|
|
44
|
+
bold?: boolean;
|
|
45
|
+
italic?: boolean;
|
|
46
|
+
underline?: boolean;
|
|
47
|
+
/** Present when the run sits inside an `<a href>`; the resolved target. */
|
|
48
|
+
href?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parse a CMS content string into a flat list of inline-formatted runs,
|
|
52
|
+
* preserving only the safe inline subset. Block tags + `<br>` collapse to
|
|
53
|
+
* spaces; entities are decoded; a JSON payload is returned as one untouched run.
|
|
54
|
+
* Adjacent runs that share formatting are merged and outer whitespace trimmed.
|
|
55
|
+
*/
|
|
56
|
+
declare function parseInlineRich(value: string | null | undefined): IInlineNode[];
|
|
57
|
+
/**
|
|
58
|
+
* Does this value carry any of the supported inline tags? Used by renderers to
|
|
59
|
+
* fast-path plain strings (and to skip JSON). Cheap: no full parse.
|
|
60
|
+
*/
|
|
61
|
+
declare function hasInlineFormatting(value: string | null | undefined): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Strip a content string to readable plain text: drop every tag, decode common
|
|
64
|
+
* entities, collapse whitespace. Block tags + `<br>` become spaces so words do
|
|
65
|
+
* not run together. JSON payloads and tag-free strings are returned untouched
|
|
66
|
+
* (apart from entity decoding), so it is safe to call on any field.
|
|
67
|
+
*
|
|
68
|
+
* This is the canonical cross-platform helper (web `stripHtmlTags` / mobile
|
|
69
|
+
* `stripHtmlToText` mirror it).
|
|
70
|
+
*/
|
|
71
|
+
declare function stripHtmlToText(value: string | null | undefined): string;
|
|
72
|
+
|
|
73
|
+
export { type IInlineNode as I, hasInlineFormatting as h, parseInlineRich as p, stripHtmlToText as s };
|
|
@@ -150,6 +150,12 @@ interface IPluginManifestStyle {
|
|
|
150
150
|
renamedFrom?: string[];
|
|
151
151
|
/** When present, the installer makes the style's field links match this list. */
|
|
152
152
|
fields?: IPluginManifestStyleField[];
|
|
153
|
+
/**
|
|
154
|
+
* Field name → registered resource type of this plugin (`resourceTypes`
|
|
155
|
+
* lookup). The field must be declared for the style. Needs `pluginApiVersion`
|
|
156
|
+
* >= 0.2.0.
|
|
157
|
+
*/
|
|
158
|
+
resourceFields?: Record<string, string>;
|
|
153
159
|
}
|
|
154
160
|
/** Style group written into `style_groups` by the host installer (rule 7.8). */
|
|
155
161
|
interface IPluginManifestStyleGroup {
|
|
@@ -199,12 +205,99 @@ interface IPluginManifestApiRoute {
|
|
|
199
205
|
*/
|
|
200
206
|
public?: boolean;
|
|
201
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Inline JSON Schema for an action-plannable plugin job config. Allowed property
|
|
210
|
+
* types are `string`, `integer`, `number` and `boolean`; nesting is not allowed.
|
|
211
|
+
* `format: "variable-text"` marks a string that accepts `{{variables}}`.
|
|
212
|
+
*/
|
|
213
|
+
interface IPluginManifestJobConfigSchema {
|
|
214
|
+
type: 'object';
|
|
215
|
+
properties?: Record<string, IPluginManifestJobConfigProperty>;
|
|
216
|
+
required?: string[];
|
|
217
|
+
additionalProperties?: boolean;
|
|
218
|
+
}
|
|
219
|
+
interface IPluginManifestJobConfigProperty {
|
|
220
|
+
type: 'string' | 'integer' | 'number' | 'boolean';
|
|
221
|
+
enum?: Array<string | number | boolean>;
|
|
222
|
+
minimum?: number;
|
|
223
|
+
maximum?: number;
|
|
224
|
+
maxLength?: number;
|
|
225
|
+
title?: string;
|
|
226
|
+
description?: string;
|
|
227
|
+
default?: string | number | boolean;
|
|
228
|
+
/** Marks a string that accepts `{{variables}}` when the action plans the job. */
|
|
229
|
+
format?: 'variable-text';
|
|
230
|
+
}
|
|
202
231
|
interface IPluginManifestScheduledJob {
|
|
203
232
|
/** Job type key. */
|
|
204
233
|
type: string;
|
|
205
234
|
description: string;
|
|
206
235
|
/** Capability gate (always requires `scheduledJobs`). */
|
|
207
236
|
capability: 'scheduledJobs';
|
|
237
|
+
/** Required when `actionPlannable` is true. Shown in the action builder. */
|
|
238
|
+
label?: string;
|
|
239
|
+
/** When true, editors may plan this job type in an action. Default false. */
|
|
240
|
+
actionPlannable?: boolean;
|
|
241
|
+
/** Inline JSON Schema for `plugin_config` when the job is planned from an action. */
|
|
242
|
+
configSchema?: IPluginManifestJobConfigSchema;
|
|
243
|
+
/** Config property → registered resource type of this plugin. */
|
|
244
|
+
resourceFields?: Record<string, string>;
|
|
245
|
+
/** Child-process timeout in seconds (10 to 900). Default 120. */
|
|
246
|
+
timeoutSeconds?: number;
|
|
247
|
+
}
|
|
248
|
+
/** Cache category declared by a plugin; stored as `<plugin id>.<name>`. */
|
|
249
|
+
interface IPluginManifestCacheCategory {
|
|
250
|
+
/** `^[a-z][a-z0-9_]{0,40}$`. */
|
|
251
|
+
name: string;
|
|
252
|
+
/** Lifetime in seconds (60 to 86400). */
|
|
253
|
+
ttlSeconds: number;
|
|
254
|
+
description?: string;
|
|
255
|
+
}
|
|
256
|
+
/** Instance setting declared by a plugin; stored by the host (C14). */
|
|
257
|
+
interface IPluginManifestSetting {
|
|
258
|
+
/** `^[a-z][a-z0-9_]{0,63}$`. */
|
|
259
|
+
key: string;
|
|
260
|
+
label: string;
|
|
261
|
+
type: 'string' | 'number' | 'boolean' | 'url';
|
|
262
|
+
/** Default false. Secrets are encrypted at rest and never returned clear. */
|
|
263
|
+
secret?: boolean;
|
|
264
|
+
/** Default false. */
|
|
265
|
+
required?: boolean;
|
|
266
|
+
/** Not allowed when `secret` is true. */
|
|
267
|
+
default?: string | number | boolean;
|
|
268
|
+
/** `^[A-Z][A-Z0-9_]{2,63}$`, unique across enabled plugins. */
|
|
269
|
+
envOverride?: string;
|
|
270
|
+
}
|
|
271
|
+
/** Rate limit declared by a plugin (C15). */
|
|
272
|
+
interface IPluginManifestRateLimit {
|
|
273
|
+
/** `^[a-z][a-z0-9_]{0,40}$`. */
|
|
274
|
+
name: string;
|
|
275
|
+
policy: 'sliding_window' | 'fixed_window';
|
|
276
|
+
/** 1 to 100000. */
|
|
277
|
+
limit: number;
|
|
278
|
+
/** Symfony rate-limiter interval string (e.g. `1 minute`). */
|
|
279
|
+
interval: string;
|
|
280
|
+
}
|
|
281
|
+
/** JSON Logic operation declared by a plugin (C16). */
|
|
282
|
+
interface IPluginManifestJsonLogicOperation {
|
|
283
|
+
/** `^[a-z][a-z0-9_]*\.[a-z][a-z0-9_]*$`; the namespace belongs to one plugin. */
|
|
284
|
+
name: string;
|
|
285
|
+
description: string;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* After-commit domain events a plugin may listen to (C24). Must match the host
|
|
289
|
+
* event names exactly.
|
|
290
|
+
*/
|
|
291
|
+
type TPluginDomainEventName = 'record.saved' | 'record.deleted' | 'user.created' | 'user.deleted' | 'page.published';
|
|
292
|
+
/** Recurring plugin job (C25). `type` must be one of the plugin's `scheduledJobs`. */
|
|
293
|
+
interface IPluginManifestRecurringJob {
|
|
294
|
+
/** `^[a-z][a-z0-9_]{0,40}$`. */
|
|
295
|
+
name: string;
|
|
296
|
+
/** One of this plugin's `scheduledJobs[].type`. */
|
|
297
|
+
type: string;
|
|
298
|
+
/** Five-field cron, UTC, at least 5 minutes apart. */
|
|
299
|
+
cron: string;
|
|
300
|
+
description: string;
|
|
208
301
|
}
|
|
209
302
|
interface IPluginManifestAsset {
|
|
210
303
|
/** Source path within the plugin package. */
|
|
@@ -299,6 +392,36 @@ interface IPluginManifest {
|
|
|
299
392
|
apiRoutes?: IPluginManifestApiRoute[];
|
|
300
393
|
/** Scheduled jobs. */
|
|
301
394
|
scheduledJobs?: IPluginManifestScheduledJob[];
|
|
395
|
+
/**
|
|
396
|
+
* Cache categories the host registers for this plugin (C4). Needs
|
|
397
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
398
|
+
*/
|
|
399
|
+
cacheCategories?: IPluginManifestCacheCategory[];
|
|
400
|
+
/**
|
|
401
|
+
* Instance settings and secrets stored by the host (C14). Needs
|
|
402
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
403
|
+
*/
|
|
404
|
+
settings?: IPluginManifestSetting[];
|
|
405
|
+
/**
|
|
406
|
+
* Rate limits the host builds for this plugin (C15). Needs
|
|
407
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
408
|
+
*/
|
|
409
|
+
rateLimits?: IPluginManifestRateLimit[];
|
|
410
|
+
/**
|
|
411
|
+
* JSON Logic operations the host registers for conditions (C16). Needs
|
|
412
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
413
|
+
*/
|
|
414
|
+
jsonLogicOperations?: IPluginManifestJsonLogicOperation[];
|
|
415
|
+
/**
|
|
416
|
+
* After-commit domain events this plugin's listeners receive (C24). Needs
|
|
417
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
418
|
+
*/
|
|
419
|
+
listens?: TPluginDomainEventName[];
|
|
420
|
+
/**
|
|
421
|
+
* Recurring jobs the host keeps queued while the plugin is enabled (C25).
|
|
422
|
+
* Needs `pluginApiVersion` >= 0.2.0.
|
|
423
|
+
*/
|
|
424
|
+
recurringJobs?: IPluginManifestRecurringJob[];
|
|
302
425
|
/** Vendored assets. */
|
|
303
426
|
assets?: IPluginManifestAsset[];
|
|
304
427
|
/** Health-check declaration. */
|
|
@@ -307,4 +430,4 @@ interface IPluginManifest {
|
|
|
307
430
|
labels?: Record<string, string>;
|
|
308
431
|
}
|
|
309
432
|
|
|
310
|
-
export type { IPluginManifest as I, IPluginManifestAdminPage as a, IPluginManifestApiRoute as b, IPluginManifestAsset as c,
|
|
433
|
+
export type { IPluginManifestStyle as A, IPluginManifestStyleField as B, IPluginManifestStyleGroup as C, IPluginManifestTrustLevel as D, IPluginManifest as I, TPluginDomainEventName as T, IPluginManifestAdminPage as a, IPluginManifestApiRoute as b, IPluginManifestAsset as c, IPluginManifestCacheCategory as d, IPluginManifestCapability as e, IPluginManifestCompatibility as f, IPluginManifestConflict as g, IPluginManifestDataAccess as h, IPluginManifestDependency as i, IPluginManifestExternalHost as j, IPluginManifestFeatureFlag as k, IPluginManifestField as l, IPluginManifestFieldType as m, IPluginManifestHealth as n, IPluginManifestJobConfigProperty as o, IPluginManifestJobConfigSchema as p, IPluginManifestJsonLogicOperation as q, IPluginManifestLookupExtension as r, IPluginManifestMobile as s, IPluginManifestPermission as t, IPluginManifestRateLimit as u, IPluginManifestRealtimeTopic as v, IPluginManifestRecurringJob as w, IPluginManifestScheduledJob as x, IPluginManifestSecurity as y, IPluginManifestSetting as z };
|
|
@@ -150,6 +150,12 @@ interface IPluginManifestStyle {
|
|
|
150
150
|
renamedFrom?: string[];
|
|
151
151
|
/** When present, the installer makes the style's field links match this list. */
|
|
152
152
|
fields?: IPluginManifestStyleField[];
|
|
153
|
+
/**
|
|
154
|
+
* Field name → registered resource type of this plugin (`resourceTypes`
|
|
155
|
+
* lookup). The field must be declared for the style. Needs `pluginApiVersion`
|
|
156
|
+
* >= 0.2.0.
|
|
157
|
+
*/
|
|
158
|
+
resourceFields?: Record<string, string>;
|
|
153
159
|
}
|
|
154
160
|
/** Style group written into `style_groups` by the host installer (rule 7.8). */
|
|
155
161
|
interface IPluginManifestStyleGroup {
|
|
@@ -199,12 +205,99 @@ interface IPluginManifestApiRoute {
|
|
|
199
205
|
*/
|
|
200
206
|
public?: boolean;
|
|
201
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Inline JSON Schema for an action-plannable plugin job config. Allowed property
|
|
210
|
+
* types are `string`, `integer`, `number` and `boolean`; nesting is not allowed.
|
|
211
|
+
* `format: "variable-text"` marks a string that accepts `{{variables}}`.
|
|
212
|
+
*/
|
|
213
|
+
interface IPluginManifestJobConfigSchema {
|
|
214
|
+
type: 'object';
|
|
215
|
+
properties?: Record<string, IPluginManifestJobConfigProperty>;
|
|
216
|
+
required?: string[];
|
|
217
|
+
additionalProperties?: boolean;
|
|
218
|
+
}
|
|
219
|
+
interface IPluginManifestJobConfigProperty {
|
|
220
|
+
type: 'string' | 'integer' | 'number' | 'boolean';
|
|
221
|
+
enum?: Array<string | number | boolean>;
|
|
222
|
+
minimum?: number;
|
|
223
|
+
maximum?: number;
|
|
224
|
+
maxLength?: number;
|
|
225
|
+
title?: string;
|
|
226
|
+
description?: string;
|
|
227
|
+
default?: string | number | boolean;
|
|
228
|
+
/** Marks a string that accepts `{{variables}}` when the action plans the job. */
|
|
229
|
+
format?: 'variable-text';
|
|
230
|
+
}
|
|
202
231
|
interface IPluginManifestScheduledJob {
|
|
203
232
|
/** Job type key. */
|
|
204
233
|
type: string;
|
|
205
234
|
description: string;
|
|
206
235
|
/** Capability gate (always requires `scheduledJobs`). */
|
|
207
236
|
capability: 'scheduledJobs';
|
|
237
|
+
/** Required when `actionPlannable` is true. Shown in the action builder. */
|
|
238
|
+
label?: string;
|
|
239
|
+
/** When true, editors may plan this job type in an action. Default false. */
|
|
240
|
+
actionPlannable?: boolean;
|
|
241
|
+
/** Inline JSON Schema for `plugin_config` when the job is planned from an action. */
|
|
242
|
+
configSchema?: IPluginManifestJobConfigSchema;
|
|
243
|
+
/** Config property → registered resource type of this plugin. */
|
|
244
|
+
resourceFields?: Record<string, string>;
|
|
245
|
+
/** Child-process timeout in seconds (10 to 900). Default 120. */
|
|
246
|
+
timeoutSeconds?: number;
|
|
247
|
+
}
|
|
248
|
+
/** Cache category declared by a plugin; stored as `<plugin id>.<name>`. */
|
|
249
|
+
interface IPluginManifestCacheCategory {
|
|
250
|
+
/** `^[a-z][a-z0-9_]{0,40}$`. */
|
|
251
|
+
name: string;
|
|
252
|
+
/** Lifetime in seconds (60 to 86400). */
|
|
253
|
+
ttlSeconds: number;
|
|
254
|
+
description?: string;
|
|
255
|
+
}
|
|
256
|
+
/** Instance setting declared by a plugin; stored by the host (C14). */
|
|
257
|
+
interface IPluginManifestSetting {
|
|
258
|
+
/** `^[a-z][a-z0-9_]{0,63}$`. */
|
|
259
|
+
key: string;
|
|
260
|
+
label: string;
|
|
261
|
+
type: 'string' | 'number' | 'boolean' | 'url';
|
|
262
|
+
/** Default false. Secrets are encrypted at rest and never returned clear. */
|
|
263
|
+
secret?: boolean;
|
|
264
|
+
/** Default false. */
|
|
265
|
+
required?: boolean;
|
|
266
|
+
/** Not allowed when `secret` is true. */
|
|
267
|
+
default?: string | number | boolean;
|
|
268
|
+
/** `^[A-Z][A-Z0-9_]{2,63}$`, unique across enabled plugins. */
|
|
269
|
+
envOverride?: string;
|
|
270
|
+
}
|
|
271
|
+
/** Rate limit declared by a plugin (C15). */
|
|
272
|
+
interface IPluginManifestRateLimit {
|
|
273
|
+
/** `^[a-z][a-z0-9_]{0,40}$`. */
|
|
274
|
+
name: string;
|
|
275
|
+
policy: 'sliding_window' | 'fixed_window';
|
|
276
|
+
/** 1 to 100000. */
|
|
277
|
+
limit: number;
|
|
278
|
+
/** Symfony rate-limiter interval string (e.g. `1 minute`). */
|
|
279
|
+
interval: string;
|
|
280
|
+
}
|
|
281
|
+
/** JSON Logic operation declared by a plugin (C16). */
|
|
282
|
+
interface IPluginManifestJsonLogicOperation {
|
|
283
|
+
/** `^[a-z][a-z0-9_]*\.[a-z][a-z0-9_]*$`; the namespace belongs to one plugin. */
|
|
284
|
+
name: string;
|
|
285
|
+
description: string;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* After-commit domain events a plugin may listen to (C24). Must match the host
|
|
289
|
+
* event names exactly.
|
|
290
|
+
*/
|
|
291
|
+
type TPluginDomainEventName = 'record.saved' | 'record.deleted' | 'user.created' | 'user.deleted' | 'page.published';
|
|
292
|
+
/** Recurring plugin job (C25). `type` must be one of the plugin's `scheduledJobs`. */
|
|
293
|
+
interface IPluginManifestRecurringJob {
|
|
294
|
+
/** `^[a-z][a-z0-9_]{0,40}$`. */
|
|
295
|
+
name: string;
|
|
296
|
+
/** One of this plugin's `scheduledJobs[].type`. */
|
|
297
|
+
type: string;
|
|
298
|
+
/** Five-field cron, UTC, at least 5 minutes apart. */
|
|
299
|
+
cron: string;
|
|
300
|
+
description: string;
|
|
208
301
|
}
|
|
209
302
|
interface IPluginManifestAsset {
|
|
210
303
|
/** Source path within the plugin package. */
|
|
@@ -299,6 +392,36 @@ interface IPluginManifest {
|
|
|
299
392
|
apiRoutes?: IPluginManifestApiRoute[];
|
|
300
393
|
/** Scheduled jobs. */
|
|
301
394
|
scheduledJobs?: IPluginManifestScheduledJob[];
|
|
395
|
+
/**
|
|
396
|
+
* Cache categories the host registers for this plugin (C4). Needs
|
|
397
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
398
|
+
*/
|
|
399
|
+
cacheCategories?: IPluginManifestCacheCategory[];
|
|
400
|
+
/**
|
|
401
|
+
* Instance settings and secrets stored by the host (C14). Needs
|
|
402
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
403
|
+
*/
|
|
404
|
+
settings?: IPluginManifestSetting[];
|
|
405
|
+
/**
|
|
406
|
+
* Rate limits the host builds for this plugin (C15). Needs
|
|
407
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
408
|
+
*/
|
|
409
|
+
rateLimits?: IPluginManifestRateLimit[];
|
|
410
|
+
/**
|
|
411
|
+
* JSON Logic operations the host registers for conditions (C16). Needs
|
|
412
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
413
|
+
*/
|
|
414
|
+
jsonLogicOperations?: IPluginManifestJsonLogicOperation[];
|
|
415
|
+
/**
|
|
416
|
+
* After-commit domain events this plugin's listeners receive (C24). Needs
|
|
417
|
+
* `pluginApiVersion` >= 0.2.0.
|
|
418
|
+
*/
|
|
419
|
+
listens?: TPluginDomainEventName[];
|
|
420
|
+
/**
|
|
421
|
+
* Recurring jobs the host keeps queued while the plugin is enabled (C25).
|
|
422
|
+
* Needs `pluginApiVersion` >= 0.2.0.
|
|
423
|
+
*/
|
|
424
|
+
recurringJobs?: IPluginManifestRecurringJob[];
|
|
302
425
|
/** Vendored assets. */
|
|
303
426
|
assets?: IPluginManifestAsset[];
|
|
304
427
|
/** Health-check declaration. */
|
|
@@ -307,4 +430,4 @@ interface IPluginManifest {
|
|
|
307
430
|
labels?: Record<string, string>;
|
|
308
431
|
}
|
|
309
432
|
|
|
310
|
-
export type { IPluginManifest as I, IPluginManifestAdminPage as a, IPluginManifestApiRoute as b, IPluginManifestAsset as c,
|
|
433
|
+
export type { IPluginManifestStyle as A, IPluginManifestStyleField as B, IPluginManifestStyleGroup as C, IPluginManifestTrustLevel as D, IPluginManifest as I, TPluginDomainEventName as T, IPluginManifestAdminPage as a, IPluginManifestApiRoute as b, IPluginManifestAsset as c, IPluginManifestCacheCategory as d, IPluginManifestCapability as e, IPluginManifestCompatibility as f, IPluginManifestConflict as g, IPluginManifestDataAccess as h, IPluginManifestDependency as i, IPluginManifestExternalHost as j, IPluginManifestFeatureFlag as k, IPluginManifestField as l, IPluginManifestFieldType as m, IPluginManifestHealth as n, IPluginManifestJobConfigProperty as o, IPluginManifestJobConfigSchema as p, IPluginManifestJsonLogicOperation as q, IPluginManifestLookupExtension as r, IPluginManifestMobile as s, IPluginManifestPermission as t, IPluginManifestRateLimit as u, IPluginManifestRealtimeTopic as v, IPluginManifestRecurringJob as w, IPluginManifestScheduledJob as x, IPluginManifestSecurity as y, IPluginManifestSetting as z };
|