@nurama/sdk 1.4.4 → 1.4.6
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 +7 -7
- package/dist/browser/nurama-bot-sdk.js +37 -4
- package/dist/browser/nurama-bot-sdk.min.js +1 -1
- package/dist/browser/nurama-sdk.js +37 -4
- package/dist/browser/nurama-sdk.min.js +1 -1
- package/dist/routes/project.d.ts +16 -0
- package/dist/routes/project.d.ts.map +1 -1
- package/dist/routes/project.js +37 -0
- package/dist/routes/project.js.map +1 -1
- package/dist/version.js +4 -4
- package/package.json +2 -2
- package/src/routes/project.ts +37 -0
- package/src/version.ts +4 -4
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Provides API, web-socket, and additional utilities for interfacing with the Nura
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install nurama
|
|
8
|
+
npm install @nurama/sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
@@ -13,7 +13,7 @@ npm install nurama-sdk
|
|
|
13
13
|
### Basic API Usage
|
|
14
14
|
|
|
15
15
|
```javascript
|
|
16
|
-
import NuramaClient from 'nurama
|
|
16
|
+
import NuramaClient from '@nurama/sdk';
|
|
17
17
|
|
|
18
18
|
// Create client instance
|
|
19
19
|
const client = new NuramaClient('https://api.nurama.com', {
|
|
@@ -36,7 +36,7 @@ console.log(workspaces);
|
|
|
36
36
|
The SDK provides WebSocket functionality for real-time notifications and events. Socket.IO is used under the hood, which handles protocol conversion automatically.
|
|
37
37
|
|
|
38
38
|
```javascript
|
|
39
|
-
import NuramaClient from 'nurama
|
|
39
|
+
import NuramaClient from '@nurama/sdk';
|
|
40
40
|
|
|
41
41
|
// Create client instance with a separate WebSocket server URL if needed
|
|
42
42
|
const client = new NuramaClient('https://api.nurama.com', {
|
|
@@ -185,7 +185,7 @@ The `NuramaClient` constructor accepts various options for customization:
|
|
|
185
185
|
|
|
186
186
|
```javascript
|
|
187
187
|
// Import the client
|
|
188
|
-
import NuramaClient from 'nurama
|
|
188
|
+
import NuramaClient from '@nurama/sdk';
|
|
189
189
|
|
|
190
190
|
// Initialize with options
|
|
191
191
|
const nurama = new NuramaClient('https://api.nurama.com', {
|
|
@@ -668,7 +668,7 @@ await client.notification.getNotifications({
|
|
|
668
668
|
The URL parameter utility can also be used independently:
|
|
669
669
|
|
|
670
670
|
```javascript
|
|
671
|
-
import { parseUrlParams, paramsToUrlSearchParams } from 'nurama
|
|
671
|
+
import { parseUrlParams, paramsToUrlSearchParams } from '@nurama/sdk/utils/urlParams';
|
|
672
672
|
|
|
673
673
|
// Convert parameters to string record
|
|
674
674
|
const stringParams = parseUrlParams({
|
|
@@ -691,7 +691,7 @@ console.log(urlParams.toString()); // "page=1&limit=10&active=true"
|
|
|
691
691
|
The utility supports configuration options (though the defaults work well for the Nurama API):
|
|
692
692
|
|
|
693
693
|
```javascript
|
|
694
|
-
import { parseUrlParams } from 'nurama
|
|
694
|
+
import { parseUrlParams } from '@nurama/sdk/utils/urlParams';
|
|
695
695
|
|
|
696
696
|
const result = parseUrlParams(params, {
|
|
697
697
|
arrayFormat: 'comma', // 'comma' or 'brackets' (key[]=val1&key[]=val2)
|
|
@@ -983,7 +983,7 @@ console.log('Git Commit:', versionInfo.gitCommit);
|
|
|
983
983
|
**TypeScript Type:**
|
|
984
984
|
|
|
985
985
|
```typescript
|
|
986
|
-
import { type SDKVersionInfo } from 'nurama
|
|
986
|
+
import { type SDKVersionInfo } from '@nurama/sdk';
|
|
987
987
|
|
|
988
988
|
interface SDKVersionInfo {
|
|
989
989
|
version: string; // Semantic version (e.g., "1.3.3")
|
|
@@ -5973,6 +5973,39 @@
|
|
|
5973
5973
|
sendJWT: true
|
|
5974
5974
|
});
|
|
5975
5975
|
},
|
|
5976
|
+
/**
|
|
5977
|
+
* Gets your reading position in a project's highlights: when you last
|
|
5978
|
+
* caught up, and how many messages others have highlighted since. If you
|
|
5979
|
+
* have never caught up, it counts from when read tracking began.
|
|
5980
|
+
* @param {string} projectId - The project ID.
|
|
5981
|
+
* @param {'creator' | 'reviewer'} visibility - Which highlights.
|
|
5982
|
+
* @returns {Promise<ReadState>} Your reading position.
|
|
5983
|
+
*/
|
|
5984
|
+
async getHighlightsReadState(projectId, visibility) {
|
|
5985
|
+
if (!projectId) throw new Error("projectId is required.");
|
|
5986
|
+
if (!visibility) throw new Error("visibility is required.");
|
|
5987
|
+
return client._request({
|
|
5988
|
+
method: "GET",
|
|
5989
|
+
endpoint: `/v1/projects/${projectId}/${visibility}/highlighted-messages/read-state`,
|
|
5990
|
+
sendJWT: true
|
|
5991
|
+
});
|
|
5992
|
+
},
|
|
5993
|
+
/**
|
|
5994
|
+
* Marks a project's highlights as read. Pass `lastReadAt` (epoch ms) — the
|
|
5995
|
+
* `highlightedAt` of the newest highlight you had loaded; omit it to catch
|
|
5996
|
+
* up to now. The marker only moves forward and never past the present.
|
|
5997
|
+
* @returns {Promise<ReadState>} Your updated reading position.
|
|
5998
|
+
*/
|
|
5999
|
+
async markHighlightsCaughtUp(projectId, visibility, lastReadAt) {
|
|
6000
|
+
if (!projectId) throw new Error("projectId is required.");
|
|
6001
|
+
if (!visibility) throw new Error("visibility is required.");
|
|
6002
|
+
return client._request({
|
|
6003
|
+
method: "POST",
|
|
6004
|
+
endpoint: `/v1/projects/${projectId}/${visibility}/highlighted-messages/read-state`,
|
|
6005
|
+
body: lastReadAt === void 0 ? {} : { lastReadAt },
|
|
6006
|
+
sendJWT: true
|
|
6007
|
+
});
|
|
6008
|
+
},
|
|
5976
6009
|
/**
|
|
5977
6010
|
* Top-N assets in a project by access-activity event type (plays, downloads, embeds).
|
|
5978
6011
|
* Requires project read access. Returns asset IDs and counts only; hydrate names and
|
|
@@ -11556,10 +11589,10 @@
|
|
|
11556
11589
|
|
|
11557
11590
|
// src/version.ts
|
|
11558
11591
|
var SDK_VERSION = {
|
|
11559
|
-
version: "1.4.
|
|
11560
|
-
buildTimestamp: "2026-10-
|
|
11561
|
-
buildHash: "
|
|
11562
|
-
gitCommit: "
|
|
11592
|
+
version: "1.4.6",
|
|
11593
|
+
buildTimestamp: "2026-10-30T09:37:39.703Z",
|
|
11594
|
+
buildHash: "591a47b7ee697e4b2fd756a50b5b647e",
|
|
11595
|
+
gitCommit: "e46370d",
|
|
11563
11596
|
dirty: false
|
|
11564
11597
|
};
|
|
11565
11598
|
|