@narrative.io/data-collaboration-sdk-ts 0.0.96 → 0.0.98
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,7 +1,7 @@
|
|
|
1
1
|
import { type ApiRecords } from '../types';
|
|
2
2
|
import { BaseApi } from '../base-api';
|
|
3
|
-
import {
|
|
4
|
-
export { type FilePerSnapshotResponse, type Dataset, type DatasetTableSummaryAPIResponse };
|
|
3
|
+
import type { FilePerSnapshotResponse, Dataset, DatasetTableSummaryAPIResponse, ColumnStatistics } from './types';
|
|
4
|
+
export { type FilePerSnapshotResponse, type Dataset, type DatasetTableSummaryAPIResponse, type ColumnStatistics };
|
|
5
5
|
/**
|
|
6
6
|
* @module DatasetApi
|
|
7
7
|
* @description This module provides methods for fetching datasets.
|
|
@@ -71,4 +71,5 @@ export declare class DatasetApi extends BaseApi {
|
|
|
71
71
|
getDatasetFileDownloadUrl(datasetId: number, snapshotId: number, fileId: string): Promise<{
|
|
72
72
|
download_url: string;
|
|
73
73
|
}>;
|
|
74
|
+
getColumnStats(datasetId: number): Promise<ColumnStatistics>;
|
|
74
75
|
}
|
package/build/datasets/index.js
CHANGED
|
@@ -88,4 +88,7 @@ export class DatasetApi extends BaseApi {
|
|
|
88
88
|
async getDatasetFileDownloadUrl(datasetId, snapshotId, fileId) {
|
|
89
89
|
return await this.post(`${resourceName}/${datasetId}/snapshots/${snapshotId}/files-added/${fileId}/download`);
|
|
90
90
|
}
|
|
91
|
+
async getColumnStats(datasetId) {
|
|
92
|
+
return await this.get(`${resourceName}/${datasetId}/column-stats`);
|
|
93
|
+
}
|
|
91
94
|
}
|
|
@@ -41,7 +41,7 @@ export interface DatasetTableSummary {
|
|
|
41
41
|
snapshot_added_delete_files: number;
|
|
42
42
|
snapshot_removed_delete_files: number;
|
|
43
43
|
snapshot_removed_bytes: number;
|
|
44
|
-
|
|
44
|
+
column_summary: DatasetColumnSummary[];
|
|
45
45
|
}
|
|
46
46
|
export interface DatasetTableSummaryAPIResponse {
|
|
47
47
|
dataset_id: number;
|
|
@@ -96,4 +96,61 @@ export interface FilePerSnapshotResponse {
|
|
|
96
96
|
has_next: boolean;
|
|
97
97
|
next_snapshot: number | null;
|
|
98
98
|
}
|
|
99
|
+
export interface ColumnStatistics {
|
|
100
|
+
advanced_statistics_metadata: AdvancedStatisticsMetadata;
|
|
101
|
+
columns_summary: ColumnSummary[];
|
|
102
|
+
}
|
|
103
|
+
interface AdvancedStatisticsMetadata {
|
|
104
|
+
snapshot_range: SnapshotRange;
|
|
105
|
+
configuration: Configuration;
|
|
106
|
+
}
|
|
107
|
+
interface SnapshotRange {
|
|
108
|
+
from_snapshot: string;
|
|
109
|
+
until_snapshot: string;
|
|
110
|
+
from_snapshot_timestamp: string;
|
|
111
|
+
until_snapshot_timestamp: string;
|
|
112
|
+
}
|
|
113
|
+
interface Configuration {
|
|
114
|
+
value_histogram: Columns;
|
|
115
|
+
completeness: Columns;
|
|
116
|
+
approx_count_distinct: Columns;
|
|
117
|
+
count_distinct: Columns;
|
|
118
|
+
observed_types_histogram: Columns;
|
|
119
|
+
mean: Columns;
|
|
120
|
+
deviation: Columns;
|
|
121
|
+
}
|
|
122
|
+
interface Columns {
|
|
123
|
+
columns: string[];
|
|
124
|
+
}
|
|
125
|
+
interface ColumnSummary {
|
|
126
|
+
name: string;
|
|
127
|
+
type: string;
|
|
128
|
+
basic_statistics: BasicStatistics;
|
|
129
|
+
advanced_statistics: AdvancedStatistics;
|
|
130
|
+
}
|
|
131
|
+
interface BasicStatistics {
|
|
132
|
+
nan_value_count: number | null;
|
|
133
|
+
null_value_count: number;
|
|
134
|
+
lower_bound: string | number;
|
|
135
|
+
upper_bound: string | number;
|
|
136
|
+
value_count: number;
|
|
137
|
+
column_store_bytes: number;
|
|
138
|
+
}
|
|
139
|
+
interface AdvancedStatistics {
|
|
140
|
+
approx_count_distinct: number | null;
|
|
141
|
+
count_distinct: null;
|
|
142
|
+
histogram: Histogram | null;
|
|
143
|
+
mean: number | null;
|
|
144
|
+
standard_deviation: number | null;
|
|
145
|
+
completeness: number;
|
|
146
|
+
observed_types: Histogram | null;
|
|
147
|
+
}
|
|
148
|
+
interface Histogram {
|
|
149
|
+
values: Record<string, Value>;
|
|
150
|
+
number_of_bins: number;
|
|
151
|
+
}
|
|
152
|
+
interface Value {
|
|
153
|
+
absolute: number;
|
|
154
|
+
ratio: number;
|
|
155
|
+
}
|
|
99
156
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@narrative.io/data-collaboration-sdk-ts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.98",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"repository": "github:narrative-io/data-collaboration-sdk-ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@commitlint/config-conventional": "^17.4.2",
|
|
28
28
|
"@types/jest": "^29.5.0",
|
|
29
29
|
"babel-jest": "^29.4.3",
|
|
30
|
-
"eslint-config-standard-with-typescript": "^
|
|
30
|
+
"eslint-config-standard-with-typescript": "^37.0.0",
|
|
31
31
|
"husky": "^8.0.0",
|
|
32
32
|
"jest": "^29.4.3",
|
|
33
33
|
"ts-jest": "^29.0.5"
|