@athenaintel/sdk 4.3.2128 → 4.3.2130

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 (24) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/sessions/client/Client.d.ts +34 -0
  3. package/dist/cjs/api/resources/sessions/client/Client.js +152 -0
  4. package/dist/cjs/api/resources/sessions/client/requests/MarkReadSessionsRequest.d.ts +10 -0
  5. package/dist/cjs/api/resources/sessions/client/requests/MarkReadSessionsRequest.js +3 -0
  6. package/dist/cjs/api/resources/sessions/client/requests/MarkUnreadSessionsRequest.d.ts +10 -0
  7. package/dist/cjs/api/resources/sessions/client/requests/MarkUnreadSessionsRequest.js +3 -0
  8. package/dist/cjs/api/resources/sessions/client/requests/index.d.ts +2 -0
  9. package/dist/cjs/api/types/SessionOut.d.ts +2 -0
  10. package/dist/cjs/version.d.ts +1 -1
  11. package/dist/cjs/version.js +1 -1
  12. package/dist/esm/BaseClient.mjs +2 -2
  13. package/dist/esm/api/resources/sessions/client/Client.d.mts +34 -0
  14. package/dist/esm/api/resources/sessions/client/Client.mjs +152 -0
  15. package/dist/esm/api/resources/sessions/client/requests/MarkReadSessionsRequest.d.mts +10 -0
  16. package/dist/esm/api/resources/sessions/client/requests/MarkReadSessionsRequest.mjs +2 -0
  17. package/dist/esm/api/resources/sessions/client/requests/MarkUnreadSessionsRequest.d.mts +10 -0
  18. package/dist/esm/api/resources/sessions/client/requests/MarkUnreadSessionsRequest.mjs +2 -0
  19. package/dist/esm/api/resources/sessions/client/requests/index.d.mts +2 -0
  20. package/dist/esm/api/types/SessionOut.d.mts +2 -0
  21. package/dist/esm/version.d.mts +1 -1
  22. package/dist/esm/version.mjs +1 -1
  23. package/package.json +1 -1
  24. package/reference.md +130 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@athenaintel/sdk",
46
- "X-Fern-SDK-Version": "4.3.2128",
47
- "User-Agent": "@athenaintel/sdk/4.3.2128",
46
+ "X-Fern-SDK-Version": "4.3.2130",
47
+ "User-Agent": "@athenaintel/sdk/4.3.2130",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -62,4 +62,38 @@ export declare class SessionsClient {
62
62
  */
63
63
  download(request: AthenaIntelligence.DownloadSessionsRequest, requestOptions?: SessionsClient.RequestOptions): core.HttpResponsePromise<unknown>;
64
64
  private __download;
65
+ /**
66
+ * Record that the calling user has read the session as of now, clearing its unread indicator. Idempotent: repeated calls only move the read receipt forward.
67
+ *
68
+ * @param {AthenaIntelligence.MarkReadSessionsRequest} request
69
+ * @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.
70
+ *
71
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
72
+ * @throws {@link AthenaIntelligence.NotFoundError}
73
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
74
+ *
75
+ * @example
76
+ * await client.sessions.markRead({
77
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
78
+ * })
79
+ */
80
+ markRead(request: AthenaIntelligence.MarkReadSessionsRequest, requestOptions?: SessionsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.SessionOut>;
81
+ private __markRead;
82
+ /**
83
+ * Clear the calling user's read receipt so the session shows as unread again. Idempotent: repeated calls leave the session unread.
84
+ *
85
+ * @param {AthenaIntelligence.MarkUnreadSessionsRequest} request
86
+ * @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.
87
+ *
88
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
89
+ * @throws {@link AthenaIntelligence.NotFoundError}
90
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
91
+ *
92
+ * @example
93
+ * await client.sessions.markUnread({
94
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
95
+ * })
96
+ */
97
+ markUnread(request: AthenaIntelligence.MarkUnreadSessionsRequest, requestOptions?: SessionsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.SessionOut>;
98
+ private __markUnread;
65
99
  }
@@ -347,5 +347,157 @@ class SessionsClient {
347
347
  }
348
348
  });
349
349
  }
350
+ /**
351
+ * Record that the calling user has read the session as of now, clearing its unread indicator. Idempotent: repeated calls only move the read receipt forward.
352
+ *
353
+ * @param {AthenaIntelligence.MarkReadSessionsRequest} request
354
+ * @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.
355
+ *
356
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
357
+ * @throws {@link AthenaIntelligence.NotFoundError}
358
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
359
+ *
360
+ * @example
361
+ * await client.sessions.markRead({
362
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
363
+ * })
364
+ */
365
+ markRead(request, requestOptions) {
366
+ return core.HttpResponsePromise.fromPromise(this.__markRead(request, requestOptions));
367
+ }
368
+ __markRead(request, requestOptions) {
369
+ return __awaiter(this, void 0, void 0, function* () {
370
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
371
+ const { asset_id: assetId } = request;
372
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
373
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
374
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
375
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/sessions/${core.url.encodePathParam(assetId)}/read`),
376
+ method: "POST",
377
+ headers: _headers,
378
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
379
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
380
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
381
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
382
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
383
+ logging: this._options.logging,
384
+ });
385
+ if (_response.ok) {
386
+ return { data: _response.body, rawResponse: _response.rawResponse };
387
+ }
388
+ if (_response.error.reason === "status-code") {
389
+ switch (_response.error.statusCode) {
390
+ case 401:
391
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
392
+ case 404:
393
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
394
+ case 422:
395
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
396
+ default:
397
+ throw new errors.AthenaIntelligenceError({
398
+ statusCode: _response.error.statusCode,
399
+ body: _response.error.body,
400
+ rawResponse: _response.rawResponse,
401
+ });
402
+ }
403
+ }
404
+ switch (_response.error.reason) {
405
+ case "non-json":
406
+ throw new errors.AthenaIntelligenceError({
407
+ statusCode: _response.error.statusCode,
408
+ body: _response.error.rawBody,
409
+ rawResponse: _response.rawResponse,
410
+ });
411
+ case "body-is-null":
412
+ throw new errors.AthenaIntelligenceError({
413
+ statusCode: _response.error.statusCode,
414
+ rawResponse: _response.rawResponse,
415
+ });
416
+ case "timeout":
417
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/sessions/{asset_id}/read.");
418
+ case "unknown":
419
+ throw new errors.AthenaIntelligenceError({
420
+ message: _response.error.errorMessage,
421
+ rawResponse: _response.rawResponse,
422
+ });
423
+ }
424
+ });
425
+ }
426
+ /**
427
+ * Clear the calling user's read receipt so the session shows as unread again. Idempotent: repeated calls leave the session unread.
428
+ *
429
+ * @param {AthenaIntelligence.MarkUnreadSessionsRequest} request
430
+ * @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.
431
+ *
432
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
433
+ * @throws {@link AthenaIntelligence.NotFoundError}
434
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
435
+ *
436
+ * @example
437
+ * await client.sessions.markUnread({
438
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
439
+ * })
440
+ */
441
+ markUnread(request, requestOptions) {
442
+ return core.HttpResponsePromise.fromPromise(this.__markUnread(request, requestOptions));
443
+ }
444
+ __markUnread(request, requestOptions) {
445
+ return __awaiter(this, void 0, void 0, function* () {
446
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
447
+ const { asset_id: assetId } = request;
448
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
449
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
450
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
451
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/sessions/${core.url.encodePathParam(assetId)}/unread`),
452
+ method: "POST",
453
+ headers: _headers,
454
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
455
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
456
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
457
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
458
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
459
+ logging: this._options.logging,
460
+ });
461
+ if (_response.ok) {
462
+ return { data: _response.body, rawResponse: _response.rawResponse };
463
+ }
464
+ if (_response.error.reason === "status-code") {
465
+ switch (_response.error.statusCode) {
466
+ case 401:
467
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
468
+ case 404:
469
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
470
+ case 422:
471
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
472
+ default:
473
+ throw new errors.AthenaIntelligenceError({
474
+ statusCode: _response.error.statusCode,
475
+ body: _response.error.body,
476
+ rawResponse: _response.rawResponse,
477
+ });
478
+ }
479
+ }
480
+ switch (_response.error.reason) {
481
+ case "non-json":
482
+ throw new errors.AthenaIntelligenceError({
483
+ statusCode: _response.error.statusCode,
484
+ body: _response.error.rawBody,
485
+ rawResponse: _response.rawResponse,
486
+ });
487
+ case "body-is-null":
488
+ throw new errors.AthenaIntelligenceError({
489
+ statusCode: _response.error.statusCode,
490
+ rawResponse: _response.rawResponse,
491
+ });
492
+ case "timeout":
493
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/sessions/{asset_id}/unread.");
494
+ case "unknown":
495
+ throw new errors.AthenaIntelligenceError({
496
+ message: _response.error.errorMessage,
497
+ rawResponse: _response.rawResponse,
498
+ });
499
+ }
500
+ });
501
+ }
350
502
  }
351
503
  exports.SessionsClient = SessionsClient;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
5
+ * }
6
+ */
7
+ export interface MarkReadSessionsRequest {
8
+ /** Unique identifier of the session asset to mark as read */
9
+ asset_id: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
5
+ * }
6
+ */
7
+ export interface MarkUnreadSessionsRequest {
8
+ /** Unique identifier of the session asset to mark as unread */
9
+ asset_id: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,5 @@
1
1
  export type { DownloadSessionsRequest } from "./DownloadSessionsRequest.js";
2
2
  export type { GetSessionsRequest } from "./GetSessionsRequest.js";
3
3
  export type { ListSessionsRequest } from "./ListSessionsRequest.js";
4
+ export type { MarkReadSessionsRequest } from "./MarkReadSessionsRequest.js";
5
+ export type { MarkUnreadSessionsRequest } from "./MarkUnreadSessionsRequest.js";
@@ -22,6 +22,8 @@ export interface SessionOut {
22
22
  id: string;
23
23
  /** Whether this is a branched sub-session of another session */
24
24
  is_sub_session?: boolean;
25
+ /** Whether the session is unread for the calling user: it changed since they last opened it, or they never opened it and it did not originate from the web app */
26
+ is_unread?: boolean;
25
27
  /** Plain-text preview of the most recent message, when available */
26
28
  last_message_preview?: string | null;
27
29
  /** Model the session ran with, when set */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.2128";
1
+ export declare const SDK_VERSION = "4.3.2130";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "4.3.2128";
4
+ exports.SDK_VERSION = "4.3.2130";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@athenaintel/sdk",
9
- "X-Fern-SDK-Version": "4.3.2128",
10
- "User-Agent": "@athenaintel/sdk/4.3.2128",
9
+ "X-Fern-SDK-Version": "4.3.2130",
10
+ "User-Agent": "@athenaintel/sdk/4.3.2130",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -62,4 +62,38 @@ export declare class SessionsClient {
62
62
  */
63
63
  download(request: AthenaIntelligence.DownloadSessionsRequest, requestOptions?: SessionsClient.RequestOptions): core.HttpResponsePromise<unknown>;
64
64
  private __download;
65
+ /**
66
+ * Record that the calling user has read the session as of now, clearing its unread indicator. Idempotent: repeated calls only move the read receipt forward.
67
+ *
68
+ * @param {AthenaIntelligence.MarkReadSessionsRequest} request
69
+ * @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.
70
+ *
71
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
72
+ * @throws {@link AthenaIntelligence.NotFoundError}
73
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
74
+ *
75
+ * @example
76
+ * await client.sessions.markRead({
77
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
78
+ * })
79
+ */
80
+ markRead(request: AthenaIntelligence.MarkReadSessionsRequest, requestOptions?: SessionsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.SessionOut>;
81
+ private __markRead;
82
+ /**
83
+ * Clear the calling user's read receipt so the session shows as unread again. Idempotent: repeated calls leave the session unread.
84
+ *
85
+ * @param {AthenaIntelligence.MarkUnreadSessionsRequest} request
86
+ * @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.
87
+ *
88
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
89
+ * @throws {@link AthenaIntelligence.NotFoundError}
90
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
91
+ *
92
+ * @example
93
+ * await client.sessions.markUnread({
94
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
95
+ * })
96
+ */
97
+ markUnread(request: AthenaIntelligence.MarkUnreadSessionsRequest, requestOptions?: SessionsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.SessionOut>;
98
+ private __markUnread;
65
99
  }
@@ -311,4 +311,156 @@ export class SessionsClient {
311
311
  }
312
312
  });
313
313
  }
314
+ /**
315
+ * Record that the calling user has read the session as of now, clearing its unread indicator. Idempotent: repeated calls only move the read receipt forward.
316
+ *
317
+ * @param {AthenaIntelligence.MarkReadSessionsRequest} request
318
+ * @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.
319
+ *
320
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
321
+ * @throws {@link AthenaIntelligence.NotFoundError}
322
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
323
+ *
324
+ * @example
325
+ * await client.sessions.markRead({
326
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
327
+ * })
328
+ */
329
+ markRead(request, requestOptions) {
330
+ return core.HttpResponsePromise.fromPromise(this.__markRead(request, requestOptions));
331
+ }
332
+ __markRead(request, requestOptions) {
333
+ return __awaiter(this, void 0, void 0, function* () {
334
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
335
+ const { asset_id: assetId } = request;
336
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
337
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
338
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
339
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/sessions/${core.url.encodePathParam(assetId)}/read`),
340
+ method: "POST",
341
+ headers: _headers,
342
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
343
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
344
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
345
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
346
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
347
+ logging: this._options.logging,
348
+ });
349
+ if (_response.ok) {
350
+ return { data: _response.body, rawResponse: _response.rawResponse };
351
+ }
352
+ if (_response.error.reason === "status-code") {
353
+ switch (_response.error.statusCode) {
354
+ case 401:
355
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
356
+ case 404:
357
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
358
+ case 422:
359
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
360
+ default:
361
+ throw new errors.AthenaIntelligenceError({
362
+ statusCode: _response.error.statusCode,
363
+ body: _response.error.body,
364
+ rawResponse: _response.rawResponse,
365
+ });
366
+ }
367
+ }
368
+ switch (_response.error.reason) {
369
+ case "non-json":
370
+ throw new errors.AthenaIntelligenceError({
371
+ statusCode: _response.error.statusCode,
372
+ body: _response.error.rawBody,
373
+ rawResponse: _response.rawResponse,
374
+ });
375
+ case "body-is-null":
376
+ throw new errors.AthenaIntelligenceError({
377
+ statusCode: _response.error.statusCode,
378
+ rawResponse: _response.rawResponse,
379
+ });
380
+ case "timeout":
381
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/sessions/{asset_id}/read.");
382
+ case "unknown":
383
+ throw new errors.AthenaIntelligenceError({
384
+ message: _response.error.errorMessage,
385
+ rawResponse: _response.rawResponse,
386
+ });
387
+ }
388
+ });
389
+ }
390
+ /**
391
+ * Clear the calling user's read receipt so the session shows as unread again. Idempotent: repeated calls leave the session unread.
392
+ *
393
+ * @param {AthenaIntelligence.MarkUnreadSessionsRequest} request
394
+ * @param {SessionsClient.RequestOptions} requestOptions - Request-specific configuration.
395
+ *
396
+ * @throws {@link AthenaIntelligence.UnauthorizedError}
397
+ * @throws {@link AthenaIntelligence.NotFoundError}
398
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
399
+ *
400
+ * @example
401
+ * await client.sessions.markUnread({
402
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
403
+ * })
404
+ */
405
+ markUnread(request, requestOptions) {
406
+ return core.HttpResponsePromise.fromPromise(this.__markUnread(request, requestOptions));
407
+ }
408
+ __markUnread(request, requestOptions) {
409
+ return __awaiter(this, void 0, void 0, function* () {
410
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
411
+ const { asset_id: assetId } = request;
412
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
413
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
414
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
415
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/sessions/${core.url.encodePathParam(assetId)}/unread`),
416
+ method: "POST",
417
+ headers: _headers,
418
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
419
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
420
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
421
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
422
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
423
+ logging: this._options.logging,
424
+ });
425
+ if (_response.ok) {
426
+ return { data: _response.body, rawResponse: _response.rawResponse };
427
+ }
428
+ if (_response.error.reason === "status-code") {
429
+ switch (_response.error.statusCode) {
430
+ case 401:
431
+ throw new AthenaIntelligence.UnauthorizedError(_response.error.body, _response.rawResponse);
432
+ case 404:
433
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
434
+ case 422:
435
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
436
+ default:
437
+ throw new errors.AthenaIntelligenceError({
438
+ statusCode: _response.error.statusCode,
439
+ body: _response.error.body,
440
+ rawResponse: _response.rawResponse,
441
+ });
442
+ }
443
+ }
444
+ switch (_response.error.reason) {
445
+ case "non-json":
446
+ throw new errors.AthenaIntelligenceError({
447
+ statusCode: _response.error.statusCode,
448
+ body: _response.error.rawBody,
449
+ rawResponse: _response.rawResponse,
450
+ });
451
+ case "body-is-null":
452
+ throw new errors.AthenaIntelligenceError({
453
+ statusCode: _response.error.statusCode,
454
+ rawResponse: _response.rawResponse,
455
+ });
456
+ case "timeout":
457
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/sessions/{asset_id}/unread.");
458
+ case "unknown":
459
+ throw new errors.AthenaIntelligenceError({
460
+ message: _response.error.errorMessage,
461
+ rawResponse: _response.rawResponse,
462
+ });
463
+ }
464
+ });
465
+ }
314
466
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
5
+ * }
6
+ */
7
+ export interface MarkReadSessionsRequest {
8
+ /** Unique identifier of the session asset to mark as read */
9
+ asset_id: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
5
+ * }
6
+ */
7
+ export interface MarkUnreadSessionsRequest {
8
+ /** Unique identifier of the session asset to mark as unread */
9
+ asset_id: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,3 +1,5 @@
1
1
  export type { DownloadSessionsRequest } from "./DownloadSessionsRequest.mjs";
2
2
  export type { GetSessionsRequest } from "./GetSessionsRequest.mjs";
3
3
  export type { ListSessionsRequest } from "./ListSessionsRequest.mjs";
4
+ export type { MarkReadSessionsRequest } from "./MarkReadSessionsRequest.mjs";
5
+ export type { MarkUnreadSessionsRequest } from "./MarkUnreadSessionsRequest.mjs";
@@ -22,6 +22,8 @@ export interface SessionOut {
22
22
  id: string;
23
23
  /** Whether this is a branched sub-session of another session */
24
24
  is_sub_session?: boolean;
25
+ /** Whether the session is unread for the calling user: it changed since they last opened it, or they never opened it and it did not originate from the web app */
26
+ is_unread?: boolean;
25
27
  /** Plain-text preview of the most recent message, when available */
26
28
  last_message_preview?: string | null;
27
29
  /** Model the session ran with, when set */
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.2128";
1
+ export declare const SDK_VERSION = "4.3.2130";
@@ -1 +1 @@
1
- export const SDK_VERSION = "4.3.2128";
1
+ export const SDK_VERSION = "4.3.2130";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenaintel/sdk",
3
- "version": "4.3.2128",
3
+ "version": "4.3.2130",
4
4
  "private": false,
5
5
  "repository": "github:Athena-Intel/athena-typescript",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -3035,6 +3035,136 @@ await client.sessions.download({
3035
3035
  </dl>
3036
3036
 
3037
3037
 
3038
+ </dd>
3039
+ </dl>
3040
+ </details>
3041
+
3042
+ <details><summary><code>client.sessions.<a href="/src/api/resources/sessions/client/Client.ts">markRead</a>({ ...params }) -> AthenaIntelligence.SessionOut</code></summary>
3043
+ <dl>
3044
+ <dd>
3045
+
3046
+ #### 📝 Description
3047
+
3048
+ <dl>
3049
+ <dd>
3050
+
3051
+ <dl>
3052
+ <dd>
3053
+
3054
+ Record that the calling user has read the session as of now, clearing its unread indicator. Idempotent: repeated calls only move the read receipt forward.
3055
+ </dd>
3056
+ </dl>
3057
+ </dd>
3058
+ </dl>
3059
+
3060
+ #### 🔌 Usage
3061
+
3062
+ <dl>
3063
+ <dd>
3064
+
3065
+ <dl>
3066
+ <dd>
3067
+
3068
+ ```typescript
3069
+ await client.sessions.markRead({
3070
+ asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
3071
+ });
3072
+
3073
+ ```
3074
+ </dd>
3075
+ </dl>
3076
+ </dd>
3077
+ </dl>
3078
+
3079
+ #### ⚙️ Parameters
3080
+
3081
+ <dl>
3082
+ <dd>
3083
+
3084
+ <dl>
3085
+ <dd>
3086
+
3087
+ **request:** `AthenaIntelligence.MarkReadSessionsRequest`
3088
+
3089
+ </dd>
3090
+ </dl>
3091
+
3092
+ <dl>
3093
+ <dd>
3094
+
3095
+ **requestOptions:** `SessionsClient.RequestOptions`
3096
+
3097
+ </dd>
3098
+ </dl>
3099
+ </dd>
3100
+ </dl>
3101
+
3102
+
3103
+ </dd>
3104
+ </dl>
3105
+ </details>
3106
+
3107
+ <details><summary><code>client.sessions.<a href="/src/api/resources/sessions/client/Client.ts">markUnread</a>({ ...params }) -> AthenaIntelligence.SessionOut</code></summary>
3108
+ <dl>
3109
+ <dd>
3110
+
3111
+ #### 📝 Description
3112
+
3113
+ <dl>
3114
+ <dd>
3115
+
3116
+ <dl>
3117
+ <dd>
3118
+
3119
+ Clear the calling user's read receipt so the session shows as unread again. Idempotent: repeated calls leave the session unread.
3120
+ </dd>
3121
+ </dl>
3122
+ </dd>
3123
+ </dl>
3124
+
3125
+ #### 🔌 Usage
3126
+
3127
+ <dl>
3128
+ <dd>
3129
+
3130
+ <dl>
3131
+ <dd>
3132
+
3133
+ ```typescript
3134
+ await client.sessions.markUnread({
3135
+ asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
3136
+ });
3137
+
3138
+ ```
3139
+ </dd>
3140
+ </dl>
3141
+ </dd>
3142
+ </dl>
3143
+
3144
+ #### ⚙️ Parameters
3145
+
3146
+ <dl>
3147
+ <dd>
3148
+
3149
+ <dl>
3150
+ <dd>
3151
+
3152
+ **request:** `AthenaIntelligence.MarkUnreadSessionsRequest`
3153
+
3154
+ </dd>
3155
+ </dl>
3156
+
3157
+ <dl>
3158
+ <dd>
3159
+
3160
+ **requestOptions:** `SessionsClient.RequestOptions`
3161
+
3162
+ </dd>
3163
+ </dl>
3164
+ </dd>
3165
+ </dl>
3166
+
3167
+
3038
3168
  </dd>
3039
3169
  </dl>
3040
3170
  </details>