@explo-tech/fido-api 0.0.8 → 0.0.9

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/index.ts CHANGED
@@ -7,9 +7,11 @@ export { OpenAPI } from './core/OpenAPI';
7
7
  export type { OpenAPIConfig } from './core/OpenAPI';
8
8
 
9
9
  export type { BooleanPropertyValue } from './models/BooleanPropertyValue';
10
+ export type { BulkViewsRequest } from './models/BulkViewsRequest';
11
+ export type { BulkViewsResponse } from './models/BulkViewsResponse';
10
12
  export type { ClientError } from './models/ClientError';
11
13
  export type { Computation } from './models/Computation';
12
- export type { ComputedViewRunRequest } from './models/ComputedViewRunRequest';
14
+ export type { ComputedView } from './models/ComputedView';
13
15
  export type { DataPage } from './models/DataPage';
14
16
  export type { DataRecord } from './models/DataRecord';
15
17
  export type { DataRequestParameters } from './models/DataRequestParameters';
@@ -19,7 +21,6 @@ export type { DataSource } from './models/DataSource';
19
21
  export type { DataSourceConfiguration } from './models/DataSourceConfiguration';
20
22
  export type { DataSourceRequest } from './models/DataSourceRequest';
21
23
  export type { DataSourceResponse } from './models/DataSourceResponse';
22
- export type { DataSourceTablePreviewRequest } from './models/DataSourceTablePreviewRequest';
23
24
  export type { DatePropertyValue } from './models/DatePropertyValue';
24
25
  export type { DateTimePropertyValue } from './models/DateTimePropertyValue';
25
26
  export type { DecimalPropertyValue } from './models/DecimalPropertyValue';
@@ -28,6 +29,8 @@ export type { Duration } from './models/Duration';
28
29
  export type { Filter } from './models/Filter';
29
30
  export type { IntegerPropertyValue } from './models/IntegerPropertyValue';
30
31
  export type { LocalDate } from './models/LocalDate';
32
+ export type { MySql } from './models/MySql';
33
+ export type { MySqlAuthentication } from './models/MySqlAuthentication';
31
34
  export type { Namespace } from './models/Namespace';
32
35
  export type { NamespaceRequest } from './models/NamespaceRequest';
33
36
  export type { NamespaceResponse } from './models/NamespaceResponse';
@@ -43,18 +46,26 @@ export { PropertyType } from './models/PropertyType';
43
46
  export type { PropertyValue } from './models/PropertyValue';
44
47
  export type { PublicTunnel } from './models/PublicTunnel';
45
48
  export type { QueryExecutionResponse } from './models/QueryExecutionResponse';
49
+ export type { QueryPreviewRequest } from './models/QueryPreviewRequest';
46
50
  export type { RequestTelemetry } from './models/RequestTelemetry';
47
51
  export type { Sort } from './models/Sort';
48
52
  export { SortDirection } from './models/SortDirection';
49
53
  export type { SSHAuthentication } from './models/SSHAuthentication';
50
54
  export type { SSHTunnel } from './models/SSHTunnel';
51
55
  export type { StringPropertyValue } from './models/StringPropertyValue';
56
+ export type { TablePreviewRequest } from './models/TablePreviewRequest';
57
+ export type { TableView } from './models/TableView';
52
58
  export type { TenantPrivateKeyAuthentication } from './models/TenantPrivateKeyAuthentication';
53
59
  export type { Tunnel } from './models/Tunnel';
54
60
  export type { UUID } from './models/UUID';
55
61
  export type { VendorPrivateKeyAuthentication } from './models/VendorPrivateKeyAuthentication';
62
+ export type { View } from './models/View';
63
+ export type { ViewRequest } from './models/ViewRequest';
64
+ export type { ViewResponse } from './models/ViewResponse';
65
+ export type { ViewRunRequest } from './models/ViewRunRequest';
56
66
 
57
67
  export { DatasourceResourceService } from './services/DatasourceResourceService';
58
68
  export { HealthResourceService } from './services/HealthResourceService';
59
69
  export { NamespaceResourceService } from './services/NamespaceResourceService';
60
70
  export { QueryResourceService } from './services/QueryResourceService';
71
+ export { ViewResourceService } from './services/ViewResourceService';
@@ -0,0 +1,8 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ export type BulkViewsRequest = {
6
+ viewIds: Array<string>;
7
+ };
8
+
@@ -0,0 +1,10 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type { View } from './View';
6
+
7
+ export type BulkViewsResponse = {
8
+ views: Array<View>;
9
+ };
10
+
@@ -0,0 +1,16 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type { PropertySchema } from './PropertySchema';
6
+ import type { UUID } from './UUID';
7
+
8
+ export type ComputedView = {
9
+ name: string;
10
+ description: string;
11
+ columnDefinitions: Array<PropertySchema>;
12
+ id: UUID | null;
13
+ namespaceId: UUID | null;
14
+ query: string;
15
+ };
16
+
@@ -2,10 +2,11 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
 
5
+ import type { MySql } from './MySql';
5
6
  import type { Postgres } from './Postgres';
6
7
  import type { Tunnel } from './Tunnel';
7
8
 
8
- export type DataSourceConfiguration = (Postgres | {
9
+ export type DataSourceConfiguration = (Postgres | MySql | {
9
10
  tunnel: Tunnel;
10
11
  });
11
12
 
@@ -0,0 +1,15 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type { MySqlAuthentication } from './MySqlAuthentication';
6
+ import type { Tunnel } from './Tunnel';
7
+
8
+ export type MySql = {
9
+ tunnel: Tunnel;
10
+ authentication: MySqlAuthentication;
11
+ database: string;
12
+ host: string;
13
+ port?: number;
14
+ };
15
+
@@ -0,0 +1,8 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type { PasswordAuthentication } from './PasswordAuthentication';
6
+
7
+ export type MySqlAuthentication = PasswordAuthentication;
8
+
@@ -5,7 +5,7 @@
5
5
  import type { Computation } from './Computation';
6
6
  import type { DataRequestParameters } from './DataRequestParameters';
7
7
 
8
- export type ComputedViewRunRequest = {
8
+ export type QueryPreviewRequest = {
9
9
  query: string;
10
10
  tableIdentifier: string;
11
11
  dataRequestParameters: DataRequestParameters;
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type { DataRequestParameters } from './DataRequestParameters';
6
6
 
7
- export type DataSourceTablePreviewRequest = {
7
+ export type TablePreviewRequest = {
8
8
  tableIdentifier: string;
9
9
  dataRequestParameters: DataRequestParameters;
10
10
  };
@@ -0,0 +1,16 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type { PropertySchema } from './PropertySchema';
6
+ import type { UUID } from './UUID';
7
+
8
+ export type TableView = {
9
+ name: string;
10
+ description: string;
11
+ columnDefinitions: Array<PropertySchema>;
12
+ id: UUID | null;
13
+ namespaceId: UUID | null;
14
+ tableName: string;
15
+ };
16
+
package/models/View.ts ADDED
@@ -0,0 +1,17 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type { ComputedView } from './ComputedView';
6
+ import type { PropertySchema } from './PropertySchema';
7
+ import type { TableView } from './TableView';
8
+ import type { UUID } from './UUID';
9
+
10
+ export type View = (TableView | ComputedView | {
11
+ name: string;
12
+ description: string;
13
+ columnDefinitions: Array<PropertySchema>;
14
+ id: UUID | null;
15
+ namespaceId: UUID | null;
16
+ });
17
+
@@ -0,0 +1,10 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type { View } from './View';
6
+
7
+ export type ViewRequest = {
8
+ view: View;
9
+ };
10
+
@@ -0,0 +1,10 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type { View } from './View';
6
+
7
+ export type ViewResponse = {
8
+ view: View;
9
+ };
10
+
@@ -0,0 +1,13 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type { Computation } from './Computation';
6
+ import type { DataRequestParameters } from './DataRequestParameters';
7
+
8
+ export type ViewRunRequest = {
9
+ dataRequestParameters: DataRequestParameters;
10
+ queryContext: Record<string, any>;
11
+ computation: Computation | null;
12
+ };
13
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explo-tech/fido-api",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Fido api",
5
5
  "homepage": "https://github.com/trust-kaz/fido",
6
6
  "license": "MIT",
@@ -1,10 +1,11 @@
1
1
  /* istanbul ignore file */
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- import type { ComputedViewRunRequest } from '../models/ComputedViewRunRequest';
5
- import type { DataSourceTablePreviewRequest } from '../models/DataSourceTablePreviewRequest';
6
4
  import type { QueryExecutionResponse } from '../models/QueryExecutionResponse';
5
+ import type { QueryPreviewRequest } from '../models/QueryPreviewRequest';
6
+ import type { TablePreviewRequest } from '../models/TablePreviewRequest';
7
7
  import type { UUID } from '../models/UUID';
8
+ import type { ViewRunRequest } from '../models/ViewRunRequest';
8
9
 
9
10
  import type { CancelablePromise } from '../core/CancelablePromise';
10
11
  import { OpenAPI } from '../core/OpenAPI';
@@ -20,10 +21,10 @@ export class QueryResourceService {
20
21
  * @returns QueryExecutionResponse A DataPage of the provided query
21
22
  * @throws ApiError
22
23
  */
23
- public static runComputedView(
24
+ public static getQueryPreview(
24
25
  dataSourceId: UUID,
25
26
  namespaceId: UUID,
26
- requestBody?: ComputedViewRunRequest,
27
+ requestBody?: QueryPreviewRequest,
27
28
  ): CancelablePromise<QueryExecutionResponse> {
28
29
  return __request(OpenAPI, {
29
30
  method: 'POST',
@@ -45,10 +46,10 @@ export class QueryResourceService {
45
46
  * @returns QueryExecutionResponse A DataPage of the resulting Data Source's data
46
47
  * @throws ApiError
47
48
  */
48
- public static getDatasourceTablePreview(
49
+ public static getTablePreview(
49
50
  dataSourceId: UUID,
50
51
  namespaceId: UUID,
51
- requestBody?: DataSourceTablePreviewRequest,
52
+ requestBody?: TablePreviewRequest,
52
53
  ): CancelablePromise<QueryExecutionResponse> {
53
54
  return __request(OpenAPI, {
54
55
  method: 'POST',
@@ -62,4 +63,32 @@ export class QueryResourceService {
62
63
  });
63
64
  }
64
65
 
66
+ /**
67
+ * Runs the requested view against the provided data source
68
+ * @param dataSourceId
69
+ * @param namespaceId
70
+ * @param viewId
71
+ * @param requestBody
72
+ * @returns QueryExecutionResponse A DataPage of the provided query
73
+ * @throws ApiError
74
+ */
75
+ public static runView(
76
+ dataSourceId: UUID,
77
+ namespaceId: UUID,
78
+ viewId: UUID,
79
+ requestBody?: ViewRunRequest,
80
+ ): CancelablePromise<QueryExecutionResponse> {
81
+ return __request(OpenAPI, {
82
+ method: 'POST',
83
+ url: '/v1/namespaces/{namespaceId}/data-sources/{dataSourceId}/views/{viewId}/run',
84
+ path: {
85
+ 'dataSourceId': dataSourceId,
86
+ 'namespaceId': namespaceId,
87
+ 'viewId': viewId,
88
+ },
89
+ body: requestBody,
90
+ mediaType: 'application/json',
91
+ });
92
+ }
93
+
65
94
  }
@@ -0,0 +1,156 @@
1
+ /* istanbul ignore file */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import type { BulkViewsRequest } from '../models/BulkViewsRequest';
5
+ import type { UUID } from '../models/UUID';
6
+ import type { View } from '../models/View';
7
+ import type { ViewRequest } from '../models/ViewRequest';
8
+ import type { ViewResponse } from '../models/ViewResponse';
9
+
10
+ import type { CancelablePromise } from '../core/CancelablePromise';
11
+ import { OpenAPI } from '../core/OpenAPI';
12
+ import { request as __request } from '../core/request';
13
+
14
+ export class ViewResourceService {
15
+
16
+ /**
17
+ * Deletes a view
18
+ * @param namespaceId
19
+ * @param requestBody
20
+ * @returns any The requested views
21
+ * @throws ApiError
22
+ */
23
+ public static getViews(
24
+ namespaceId: UUID,
25
+ requestBody?: BulkViewsRequest,
26
+ ): CancelablePromise<{
27
+ views: Array<View>;
28
+ }> {
29
+ return __request(OpenAPI, {
30
+ method: 'POST',
31
+ url: '/v1/namespaces/{namespaceId}/views/bulk-get',
32
+ path: {
33
+ 'namespaceId': namespaceId,
34
+ },
35
+ body: requestBody,
36
+ mediaType: 'application/json',
37
+ });
38
+ }
39
+
40
+ /**
41
+ * Clones the request set of views
42
+ * @param namespaceId
43
+ * @param requestBody
44
+ * @returns any The cloned views
45
+ * @throws ApiError
46
+ */
47
+ public static cloneViews(
48
+ namespaceId: UUID,
49
+ requestBody?: BulkViewsRequest,
50
+ ): CancelablePromise<{
51
+ views: Array<View>;
52
+ }> {
53
+ return __request(OpenAPI, {
54
+ method: 'POST',
55
+ url: '/v1/namespaces/{namespaceId}/views/clone',
56
+ path: {
57
+ 'namespaceId': namespaceId,
58
+ },
59
+ body: requestBody,
60
+ mediaType: 'application/json',
61
+ });
62
+ }
63
+
64
+ /**
65
+ * Gets a view
66
+ * @param id
67
+ * @param namespaceId
68
+ * @returns ViewResponse The requested view
69
+ * @throws ApiError
70
+ */
71
+ public static getView(
72
+ id: UUID,
73
+ namespaceId: UUID,
74
+ ): CancelablePromise<ViewResponse> {
75
+ return __request(OpenAPI, {
76
+ method: 'GET',
77
+ url: '/v1/namespaces/{namespaceId}/views/{id}',
78
+ path: {
79
+ 'id': id,
80
+ 'namespaceId': namespaceId,
81
+ },
82
+ });
83
+ }
84
+
85
+ /**
86
+ * Updates a view's metadata
87
+ * @param id
88
+ * @param namespaceId
89
+ * @param requestBody
90
+ * @returns ViewResponse The updated view
91
+ * @throws ApiError
92
+ */
93
+ public static updateView(
94
+ id: UUID,
95
+ namespaceId: UUID,
96
+ requestBody?: ViewRequest,
97
+ ): CancelablePromise<ViewResponse> {
98
+ return __request(OpenAPI, {
99
+ method: 'PUT',
100
+ url: '/v1/namespaces/{namespaceId}/views/{id}',
101
+ path: {
102
+ 'id': id,
103
+ 'namespaceId': namespaceId,
104
+ },
105
+ body: requestBody,
106
+ mediaType: 'application/json',
107
+ });
108
+ }
109
+
110
+ /**
111
+ * Creates a view
112
+ * @param id
113
+ * @param namespaceId
114
+ * @param requestBody
115
+ * @returns ViewResponse The requested view
116
+ * @throws ApiError
117
+ */
118
+ public static createView(
119
+ id: UUID,
120
+ namespaceId: UUID,
121
+ requestBody?: ViewRequest,
122
+ ): CancelablePromise<ViewResponse> {
123
+ return __request(OpenAPI, {
124
+ method: 'POST',
125
+ url: '/v1/namespaces/{namespaceId}/views/{id}',
126
+ path: {
127
+ 'id': id,
128
+ 'namespaceId': namespaceId,
129
+ },
130
+ body: requestBody,
131
+ mediaType: 'application/json',
132
+ });
133
+ }
134
+
135
+ /**
136
+ * Deletes a view
137
+ * @param id
138
+ * @param namespaceId
139
+ * @returns any 200 if the view was deleted properly
140
+ * @throws ApiError
141
+ */
142
+ public static deleteView(
143
+ id: UUID,
144
+ namespaceId: UUID,
145
+ ): CancelablePromise<Record<string, any>> {
146
+ return __request(OpenAPI, {
147
+ method: 'DELETE',
148
+ url: '/v1/namespaces/{namespaceId}/views/{id}',
149
+ path: {
150
+ 'id': id,
151
+ 'namespaceId': namespaceId,
152
+ },
153
+ });
154
+ }
155
+
156
+ }