namirasoft-cost 1.4.6 → 1.4.7

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.
@@ -10,7 +10,7 @@ const NamirasoftCostServerHealthz_1 = require("./NamirasoftCostServerHealthz");
10
10
  const NamirasoftCostServerValue_1 = require("./NamirasoftCostServerValue");
11
11
  class NamirasoftCostServer extends namirasoft_account_1.NSABaseServer {
12
12
  constructor(base_url, manager, onError) {
13
- super(base_url, `1.4.4`, manager, onError);
13
+ super(base_url, `1.4.6`, manager, onError);
14
14
  this.healthz = new NamirasoftCostServerHealthz_1.NamirasoftCostServerHealthz(this);
15
15
  this.value = new NamirasoftCostServerValue_1.NamirasoftCostServerValue(this);
16
16
  this.bill_watch_a_w_s = new NamirasoftCostServerBillWatchAWS_1.NamirasoftCostServerBillWatchAWS(this);
@@ -5,6 +5,7 @@ import { Period } from "./type/Period";
5
5
  export declare class NamirasoftCostServerBillWatchAWS extends NamirasoftCostServerBase {
6
6
  constructor(server: NamirasoftCostServer);
7
7
  Estimation(body: {
8
+ first_watch_created_at: (string | null);
8
9
  period: Period;
9
10
  active: boolean;
10
11
  }): Promise<Estimation>;
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftCostServerBillWatchAWS.js","sourceRoot":"","sources":["../src/NamirasoftCostServerBillWatchAWS.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yEAAsE;AAGtE,MAAa,gCAAiC,SAAQ,mDAAwB;IAE1E,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,UAAU,CAAC,IAAyC;;YAEtD,IAAI,IAAI,GAAG,kCAAkC,CAAC;YAC9C,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,4EAaC;AAAA,CAAC"}
1
+ {"version":3,"file":"NamirasoftCostServerBillWatchAWS.js","sourceRoot":"","sources":["../src/NamirasoftCostServerBillWatchAWS.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yEAAsE;AAGtE,MAAa,gCAAiC,SAAQ,mDAAwB;IAE1E,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,UAAU,CAAC,IAAkF;;YAE/F,IAAI,IAAI,GAAG,kCAAkC,CAAC;YAC9C,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,4EAaC;AAAA,CAAC"}
@@ -5,6 +5,7 @@ import { Period } from "./type/Period";
5
5
  export declare class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase {
6
6
  constructor(server: NamirasoftCostServer);
7
7
  Estimation(body: {
8
+ first_watch_created_at: (string | null);
8
9
  period: Period;
9
10
  active: boolean;
10
11
  }): Promise<Estimation>;
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftCostServerBillWatchAzure.js","sourceRoot":"","sources":["../src/NamirasoftCostServerBillWatchAzure.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yEAAsE;AAGtE,MAAa,kCAAmC,SAAQ,mDAAwB;IAE5E,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,UAAU,CAAC,IAAyC;;YAEtD,IAAI,IAAI,GAAG,oCAAoC,CAAC;YAChD,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,gFAaC;AAAA,CAAC"}
1
+ {"version":3,"file":"NamirasoftCostServerBillWatchAzure.js","sourceRoot":"","sources":["../src/NamirasoftCostServerBillWatchAzure.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yEAAsE;AAGtE,MAAa,kCAAmC,SAAQ,mDAAwB;IAE5E,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,UAAU,CAAC,IAAkF;;YAE/F,IAAI,IAAI,GAAG,oCAAoC,CAAC;YAChD,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,gFAaC;AAAA,CAAC"}
@@ -5,6 +5,7 @@ import { Period } from "./type/Period";
5
5
  export declare class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase {
6
6
  constructor(server: NamirasoftCostServer);
7
7
  Estimation(body: {
8
+ first_watch_created_at: (string | null);
8
9
  period: Period;
9
10
  active: boolean;
10
11
  }): Promise<Estimation>;
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftCostServerBillWatchGCP.js","sourceRoot":"","sources":["../src/NamirasoftCostServerBillWatchGCP.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yEAAsE;AAGtE,MAAa,gCAAiC,SAAQ,mDAAwB;IAE1E,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,UAAU,CAAC,IAAyC;;YAEtD,IAAI,IAAI,GAAG,kCAAkC,CAAC;YAC9C,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,4EAaC;AAAA,CAAC"}
1
+ {"version":3,"file":"NamirasoftCostServerBillWatchGCP.js","sourceRoot":"","sources":["../src/NamirasoftCostServerBillWatchGCP.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yEAAsE;AAGtE,MAAa,gCAAiC,SAAQ,mDAAwB;IAE1E,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,UAAU,CAAC,IAAkF;;YAE/F,IAAI,IAAI,GAAG,kCAAkC,CAAC;YAC9C,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,4EAaC;AAAA,CAAC"}
@@ -3,5 +3,5 @@ import { Period } from "./type/Period";
3
3
  export declare class TimeUtil {
4
4
  static trialEndsAt(trial: Trial): Date;
5
5
  static isTrial(trial: Trial, date: Date): boolean;
6
- static loopHourly(trial: Trial | null, period: Period, estimate_hour: (period: Period) => void): void;
6
+ static loopHourly(trial: Trial | null, period: Period, estimate_hour: (period: Period) => Promise<void>): Promise<void>;
7
7
  }
package/dist/TimeUtil.js CHANGED
@@ -1,4 +1,13 @@
1
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
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.TimeUtil = void 0;
4
13
  const namirasoft_core_1 = require("namirasoft-core");
@@ -17,27 +26,29 @@ class TimeUtil {
17
26
  return date <= TimeUtil.trialEndsAt(trial);
18
27
  }
19
28
  static loopHourly(trial, period, estimate_hour) {
20
- if (period.end <= period.start)
21
- return;
22
- if (trial) {
23
- let ends_at = TimeUtil.trialEndsAt(trial);
24
- if (period.end <= ends_at)
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ if (period.end <= period.start)
25
31
  return;
26
- if (period.start <= ends_at)
27
- period.start = ends_at;
28
- }
29
- let start = period.start;
30
- let end = null;
31
- do {
32
- end = namirasoft_core_1.TimeOperation.hoursLater(1, start);
33
- end.setMilliseconds(0);
34
- end.setSeconds(0);
35
- end.setMinutes(0);
36
- if (period.end < end)
37
- end = period.end;
38
- estimate_hour({ start, end });
39
- start = end;
40
- } while (end < period.end);
32
+ if (trial) {
33
+ let ends_at = TimeUtil.trialEndsAt(trial);
34
+ if (period.end <= ends_at)
35
+ return;
36
+ if (period.start <= ends_at)
37
+ period.start = ends_at;
38
+ }
39
+ let start = period.start;
40
+ let end = null;
41
+ do {
42
+ end = namirasoft_core_1.TimeOperation.hoursLater(1, start);
43
+ end.setMilliseconds(0);
44
+ end.setSeconds(0);
45
+ end.setMinutes(0);
46
+ if (period.end < end)
47
+ end = period.end;
48
+ yield estimate_hour({ start, end });
49
+ start = end;
50
+ } while (end < period.end);
51
+ });
41
52
  }
42
53
  }
43
54
  exports.TimeUtil = TimeUtil;
@@ -1 +1 @@
1
- {"version":3,"file":"TimeUtil.js","sourceRoot":"","sources":["../src/TimeUtil.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAGhD,gDAA6C;AAE7C,MAAa,QAAQ;IAEjB,MAAM,CAAC,WAAW,CAAC,KAAY;QAE3B,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,qBAAS,CAAC,GAAG;YACpC,OAAO,+BAAa,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC3E,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,qBAAS,CAAC,IAAI;YACrC,OAAO,+BAAa,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,qBAAS,CAAC,KAAK;YACtC,OAAO,+BAAa,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC7E,OAAO,KAAK,CAAC,UAAU,CAAC;IAC5B,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,KAAY,EAAE,IAAU;QAEnC,OAAO,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,CAAC,UAAU,CAAC,KAAmB,EAAE,MAAc,EAAE,aAAuC;QAE1F,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK;YAC1B,OAAO;QAEX,IAAI,KAAK,EACT,CAAC;YACG,IAAI,OAAO,GAAG,QAAQ,CAAC,WAAW,CAAC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EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;gBACpC,KAAK,GAAG,GAAG,CAAC;YAChB,CAAC,QACM,GAAG,GAAG,MAAM,CAAC,GAAG,EAAC;QAC5B,CAAC;KAAA;CACJ;AA/CD,4BA+CC"}
@@ -17,6 +17,14 @@ const namirasoft_account_1 = require("namirasoft-account");
17
17
  class BillWatchAWSEstimationCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
18
  constructor(argv) {
19
19
  super(argv, [], [
20
+ {
21
+ name: "first_watch_created_at",
22
+ short: "",
23
+ description: "Provides the value of 'first_watch_created_at' in body",
24
+ optional: true,
25
+ args: ["first_watch_created_at"],
26
+ defaults: [""]
27
+ },
20
28
  {
21
29
  name: "period",
22
30
  short: "",
@@ -46,6 +54,7 @@ class BillWatchAWSEstimationCommand extends namirasoft_node_cli_1.BaseFinalComma
46
54
  let url = this.app.storage.getItem("ns-cost-server-url");
47
55
  let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
48
56
  let ans = yield server.bill_watch_a_w_s.Estimation({
57
+ first_watch_created_at: this.option_values.first_watch_created_at,
49
58
  period: this.option_values.period,
50
59
  active: this.option_values.active
51
60
  });
@@ -1 +1 @@
1
- {"version":3,"file":"BillWatchAWSEstimationCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWSEstimationCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,6BAA8B,SAAQ,sCAAgB;IAE/D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;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;Y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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,gBAAgB,CAAC,UAAU,CAAC;gBAC/C,sBAAsB,EAAE,IAAI,CAAC,aAAa,CAAC,sBAAsB;gBACjE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,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;AAhDD,sEAgDC;AAAA,CAAC"}
@@ -17,6 +17,14 @@ const namirasoft_account_1 = require("namirasoft-account");
17
17
  class BillWatchAzureEstimationCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
18
  constructor(argv) {
19
19
  super(argv, [], [
20
+ {
21
+ name: "first_watch_created_at",
22
+ short: "",
23
+ description: "Provides the value of 'first_watch_created_at' in body",
24
+ optional: true,
25
+ args: ["first_watch_created_at"],
26
+ defaults: [""]
27
+ },
20
28
  {
21
29
  name: "period",
22
30
  short: "",
@@ -46,6 +54,7 @@ class BillWatchAzureEstimationCommand extends namirasoft_node_cli_1.BaseFinalCom
46
54
  let url = this.app.storage.getItem("ns-cost-server-url");
47
55
  let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
48
56
  let ans = yield server.bill_watch_azure.Estimation({
57
+ first_watch_created_at: this.option_values.first_watch_created_at,
49
58
  period: this.option_values.period,
50
59
  active: this.option_values.active
51
60
  });
@@ -1 +1 @@
1
- {"version":3,"file":"BillWatchAzureEstimationCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureEstimationCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,+BAAgC,SAAQ,sCAAgB;IAEjE,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;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,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,gBAAgB,CAAC,UAAU,CAAC;gBAC/C,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,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;AAvCD,0EAuCC;AAAA,CAAC"}
1
+ {"version":3,"file":"BillWatchAzureEstimationCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureEstimationCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,+BAAgC,SAAQ,sCAAgB;IAEjE,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,IAAI,EAAE,wBAAwB;gBAC9B,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wDAAwD;gBACrE,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,CAAC,wBAAwB,CAAC;gBAChC,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,QAAQ;gBACd,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wCAAwC;gBACrD,QAAQ,EAAE,KAAK;gBACf,I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cli_1.BaseFinalCommand {
18
18
  constructor(argv) {
19
19
  super(argv, [], [
20
+ {
21
+ name: "first_watch_created_at",
22
+ short: "",
23
+ description: "Provides the value of 'first_watch_created_at' in body",
24
+ optional: true,
25
+ args: ["first_watch_created_at"],
26
+ defaults: [""]
27
+ },
20
28
  {
21
29
  name: "period",
22
30
  short: "",
@@ -46,6 +54,7 @@ class BillWatchGCPEstimationCommand extends namirasoft_node_cli_1.BaseFinalComma
46
54
  let url = this.app.storage.getItem("ns-cost-server-url");
47
55
  let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
48
56
  let ans = yield server.bill_watch_g_c_p.Estimation({
57
+ first_watch_created_at: this.option_values.first_watch_created_at,
49
58
  period: this.option_values.period,
50
59
  active: this.option_values.active
51
60
  });
@@ -1 +1 @@
1
- {"version":3,"file":"BillWatchGCPEstimationCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchGCPEstimationCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,6BAA8B,SAAQ,sCAAgB;IAE/D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;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,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,IA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AC,CAAC;YAC3F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC;gBAC/C,sBAAsB,EAAE,IAAI,CAAC,aAAa,CAAC,sBAAsB;gBACjE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,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;AAhDD,sEAgDC;AAAA,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from "./NamirasoftCostServerBillWatchGCP";
6
6
  export * from "./NamirasoftCostServerCost";
7
7
  export * from "./NamirasoftCostServerHealthz";
8
8
  export * from "./NamirasoftCostServerValue";
9
+ export * from "./TimeUtil";
9
10
  export * from "./command/BillWatchAWSCommand";
10
11
  export * from "./command/BillWatchAWSEstimationCommand";
11
12
  export * from "./command/BillWatchAzureCommand";
@@ -19,14 +20,13 @@ export * from "./command/HealthzCommand";
19
20
  export * from "./command/HealthzGetCommand";
20
21
  export * from "./command/ValueCommand";
21
22
  export * from "./command/ValueListCommand";
23
+ export * from "./enum/TrialUnit";
22
24
  export * from "./meta/CostMetaTable";
23
25
  export * from "./meta/NamirasoftCostMetaDatabase";
24
26
  export * from "./row/CostCreateRow";
25
27
  export * from "./row/CostRow";
26
- export * from "./enum/TrialUnit";
27
28
  export * from "./type/Estimation";
28
29
  export * from "./type/EstimationRow";
29
30
  export * from "./type/Period";
30
31
  export * from "./type/Trial";
31
32
  export * from "./type/TrialDuration";
32
- export * from "./TimeUtil";
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ __exportStar(require("./NamirasoftCostServerBillWatchGCP"), exports);
22
22
  __exportStar(require("./NamirasoftCostServerCost"), exports);
23
23
  __exportStar(require("./NamirasoftCostServerHealthz"), exports);
24
24
  __exportStar(require("./NamirasoftCostServerValue"), exports);
25
+ __exportStar(require("./TimeUtil"), exports);
25
26
  __exportStar(require("./command/BillWatchAWSCommand"), exports);
26
27
  __exportStar(require("./command/BillWatchAWSEstimationCommand"), exports);
27
28
  __exportStar(require("./command/BillWatchAzureCommand"), exports);
@@ -35,15 +36,14 @@ __exportStar(require("./command/HealthzCommand"), exports);
35
36
  __exportStar(require("./command/HealthzGetCommand"), exports);
36
37
  __exportStar(require("./command/ValueCommand"), exports);
37
38
  __exportStar(require("./command/ValueListCommand"), exports);
39
+ __exportStar(require("./enum/TrialUnit"), exports);
38
40
  __exportStar(require("./meta/CostMetaTable"), exports);
39
41
  __exportStar(require("./meta/NamirasoftCostMetaDatabase"), exports);
40
42
  __exportStar(require("./row/CostCreateRow"), exports);
41
43
  __exportStar(require("./row/CostRow"), exports);
42
- __exportStar(require("./enum/TrialUnit"), exports);
43
44
  __exportStar(require("./type/Estimation"), exports);
44
45
  __exportStar(require("./type/EstimationRow"), exports);
45
46
  __exportStar(require("./type/Period"), exports);
46
47
  __exportStar(require("./type/Trial"), exports);
47
48
  __exportStar(require("./type/TrialDuration"), exports);
48
- __exportStar(require("./TimeUtil"), exports);
49
49
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,yDAAuC;AACvC,6DAA2C;AAC3C,qEAAmD;AACnD,uEAAqD;AACrD,qEAAmD;AACnD,6DAA2C;AAC3C,gEAA8C;AAC9C,8DAA4C;AAC5C,gEAA8C;AAC9C,0EAAwD;AACxD,kEAAgD;AAChD,4EAA0D;AAC1D,gEAA8C;AAC9C,0EAAwD;AACxD,wDAAsC;AACtC,4DAA0C;AAC1C,kEAAgD;AAChD,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,oEAAkD;AAClD,sDAAoC;AACpC,gDAA8B;AAC9B,mDAAiC;AACjC,oDAAkC;AAClC,uDAAqC;AACrC,gDAA8B;AAC9B,+CAA6B;AAC7B,uDAAqC;AACrC,6CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,yDAAuC;AACvC,6DAA2C;AAC3C,qEAAmD;AACnD,uEAAqD;AACrD,qEAAmD;AACnD,6DAA2C;AAC3C,gEAA8C;AAC9C,8DAA4C;AAC5C,6CAA2B;AAC3B,gEAA8C;AAC9C,0EAAwD;AACxD,kEAAgD;AAChD,4EAA0D;AAC1D,gEAA8C;AAC9C,0EAAwD;AACxD,wDAAsC;AACtC,4DAA0C;AAC1C,kEAAgD;AAChD,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC;AACvC,6DAA2C;AAC3C,mDAAiC;AACjC,uDAAqC;AACrC,oEAAkD;AAClD,sDAAoC;AACpC,gDAA8B;AAC9B,oDAAkC;AAClC,uDAAqC;AACrC,gDAA8B;AAC9B,+CAA6B;AAC7B,uDAAqC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.6",
11
+ "version": "1.4.7",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -37,7 +37,7 @@ export class NamirasoftCostServer extends NSABaseServer
37
37
  cost: NamirasoftCostServerCost;
38
38
  constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
39
39
  {
40
- super(base_url, `1.4.4`, manager, onError);
40
+ super(base_url, `1.4.6`, manager, onError);
41
41
  this.healthz = new NamirasoftCostServerHealthz(this);
42
42
  this.value = new NamirasoftCostServerValue(this);
43
43
  this.bill_watch_a_w_s = new NamirasoftCostServerBillWatchAWS(this);
@@ -30,7 +30,7 @@ export class NamirasoftCostServerBillWatchAWS extends NamirasoftCostServerBase
30
30
  super(server);
31
31
  this.Estimation = this.Estimation.bind(this);
32
32
  }
33
- async Estimation(body: { period: Period, active: boolean }): Promise<Estimation>
33
+ async Estimation(body: { first_watch_created_at: (string | null), period: Period, active: boolean }): Promise<Estimation>
34
34
  {
35
35
  let path = `/estimation/bill-watch/watch/aws`;
36
36
  let { data } = await this.server._post<Estimation>(path, {}, body);
@@ -30,7 +30,7 @@ export class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase
30
30
  super(server);
31
31
  this.Estimation = this.Estimation.bind(this);
32
32
  }
33
- async Estimation(body: { period: Period, active: boolean }): Promise<Estimation>
33
+ async Estimation(body: { first_watch_created_at: (string | null), period: Period, active: boolean }): Promise<Estimation>
34
34
  {
35
35
  let path = `/estimation/bill-watch/watch/azure`;
36
36
  let { data } = await this.server._post<Estimation>(path, {}, body);
@@ -30,7 +30,7 @@ export class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase
30
30
  super(server);
31
31
  this.Estimation = this.Estimation.bind(this);
32
32
  }
33
- async Estimation(body: { period: Period, active: boolean }): Promise<Estimation>
33
+ async Estimation(body: { first_watch_created_at: (string | null), period: Period, active: boolean }): Promise<Estimation>
34
34
  {
35
35
  let path = `/estimation/bill-watch/watch/gcp`;
36
36
  let { data } = await this.server._post<Estimation>(path, {}, body);
package/src/TimeUtil.ts CHANGED
@@ -19,7 +19,7 @@ export class TimeUtil
19
19
  {
20
20
  return date <= TimeUtil.trialEndsAt(trial);
21
21
  }
22
- static loopHourly(trial: Trial | null, period: Period, estimate_hour: (period: Period) => void)
22
+ static async loopHourly(trial: Trial | null, period: Period, estimate_hour: (period: Period) => Promise<void>): Promise<void>
23
23
  {
24
24
  if (period.end <= period.start)
25
25
  return;
@@ -45,7 +45,7 @@ export class TimeUtil
45
45
  if (period.end < end)
46
46
  end = period.end;
47
47
 
48
- estimate_hour({ start, end });
48
+ await estimate_hour({ start, end });
49
49
  start = end;
50
50
  }
51
51
  while (end < period.end)
@@ -28,6 +28,14 @@ export class BillWatchAWSEstimationCommand extends BaseFinalCommand
28
28
  constructor(argv: string[])
29
29
  {
30
30
  super(argv, [], [
31
+ {
32
+ name: "first_watch_created_at",
33
+ short: "",
34
+ description: "Provides the value of 'first_watch_created_at' in body",
35
+ optional: true,
36
+ args: ["first_watch_created_at"],
37
+ defaults: [""]
38
+ },
31
39
  {
32
40
  name: "period",
33
41
  short: "",
@@ -57,6 +65,7 @@ export class BillWatchAWSEstimationCommand extends BaseFinalCommand
57
65
  let url = this.app.storage.getItem("ns-cost-server-url");
58
66
  let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
59
67
  let ans = await server.bill_watch_a_w_s.Estimation({
68
+ first_watch_created_at: this.option_values.first_watch_created_at,
60
69
  period: this.option_values.period,
61
70
  active: this.option_values.active
62
71
  });
@@ -28,6 +28,14 @@ export class BillWatchAzureEstimationCommand extends BaseFinalCommand
28
28
  constructor(argv: string[])
29
29
  {
30
30
  super(argv, [], [
31
+ {
32
+ name: "first_watch_created_at",
33
+ short: "",
34
+ description: "Provides the value of 'first_watch_created_at' in body",
35
+ optional: true,
36
+ args: ["first_watch_created_at"],
37
+ defaults: [""]
38
+ },
31
39
  {
32
40
  name: "period",
33
41
  short: "",
@@ -57,6 +65,7 @@ export class BillWatchAzureEstimationCommand extends BaseFinalCommand
57
65
  let url = this.app.storage.getItem("ns-cost-server-url");
58
66
  let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
59
67
  let ans = await server.bill_watch_azure.Estimation({
68
+ first_watch_created_at: this.option_values.first_watch_created_at,
60
69
  period: this.option_values.period,
61
70
  active: this.option_values.active
62
71
  });
@@ -28,6 +28,14 @@ export class BillWatchGCPEstimationCommand extends BaseFinalCommand
28
28
  constructor(argv: string[])
29
29
  {
30
30
  super(argv, [], [
31
+ {
32
+ name: "first_watch_created_at",
33
+ short: "",
34
+ description: "Provides the value of 'first_watch_created_at' in body",
35
+ optional: true,
36
+ args: ["first_watch_created_at"],
37
+ defaults: [""]
38
+ },
31
39
  {
32
40
  name: "period",
33
41
  short: "",
@@ -57,6 +65,7 @@ export class BillWatchGCPEstimationCommand extends BaseFinalCommand
57
65
  let url = this.app.storage.getItem("ns-cost-server-url");
58
66
  let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
59
67
  let ans = await server.bill_watch_g_c_p.Estimation({
68
+ first_watch_created_at: this.option_values.first_watch_created_at,
60
69
  period: this.option_values.period,
61
70
  active: this.option_values.active
62
71
  });
package/src/index.ts CHANGED
@@ -26,6 +26,7 @@ export * from "./NamirasoftCostServerBillWatchGCP";
26
26
  export * from "./NamirasoftCostServerCost";
27
27
  export * from "./NamirasoftCostServerHealthz";
28
28
  export * from "./NamirasoftCostServerValue";
29
+ export * from "./TimeUtil";
29
30
  export * from "./command/BillWatchAWSCommand";
30
31
  export * from "./command/BillWatchAWSEstimationCommand";
31
32
  export * from "./command/BillWatchAzureCommand";
@@ -39,14 +40,13 @@ export * from "./command/HealthzCommand";
39
40
  export * from "./command/HealthzGetCommand";
40
41
  export * from "./command/ValueCommand";
41
42
  export * from "./command/ValueListCommand";
43
+ export * from "./enum/TrialUnit";
42
44
  export * from "./meta/CostMetaTable";
43
45
  export * from "./meta/NamirasoftCostMetaDatabase";
44
46
  export * from "./row/CostCreateRow";
45
47
  export * from "./row/CostRow";
46
- export * from "./enum/TrialUnit";
47
48
  export * from "./type/Estimation";
48
49
  export * from "./type/EstimationRow";
49
50
  export * from "./type/Period";
50
51
  export * from "./type/Trial";
51
- export * from "./type/TrialDuration";
52
- export * from "./TimeUtil";
52
+ export * from "./type/TrialDuration";