@mosaicast/plugin-sdk 0.1.1 → 0.3.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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  > Versioned plugin contract SDK (Java `plugin-api` + `@mosaicast/plugin-sdk` TS) plus a test kit.
4
4
 
5
+ [![CI](https://github.com/Mosaicast/mosaicast-plugin-sdk/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Mosaicast/mosaicast-plugin-sdk/actions/workflows/ci.yml)
6
+ [![npm](https://img.shields.io/npm/v/@mosaicast/plugin-sdk?logo=npm)](https://www.npmjs.com/package/@mosaicast/plugin-sdk)
7
+ [![GitHub Packages](https://img.shields.io/github/v/release/Mosaicast/mosaicast-plugin-sdk?include_prereleases&label=github%20packages&logo=github&color=2ea44f)](https://github.com/Mosaicast/mosaicast-plugin-sdk/packages)
8
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/Mosaicast/mosaicast-plugin-sdk/badge)](https://scorecard.dev/viewer/?uri=github.com/Mosaicast/mosaicast-plugin-sdk)
9
+ [![License](https://img.shields.io/github/license/Mosaicast/mosaicast-plugin-sdk?color=blue)](LICENSE)
10
+
11
+ <!-- Badges are dynamic: CI reflects the latest master run; npm/GitHub-Packages track the published
12
+ version (GitHub Packages via the release tag — Maven coords and releases move together); the
13
+ OpenSSF Scorecard badge is populated by .github/workflows/scorecard.yml. No version is hardcoded.
14
+ The GitHub Packages badge uses include_prereleases because releases are tagged as pre-releases
15
+ while the SDK is pre-1.0. -->
16
+
5
17
  Part of **[Mosaicast](https://github.com/mosaicast)** — an extensible website platform for podcasts. Status: **v1 in development**.
6
18
 
7
19
  This repo is the **hard contract boundary** of the whole system: core AND every plugin compile against it, and it depends on neither. See `docs/ARCHITECTURE.md` for the big picture and `docs/BRIEF.md` for this repo's scope.
@@ -33,8 +45,8 @@ npm ci && npm run build # TypeScript: src → dist (.js + .d.ts)
33
45
  - Released: from **GitHub Packages** (see below).
34
46
  ```kotlin
35
47
  dependencies {
36
- compileOnly("dev.mosaicast:plugin-api:0.1.1") // contract, provided by the host
37
- testImplementation("dev.mosaicast:plugin-testkit:0.1.1") // test doubles only
48
+ compileOnly("dev.mosaicast:plugin-api:0.3.0") // contract, provided by the host
49
+ testImplementation("dev.mosaicast:plugin-testkit:0.3.0") // test doubles only
38
50
  }
39
51
  ```
40
52
  Sources + Javadoc JARs give IDE hover docs automatically.
@@ -57,6 +69,47 @@ repositories {
57
69
  ```
58
70
  The token is any GitHub PAT with `read:packages`. (Anonymous-pull via Maven Central is a possible future move.)
59
71
 
72
+ ## Plugin data access (v1) — plugins do not define HTTP routes
73
+
74
+ This is the part plugin authors most often guess wrong, so it is stated plainly. **A plugin's server side is `register(ctx)` — that is the whole of it.** There is no route-registration or HTTP-handler API in the contract, and its absence is a design decision, not a gap (ARCHITECTURE §7.4/§7.5; the generic doc store is the default).
75
+
76
+ **Backend.** A plugin persists *everything* through `ctx.store()` — the hard-scoped `DocStore`, addressed by `(Scope, key)` — and does any aggregation in `ctx.onSchedule(...)`. (The only alternative is a relational schema *declared in the manifest* and reached via `ctx.schema()`; still not a route.)
77
+
78
+ **Frontend.** A Web Component reaches plugin data through `ctx.api` (`PluginApiClient`). Those calls do **not** hit plugin-authored routes — they hit a fixed, generic surface the **host** exposes over that same doc store, namespaced per plugin. It mirrors `DocStore` one-to-one — `get` / `put` / `list` / `delete`, and no more:
79
+
80
+ ```text
81
+ GET /api/plugins/{id}/data/{scopeType}/{scopeId}/{key}
82
+ → one JSON doc; 404 if absent
83
+ GET /api/plugins/{id}/data/{scopeType}/{scopeId}?prefix=&page=&size=
84
+ → { items: [{ key, value }], page, size, totalElements, totalPages }
85
+ PUT /api/plugins/{id}/data/{scopeType}/{scopeId}/{key} (JSON body)
86
+ → upsert, last-write-wins
87
+ DELETE /api/plugins/{id}/data/{scopeType}/{scopeId}/{key}
88
+ → remove; idempotent
89
+ ```
90
+
91
+ | Operation | Backend (Java) | Frontend (TS) |
92
+ |---|---|---|
93
+ | read one | `store().get(scope, key, T.class)` → `Optional<T>` | `ctx.api.get<T>('data/…/{key}')` |
94
+ | list by prefix | `store().query(scope, prefix)` → `List<DocEntry>` | `ctx.api.get<PagedDocs<T>>('data/…?prefix=…')` |
95
+ | upsert | `store().put(scope, key, value)` | `ctx.api.put('data/…/{key}', value)` |
96
+ | remove | `store().delete(scope, key)` → `boolean` | `ctx.api.delete('data/…/{key}')` |
97
+
98
+ - `scopeType` is `site | feed | season | episode` and `scopeId` is that entity's id — mirroring `Scope`/`ScopeType`, the same addressing the backend uses. **`site`'s `scopeId` is always `main`** (`Scope.SITE_ID`): there is only one site, so both the SDK and the host normalize every site scope to that singleton — `Scope.site()` and `…/data/site/main/{key}` address the same document, and the path always has four non-empty segments.
99
+ - `key` must match `DocStore.KEY_PATTERN` = `^[A-Za-z0-9._:-]{1,200}$` and is the final path segment, verbatim — no `/`, and no percent-encoded slash either (servlet containers reject `%2F` there). Structure keys with `:` / `.` / `-` instead, e.g. `mark:userId:cell`. The host answers 400 on a bad key, and `InMemoryDocStore` throws `IllegalArgumentException` — so it fails in your tests, not in production.
100
+ - The list is **paginated** (core's standard `PagedResponse` envelope) and **carries keys** (`DocEntry`), because neither end can address a doc without one.
101
+ - `delete` is **idempotent**: removing an absent doc is not an error. The Java call returns whether anything was actually removed.
102
+
103
+ **The two ends see one store.** The doc a backend writes with `ctx.store().put(scope, key, value)` is exactly what the frontend reads at `GET /api/plugins/{id}/data/{scopeType}/{scopeId}/{key}`.
104
+
105
+ **What the host enforces**, so a plugin doesn't have to:
106
+ - Data is **hard-scoped to the plugin id** — a plugin can only ever see its own data.
107
+ - **Reads** are gated by the slot's `visibleTo`; **writes** require the mapped role. The host validates that the scope exists (and that the feed is enabled). `ctx.api` carries the user's auth (session or personal access token).
108
+
109
+ **No request-time server logic.** A write is plain persistence — no plugin code runs on the request. Anything derived, validated or aggregated server-side is **precomputed** in `register`/`onSchedule` and read back from the store.
110
+
111
+ > Roadmap: custom plugin-defined server routes may arrive in a later `platformApi` version; plugins use the doc store.
112
+
60
113
  ## Releasing (maintainers)
61
114
  Publishing is automated and fires on a **published GitHub Release**, not on PR merge
62
115
  (`.github/workflows/release.yml`).
@@ -74,7 +127,7 @@ Publishing is automated and fires on a **published GitHub Release**, not on PR m
74
127
  var ctx = new FakePluginContext(); // in-memory store, config, feeds; sync onSchedule
75
128
  myPlugin.register(ctx); // exercise the backend
76
129
  assertEquals(Optional.of("world"),
77
- ctx.store().get(Scope.site("main"), "hello", String.class));
130
+ ctx.store().get(Scope.site(), "hello", String.class));
78
131
  ```
79
132
 
80
133
  **TypeScript** (`@mosaicast/plugin-sdk/testing`, jsdom):
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * version. The host rejects a plugin whose manifest `platformApi` is incompatible with this value
15
15
  * (ARCHITECTURE §7.2). **These move together — a breaking change is a major bump.**
16
16
  */
17
- export declare const PLATFORM_API_VERSION: "0.1.1";
17
+ export declare const PLATFORM_API_VERSION: '0.3.0';
18
18
  /** A user's role (ARCHITECTURE §8.5). Anonymous visitors have no role (`user` is `null`). */
19
19
  export type Role = 'admin' | 'podcaster' | 'fan';
20
20
  /** The level plus concrete entity a view is scoped to (ARCHITECTURE §6.1). */
@@ -67,11 +67,89 @@ export interface ThemeTokens {
67
67
  border: string;
68
68
  }
69
69
  /**
70
- * A thin authenticated REST client for the plugin's own backend.
70
+ * One document in the plugin's doc store: its key plus its value.
71
71
  *
72
- * All paths are relative to the plugin's base (`/api/plugins/<id>/`); the host attaches the auth token
73
- * and base path. Methods reject on non-2xx responses (RFC 7807 `application/problem+json` body,
74
- * ARCHITECTURE §13).
72
+ * Mirror of the Java `dev.mosaicast.plugin.api.DocEntry` record, and the element type of the host's
73
+ * paged list endpoint — the key is carried because you cannot address a document without it.
74
+ */
75
+ export interface DocEntry<T = unknown> {
76
+ /** The document's key within its scope; matches `^[A-Za-z0-9._:-]{1,200}$`. */
77
+ key: string;
78
+ /** The document's JSON value. */
79
+ value: T;
80
+ }
81
+ /**
82
+ * The host's standard paged envelope, as returned by the doc-store list endpoint
83
+ * (`GET /api/plugins/{id}/data/{scopeType}/{scopeId}?prefix=&page=&size=`).
84
+ */
85
+ export interface PagedDocs<T = unknown> {
86
+ /** The documents on this page, keyed. */
87
+ items: DocEntry<T>[];
88
+ /** The zero-based page index. */
89
+ page: number;
90
+ /** The requested page size. */
91
+ size: number;
92
+ /** Total number of matching documents across all pages. */
93
+ totalElements: number;
94
+ /** Total number of pages. */
95
+ totalPages: number;
96
+ }
97
+ /**
98
+ * A thin authenticated REST client for the **host-provided** endpoints of this plugin's namespace.
99
+ *
100
+ * All paths are relative to the plugin's base (`/api/plugins/<id>/`); the host attaches the base path and
101
+ * the user's auth (session or personal access token). Methods reject on non-2xx responses (RFC 7807
102
+ * `application/problem+json` body, ARCHITECTURE §13).
103
+ *
104
+ * **These are not plugin-authored routes.** A v1 plugin cannot declare HTTP endpoints — its server side
105
+ * is `register(ctx)` and nothing else (see the Java `PluginBackend`). What this client talks to is a
106
+ * fixed, generic surface the host exposes over the plugin's hard-scoped doc store, mirroring the Java
107
+ * `DocStore` one-to-one — get / put / list / delete, nothing more:
108
+ *
109
+ * ```text
110
+ * GET /api/plugins/{id}/data/{scopeType}/{scopeId}/{key}
111
+ * → one JSON doc; 404 if absent
112
+ * GET /api/plugins/{id}/data/{scopeType}/{scopeId}?prefix=&page=&size=
113
+ * → { items: [{ key, value }], page, size, totalElements, totalPages }
114
+ * PUT /api/plugins/{id}/data/{scopeType}/{scopeId}/{key} (JSON body)
115
+ * → upsert, last-write-wins
116
+ * DELETE /api/plugins/{id}/data/{scopeType}/{scopeId}/{key}
117
+ * → remove; idempotent
118
+ * ```
119
+ *
120
+ * `scopeType` is `site | feed | season | episode` and `scopeId` the id of that entity — i.e. the
121
+ * {@link Scope} the backend addresses with. For `site` the id is the literal `main` (one site, one
122
+ * singleton scope), so the path always has four non-empty segments. `key` must match
123
+ * `^[A-Za-z0-9._:-]{1,200}$` — the host answers 400 otherwise — and is the final path segment verbatim:
124
+ * no `/`, so structure keys with `:` / `.` / `-` (e.g. `mark:userId:cell`). The list is paginated
125
+ * ({@link PagedDocs}) and carries each doc's key ({@link DocEntry}), since you cannot address a doc
126
+ * without it.
127
+ *
128
+ * The doc a backend writes with `ctx.store().put(scope, key, value)` is the one read here at
129
+ * `GET /api/plugins/{id}/data/{scopeType}/{scopeId}/{key}`: one store, two ends.
130
+ *
131
+ * Data is hard-scoped to the plugin id — a plugin can only ever see its own. Reads are gated by the
132
+ * slot's `visibleTo`, writes require the mapped {@link Role}, and the host validates that the scope
133
+ * exists. A write is plain persistence: no plugin code runs at request time, so anything derived or
134
+ * validated server-side must be precomputed in the backend's `register`/`onSchedule` and read back from
135
+ * the store.
136
+ *
137
+ * Custom plugin-defined server routes may arrive in a later `platformApi` version; v1 plugins use the
138
+ * doc store.
139
+ *
140
+ * @example Read, list, write and remove docs from a Web Component
141
+ * ```ts
142
+ * const base = `data/${ctx.scope.type}/${ctx.scope.id}`; // scope.id is `main` on the site scope
143
+ * const key = `board:${ctx.user!.id}`; // no `/` in keys
144
+ *
145
+ * const board = await ctx.api.get<Board>(`${base}/${key}`); // rejects with a 404 problem if absent
146
+ * await ctx.api.put(`${base}/${key}`, { ...board, marked }); // upsert, last-write-wins
147
+ *
148
+ * const page = await ctx.api.get<PagedDocs<Board>>(`${base}?prefix=board:&page=0&size=50`);
149
+ * page.items.forEach(({ key, value }) => render(key, value));
150
+ *
151
+ * await ctx.api.delete(`${base}/${key}`); // idempotent
152
+ * ```
75
153
  */
76
154
  export interface PluginApiClient {
77
155
  /** GET a path, resolving to the parsed JSON body. */
@@ -83,6 +161,45 @@ export interface PluginApiClient {
83
161
  /** DELETE a path, resolving to the parsed JSON response. */
84
162
  delete<T = unknown>(path: string): Promise<T>;
85
163
  }
164
+ /**
165
+ * The presentation layer of an episode — the feed-derived snapshot the core UI shows (ARCHITECTURE §4.2),
166
+ * mirrored from the Java `dev.mosaicast.plugin.api.DisplaySnapshot` record.
167
+ *
168
+ * **Not authoritative:** the host overwrites it on every fetch from the raw feed, so a feed change
169
+ * propagates automatically. `publishedAt` and `duration` are serialized as ISO-8601 strings (an instant
170
+ * and an ISO-8601 duration respectively). Optional fields are absent when the feed declares nothing.
171
+ */
172
+ export interface DisplaySnapshot {
173
+ /** The episode title from the feed. */
174
+ title: string;
175
+ /** The episode description/show notes; may be empty. */
176
+ description: string;
177
+ /** The enclosure audio URL; absent for a `PLANNED` episode with no audio yet. */
178
+ audioUrl?: string;
179
+ /** The publication timestamp (ISO-8601 instant); absent for a `PLANNED` episode. */
180
+ publishedAt?: string;
181
+ /** The declared runtime (ISO-8601 duration); absent when the feed declares none. */
182
+ duration?: string;
183
+ /** The episode's own artwork (`itunes:image` on the item); absent if the episode declares none. */
184
+ imageUrl?: string;
185
+ /** The feed/show cover (`itunes:image` on the channel); absent if the feed declares none. */
186
+ feedImageUrl?: string;
187
+ /** The episode author (`itunes:author`); absent if the feed declares none. */
188
+ author?: string;
189
+ /** A short episode subtitle (`itunes:subtitle`); absent if the feed declares none. */
190
+ subtitle?: string;
191
+ }
192
+ /**
193
+ * The artwork to display for an episode: its own {@link DisplaySnapshot.imageUrl} if present, otherwise
194
+ * the {@link DisplaySnapshot.feedImageUrl feed cover}, otherwise `undefined`.
195
+ *
196
+ * Mirror of the Java `DisplaySnapshot.artwork()` accessor. Use the two fields directly when you
197
+ * specifically need the episode- or feed-level value.
198
+ *
199
+ * @param snapshot the display snapshot to resolve artwork for
200
+ * @returns the resolved artwork URL, or `undefined` when neither the episode nor the feed declares one
201
+ */
202
+ export declare function resolveArtwork(snapshot: DisplaySnapshot): string | undefined;
86
203
  /**
87
204
  * Everything a frontend plugin is given, set by the host on the mounted custom element
88
205
  * (ARCHITECTURE §7.5). This is the **entire** interface a plugin author must learn.
@@ -101,7 +218,11 @@ export interface PluginContext {
101
218
  id: string;
102
219
  role: Role;
103
220
  } | null;
104
- /** Authenticated client for the plugin's own backend. */
221
+ /**
222
+ * Authenticated client for this plugin's host-provided data endpoints — **not** for plugin-authored
223
+ * routes, which do not exist in v1. It reads and writes the same hard-scoped doc store the backend
224
+ * uses via `ctx.store()`. See {@link PluginApiClient} for the endpoint shape and access rules.
225
+ */
105
226
  api: PluginApiClient;
106
227
  /** Cookie/consent gate for third-party resources (ARCHITECTURE §12.5). */
107
228
  consent: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAG,OAAgB,CAAC;AAErD,6FAA6F;AAC7F,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,WAAW,GAAG,KAAK,CAAC;AAEjD,8EAA8E;AAC9E,MAAM,WAAW,KAAK;IACpB,uBAAuB;IACvB,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC7C,mFAAmF;IACnF,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IAC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AOG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAEvG,kDAAkD;AAClD,MAAM,WAAW,oBAAoB;IACnC,sFAAsF;IACtF,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,MAAM,EAAE,eAAe,CAAC;CACzB;AAqBD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAqD1E;AAED,4FAA4F;AAC5F,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAEvD,2DAA2D;AAC3D,MAAM,WAAW,UAAU;IACzB;;;;;;;OAOG;IACH,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;IACjE,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAaD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,GAC9B,UAAU,CAgBZ"}
package/dist/index.js CHANGED
@@ -16,7 +16,20 @@
16
16
  * version. The host rejects a plugin whose manifest `platformApi` is incompatible with this value
17
17
  * (ARCHITECTURE §7.2). **These move together — a breaking change is a major bump.**
18
18
  */
19
- export const PLATFORM_API_VERSION = '0.1.1';
19
+ export const PLATFORM_API_VERSION = '0.3.0';
20
+ /**
21
+ * The artwork to display for an episode: its own {@link DisplaySnapshot.imageUrl} if present, otherwise
22
+ * the {@link DisplaySnapshot.feedImageUrl feed cover}, otherwise `undefined`.
23
+ *
24
+ * Mirror of the Java `DisplaySnapshot.artwork()` accessor. Use the two fields directly when you
25
+ * specifically need the episode- or feed-level value.
26
+ *
27
+ * @param snapshot the display snapshot to resolve artwork for
28
+ * @returns the resolved artwork URL, or `undefined` when neither the episode nor the feed declares one
29
+ */
30
+ export function resolveArtwork(snapshot) {
31
+ return snapshot.imageUrl ?? snapshot.feedImageUrl;
32
+ }
20
33
  const THEME_TOKEN_VARS = [
21
34
  ['bg', '--mc-bg'],
22
35
  ['surface', '--mc-surface'],
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,qDAAqD;AAErD;;;;;;;;GAQG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAgB,CAAC;AA4HrD,MAAM,gBAAgB,GAA+C;IACnE,CAAC,IAAI,EAAE,SAAS,CAAC;IACjB,CAAC,SAAS,EAAE,cAAc,CAAC;IAC3B,CAAC,MAAM,EAAE,WAAW,CAAC;IACrB,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAChC,CAAC,QAAQ,EAAE,aAAa,CAAC;IACzB,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;IAC1C,CAAC,SAAS,EAAE,eAAe,CAAC;IAC5B,CAAC,QAAQ,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,+DAA+D;AAC/D,SAAS,QAAQ,CAAC,KAAkB;IAClC,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;SACjE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC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AAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;QAChE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;QACvC,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;QACnD,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC9C,KAAK,EAAE,aAAa;KACrB,CAAC;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC5C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mosaicast/plugin-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "description": "Versioned plugin contract for Mosaicast: the frontend PluginContext types, a Web Component base helper, an i18n helper, plus a test kit under the /testing subpath.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -33,9 +33,9 @@
33
33
  "test:watch": "vitest"
34
34
  },
35
35
  "devDependencies": {
36
- "jsdom": "^24.1.0",
37
- "typescript": "^5.5.4",
38
- "vitest": "^2.0.5"
36
+ "jsdom": "^29.1.1",
37
+ "typescript": "^7.0.2",
38
+ "vitest": "^4.1.10"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"