@narrative.io/data-collaboration-sdk-ts 0.0.108 → 0.0.110

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.
@@ -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, DatasetTableSummary } from "./types";
3
+ import type { FilePerSnapshotResponse, Dataset, DatasetTableSummaryAPIResponse, ColumnStatistics, RetentionPolicy, DatasetTableSummary, RecalculationInfo } from "./types";
4
4
  export { type FilePerSnapshotResponse, type Dataset, type RetentionPolicy, type DatasetTableSummaryAPIResponse, type ColumnStatistics, };
5
5
  /**
6
6
  * @module DatasetApi
@@ -102,4 +102,20 @@ export declare class DatasetApi extends BaseApi {
102
102
  * @public
103
103
  */
104
104
  updateRetentionPolicy(datasetId: number, policy: RetentionPolicy): Promise<Dataset>;
105
+ /**
106
+ * Configures the statistics for a specific dataset column.
107
+ * This method sends a PUT request to the specified endpoint to update the statistics configuration.
108
+ *
109
+ * @param {number} datasetId - The ID of the dataset whose column statistics need to be configured.
110
+ * @returns {Promise<void>} A promise that resolves when the operation is complete.
111
+ */
112
+ configureDatasetColumnStatistics(datasetId: number): Promise<void>;
113
+ /**
114
+ * Initiates a recalculation of the column statistics for a specific dataset.
115
+ * This method sends a POST request to the specified endpoint to start the recalculation process.
116
+ *
117
+ * @param {number} datasetId - The ID of the dataset whose column statistics need to be recalculated.
118
+ * @returns {Promise<RecalculationInfo>} A promise that resolves when the operation is complete.
119
+ */
120
+ recalculateDatasetColumnStatistics(datasetId: number): Promise<RecalculationInfo>;
105
121
  }
@@ -125,4 +125,24 @@ export class DatasetApi extends BaseApi {
125
125
  async updateRetentionPolicy(datasetId, policy) {
126
126
  return await this.put(`${resourceName}/${datasetId}/retention-policy`, policy);
127
127
  }
128
+ /**
129
+ * Configures the statistics for a specific dataset column.
130
+ * This method sends a PUT request to the specified endpoint to update the statistics configuration.
131
+ *
132
+ * @param {number} datasetId - The ID of the dataset whose column statistics need to be configured.
133
+ * @returns {Promise<void>} A promise that resolves when the operation is complete.
134
+ */
135
+ async configureDatasetColumnStatistics(datasetId) {
136
+ await this.put(`${resourceName}/${datasetId}/derive-stats-config`, {});
137
+ }
138
+ /**
139
+ * Initiates a recalculation of the column statistics for a specific dataset.
140
+ * This method sends a POST request to the specified endpoint to start the recalculation process.
141
+ *
142
+ * @param {number} datasetId - The ID of the dataset whose column statistics need to be recalculated.
143
+ * @returns {Promise<RecalculationInfo>} A promise that resolves when the operation is complete.
144
+ */
145
+ async recalculateDatasetColumnStatistics(datasetId) {
146
+ return await this.post(`${resourceName}/${datasetId}/column-stats/recalculate`, {});
147
+ }
128
148
  }
@@ -15,6 +15,12 @@ export interface Dataset {
15
15
  active_dataset_stored_bytes?: number;
16
16
  mappings?: Mapping[];
17
17
  }
18
+ export interface RecalculationInfo {
19
+ recalculation_id: string;
20
+ snapshots: string[];
21
+ from_snapshot_timestamp: string;
22
+ until_snapshot_timestamp: string;
23
+ }
18
24
  export interface DatasetColumnSummary {
19
25
  id: number;
20
26
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "0.0.108",
3
+ "version": "0.0.110",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",