@nurama/sdk 1.4.6 → 1.4.7

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/dist/version.js CHANGED
@@ -3,10 +3,10 @@
3
3
  * AUTO-GENERATED by scripts/generate-version-info.cjs - DO NOT EDIT MANUALLY
4
4
  */
5
5
  export const SDK_VERSION = {
6
- version: '1.4.6',
7
- buildTimestamp: '2026-10-30T09:37:39.703Z',
8
- buildHash: '591a47b7ee697e4b2fd756a50b5b647e',
9
- gitCommit: 'e46370d',
6
+ version: '1.4.7',
7
+ buildTimestamp: '2026-11-11T06:13:04.718Z',
8
+ buildHash: '18b104b8bee310a1409fe4e5ca11eb33',
9
+ gitCommit: 'dccf5ca',
10
10
  dirty: false,
11
11
  };
12
12
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nurama/sdk",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "Provides API, web-socket, and additional utilities for interfacing with the Nurama platform.",
5
5
  "main": "dist/NuramaClient.js",
6
6
  "module": "dist/NuramaClient.js",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "jwt-decode": "^4.0.0",
35
35
  "socket.io-client": "^4.7.2",
36
- "@nurama/types": "1.4.6"
36
+ "@nurama/types": "1.4.7"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/jest": "^29.5.14",
@@ -23,7 +23,13 @@ export interface DocumentViewUrlResponse {
23
23
 
24
24
  import NuramaClient from '../NuramaClient.js';
25
25
  import { uploadSessionManager } from '../utils/uploadSessionManager.js';
26
- import { type Asset, type File, type AssetReferences } from '@nurama/types'; // Import Asset and File types
26
+ import {
27
+ type Asset,
28
+ type File,
29
+ type AssetReferences,
30
+ type AssetOriginalStatus,
31
+ type AssetOriginalHistoryEntry,
32
+ } from '@nurama/types';
27
33
 
28
34
  // --- Request Body Interfaces ---
29
35
  export interface UpdateAssetData {
@@ -300,6 +306,80 @@ export default function createAssetMethods(client: NuramaClient) {
300
306
  });
301
307
  },
302
308
 
309
+ /**
310
+ * Where an asset's original is, what the project's pruning policy will do
311
+ * with it, and whether it can be pruned by hand now. Needs `canGetAssetOriginal`.
312
+ * @param {string} assetId - The ID of the asset.
313
+ * @returns {Promise<AssetOriginalStatus>} The original's state.
314
+ */
315
+ async getOriginal(assetId: string): Promise<AssetOriginalStatus> {
316
+ if (!assetId) throw new Error('assetId is required.');
317
+ return client._request<AssetOriginalStatus>({
318
+ method: 'GET',
319
+ endpoint: `/v1/assets/${assetId}/original`,
320
+ sendJWT: true,
321
+ });
322
+ },
323
+
324
+ /**
325
+ * The history of an asset's original, newest first. Needs `canGetAssetOriginal`.
326
+ * @param {string} assetId - The ID of the asset.
327
+ * @returns {Promise<{ results: AssetOriginalHistoryEntry[] }>} The history.
328
+ */
329
+ async getOriginalHistory(assetId: string): Promise<{ results: AssetOriginalHistoryEntry[] }> {
330
+ if (!assetId) throw new Error('assetId is required.');
331
+ return client._request<{ results: AssetOriginalHistoryEntry[] }>({
332
+ method: 'GET',
333
+ endpoint: `/v1/assets/${assetId}/original/history`,
334
+ sendJWT: true,
335
+ });
336
+ },
337
+
338
+ /**
339
+ * Requests that an asset's original be pruned once the undo window has
340
+ * passed (`pruneAfter`). Needs `canPruneAsset`.
341
+ * @param {string} assetId - The ID of the asset.
342
+ * @returns {Promise<Asset>} The asset, now waiting to be pruned.
343
+ */
344
+ async pruneOriginal(assetId: string): Promise<Asset> {
345
+ if (!assetId) throw new Error('assetId is required.');
346
+ return client._request<Asset>({
347
+ method: 'POST',
348
+ endpoint: `/v1/assets/${assetId}/original/prune`,
349
+ sendJWT: true,
350
+ });
351
+ },
352
+
353
+ /**
354
+ * Cancels a requested prune before it runs. Needs `canPruneAsset`.
355
+ * @param {string} assetId - The ID of the asset.
356
+ * @returns {Promise<Asset>} The asset, with its original back to `stored`.
357
+ */
358
+ async cancelPruneOriginal(assetId: string): Promise<Asset> {
359
+ if (!assetId) throw new Error('assetId is required.');
360
+ return client._request<Asset>({
361
+ method: 'DELETE',
362
+ endpoint: `/v1/assets/${assetId}/original/prune`,
363
+ sendJWT: true,
364
+ });
365
+ },
366
+
367
+ /**
368
+ * Exempts an asset from pruning, or lifts the exemption. Needs `canPruneAsset`.
369
+ * @param {string} assetId - The ID of the asset.
370
+ * @param {boolean} keepOriginal - True to exempt the asset.
371
+ * @returns {Promise<Asset>} The asset.
372
+ */
373
+ async setKeepOriginal(assetId: string, keepOriginal: boolean): Promise<Asset> {
374
+ if (!assetId) throw new Error('assetId is required.');
375
+ return client._request<Asset>({
376
+ method: 'PUT',
377
+ endpoint: `/v1/assets/${assetId}/original/keep`,
378
+ body: { keepOriginal },
379
+ sendJWT: true,
380
+ });
381
+ },
382
+
303
383
  /**
304
384
  * Updates an asset.
305
385
  * @param {string} assetId - The ID of the asset to update.
@@ -35,11 +35,12 @@ export default function createProductMethods(client: NuramaClient) {
35
35
  },
36
36
 
37
37
  /**
38
- * List active starter-package "plans" available to the caller,
39
- * scoped by user-level restrictions but NOT bound to a workspace.
40
- * Used by the post-signup plan-selection overlay before any
41
- * workspace exists.
42
- * @returns {Promise<ProductResponse[]>} Active starter-package plans.
38
+ * The base-plan catalogue. Works signed out: without a session it is the
39
+ * public catalogue (active, unrestricted plans). With one it also has the
40
+ * promo plans restricted to the caller (`restricted: true`) and leaves out
41
+ * a Demo they've already used. Plans carry only their public fields —
42
+ * no `restrictTo`, `notes` or payment-provider ids.
43
+ * @returns {Promise<ProductResponse[]>} Base plans available to the caller.
43
44
  */
44
45
  async listPlans(): Promise<ProductResponse[]> {
45
46
  return client._request<ProductResponse[]>({
@@ -20,6 +20,11 @@ import {
20
20
  type ListFeedEventsParams,
21
21
  type CursorPaginatedFeedEvents,
22
22
  type ReadState,
23
+ type AssetPruneSelection,
24
+ type AssetPrunePreview,
25
+ type AssetPruneRequestResult,
26
+ type AssetPruneCancelResult,
27
+ type ProjectPruningSummary,
23
28
  } from '@nurama/types';
24
29
 
25
30
  // Combine pagination metadata with a results array
@@ -1600,5 +1605,69 @@ export default function createProjectMethods(client: NuramaClient) {
1600
1605
  sendJWT: true,
1601
1606
  });
1602
1607
  },
1608
+
1609
+ /**
1610
+ * What pruning the originals of a selection of the project's assets would
1611
+ * do, without doing it. Needs `canPruneAsset` on the project.
1612
+ * @param {string} projectId - The project ID.
1613
+ * @param {AssetPruneSelection} selection - Asset ids, creator-tree paths, or both.
1614
+ * @returns {Promise<AssetPrunePreview>} Each asset's eligibility, and the totals.
1615
+ */
1616
+ async previewPruneOriginals(projectId: string, selection: AssetPruneSelection): Promise<AssetPrunePreview> {
1617
+ if (!projectId) throw new Error('projectId is required.');
1618
+ return client._request<AssetPrunePreview>({
1619
+ method: 'POST',
1620
+ endpoint: `/v1/projects/${projectId}/original-pruning/preview`,
1621
+ body: selection,
1622
+ sendJWT: true,
1623
+ });
1624
+ },
1625
+
1626
+ /**
1627
+ * Requests prunes for every asset in the selection that can be pruned.
1628
+ * Needs `canPruneAsset` on the project.
1629
+ * @param {string} projectId - The project ID.
1630
+ * @param {AssetPruneSelection} selection - Asset ids, creator-tree paths, or both.
1631
+ * @returns {Promise<AssetPruneRequestResult>} The requested and skipped assets.
1632
+ */
1633
+ async pruneOriginals(projectId: string, selection: AssetPruneSelection): Promise<AssetPruneRequestResult> {
1634
+ if (!projectId) throw new Error('projectId is required.');
1635
+ return client._request<AssetPruneRequestResult>({
1636
+ method: 'POST',
1637
+ endpoint: `/v1/projects/${projectId}/original-pruning/prune`,
1638
+ body: selection,
1639
+ sendJWT: true,
1640
+ });
1641
+ },
1642
+
1643
+ /**
1644
+ * Cancels every waiting prune in the selection. Needs `canPruneAsset` on the project.
1645
+ * @param {string} projectId - The project ID.
1646
+ * @param {AssetPruneSelection} selection - Asset ids, creator-tree paths, or both.
1647
+ * @returns {Promise<AssetPruneCancelResult>} The cancelled assets, and those with nothing waiting.
1648
+ */
1649
+ async cancelPruneOriginals(projectId: string, selection: AssetPruneSelection): Promise<AssetPruneCancelResult> {
1650
+ if (!projectId) throw new Error('projectId is required.');
1651
+ return client._request<AssetPruneCancelResult>({
1652
+ method: 'POST',
1653
+ endpoint: `/v1/projects/${projectId}/original-pruning/cancel`,
1654
+ body: selection,
1655
+ sendJWT: true,
1656
+ });
1657
+ },
1658
+
1659
+ /**
1660
+ * The project's pruning policy and what it has done. Needs `canManageProjectSettings`.
1661
+ * @param {string} projectId - The project ID.
1662
+ * @returns {Promise<ProjectPruningSummary>} The summary.
1663
+ */
1664
+ async getOriginalPruningSummary(projectId: string): Promise<ProjectPruningSummary> {
1665
+ if (!projectId) throw new Error('projectId is required.');
1666
+ return client._request<ProjectPruningSummary>({
1667
+ method: 'GET',
1668
+ endpoint: `/v1/projects/${projectId}/original-pruning/summary`,
1669
+ sendJWT: true,
1670
+ });
1671
+ },
1603
1672
  };
1604
1673
  }
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.6',
18
- buildTimestamp: '2026-10-30T09:37:39.703Z',
19
- buildHash: '591a47b7ee697e4b2fd756a50b5b647e',
20
- gitCommit: 'e46370d',
17
+ version: '1.4.7',
18
+ buildTimestamp: '2026-11-11T06:13:04.718Z',
19
+ buildHash: '18b104b8bee310a1409fe4e5ca11eb33',
20
+ gitCommit: 'dccf5ca',
21
21
  dirty: false,
22
22
  };