@narrative.io/data-collaboration-sdk-ts 0.0.107 → 0.0.109
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/access-rules/index.d.ts +44 -0
- package/build/access-rules/index.js +51 -0
- package/build/access-rules/types.d.ts +29 -0
- package/build/access-rules/types.js +1 -0
- package/build/apps/index.d.ts +3 -3
- package/build/apps/index.js +4 -4
- package/build/apps/types.d.ts +1 -1
- package/build/apps/types.js +0 -1
- package/build/attributes/index.d.ts +9 -9
- package/build/attributes/index.js +8 -8
- package/build/attributes/types.d.ts +5 -5
- package/build/authentication/index.d.ts +3 -3
- package/build/authentication/index.js +3 -3
- package/build/authentication/types.d.ts +3 -3
- package/build/base-api.d.ts +42 -42
- package/build/base-api.js +51 -51
- package/build/company-info/index.d.ts +3 -3
- package/build/company-info/index.js +2 -2
- package/build/contracts/index.d.ts +18 -18
- package/build/contracts/index.js +18 -18
- package/build/contracts/types.d.ts +3 -3
- package/build/data-streams/index.d.ts +10 -10
- package/build/data-streams/index.js +9 -9
- package/build/data-streams/types.d.ts +7 -7
- package/build/datasets/index.d.ts +46 -30
- package/build/datasets/index.js +52 -32
- package/build/datasets/types.d.ts +15 -9
- package/build/forecast/index.d.ts +3 -3
- package/build/forecast/index.js +3 -3
- package/build/forecast/types.d.ts +7 -7
- package/build/health/index.d.ts +2 -2
- package/build/health/index.js +2 -2
- package/build/health/types.d.ts +1 -1
- package/build/index.d.ts +32 -31
- package/build/index.js +44 -24
- package/build/installations/index.d.ts +3 -3
- package/build/installations/index.js +3 -3
- package/build/installations/types.d.ts +1 -1
- package/build/mappings/index.d.ts +16 -16
- package/build/mappings/index.js +18 -18
- package/build/mappings/types.d.ts +6 -6
- package/build/nql/DataRulesConverter.d.ts +3 -3
- package/build/nql/DataRulesConverter.js +55 -31
- package/build/nql/NQLParser.d.ts +4 -4
- package/build/nql/NQLParser.js +74 -57
- package/build/nql/SubstraitParser.d.ts +173 -173
- package/build/nql/SubstraitParser.js +270 -261
- package/build/nql/index.d.ts +4 -4
- package/build/nql/index.js +3 -3
- package/build/nql/types.d.ts +6 -6
- package/build/nql/types.js +59 -29
- package/build/ping/index.d.ts +2 -2
- package/build/ping/index.js +2 -2
- package/build/ping/types.d.ts +1 -1
- package/build/products/index.d.ts +6 -6
- package/build/products/index.js +6 -6
- package/build/products/types.d.ts +4 -4
- package/build/resources/index.d.ts +4 -4
- package/build/resources/index.js +2 -2
- package/build/resources/types.d.ts +3 -3
- package/build/rosetta/types.d.ts +12 -12
- package/build/rosetta/types.js +69 -42
- package/build/rosetta-stone/index.d.ts +3 -3
- package/build/rosetta-stone/index.js +3 -3
- package/build/types.d.ts +2 -2
- package/build/uploads/index.d.ts +8 -8
- package/build/uploads/index.js +8 -8
- package/build/utils.js +1 -1
- package/package.json +3 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { BaseApi } from
|
|
2
|
-
import { type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView } from
|
|
1
|
+
import { BaseApi } from "../base-api";
|
|
2
|
+
import { type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* A class for accessing the Contracts API.
|
|
5
5
|
* @extends BaseApi
|
|
6
6
|
*/
|
|
7
7
|
declare class ContractsApi extends BaseApi {
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
* Gets a list of contracts from the API.
|
|
10
|
+
*
|
|
11
|
+
* @returns {Promise<CustomerContract[]>} A promise that resolves with the list of contracts.
|
|
12
|
+
*/
|
|
13
13
|
getContracts(): Promise<ContractDetails[]>;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
* Get a customer contract based on the contract ID
|
|
16
|
+
*
|
|
17
|
+
* @param contractId - ID of the customer contract
|
|
18
|
+
* @returns Promise that resolves to the customer contract
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
21
|
getContract(contractId: string): Promise<ContractDetails>;
|
|
22
22
|
/**
|
|
23
23
|
* Update a customer contract's payment method based on the contract ID
|
|
@@ -29,11 +29,11 @@ declare class ContractsApi extends BaseApi {
|
|
|
29
29
|
*/
|
|
30
30
|
updatePaymentMethod(contractId: string, paymentMethod: PaymentMethod): Promise<ContractDetails>;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
* Get the active contract for a company
|
|
33
|
+
*
|
|
34
|
+
* @returns Promise that resolves to the customer contract
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
37
|
getActiveContract(): Promise<ContractDetails>;
|
|
38
38
|
}
|
|
39
|
-
export { ContractsApi, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView };
|
|
39
|
+
export { ContractsApi, type ContractDetails, type CustomerContract, type PaymentMethod, type ContractRateView, };
|
package/build/contracts/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { BaseApi } from
|
|
1
|
+
import { BaseApi } from "../base-api";
|
|
2
2
|
/**
|
|
3
3
|
* The name of the resource to be used in API requests.
|
|
4
4
|
* @constant
|
|
5
5
|
* @private
|
|
6
6
|
* @type {string}
|
|
7
7
|
*/
|
|
8
|
-
const resourceName =
|
|
8
|
+
const resourceName = "contracts";
|
|
9
9
|
/**
|
|
10
10
|
* A class for accessing the Contracts API.
|
|
11
11
|
* @extends BaseApi
|
|
12
12
|
*/
|
|
13
13
|
class ContractsApi extends BaseApi {
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
* Gets a list of contracts from the API.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Promise<CustomerContract[]>} A promise that resolves with the list of contracts.
|
|
18
|
+
*/
|
|
19
19
|
async getContracts() {
|
|
20
20
|
return await this.get(resourceName);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
* Get a customer contract based on the contract ID
|
|
24
|
+
*
|
|
25
|
+
* @param contractId - ID of the customer contract
|
|
26
|
+
* @returns Promise that resolves to the customer contract
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
29
|
async getContract(contractId) {
|
|
30
30
|
return await this.get(`${resourceName}/${contractId}`);
|
|
31
31
|
}
|
|
@@ -41,13 +41,13 @@ class ContractsApi extends BaseApi {
|
|
|
41
41
|
return await this.put(`${resourceName}/${contractId}`, paymentMethod);
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
* Get the active contract for a company
|
|
45
|
+
*
|
|
46
|
+
* @returns Promise that resolves to the customer contract
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
49
|
async getActiveContract() {
|
|
50
50
|
return await this.get(`${resourceName}/active`);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
export { ContractsApi };
|
|
53
|
+
export { ContractsApi, };
|
|
@@ -16,7 +16,7 @@ export interface CustomerContract {
|
|
|
16
16
|
updated_at: string;
|
|
17
17
|
}
|
|
18
18
|
export interface PaymentMethod {
|
|
19
|
-
type:
|
|
19
|
+
type: "credit_card" | "invoice";
|
|
20
20
|
}
|
|
21
21
|
export interface ContractRateView {
|
|
22
22
|
rate?: Rate;
|
|
@@ -30,7 +30,7 @@ export interface Rate {
|
|
|
30
30
|
type: RateType;
|
|
31
31
|
unit_price: UnitPrice;
|
|
32
32
|
}
|
|
33
|
-
export type RateType =
|
|
33
|
+
export type RateType = "per_unit" | "percent_of_gmv";
|
|
34
34
|
export interface UnitPrice {
|
|
35
35
|
value: number;
|
|
36
36
|
expressed_in: string;
|
|
@@ -45,4 +45,4 @@ export interface ProductView {
|
|
|
45
45
|
unit?: string;
|
|
46
46
|
status?: ProductStatus;
|
|
47
47
|
}
|
|
48
|
-
export type ProductStatus =
|
|
48
|
+
export type ProductStatus = "active" | "archived";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ApiRecords } from
|
|
2
|
-
import { BaseApi } from
|
|
3
|
-
import { type DataStream, type DataRules, type ColumnSet, type ColumnWithFilterAndExport, type AttributeSet } from
|
|
1
|
+
import { type ApiRecords } from "../types";
|
|
2
|
+
import { BaseApi } from "../base-api";
|
|
3
|
+
import { type DataStream, type DataRules, type ColumnSet, type ColumnWithFilterAndExport, type AttributeSet } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* @module DataStreamsApi
|
|
6
6
|
* @description This module provides methods for interacting with Data Streams.
|
|
@@ -15,13 +15,13 @@ declare class DataStreamsApi extends BaseApi {
|
|
|
15
15
|
*/
|
|
16
16
|
getDataStreamsForDSM(searchTerm: string, authenticated: boolean): Promise<ApiRecords<DataStream>>;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
* Gets a single Data Stream given a slug and companyId.
|
|
19
|
+
*
|
|
20
|
+
* @param {number} slug - The slug for the Data Stream to return.
|
|
21
|
+
* @param {number} companyId - The companyId for the Data Stream to return.
|
|
22
|
+
* @returns {Promise<DataStream>} A promise that resolves with the Data Stream.
|
|
23
|
+
*/
|
|
24
24
|
getDataStreamBySlug(slug: string, companyId: number, authenticated: boolean): Promise<DataStream>;
|
|
25
25
|
private getBaseUri;
|
|
26
26
|
}
|
|
27
|
-
export { DataStreamsApi, type DataRules, type ColumnSet, type ColumnWithFilterAndExport, type AttributeSet, type DataStream };
|
|
27
|
+
export { DataStreamsApi, type DataRules, type ColumnSet, type ColumnWithFilterAndExport, type AttributeSet, type DataStream, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseApi } from
|
|
2
|
-
const resourceName =
|
|
1
|
+
import { BaseApi } from "../base-api";
|
|
2
|
+
const resourceName = "data-stream";
|
|
3
3
|
/**
|
|
4
4
|
* @module DataStreamsApi
|
|
5
5
|
* @description This module provides methods for interacting with Data Streams.
|
|
@@ -16,12 +16,12 @@ class DataStreamsApi extends BaseApi {
|
|
|
16
16
|
return await this.get(`${this.getBaseUri(authenticated)}/sales-channel/data-streams-market/search?q=${encodeURIComponent(searchTerm)}`);
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
* Gets a single Data Stream given a slug and companyId.
|
|
20
|
+
*
|
|
21
|
+
* @param {number} slug - The slug for the Data Stream to return.
|
|
22
|
+
* @param {number} companyId - The companyId for the Data Stream to return.
|
|
23
|
+
* @returns {Promise<DataStream>} A promise that resolves with the Data Stream.
|
|
24
|
+
*/
|
|
25
25
|
async getDataStreamBySlug(slug, companyId, authenticated) {
|
|
26
26
|
return await this.get(`${this.getBaseUri(authenticated)}/company/${companyId}/slug/${slug}`);
|
|
27
27
|
}
|
|
@@ -34,4 +34,4 @@ class DataStreamsApi extends BaseApi {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
export { DataStreamsApi };
|
|
37
|
+
export { DataStreamsApi, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Dataset } from
|
|
1
|
+
import { type Dataset } from "../datasets/types";
|
|
2
2
|
export interface DataStream {
|
|
3
3
|
id: string;
|
|
4
4
|
company_id: number;
|
|
@@ -22,7 +22,7 @@ export interface DataStreamContent {
|
|
|
22
22
|
icon?: string;
|
|
23
23
|
sections?: string[];
|
|
24
24
|
}
|
|
25
|
-
export type SalesChannel =
|
|
25
|
+
export type SalesChannel = "data_streams_market" | "data_shop";
|
|
26
26
|
export interface Offer {
|
|
27
27
|
id: string;
|
|
28
28
|
channel: SalesChannel;
|
|
@@ -38,7 +38,7 @@ export interface OfferLicensing {
|
|
|
38
38
|
}
|
|
39
39
|
export interface OfferPricing {
|
|
40
40
|
micro_cents_usd: number;
|
|
41
|
-
type:
|
|
41
|
+
type: "per_record" | "max_price_per_record";
|
|
42
42
|
}
|
|
43
43
|
export interface AuthRules {
|
|
44
44
|
company_contstraint: CompanyConstraint;
|
|
@@ -102,7 +102,7 @@ export interface ColumnWithFilterAndExport {
|
|
|
102
102
|
filter?: FilterDefinition;
|
|
103
103
|
exported: boolean;
|
|
104
104
|
}
|
|
105
|
-
export type FilterDefinition =
|
|
105
|
+
export type FilterDefinition = "include_all_values_including_nulls_filter" | "include_only_if_not_null_filter" | EnumFilter | IntervalFilter | TimestampFilter | SparkSqlConstraintFilter;
|
|
106
106
|
export interface EnumFilter {
|
|
107
107
|
type: InclusionType;
|
|
108
108
|
list: string[];
|
|
@@ -119,10 +119,10 @@ export interface TimestampFilter {
|
|
|
119
119
|
export interface SparkSqlConstraintFilter {
|
|
120
120
|
expressions: string[];
|
|
121
121
|
}
|
|
122
|
-
export type IntervalEndType =
|
|
122
|
+
export type IntervalEndType = "inclusive" | "exclusive";
|
|
123
123
|
export interface IntervalEnd {
|
|
124
124
|
type: IntervalEndType;
|
|
125
125
|
value: string;
|
|
126
126
|
}
|
|
127
|
-
export type SpatialPredicate =
|
|
128
|
-
export type InclusionType =
|
|
127
|
+
export type SpatialPredicate = "contains" | "intersects";
|
|
128
|
+
export type InclusionType = "include" | "exclude";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ApiRecords } from
|
|
2
|
-
import { BaseApi } from
|
|
3
|
-
import type { FilePerSnapshotResponse, Dataset, DatasetTableSummaryAPIResponse, ColumnStatistics, RetentionPolicy, DatasetTableSummary } from
|
|
4
|
-
export { type FilePerSnapshotResponse, type Dataset, type RetentionPolicy, type DatasetTableSummaryAPIResponse, type ColumnStatistics };
|
|
1
|
+
import { type ApiRecords } from "../types";
|
|
2
|
+
import { BaseApi } from "../base-api";
|
|
3
|
+
import type { FilePerSnapshotResponse, Dataset, DatasetTableSummaryAPIResponse, ColumnStatistics, RetentionPolicy, DatasetTableSummary } from "./types";
|
|
4
|
+
export { type FilePerSnapshotResponse, type Dataset, type RetentionPolicy, type DatasetTableSummaryAPIResponse, type ColumnStatistics, };
|
|
5
5
|
/**
|
|
6
6
|
* @module DatasetApi
|
|
7
7
|
* @description This module provides methods for fetching datasets.
|
|
@@ -55,7 +55,7 @@ export declare class DatasetApi extends BaseApi {
|
|
|
55
55
|
* @throws {Error} If there is an issue with the request or the response.
|
|
56
56
|
* @memberof DatasetApi
|
|
57
57
|
* @public
|
|
58
|
-
|
|
58
|
+
*/
|
|
59
59
|
getDatasetFiles(datasetId: number, size?: number, offset?: number, afterTimestamp?: string, fromSnapshotId?: number): Promise<FilePerSnapshotResponse>;
|
|
60
60
|
/**
|
|
61
61
|
* Fetches the download URL for a specific dataset file.
|
|
@@ -72,34 +72,50 @@ export declare class DatasetApi extends BaseApi {
|
|
|
72
72
|
download_url: string;
|
|
73
73
|
}>;
|
|
74
74
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
* Fetches column statistics for a given dataset.
|
|
76
|
+
*
|
|
77
|
+
* @param {number} datasetId - The ID of the dataset to fetch column statistics for.
|
|
78
|
+
* @returns {Promise<ColumnStatistics>} A Promise that resolves with an object containing the column statistics.
|
|
79
|
+
* @throws {Error} If there is an issue with the request or the response.
|
|
80
|
+
* @memberof DatasetApi
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
83
|
getColumnStats(datasetId: number): Promise<ColumnStatistics>;
|
|
84
84
|
/**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
93
|
getStatistics(datasetId: number, offset?: number, size?: number): Promise<ApiRecords<DatasetTableSummary>>;
|
|
94
94
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
* Updates the retention policy of a specific dataset.
|
|
96
|
+
*
|
|
97
|
+
* @param {number} datasetId - The ID of the dataset to update the retention policy for.
|
|
98
|
+
* @param {RetentionPolicy} policy - The new retention policy to be applied.
|
|
99
|
+
* @returns {Promise<Dataset>} A Promise that resolves with the updated dataset object.
|
|
100
|
+
* @throws {Error} If there is an issue with the request or the response.
|
|
101
|
+
* @memberof DatasetApi
|
|
102
|
+
* @public
|
|
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<void>} A promise that resolves when the operation is complete.
|
|
119
|
+
*/
|
|
120
|
+
recalculateDatasetColumnStatistics(datasetId: number): Promise<void>;
|
|
105
121
|
}
|
package/build/datasets/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseApi } from
|
|
2
|
-
const resourceName =
|
|
1
|
+
import { BaseApi } from "../base-api";
|
|
2
|
+
const resourceName = "datasets";
|
|
3
3
|
/**
|
|
4
4
|
* @module DatasetApi
|
|
5
5
|
* @description This module provides methods for fetching datasets.
|
|
@@ -61,17 +61,17 @@ export class DatasetApi extends BaseApi {
|
|
|
61
61
|
* @throws {Error} If there is an issue with the request or the response.
|
|
62
62
|
* @memberof DatasetApi
|
|
63
63
|
* @public
|
|
64
|
-
|
|
64
|
+
*/
|
|
65
65
|
async getDatasetFiles(datasetId, size, offset, afterTimestamp, fromSnapshotId) {
|
|
66
66
|
const params = new URLSearchParams();
|
|
67
67
|
if (size != null)
|
|
68
|
-
params.append(
|
|
68
|
+
params.append("per_page", String(size));
|
|
69
69
|
if (offset != null)
|
|
70
|
-
params.append(
|
|
70
|
+
params.append("offset", String(offset));
|
|
71
71
|
if (afterTimestamp != null)
|
|
72
|
-
params.append(
|
|
72
|
+
params.append("timestamp.gte", afterTimestamp);
|
|
73
73
|
if (fromSnapshotId != null)
|
|
74
|
-
params.append(
|
|
74
|
+
params.append("from_snapshot_id", String(fromSnapshotId));
|
|
75
75
|
return await this.get(`${resourceName}/${datasetId}/find-files?${params.toString()}`);
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
@@ -89,40 +89,60 @@ export class DatasetApi extends BaseApi {
|
|
|
89
89
|
return await this.post(`${resourceName}/${datasetId}/snapshots/${snapshotId}/files-added/${fileId}/download`);
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
* Fetches column statistics for a given dataset.
|
|
93
|
+
*
|
|
94
|
+
* @param {number} datasetId - The ID of the dataset to fetch column statistics for.
|
|
95
|
+
* @returns {Promise<ColumnStatistics>} A Promise that resolves with an object containing the column statistics.
|
|
96
|
+
* @throws {Error} If there is an issue with the request or the response.
|
|
97
|
+
* @memberof DatasetApi
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
100
|
async getColumnStats(datasetId) {
|
|
101
101
|
return await this.get(`${resourceName}/${datasetId}/column-stats`);
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
112
|
async getStatistics(datasetId, offset = 0, size = 1000) {
|
|
113
113
|
return await this.get(`${resourceName}/${datasetId}/stats?offset=${offset}&per_page=${size}`);
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
116
|
+
* Updates the retention policy of a specific dataset.
|
|
117
|
+
*
|
|
118
|
+
* @param {number} datasetId - The ID of the dataset to update the retention policy for.
|
|
119
|
+
* @param {RetentionPolicy} policy - The new retention policy to be applied.
|
|
120
|
+
* @returns {Promise<Dataset>} A Promise that resolves with the updated dataset object.
|
|
121
|
+
* @throws {Error} If there is an issue with the request or the response.
|
|
122
|
+
* @memberof DatasetApi
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
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<void>} A promise that resolves when the operation is complete.
|
|
144
|
+
*/
|
|
145
|
+
async recalculateDatasetColumnStatistics(datasetId) {
|
|
146
|
+
await this.post(`${resourceName}/${datasetId}/column-stats/recalculate`, {});
|
|
147
|
+
}
|
|
128
148
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Mapping } from
|
|
1
|
+
import type { Mapping } from "../mappings/types";
|
|
2
2
|
export interface Dataset {
|
|
3
3
|
id: number;
|
|
4
4
|
company_id: number;
|
|
@@ -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;
|
|
@@ -49,13 +55,13 @@ export interface DatasetTableSummaryAPIResponse {
|
|
|
49
55
|
dataset_id: number;
|
|
50
56
|
records: DatasetTableSummary[];
|
|
51
57
|
}
|
|
52
|
-
type SchemaFileConfigType =
|
|
53
|
-
type SchemaPropertiesType =
|
|
54
|
-
type DatasetStatus =
|
|
55
|
-
type DatasetWriteMode =
|
|
56
|
-
type ExpressionlessRetentionPolicyType =
|
|
57
|
-
type ExpressionedRetentionPolicyType =
|
|
58
|
-
type SchemaType =
|
|
58
|
+
type SchemaFileConfigType = "flat" | "json" | "parquet";
|
|
59
|
+
type SchemaPropertiesType = "string" | "boolean" | "double" | "long" | "timestamptz" | "object" | "array";
|
|
60
|
+
type DatasetStatus = "active" | "archived";
|
|
61
|
+
type DatasetWriteMode = "append" | "overwrite";
|
|
62
|
+
type ExpressionlessRetentionPolicyType = "retain_everything" | "expire_everything";
|
|
63
|
+
type ExpressionedRetentionPolicyType = "retain_when" | "expire_when";
|
|
64
|
+
type SchemaType = "object" | "value";
|
|
59
65
|
export declare enum Operator {
|
|
60
66
|
GreaterThan = ">",
|
|
61
67
|
LessThan = "<",
|
|
@@ -67,7 +73,7 @@ export type RetentionPolicy = {
|
|
|
67
73
|
} | {
|
|
68
74
|
type: ExpressionedRetentionPolicyType;
|
|
69
75
|
expression?: {
|
|
70
|
-
type:
|
|
76
|
+
type: "snapshot_age";
|
|
71
77
|
operator: Operator;
|
|
72
78
|
period: string;
|
|
73
79
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseApi } from
|
|
2
|
-
import { type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState } from
|
|
1
|
+
import { BaseApi } from "../base-api";
|
|
2
|
+
import { type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* @module ForecastApi
|
|
5
5
|
* @description This module provides methods for generating forecasts from a subscription
|
|
@@ -49,4 +49,4 @@ declare class ForecastApi extends BaseApi {
|
|
|
49
49
|
*/
|
|
50
50
|
getPublicForecast(forecastId: string): Promise<ForecastResponse>;
|
|
51
51
|
}
|
|
52
|
-
export { ForecastApi, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState };
|
|
52
|
+
export { ForecastApi, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse, type JobState, };
|
package/build/forecast/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseApi } from
|
|
2
|
-
const resourceName =
|
|
1
|
+
import { BaseApi } from "../base-api";
|
|
2
|
+
const resourceName = "data-shops/subscriptions";
|
|
3
3
|
/**
|
|
4
4
|
* @module ForecastApi
|
|
5
5
|
* @description This module provides methods for generating forecasts from a subscription
|
|
@@ -61,4 +61,4 @@ class ForecastApi extends BaseApi {
|
|
|
61
61
|
return await this.get(`${resourceName}/public/forecasts/${forecastId}`);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
export { ForecastApi };
|
|
64
|
+
export { ForecastApi, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DataRules } from
|
|
1
|
+
import { type DataRules } from "../data-streams/types";
|
|
2
2
|
export interface CostForecastRequest {
|
|
3
3
|
as_of?: Date;
|
|
4
4
|
details: ForecastDetails;
|
|
@@ -7,29 +7,29 @@ export interface ForecastRequest extends CostForecastRequest {
|
|
|
7
7
|
fingerprint?: string;
|
|
8
8
|
skip_cache?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export type ForecastType =
|
|
10
|
+
export type ForecastType = "marketplace" | "data_stream";
|
|
11
11
|
export interface ForecastDetails {
|
|
12
12
|
type: ForecastType;
|
|
13
13
|
}
|
|
14
14
|
export interface MarketplaceForecastDetails extends ForecastDetails {
|
|
15
|
-
type:
|
|
15
|
+
type: "marketplace";
|
|
16
16
|
company_constraint?: CompanyConstraint;
|
|
17
17
|
dataset_constraint?: DatasetConstraint;
|
|
18
18
|
data_rules: DataRules;
|
|
19
19
|
pricing: ForecastPricing;
|
|
20
20
|
}
|
|
21
21
|
export interface DataStreamPurchaseDetails {
|
|
22
|
-
type:
|
|
22
|
+
type: "data_stream";
|
|
23
23
|
data_stream_id: string;
|
|
24
24
|
offer_id: string;
|
|
25
25
|
data_shop_id?: number;
|
|
26
26
|
}
|
|
27
|
-
export type CompanyConstraintType =
|
|
27
|
+
export type CompanyConstraintType = "inclusion" | "exclusion";
|
|
28
28
|
export interface CompanyConstraint {
|
|
29
29
|
type: CompanyConstraintType;
|
|
30
30
|
company_ids: number[];
|
|
31
31
|
}
|
|
32
|
-
export type DatasetConstraintType =
|
|
32
|
+
export type DatasetConstraintType = "inclusion" | "exclusion" | "all";
|
|
33
33
|
export interface DatasetConstraint {
|
|
34
34
|
type: DatasetConstraintType;
|
|
35
35
|
dataset_ids: number[];
|
|
@@ -72,7 +72,7 @@ export interface ForecastDimensions {
|
|
|
72
72
|
distinct_counts: string[];
|
|
73
73
|
group_by?: string;
|
|
74
74
|
}
|
|
75
|
-
export type JobState =
|
|
75
|
+
export type JobState = "pending" | "running" | "completed" | "cancelled" | "failed";
|
|
76
76
|
export interface ForecastResult {
|
|
77
77
|
cost: number;
|
|
78
78
|
datasets: DatasetForecastResponse[];
|
package/build/health/index.d.ts
CHANGED
package/build/health/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BaseApi } from
|
|
1
|
+
import { BaseApi } from "../base-api";
|
|
2
2
|
/**
|
|
3
3
|
* The name of the resource to be used in API requests.
|
|
4
4
|
* @constant
|
|
5
5
|
* @private
|
|
6
6
|
* @type {string}
|
|
7
7
|
*/
|
|
8
|
-
const resourceName =
|
|
8
|
+
const resourceName = "health";
|
|
9
9
|
/**
|
|
10
10
|
* A class for accessing the Health Check API.
|
|
11
11
|
* @extends BaseApi
|
package/build/health/types.d.ts
CHANGED