Skip to content

Commit 0238f9a

Browse files
author
Sia Ghassemi
committed
fixed few bugs and typos, added global --out-json
1 parent 4158006 commit 0238f9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+823
-615
lines changed

README.md

Lines changed: 60 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ Usage:
4545
appStoreConnect [options] [command]
4646

4747
Options:
48-
--version Show version information
49-
-?, -h, --help Show help and usage information
48+
-oj, --out-json
49+
--version Show version information
50+
-?, -h, --help Show help and usage information
5051

5152
Commands:
5253
bundleIds create, update, list BundleIds
@@ -81,7 +82,8 @@ Usage:
8182
appStoreConnect users [options] [command]
8283

8384
Options:
84-
-?, -h, --help Show help and usage information
85+
-oj, --out-json
86+
-?, -h, --help Show help and usage information
8587

8688
Commands:
8789
u, update <userId> <firstName> <lastName> <roles> <token> update a user by their id
@@ -90,8 +92,8 @@ Commands:
9092
g, get <userId> <token> get a user by their id
9193
l, list <token> list all users
9294
d, delete <userId> <token> delete a user by their id
93-
apps, la, linkedApps, lla <userId> <token> list all apps linked to a user by their id
94-
appIds, laid, linkedAppIds, llaid <userId> <token> list all appIds linked to a user by their id
95+
apps, linkedApps <userId> <token> list all apps linked to a user by their id
96+
appIds, linkedAppIds <userId> <token> list all appIds linked to a user by their id
9597
replaceApps <userId> <apps> <token> replace apps for a user by their id
9698
replaceAppsFromJson, replaceAppsJson <userId> <token> <json> replace apps for a user from List of Data json
9799
replaceAppsFile, replaceAppsFromFile <userId> <token> <file> replace apps for a user from List of Data json file
@@ -101,7 +103,6 @@ Commands:
101103
addApps <userId> <apps> <token> add apps for a user by their id
102104
addAppsFromJson, addAppsJson <userId> <token> <json> add apps for a user from List of Data json
103105
addAppsFile, addAppsFromFile <userId> <token> <file> add apps for a user from List of Data json file
104-
105106
```
106107

107108
### UserInvitaions
@@ -116,18 +117,18 @@ Usage:
116117
appStoreConnect userInvitations [options] [command]
117118

118119
Options:
119-
-?, -h, --help Show help and usage information
120+
-oj, --out-json
121+
-?, -h, --help Show help and usage information
120122

121123
Commands:
122-
i, invite <email> <firstName> <lastName> <token> invite a user
123-
ij, ijson, inviteFromJson <token> <json> invite a new user from userInvitation json
124-
if, ifile, inviteFromFile <token> <file> invite a new user from userInvitation json file
125-
g, get <userInvitationId> <token> get a user invitation by its id
126-
l, list <token> list all userInvitations
127-
c, cancel <userInvitationId> <token> cancel a userInvitation by its id
128-
apps, la, linkedApps, lla <userInvitationId> <token> list all apps linked to a userInvitation by its id
129-
appIds, laid, linkedAppIds, llaid <userInvitationId> <token> list all appIds linked to a userInvitation by its id
130-
124+
i, invite <email> <firstName> <lastName> <token> invite a user
125+
ij, ijson, inviteFromJson <token> <json> invite a new user from userInvitation json
126+
if, ifile, inviteFromFile <token> <file> invite a new user from userInvitation json file
127+
g, get <userInvitationId> <token> get a user invitation by its id
128+
l, list <token> list all userInvitations
129+
c, cancel <userInvitationId> <token> cancel a userInvitation by its id
130+
apps, linkedApps <userInvitationId> <token> list all apps linked to a userInvitation by its id
131+
appIds, linkedAppIds <userInvitationId> <token> list all appIds linked to a userInvitation by its id
131132
```
132133

133134
### BundleId
@@ -142,21 +143,21 @@ Usage:
142143
appStoreConnect bundleIds [options] [command]
143144

144145
Options:
145-
-?, -h, --help Show help and usage information
146+
-oj, --out-json
147+
-?, -h, --help Show help and usage information
146148

147149
Commands:
148150
l, list <token>
149151
g, get <bundleIdId> <token>
150152
r, register <identifier> <name> <IOS|MAC_OS|UNIVERSAL> <token>
151-
registerFromJson, rj, rjson <token> <json> register a new bundleId from bundleId json
152-
registerFromFile, rf, rfile <token> <file> register a new bundleId from bundleId json file
153+
registerFromJson, rj, rjson <token> <json> register a new bundleId from bundleId json
154+
registerFromFile, rf, rfile <token> <file> register a new bundleId from bundleId json file
153155
u, update <id> <token>
154156
d, delete <bundleIdId> <token>
155-
capabilities, lbc, list-linkedBundleIdCapabilities, llbc <bundleIdId> <token>
156-
capabilityIds, lbci, list-linkedBundleIdCapabilityIds, llbci <bundleIdId> <token>
157-
list-linkedProfiles, llp, lp, profiles <bundleIdId> <token> lists all profiles for given bundleId (no-content)
158-
list-linkedProfileIds, llpi, lpi, profileIds <bundleIdId> <token>
159-
157+
capabilities, list-linkedBundleIdCapabilities <bundleIdId> <token> list all capabilities for given bundleId
158+
capabilityIds, list-linkedBundleIdCapabilityIds <bundleIdId> <token> list all capabilityIds for given bundleId
159+
list-linkedProfiles, profiles <bundleIdId> <token> lists all profiles for given bundleId (no-content)
160+
list-linkedProfileIds, profileIds <bundleIdId> <token> list all profileIds for given bundleId
160161
```
161162

162163
### BundleIdCapability
@@ -171,13 +172,13 @@ Usage:
171172
appStoreConnect bundleIdCapability [options] [command]
172173

173174
Options:
174-
-?, -h, --help Show help and usage information
175+
-oj, --out-json
176+
-?, -h, --help Show help and usage information
175177

176178
Commands:
177179
ej, ejson, enableFromJson <token> <json> enable capability from BundleIdCapability json
178180
ef, efile, enableFromFile <token> <file> enable capability from BundleIdCapability json file
179181
d, disable <capabilityId> <token>
180-
181182
```
182183

183184
### Devices
@@ -192,7 +193,8 @@ Usage:
192193
appStoreConnect devices [options] [command]
193194

194195
Options:
195-
-?, -h, --help Show help and usage information
196+
-oj, --out-json
197+
-?, -h, --help Show help and usage information
196198

197199
Commands:
198200
r, register <name> <APPLE_TV|APPLE_WATCH|IPAD|IPHONE|IPOD|MAC> <IOS|MAC_OS|UNIVERSAL> <udid> <token> register a new device
@@ -203,7 +205,6 @@ Commands:
203205
uf, ufile, updateFromFile <token> <deviceId> <file> update a device from device json file
204206
g, get <deviceId> <token> get a device by its id
205207
l, list <token> list all devices
206-
207208
```
208209

209210
### Certificates
@@ -224,7 +225,7 @@ Organizational Unit [OU]:
224225
Common Name* [CN]: sia-consulting.eu
225226
Email Address [emailAddress]: info@sia-consulting.eu
226227
```
227-
You can then create a certificate by calling `appStoreConnect.exe certificate createFromFile <CERTIFICATE-TYPE> <BEARER-TOKEN> ./certificate-request.csr`
228+
You can then create a certificate by calling `appStoreConnect.exe certificate createFromFile <BEARER-TOKEN> ./certificate-request.csr --type <CERTIFICATE-TYPE>`
228229
```bash
229230
$ ./appStoreConnect.exe certificates cf
230231
Required argument missing for command: cf
@@ -233,14 +234,15 @@ createFromFile:
233234
create a new certificate from certificate json file
234235

235236
Usage:
236-
appStoreConnect certificates createFromFile [options] <type> <token> <file>
237+
appStoreConnect certificates createFromFile [options] <token> <file>
237238

238239
Arguments:
239-
<DEVELOPER_ID_APPLICATION|DEVELOPER_ID_KEXT|DEVELOPMENT|IOS_DEVELOPMENT|IOS_DISTRIBUTION|MAC_APP_DEVELOPMENT|MAC_APP_DISTRIBUTION|MAC_INSTALLER_DISTRIBUTION>
240240
<token>
241241
<file>
242242

243243
Options:
244+
--type <DEVELOPER_ID_APPLICATION|DEVELOPER_ID_KEXT|DEVELOPMENT|IOS_DEVELOPMENT|IOS_DISTRIBUTION|MAC_APP_DEVELOPMENT|MAC_APP_DISTRIBUTION|MAC_INSTALLER_DISTRIBUTION>
245+
-oj, --out-json
244246
-?, -h, --help Show help and usage information
245247
```
246248
After that you can download the Certificate (CER) from AppStoreConnect
@@ -256,7 +258,7 @@ $ ./appStoreConnect.exe tools cert p12FromFile ./certificate.cer --password <PAS
256258

257259
Here is the help output of the certifiactes command
258260
```bash
259-
dersia@DerSiaBook:/mnt/c/sources/AppStoreConnect/src/AppStoreConnectCli/bin/Debug/netcoreapp3.1$ ./appStoreConnect.exe certificates
261+
$ ./appStoreConnect.exe certificates
260262
Required command was not provided.
261263

262264
certificates:
@@ -266,29 +268,22 @@ Usage:
266268
appStoreConnect certificates [options] [command]
267269

268270
Options:
269-
-?, -h, --help Show help and usage information
271+
-oj, --out-json
272+
-?, -h, --help Show help and usage information
270273

271274
Commands:
272-
c, create <csrContent> <DEVELOPER_ID_APPLICATION|DEVELOPER_ID_KEXT|DEVELOPMENT|IOS_DEVELOPMENT|IOS_DISTRIBUTION|MAC_APP_DEVELOPMENT|MAC_APP_DISTRIBUTION|MAC_INSTALLER_DISTRIBUTION> <token>
273-
create a new certificate
274-
cf, cfile, createFromFile <DEVELOPER_ID_APPLICATION|DEVELOPER_ID_KEXT|DEVELOPMENT|IOS_DEVELOPMENT|IOS_DISTRIBUTION|MAC_APP_DEVELOPMENT|MAC_APP_DISTRIBUTION|MAC_INSTALLER_DISTRIBUTION> <token> <file>
275-
create a new certificate from certificate json file
276-
g, get <certificateId> <token>
277-
get a certificate by its id
278-
gc, getContent <certificateId> <token>
279-
get a certificate content by its id
280-
ge, getEntry <certificateId> <token>
281-
get a certificate without its content by its id
282-
l, list <token>
283-
list all certificates (no content)
284-
r, revoke <certificateId> <token>
285-
revoke a certificate by its id
286-
275+
c, create <csrContent> <token> create a new certificate
276+
cf, cfile, createFromFile <token> <file> create a new certificate from certificate json file
277+
g, get <certificateId> <token> get a certificate by its id
278+
gc, getContent <certificateId> <token> get a certificate content by its id
279+
ge, getEntry <certificateId> <token> get a certificate without its content by its id
280+
l, list <token> list all certificates (no content)
281+
r, revoke <certificateId> <token> revoke a certificate by its id
287282
```
288283

289284
### Profiles
290285
```bash
291-
dersia@DerSiaBook:/mnt/c/sources/AppStoreConnect/src/AppStoreConnectCli/bin/Debug/netcoreapp3.1$ ./appStoreConnect.exe profiles
286+
$ ./appStoreConnect.exe profiles
292287
Required command was not provided.
293288

294289
profiles:
@@ -298,38 +293,24 @@ Usage:
298293
appStoreConnect profiles [options] [command]
299294

300295
Options:
301-
-?, -h, --help Show help and usage information
296+
-oj, --out-json
297+
-?, -h, --help Show help and usage information
302298

303299
Commands:
304-
c, create <name> <IOS_APP_ADHOC|IOS_APP_DEVELOPMENT|IOS_APP_INHOUSE|IOS_APP_STORE|MAC_APP_DEVELOPMENT|MAC_APP_DIRECT|MAC_APP_STORE|TVOS_APP_ADHOC|TVOS_APP_DEVELOPMENT|TVOS_APP_INHOUSE|TVOS_APP_STORE> <token>
305-
create a new profile
306-
cj, cjson, createFromJson <token> <json>
307-
create a new profile from profile json
308-
cf, cfile, createFromFile <token> <file>
309-
create a new profile from profile json file
310-
g, get <profileId> <token>
311-
get a profile by its id
312-
gc, getContent <profileId> <token>
313-
get a profile content by its id
314-
ge, getEntry <profileId> <token>
315-
get a profile by its id(without content)
316-
l, list <token>
317-
list all profiles
318-
d, delete <profileId> <token>
319-
delete a profile by its id
320-
bundleId, lbi, linkedBundleId, llbi <profileId> <token>
321-
get bundleId linked to a profile
322-
bundleIdId, lbiid, linkedBundleIdId, llbiid <profileId> <token>
323-
get bundleIdId linked to a profile
324-
certificates, lc, linkedCertificates, llc <profileId> <token>
325-
list all certificates linked to a profile
326-
certificateIds, lcid, linkedCertificateIds, llcid <profileId> <token>
327-
list all certificateIds linked to a profile
328-
devices, ld, linkedDevices, lld <profileId> <token>
329-
list all devices linked to a profile
330-
deviceIds, ldid, linkedDeviceIds, lldid <profileId> <token>
331-
list all deviceIds linked to a profile
332-
300+
c, create <name> <token> create a new profile
301+
cj, cjson, createFromJson <token> <json> create a new profile from profile json
302+
cf, cfile, createFromFile <token> <file> create a new profile from profile json file
303+
g, get <profileId> <token> get a profile by its id
304+
gc, getContent <profileId> <token> get a profile content by its id
305+
ge, getEntry <profileId> <token> get a profile by its id (without content)
306+
l, list <token> list all profiles
307+
d, delete <profileId> <token> delete a profile by its id
308+
bundleId, linkedBundleId <profileId> <token> get bundleId linked to a profile
309+
bundleIdId, linkedBundleIdId <profileId> <token> get bundleIdId linked to a profile
310+
certificates, linkedCertificates <profileId> <token> list all certificates linked to a profile
311+
certificateIds, linkedCertificateIds <profileId> <token> list all certificateIds linked to a profile
312+
devices, linkedDevices <profileId> <token> list all devices linked to a profile
313+
deviceIds, linkedDeviceIds <profileId> <token> list all deviceIds linked to a profile
333314
```
334315

335316
## Future plans

src/AppStoreConnect/Endpoints/BundleIdCapabilities/DisableCapability.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task<ApplicationResponse> DisableCapability(string id)
2828
{ StatusCode: 403 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
2929
{ StatusCode: 404 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
3030
{ StatusCode: 409 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
31-
{ StatusCode: _ } res => new InternalErrorResponse { Exception = new Exception(res.StatusCode.ToString()) },
31+
{ StatusCode: _ } res => await InternalErrorResponse.CreateFromResponseMessage(res.Response),
3232
};
3333
}
3434
}

src/AppStoreConnect/Endpoints/BundleIdCapabilities/EnableCapability.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task<ApplicationResponse> EnableCapability(BundleIdCapabilityCreate
2828
{ StatusCode: 400 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
2929
{ StatusCode: 403 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
3030
{ StatusCode: 409 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
31-
{ StatusCode: _ } res => new InternalErrorResponse { Exception = new Exception(res.StatusCode.ToString()) },
31+
{ StatusCode: _ } res => await InternalErrorResponse.CreateFromResponseMessage(res.Response),
3232
};
3333
}
3434
}

src/AppStoreConnect/Endpoints/BundleIdCapabilities/ModifyCapability.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public async Task<ApplicationResponse> ModifyCapability(string id, BundleIdCapab
2929
{ StatusCode: 403 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
3030
{ StatusCode: 404 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
3131
{ StatusCode: 409 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
32-
{ StatusCode: _ } res => new InternalErrorResponse { Exception = new Exception(res.StatusCode.ToString()) },
32+
{ StatusCode: _ } res => await InternalErrorResponse.CreateFromResponseMessage(res.Response),
3333
};
3434
}
3535
}

src/AppStoreConnect/Endpoints/BundleIds/DeleteBundleId.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async Task<ApplicationResponse> DeleteBundleId(string id)
2727
{ StatusCode: 403 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
2828
{ StatusCode: 404 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
2929
{ StatusCode: 409 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
30-
{ StatusCode: _ } res => new InternalErrorResponse { Exception = new Exception(res.StatusCode.ToString()) },
30+
{ StatusCode: _ } res => await InternalErrorResponse.CreateFromResponseMessage(res.Response),
3131
};
3232
}
3333
}

src/AppStoreConnect/Endpoints/BundleIds/GetBundleId.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public async Task<ApplicationResponse> GetBundleId(string id, GetBundleIdFilters
5454
{ StatusCode: 400 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
5555
{ StatusCode: 403 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
5656
{ StatusCode: 404 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
57-
{ StatusCode: _ } res => new InternalErrorResponse { Exception = new Exception(res.StatusCode.ToString()) },
57+
{ StatusCode: _ } res => await InternalErrorResponse.CreateFromResponseMessage(res.Response),
5858
};
5959
}
6060
}

src/AppStoreConnect/Endpoints/BundleIds/GetLinkedBundleIdCapabilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task<ApplicationResponse> GetLinkedBundleIdCapabilities(string bund
4141
{ StatusCode: 400 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
4242
{ StatusCode: 403 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
4343
{ StatusCode: 404 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
44-
{ StatusCode: _ } res => new InternalErrorResponse { Exception = new Exception(res.StatusCode.ToString()) },
44+
{ StatusCode: _ } res => await InternalErrorResponse.CreateFromResponseMessage(res.Response),
4545
};
4646
}
4747
}

src/AppStoreConnect/Endpoints/BundleIds/GetLinkedBundleIdCapabilityIds.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public async Task<ApplicationResponse> GetLinkedBundleIdCapabilityIds(string bun
3535
{ StatusCode: 400 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
3636
{ StatusCode: 403 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
3737
{ StatusCode: 404 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
38-
{ StatusCode: _ } res => new InternalErrorResponse { Exception = new Exception(res.StatusCode.ToString()) },
38+
{ StatusCode: _ } res => await InternalErrorResponse.CreateFromResponseMessage(res.Response),
3939
};
4040
}
4141
}

src/AppStoreConnect/Endpoints/BundleIds/GetLinkedProfileIds.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public async Task<ApplicationResponse> GetLinkedProfileIds(string bundleId, List
3434
{ StatusCode: 400 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
3535
{ StatusCode: 403 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
3636
{ StatusCode: 404 } br => JsonSerializer.Deserialize<ErrorResponse>(await br.Response.Content.ReadAsStringAsync()),
37-
{ StatusCode: _ } res => new InternalErrorResponse { Exception = new Exception(res.StatusCode.ToString()) },
37+
{ StatusCode: _ } res => await InternalErrorResponse.CreateFromResponseMessage(res.Response),
3838
};
3939
}
4040
}

0 commit comments

Comments
 (0)