@frockbot/plugin-audit 0.3.0 → 0.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frockbot/plugin-audit",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -25,11 +25,11 @@
25
25
  "typecheck": "vue-tsc --noEmit -p tsconfig.json"
26
26
  },
27
27
  "dependencies": {
28
- "@frockbot/client-core": "0.3.0",
29
- "@frockbot/client-ui": "0.3.0",
30
- "@frockbot/kernel-contracts": "0.3.0",
31
- "@frockbot/plugin-shell": "0.3.0",
32
- "@frockbot/secret-shapes": "0.3.0",
28
+ "@frockbot/client-core": "0.3.2",
29
+ "@frockbot/client-ui": "0.3.2",
30
+ "@frockbot/kernel-contracts": "0.3.2",
31
+ "@frockbot/plugin-shell": "0.3.2",
32
+ "@frockbot/secret-shapes": "0.3.2",
33
33
  "cordis": "4.0.0-rc.8",
34
34
  "vue": "3.5.41"
35
35
  },
package/src/backend.ts CHANGED
@@ -24,6 +24,7 @@ import {
24
24
  type AuditRebuildReceiptV1,
25
25
  type ClientAuditPageV1,
26
26
  } from "./shared.js";
27
+ import { defineGatewayContribution } from "@frockbot/kernel-contracts/contributions";
27
28
 
28
29
  export interface AuditGatewayHost {
29
30
  readAudit(userId: string, query: AuditQueryV1): Promise<ClientAuditPageV1>;
@@ -146,3 +147,16 @@ export namespace createAuditBackendContribution {
146
147
  return () => lifecycle.mount(createAuditBackendContribution(host));
147
148
  }
148
149
  }
150
+
151
+ /**
152
+ * The manifest's gateway `backend` entry, resolved by specifier. The
153
+ * application looks this descriptor up in its Contribution table; it never
154
+ * branches on which Package it belongs to.
155
+ */
156
+ export const backendContribution = defineGatewayContribution<
157
+ AuditGatewayHost,
158
+ AuditBackendRouteContribution
159
+ >({
160
+ specifier: "@frockbot/plugin-audit/backend",
161
+ create: createAuditBackendContribution.plugin,
162
+ });
@@ -14,6 +14,7 @@ import {
14
14
  } from "../shared.js";
15
15
  import AuditSection from "./AuditSection.vue";
16
16
  import { auditStateKey, type AuditClientState } from "./state.js";
17
+ import { defineClientContribution } from "@frockbot/kernel-contracts/contributions";
17
18
 
18
19
  function message(error: unknown, fallback: string): string {
19
20
  return error instanceof Error ? error.message : fallback;
@@ -123,3 +124,13 @@ export const auditClientPlugin: ClientPlugin = (ctx) => {
123
124
  };
124
125
 
125
126
  export default auditClientPlugin;
127
+
128
+ /**
129
+ * The manifest's `client` entry, resolved by specifier. The application looks
130
+ * this descriptor up in its Contribution table; it never branches on which
131
+ * Package it belongs to.
132
+ */
133
+ export const clientContribution = defineClientContribution<ClientPlugin>({
134
+ specifier: "@frockbot/plugin-audit/client",
135
+ plugin: auditClientPlugin,
136
+ });
package/src/user.ts CHANGED
@@ -29,6 +29,7 @@ import {
29
29
  type AuditEntrySourceV1,
30
30
  type AuditSqlV1,
31
31
  } from "./store.js";
32
+ import { defineUserBackendContribution } from "@frockbot/kernel-contracts/contributions";
32
33
 
33
34
  export interface AuditUserBackendHost {
34
35
  /** The User Durable Object's own SQL storage. */
@@ -213,3 +214,26 @@ export function createAuditUserBackendPlugin(
213
214
  ): Plugin {
214
215
  return () => lifecycle.mount(new AuditUserBackendContribution(host));
215
216
  }
217
+
218
+ /**
219
+ * What an application hands this Contribution: the User's audit table, under the
220
+ * Package's own key so one wide host object can satisfy every Package's slice
221
+ * without their fields colliding.
222
+ */
223
+ export interface AuditUserApplicationHostV1 {
224
+ audit: AuditUserBackendHost;
225
+ }
226
+
227
+ /**
228
+ * The manifest's `user` entry, resolved by specifier. The
229
+ * application looks this descriptor up in its Contribution table; it never
230
+ * branches on which Package it belongs to.
231
+ */
232
+ export const userContribution = defineUserBackendContribution<
233
+ AuditUserApplicationHostV1,
234
+ AuditUserBackendContribution
235
+ >({
236
+ specifier: "@frockbot/plugin-audit/user",
237
+ create: (host, lifecycle) =>
238
+ createAuditUserBackendPlugin(host.audit, lifecycle),
239
+ });