Skip to content

Commit e462ed8

Browse files
committed
Cli fix for measures and docs update
1 parent df7f011 commit e462ed8

File tree

9 files changed

+585
-113
lines changed

9 files changed

+585
-113
lines changed

bin/cli.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,35 @@ var program = require('commander'),
1616
* Options helpers
1717
*/
1818
var Helpers = {
19-
cacheFile: path.join( ((process.platform.substr(0, 3) === 'win') ? process.env.HOMEPATH : process.env.HOME), ".itcreport")
19+
cacheFile: path.join( ((process.platform.substr(0, 3) === 'win') ? process.env.HOMEPATH : process.env.HOME), ".itcreport"),
20+
translate: {
21+
inapp: itc.type.inapp,
22+
app: itc.type.app,
23+
24+
free: itc.transaction.free,
25+
paid: itc.transaction.paid,
26+
redownload: itc.transaction.redownload,
27+
update: itc.transaction.update,
28+
refund: itc.transaction.refund,
29+
30+
desktop: itc.platform.desktop,
31+
iphone: itc.platform.iphone,
32+
ipad: itc.platform.ipad,
33+
ipod: itc.platform.ipod,
34+
35+
proceeds: itc.measure.proceeds,
36+
units: itc.measure.units
37+
}
2038
};
2139

2240
Helpers.collectValues = function (value, collection) {
23-
collection.push(value);
24-
return collection;
41+
// All values are unique so for now its ok to do it this way :()
42+
if (typeof Helpers.translate[value] !== 'undefined') {
43+
collection.push(Helpers.translate[value]);
44+
return collection;
45+
}
46+
console.error("\nUknown value: " + value + "\n");
47+
process.exit(1);
2548
}
2649

2750
Helpers.sinceDate = function(value) {
@@ -183,7 +206,7 @@ program
183206
Config.filters.type = program.type;
184207
})
185208
.on("measure", function() {
186-
Config.measure = program.measure;
209+
Config.measures = program.measure;
187210
});
188211

189212
// Command create-config

docs/classes/Connect.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ <h3 class="name"><code>executeRequest</code></h3>
448448

449449

450450

451-
<a href="../files/index.js.html#l203"><code>index.js:203</code></a>
451+
<a href="../files/index.js.html#l211"><code>index.js:211</code></a>
452452

453453
</p>
454454

@@ -559,7 +559,7 @@ <h3 class="name"><code>login</code></h3>
559559

560560

561561

562-
<a href="../files/index.js.html#l246"><code>index.js:246</code></a>
562+
<a href="../files/index.js.html#l254"><code>index.js:254</code></a>
563563

564564
</p>
565565

@@ -664,7 +664,7 @@ <h3 class="name"><code>metadata</code></h3>
664664

665665

666666

667-
<a href="../files/index.js.html#l169"><code>index.js:169</code></a>
667+
<a href="../files/index.js.html#l177"><code>index.js:177</code></a>
668668

669669
</p>
670670

@@ -819,7 +819,7 @@ <h3 class="name"><code>request</code></h3>
819819

820820

821821

822-
<a href="../files/index.js.html#l132"><code>index.js:132</code></a>
822+
<a href="../files/index.js.html#l140"><code>index.js:140</code></a>
823823

824824
</p>
825825

docs/classes/Query.html

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ <h1>Query Class</h1>
9696

9797

9898
<div class="foundat">
99-
Defined in: <a href="../files/index.js.html#l427"><code>index.js:427</code></a>
99+
Defined in: <a href="../files/index.js.html#l437"><code>index.js:437</code></a>
100100
</div>
101101

102102

@@ -118,25 +118,25 @@ <h1>Query Class</h1>
118118
var itc = require(&quot;itunesconnect&quot;),
119119

120120
// Types
121-
itc.Type.InApp
122-
itc.Type.App
121+
itc.type.inapp
122+
itc.type.app
123123

124124
// Transactions
125-
itc.Transaction.Free
126-
itc.Transaction.Paid
127-
itc.Transaction.Redownload
128-
itc.Transaction.Update
129-
itc.Transaction.Refund
125+
itc.transaction.free
126+
itc.transaction.paid
127+
itc.transaction.redownload
128+
itc.transaction.update
129+
itc.transaction.refund
130130

131131
// Platforms
132-
itc.Platform.Desktop
133-
itc.Platform.iPhone
134-
itc.Platform.iPad
135-
itc.Platform.iPod
132+
itc.platform.desktop
133+
itc.platform.iphone
134+
itc.platform.ipad
135+
itc.platform.ipod
136136

137137
// Measures
138-
itc.Measure.Proceeds
139-
itc.Measure.Units</code></pre>
138+
itc.measure.proceeds
139+
itc.measure.units</code></pre>
140140

141141
</div>
142142

@@ -193,7 +193,7 @@ <h3 class="name"><code>Query</code></h3>
193193

194194

195195

196-
<a href="../files/index.js.html#l427"><code>index.js:427</code></a>
196+
<a href="../files/index.js.html#l437"><code>index.js:437</code></a>
197197

198198
</p>
199199

@@ -433,7 +433,7 @@ <h3 class="name"><code>body</code></h3>
433433

434434

435435

436-
<a href="../files/index.js.html#l483"><code>index.js:483</code></a>
436+
<a href="../files/index.js.html#l493"><code>index.js:493</code></a>
437437

438438
</p>
439439

@@ -514,7 +514,7 @@ <h3 class="name"><code>category</code></h3>
514514

515515

516516

517-
<a href="../files/index.js.html#l686"><code>index.js:686</code></a>
517+
<a href="../files/index.js.html#l699"><code>index.js:699</code></a>
518518

519519
</p>
520520

@@ -625,7 +625,7 @@ <h3 class="name"><code>content</code></h3>
625625

626626

627627

628-
<a href="../files/index.js.html#l672"><code>index.js:672</code></a>
628+
<a href="../files/index.js.html#l685"><code>index.js:685</code></a>
629629

630630
</p>
631631

@@ -722,7 +722,7 @@ <h3 class="name"><code>date</code></h3>
722722

723723

724724

725-
<a href="../files/index.js.html#l574"><code>index.js:574</code></a>
725+
<a href="../files/index.js.html#l587"><code>index.js:587</code></a>
726726

727727
</p>
728728

@@ -839,7 +839,7 @@ <h3 class="name"><code>group</code></h3>
839839

840840

841841

842-
<a href="../files/index.js.html#l624"><code>index.js:624</code></a>
842+
<a href="../files/index.js.html#l637"><code>index.js:637</code></a>
843843

844844
</p>
845845

@@ -1012,7 +1012,7 @@ <h3 class="name"><code>interval</code></h3>
10121012

10131013

10141014

1015-
<a href="../files/index.js.html#l555"><code>index.js:555</code></a>
1015+
<a href="../files/index.js.html#l568"><code>index.js:568</code></a>
10161016

10171017
</p>
10181018

@@ -1172,7 +1172,7 @@ <h3 class="name"><code>limit</code></h3>
11721172

11731173

11741174

1175-
<a href="../files/index.js.html#l658"><code>index.js:658</code></a>
1175+
<a href="../files/index.js.html#l671"><code>index.js:671</code></a>
11761176

11771177
</p>
11781178

@@ -1263,7 +1263,7 @@ <h3 class="name"><code>location</code></h3>
12631263

12641264

12651265

1266-
<a href="../files/index.js.html#l722"><code>index.js:722</code></a>
1266+
<a href="../files/index.js.html#l735"><code>index.js:735</code></a>
12671267

12681268
</p>
12691269

@@ -1354,7 +1354,7 @@ <h3 class="name"><code>measures</code></h3>
13541354

13551355

13561356

1357-
<a href="../files/index.js.html#l644"><code>index.js:644</code></a>
1357+
<a href="../files/index.js.html#l657"><code>index.js:657</code></a>
13581358

13591359
</p>
13601360

@@ -1444,7 +1444,7 @@ <h3 class="name"><code>platform</code></h3>
14441444

14451445

14461446

1447-
<a href="../files/index.js.html#l736"><code>index.js:736</code></a>
1447+
<a href="../files/index.js.html#l749"><code>index.js:749</code></a>
14481448

14491449
</p>
14501450

@@ -1527,7 +1527,7 @@ <h3 class="name"><code>ranked</code></h3>
15271527

15281528

15291529

1530-
<a href="../files/index.js.html#l535"><code>index.js:535</code></a>
1530+
<a href="../files/index.js.html#l548"><code>index.js:548</code></a>
15311531

15321532
</p>
15331533

@@ -1600,7 +1600,7 @@ <h3 class="name"><code>time</code></h3>
16001600

16011601

16021602

1603-
<a href="../files/index.js.html#l604"><code>index.js:604</code></a>
1603+
<a href="../files/index.js.html#l617"><code>index.js:617</code></a>
16041604

16051605
</p>
16061606

@@ -1701,7 +1701,7 @@ <h3 class="name"><code>timed</code></h3>
17011701

17021702

17031703

1704-
<a href="../files/index.js.html#l515"><code>index.js:515</code></a>
1704+
<a href="../files/index.js.html#l528"><code>index.js:528</code></a>
17051705

17061706
</p>
17071707

@@ -1768,7 +1768,7 @@ <h3 class="name"><code>transaction</code></h3>
17681768

17691769

17701770

1771-
<a href="../files/index.js.html#l764"><code>index.js:764</code></a>
1771+
<a href="../files/index.js.html#l777"><code>index.js:777</code></a>
17721772

17731773
</p>
17741774

@@ -1859,7 +1859,7 @@ <h3 class="name"><code>type</code></h3>
18591859

18601860

18611861

1862-
<a href="../files/index.js.html#l750"><code>index.js:750</code></a>
1862+
<a href="../files/index.js.html#l763"><code>index.js:763</code></a>
18631863

18641864
</p>
18651865

docs/classes/Report.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ <h1>Report Class</h1>
9696

9797

9898
<div class="foundat">
99-
Defined in: <a href="../files/index.js.html#l290"><code>index.js:290</code></a>
99+
Defined in: <a href="../files/index.js.html#l300"><code>index.js:300</code></a>
100100
</div>
101101

102102

@@ -135,10 +135,10 @@ <h1>Report Class</h1>
135135
filters : {
136136
content: [{AppID}, {AppID}, {AppID}],
137137
location: [{LocationID}, {LocationID}],
138-
transaction: itc.Transaction.Free,
138+
transaction: itc.transaction.free,
139139
type: [
140-
itc.Type.InApp,
141-
itc.Type.App
140+
itc.type.inapp,
141+
itc.type.app
142142
],
143143
category: {CategoryID}
144144
},
@@ -202,7 +202,7 @@ <h3 class="name"><code>Report</code></h3>
202202

203203

204204

205-
<a href="../files/index.js.html#l290"><code>index.js:290</code></a>
205+
<a href="../files/index.js.html#l300"><code>index.js:300</code></a>
206206

207207
</p>
208208

@@ -689,7 +689,7 @@ <h3 class="name"><code>ranked</code></h3>
689689

690690

691691

692-
<a href="../files/index.js.html#l365"><code>index.js:365</code></a>
692+
<a href="../files/index.js.html#l375"><code>index.js:375</code></a>
693693

694694
</p>
695695

@@ -811,7 +811,7 @@ <h3 class="name"><code>timed</code></h3>
811811

812812

813813

814-
<a href="../files/index.js.html#l396"><code>index.js:396</code></a>
814+
<a href="../files/index.js.html#l406"><code>index.js:406</code></a>
815815

816816
</p>
817817

0 commit comments

Comments
 (0)