@vizzly/api-client 0.0.70 → 0.0.71
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.
|
@@ -29,6 +29,10 @@ export declare class VizzlyQueryEngineApi extends Api {
|
|
|
29
29
|
results: Array<nSemanticLayer.Result>;
|
|
30
30
|
}>>;
|
|
31
31
|
private buildCreateResultsRequest;
|
|
32
|
+
collectTreePartInstructions(params: RequestParams<nVizzlyQueryEngine.CollectTreePartInstructionsParams>): Promise<import("../types").Response<{
|
|
33
|
+
treeParts: DataOptimiser.TreePartInstruction[];
|
|
34
|
+
}>>;
|
|
35
|
+
private buildCollectTreePartInstructionsRequest;
|
|
32
36
|
collectTableSchema(params: RequestParams<nVizzlyQueryEngine.CollectTableSchemaParams>): Promise<import("../types").Response<{
|
|
33
37
|
tableSchemaByConnection: {
|
|
34
38
|
[connectionId: string]: {
|
|
@@ -110,6 +110,23 @@ class VizzlyQueryEngineApi extends Api_1.Api {
|
|
|
110
110
|
acceptedAuthParams: ['queryEngineApiKey', 'dashboardAccessToken'],
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
+
collectTreePartInstructions(params) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
return yield this.execute(this.buildCollectTreePartInstructionsRequest(params));
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
buildCollectTreePartInstructionsRequest(params) {
|
|
119
|
+
return {
|
|
120
|
+
path: `/api/v1/data-optimiser/tree-part-instructions`,
|
|
121
|
+
method: 'post',
|
|
122
|
+
abortSignal: params.abortSignal,
|
|
123
|
+
body: {
|
|
124
|
+
company: { id: params.companyId },
|
|
125
|
+
treeTableAddress: params.treeTableAddress,
|
|
126
|
+
},
|
|
127
|
+
acceptedAuthParams: ['queryEngineApiKey'],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
113
130
|
collectTableSchema(params) {
|
|
114
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
132
|
return yield this.execute(this.buildCollectTableSchemaRequest(params));
|
|
@@ -122,7 +139,7 @@ class VizzlyQueryEngineApi extends Api_1.Api {
|
|
|
122
139
|
abortSignal: params.abortSignal,
|
|
123
140
|
body: {
|
|
124
141
|
allowedConfigOrigins: params.allowedConfigOrigins,
|
|
125
|
-
dynamicConfig: params.dynamicConfig
|
|
142
|
+
dynamicConfig: params.dynamicConfig,
|
|
126
143
|
},
|
|
127
144
|
acceptedAuthParams: ['queryEngineApiKey'],
|
|
128
145
|
};
|
|
@@ -140,7 +157,7 @@ class VizzlyQueryEngineApi extends Api_1.Api {
|
|
|
140
157
|
body: {
|
|
141
158
|
allowedConfigOrigins: params.allowedConfigOrigins,
|
|
142
159
|
dynamicConfig: params.dynamicConfig,
|
|
143
|
-
filterColumnsByTable: params.filterColumnsByTable
|
|
160
|
+
filterColumnsByTable: params.filterColumnsByTable,
|
|
144
161
|
},
|
|
145
162
|
acceptedAuthParams: ['queryEngineApiKey'],
|
|
146
163
|
};
|
|
@@ -507,7 +524,7 @@ class VizzlyQueryEngineApi extends Api_1.Api {
|
|
|
507
524
|
internalCompanyConnection: params.internalCompanyConnection,
|
|
508
525
|
externalSnowflakeConnection: params.externalSnowflakeConnection,
|
|
509
526
|
transformations: params.transformations,
|
|
510
|
-
previousWorkflowResults: params.previousWorkflowResults
|
|
527
|
+
previousWorkflowResults: params.previousWorkflowResults,
|
|
511
528
|
},
|
|
512
529
|
acceptedAuthParams: ['queryEngineApiKey'],
|
|
513
530
|
};
|
|
@@ -538,7 +555,7 @@ class VizzlyQueryEngineApi extends Api_1.Api {
|
|
|
538
555
|
cascadingInstructions: params.cascadingInstructions,
|
|
539
556
|
primaryDateFieldId: params.primaryDateFieldId,
|
|
540
557
|
internalCompanyConnection: params.internalCompanyConnection,
|
|
541
|
-
previousWorkflowResults: params.previousWorkflowResults
|
|
558
|
+
previousWorkflowResults: params.previousWorkflowResults,
|
|
542
559
|
},
|
|
543
560
|
acceptedAuthParams: ['queryEngineApiKey'],
|
|
544
561
|
};
|
|
@@ -565,7 +582,7 @@ class VizzlyQueryEngineApi extends Api_1.Api {
|
|
|
565
582
|
snapshotDataSourceId: params.snapshotDataSourceId,
|
|
566
583
|
subsnapDataSourceId: params.subsnapDataSourceId,
|
|
567
584
|
snapshotFields: params.snapshotFields,
|
|
568
|
-
internalCompanyConnection: params.internalCompanyConnection
|
|
585
|
+
internalCompanyConnection: params.internalCompanyConnection,
|
|
569
586
|
},
|
|
570
587
|
acceptedAuthParams: ['queryEngineApiKey'],
|
|
571
588
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export * from './types/team';
|
|
|
9
9
|
export * from './types/user';
|
|
10
10
|
import { DataAccessConfig } from '@vizzly/auth';
|
|
11
11
|
import { nSemanticLayer, OriginId } from '@vizzly/semantic-layer-public';
|
|
12
|
-
import { SnowflakeConnection } from '@vizzly/sqlbuilder-public';
|
|
12
|
+
import { DatabaseColumn, SnowflakeConnection } from '@vizzly/sqlbuilder-public';
|
|
13
13
|
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
14
14
|
export type UpdateDashboardResponseBody = {
|
|
15
15
|
dashboard: DashboardFromAPI;
|
|
@@ -113,6 +113,10 @@ export declare namespace nVizzlyQueryEngine {
|
|
|
113
113
|
dynamicConfig?: nSemanticLayer.Config;
|
|
114
114
|
secureFilters?: DataAccessConfig['secureFilters'];
|
|
115
115
|
};
|
|
116
|
+
type CollectTreePartInstructionsParams = {
|
|
117
|
+
companyId: string;
|
|
118
|
+
treeTableAddress: [string, string, string];
|
|
119
|
+
};
|
|
116
120
|
type CollectTableSchemaParams = {
|
|
117
121
|
allowedConfigOrigins: OriginId[];
|
|
118
122
|
dynamicConfig?: nSemanticLayer.Config;
|
|
@@ -474,14 +478,40 @@ export type GlobalLibraryPermissionFromAPI = {
|
|
|
474
478
|
scope: 'read' | 'read_write';
|
|
475
479
|
};
|
|
476
480
|
export declare namespace DataOptimiser {
|
|
477
|
-
type
|
|
481
|
+
type RenameColumnInstruction = {
|
|
482
|
+
type: 'rename_column';
|
|
483
|
+
columnToRename: DatabaseColumn;
|
|
484
|
+
newColumnName: string;
|
|
485
|
+
};
|
|
486
|
+
type RemoveColumnInstruction = {
|
|
487
|
+
type: 'remove_column';
|
|
488
|
+
columnToRemove: DatabaseColumn;
|
|
489
|
+
};
|
|
490
|
+
type KeepColumnWithoutChangesInstruction = {
|
|
491
|
+
type: 'keep_column_without_changes';
|
|
492
|
+
column: DatabaseColumn;
|
|
493
|
+
};
|
|
494
|
+
export type ColumnInstruction = RenameColumnInstruction | RemoveColumnInstruction | KeepColumnWithoutChangesInstruction;
|
|
495
|
+
export type TreePartInstruction = {
|
|
496
|
+
type: 'branch' | 'trunk';
|
|
497
|
+
columnInstructions: Array<ColumnInstruction>;
|
|
498
|
+
filter: Array<{
|
|
499
|
+
columnName: string;
|
|
500
|
+
value: any;
|
|
501
|
+
}>;
|
|
502
|
+
uniqueDimensionValues: {
|
|
503
|
+
brands: string[];
|
|
504
|
+
mediaChannels: string[];
|
|
505
|
+
};
|
|
506
|
+
};
|
|
507
|
+
export type DataSourceFields = Array<{
|
|
478
508
|
id: string;
|
|
479
509
|
address: string[];
|
|
480
510
|
data_type: string;
|
|
481
511
|
normalized_data_type: 'string' | 'number' | 'date_time' | 'boolean';
|
|
482
512
|
}>;
|
|
483
|
-
type EphemeralDataSourceFields = Array<Omit<DataSourceFields[number], 'id'>>;
|
|
484
|
-
type DimensionFieldsMapping = Array<{
|
|
513
|
+
export type EphemeralDataSourceFields = Array<Omit<DataSourceFields[number], 'id'>>;
|
|
514
|
+
export type DimensionFieldsMapping = Array<{
|
|
485
515
|
field_id: string;
|
|
486
516
|
gti_dimension_key: 'brands' | 'regions' | 'media_channels';
|
|
487
517
|
dimension_values_mappings: Array<{
|
|
@@ -502,22 +532,22 @@ export declare namespace DataOptimiser {
|
|
|
502
532
|
* snapshot in the same request without doing any logic, and the data
|
|
503
533
|
* optimiser will pick what it needs.
|
|
504
534
|
*/
|
|
505
|
-
type CascadingInstructions = Array<{
|
|
535
|
+
export type CascadingInstructions = Array<{
|
|
506
536
|
datasourceDimensionFieldMapping: DimensionFieldsMapping;
|
|
507
537
|
dataStartDate: string | null;
|
|
508
538
|
dataEndDate: string | null;
|
|
509
539
|
}>;
|
|
510
|
-
type ActionResultStatus = 'success' | 'failure' | 'no_action_taken' | 'started_in_background';
|
|
511
|
-
type ActionStatus<PlannedOutcome> = {
|
|
540
|
+
export type ActionResultStatus = 'success' | 'failure' | 'no_action_taken' | 'started_in_background';
|
|
541
|
+
export type ActionStatus<PlannedOutcome> = {
|
|
512
542
|
name: string;
|
|
513
543
|
status: ActionResultStatus;
|
|
514
544
|
plannedOutcome: PlannedOutcome;
|
|
515
545
|
};
|
|
516
|
-
type ActionResult<Content> = {
|
|
546
|
+
export type ActionResult<Content> = {
|
|
517
547
|
status: ActionResultStatus;
|
|
518
548
|
content: Content;
|
|
519
549
|
};
|
|
520
|
-
type StatusResponse<Status extends {
|
|
550
|
+
export type StatusResponse<Status extends {
|
|
521
551
|
[actionId: string]: {
|
|
522
552
|
name: string;
|
|
523
553
|
status: ActionResultStatus;
|
|
@@ -532,7 +562,7 @@ export declare namespace DataOptimiser {
|
|
|
532
562
|
};
|
|
533
563
|
status: Status;
|
|
534
564
|
};
|
|
535
|
-
type ExecuteResponse<WorkflowResult extends {
|
|
565
|
+
export type ExecuteResponse<WorkflowResult extends {
|
|
536
566
|
[actionId: string]: {
|
|
537
567
|
status: ActionResultStatus;
|
|
538
568
|
content: any;
|
|
@@ -540,11 +570,11 @@ export declare namespace DataOptimiser {
|
|
|
540
570
|
}> = {
|
|
541
571
|
workflowResults: WorkflowResult;
|
|
542
572
|
};
|
|
543
|
-
type QueryEngineConnection = {
|
|
573
|
+
export type QueryEngineConnection = {
|
|
544
574
|
encryptedCredentials: string;
|
|
545
575
|
unencryptedCredentials?: Partial<SnowflakeConnection>;
|
|
546
576
|
};
|
|
547
|
-
type IngestExecuteResponse = ExecuteResponse<{
|
|
577
|
+
export type IngestExecuteResponse = ExecuteResponse<{
|
|
548
578
|
setup_export_data_integration: DataOptimiser.ActionResult<{}>;
|
|
549
579
|
ingest_to_storage: DataOptimiser.ActionResult<{
|
|
550
580
|
toBucket: string;
|
|
@@ -557,10 +587,11 @@ export declare namespace DataOptimiser {
|
|
|
557
587
|
executedInSnowflakeSessionId: string;
|
|
558
588
|
}>;
|
|
559
589
|
}>;
|
|
560
|
-
type CreateSnapshotExecuteResponse = DataOptimiser.ExecuteResponse<{
|
|
590
|
+
export type CreateSnapshotExecuteResponse = DataOptimiser.ExecuteResponse<{
|
|
561
591
|
create_snapshot: DataOptimiser.ActionResult<{
|
|
562
592
|
executedInSnowflakeSessionId: string;
|
|
563
593
|
snapshotFields: DataOptimiser.DataSourceFields;
|
|
564
594
|
}>;
|
|
565
595
|
}>;
|
|
596
|
+
export {};
|
|
566
597
|
}
|