@kubun/plugin-service-api 0.17.0 → 0.17.1

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.
Files changed (2) hide show
  1. package/lib/index.d.ts +13 -0
  2. package/package.json +1 -1
package/lib/index.d.ts CHANGED
@@ -49,6 +49,13 @@ export type ServiceHandlerContext = {
49
49
  * comes from the handler. With no `subject`, the caller acts only for itself.
50
50
  */
51
51
  authorize: (subject?: string) => Promise<boolean>;
52
+ /**
53
+ * Server-derived group ID for this serve, when the transport is bound to a
54
+ * group tunnel. Injected per-serve as a constant (never read from the wire
55
+ * message/param), so a handler cannot spoof it. `undefined` outside a group
56
+ * context.
57
+ */
58
+ groupID?: string;
52
59
  };
53
60
  /** A single namespaced procedure handler, e.g. the impl behind `echo/ping`. */
54
61
  export type ServiceHandler = (context: ServiceHandlerContext) => unknown | Promise<unknown>;
@@ -106,4 +113,10 @@ export type ServiceServerServeParams = {
106
113
  cache?: DIDCache;
107
114
  /** Aborts the server when signalled. */
108
115
  signal?: AbortSignal;
116
+ /**
117
+ * Server-derived group ID for this serve, plumbed into each served handler's
118
+ * context as {@link ServiceHandlerContext.groupID}. Set when the transport is
119
+ * bound to a group tunnel; omitted outside a group context.
120
+ */
121
+ groupID?: string;
109
122
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubun/plugin-service-api",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "keywords": [],
5
5
  "license": "see LICENSE.md",
6
6
  "sideEffects": false,