namirasoft-cost 1.4.25 → 1.4.26
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/.ns-sdkg-file-keep +9 -8
- package/dist/NamirasoftCostServerBillWatchAWS.d.ts +2 -2
- package/dist/NamirasoftCostServerBillWatchAWS.js +4 -4
- package/dist/NamirasoftCostServerBillWatchAzure.d.ts +2 -2
- package/dist/NamirasoftCostServerBillWatchAzure.js +4 -4
- package/dist/NamirasoftCostServerBillWatchGCP.d.ts +2 -2
- package/dist/NamirasoftCostServerBillWatchGCP.js +4 -4
- package/dist/NamirasoftCostServerFieldCategory.d.ts +2 -2
- package/dist/NamirasoftCostServerFieldCategory.js +4 -4
- package/dist/NamirasoftCostServerFieldField.d.ts +2 -2
- package/dist/NamirasoftCostServerFieldField.js +4 -4
- package/dist/NamirasoftCostServerSecretSecret.d.ts +2 -2
- package/dist/NamirasoftCostServerSecretSecret.js +4 -4
- package/dist/index.d.ts +1 -29
- package/dist/index.js +1 -29
- package/dist/index.js.map +1 -1
- package/dist/type/Bonus.d.ts +9 -0
- package/dist/type/Bonus.js +16 -0
- package/dist/type/Bonus.js.map +1 -0
- package/dist/type/Estimation.d.ts +4 -0
- package/dist/type/Estimation.js +22 -0
- package/dist/type/Estimation.js.map +1 -1
- package/dist/type/EstimationOption.d.ts +4 -0
- package/dist/type/EstimationOption.js +20 -0
- package/dist/type/EstimationOption.js.map +1 -1
- package/dist/type/EstimationUsage.d.ts +4 -0
- package/dist/type/EstimationUsage.js +15 -0
- package/dist/type/EstimationUsage.js.map +1 -1
- package/dist/type/Period.d.ts +4 -0
- package/dist/type/Period.js +27 -4
- package/dist/type/Period.js.map +1 -1
- package/package.json +4 -3
- package/src/NamirasoftCostServerBillWatchAWS.ts +4 -4
- package/src/NamirasoftCostServerBillWatchAzure.ts +4 -4
- package/src/NamirasoftCostServerBillWatchGCP.ts +4 -4
- package/src/NamirasoftCostServerFieldCategory.ts +4 -4
- package/src/NamirasoftCostServerFieldField.ts +4 -4
- package/src/NamirasoftCostServerSecretSecret.ts +4 -4
- package/src/index.ts +1 -29
- package/src/type/Bonus.ts +21 -0
- package/src/type/Estimation.ts +24 -3
- package/src/type/EstimationOption.ts +22 -2
- package/src/type/EstimationUsage.ts +18 -1
- package/src/type/Period.ts +27 -3
- package/dist/command/BillWatchAWSCommand.d.ts +0 -4
- package/dist/command/BillWatchAWSCommand.js +0 -17
- package/dist/command/BillWatchAWSCommand.js.map +0 -1
- package/dist/command/BillWatchAWSEstimateHourlyCommand.d.ts +0 -5
- package/dist/command/BillWatchAWSEstimateHourlyCommand.js +0 -76
- package/dist/command/BillWatchAWSEstimateHourlyCommand.js.map +0 -1
- package/dist/command/BillWatchAWS_CreateForHourlyCommand.d.ts +0 -5
- package/dist/command/BillWatchAWS_CreateForHourlyCommand.js +0 -94
- package/dist/command/BillWatchAWS_CreateForHourlyCommand.js.map +0 -1
- package/dist/command/BillWatchAzureCommand.d.ts +0 -4
- package/dist/command/BillWatchAzureCommand.js +0 -17
- package/dist/command/BillWatchAzureCommand.js.map +0 -1
- package/dist/command/BillWatchAzureEstimateHourlyCommand.d.ts +0 -5
- package/dist/command/BillWatchAzureEstimateHourlyCommand.js +0 -76
- package/dist/command/BillWatchAzureEstimateHourlyCommand.js.map +0 -1
- package/dist/command/BillWatchAzure_CreateForHourlyCommand.d.ts +0 -5
- package/dist/command/BillWatchAzure_CreateForHourlyCommand.js +0 -94
- package/dist/command/BillWatchAzure_CreateForHourlyCommand.js.map +0 -1
- package/dist/command/BillWatchGCPCommand.d.ts +0 -4
- package/dist/command/BillWatchGCPCommand.js +0 -17
- package/dist/command/BillWatchGCPCommand.js.map +0 -1
- package/dist/command/BillWatchGCPEstimateHourlyCommand.d.ts +0 -5
- package/dist/command/BillWatchGCPEstimateHourlyCommand.js +0 -76
- package/dist/command/BillWatchGCPEstimateHourlyCommand.js.map +0 -1
- package/dist/command/BillWatchGCP_CreateForHourlyCommand.d.ts +0 -5
- package/dist/command/BillWatchGCP_CreateForHourlyCommand.js +0 -94
- package/dist/command/BillWatchGCP_CreateForHourlyCommand.js.map +0 -1
- package/dist/command/CostCommand.d.ts +0 -4
- package/dist/command/CostCommand.js +0 -17
- package/dist/command/CostCommand.js.map +0 -1
- package/dist/command/CostListCommand.d.ts +0 -5
- package/dist/command/CostListCommand.js +0 -38
- package/dist/command/CostListCommand.js.map +0 -1
- package/dist/command/Cost_CreateForCommand.d.ts +0 -5
- package/dist/command/Cost_CreateForCommand.js +0 -175
- package/dist/command/Cost_CreateForCommand.js.map +0 -1
- package/dist/command/FieldCategoryCommand.d.ts +0 -4
- package/dist/command/FieldCategoryCommand.js +0 -17
- package/dist/command/FieldCategoryCommand.js.map +0 -1
- package/dist/command/FieldCategoryEstimateHourlyCommand.d.ts +0 -5
- package/dist/command/FieldCategoryEstimateHourlyCommand.js +0 -76
- package/dist/command/FieldCategoryEstimateHourlyCommand.js.map +0 -1
- package/dist/command/FieldCategory_CreateForHourlyCommand.d.ts +0 -5
- package/dist/command/FieldCategory_CreateForHourlyCommand.js +0 -94
- package/dist/command/FieldCategory_CreateForHourlyCommand.js.map +0 -1
- package/dist/command/FieldFieldCommand.d.ts +0 -4
- package/dist/command/FieldFieldCommand.js +0 -17
- package/dist/command/FieldFieldCommand.js.map +0 -1
- package/dist/command/FieldFieldEstimateHourlyCommand.d.ts +0 -5
- package/dist/command/FieldFieldEstimateHourlyCommand.js +0 -76
- package/dist/command/FieldFieldEstimateHourlyCommand.js.map +0 -1
- package/dist/command/FieldField_CreateForHourlyCommand.d.ts +0 -5
- package/dist/command/FieldField_CreateForHourlyCommand.js +0 -94
- package/dist/command/FieldField_CreateForHourlyCommand.js.map +0 -1
- package/dist/command/HealthzCommand.d.ts +0 -4
- package/dist/command/HealthzCommand.js +0 -15
- package/dist/command/HealthzCommand.js.map +0 -1
- package/dist/command/HealthzGetCommand.d.ts +0 -5
- package/dist/command/HealthzGetCommand.js +0 -38
- package/dist/command/HealthzGetCommand.js.map +0 -1
- package/dist/command/MetricsCommand.d.ts +0 -4
- package/dist/command/MetricsCommand.js +0 -15
- package/dist/command/MetricsCommand.js.map +0 -1
- package/dist/command/MetricsGetCommand.d.ts +0 -5
- package/dist/command/MetricsGetCommand.js +0 -38
- package/dist/command/MetricsGetCommand.js.map +0 -1
- package/dist/command/SecretSecretCommand.d.ts +0 -4
- package/dist/command/SecretSecretCommand.js +0 -21
- package/dist/command/SecretSecretCommand.js.map +0 -1
- package/dist/command/SecretSecretEstimateHourlyCommand.d.ts +0 -5
- package/dist/command/SecretSecretEstimateHourlyCommand.js +0 -76
- package/dist/command/SecretSecretEstimateHourlyCommand.js.map +0 -1
- package/dist/command/SecretSecretEstimateReadCommand.d.ts +0 -5
- package/dist/command/SecretSecretEstimateReadCommand.js +0 -76
- package/dist/command/SecretSecretEstimateReadCommand.js.map +0 -1
- package/dist/command/SecretSecret_CreateForHourlyCommand.d.ts +0 -5
- package/dist/command/SecretSecret_CreateForHourlyCommand.js +0 -94
- package/dist/command/SecretSecret_CreateForHourlyCommand.js.map +0 -1
- package/dist/command/SecretSecret_CreateForReadCommand.d.ts +0 -5
- package/dist/command/SecretSecret_CreateForReadCommand.js +0 -94
- package/dist/command/SecretSecret_CreateForReadCommand.js.map +0 -1
- package/dist/command/ValueCommand.d.ts +0 -4
- package/dist/command/ValueCommand.js +0 -15
- package/dist/command/ValueCommand.js.map +0 -1
- package/dist/command/ValueListCommand.d.ts +0 -5
- package/dist/command/ValueListCommand.js +0 -38
- package/dist/command/ValueListCommand.js.map +0 -1
- package/dist/command/cli.d.ts +0 -2
- package/dist/command/cli.js +0 -32
- package/dist/command/cli.js.map +0 -1
- package/dist/estimator/BillWatchAWSEstimator.d.ts +0 -3
- package/dist/estimator/BillWatchAWSEstimator.js +0 -8
- package/dist/estimator/BillWatchAWSEstimator.js.map +0 -1
- package/dist/estimator/BillWatchAWSHourlyEstimator.d.ts +0 -3
- package/dist/estimator/BillWatchAWSHourlyEstimator.js +0 -8
- package/dist/estimator/BillWatchAWSHourlyEstimator.js.map +0 -1
- package/dist/estimator/BillWatchAzureEstimator.d.ts +0 -3
- package/dist/estimator/BillWatchAzureEstimator.js +0 -8
- package/dist/estimator/BillWatchAzureEstimator.js.map +0 -1
- package/dist/estimator/BillWatchAzureHourlyEstimator.d.ts +0 -3
- package/dist/estimator/BillWatchAzureHourlyEstimator.js +0 -8
- package/dist/estimator/BillWatchAzureHourlyEstimator.js.map +0 -1
- package/dist/estimator/BillWatchBaseEstimator.d.ts +0 -14
- package/dist/estimator/BillWatchBaseEstimator.js +0 -26
- package/dist/estimator/BillWatchBaseEstimator.js.map +0 -1
- package/dist/estimator/BillWatchBaseHourlyEstimator.d.ts +0 -14
- package/dist/estimator/BillWatchBaseHourlyEstimator.js +0 -26
- package/dist/estimator/BillWatchBaseHourlyEstimator.js.map +0 -1
- package/dist/estimator/BillWatchGCPEstimator.d.ts +0 -3
- package/dist/estimator/BillWatchGCPEstimator.js +0 -8
- package/dist/estimator/BillWatchGCPEstimator.js.map +0 -1
- package/dist/estimator/BillWatchGCPHourlyEstimator.d.ts +0 -3
- package/dist/estimator/BillWatchGCPHourlyEstimator.js +0 -8
- package/dist/estimator/BillWatchGCPHourlyEstimator.js.map +0 -1
- package/dist/estimator/FieldBaseEstimator.d.ts +0 -9
- package/dist/estimator/FieldBaseEstimator.js +0 -22
- package/dist/estimator/FieldBaseEstimator.js.map +0 -1
- package/dist/estimator/FieldBaseHourlyEstimator.d.ts +0 -9
- package/dist/estimator/FieldBaseHourlyEstimator.js +0 -22
- package/dist/estimator/FieldBaseHourlyEstimator.js.map +0 -1
- package/dist/estimator/FieldCategoryEstimator.d.ts +0 -8
- package/dist/estimator/FieldCategoryEstimator.js +0 -12
- package/dist/estimator/FieldCategoryEstimator.js.map +0 -1
- package/dist/estimator/FieldCategoryHourlyEstimator.d.ts +0 -8
- package/dist/estimator/FieldCategoryHourlyEstimator.js +0 -12
- package/dist/estimator/FieldCategoryHourlyEstimator.js.map +0 -1
- package/dist/estimator/FieldFieldEstimator.d.ts +0 -8
- package/dist/estimator/FieldFieldEstimator.js +0 -12
- package/dist/estimator/FieldFieldEstimator.js.map +0 -1
- package/dist/estimator/FieldFieldHourlyEstimator.d.ts +0 -8
- package/dist/estimator/FieldFieldHourlyEstimator.js +0 -12
- package/dist/estimator/FieldFieldHourlyEstimator.js.map +0 -1
- package/dist/estimator/SecretSecretEstimator.d.ts +0 -14
- package/dist/estimator/SecretSecretEstimator.js +0 -25
- package/dist/estimator/SecretSecretEstimator.js.map +0 -1
- package/dist/estimator/SecretSecretHourlyEstimator.d.ts +0 -14
- package/dist/estimator/SecretSecretHourlyEstimator.js +0 -25
- package/dist/estimator/SecretSecretHourlyEstimator.js.map +0 -1
- package/src/command/BillWatchAWSCommand.ts +0 -34
- package/src/command/BillWatchAWSEstimateHourlyCommand.ts +0 -83
- package/src/command/BillWatchAWS_CreateForHourlyCommand.ts +0 -101
- package/src/command/BillWatchAzureCommand.ts +0 -34
- package/src/command/BillWatchAzureEstimateHourlyCommand.ts +0 -83
- package/src/command/BillWatchAzure_CreateForHourlyCommand.ts +0 -101
- package/src/command/BillWatchGCPCommand.ts +0 -34
- package/src/command/BillWatchGCPEstimateHourlyCommand.ts +0 -83
- package/src/command/BillWatchGCP_CreateForHourlyCommand.ts +0 -101
- package/src/command/CostCommand.ts +0 -34
- package/src/command/CostListCommand.ts +0 -45
- package/src/command/Cost_CreateForCommand.ts +0 -182
- package/src/command/FieldCategoryCommand.ts +0 -34
- package/src/command/FieldCategoryEstimateHourlyCommand.ts +0 -83
- package/src/command/FieldCategory_CreateForHourlyCommand.ts +0 -101
- package/src/command/FieldFieldCommand.ts +0 -34
- package/src/command/FieldFieldEstimateHourlyCommand.ts +0 -83
- package/src/command/FieldField_CreateForHourlyCommand.ts +0 -101
- package/src/command/HealthzCommand.ts +0 -32
- package/src/command/HealthzGetCommand.ts +0 -45
- package/src/command/MetricsCommand.ts +0 -32
- package/src/command/MetricsGetCommand.ts +0 -45
- package/src/command/SecretSecretCommand.ts +0 -38
- package/src/command/SecretSecretEstimateHourlyCommand.ts +0 -83
- package/src/command/SecretSecretEstimateReadCommand.ts +0 -83
- package/src/command/SecretSecret_CreateForHourlyCommand.ts +0 -101
- package/src/command/SecretSecret_CreateForReadCommand.ts +0 -101
- package/src/command/ValueCommand.ts +0 -32
- package/src/command/ValueListCommand.ts +0 -45
- package/src/command/cli.ts +0 -51
@@ -29,16 +29,16 @@ export class NamirasoftCostServerBillWatchAWS extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateRecord = this.EstimateRecord.bind(this);
|
33
|
+
this._CreateForRecord = this._CreateForRecord.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
37
|
let path = `/estimation/bill-watch/aws/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
43
|
let path = `/application/user/${user_id}/cost/bill-watch/aws/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
@@ -29,16 +29,16 @@ export class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateRecord = this.EstimateRecord.bind(this);
|
33
|
+
this._CreateForRecord = this._CreateForRecord.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
37
|
let path = `/estimation/bill-watch/azure/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
43
|
let path = `/application/user/${user_id}/cost/bill-watch/azure/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
@@ -29,16 +29,16 @@ export class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateRecord = this.EstimateRecord.bind(this);
|
33
|
+
this._CreateForRecord = this._CreateForRecord.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
37
|
let path = `/estimation/bill-watch/gcp/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
43
|
let path = `/application/user/${user_id}/cost/bill-watch/gcp/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
@@ -29,16 +29,16 @@ export class NamirasoftCostServerFieldCategory extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateRecord = this.EstimateRecord.bind(this);
|
33
|
+
this._CreateForRecord = this._CreateForRecord.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
37
|
let path = `/estimation/field/category/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
43
|
let path = `/application/user/${user_id}/cost/field/category/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
@@ -29,16 +29,16 @@ export class NamirasoftCostServerFieldField extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateRecord = this.EstimateRecord.bind(this);
|
33
|
+
this._CreateForRecord = this._CreateForRecord.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
37
|
let path = `/estimation/field/field/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
43
|
let path = `/application/user/${user_id}/cost/field/field/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
@@ -29,18 +29,18 @@ export class NamirasoftCostServerSecretSecret extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateRecord = this.EstimateRecord.bind(this);
|
33
|
+
this._CreateForRecord = this._CreateForRecord.bind(this);
|
34
34
|
this.EstimateRead = this.EstimateRead.bind(this);
|
35
35
|
this._CreateForRead = this._CreateForRead.bind(this);
|
36
36
|
}
|
37
|
-
async
|
37
|
+
async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
38
38
|
{
|
39
39
|
let path = `/estimation/secret/secret/hourly`;
|
40
40
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
41
41
|
return data;
|
42
42
|
}
|
43
|
-
async
|
43
|
+
async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
44
44
|
{
|
45
45
|
let path = `/application/user/${user_id}/cost/secret/secret/hourly`;
|
46
46
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
package/src/index.ts
CHANGED
@@ -41,39 +41,11 @@ export * from "./NamirasoftCostServerHealthz";
|
|
41
41
|
export * from "./NamirasoftCostServerMetrics";
|
42
42
|
export * from "./NamirasoftCostServerSecretSecret";
|
43
43
|
export * from "./NamirasoftCostServerValue";
|
44
|
-
export * from "./command/BillWatchAWSCommand";
|
45
|
-
export * from "./command/BillWatchAWSEstimateHourlyCommand";
|
46
|
-
export * from "./command/BillWatchAWS_CreateForHourlyCommand";
|
47
|
-
export * from "./command/BillWatchAzureCommand";
|
48
|
-
export * from "./command/BillWatchAzureEstimateHourlyCommand";
|
49
|
-
export * from "./command/BillWatchAzure_CreateForHourlyCommand";
|
50
|
-
export * from "./command/BillWatchGCPCommand";
|
51
|
-
export * from "./command/BillWatchGCPEstimateHourlyCommand";
|
52
|
-
export * from "./command/BillWatchGCP_CreateForHourlyCommand";
|
53
|
-
export * from "./command/CostCommand";
|
54
|
-
export * from "./command/CostListCommand";
|
55
|
-
export * from "./command/Cost_CreateForCommand";
|
56
|
-
export * from "./command/FieldCategoryCommand";
|
57
|
-
export * from "./command/FieldCategoryEstimateHourlyCommand";
|
58
|
-
export * from "./command/FieldCategory_CreateForHourlyCommand";
|
59
|
-
export * from "./command/FieldFieldCommand";
|
60
|
-
export * from "./command/FieldFieldEstimateHourlyCommand";
|
61
|
-
export * from "./command/FieldField_CreateForHourlyCommand";
|
62
|
-
export * from "./command/HealthzCommand";
|
63
|
-
export * from "./command/HealthzGetCommand";
|
64
|
-
export * from "./command/MetricsCommand";
|
65
|
-
export * from "./command/MetricsGetCommand";
|
66
|
-
export * from "./command/SecretSecretCommand";
|
67
|
-
export * from "./command/SecretSecretEstimateHourlyCommand";
|
68
|
-
export * from "./command/SecretSecretEstimateReadCommand";
|
69
|
-
export * from "./command/SecretSecret_CreateForHourlyCommand";
|
70
|
-
export * from "./command/SecretSecret_CreateForReadCommand";
|
71
|
-
export * from "./command/ValueCommand";
|
72
|
-
export * from "./command/ValueListCommand";
|
73
44
|
export * from "./meta/CostMetaTable";
|
74
45
|
export * from "./meta/NamirasoftCostMetaDatabase";
|
75
46
|
export * from "./row/CostCreateRow";
|
76
47
|
export * from "./row/CostRow";
|
48
|
+
export * from "./type/Bonus";
|
77
49
|
export * from "./type/Estimation";
|
78
50
|
export * from "./type/EstimationOption";
|
79
51
|
export * from "./type/EstimationUsage";
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { BaseVariableSchema, ObjectSchema, StringSchema } from "namirasoft-schema";
|
2
|
+
|
3
|
+
export type Bonus =
|
4
|
+
{
|
5
|
+
name: string;
|
6
|
+
value: number;
|
7
|
+
unit: string;
|
8
|
+
};
|
9
|
+
|
10
|
+
export class BonusSchema extends ObjectSchema
|
11
|
+
{
|
12
|
+
constructor(required: boolean)
|
13
|
+
{
|
14
|
+
super("Bonus", required, [
|
15
|
+
new BaseVariableSchema("name", new StringSchema(true)),
|
16
|
+
]);
|
17
|
+
this.external = {
|
18
|
+
package: "./type/Bonus"
|
19
|
+
};
|
20
|
+
}
|
21
|
+
}
|
package/src/type/Estimation.ts
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
import { BaseVariableSchema, IntegerSchema, MoneySchema, ObjectSchema, StringSchema } from "namirasoft-schema";
|
1
2
|
import { BaseBonus } from "../bonus/BaseBonus";
|
2
|
-
import { EstimationOption } from "./EstimationOption";
|
3
|
-
import { EstimationUsage } from "./EstimationUsage";
|
3
|
+
import { EstimationOption, EstimationOptionSchema } from "./EstimationOption";
|
4
|
+
import { EstimationUsage, EstimationUsageSchema } from "./EstimationUsage";
|
5
|
+
import { BonusSchema } from "./Bonus";
|
4
6
|
|
5
7
|
export type Estimation =
|
6
8
|
{
|
@@ -11,4 +13,23 @@ export type Estimation =
|
|
11
13
|
amount: number;
|
12
14
|
currency: string;
|
13
15
|
free?: BaseBonus;
|
14
|
-
};
|
16
|
+
};
|
17
|
+
|
18
|
+
export class EstimationSchema extends ObjectSchema
|
19
|
+
{
|
20
|
+
constructor(required: boolean)
|
21
|
+
{
|
22
|
+
super("Estimation", required, [
|
23
|
+
new BaseVariableSchema("option", new EstimationOptionSchema(true)),
|
24
|
+
new BaseVariableSchema("seconds", new IntegerSchema(true, 1, 3600)),
|
25
|
+
new BaseVariableSchema("usage", new EstimationUsageSchema(true)),
|
26
|
+
new BaseVariableSchema("fee", new MoneySchema(true)),
|
27
|
+
new BaseVariableSchema("amount", new MoneySchema(true, 1)),
|
28
|
+
new BaseVariableSchema("currency", new StringSchema(true)),
|
29
|
+
new BaseVariableSchema("free", new BonusSchema(false)),
|
30
|
+
]);
|
31
|
+
this.external = {
|
32
|
+
package: "./type/Estimation"
|
33
|
+
};
|
34
|
+
}
|
35
|
+
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { BaseVariableSchema, BoolSchema, DateTimeSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
|
2
|
+
import { Period, PeriodSchema } from "./Period";
|
2
3
|
|
3
4
|
export interface EstimationOption
|
4
5
|
{
|
@@ -9,4 +10,23 @@ export interface EstimationOption
|
|
9
10
|
value: number;
|
10
11
|
active: boolean;
|
11
12
|
trial_started_at: Date | null;
|
12
|
-
};
|
13
|
+
};
|
14
|
+
|
15
|
+
export class EstimationOptionSchema extends ObjectSchema
|
16
|
+
{
|
17
|
+
constructor(required: boolean)
|
18
|
+
{
|
19
|
+
super("EstimationOption", required, [
|
20
|
+
new BaseVariableSchema("period", new PeriodSchema(true)),
|
21
|
+
new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
|
22
|
+
new BaseVariableSchema("number", new IntegerSchema(true, 1)),
|
23
|
+
new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
|
24
|
+
new BaseVariableSchema("value", new IntegerSchema(true, 1)),
|
25
|
+
new BaseVariableSchema("active", new BoolSchema(true)),
|
26
|
+
new BaseVariableSchema("trial_started_at", new DateTimeSchema(false)),
|
27
|
+
]);
|
28
|
+
this.external = {
|
29
|
+
package: "./type/EstimationOption"
|
30
|
+
};
|
31
|
+
}
|
32
|
+
}
|
@@ -1,6 +1,23 @@
|
|
1
|
+
import { BaseVariableSchema, IntegerSchema, ObjectSchema, StringSchema } from "namirasoft-schema";
|
2
|
+
|
1
3
|
export type EstimationUsage =
|
2
4
|
{
|
3
5
|
name: string;
|
4
6
|
value: number;
|
5
7
|
unit: string;
|
6
|
-
};
|
8
|
+
};
|
9
|
+
|
10
|
+
export class EstimationUsageSchema extends ObjectSchema
|
11
|
+
{
|
12
|
+
constructor(required: boolean)
|
13
|
+
{
|
14
|
+
super("EstimationUsage", required, [
|
15
|
+
new BaseVariableSchema("name", new StringSchema(true)),
|
16
|
+
new BaseVariableSchema("value", new IntegerSchema(true)),
|
17
|
+
new BaseVariableSchema("unit", new StringSchema(true)),
|
18
|
+
]);
|
19
|
+
this.external = {
|
20
|
+
package: "./type/EstimationUsage"
|
21
|
+
};
|
22
|
+
}
|
23
|
+
}
|
package/src/type/Period.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { TimeOperation } from "namirasoft-core";
|
2
|
+
import { BaseVariableSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
|
2
3
|
|
3
4
|
export type Period =
|
4
5
|
{
|
@@ -16,6 +17,29 @@ export type Period =
|
|
16
17
|
};
|
17
18
|
};
|
18
19
|
|
20
|
+
export class PeriodSchema extends ObjectSchema
|
21
|
+
{
|
22
|
+
constructor(required: boolean)
|
23
|
+
{
|
24
|
+
super("Period", required, [
|
25
|
+
new BaseVariableSchema("year", new IntegerSchema(true, 0, 9999)),
|
26
|
+
new BaseVariableSchema("month", new IntegerSchema(true, 1, 12)),
|
27
|
+
new BaseVariableSchema("day", new IntegerSchema(true, 1, 31)),
|
28
|
+
new BaseVariableSchema("hour", new IntegerSchema(true, 0, 23)),
|
29
|
+
new BaseVariableSchema("start", new ObjectSchema("", true, [
|
30
|
+
new BaseVariableSchema("minute", new IntegerSchema(true, 0, 59)),
|
31
|
+
new BaseVariableSchema("second", new IntegerSchema(true, 0, 59))
|
32
|
+
])),
|
33
|
+
new BaseVariableSchema("end", new ObjectSchema("", true, [
|
34
|
+
new BaseVariableSchema("minute", new IntegerSchema(true, 0, 59)),
|
35
|
+
new BaseVariableSchema("second", new IntegerSchema(true, 0, 59))
|
36
|
+
])),
|
37
|
+
]);
|
38
|
+
this.external = {
|
39
|
+
package: "./type/Period"
|
40
|
+
};
|
41
|
+
}
|
42
|
+
}
|
19
43
|
export class PeriodUtil
|
20
44
|
{
|
21
45
|
static toSeconds(period: Period)
|
@@ -24,15 +48,15 @@ export class PeriodUtil
|
|
24
48
|
}
|
25
49
|
static toDates(period: Period)
|
26
50
|
{
|
27
|
-
let start = new Date(period.year, period.month, period.day, period.hour, period.start.minute, period.start.second);
|
28
|
-
let end = new Date(period.year, period.month, period.day, period.hour, period.end.minute, period.end.second);
|
51
|
+
let start = new Date(period.year, period.month - 1, period.day, period.hour, period.start.minute, period.start.second);
|
52
|
+
let end = new Date(period.year, period.month - 1, period.day, period.hour, period.end.minute, period.end.second);
|
29
53
|
return { start, end };
|
30
54
|
}
|
31
55
|
static byDates(start: Date, end: Date)
|
32
56
|
{
|
33
57
|
return {
|
34
58
|
year: start.getFullYear(),
|
35
|
-
month: start.getMonth(),
|
59
|
+
month: start.getMonth() + 1,
|
36
60
|
day: start.getDate(),
|
37
61
|
hour: start.getHours(),
|
38
62
|
start: {
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BillWatchAWSCommand = void 0;
|
4
|
-
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
5
|
-
const BillWatchAWSEstimateHourlyCommand_1 = require("./BillWatchAWSEstimateHourlyCommand");
|
6
|
-
const BillWatchAWS_CreateForHourlyCommand_1 = require("./BillWatchAWS_CreateForHourlyCommand");
|
7
|
-
class BillWatchAWSCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
8
|
-
constructor(argv) {
|
9
|
-
super(argv, {
|
10
|
-
"estimatehourly": BillWatchAWSEstimateHourlyCommand_1.BillWatchAWSEstimateHourlyCommand,
|
11
|
-
"_createforhourly": BillWatchAWS_CreateForHourlyCommand_1.BillWatchAWS_CreateForHourlyCommand,
|
12
|
-
});
|
13
|
-
}
|
14
|
-
}
|
15
|
-
exports.BillWatchAWSCommand = BillWatchAWSCommand;
|
16
|
-
;
|
17
|
-
//# sourceMappingURL=BillWatchAWSCommand.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"BillWatchAWSCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWSCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,2FAAwF;AACxF,+FAA4F;AAE5F,MAAa,mBAAoB,SAAQ,0CAAoB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,gBAAgB,EAAE,qEAAiC;YACnD,kBAAkB,EAAE,yEAAmC;SAC1D,CAAC,CAAC;IACP,CAAC;CACJ;AATD,kDASC;AAAA,CAAC"}
|
@@ -1,76 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.BillWatchAWSEstimateHourlyCommand = void 0;
|
13
|
-
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
14
|
-
const namirasoft_core_1 = require("namirasoft-core");
|
15
|
-
const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
|
16
|
-
const namirasoft_account_1 = require("namirasoft-account");
|
17
|
-
class BillWatchAWSEstimateHourlyCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
18
|
-
constructor(argv) {
|
19
|
-
super(argv, [], [
|
20
|
-
{
|
21
|
-
name: "first_entity_created_at",
|
22
|
-
short: "",
|
23
|
-
description: "Provides the value of 'first_entity_created_at' in body",
|
24
|
-
optional: true,
|
25
|
-
args: ["first_entity_created_at"],
|
26
|
-
defaults: [""]
|
27
|
-
},
|
28
|
-
{
|
29
|
-
name: "period",
|
30
|
-
short: "",
|
31
|
-
description: "Provides the value of 'period' in body",
|
32
|
-
optional: false,
|
33
|
-
args: ["period"],
|
34
|
-
defaults: [""]
|
35
|
-
},
|
36
|
-
{
|
37
|
-
name: "row_number",
|
38
|
-
short: "",
|
39
|
-
description: "Provides the value of 'row_number' in body",
|
40
|
-
optional: false,
|
41
|
-
args: ["row_number"],
|
42
|
-
defaults: [""]
|
43
|
-
},
|
44
|
-
{
|
45
|
-
name: "active",
|
46
|
-
short: "",
|
47
|
-
description: "Provides the value of 'active' in body",
|
48
|
-
optional: false,
|
49
|
-
args: ["active"],
|
50
|
-
defaults: [""]
|
51
|
-
}
|
52
|
-
]);
|
53
|
-
}
|
54
|
-
exec() {
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
56
|
-
let token = this.app.storage.getNSAToken();
|
57
|
-
if (token == null)
|
58
|
-
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
59
|
-
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
60
|
-
let manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
61
|
-
manager.setValue(token, false);
|
62
|
-
let url = this.app.storage.getItem("ns-cost-server-url");
|
63
|
-
let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
64
|
-
let ans = yield server.bill_watch_aws.EstimateHourly({
|
65
|
-
first_entity_created_at: this.option_values.first_entity_created_at,
|
66
|
-
period: this.option_values.period,
|
67
|
-
row_number: this.option_values.row_number,
|
68
|
-
active: this.option_values.active
|
69
|
-
});
|
70
|
-
this.app.logger.success(JSON.stringify(ans));
|
71
|
-
});
|
72
|
-
}
|
73
|
-
}
|
74
|
-
exports.BillWatchAWSEstimateHourlyCommand = BillWatchAWSEstimateHourlyCommand;
|
75
|
-
;
|
76
|
-
//# sourceMappingURL=BillWatchAWSEstimateHourlyCommand.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"BillWatchAWSEstimateHourlyCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWSEstimateHourlyCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,iCAAkC,SAAQ,sCAAgB;IAEnE,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,IAAI,EAAE,yBAAyB;gBAC/B,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,yDAAyD;gBACtE,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,CAAC,yBAAyB,CAAC;gBACjC,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wCAAwC;gBACrD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,YAAY,CAAC;gBACpB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wCAAwC;gBACrD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;SACA,CAAC,CAAC;IACX,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,yGAAyG,CAAC,CAAC;YAC/H,IAAI,OAAO,GAAG,IAAI,yCAAuB,EAAE,CAAC;YAC5C,IAAI,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;YACzD,IAAI,MAAM,GAAG,IAAI,2CAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC;gBACjD,uBAAuB,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB;gBACnE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;gBACzC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;aACpC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAzDD,8EAyDC;AAAA,CAAC"}
|
@@ -1,94 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.BillWatchAWS_CreateForHourlyCommand = void 0;
|
13
|
-
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
14
|
-
const namirasoft_core_1 = require("namirasoft-core");
|
15
|
-
const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
|
16
|
-
const namirasoft_account_1 = require("namirasoft-account");
|
17
|
-
class BillWatchAWS_CreateForHourlyCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
18
|
-
constructor(argv) {
|
19
|
-
super(argv, ["user_id"], [
|
20
|
-
{
|
21
|
-
name: "first_entity_created_at",
|
22
|
-
short: "",
|
23
|
-
description: "Provides the value of 'first_entity_created_at' in body",
|
24
|
-
optional: true,
|
25
|
-
args: ["first_entity_created_at"],
|
26
|
-
defaults: [""]
|
27
|
-
},
|
28
|
-
{
|
29
|
-
name: "period",
|
30
|
-
short: "",
|
31
|
-
description: "Provides the value of 'period' in body",
|
32
|
-
optional: false,
|
33
|
-
args: ["period"],
|
34
|
-
defaults: [""]
|
35
|
-
},
|
36
|
-
{
|
37
|
-
name: "row_number",
|
38
|
-
short: "",
|
39
|
-
description: "Provides the value of 'row_number' in body",
|
40
|
-
optional: false,
|
41
|
-
args: ["row_number"],
|
42
|
-
defaults: [""]
|
43
|
-
},
|
44
|
-
{
|
45
|
-
name: "active",
|
46
|
-
short: "",
|
47
|
-
description: "Provides the value of 'active' in body",
|
48
|
-
optional: false,
|
49
|
-
args: ["active"],
|
50
|
-
defaults: [""]
|
51
|
-
},
|
52
|
-
{
|
53
|
-
name: "workspace_id",
|
54
|
-
short: "",
|
55
|
-
description: "Provides the value of 'workspace_id' in body",
|
56
|
-
optional: false,
|
57
|
-
args: ["workspace_id"],
|
58
|
-
defaults: [""]
|
59
|
-
},
|
60
|
-
{
|
61
|
-
name: "resource_id",
|
62
|
-
short: "",
|
63
|
-
description: "Provides the value of 'resource_id' in body",
|
64
|
-
optional: false,
|
65
|
-
args: ["resource_id"],
|
66
|
-
defaults: [""]
|
67
|
-
}
|
68
|
-
]);
|
69
|
-
}
|
70
|
-
exec() {
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
72
|
-
let token = this.app.storage.getNSAToken();
|
73
|
-
if (token == null)
|
74
|
-
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
75
|
-
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
76
|
-
let manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
77
|
-
manager.setValue(token, false);
|
78
|
-
let url = this.app.storage.getItem("ns-cost-server-url");
|
79
|
-
let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
80
|
-
let ans = yield server.bill_watch_aws._CreateForHourly(this.arg_values[0], {
|
81
|
-
first_entity_created_at: this.option_values.first_entity_created_at,
|
82
|
-
period: this.option_values.period,
|
83
|
-
row_number: this.option_values.row_number,
|
84
|
-
active: this.option_values.active,
|
85
|
-
workspace_id: this.option_values.workspace_id,
|
86
|
-
resource_id: this.option_values.resource_id
|
87
|
-
});
|
88
|
-
this.app.logger.success(JSON.stringify(ans));
|
89
|
-
});
|
90
|
-
}
|
91
|
-
}
|
92
|
-
exports.BillWatchAWS_CreateForHourlyCommand = BillWatchAWS_CreateForHourlyCommand;
|
93
|
-
;
|
94
|
-
//# sourceMappingURL=BillWatchAWS_CreateForHourlyCommand.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"BillWatchAWS_CreateForHourlyCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWS_CreateForHourlyCommand.ts"],"names":[],"mappings":"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"}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BillWatchAzureCommand = void 0;
|
4
|
-
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
5
|
-
const BillWatchAzureEstimateHourlyCommand_1 = require("./BillWatchAzureEstimateHourlyCommand");
|
6
|
-
const BillWatchAzure_CreateForHourlyCommand_1 = require("./BillWatchAzure_CreateForHourlyCommand");
|
7
|
-
class BillWatchAzureCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
8
|
-
constructor(argv) {
|
9
|
-
super(argv, {
|
10
|
-
"estimatehourly": BillWatchAzureEstimateHourlyCommand_1.BillWatchAzureEstimateHourlyCommand,
|
11
|
-
"_createforhourly": BillWatchAzure_CreateForHourlyCommand_1.BillWatchAzure_CreateForHourlyCommand,
|
12
|
-
});
|
13
|
-
}
|
14
|
-
}
|
15
|
-
exports.BillWatchAzureCommand = BillWatchAzureCommand;
|
16
|
-
;
|
17
|
-
//# sourceMappingURL=BillWatchAzureCommand.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"BillWatchAzureCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,+FAA4F;AAC5F,mGAAgG;AAEhG,MAAa,qBAAsB,SAAQ,0CAAoB;IAE3D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,gBAAgB,EAAE,yEAAmC;YACrD,kBAAkB,EAAE,6EAAqC;SAC5D,CAAC,CAAC;IACP,CAAC;CACJ;AATD,sDASC;AAAA,CAAC"}
|