@narrative.io/data-collaboration-sdk-ts 0.0.45 → 0.0.46
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/forecast/types.d.ts +106 -0
- package/build/forecast/types.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { type DataRules } from '../data-streams/types';
|
|
2
|
+
export interface CostForecastRequest {
|
|
3
|
+
asOf?: Date;
|
|
4
|
+
details: ForecastDetails;
|
|
5
|
+
}
|
|
6
|
+
export interface ForecastRequest extends CostForecastRequest {
|
|
7
|
+
fingerprint?: string;
|
|
8
|
+
skipCache?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type ForecastType = 'marketplace' | 'data_stream';
|
|
11
|
+
export interface ForecastDetails {
|
|
12
|
+
type: ForecastType;
|
|
13
|
+
}
|
|
14
|
+
export interface MarketplaceForecastDetails extends ForecastDetails {
|
|
15
|
+
type: 'marketplace';
|
|
16
|
+
company_constraint?: CompanyConstraint;
|
|
17
|
+
dataset_constraint?: DatasetConstraint;
|
|
18
|
+
data_rules: DataRules;
|
|
19
|
+
pricing: ForecastPricing;
|
|
20
|
+
}
|
|
21
|
+
export interface DataStreamPurchaseDetails {
|
|
22
|
+
type: 'data_stream';
|
|
23
|
+
data_stream_id: number;
|
|
24
|
+
offer_id: number;
|
|
25
|
+
data_shop_id?: number;
|
|
26
|
+
}
|
|
27
|
+
export type CompanyConstraintType = 'inclusion' | 'exclusion';
|
|
28
|
+
export interface CompanyConstraint {
|
|
29
|
+
type: CompanyConstraintType;
|
|
30
|
+
company_ids: number[];
|
|
31
|
+
}
|
|
32
|
+
export type DatasetConstraintType = 'inclusion' | 'exclusion' | 'all';
|
|
33
|
+
export interface DatasetConstraint {
|
|
34
|
+
type: DatasetConstraintType;
|
|
35
|
+
dataset_ids: number[];
|
|
36
|
+
}
|
|
37
|
+
export interface ForecastPricing {
|
|
38
|
+
micro_cents_usd: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ForecastGenericResponse {
|
|
41
|
+
id: string;
|
|
42
|
+
companyId: number;
|
|
43
|
+
completedAt?: Date;
|
|
44
|
+
createdAt: Date;
|
|
45
|
+
failures: JobFailure[];
|
|
46
|
+
idempotencyKey: string;
|
|
47
|
+
input: ForecastInput;
|
|
48
|
+
requestSource: RequestSource;
|
|
49
|
+
state: JobState;
|
|
50
|
+
updatedAt: Date;
|
|
51
|
+
}
|
|
52
|
+
export interface ForecastResponse extends ForecastGenericResponse {
|
|
53
|
+
result?: ForecastResult;
|
|
54
|
+
}
|
|
55
|
+
export interface CostForecastResponse extends ForecastGenericResponse {
|
|
56
|
+
result?: CostForecastResult;
|
|
57
|
+
}
|
|
58
|
+
export interface CostForecastInput {
|
|
59
|
+
details: ForecastDetails;
|
|
60
|
+
}
|
|
61
|
+
export interface ForecastInput {
|
|
62
|
+
asOf?: Date;
|
|
63
|
+
dimensions: ForecastDimensions;
|
|
64
|
+
fingerprint?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface RequestSource {
|
|
67
|
+
company_id: number;
|
|
68
|
+
type: string;
|
|
69
|
+
user_id: number;
|
|
70
|
+
}
|
|
71
|
+
export interface ForecastDimensions {
|
|
72
|
+
distinctCounts: string[];
|
|
73
|
+
groupBy?: string;
|
|
74
|
+
}
|
|
75
|
+
export type JobState = 'pending' | 'running' | 'completed' | 'cancelled' | 'failed';
|
|
76
|
+
export interface ForecastResult {
|
|
77
|
+
cost: number;
|
|
78
|
+
datasets: DatasetForecastResponse[];
|
|
79
|
+
rows: number;
|
|
80
|
+
scanCost: ScanCostEstimate;
|
|
81
|
+
}
|
|
82
|
+
export interface CostForecastResult {
|
|
83
|
+
cost: ScanCostEstimate;
|
|
84
|
+
}
|
|
85
|
+
export interface DatasetForecastResponse {
|
|
86
|
+
companyId: number;
|
|
87
|
+
datasetId: number;
|
|
88
|
+
group?: string;
|
|
89
|
+
cost: number;
|
|
90
|
+
rows: number;
|
|
91
|
+
}
|
|
92
|
+
export interface ScanCostEstimate {
|
|
93
|
+
rows: number;
|
|
94
|
+
size: number;
|
|
95
|
+
sources: DataSourceCost[];
|
|
96
|
+
}
|
|
97
|
+
export interface DataSourceCost {
|
|
98
|
+
source: string | number;
|
|
99
|
+
rows: number;
|
|
100
|
+
size: number;
|
|
101
|
+
}
|
|
102
|
+
export interface JobFailure {
|
|
103
|
+
message: string;
|
|
104
|
+
timestamp: Date;
|
|
105
|
+
value: string;
|
|
106
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|