namirasoft-cost 1.4.42 → 1.4.44

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.
@@ -14,7 +14,7 @@ const NamirasoftCostServerSecretSecret_1 = require("./NamirasoftCostServerSecret
14
14
  const NamirasoftCostServerValue_1 = require("./NamirasoftCostServerValue");
15
15
  class NamirasoftCostServer extends namirasoft_account_1.NSABaseServer {
16
16
  constructor(base_url, manager, onError) {
17
- super(base_url, `1.4.42`, manager, onError);
17
+ super(base_url, `1.4.44`, manager, onError);
18
18
  this.healthz = new NamirasoftCostServerHealthz_1.NamirasoftCostServerHealthz(this);
19
19
  this.metrics = new NamirasoftCostServerMetrics_1.NamirasoftCostServerMetrics(this);
20
20
  this.value = new NamirasoftCostServerValue_1.NamirasoftCostServerValue(this);
@@ -2,6 +2,7 @@ import { CostRow } from "./row/CostRow";
2
2
  import { DimensionType } from "./enum/DimensionType";
3
3
  import { FilterItem } from "namirasoft-core";
4
4
  import { GranularityType } from "./enum/GranularityType";
5
+ import { GroupedResponseRow } from "./row/GroupedResponseRow";
5
6
  import { NamirasoftCostServer } from "./NamirasoftCostServer";
6
7
  import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
7
8
  import { SortItem } from "namirasoft-core";
@@ -11,5 +12,18 @@ export declare class NamirasoftCostServerCost extends NamirasoftCostServerBase {
11
12
  rows: CostRow[];
12
13
  count: number;
13
14
  }>;
14
- Grouped(start_date: Date, end_date: Date, granularity: GranularityType, dimension: DimensionType, filter_workspace_ids: string[], filter_product_ids: string[], filter_sales_item_ids: string[], filter_offer_ids: string[], filter_offer_item_ids: string[], filter_resource_entities: string[], filter_resource_ids: string[], filter_usage_names: string[]): Promise<any[]>;
15
+ Grouped(body: {
16
+ start_date: Date;
17
+ end_date: Date;
18
+ granularity: GranularityType;
19
+ dimension: DimensionType;
20
+ filter_workspace_ids: (string | null)[];
21
+ filter_product_ids: (string | null)[];
22
+ filter_sales_item_ids: (string | null)[];
23
+ filter_offer_ids: (string | null)[];
24
+ filter_offer_item_ids: (string | null)[];
25
+ filter_resource_entities: (string | null)[];
26
+ filter_resource_ids: (string | null)[];
27
+ filter_usage_names: (string | null)[];
28
+ }): Promise<GroupedResponseRow[]>;
15
29
  }
@@ -28,10 +28,10 @@ class NamirasoftCostServerCost extends NamirasoftCostServerBase_1.NamirasoftCost
28
28
  return data;
29
29
  });
30
30
  }
31
- Grouped(start_date, end_date, granularity, dimension, filter_workspace_ids, filter_product_ids, filter_sales_item_ids, filter_offer_ids, filter_offer_item_ids, filter_resource_entities, filter_resource_ids, filter_usage_names) {
31
+ Grouped(body) {
32
32
  return __awaiter(this, void 0, void 0, function* () {
33
33
  let path = `/cost/grouped`;
34
- let { data } = yield this.server._get(path, { start_date, end_date, granularity, dimension, filter_workspace_ids, filter_product_ids, filter_sales_item_ids, filter_offer_ids, filter_offer_item_ids, filter_resource_entities, filter_resource_ids, filter_usage_names });
34
+ let { data } = yield this.server._post(path, {}, body);
35
35
  return data;
36
36
  });
37
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftCostServerCost.js","sourceRoot":"","sources":["../src/NamirasoftCostServerCost.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,qDAA6C;AAG7C,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,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IACK,IAAI,CAAC,OAA4B,EAAE,IAAqB,EAAE,IAAqB,EAAE,KAAiB;;YAEpG,IAAI,oBAAoB,GAAW,4BAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,kB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AC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,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,OAAO,CAAC,IAAua;;YAEjb,IAAI,IAAI,GAAG,eAAe,CAAC;YAC3B,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAuB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YAC7E,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAtBD,4DAsBC;AAAA,CAAC"}
@@ -16,7 +16,104 @@ const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
16
16
  const namirasoft_account_1 = require("namirasoft-account");
17
17
  class CostGroupedCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
18
  constructor(argv) {
19
- super(argv, ["start_date", "end_date", "granularity", "dimension", "filter_workspace_ids", "filter_product_ids", "filter_sales_item_ids", "filter_offer_ids", "filter_offer_item_ids", "filter_resource_entities", "filter_resource_ids", "filter_usage_names"], []);
19
+ super(argv, [], [
20
+ {
21
+ name: "start_date",
22
+ short: "",
23
+ description: "Provides the value of 'start_date' in body",
24
+ optional: false,
25
+ args: ["start_date"],
26
+ defaults: [""]
27
+ },
28
+ {
29
+ name: "end_date",
30
+ short: "",
31
+ description: "Provides the value of 'end_date' in body",
32
+ optional: false,
33
+ args: ["end_date"],
34
+ defaults: [""]
35
+ },
36
+ {
37
+ name: "granularity",
38
+ short: "",
39
+ description: "Provides the value of 'granularity' in body",
40
+ optional: false,
41
+ args: ["granularity"],
42
+ defaults: [""]
43
+ },
44
+ {
45
+ name: "dimension",
46
+ short: "",
47
+ description: "Provides the value of 'dimension' in body",
48
+ optional: false,
49
+ args: ["dimension"],
50
+ defaults: [""]
51
+ },
52
+ {
53
+ name: "filter_workspace_ids",
54
+ short: "",
55
+ description: "Provides the value of 'filter_workspace_ids' in body",
56
+ optional: false,
57
+ args: ["filter_workspace_ids"],
58
+ defaults: [""]
59
+ },
60
+ {
61
+ name: "filter_product_ids",
62
+ short: "",
63
+ description: "Provides the value of 'filter_product_ids' in body",
64
+ optional: false,
65
+ args: ["filter_product_ids"],
66
+ defaults: [""]
67
+ },
68
+ {
69
+ name: "filter_sales_item_ids",
70
+ short: "",
71
+ description: "Provides the value of 'filter_sales_item_ids' in body",
72
+ optional: false,
73
+ args: ["filter_sales_item_ids"],
74
+ defaults: [""]
75
+ },
76
+ {
77
+ name: "filter_offer_ids",
78
+ short: "",
79
+ description: "Provides the value of 'filter_offer_ids' in body",
80
+ optional: false,
81
+ args: ["filter_offer_ids"],
82
+ defaults: [""]
83
+ },
84
+ {
85
+ name: "filter_offer_item_ids",
86
+ short: "",
87
+ description: "Provides the value of 'filter_offer_item_ids' in body",
88
+ optional: false,
89
+ args: ["filter_offer_item_ids"],
90
+ defaults: [""]
91
+ },
92
+ {
93
+ name: "filter_resource_entities",
94
+ short: "",
95
+ description: "Provides the value of 'filter_resource_entities' in body",
96
+ optional: false,
97
+ args: ["filter_resource_entities"],
98
+ defaults: [""]
99
+ },
100
+ {
101
+ name: "filter_resource_ids",
102
+ short: "",
103
+ description: "Provides the value of 'filter_resource_ids' in body",
104
+ optional: false,
105
+ args: ["filter_resource_ids"],
106
+ defaults: [""]
107
+ },
108
+ {
109
+ name: "filter_usage_names",
110
+ short: "",
111
+ description: "Provides the value of 'filter_usage_names' in body",
112
+ optional: false,
113
+ args: ["filter_usage_names"],
114
+ defaults: [""]
115
+ }
116
+ ]);
20
117
  }
21
118
  exec() {
22
119
  return __awaiter(this, void 0, void 0, function* () {
@@ -28,7 +125,20 @@ class CostGroupedCommand extends namirasoft_node_cli_1.BaseFinalCommand {
28
125
  manager.setValue(token, false);
29
126
  let url = this.app.storage.getItem("ns-cost-server-url");
30
127
  let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
31
- let ans = yield server.cost.Grouped(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3], this.arg_values[4], this.arg_values[5], this.arg_values[6], this.arg_values[7], this.arg_values[8], this.arg_values[9], this.arg_values[10], this.arg_values[11]);
128
+ let ans = yield server.cost.Grouped({
129
+ start_date: this.option_values.start_date,
130
+ end_date: this.option_values.end_date,
131
+ granularity: this.option_values.granularity,
132
+ dimension: this.option_values.dimension,
133
+ filter_workspace_ids: this.option_values.filter_workspace_ids,
134
+ filter_product_ids: this.option_values.filter_product_ids,
135
+ filter_sales_item_ids: this.option_values.filter_sales_item_ids,
136
+ filter_offer_ids: this.option_values.filter_offer_ids,
137
+ filter_offer_item_ids: this.option_values.filter_offer_item_ids,
138
+ filter_resource_entities: this.option_values.filter_resource_entities,
139
+ filter_resource_ids: this.option_values.filter_resource_ids,
140
+ filter_usage_names: this.option_values.filter_usage_names
141
+ });
32
142
  this.app.logger.success(JSON.stringify(ans));
33
143
  });
34
144
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CostGroupedCommand.js","sourceRoot":"","sources":["../../src/command/CostGroupedCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,kBAAmB,SAAQ,sCAAgB;IAEpD,YAAY,I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AO,CAAC;gBAChC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;gBACzC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;gBACrC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS;gBACvC,oBAAoB,EAAE,IAAI,CAAC,aAAa,CAAC,oBAAoB;gBAC7D,kBAAkB,EAAE,IAAI,CAAC,aAAa,CAAC,kBAAkB;gBACzD,qBAAqB,EAAE,IAAI,CAAC,aAAa,CAAC,qBAAqB;gBAC/D,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,gBAAgB;gBACrD,qBAAqB,EAAE,IAAI,CAAC,aAAa,CAAC,qBAAqB;gBAC/D,wBAAwB,EAAE,IAAI,CAAC,aAAa,CAAC,wBAAwB;gBACrE,mBAAmB,EAAE,IAAI,CAAC,aAAa,CAAC,mBAAmB;gBAC3D,kBAAkB,EAAE,IAAI,CAAC,aAAa,CAAC,kBAAkB;aAC5D,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAjID,gDAiIC;AAAA,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export declare enum DimensionType {
2
+ NONE = "NONE",
2
3
  WORKSPACE = "WORKSPACE",
3
4
  PRODUCT = "PRODUCT",
4
5
  SALES_ITEM = "SALES_ITEM",
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DimensionType = void 0;
4
4
  var DimensionType;
5
5
  (function (DimensionType) {
6
+ DimensionType["NONE"] = "NONE";
6
7
  DimensionType["WORKSPACE"] = "WORKSPACE";
7
8
  DimensionType["PRODUCT"] = "PRODUCT";
8
9
  DimensionType["SALES_ITEM"] = "SALES_ITEM";
@@ -1 +1 @@
1
- {"version":3,"file":"DimensionType.js","sourceRoot":"","sources":["../../src/enum/DimensionType.ts"],"names":[],"mappings":";;;AAoBA,IAAY,aAUX;AAVD,WAAY,aAAa;IAErB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;IACnB,0CAAyB,CAAA;IACzB,gCAAe,CAAA;IACf,0CAAyB,CAAA;IACzB,oDAAmC,CAAA;IACnC,4CAA2B,CAAA;IAC3B,0CAAyB,CAAA;AAC7B,CAAC,EAVW,aAAa,6BAAb,aAAa,QAUxB"}
1
+ {"version":3,"file":"DimensionType.js","sourceRoot":"","sources":["../../src/enum/DimensionType.ts"],"names":[],"mappings":";;;AAoBA,IAAY,aAWX;AAXD,WAAY,aAAa;IAErB,8BAAa,CAAA;IACb,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;IACnB,0CAAyB,CAAA;IACzB,gCAAe,CAAA;IACf,0CAAyB,CAAA;IACzB,oDAAmC,CAAA;IACnC,4CAA2B,CAAA;IAC3B,0CAAyB,CAAA;AAC7B,CAAC,EAXW,aAAa,6BAAb,aAAa,QAWxB"}
package/dist/index.d.ts CHANGED
@@ -64,6 +64,7 @@ export * from "./estimator/SecretSecretRecordEstimator";
64
64
  export * from "./meta/CostMetaTable";
65
65
  export * from "./meta/NamirasoftCostMetaDatabase";
66
66
  export * from "./row/CostRow";
67
+ export * from "./row/GroupedResponseRow";
67
68
  export * from "./type/Bonus";
68
69
  export * from "./type/CalculationOption";
69
70
  export * from "./type/Estimation";
package/dist/index.js CHANGED
@@ -80,6 +80,7 @@ __exportStar(require("./estimator/SecretSecretRecordEstimator"), exports);
80
80
  __exportStar(require("./meta/CostMetaTable"), exports);
81
81
  __exportStar(require("./meta/NamirasoftCostMetaDatabase"), exports);
82
82
  __exportStar(require("./row/CostRow"), exports);
83
+ __exportStar(require("./row/GroupedResponseRow"), exports);
83
84
  __exportStar(require("./type/Bonus"), exports);
84
85
  __exportStar(require("./type/CalculationOption"), exports);
85
86
  __exportStar(require("./type/Estimation"), exports);
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,sEAAoD;AACpD,mEAAiD;AACjD,gEAA8C;AAC9C,gEAA8C;AAC9C,qEAAmD;AACnD,8DAA4C;AAC5C,oDAAkC;AAClC,wDAAsC;AACtC,yDAAuC;AACvC,8DAA4C;AAC5C,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAC3C,wDAAsC;AACtC,qDAAmC;AACnC,gEAA8C;AAC9C,8EAA4D;AAC5D,gFAA8D;AAC9D,kEAAgD;AAChD,gFAA8D;AAC9D,kFAAgE;AAChE,gEAA8C;AAC9C,8EAA4D;AAC5D,gFAA8D;AAC9D,wDAAsC;AACtC,+DAA6C;AAC7C,4DAA0C;AAC1C,iEAA+C;AAC/C,+EAA6D;AAC7D,iFAA+D;AAC/D,8DAA4C;AAC5C,4EAA0D;AAC1D,8EAA4D;AAC5D,2DAAyC;AACzC,8DAA4C;AAC5C,2DAAyC;AACzC,8DAA4C;AAC5C,gEAA8C;AAC9C,4EAA0D;AAC1D,8EAA4D;AAC5D,8EAA4D;AAC5D,gFAA8D;AAC9D,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,yDAAuC;AACvC,4DAA0C;AAC1C,0EAAwD;AACxD,4EAA0D;AAC1D,2EAAyD;AACzD,0EAAwD;AACxD,uEAAqD;AACrD,2EAAyD;AACzD,wEAAsD;AACtD,wEAAsD;AACtD,0EAAwD;AACxD,uDAAqC;AACrC,oEAAkD;AAClD,gDAA8B;AAC9B,+CAA6B;AAC7B,2DAAyC;AACzC,oDAAkC;AAClC,0DAAwC;AACxC,yDAAuC;AACvC,gDAA8B;AAC9B,0DAAwC;AACxC,+CAA6B"}
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,sEAAoD;AACpD,mEAAiD;AACjD,gEAA8C;AAC9C,gEAA8C;AAC9C,qEAAmD;AACnD,8DAA4C;AAC5C,oDAAkC;AAClC,wDAAsC;AACtC,yDAAuC;AACvC,8DAA4C;AAC5C,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAC3C,wDAAsC;AACtC,qDAAmC;AACnC,gEAA8C;AAC9C,8EAA4D;AAC5D,gFAA8D;AAC9D,kEAAgD;AAChD,gFAA8D;AAC9D,kFAAgE;AAChE,gEAA8C;AAC9C,8EAA4D;AAC5D,gFAA8D;AAC9D,wDAAsC;AACtC,+DAA6C;AAC7C,4DAA0C;AAC1C,iEAA+C;AAC/C,+EAA6D;AAC7D,iFAA+D;AAC/D,8DAA4C;AAC5C,4EAA0D;AAC1D,8EAA4D;AAC5D,2DAAyC;AACzC,8DAA4C;AAC5C,2DAAyC;AACzC,8DAA4C;AAC5C,gEAA8C;AAC9C,4EAA0D;AAC1D,8EAA4D;AAC5D,8EAA4D;AAC5D,gFAA8D;AAC9D,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,yDAAuC;AACvC,4DAA0C;AAC1C,0EAAwD;AACxD,4EAA0D;AAC1D,2EAAyD;AACzD,0EAAwD;AACxD,uEAAqD;AACrD,2EAAyD;AACzD,wEAAsD;AACtD,wEAAsD;AACtD,0EAAwD;AACxD,uDAAqC;AACrC,oEAAkD;AAClD,gDAA8B;AAC9B,2DAAyC;AACzC,+CAA6B;AAC7B,2DAAyC;AACzC,oDAAkC;AAClC,0DAAwC;AACxC,yDAAuC;AACvC,gDAA8B;AAC9B,0DAAwC;AACxC,+CAA6B"}
@@ -0,0 +1,6 @@
1
+ export type GroupedResponseRow = {
2
+ period: Date;
3
+ dimension: string;
4
+ total_count: number;
5
+ total_amount: number;
6
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=GroupedResponseRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupedResponseRow.js","sourceRoot":"","sources":["../../src/row/GroupedResponseRow.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.42",
11
+ "version": "1.4.44",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -45,7 +45,7 @@ export class NamirasoftCostServer extends NSABaseServer
45
45
  cost: NamirasoftCostServerCost;
46
46
  constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
47
47
  {
48
- super(base_url, `1.4.42`, manager, onError);
48
+ super(base_url, `1.4.44`, manager, onError);
49
49
  this.healthz = new NamirasoftCostServerHealthz(this);
50
50
  this.metrics = new NamirasoftCostServerMetrics(this);
51
51
  this.value = new NamirasoftCostServerValue(this);
@@ -22,6 +22,7 @@ import { CostRow } from "./row/CostRow";
22
22
  import { DimensionType } from "./enum/DimensionType";
23
23
  import { FilterItem } from "namirasoft-core";
24
24
  import { GranularityType } from "./enum/GranularityType";
25
+ import { GroupedResponseRow } from "./row/GroupedResponseRow";
25
26
  import { NamirasoftCostServer } from "./NamirasoftCostServer";
26
27
  import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
27
28
  import { SortItem } from "namirasoft-core";
@@ -42,10 +43,10 @@ export class NamirasoftCostServerCost extends NamirasoftCostServerBase
42
43
  let { data } = await this.server._get<{ rows: CostRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value });
43
44
  return data;
44
45
  }
45
- async Grouped(start_date: Date, end_date: Date, granularity: GranularityType, dimension: DimensionType, filter_workspace_ids: string[], filter_product_ids: string[], filter_sales_item_ids: string[], filter_offer_ids: string[], filter_offer_item_ids: string[], filter_resource_entities: string[], filter_resource_ids: string[], filter_usage_names: string[]): Promise<any[]>
46
+ async Grouped(body: { start_date: Date, end_date: Date, granularity: GranularityType, dimension: DimensionType, filter_workspace_ids: (string | null)[], filter_product_ids: (string | null)[], filter_sales_item_ids: (string | null)[], filter_offer_ids: (string | null)[], filter_offer_item_ids: (string | null)[], filter_resource_entities: (string | null)[], filter_resource_ids: (string | null)[], filter_usage_names: (string | null)[] }): Promise<GroupedResponseRow[]>
46
47
  {
47
48
  let path = `/cost/grouped`;
48
- let { data } = await this.server._get<any[]>(path, { start_date, end_date, granularity, dimension, filter_workspace_ids, filter_product_ids, filter_sales_item_ids, filter_offer_ids, filter_offer_item_ids, filter_resource_entities, filter_resource_ids, filter_usage_names });
49
+ let { data } = await this.server._post<GroupedResponseRow[]>(path, {}, body);
49
50
  return data;
50
51
  }
51
52
  };
@@ -27,7 +27,104 @@ export class CostGroupedCommand extends BaseFinalCommand
27
27
  {
28
28
  constructor(argv: string[])
29
29
  {
30
- super(argv, ["start_date", "end_date", "granularity", "dimension", "filter_workspace_ids", "filter_product_ids", "filter_sales_item_ids", "filter_offer_ids", "filter_offer_item_ids", "filter_resource_entities", "filter_resource_ids", "filter_usage_names"], []);
30
+ super(argv, [], [
31
+ {
32
+ name: "start_date",
33
+ short: "",
34
+ description: "Provides the value of 'start_date' in body",
35
+ optional: false,
36
+ args: ["start_date"],
37
+ defaults: [""]
38
+ },
39
+ {
40
+ name: "end_date",
41
+ short: "",
42
+ description: "Provides the value of 'end_date' in body",
43
+ optional: false,
44
+ args: ["end_date"],
45
+ defaults: [""]
46
+ },
47
+ {
48
+ name: "granularity",
49
+ short: "",
50
+ description: "Provides the value of 'granularity' in body",
51
+ optional: false,
52
+ args: ["granularity"],
53
+ defaults: [""]
54
+ },
55
+ {
56
+ name: "dimension",
57
+ short: "",
58
+ description: "Provides the value of 'dimension' in body",
59
+ optional: false,
60
+ args: ["dimension"],
61
+ defaults: [""]
62
+ },
63
+ {
64
+ name: "filter_workspace_ids",
65
+ short: "",
66
+ description: "Provides the value of 'filter_workspace_ids' in body",
67
+ optional: false,
68
+ args: ["filter_workspace_ids"],
69
+ defaults: [""]
70
+ },
71
+ {
72
+ name: "filter_product_ids",
73
+ short: "",
74
+ description: "Provides the value of 'filter_product_ids' in body",
75
+ optional: false,
76
+ args: ["filter_product_ids"],
77
+ defaults: [""]
78
+ },
79
+ {
80
+ name: "filter_sales_item_ids",
81
+ short: "",
82
+ description: "Provides the value of 'filter_sales_item_ids' in body",
83
+ optional: false,
84
+ args: ["filter_sales_item_ids"],
85
+ defaults: [""]
86
+ },
87
+ {
88
+ name: "filter_offer_ids",
89
+ short: "",
90
+ description: "Provides the value of 'filter_offer_ids' in body",
91
+ optional: false,
92
+ args: ["filter_offer_ids"],
93
+ defaults: [""]
94
+ },
95
+ {
96
+ name: "filter_offer_item_ids",
97
+ short: "",
98
+ description: "Provides the value of 'filter_offer_item_ids' in body",
99
+ optional: false,
100
+ args: ["filter_offer_item_ids"],
101
+ defaults: [""]
102
+ },
103
+ {
104
+ name: "filter_resource_entities",
105
+ short: "",
106
+ description: "Provides the value of 'filter_resource_entities' in body",
107
+ optional: false,
108
+ args: ["filter_resource_entities"],
109
+ defaults: [""]
110
+ },
111
+ {
112
+ name: "filter_resource_ids",
113
+ short: "",
114
+ description: "Provides the value of 'filter_resource_ids' in body",
115
+ optional: false,
116
+ args: ["filter_resource_ids"],
117
+ defaults: [""]
118
+ },
119
+ {
120
+ name: "filter_usage_names",
121
+ short: "",
122
+ description: "Provides the value of 'filter_usage_names' in body",
123
+ optional: false,
124
+ args: ["filter_usage_names"],
125
+ defaults: [""]
126
+ }
127
+ ]);
31
128
  }
32
129
  override async exec()
33
130
  {
@@ -39,7 +136,20 @@ export class CostGroupedCommand extends BaseFinalCommand
39
136
  manager.setValue(token, false);
40
137
  let url = this.app.storage.getItem("ns-cost-server-url");
41
138
  let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
42
- let ans = await server.cost.Grouped(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3], this.arg_values[4], this.arg_values[5], this.arg_values[6], this.arg_values[7], this.arg_values[8], this.arg_values[9], this.arg_values[10], this.arg_values[11]);
139
+ let ans = await server.cost.Grouped({
140
+ start_date: this.option_values.start_date,
141
+ end_date: this.option_values.end_date,
142
+ granularity: this.option_values.granularity,
143
+ dimension: this.option_values.dimension,
144
+ filter_workspace_ids: this.option_values.filter_workspace_ids,
145
+ filter_product_ids: this.option_values.filter_product_ids,
146
+ filter_sales_item_ids: this.option_values.filter_sales_item_ids,
147
+ filter_offer_ids: this.option_values.filter_offer_ids,
148
+ filter_offer_item_ids: this.option_values.filter_offer_item_ids,
149
+ filter_resource_entities: this.option_values.filter_resource_entities,
150
+ filter_resource_ids: this.option_values.filter_resource_ids,
151
+ filter_usage_names: this.option_values.filter_usage_names
152
+ });
43
153
  this.app.logger.success(JSON.stringify(ans));
44
154
  }
45
155
  };
@@ -20,6 +20,7 @@
20
20
 
21
21
  export enum DimensionType
22
22
  {
23
+ NONE = "NONE",
23
24
  WORKSPACE = "WORKSPACE",
24
25
  PRODUCT = "PRODUCT",
25
26
  SALES_ITEM = "SALES_ITEM",
package/src/index.ts CHANGED
@@ -84,6 +84,7 @@ export * from "./estimator/SecretSecretRecordEstimator";
84
84
  export * from "./meta/CostMetaTable";
85
85
  export * from "./meta/NamirasoftCostMetaDatabase";
86
86
  export * from "./row/CostRow";
87
+ export * from "./row/GroupedResponseRow";
87
88
  export * from "./type/Bonus";
88
89
  export * from "./type/CalculationOption";
89
90
  export * from "./type/Estimation";
@@ -0,0 +1,27 @@
1
+ /****************************************************************/
2
+ /* */
3
+ /* This is an Auto-Generated File */
4
+ /* Made By */
5
+ /* Namirasoft SDK Generator NPM Package */
6
+ /* */
7
+ /****************************************************************/
8
+ /****************************************************************/
9
+ /* */
10
+ /* Please do not make any change to this file */
11
+ /* If any change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ export type GroupedResponseRow =
22
+ {
23
+ period: Date;
24
+ dimension: string;
25
+ total_count: number;
26
+ total_amount: number;
27
+ }