@coveo/platform-client 37.9.0 → 37.11.0
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/README.md +1 -15
- package/dist/APICore.js +6 -2
- package/dist/APICore.js.map +1 -1
- package/dist/definitions/APICore.d.ts +1 -1
- package/dist/definitions/resources/BaseInterfaces.d.ts +1 -1
- package/dist/definitions/resources/Pipelines/Conditions/Condition.d.ts +27 -0
- package/dist/definitions/resources/Pipelines/Conditions/ConditionInterfaces.d.ts +63 -1
- package/dist/definitions/resources/Pipelines/MLAssociations/MLAssociations.d.ts +2 -1
- package/dist/definitions/resources/Pipelines/MLAssociations/MLAssociationsInterfaces.d.ts +3 -0
- package/dist/definitions/resources/Pipelines/PipelinesInterfaces.d.ts +1 -1
- package/dist/definitions/resources/UsageAnalytics/Read/Administration/Administration.d.ts +13 -2
- package/dist/definitions/resources/UsageAnalytics/Read/Administration/AdministrationInterfaces.d.ts +5 -6
- package/dist/definitions/resources/UsageAnalytics/Read/CommonParamParts.d.ts +118 -0
- package/dist/definitions/resources/UsageAnalytics/Read/DataShare/DataShare.d.ts +15 -3
- package/dist/definitions/resources/UsageAnalytics/Read/Dimensions/Dimensions.d.ts +65 -2
- package/dist/definitions/resources/UsageAnalytics/Read/Dimensions/DimensionsInterfaces.d.ts +20 -19
- package/dist/definitions/resources/UsageAnalytics/Read/Exports/Exports.d.ts +60 -2
- package/dist/definitions/resources/UsageAnalytics/Read/Exports/ExportsInterfaces.d.ts +28 -23
- package/dist/definitions/resources/UsageAnalytics/Read/Filters/Filters.d.ts +44 -26
- package/dist/definitions/resources/UsageAnalytics/Read/ReadServiceResource.d.ts +16 -0
- package/dist/definitions/resources/UsageAnalytics/Read/Reports/Reports.d.ts +35 -17
- package/dist/definitions/resources/UsageAnalytics/Read/Reports/ReportsInterfaces.d.ts +13 -14
- package/dist/definitions/resources/UsageAnalytics/Read/Snowflake/Snowflake.d.ts +41 -2
- package/dist/definitions/resources/UsageAnalytics/Read/Snowflake/SnowflakeInterfaces.d.ts +8 -16
- package/dist/definitions/resources/UsageAnalytics/Read/Statistics/Statistics.d.ts +55 -4
- package/dist/definitions/resources/UsageAnalytics/Read/Statistics/StatisticsInterfaces.d.ts +71 -93
- package/dist/definitions/resources/UsageAnalytics/Read/Users/Users.d.ts +33 -2
- package/dist/definitions/resources/UsageAnalytics/Read/Users/UsersInterfaces.d.ts +11 -9
- package/dist/definitions/resources/UsageAnalytics/Read/index.d.ts +1 -0
- package/dist/definitions/resources/UsageAnalytics/UsageAnalytics.d.ts +5 -5
- package/dist/definitions/utils/normalizePaginatedOptions.d.ts +1 -1
- package/dist/resources/Activities/Activities.js +2 -2
- package/dist/resources/Activities/Activities.js.map +1 -1
- package/dist/resources/Pipelines/Conditions/Condition.js +32 -0
- package/dist/resources/Pipelines/Conditions/Condition.js.map +1 -1
- package/dist/resources/Pipelines/MLAssociations/MLAssociations.js +4 -0
- package/dist/resources/Pipelines/MLAssociations/MLAssociations.js.map +1 -1
- package/dist/resources/ResourceSnapshots/ResourceSnapshots.js +1 -1
- package/dist/resources/ResourceSnapshots/ResourceSnapshots.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/Administration/Administration.js +16 -5
- package/dist/resources/UsageAnalytics/Read/Administration/Administration.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/CommonParamParts.js +3 -0
- package/dist/resources/UsageAnalytics/Read/CommonParamParts.js.map +1 -0
- package/dist/resources/UsageAnalytics/Read/DataShare/DataShare.js +19 -7
- package/dist/resources/UsageAnalytics/Read/DataShare/DataShare.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/Dimensions/Dimensions.js +76 -13
- package/dist/resources/UsageAnalytics/Read/Dimensions/Dimensions.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/Exports/Exports.js +73 -15
- package/dist/resources/UsageAnalytics/Read/Exports/Exports.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/Filters/Filters.js +58 -40
- package/dist/resources/UsageAnalytics/Read/Filters/Filters.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/ReadServiceResource.js +28 -0
- package/dist/resources/UsageAnalytics/Read/ReadServiceResource.js.map +1 -0
- package/dist/resources/UsageAnalytics/Read/Reports/Reports.js +48 -38
- package/dist/resources/UsageAnalytics/Read/Reports/Reports.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/Reports/ReportsInterfaces.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/Snowflake/Snowflake.js +52 -13
- package/dist/resources/UsageAnalytics/Read/Snowflake/Snowflake.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/Statistics/Statistics.js +66 -13
- package/dist/resources/UsageAnalytics/Read/Statistics/Statistics.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/Users/Users.js +38 -7
- package/dist/resources/UsageAnalytics/Read/Users/Users.js.map +1 -1
- package/dist/resources/UsageAnalytics/Read/index.js +1 -0
- package/dist/resources/UsageAnalytics/Read/index.js.map +1 -1
- package/dist/resources/UsageAnalytics/UsageAnalytics.js +5 -5
- package/dist/resources/UsageAnalytics/UsageAnalytics.js.map +1 -1
- package/dist/utils/normalizePaginatedOptions.js +1 -1
- package/dist/utils/normalizePaginatedOptions.js.map +1 -1
- package/package.json +10 -9
|
@@ -1,20 +1,78 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ReadServiceResource from '../ReadServiceResource';
|
|
2
2
|
import { CreateExportScheduleModel, EstimateExportParams, EstimateVisitExportParams, ExportDownloadLink, ExportEstimateModel, ExportModel, ExportScheduleModel, GenerateExportParams, GenerateVisitExportParams } from './ExportsInterfaces';
|
|
3
|
-
export default class Exports extends
|
|
3
|
+
export default class Exports extends ReadServiceResource {
|
|
4
4
|
static baseUrl: string;
|
|
5
|
+
/**
|
|
6
|
+
* Lists all exports.
|
|
7
|
+
*/
|
|
5
8
|
list(): Promise<ExportModel[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Generate an export.
|
|
11
|
+
*/
|
|
6
12
|
generate(params: GenerateExportParams): Promise<ExportModel>;
|
|
13
|
+
/**
|
|
14
|
+
* Get information on an export.
|
|
15
|
+
*
|
|
16
|
+
* @param exportId The export's unique identifier.
|
|
17
|
+
* @param redirect Whether to return a HTTP redirect to the actual file.
|
|
18
|
+
*/
|
|
7
19
|
get(exportId: string, redirect?: boolean): Promise<ExportModel>;
|
|
20
|
+
/**
|
|
21
|
+
* Get the download link of an export.
|
|
22
|
+
*
|
|
23
|
+
* @param exportId The export's unique identifier.
|
|
24
|
+
*/
|
|
8
25
|
getExportDownloadLink(exportId: string): Promise<ExportDownloadLink>;
|
|
26
|
+
/**
|
|
27
|
+
* Delete an export.
|
|
28
|
+
*
|
|
29
|
+
* @param exportId The export's unique identifier.
|
|
30
|
+
*/
|
|
9
31
|
delete(exportId: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Estimate the number of rows in an export.
|
|
34
|
+
*/
|
|
10
35
|
estimateRowsCount(params: EstimateExportParams): Promise<ExportEstimateModel>;
|
|
36
|
+
/**
|
|
37
|
+
* Get the exports service status.
|
|
38
|
+
*/
|
|
11
39
|
getStatus(): Promise<Record<string, string>>;
|
|
40
|
+
/**
|
|
41
|
+
* Health check for the exports service.
|
|
42
|
+
*/
|
|
12
43
|
checkHealth(): Promise<Record<string, string>>;
|
|
44
|
+
/**
|
|
45
|
+
* Generate a visit export.
|
|
46
|
+
*/
|
|
13
47
|
generateVisitExport(params: GenerateVisitExportParams): Promise<ExportModel>;
|
|
48
|
+
/**
|
|
49
|
+
* Estimate the number of rows in a visit export.
|
|
50
|
+
*/
|
|
14
51
|
estimateVisitExportRowsCount(params: EstimateVisitExportParams): Promise<ExportEstimateModel>;
|
|
52
|
+
/**
|
|
53
|
+
* Get all the export schedules.
|
|
54
|
+
*/
|
|
15
55
|
listSchedules(): Promise<ExportScheduleModel[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Create an export schedule.
|
|
58
|
+
*/
|
|
16
59
|
createSchedule(model: CreateExportScheduleModel): Promise<ExportScheduleModel>;
|
|
60
|
+
/**
|
|
61
|
+
* Get information on an export schedule.
|
|
62
|
+
*
|
|
63
|
+
* @param exportScheduleId The export schedule's unique identifier.
|
|
64
|
+
*/
|
|
17
65
|
getSchedule(exportScheduleId: string): Promise<ExportScheduleModel>;
|
|
66
|
+
/**
|
|
67
|
+
* Update an existing export schedule.
|
|
68
|
+
*
|
|
69
|
+
* @param exportScheduleId The export schedule's unique identifier.
|
|
70
|
+
*/
|
|
18
71
|
updateSchedule(exportScheduleId: string, model: CreateExportScheduleModel): Promise<ExportScheduleModel>;
|
|
72
|
+
/**
|
|
73
|
+
* Delete an export schedule.
|
|
74
|
+
*
|
|
75
|
+
* @param exportScheduleId The export schedule's unique identifier.
|
|
76
|
+
*/
|
|
19
77
|
deleteSchedule(exportScheduleId: string): Promise<void>;
|
|
20
78
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSVFileFormat, DayOfWeek, ExportScheduleFrequency, ExportStatus, ExportTablesType } from '../../../Enums';
|
|
2
|
+
import { EventDimensionsExcludeFilterParamParts, EventDimensionsFilterParamParts, EventDimensionsHideEventsFilterParamParts, TimeRangeParamParts } from '../CommonParamParts';
|
|
2
3
|
export interface ExportModel {
|
|
3
4
|
id: string;
|
|
4
5
|
author: string;
|
|
@@ -22,24 +23,19 @@ export interface ExportEstimateModel {
|
|
|
22
23
|
}
|
|
23
24
|
export interface ExportDownloadLink {
|
|
24
25
|
/**
|
|
25
|
-
* The export's unique identifier
|
|
26
|
+
* The export's unique identifier.
|
|
26
27
|
*/
|
|
27
28
|
id: string;
|
|
28
29
|
/**
|
|
29
|
-
* The export download link. Only appears when export is ready
|
|
30
|
+
* The export download link. Only appears when export is ready.
|
|
30
31
|
*/
|
|
31
32
|
downloadLink?: string;
|
|
32
33
|
}
|
|
33
|
-
interface
|
|
34
|
-
from: string;
|
|
35
|
-
to: string;
|
|
34
|
+
export interface EstimateExportParams extends TimeRangeParamParts, EventDimensionsFilterParamParts {
|
|
36
35
|
/**
|
|
37
|
-
* The
|
|
38
|
-
*
|
|
36
|
+
* The tables that will be included.
|
|
37
|
+
* If not provided, all tables will be included.
|
|
39
38
|
*/
|
|
40
|
-
f?: string[];
|
|
41
|
-
}
|
|
42
|
-
export interface EstimateExportParams extends EstimateExportCommonParams {
|
|
43
39
|
tables?: ExportTablesType[];
|
|
44
40
|
/**
|
|
45
41
|
* The filter that will be applied to the click and search events dimensions.
|
|
@@ -52,29 +48,38 @@ export interface EstimateExportParams extends EstimateExportCommonParams {
|
|
|
52
48
|
*/
|
|
53
49
|
fc?: string[];
|
|
54
50
|
}
|
|
55
|
-
export interface EstimateVisitExportParams extends
|
|
56
|
-
|
|
51
|
+
export interface EstimateVisitExportParams extends TimeRangeParamParts, EventDimensionsFilterParamParts, EventDimensionsExcludeFilterParamParts, EventDimensionsHideEventsFilterParamParts {
|
|
52
|
+
}
|
|
53
|
+
export interface GenerateExportParams extends EstimateExportParams {
|
|
57
54
|
/**
|
|
58
|
-
*
|
|
59
|
-
* Multiple filter parameters are joined with the AND operator.
|
|
55
|
+
* Can only contain US-ASCII characters. If not provided, it will be set to the export's id.
|
|
60
56
|
*/
|
|
61
|
-
fn?: string[];
|
|
62
|
-
}
|
|
63
|
-
interface GenerateExportCommonParams {
|
|
64
57
|
filename?: string;
|
|
65
58
|
/**
|
|
66
59
|
* Export's description.
|
|
67
60
|
*/
|
|
68
61
|
d?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The dimensions that will be exported. If not provided, all dimensions will be exported.
|
|
64
|
+
*/
|
|
69
65
|
dimensions?: string[];
|
|
66
|
+
/**
|
|
67
|
+
* The format of the generated CSV files.
|
|
68
|
+
*/
|
|
70
69
|
format?: CSVFileFormat;
|
|
70
|
+
/**
|
|
71
|
+
* Whether to use the display names in the export's header. If false, the api names will be used.
|
|
72
|
+
*/
|
|
71
73
|
useDisplayNames?: boolean;
|
|
72
74
|
}
|
|
73
|
-
export
|
|
74
|
-
|
|
75
|
+
export interface GenerateVisitExportParams extends GenerateExportParams {
|
|
76
|
+
/**
|
|
77
|
+
* Whether to order the rows by datetime in the export.
|
|
78
|
+
* If the number of rows exported is too large, this parameter will be ignored and data will be unsorted.
|
|
79
|
+
*/
|
|
75
80
|
ordered?: boolean;
|
|
76
|
-
}
|
|
77
|
-
interface
|
|
81
|
+
}
|
|
82
|
+
interface ExportScheduleModelCommonProperties {
|
|
78
83
|
frequency: ExportScheduleFrequency;
|
|
79
84
|
dayOfWeek?: DayOfWeek;
|
|
80
85
|
timezone: string;
|
|
@@ -82,7 +87,7 @@ interface ScheduleCommonProperties {
|
|
|
82
87
|
usingDisplayNames?: boolean;
|
|
83
88
|
notificationsEmails?: string[];
|
|
84
89
|
}
|
|
85
|
-
export interface ExportScheduleModel extends
|
|
90
|
+
export interface ExportScheduleModel extends ExportScheduleModelCommonProperties {
|
|
86
91
|
id: string;
|
|
87
92
|
author: string;
|
|
88
93
|
filters: Record<string, string>;
|
|
@@ -90,7 +95,7 @@ export interface ExportScheduleModel extends ScheduleCommonProperties {
|
|
|
90
95
|
description: string;
|
|
91
96
|
errorInfo?: Record<string, string>;
|
|
92
97
|
}
|
|
93
|
-
export interface CreateExportScheduleModel extends
|
|
98
|
+
export interface CreateExportScheduleModel extends ExportScheduleModelCommonProperties {
|
|
94
99
|
commonFilters?: string[];
|
|
95
100
|
searchesFilters?: string[];
|
|
96
101
|
customEventsFilters?: string[];
|
|
@@ -1,71 +1,89 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ReadServiceResource from '../ReadServiceResource';
|
|
2
2
|
import { CreatePermissionsFilterModel, CreatePermissionsFilterResponse, CreateReportingFilterModel, CreateReportingFilterResponse, FilterResponse, FilterServiceHealthResponse, FilterServiceStatusResponse, FilterTargetsModel, FilterTargetsResponse, ListFiltersResponse, PermissionsFilterUser, UpdatePermissionsFilterModel, UpdateReportingFilterModel } from './FiltersInterfaces';
|
|
3
|
-
export default class Filters extends
|
|
3
|
+
export default class Filters extends ReadServiceResource {
|
|
4
4
|
static baseUrl: string;
|
|
5
5
|
static reportingBaseUrl: string;
|
|
6
6
|
static permissionsBaseUrl: string;
|
|
7
7
|
/**
|
|
8
|
-
* Get all reporting filters
|
|
8
|
+
* Get all reporting filters.
|
|
9
9
|
*/
|
|
10
10
|
listReportFilters(): Promise<ListFiltersResponse>;
|
|
11
11
|
/**
|
|
12
|
-
* Get a reporting filter
|
|
12
|
+
* Get a reporting filter.
|
|
13
|
+
*
|
|
14
|
+
* @param filterId The unique identifier of a filter. This id is generated by the server when creating a filter.
|
|
13
15
|
*/
|
|
14
|
-
getReportFilter(
|
|
16
|
+
getReportFilter(filterId: string): Promise<FilterResponse>;
|
|
15
17
|
/**
|
|
16
|
-
* Create a reporting filter
|
|
18
|
+
* Create a reporting filter.
|
|
17
19
|
*/
|
|
18
20
|
createReportFilter(filter: CreateReportingFilterModel): Promise<CreateReportingFilterResponse>;
|
|
19
21
|
/**
|
|
20
22
|
* Update a reporting filter
|
|
23
|
+
*
|
|
24
|
+
* @param filterId The unique identifier of a filter. This id is generated by the server when creating a filter.
|
|
21
25
|
*/
|
|
22
|
-
updateReportFilter(
|
|
26
|
+
updateReportFilter(filterId: string, filter: UpdateReportingFilterModel): Promise<CreateReportingFilterResponse>;
|
|
23
27
|
/**
|
|
24
28
|
* Delete a reporting filter
|
|
29
|
+
*
|
|
30
|
+
* @param filterId The unique identifier of a filter. This id is generated by the server when creating a filter.
|
|
25
31
|
*/
|
|
26
|
-
deleteReportFilter(
|
|
32
|
+
deleteReportFilter(filterId: string): Promise<Record<string, unknown>>;
|
|
27
33
|
/**
|
|
28
|
-
* Get all permission filters
|
|
34
|
+
* Get all permission filters.
|
|
29
35
|
*/
|
|
30
36
|
listPermissionFilters(): Promise<ListFiltersResponse>;
|
|
31
37
|
/**
|
|
32
|
-
* Get a permission filter
|
|
38
|
+
* Get a permission filter.
|
|
33
39
|
*/
|
|
34
|
-
getPermissionFilter(
|
|
40
|
+
getPermissionFilter(filterId: string): Promise<FilterResponse>;
|
|
35
41
|
/**
|
|
36
|
-
* Create a permission filter
|
|
42
|
+
* Create a permission filter.
|
|
37
43
|
*/
|
|
38
44
|
createPermissionFilter(filter: CreatePermissionsFilterModel): Promise<CreatePermissionsFilterResponse>;
|
|
39
45
|
/**
|
|
40
|
-
* Update a permission filter
|
|
46
|
+
* Update a permission filter.
|
|
47
|
+
*
|
|
48
|
+
* @param filterId The unique identifier of a filter. This id is generated by the server when creating a filter.
|
|
41
49
|
*/
|
|
42
|
-
updatePermissionFilter(
|
|
50
|
+
updatePermissionFilter(filterId: string, filter: UpdatePermissionsFilterModel): Promise<CreatePermissionsFilterResponse>;
|
|
43
51
|
/**
|
|
44
|
-
* Delete a permission filter
|
|
52
|
+
* Delete a permission filter.
|
|
53
|
+
*
|
|
54
|
+
* @param filterId The unique identifier of a filter. This id is generated by the server when creating a filter.
|
|
45
55
|
*/
|
|
46
|
-
deletePermissionFilter(
|
|
56
|
+
deletePermissionFilter(filterId: string): Promise<Record<string, unknown>>;
|
|
47
57
|
/**
|
|
48
|
-
* Get the users of a permission filters
|
|
58
|
+
* Get the users of a permission filters.
|
|
59
|
+
*
|
|
60
|
+
* @param filterId The unique identifier of a filter. This id is generated by the server when creating a filter.
|
|
49
61
|
*/
|
|
50
|
-
getPermissionFilterUsers(
|
|
62
|
+
getPermissionFilterUsers(filterId: string): Promise<PermissionsFilterUser[]>;
|
|
51
63
|
/**
|
|
52
|
-
* Set the users of a permission filter
|
|
64
|
+
* Set the users of a permission filter.
|
|
65
|
+
*
|
|
66
|
+
* @param filterId The unique identifier of a filter. This id is generated by the server when creating a filter.
|
|
53
67
|
*/
|
|
54
|
-
updatePermissionFilterUsers(
|
|
68
|
+
updatePermissionFilterUsers(filterId: string, users: string[]): Promise<Record<string, unknown>>;
|
|
55
69
|
/**
|
|
56
|
-
* Get the targets of a permission filters
|
|
70
|
+
* Get the targets of a permission filters.
|
|
71
|
+
*
|
|
72
|
+
* @param filterId The unique identifier of a filter. This id is generated by the server when creating a filter.
|
|
57
73
|
*/
|
|
58
|
-
getPermissionFilterTargets(
|
|
74
|
+
getPermissionFilterTargets(filterId: string): Promise<FilterTargetsResponse[]>;
|
|
59
75
|
/**
|
|
60
|
-
* Set the targets of a permission filter
|
|
76
|
+
* Set the targets of a permission filter.
|
|
77
|
+
*
|
|
78
|
+
* @param filterId The unique identifier of a filter. This id is generated by the server when creating a filter.
|
|
61
79
|
*/
|
|
62
|
-
updatePermissionFilterTargets(
|
|
80
|
+
updatePermissionFilterTargets(filterId: string, targets: FilterTargetsModel): Promise<Record<string, unknown>>;
|
|
63
81
|
/**
|
|
64
|
-
* Health check for the filter service
|
|
82
|
+
* Health check for the filter service.
|
|
65
83
|
*/
|
|
66
84
|
healthcheck(): Promise<FilterServiceHealthResponse>;
|
|
67
85
|
/**
|
|
68
|
-
* Get the filter service status
|
|
86
|
+
* Get the filter service status.
|
|
69
87
|
*/
|
|
70
88
|
status(): Promise<FilterServiceStatusResponse>;
|
|
71
89
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Resource from '../../Resource';
|
|
2
|
+
/**
|
|
3
|
+
* Extends Resource with a `buildPathWithOrg` method, that will fill in the optional `org` query parameter by default.
|
|
4
|
+
* It still allows "overriding" the org by specifying it explicitly in the parameters.
|
|
5
|
+
*/
|
|
6
|
+
export default class ReadServiceResource extends Resource {
|
|
7
|
+
/**
|
|
8
|
+
* Build the request path, handling the optional `org` query parameter.
|
|
9
|
+
*
|
|
10
|
+
* @param route The path part of the request.
|
|
11
|
+
* @param queryParams Optional query parameters object.
|
|
12
|
+
* If this object contains an `org` property, it will override the value from the configuration.
|
|
13
|
+
* @returns The request path including formatted query parameters.
|
|
14
|
+
*/
|
|
15
|
+
protected buildPathWithOrg(route: string, queryParams?: any): string;
|
|
16
|
+
}
|
|
@@ -1,42 +1,56 @@
|
|
|
1
1
|
import { ReportType } from '../../../Enums';
|
|
2
|
-
import
|
|
2
|
+
import ReadServiceResource from '../ReadServiceResource';
|
|
3
3
|
import { CreateReportModel, CreateReportResponse, GetReportOptions, GetReportTemplateOptions, ListReportsOptions, ListReportsResponse, ReportAccessRequest, ReportAccessResponse, ReportModel, TemplateResponse, ReportUsersResponse, StatusResponse, TemplateMetadataResponse, UpdateReportModel } from './ReportsInterfaces';
|
|
4
|
-
export default class Reports extends
|
|
4
|
+
export default class Reports extends ReadServiceResource {
|
|
5
5
|
static baseUrl: string;
|
|
6
6
|
/**
|
|
7
|
-
* Get the persisted reports of one or all types
|
|
7
|
+
* Get the persisted reports of one or all types.
|
|
8
8
|
*/
|
|
9
9
|
list(options?: ListReportsOptions): Promise<ListReportsResponse>;
|
|
10
10
|
/**
|
|
11
|
-
* Get a report
|
|
11
|
+
* Get a report.
|
|
12
|
+
*
|
|
13
|
+
* @param reportId The unique identifier of a report. This id is generated by the server when creating a report.
|
|
12
14
|
*/
|
|
13
|
-
get(
|
|
15
|
+
get(reportId: string, options?: GetReportOptions): Promise<ReportModel>;
|
|
14
16
|
/**
|
|
15
|
-
* Create a report
|
|
17
|
+
* Create a report.
|
|
16
18
|
*/
|
|
17
19
|
create(report: CreateReportModel): Promise<CreateReportResponse>;
|
|
18
20
|
/**
|
|
19
|
-
* Update a report
|
|
21
|
+
* Update a report.
|
|
22
|
+
*
|
|
23
|
+
* @param reportId The unique identifier of a report. This id is generated by the server when creating a report.
|
|
20
24
|
*/
|
|
21
|
-
update(
|
|
25
|
+
update(reportId: string, report: UpdateReportModel): Promise<CreateReportModel>;
|
|
22
26
|
/**
|
|
23
|
-
* Delete a report
|
|
27
|
+
* Delete a report.
|
|
28
|
+
*
|
|
29
|
+
* @param reportId The unique identifier of a report. This id is generated by the server when creating a report.
|
|
24
30
|
*/
|
|
25
|
-
delete(
|
|
31
|
+
delete(reportId: string): Promise<Record<string, unknown>>;
|
|
26
32
|
/**
|
|
27
|
-
* Get the users and groups who can view a report
|
|
33
|
+
* Get the users and groups who can view a report.
|
|
34
|
+
*
|
|
35
|
+
* @param reportId The unique identifier of a report. This id is generated by the server when creating a report.
|
|
28
36
|
*/
|
|
29
37
|
getAccess(reportId: string): Promise<ReportAccessResponse>;
|
|
30
38
|
/**
|
|
31
|
-
* Set the users and groups who are allowed to view a report
|
|
39
|
+
* Set the users and groups who are allowed to view a report.
|
|
40
|
+
*
|
|
41
|
+
* @param reportId The unique identifier of a report. This id is generated by the server when creating a report.
|
|
32
42
|
*/
|
|
33
43
|
setAccess(reportId: string, reportAccess: ReportAccessRequest): Promise<Record<string, unknown>>;
|
|
34
44
|
/**
|
|
35
|
-
* Get the users who can view a report
|
|
45
|
+
* Get the users who can view a report.
|
|
46
|
+
*
|
|
47
|
+
* @param reportId The unique identifier of a report. This id is generated by the server when creating a report.
|
|
36
48
|
*/
|
|
37
49
|
getUsers(reportId: string): Promise<ReportUsersResponse>;
|
|
38
50
|
/**
|
|
39
|
-
* Set the users who are allowed to view a report
|
|
51
|
+
* Set the users who are allowed to view a report.
|
|
52
|
+
*
|
|
53
|
+
* @param reportId The unique identifier of a report. This id is generated by the server when creating a report.
|
|
40
54
|
*/
|
|
41
55
|
setUsers(reportId: string, userIds: string[]): Promise<Record<string, unknown>>;
|
|
42
56
|
/**
|
|
@@ -44,15 +58,19 @@ export default class Reports extends Resource {
|
|
|
44
58
|
*/
|
|
45
59
|
healthcheck(): Promise<StatusResponse>;
|
|
46
60
|
/**
|
|
47
|
-
* Get a report template
|
|
61
|
+
* Get a report template.
|
|
62
|
+
*
|
|
63
|
+
* @param templateId The unique identifier of a template.
|
|
48
64
|
*/
|
|
49
65
|
getReportTemplate(templateId: string, options?: GetReportTemplateOptions): Promise<TemplateResponse[]>;
|
|
50
66
|
/**
|
|
51
|
-
* Get metadata about available report templates
|
|
67
|
+
* Get metadata about available report templates.
|
|
68
|
+
*
|
|
69
|
+
* @param type The type of the report. Must be either 'explorer' or 'dashboard'.
|
|
52
70
|
*/
|
|
53
71
|
listReportTemplates(type: ReportType, options?: GetReportTemplateOptions): Promise<TemplateMetadataResponse[]>;
|
|
54
72
|
/**
|
|
55
|
-
* Get the reports service status
|
|
73
|
+
* Get the reports service status.
|
|
56
74
|
*/
|
|
57
75
|
getServiceStatus(): Promise<StatusResponse>;
|
|
58
76
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ReportType } from '../../../Enums';
|
|
2
|
+
import { TimeZoneParamParts } from '../CommonParamParts';
|
|
2
3
|
export interface ReportModel {
|
|
3
|
-
/** The report id */
|
|
4
|
+
/** The report id. */
|
|
4
5
|
id: string;
|
|
5
|
-
/** The report account */
|
|
6
|
+
/** The report account. */
|
|
6
7
|
account: string;
|
|
7
|
-
/** The display name of the report */
|
|
8
|
+
/** The display name of the report. */
|
|
8
9
|
displayName: string;
|
|
9
10
|
/** The type of the report. Must be either 'explorer' or 'dashboard'. */
|
|
10
11
|
type: ReportType;
|
|
@@ -17,9 +18,7 @@ export interface ReportModel {
|
|
|
17
18
|
}
|
|
18
19
|
export type CreateReportModel = Omit<ReportModel, 'id' | 'account'>;
|
|
19
20
|
export type CreateReportResponse = Pick<ReportModel, 'id'>;
|
|
20
|
-
export interface GetReportOptions {
|
|
21
|
-
/** Timezone used for calculations. */
|
|
22
|
-
tz?: string;
|
|
21
|
+
export interface GetReportOptions extends TimeZoneParamParts {
|
|
23
22
|
}
|
|
24
23
|
export type UpdateReportModel = CreateReportModel;
|
|
25
24
|
export type UpdateReportResponse = CreateReportResponse;
|
|
@@ -30,7 +29,7 @@ export interface ListReportsOptions {
|
|
|
30
29
|
includeConfig?: boolean;
|
|
31
30
|
}
|
|
32
31
|
export interface ListReportsResponse {
|
|
33
|
-
/** A collection of report configurations */
|
|
32
|
+
/** A collection of report configurations. */
|
|
34
33
|
reports: ReportModel[];
|
|
35
34
|
}
|
|
36
35
|
export declare enum ReportAccessType {
|
|
@@ -38,7 +37,7 @@ export declare enum ReportAccessType {
|
|
|
38
37
|
Private = "PRIVATE"
|
|
39
38
|
}
|
|
40
39
|
export interface ReportAccessResponse {
|
|
41
|
-
/** The access type of the report. Can be PUBLIC or PRIVATE. */
|
|
40
|
+
/** The access type of the report. Can be 'PUBLIC' or 'PRIVATE'. */
|
|
42
41
|
accessType: ReportAccessType;
|
|
43
42
|
/** The users allowed to access the specified report. */
|
|
44
43
|
allowedUsers: UserResponse[];
|
|
@@ -60,26 +59,26 @@ export interface ReportUsersResponse {
|
|
|
60
59
|
allowedUsers: UserResponse[];
|
|
61
60
|
}
|
|
62
61
|
interface AccountMetaModel {
|
|
63
|
-
/** The filters that are applied to the user */
|
|
62
|
+
/** The filters that are applied to the user. */
|
|
64
63
|
filters: string[];
|
|
65
64
|
/** The reports the user can view. */
|
|
66
65
|
reports: string[];
|
|
67
66
|
}
|
|
68
67
|
export interface UserResponse extends AccountMetaModel {
|
|
69
|
-
/** The user id */
|
|
68
|
+
/** The user id. */
|
|
70
69
|
userId: string;
|
|
71
|
-
/** The user account */
|
|
70
|
+
/** The user account. */
|
|
72
71
|
account: string;
|
|
73
72
|
}
|
|
74
73
|
export interface GroupResponse extends AccountMetaModel {
|
|
75
|
-
/** The group id */
|
|
74
|
+
/** The group id. */
|
|
76
75
|
groupId: string;
|
|
77
|
-
/** The group account */
|
|
76
|
+
/** The group account. */
|
|
78
77
|
account: string;
|
|
79
78
|
}
|
|
80
79
|
export type StatusResponse = Record<string, unknown>;
|
|
81
80
|
export interface GetReportTemplateOptions {
|
|
82
|
-
/** Whether to include metadata about the report template */
|
|
81
|
+
/** Whether to include metadata about the report template. */
|
|
83
82
|
includeMetadata?: boolean;
|
|
84
83
|
}
|
|
85
84
|
export interface TemplateMetadataResponse {
|
|
@@ -1,16 +1,55 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ReadServiceResource from '../ReadServiceResource';
|
|
2
2
|
import { GetCreditUsageParams, SnowflakeCreditUsageModel, SnowflakeNetworkPolicyModel, SnowflakeReaderAccountEndpointModel, SnowflakeReaderAccountStatusModel, SnowflakeUserModel, SnowflakeUsersModel } from './SnowflakeInterfaces';
|
|
3
|
-
export default class Snowflake extends
|
|
3
|
+
export default class Snowflake extends ReadServiceResource {
|
|
4
4
|
static baseUrl: string;
|
|
5
|
+
/**
|
|
6
|
+
* Get the details for all users from a Snowflake reader account.
|
|
7
|
+
*/
|
|
5
8
|
listUsers(): Promise<SnowflakeUsersModel>;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new user within a Snowflake reader account.
|
|
11
|
+
*/
|
|
6
12
|
createUser(model: SnowflakeUserModel): Promise<SnowflakeUserModel>;
|
|
13
|
+
/**
|
|
14
|
+
* Delete a user from a Snowflake reader account.
|
|
15
|
+
*
|
|
16
|
+
* @param snowflakeUser The login name for the Snowflake user.
|
|
17
|
+
*/
|
|
7
18
|
deleteUser(snowflakeUser: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the details for a specific user from a Snowflake reader account.
|
|
21
|
+
*
|
|
22
|
+
* @param snowflakeUser The login name for the Snowflake user.
|
|
23
|
+
*/
|
|
8
24
|
getUser(snowflakeUser: string): Promise<SnowflakeUserModel>;
|
|
25
|
+
/**
|
|
26
|
+
* Reset a user's password in a Snowflake reader account.
|
|
27
|
+
*
|
|
28
|
+
* @param snowflakeUser The login name for the Snowflake user.
|
|
29
|
+
*/
|
|
9
30
|
resetPassword(snowflakeUser: string): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Get the details of the active network policy for a Snowflake reader account.
|
|
33
|
+
*/
|
|
10
34
|
getNetworkPolicy(): Promise<SnowflakeNetworkPolicyModel>;
|
|
35
|
+
/**
|
|
36
|
+
* Set the details of the active network policy for a Snowflake reader account.
|
|
37
|
+
*/
|
|
11
38
|
updateNetworkPolicy(model: SnowflakeNetworkPolicyModel): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Get the amount of compute credits used by a Snowflake reader account within a date range.
|
|
41
|
+
*/
|
|
12
42
|
getCreditUsage(params: GetCreditUsageParams): Promise<SnowflakeCreditUsageModel>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve Snowflake reader account state.
|
|
45
|
+
*/
|
|
13
46
|
getSnowflakeReaderAccount(): Promise<SnowflakeReaderAccountStatusModel>;
|
|
47
|
+
/**
|
|
48
|
+
* Retrieve Snowflake reader account endpoint.
|
|
49
|
+
*/
|
|
14
50
|
getSnowflakeReaderAccountEndpoint(): Promise<SnowflakeReaderAccountEndpointModel>;
|
|
51
|
+
/**
|
|
52
|
+
* Create a reader account.
|
|
53
|
+
*/
|
|
15
54
|
createSnowflakeReaderAccount(): Promise<void>;
|
|
16
55
|
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { SnowflakeReaderAccountStatus } from '../../../Enums';
|
|
2
|
+
import { TimeRangeParamParts } from '../CommonParamParts';
|
|
2
3
|
export interface SnowflakeUsersModel {
|
|
3
4
|
snowflakeUsers: SnowflakeUserModel[];
|
|
4
5
|
}
|
|
5
6
|
export interface SnowflakeUserModel {
|
|
6
7
|
/**
|
|
7
|
-
* The username of the user
|
|
8
|
+
* The username of the user.
|
|
8
9
|
*/
|
|
9
10
|
username: string;
|
|
10
11
|
/**
|
|
11
|
-
* The email of the user
|
|
12
|
+
* The email of the user.
|
|
12
13
|
*/
|
|
13
14
|
email: string;
|
|
14
15
|
/**
|
|
15
|
-
* The number of days that the user has access to the reader account
|
|
16
|
+
* The number of days that the user has access to the reader account.
|
|
17
|
+
* Ranging from 0 (indefinitely) to 90 days.
|
|
16
18
|
*/
|
|
17
19
|
daysToExpiry?: number;
|
|
18
20
|
}
|
|
@@ -20,30 +22,20 @@ export interface SnowflakeNetworkPolicyModel {
|
|
|
20
22
|
allowedIpAddresses: string[];
|
|
21
23
|
blockedIpAddresses: string[];
|
|
22
24
|
}
|
|
23
|
-
export interface GetCreditUsageParams {
|
|
24
|
-
/**
|
|
25
|
-
* The beginning date of the date range.
|
|
26
|
-
* ISO8601 format 'YYYY-MM-DDThh:mm:ss.sssZ'
|
|
27
|
-
*/
|
|
28
|
-
from: string;
|
|
29
|
-
/**
|
|
30
|
-
* The end date of the date range.
|
|
31
|
-
* ISO8601 format 'YYYY-MM-DDThh:mm:ss.sssZ'
|
|
32
|
-
*/
|
|
33
|
-
to: string;
|
|
25
|
+
export interface GetCreditUsageParams extends TimeRangeParamParts {
|
|
34
26
|
}
|
|
35
27
|
export interface SnowflakeCreditUsageModel {
|
|
36
28
|
creditsUsed: number;
|
|
37
29
|
}
|
|
38
30
|
export interface SnowflakeReaderAccountStatusModel {
|
|
39
31
|
/**
|
|
40
|
-
* The status of the create reader account request
|
|
32
|
+
* The status of the create reader account request.
|
|
41
33
|
*/
|
|
42
34
|
snowflakeReaderAccountStatus: SnowflakeReaderAccountStatus;
|
|
43
35
|
}
|
|
44
36
|
export interface SnowflakeReaderAccountEndpointModel {
|
|
45
37
|
/**
|
|
46
|
-
* The endpoint of the reader account
|
|
38
|
+
* The endpoint of the reader account.
|
|
47
39
|
*/
|
|
48
40
|
endpoint: string;
|
|
49
41
|
}
|