@dosu/seshi-client 0.19.0 → 0.20.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
@@ -1,4 +1,4 @@
1
- <img src="https://raw.githubusercontent.com/dosu-ai/seshi/v0.19.0/brand/glyph/seshi-glyph-badge.svg" alt="" width="64" height="64">
1
+ <img src="https://raw.githubusercontent.com/dosu-ai/seshi/v0.20.0/brand/glyph/seshi-glyph-badge.svg" alt="" width="64" height="64">
2
2
 
3
3
  # @dosu/seshi-client
4
4
 
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  Forbidden,
15
15
  OffsetMismatch,
16
16
  SessionConflict,
17
+ SessionExcluded,
17
18
  SessionRejected,
18
19
  StoreError,
19
20
  VERSION
@@ -96,6 +97,8 @@ function refuse(status, body, offset = 0) {
96
97
  throw new SessionConflict(message);
97
98
  if (status === 403 && code === "forbidden")
98
99
  throw new Forbidden(message);
100
+ if (status === 403 && code === "excluded")
101
+ throw new SessionExcluded(message);
99
102
  if (status === 422)
100
103
  throw new SessionRejected(code, message);
101
104
  if (status === 502)
@@ -310,6 +313,16 @@ class HttpSessionDB {
310
313
  refuse(status, body);
311
314
  return { document: body, etag: headers.get("etag") ?? undefined };
312
315
  }
316
+ async captureRulesSince(etag) {
317
+ const { status, body, headers } = await this.request("GET", "/v1/capture/rules", {
318
+ ...etag ? { headers: { "if-none-match": etag } } : {}
319
+ });
320
+ if (status === 304 && etag)
321
+ return null;
322
+ if (status !== 200)
323
+ refuse(status, body);
324
+ return { document: body, etag: headers.get("etag") ?? undefined };
325
+ }
313
326
  async owners(options = {}) {
314
327
  const { status, body } = await this.request("GET", "/v1/owners", {
315
328
  query: { after: options.after, limit: options.limit }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosu/seshi-client",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/dosu-ai/seshi#readme",
6
6
  "repository": {
@@ -30,6 +30,6 @@
30
30
  "node": ">=20"
31
31
  },
32
32
  "dependencies": {
33
- "@dosu/seshi-model": "0.19.0"
33
+ "@dosu/seshi-model": "0.20.0"
34
34
  }
35
35
  }
package/types/http.d.ts CHANGED
@@ -120,6 +120,13 @@ export declare class HttpSessionDB implements SessionDB {
120
120
  document: unknown;
121
121
  etag: string | undefined;
122
122
  } | null>;
123
+ /** The org's capture rules (`GET /v1/capture/rules`): the server's exclude list, which a
124
+ * laptop applies before upload, with HTTP caching as `redactionRulesSince`. `null` means the
125
+ * list has not changed since `etag`; a server older than the route answers 404 (`ServerError`). */
126
+ captureRulesSince(etag?: string): Promise<{
127
+ document: unknown;
128
+ etag: string | undefined;
129
+ } | null>;
123
130
  /** The owners with sessions stored. */
124
131
  owners(options?: {
125
132
  after?: string;