namirasoft-cost 1.4.3 → 1.4.5
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-dir-deep +3 -0
- package/.ns-sdkg-dir-keep +0 -0
- package/.ns-sdkg-file-keep +7 -0
- package/dist/NamirasoftCostServer.d.ts +4 -0
- package/dist/NamirasoftCostServer.js +5 -1
- package/dist/NamirasoftCostServer.js.map +1 -1
- package/dist/NamirasoftCostServerBillWatchAWS.d.ts +4 -4
- package/dist/NamirasoftCostServerBillWatchAWS.js.map +1 -1
- package/dist/NamirasoftCostServerBillWatchAzure.d.ts +11 -0
- package/dist/NamirasoftCostServerBillWatchAzure.js +29 -0
- package/dist/NamirasoftCostServerBillWatchAzure.js.map +1 -0
- package/dist/NamirasoftCostServerBillWatchGCP.d.ts +11 -0
- package/dist/NamirasoftCostServerBillWatchGCP.js +29 -0
- package/dist/NamirasoftCostServerBillWatchGCP.js.map +1 -0
- package/dist/NamirasoftCostServerCost.d.ts +1 -1
- package/dist/NamirasoftCostServerCost.js +3 -3
- package/dist/NamirasoftCostServerCost.js.map +1 -1
- package/dist/TimeUtil.d.ts +7 -0
- package/dist/TimeUtil.js +44 -0
- package/dist/TimeUtil.js.map +1 -0
- package/dist/command/BillWatchAzureCommand.d.ts +4 -0
- package/dist/command/BillWatchAzureCommand.js +15 -0
- package/dist/command/BillWatchAzureCommand.js.map +1 -0
- package/dist/command/BillWatchAzureEstimationCommand.d.ts +5 -0
- package/dist/command/BillWatchAzureEstimationCommand.js +58 -0
- package/dist/command/BillWatchAzureEstimationCommand.js.map +1 -0
- package/dist/command/BillWatchGCPCommand.d.ts +4 -0
- package/dist/command/BillWatchGCPCommand.js +15 -0
- package/dist/command/BillWatchGCPCommand.js.map +1 -0
- package/dist/command/BillWatchGCPEstimationCommand.d.ts +5 -0
- package/dist/command/BillWatchGCPEstimationCommand.js +58 -0
- package/dist/command/BillWatchGCPEstimationCommand.js.map +1 -0
- package/dist/command/CostCommand.js +2 -2
- package/dist/command/CostCommand.js.map +1 -1
- package/dist/command/{Cost_CreateCommand.d.ts → Cost_CreateForCommand.d.ts} +1 -1
- package/dist/command/{Cost_CreateCommand.js → Cost_CreateForCommand.js} +6 -15
- package/dist/command/Cost_CreateForCommand.js.map +1 -0
- package/dist/command/cli.js +4 -0
- package/dist/command/cli.js.map +1 -1
- package/dist/enum/TrialUnit.d.ts +5 -0
- package/dist/enum/TrialUnit.js +10 -0
- package/dist/enum/TrialUnit.js.map +1 -0
- package/dist/index.d.ts +14 -4
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/row/CostCreateRow.d.ts +0 -1
- package/dist/type/Estimation.d.ts +5 -0
- package/dist/{row/EstimationRowRow.js → type/Estimation.js} +1 -1
- package/dist/type/Estimation.js.map +1 -0
- package/dist/type/EstimationRow.d.ts +5 -0
- package/dist/{row → type}/EstimationRow.js.map +1 -1
- package/dist/type/Period.d.ts +4 -0
- package/dist/{row/PeriodRow.js → type/Period.js} +1 -1
- package/dist/type/Period.js.map +1 -0
- package/dist/type/Trial.d.ts +5 -0
- package/dist/type/Trial.js +3 -0
- package/dist/type/Trial.js.map +1 -0
- package/dist/type/TrialDuration.d.ts +5 -0
- package/dist/type/TrialDuration.js +3 -0
- package/dist/type/TrialDuration.js.map +1 -0
- package/package.json +1 -1
- package/src/NamirasoftCostServer.ts +7 -1
- package/src/NamirasoftCostServerBillWatchAWS.ts +4 -4
- package/src/NamirasoftCostServerBillWatchAzure.ts +39 -0
- package/src/{row/PeriodRow.ts → NamirasoftCostServerBillWatchGCP.ts} +18 -4
- package/src/NamirasoftCostServerCost.ts +3 -3
- package/src/TimeUtil.ts +53 -0
- package/src/{row/EstimationRowRow.ts → command/BillWatchAzureCommand.ts} +10 -5
- package/src/command/BillWatchAzureEstimationCommand.ts +65 -0
- package/src/{row/EstimationRow.ts → command/BillWatchGCPCommand.ts} +10 -5
- package/src/command/BillWatchGCPEstimationCommand.ts +65 -0
- package/src/command/CostCommand.ts +2 -2
- package/src/command/{Cost_CreateCommand.ts → Cost_CreateForCommand.ts} +3 -12
- package/src/command/cli.ts +4 -0
- package/src/enum/TrialUnit.ts +6 -0
- package/src/index.ts +14 -4
- package/src/row/CostCreateRow.ts +0 -1
- package/src/type/Estimation.ts +7 -0
- package/src/type/EstimationRow.ts +7 -0
- package/src/type/Period.ts +5 -0
- package/src/type/Trial.ts +7 -0
- package/src/type/TrialDuration.ts +7 -0
- package/dist/command/Cost_CreateCommand.js.map +0 -1
- package/dist/row/EstimationRow.d.ts +0 -5
- package/dist/row/EstimationRowRow.d.ts +0 -5
- package/dist/row/EstimationRowRow.js.map +0 -1
- package/dist/row/PeriodRow.d.ts +0 -4
- package/dist/row/PeriodRow.js.map +0 -1
- /package/dist/{row → type}/EstimationRow.js +0 -0
File without changes
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { NSABaseServer } from "namirasoft-account";
|
2
2
|
import { NamirasoftCostServerBillWatchAWS } from "./NamirasoftCostServerBillWatchAWS";
|
3
|
+
import { NamirasoftCostServerBillWatchAzure } from "./NamirasoftCostServerBillWatchAzure";
|
4
|
+
import { NamirasoftCostServerBillWatchGCP } from "./NamirasoftCostServerBillWatchGCP";
|
3
5
|
import { NamirasoftCostServerCost } from "./NamirasoftCostServerCost";
|
4
6
|
import { NamirasoftCostServerHealthz } from "./NamirasoftCostServerHealthz";
|
5
7
|
import { NamirasoftCostServerValue } from "./NamirasoftCostServerValue";
|
@@ -8,6 +10,8 @@ export declare class NamirasoftCostServer extends NSABaseServer {
|
|
8
10
|
healthz: NamirasoftCostServerHealthz;
|
9
11
|
value: NamirasoftCostServerValue;
|
10
12
|
bill_watch_a_w_s: NamirasoftCostServerBillWatchAWS;
|
13
|
+
bill_watch_azure: NamirasoftCostServerBillWatchAzure;
|
14
|
+
bill_watch_g_c_p: NamirasoftCostServerBillWatchGCP;
|
11
15
|
cost: NamirasoftCostServerCost;
|
12
16
|
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void);
|
13
17
|
}
|
@@ -3,15 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NamirasoftCostServer = void 0;
|
4
4
|
const namirasoft_account_1 = require("namirasoft-account");
|
5
5
|
const NamirasoftCostServerBillWatchAWS_1 = require("./NamirasoftCostServerBillWatchAWS");
|
6
|
+
const NamirasoftCostServerBillWatchAzure_1 = require("./NamirasoftCostServerBillWatchAzure");
|
7
|
+
const NamirasoftCostServerBillWatchGCP_1 = require("./NamirasoftCostServerBillWatchGCP");
|
6
8
|
const NamirasoftCostServerCost_1 = require("./NamirasoftCostServerCost");
|
7
9
|
const NamirasoftCostServerHealthz_1 = require("./NamirasoftCostServerHealthz");
|
8
10
|
const NamirasoftCostServerValue_1 = require("./NamirasoftCostServerValue");
|
9
11
|
class NamirasoftCostServer extends namirasoft_account_1.NSABaseServer {
|
10
12
|
constructor(base_url, manager, onError) {
|
11
|
-
super(base_url, `1.4.
|
13
|
+
super(base_url, `1.4.4`, manager, onError);
|
12
14
|
this.healthz = new NamirasoftCostServerHealthz_1.NamirasoftCostServerHealthz(this);
|
13
15
|
this.value = new NamirasoftCostServerValue_1.NamirasoftCostServerValue(this);
|
14
16
|
this.bill_watch_a_w_s = new NamirasoftCostServerBillWatchAWS_1.NamirasoftCostServerBillWatchAWS(this);
|
17
|
+
this.bill_watch_azure = new NamirasoftCostServerBillWatchAzure_1.NamirasoftCostServerBillWatchAzure(this);
|
18
|
+
this.bill_watch_g_c_p = new NamirasoftCostServerBillWatchGCP_1.NamirasoftCostServerBillWatchGCP(this);
|
15
19
|
this.cost = new NamirasoftCostServerCost_1.NamirasoftCostServerCost(this);
|
16
20
|
}
|
17
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NamirasoftCostServer.js","sourceRoot":"","sources":["../src/NamirasoftCostServer.ts"],"names":[],"mappings":";;;AAoBA,2DAAmD;AACnD,yFAAsF;AACtF,yEAAsE;AACtE,+EAA4E;AAC5E,2EAAwE;AAGxE,MAAa,oBAAqB,SAAQ,kCAAa;
|
1
|
+
{"version":3,"file":"NamirasoftCostServer.js","sourceRoot":"","sources":["../src/NamirasoftCostServer.ts"],"names":[],"mappings":";;;AAoBA,2DAAmD;AACnD,yFAAsF;AACtF,6FAA0F;AAC1F,yFAAsF;AACtF,yEAAsE;AACtE,+EAA4E;AAC5E,2EAAwE;AAGxE,MAAa,oBAAqB,SAAQ,kCAAa;IAQnD,YAAY,QAAgB,EAAE,OAAqB,EAAE,OAA+B;QAEhF,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,IAAI,yDAA2B,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,GAAG,IAAI,qDAAyB,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,gBAAgB,GAAG,IAAI,mEAAgC,CAAC,IAAI,CAAC,CAAC;QACnE,IAAI,CAAC,gBAAgB,GAAG,IAAI,uEAAkC,CAAC,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,gBAAgB,GAAG,IAAI,mEAAgC,CAAC,IAAI,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,IAAI,mDAAwB,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;CACJ;AAlBD,oDAkBC;AAAA,CAAC"}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import {
|
1
|
+
import { Estimation } from "./type/Estimation";
|
2
2
|
import { NamirasoftCostServer } from "./NamirasoftCostServer";
|
3
3
|
import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
|
4
|
-
import {
|
4
|
+
import { Period } from "./type/Period";
|
5
5
|
export declare class NamirasoftCostServerBillWatchAWS extends NamirasoftCostServerBase {
|
6
6
|
constructor(server: NamirasoftCostServer);
|
7
7
|
Estimation(body: {
|
8
|
-
period:
|
8
|
+
period: Period;
|
9
9
|
active: boolean;
|
10
|
-
}): Promise<
|
10
|
+
}): Promise<Estimation>;
|
11
11
|
}
|
@@ -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,
|
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"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Estimation } from "./type/Estimation";
|
2
|
+
import { NamirasoftCostServer } from "./NamirasoftCostServer";
|
3
|
+
import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
|
4
|
+
import { Period } from "./type/Period";
|
5
|
+
export declare class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase {
|
6
|
+
constructor(server: NamirasoftCostServer);
|
7
|
+
Estimation(body: {
|
8
|
+
period: Period;
|
9
|
+
active: boolean;
|
10
|
+
}): Promise<Estimation>;
|
11
|
+
}
|
@@ -0,0 +1,29 @@
|
|
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.NamirasoftCostServerBillWatchAzure = void 0;
|
13
|
+
const NamirasoftCostServerBase_1 = require("./NamirasoftCostServerBase");
|
14
|
+
class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase_1.NamirasoftCostServerBase {
|
15
|
+
constructor(server) {
|
16
|
+
super(server);
|
17
|
+
this.Estimation = this.Estimation.bind(this);
|
18
|
+
}
|
19
|
+
Estimation(body) {
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21
|
+
let path = `/estimation/bill-watch/watch/azure`;
|
22
|
+
let { data } = yield this.server._post(path, {}, body);
|
23
|
+
return data;
|
24
|
+
});
|
25
|
+
}
|
26
|
+
}
|
27
|
+
exports.NamirasoftCostServerBillWatchAzure = NamirasoftCostServerBillWatchAzure;
|
28
|
+
;
|
29
|
+
//# sourceMappingURL=NamirasoftCostServerBillWatchAzure.js.map
|
@@ -0,0 +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"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Estimation } from "./type/Estimation";
|
2
|
+
import { NamirasoftCostServer } from "./NamirasoftCostServer";
|
3
|
+
import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
|
4
|
+
import { Period } from "./type/Period";
|
5
|
+
export declare class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase {
|
6
|
+
constructor(server: NamirasoftCostServer);
|
7
|
+
Estimation(body: {
|
8
|
+
period: Period;
|
9
|
+
active: boolean;
|
10
|
+
}): Promise<Estimation>;
|
11
|
+
}
|
@@ -0,0 +1,29 @@
|
|
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.NamirasoftCostServerBillWatchGCP = void 0;
|
13
|
+
const NamirasoftCostServerBase_1 = require("./NamirasoftCostServerBase");
|
14
|
+
class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase_1.NamirasoftCostServerBase {
|
15
|
+
constructor(server) {
|
16
|
+
super(server);
|
17
|
+
this.Estimation = this.Estimation.bind(this);
|
18
|
+
}
|
19
|
+
Estimation(body) {
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21
|
+
let path = `/estimation/bill-watch/watch/gcp`;
|
22
|
+
let { data } = yield this.server._post(path, {}, body);
|
23
|
+
return data;
|
24
|
+
});
|
25
|
+
}
|
26
|
+
}
|
27
|
+
exports.NamirasoftCostServerBillWatchGCP = NamirasoftCostServerBillWatchGCP;
|
28
|
+
;
|
29
|
+
//# sourceMappingURL=NamirasoftCostServerBillWatchGCP.js.map
|
@@ -0,0 +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"}
|
@@ -17,7 +17,7 @@ class NamirasoftCostServerCost extends NamirasoftCostServerBase_1.NamirasoftCost
|
|
17
17
|
constructor(server) {
|
18
18
|
super(server);
|
19
19
|
this.List = this.List.bind(this);
|
20
|
-
this.
|
20
|
+
this._CreateFor = this._CreateFor.bind(this);
|
21
21
|
}
|
22
22
|
List(filters, page, size, sorts) {
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -28,9 +28,9 @@ class NamirasoftCostServerCost extends NamirasoftCostServerBase_1.NamirasoftCost
|
|
28
28
|
return data;
|
29
29
|
});
|
30
30
|
}
|
31
|
-
|
31
|
+
_CreateFor(user_id, body) {
|
32
32
|
return __awaiter(this, void 0, void 0, function* () {
|
33
|
-
let path = `/application/cost`;
|
33
|
+
let path = `/application/user/${user_id}/cost`;
|
34
34
|
let { data } = yield this.server._post(path, {}, body);
|
35
35
|
return data;
|
36
36
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NamirasoftCostServerCost.js","sourceRoot":"","sources":["../src/NamirasoftCostServerCost.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,qDAA6C;AAE7C,yEAAsE;AACtE,qDAA2C;AAE3C,MAAa,wBAAyB,SAAQ,mDAAwB;IAElE,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,
|
1
|
+
{"version":3,"file":"NamirasoftCostServerCost.js","sourceRoot":"","sources":["../src/NamirasoftCostServerCost.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,qDAA6C;AAE7C,yEAAsE;AACtE,qDAA2C;AAE3C,MAAa,wBAAyB,SAAQ,mDAAwB;IAElE,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,IAAI,CAAC,OAA4B,EAAE,IAAqB,EAAE,IAAqB,EAAE,KAAiB;;YAEpG,IAAI,oBAAoB,GAAW,4BAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,kBAAkB,GAAW,0BAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC3D,IAAI,IAAI,GAAG,YAAY,CAAC;YACxB,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAqC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;YAC1J,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,UAAU,CAAC,OAAe,EAAE,IAAmB;;YAEjD,IAAI,IAAI,GAAG,qBAAqB,OAAO,OAAO,CAAC;YAC/C,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAU,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAtBD,4DAsBC;AAAA,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Trial } from "./type/Trial";
|
2
|
+
import { Period } from "./type/Period";
|
3
|
+
export declare class TimeUtil {
|
4
|
+
static trialEndsAt(trial: Trial): Date;
|
5
|
+
static isTrial(trial: Trial, date: Date): boolean;
|
6
|
+
static loopHourly(trial: Trial | null, period: Period, estimate_hour: (period: Period) => void): void;
|
7
|
+
}
|
package/dist/TimeUtil.js
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.TimeUtil = void 0;
|
4
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
5
|
+
const TrialUnit_1 = require("./enum/TrialUnit");
|
6
|
+
class TimeUtil {
|
7
|
+
static trialEndsAt(trial) {
|
8
|
+
if (trial.duration.unit == TrialUnit_1.TrialUnit.Day)
|
9
|
+
return namirasoft_core_1.TimeOperation.daysLater(trial.duration.value, trial.started_at);
|
10
|
+
if (trial.duration.unit == TrialUnit_1.TrialUnit.Week)
|
11
|
+
return namirasoft_core_1.TimeOperation.daysLater(trial.duration.value * 7, trial.started_at);
|
12
|
+
if (trial.duration.unit == TrialUnit_1.TrialUnit.Month)
|
13
|
+
return namirasoft_core_1.TimeOperation.monthsLater(trial.duration.value, trial.started_at);
|
14
|
+
return trial.started_at;
|
15
|
+
}
|
16
|
+
static isTrial(trial, date) {
|
17
|
+
return date <= TimeUtil.trialEndsAt(trial);
|
18
|
+
}
|
19
|
+
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)
|
25
|
+
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);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
exports.TimeUtil = TimeUtil;
|
44
|
+
//# sourceMappingURL=TimeUtil.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TimeUtil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;QAED,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QACzB,IAAI,GAAG,GAAG,IAAI,CAAC;QAEf,GACA,CAAC;YACG,GAAG,GAAG,+BAAa,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;YACzC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YACvB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAClB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAClB,IAAI,MAAM,CAAC,GAAG,GAAG,GAAG;gBAChB,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;YAErB,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YAC9B,KAAK,GAAG,GAAG,CAAC;QAChB,CAAC,QACM,GAAG,GAAG,MAAM,CAAC,GAAG,EAAC;IAC5B,CAAC;CACJ;AA/CD,4BA+CC"}
|
@@ -0,0 +1,15 @@
|
|
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 BillWatchAzureEstimationCommand_1 = require("./BillWatchAzureEstimationCommand");
|
6
|
+
class BillWatchAzureCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
7
|
+
constructor(argv) {
|
8
|
+
super(argv, {
|
9
|
+
"estimation": BillWatchAzureEstimationCommand_1.BillWatchAzureEstimationCommand,
|
10
|
+
});
|
11
|
+
}
|
12
|
+
}
|
13
|
+
exports.BillWatchAzureCommand = BillWatchAzureCommand;
|
14
|
+
;
|
15
|
+
//# sourceMappingURL=BillWatchAzureCommand.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BillWatchAzureCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,uFAAoF;AAEpF,MAAa,qBAAsB,SAAQ,0CAAoB;IAE3D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,YAAY,EAAE,iEAA+B;SAChD,CAAC,CAAC;IACP,CAAC;CACJ;AARD,sDAQC;AAAA,CAAC"}
|
@@ -0,0 +1,58 @@
|
|
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.BillWatchAzureEstimationCommand = 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 BillWatchAzureEstimationCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
18
|
+
constructor(argv) {
|
19
|
+
super(argv, [], [
|
20
|
+
{
|
21
|
+
name: "period",
|
22
|
+
short: "",
|
23
|
+
description: "Provides the value of 'period' in body",
|
24
|
+
optional: false,
|
25
|
+
args: ["period"],
|
26
|
+
defaults: [""]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: "active",
|
30
|
+
short: "",
|
31
|
+
description: "Provides the value of 'active' in body",
|
32
|
+
optional: false,
|
33
|
+
args: ["active"],
|
34
|
+
defaults: [""]
|
35
|
+
}
|
36
|
+
]);
|
37
|
+
}
|
38
|
+
exec() {
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
40
|
+
let token = this.app.storage.getNSAToken();
|
41
|
+
if (token == null)
|
42
|
+
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
43
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
44
|
+
let manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
45
|
+
manager.setValue(token, false);
|
46
|
+
let url = this.app.storage.getItem("ns-cost-server-url");
|
47
|
+
let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
48
|
+
let ans = yield server.bill_watch_azure.Estimation({
|
49
|
+
period: this.option_values.period,
|
50
|
+
active: this.option_values.active
|
51
|
+
});
|
52
|
+
this.app.logger.success(JSON.stringify(ans));
|
53
|
+
});
|
54
|
+
}
|
55
|
+
}
|
56
|
+
exports.BillWatchAzureEstimationCommand = BillWatchAzureEstimationCommand;
|
57
|
+
;
|
58
|
+
//# sourceMappingURL=BillWatchAzureEstimationCommand.js.map
|
@@ -0,0 +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,W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
+
exports.BillWatchGCPCommand = void 0;
|
4
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
5
|
+
const BillWatchGCPEstimationCommand_1 = require("./BillWatchGCPEstimationCommand");
|
6
|
+
class BillWatchGCPCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
7
|
+
constructor(argv) {
|
8
|
+
super(argv, {
|
9
|
+
"estimation": BillWatchGCPEstimationCommand_1.BillWatchGCPEstimationCommand,
|
10
|
+
});
|
11
|
+
}
|
12
|
+
}
|
13
|
+
exports.BillWatchGCPCommand = BillWatchGCPCommand;
|
14
|
+
;
|
15
|
+
//# sourceMappingURL=BillWatchGCPCommand.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BillWatchGCPCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchGCPCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,mFAAgF;AAEhF,MAAa,mBAAoB,SAAQ,0CAAoB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,YAAY,EAAE,6DAA6B;SAC9C,CAAC,CAAC;IACP,CAAC;CACJ;AARD,kDAQC;AAAA,CAAC"}
|
@@ -0,0 +1,58 @@
|
|
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.BillWatchGCPEstimationCommand = 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 BillWatchGCPEstimationCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
18
|
+
constructor(argv) {
|
19
|
+
super(argv, [], [
|
20
|
+
{
|
21
|
+
name: "period",
|
22
|
+
short: "",
|
23
|
+
description: "Provides the value of 'period' in body",
|
24
|
+
optional: false,
|
25
|
+
args: ["period"],
|
26
|
+
defaults: [""]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: "active",
|
30
|
+
short: "",
|
31
|
+
description: "Provides the value of 'active' in body",
|
32
|
+
optional: false,
|
33
|
+
args: ["active"],
|
34
|
+
defaults: [""]
|
35
|
+
}
|
36
|
+
]);
|
37
|
+
}
|
38
|
+
exec() {
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
40
|
+
let token = this.app.storage.getNSAToken();
|
41
|
+
if (token == null)
|
42
|
+
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
43
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
44
|
+
let manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
45
|
+
manager.setValue(token, false);
|
46
|
+
let url = this.app.storage.getItem("ns-cost-server-url");
|
47
|
+
let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
48
|
+
let ans = yield server.bill_watch_g_c_p.Estimation({
|
49
|
+
period: this.option_values.period,
|
50
|
+
active: this.option_values.active
|
51
|
+
});
|
52
|
+
this.app.logger.success(JSON.stringify(ans));
|
53
|
+
});
|
54
|
+
}
|
55
|
+
}
|
56
|
+
exports.BillWatchGCPEstimationCommand = BillWatchGCPEstimationCommand;
|
57
|
+
;
|
58
|
+
//# sourceMappingURL=BillWatchGCPEstimationCommand.js.map
|
@@ -0,0 +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,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,sEAuCC;AAAA,CAAC"}
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CostCommand = void 0;
|
4
4
|
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
5
5
|
const CostListCommand_1 = require("./CostListCommand");
|
6
|
-
const
|
6
|
+
const Cost_CreateForCommand_1 = require("./Cost_CreateForCommand");
|
7
7
|
class CostCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
8
8
|
constructor(argv) {
|
9
9
|
super(argv, {
|
10
10
|
"list": CostListCommand_1.CostListCommand,
|
11
|
-
"
|
11
|
+
"_createfor": Cost_CreateForCommand_1.Cost_CreateForCommand,
|
12
12
|
});
|
13
13
|
}
|
14
14
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CostCommand.js","sourceRoot":"","sources":["../../src/command/CostCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,uDAAoD;AACpD,
|
1
|
+
{"version":3,"file":"CostCommand.js","sourceRoot":"","sources":["../../src/command/CostCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,uDAAoD;AACpD,mEAAgE;AAEhE,MAAa,WAAY,SAAQ,0CAAoB;IAEjD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,MAAM,EAAE,iCAAe;YACvB,YAAY,EAAE,6CAAqB;SACtC,CAAC,CAAC;IACP,CAAC;CACJ;AATD,kCASC;AAAA,CAAC"}
|
@@ -9,22 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
});
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.
|
12
|
+
exports.Cost_CreateForCommand = void 0;
|
13
13
|
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
14
14
|
const namirasoft_core_1 = require("namirasoft-core");
|
15
15
|
const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
|
16
16
|
const namirasoft_account_1 = require("namirasoft-account");
|
17
|
-
class
|
17
|
+
class Cost_CreateForCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
18
18
|
constructor(argv) {
|
19
|
-
super(argv, [], [
|
20
|
-
{
|
21
|
-
name: "user_id",
|
22
|
-
short: "",
|
23
|
-
description: "Provides the value of 'user_id' in body",
|
24
|
-
optional: false,
|
25
|
-
args: ["user_id"],
|
26
|
-
defaults: [""]
|
27
|
-
},
|
19
|
+
super(argv, ["user_id"], [
|
28
20
|
{
|
29
21
|
name: "sales_item_id",
|
30
22
|
short: "",
|
@@ -149,8 +141,7 @@ class Cost_CreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
149
141
|
manager.setValue(token, false);
|
150
142
|
let url = this.app.storage.getItem("ns-cost-server-url");
|
151
143
|
let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
152
|
-
let ans = yield server.cost.
|
153
|
-
user_id: this.option_values.user_id,
|
144
|
+
let ans = yield server.cost._CreateFor(this.arg_values[0], {
|
154
145
|
sales_item_id: this.option_values.sales_item_id,
|
155
146
|
offer_id: this.option_values.offer_id,
|
156
147
|
offer_item_id: this.option_values.offer_item_id,
|
@@ -170,6 +161,6 @@ class Cost_CreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
170
161
|
});
|
171
162
|
}
|
172
163
|
}
|
173
|
-
exports.
|
164
|
+
exports.Cost_CreateForCommand = Cost_CreateForCommand;
|
174
165
|
;
|
175
|
-
//# sourceMappingURL=
|
166
|
+
//# sourceMappingURL=Cost_CreateForCommand.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Cost_CreateForCommand.js","sourceRoot":"","sources":["../../src/command/Cost_CreateForCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,qBAAsB,SAAQ,sCAAgB;IAEvD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;YACrB;gBACI,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,eAAe,CAAC;gBACvB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,0CAA0C;gBACvD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,UAAU,CAAC;gBAClB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,eAAe,CAAC;gBACvB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAA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asoft_account_1 = require("namirasoft-account");
|
5
5
|
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
6
6
|
const BillWatchAWSCommand_1 = require("./BillWatchAWSCommand");
|
7
|
+
const BillWatchAzureCommand_1 = require("./BillWatchAzureCommand");
|
8
|
+
const BillWatchGCPCommand_1 = require("./BillWatchGCPCommand");
|
7
9
|
const namirasoft_node_cli_2 = require("namirasoft-node-cli");
|
8
10
|
const CostCommand_1 = require("./CostCommand");
|
9
11
|
const HealthzCommand_1 = require("./HealthzCommand");
|
@@ -12,6 +14,8 @@ let app = new namirasoft_node_cli_1.Application("ns-cost", new namirasoft_node_c
|
|
12
14
|
"healthz": HealthzCommand_1.HealthzCommand,
|
13
15
|
"value": ValueCommand_1.ValueCommand,
|
14
16
|
"billwatchaws": BillWatchAWSCommand_1.BillWatchAWSCommand,
|
17
|
+
"billwatchazure": BillWatchAzureCommand_1.BillWatchAzureCommand,
|
18
|
+
"billwatchgcp": BillWatchGCPCommand_1.BillWatchGCPCommand,
|
15
19
|
"cost": CostCommand_1.CostCommand,
|
16
20
|
"account": namirasoft_account_1.AccountCommand,
|
17
21
|
"config": (argv) => new namirasoft_node_cli_2.ConfigCommand(argv, ["ns-cost-server-url"])
|
package/dist/command/cli.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,+DAA4D;AAC5D,6DAAoD;AACpD,+CAA4C;AAC5C,qDAAkD;AAClD,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,SAAS,EAAE,IAAI,iCAAW,EAAE,EAClD;IACI,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,cAAc,EAAE,yCAAmB;IACnC,MAAM,EAAE,yBAAW;IACnB,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;CAChF,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,+DAA4D;AAC5D,mEAAgE;AAChE,+DAA4D;AAC5D,6DAAoD;AACpD,+CAA4C;AAC5C,qDAAkD;AAClD,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,SAAS,EAAE,IAAI,iCAAW,EAAE,EAClD;IACI,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,cAAc,EAAE,yCAAmB;IACnC,gBAAgB,EAAE,6CAAqB;IACvC,cAAc,EAAE,yCAAmB;IACnC,MAAM,EAAE,yBAAW;IACnB,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;CAChF,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.TrialUnit = void 0;
|
4
|
+
var TrialUnit;
|
5
|
+
(function (TrialUnit) {
|
6
|
+
TrialUnit["Day"] = "Day";
|
7
|
+
TrialUnit["Week"] = "Week";
|
8
|
+
TrialUnit["Month"] = "Month";
|
9
|
+
})(TrialUnit || (exports.TrialUnit = TrialUnit = {}));
|
10
|
+
//# sourceMappingURL=TrialUnit.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TrialUnit.js","sourceRoot":"","sources":["../../src/enum/TrialUnit.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAKX;AALD,WAAY,SAAS;IAEjB,wBAAW,CAAA;IACX,0BAAa,CAAA;IACb,4BAAe,CAAA;AACnB,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB"}
|