@narrative.io/data-collaboration-sdk-ts 0.0.104 → 0.0.105
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/build/datasets/index.d.ts +11 -1
- package/build/datasets/index.js +12 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ApiRecords } from '../types';
|
|
2
2
|
import { BaseApi } from '../base-api';
|
|
3
|
-
import type { FilePerSnapshotResponse, Dataset, DatasetTableSummaryAPIResponse, ColumnStatistics, RetentionPolicy } from './types';
|
|
3
|
+
import type { FilePerSnapshotResponse, Dataset, DatasetTableSummaryAPIResponse, ColumnStatistics, RetentionPolicy, DatasetTableSummary } from './types';
|
|
4
4
|
export { type FilePerSnapshotResponse, type Dataset, type RetentionPolicy, type DatasetTableSummaryAPIResponse, type ColumnStatistics };
|
|
5
5
|
/**
|
|
6
6
|
* @module DatasetApi
|
|
@@ -82,6 +82,16 @@ export declare class DatasetApi extends BaseApi {
|
|
|
82
82
|
*/
|
|
83
83
|
getColumnStats(datasetId: number): Promise<ColumnStatistics>;
|
|
84
84
|
/**
|
|
85
|
+
* Fetches the summary statistics for a given dataset.
|
|
86
|
+
*
|
|
87
|
+
* @param {number} datasetId - The ID of the dataset to fetch summary statistics for.
|
|
88
|
+
* @returns {Promise<ApiRecords<DatasetTableSummary>>} A Promise that resolves with an object containing the dataset summary statistics.
|
|
89
|
+
* @throws {Error} If there is an issue with the request or the response.
|
|
90
|
+
* @memberof DatasetApi
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
getStatistics(datasetId: number, offset?: number, size?: number): Promise<ApiRecords<DatasetTableSummary>>;
|
|
94
|
+
/**
|
|
85
95
|
* Updates the retention policy of a specific dataset.
|
|
86
96
|
*
|
|
87
97
|
* @param {number} datasetId - The ID of the dataset to update the retention policy for.
|
package/build/datasets/index.js
CHANGED
|
@@ -101,6 +101,18 @@ export class DatasetApi extends BaseApi {
|
|
|
101
101
|
return await this.get(`${resourceName}/${datasetId}/column-stats`);
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
|
+
* Fetches the summary statistics for a given dataset.
|
|
105
|
+
*
|
|
106
|
+
* @param {number} datasetId - The ID of the dataset to fetch summary statistics for.
|
|
107
|
+
* @returns {Promise<ApiRecords<DatasetTableSummary>>} A Promise that resolves with an object containing the dataset summary statistics.
|
|
108
|
+
* @throws {Error} If there is an issue with the request or the response.
|
|
109
|
+
* @memberof DatasetApi
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
async getStatistics(datasetId, offset = 0, size = 1000) {
|
|
113
|
+
return await this.get(`${resourceName}/${datasetId}/stats?offset=${offset}&per_page=${size}`);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
104
116
|
* Updates the retention policy of a specific dataset.
|
|
105
117
|
*
|
|
106
118
|
* @param {number} datasetId - The ID of the dataset to update the retention policy for.
|