@narrative.io/data-collaboration-sdk-ts 0.0.44 → 0.0.45

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.
@@ -0,0 +1,52 @@
1
+ import { BaseApi } from '../base-api';
2
+ import { type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse } from './types';
3
+ /**
4
+ * @module ForecastApi
5
+ * @description This module provides methods for generating forecasts from a subscription
6
+ * @extends BaseApi
7
+ */
8
+ declare class ForecastApi extends BaseApi {
9
+ /**
10
+ * @function postForecast
11
+ * @memberof ForecastApi
12
+ * @description Gets a forecast for a subscription given the subscription details
13
+ * @returns {Promise<ApiRecords<ForcastResponse>>} A promise that resolves to forecast response.
14
+ */
15
+ postForecast(): Promise<ForecastResponse>;
16
+ /**
17
+ * @function getForecast
18
+ * @memberof ForecastApi
19
+ * @description Gets a forecast for a given forecast id
20
+ * @returns {Promise<ForcastResponse>} A promise that resolves to forecast response.
21
+ */
22
+ getForecast(forecastId: string): Promise<ForecastResponse>;
23
+ /**
24
+ * @function postCostForecast
25
+ * @memberof ForecastApi
26
+ * @description Gets a cost forecast for a subscription given the subscriptions details
27
+ * @returns {Promise<CostForcastResponse>} A promise that resolves to cost forecast response.
28
+ */
29
+ postCostForecast(): Promise<CostForecastResponse>;
30
+ /**
31
+ * @function getCostForecast
32
+ * @memberof ForecastApi
33
+ * @description Gets a forecast for a given cost forecast id
34
+ * @returns {Promise<CostForcastResponse>} A promise that resolves to cost forecast response.
35
+ */
36
+ getCostForecast(costForecastId: string): Promise<CostForecastResponse>;
37
+ /**
38
+ * @function postPublicForecast
39
+ * @memberof ForecastApi
40
+ * @description Gets a forecast for a subscription given the subscriptions details from the public endpoint
41
+ * @returns {Promise<ForcastResponse>} A promise that resolves to forecast response.
42
+ */
43
+ postPublicForecast(): Promise<ForecastResponse>;
44
+ /**
45
+ * @function getPublicForecast
46
+ * @memberof ForecastApi
47
+ * @description Gets a forecast for a given forecast id from the public endpoint
48
+ * @returns {Promise<ForcastResponse>} A promise that resolves to forecast response.
49
+ */
50
+ getPublicForecast(forecastId: string): Promise<ForecastResponse>;
51
+ }
52
+ export { ForecastApi, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse };
@@ -0,0 +1,64 @@
1
+ import { BaseApi } from '../base-api';
2
+ const resourceName = 'data-shops/subscriptions';
3
+ /**
4
+ * @module ForecastApi
5
+ * @description This module provides methods for generating forecasts from a subscription
6
+ * @extends BaseApi
7
+ */
8
+ class ForecastApi extends BaseApi {
9
+ /**
10
+ * @function postForecast
11
+ * @memberof ForecastApi
12
+ * @description Gets a forecast for a subscription given the subscription details
13
+ * @returns {Promise<ApiRecords<ForcastResponse>>} A promise that resolves to forecast response.
14
+ */
15
+ async postForecast() {
16
+ return await this.post(`${resourceName}/forecasts`);
17
+ }
18
+ /**
19
+ * @function getForecast
20
+ * @memberof ForecastApi
21
+ * @description Gets a forecast for a given forecast id
22
+ * @returns {Promise<ForcastResponse>} A promise that resolves to forecast response.
23
+ */
24
+ async getForecast(forecastId) {
25
+ return await this.get(`${resourceName}/forecasts/${forecastId}`);
26
+ }
27
+ /**
28
+ * @function postCostForecast
29
+ * @memberof ForecastApi
30
+ * @description Gets a cost forecast for a subscription given the subscriptions details
31
+ * @returns {Promise<CostForcastResponse>} A promise that resolves to cost forecast response.
32
+ */
33
+ async postCostForecast() {
34
+ return await this.post(`${resourceName}/cost-forecasts`);
35
+ }
36
+ /**
37
+ * @function getCostForecast
38
+ * @memberof ForecastApi
39
+ * @description Gets a forecast for a given cost forecast id
40
+ * @returns {Promise<CostForcastResponse>} A promise that resolves to cost forecast response.
41
+ */
42
+ async getCostForecast(costForecastId) {
43
+ return await this.get(`${resourceName}/forecasts/${costForecastId}`);
44
+ }
45
+ /**
46
+ * @function postPublicForecast
47
+ * @memberof ForecastApi
48
+ * @description Gets a forecast for a subscription given the subscriptions details from the public endpoint
49
+ * @returns {Promise<ForcastResponse>} A promise that resolves to forecast response.
50
+ */
51
+ async postPublicForecast() {
52
+ return await this.post(`${resourceName}/public/forecasts`);
53
+ }
54
+ /**
55
+ * @function getPublicForecast
56
+ * @memberof ForecastApi
57
+ * @description Gets a forecast for a given forecast id from the public endpoint
58
+ * @returns {Promise<ForcastResponse>} A promise that resolves to forecast response.
59
+ */
60
+ async getPublicForecast(forecastId) {
61
+ return await this.get(`${resourceName}/public/forecasts/${forecastId}`);
62
+ }
63
+ }
64
+ export { ForecastApi };
package/build/index.d.ts CHANGED
@@ -18,8 +18,9 @@ import { CompanyInfoApi, type CompanyInfo } from './company-info';
18
18
  import { InstallationsApi, type Installation } from './installations';
19
19
  import { NqlApi, type NqlCompileResult, type NqlQuery, type NqlResult } from './nql';
20
20
  import { DataStreamsApi, type DataStream } from './data-streams';
21
+ import { ForecastApi, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse } from './forecast';
21
22
  declare class NarrativeApi extends BaseApi {
22
23
  }
23
- interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi {
24
+ interface NarrativeApi extends BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi {
24
25
  }
25
- export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, type Resource, type UploadsResponse, type PingStatus, type Attribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type NqlQuery, type NqlResult, type NqlCompileResult, type DataStream };
26
+ export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi, type Resource, type UploadsResponse, type PingStatus, type Attribute, type Environment, type Config, type ApiRecords, type Dataset, type HealthCheckResult, type SampleRecords, type DatasetTableSummary, type DatasetTableSummaryAPIResponse, type Product, type MonetaryAmount, type CompanyInfo, type Installation, type FilePerSnapshotResponse, type BucketCreationRequest, type UpdateAccessTypeRequest, type NqlQuery, type NqlResult, type NqlCompileResult, type DataStream, type ForecastRequest, type ForecastResponse, type CostForecastRequest, type CostForecastResponse };
package/build/index.js CHANGED
@@ -12,7 +12,8 @@ import { CompanyInfoApi } from './company-info';
12
12
  import { InstallationsApi } from './installations';
13
13
  import { NqlApi } from './nql';
14
14
  import { DataStreamsApi } from './data-streams';
15
+ import { ForecastApi } from './forecast';
15
16
  class NarrativeApi extends BaseApi {
16
17
  }
17
- applyMixins(NarrativeApi, [BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi]);
18
- export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi };
18
+ applyMixins(NarrativeApi, [BaseApi, HealthCheckApi, DatasetApi, RosettaStoneApi, AttributeApi, PingApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi]);
19
+ export { NarrativeApi, AttributeApi, HealthCheckApi, DatasetApi, PingApi, ProductsApi, CompanyInfoApi, InstallationsApi, UploadsApi, ResourceApi, NqlApi, DataStreamsApi, ForecastApi };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",