namirasoft-cost 1.4.42 → 1.4.43
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/dist/NamirasoftCostServer.js +1 -1
- package/dist/NamirasoftCostServerCost.d.ts +14 -1
- package/dist/NamirasoftCostServerCost.js +2 -2
- package/dist/NamirasoftCostServerCost.js.map +1 -1
- package/dist/command/CostGroupedCommand.js +112 -2
- package/dist/command/CostGroupedCommand.js.map +1 -1
- package/package.json +1 -1
- package/src/NamirasoftCostServer.ts +1 -1
- package/src/NamirasoftCostServerCost.ts +2 -2
- package/src/command/CostGroupedCommand.ts +112 -2
|
@@ -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.
|
|
17
|
+
super(base_url, `1.4.43`, 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);
|
|
@@ -11,5 +11,18 @@ export declare class NamirasoftCostServerCost extends NamirasoftCostServerBase {
|
|
|
11
11
|
rows: CostRow[];
|
|
12
12
|
count: number;
|
|
13
13
|
}>;
|
|
14
|
-
Grouped(
|
|
14
|
+
Grouped(body: {
|
|
15
|
+
start_date: Date;
|
|
16
|
+
end_date: Date;
|
|
17
|
+
granularity: GranularityType;
|
|
18
|
+
dimension: DimensionType;
|
|
19
|
+
filter_workspace_ids: (string[] | null);
|
|
20
|
+
filter_product_ids: (string[] | null);
|
|
21
|
+
filter_sales_item_ids: (string[] | null);
|
|
22
|
+
filter_offer_ids: (string[] | null);
|
|
23
|
+
filter_offer_item_ids: (string[] | null);
|
|
24
|
+
filter_resource_entities: (string[] | null);
|
|
25
|
+
filter_resource_ids: (string[] | null);
|
|
26
|
+
filter_usage_names: (string[] | null);
|
|
27
|
+
}): Promise<any[]>;
|
|
15
28
|
}
|
|
@@ -28,10 +28,10 @@ class NamirasoftCostServerCost extends NamirasoftCostServerBase_1.NamirasoftCost
|
|
|
28
28
|
return data;
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
Grouped(
|
|
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.
|
|
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,kBAAkB,GAAW,0BAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC3D,IAAI,IAAI,GAAG,YAAY,CAAC;YACxB,IAAI,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AAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAQ,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YAC9D,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, [
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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(
|
|
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,sCAAg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C,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"}
|
package/package.json
CHANGED
|
@@ -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.
|
|
48
|
+
super(base_url, `1.4.43`, manager, onError);
|
|
49
49
|
this.healthz = new NamirasoftCostServerHealthz(this);
|
|
50
50
|
this.metrics = new NamirasoftCostServerMetrics(this);
|
|
51
51
|
this.value = new NamirasoftCostServerValue(this);
|
|
@@ -42,10 +42,10 @@ export class NamirasoftCostServerCost extends NamirasoftCostServerBase
|
|
|
42
42
|
let { data } = await this.server._get<{ rows: CostRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value });
|
|
43
43
|
return data;
|
|
44
44
|
}
|
|
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[]>
|
|
45
|
+
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<any[]>
|
|
46
46
|
{
|
|
47
47
|
let path = `/cost/grouped`;
|
|
48
|
-
let { data } = await this.server.
|
|
48
|
+
let { data } = await this.server._post<any[]>(path, {}, body);
|
|
49
49
|
return data;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
@@ -27,7 +27,104 @@ export class CostGroupedCommand extends BaseFinalCommand
|
|
|
27
27
|
{
|
|
28
28
|
constructor(argv: string[])
|
|
29
29
|
{
|
|
30
|
-
super(argv, [
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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: true,
|
|
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(
|
|
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
|
};
|