@nurama/sdk 1.4.3 → 1.4.5

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.
@@ -19,6 +19,7 @@ import {
19
19
  type FeedVisibility,
20
20
  type ListFeedEventsParams,
21
21
  type CursorPaginatedFeedEvents,
22
+ type ReadState,
22
23
  } from '@nurama/types';
23
24
 
24
25
  // Combine pagination metadata with a results array
@@ -597,6 +598,44 @@ export default function createProjectMethods(client: NuramaClient) {
597
598
  });
598
599
  },
599
600
 
601
+ /**
602
+ * Gets where you had read up to in a project feed, and how many cards have
603
+ * moved since. `lastReadAt` is null if you have never recorded a position,
604
+ * and `unreadCount` is 0 then. Cards you are the actor on never count.
605
+ * @param {string} projectId - The ID of the project.
606
+ * @param {'creator' | 'reviewer'} visibility - Which feed to read.
607
+ * @returns {Promise<ReadState>} Your reading position in that feed.
608
+ */
609
+ async getFeedReadState(projectId: string, visibility: FeedVisibility): Promise<ReadState> {
610
+ if (!projectId) throw new Error('projectId is required.');
611
+ if (!visibility) throw new Error('visibility is required (creator or reviewer).');
612
+
613
+ return client._request<ReadState>({
614
+ method: 'GET',
615
+ endpoint: `/v1/projects/${projectId}/feed-events/${visibility}/read-state`,
616
+ sendJWT: true,
617
+ });
618
+ },
619
+
620
+ /**
621
+ * Marks a project feed as caught up. Pass `lastReadAt` (epoch ms) to catch
622
+ * up to the newest card you had loaded; omit it to catch up to now. The
623
+ * marker only moves forward and never past the present, so a stale value is
624
+ * a no-op rather than an error.
625
+ * @returns {Promise<ReadState>} Your updated reading position.
626
+ */
627
+ async markFeedCaughtUp(projectId: string, visibility: FeedVisibility, lastReadAt?: number): Promise<ReadState> {
628
+ if (!projectId) throw new Error('projectId is required.');
629
+ if (!visibility) throw new Error('visibility is required (creator or reviewer).');
630
+
631
+ return client._request<ReadState>({
632
+ method: 'POST',
633
+ endpoint: `/v1/projects/${projectId}/feed-events/${visibility}/read-state`,
634
+ body: lastReadAt === undefined ? {} : { lastReadAt },
635
+ sendJWT: true,
636
+ });
637
+ },
638
+
600
639
  // --- Folder Listing ---
601
640
 
602
641
  /**
@@ -28,6 +28,8 @@ export interface GetTasksBaseParams extends SortParams {
28
28
  relatedToId?: string;
29
29
  visibility?: TaskVisibility;
30
30
  acknowledged?: boolean;
31
+ /** `'chatMessage'` returns only mention-tasks; without it, board tasks assigned to you come too. */
32
+ originType?: 'chatMessage';
31
33
  limit?: number;
32
34
  }
33
35
 
@@ -223,31 +225,29 @@ export default function createTaskMethods(client: NuramaClient) {
223
225
  },
224
226
 
225
227
  /**
226
- * Retrieves the count of unacknowledged tasks for the current user within a specific project.
227
- * Requires authentication.
228
- * @param {string} projectId - The ID of the project.
228
+ * Retrieves the count of unacknowledged tasks for the current user within a specific project,
229
+ * or across every project when none is given. Requires authentication.
230
+ * @param {string} [projectId] - The ID of the project; omit for every project.
229
231
  * @returns {Promise<UnacknowledgedTaskCountResponse>} An object containing total, creator, and reviewer unacknowledged task counts.
230
232
  */
231
- async getUnacknowledgedTaskCount(projectId: string): Promise<UnacknowledgedTaskCountResponse> {
232
- if (!projectId) throw new Error('projectId is required.');
233
+ async getUnacknowledgedTaskCount(projectId?: string): Promise<UnacknowledgedTaskCountResponse> {
233
234
  return client._request<UnacknowledgedTaskCountResponse>({
234
235
  method: 'GET',
235
- endpoint: `/v1/tasks/unacknowledged/${projectId}`,
236
+ endpoint: projectId ? `/v1/tasks/unacknowledged/${projectId}` : '/v1/tasks/unacknowledged',
236
237
  sendJWT: true,
237
238
  });
238
239
  },
239
240
 
240
241
  /**
241
242
  * Acknowledge every unacknowledged mention-task the current user has in a
242
- * project. Idempotent server-side.
243
- * @param {string} projectId - The ID of the project.
243
+ * project, or in every project when none is given. Idempotent server-side.
244
+ * @param {string} [projectId] - The ID of the project; omit for every project.
244
245
  * @returns {Promise<AcknowledgeAllTasksResponse>} The number acknowledged and the remaining unacknowledged count.
245
246
  */
246
- async acknowledgeAllTasks(projectId: string): Promise<AcknowledgeAllTasksResponse> {
247
- if (!projectId) throw new Error('projectId is required.');
247
+ async acknowledgeAllTasks(projectId?: string): Promise<AcknowledgeAllTasksResponse> {
248
248
  return client._request<AcknowledgeAllTasksResponse>({
249
249
  method: 'PUT',
250
- endpoint: `/v1/tasks/acknowledge-all/${projectId}`,
250
+ endpoint: projectId ? `/v1/tasks/acknowledge-all/${projectId}` : '/v1/tasks/acknowledge-all',
251
251
  sendJWT: true,
252
252
  });
253
253
  },
@@ -0,0 +1,113 @@
1
+ import NuramaClient from '../NuramaClient.js';
2
+ import {
3
+ type ObjectId,
4
+ type ReadState,
5
+ type ListUserFeedParams,
6
+ type CursorPaginatedUserFeed,
7
+ type UserFeedEntry,
8
+ type UserFeedSummary,
9
+ } from '@nurama/types';
10
+
11
+ /**
12
+ * Defines the methods for the caller's own cross-project feed: project
13
+ * activity from every project they can read, and the things waiting on them.
14
+ * Every call is scoped to the signed-in user.
15
+ * @param {NuramaClient} client - The NuramaClient instance.
16
+ * @returns {object} An object containing the user feed methods.
17
+ */
18
+ export default function createUserFeedMethods(client: NuramaClient) {
19
+ return {
20
+ /**
21
+ * Gets one page of your feed, most recent first. Pass `category` for only
22
+ * project activity or only action items; dismissed items are left out
23
+ * unless `states` asks for them.
24
+ * @returns {Promise<CursorPaginatedUserFeed>}
25
+ */
26
+ async getFeed(params?: ListUserFeedParams): Promise<CursorPaginatedUserFeed> {
27
+ return client._request<CursorPaginatedUserFeed>({
28
+ method: 'GET',
29
+ endpoint: '/v1/users/feed',
30
+ params,
31
+ sendJWT: true,
32
+ });
33
+ },
34
+
35
+ /**
36
+ * Gets every badge the app shows: open action items, project activity since
37
+ * you last caught up, and that activity broken down by project in
38
+ * `byProject` — one row per project with something new, for the badge on
39
+ * its icon. The two totals stop at 100.
40
+ *
41
+ * The totals and `byProject` move independently: the totals are measured
42
+ * against your feed-wide marker, each `byProject` row against that
43
+ * project's own. So catching up in the feed does not clear project badges,
44
+ * and reading one project does not clear the feed's own count.
45
+ * @returns {Promise<UserFeedSummary>}
46
+ */
47
+ async getSummary(): Promise<UserFeedSummary> {
48
+ return client._request<UserFeedSummary>({
49
+ method: 'GET',
50
+ endpoint: '/v1/users/feed/summary',
51
+ sendJWT: true,
52
+ });
53
+ },
54
+
55
+ /**
56
+ * Gets your reading position in your feed's project activity.
57
+ * @returns {Promise<ReadState>}
58
+ */
59
+ async getReadState(): Promise<ReadState> {
60
+ return client._request<ReadState>({
61
+ method: 'GET',
62
+ endpoint: '/v1/users/feed/read-state',
63
+ sendJWT: true,
64
+ });
65
+ },
66
+
67
+ /**
68
+ * Marks your feed's project activity as caught up. Pass `lastReadAt`
69
+ * (epoch ms) to catch up to the newest card you had loaded; omit it to
70
+ * catch up to now. The marker only moves forward.
71
+ * @returns {Promise<ReadState>}
72
+ */
73
+ async markCaughtUp(lastReadAt?: number): Promise<ReadState> {
74
+ return client._request<ReadState>({
75
+ method: 'POST',
76
+ endpoint: '/v1/users/feed/read-state',
77
+ body: lastReadAt === undefined ? {} : { lastReadAt },
78
+ sendJWT: true,
79
+ });
80
+ },
81
+
82
+ /**
83
+ * Clears one of your action items (`dismissed`), or brings a cleared one
84
+ * back (`open`).
85
+ * @returns {Promise<UserFeedEntry>} The updated item.
86
+ */
87
+ async setEntryState(entryId: ObjectId, state: 'dismissed' | 'open'): Promise<UserFeedEntry> {
88
+ if (!entryId) throw new Error('entryId is required.');
89
+
90
+ return client._request<UserFeedEntry>({
91
+ method: 'PATCH',
92
+ endpoint: `/v1/users/feed/${entryId}`,
93
+ body: { state },
94
+ sendJWT: true,
95
+ });
96
+ },
97
+
98
+ /**
99
+ * Clears every open action item up to `before` (epoch ms) — the newest one
100
+ * you had loaded — so one that arrived since stays. Omit it to clear
101
+ * everything open now.
102
+ * @returns {Promise<{ dismissed: number }>}
103
+ */
104
+ async dismissAll(before?: number): Promise<{ dismissed: number }> {
105
+ return client._request<{ dismissed: number }>({
106
+ method: 'POST',
107
+ endpoint: '/v1/users/feed/dismiss',
108
+ body: before === undefined ? {} : { before },
109
+ sendJWT: true,
110
+ });
111
+ },
112
+ };
113
+ }
package/src/version.ts CHANGED
@@ -14,9 +14,9 @@ export interface SDKVersionInfo {
14
14
  }
15
15
 
16
16
  export const SDK_VERSION: SDKVersionInfo = {
17
- version: '1.4.3',
18
- buildTimestamp: '2026-10-14T13:35:12.378Z',
19
- buildHash: 'df74c9b4b055b19a9012e0c265c3b94f',
20
- gitCommit: 'b66adea',
17
+ version: '1.4.5',
18
+ buildTimestamp: '2026-10-29T06:59:31.498Z',
19
+ buildHash: 'b0bbfd265120e5fd826237cc63c5bf7d',
20
+ gitCommit: '9307f8f',
21
21
  dirty: false,
22
22
  };