Skip to content

Commit e3756a0

Browse files
committed
arc -> studio
1 parent a02cfe3 commit e3756a0

File tree

2 files changed

+61
-61
lines changed

2 files changed

+61
-61
lines changed

arc/README renamed to studio/README

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
NAME
2-
arc - https://www.arcmedia.com
2+
Studio - https://www.instructure.com/canvas/higher-education/platform/products/canvas-studio
33

44
SYNOPSIS
5-
arc [options] method
5+
studio [options] method
66

77
DESCRIPTION
8-
arc-cli is a secure curl wrapper designed to simplify interacting
9-
with the Arc JSON/REST API.
8+
studio-cli is a secure curl wrapper designed to simplify interacting
9+
with the Studio JSON/REST API.
1010

11-
arc-cli automatically handles the creation of auth sessions based
11+
studio-cli automatically handles the creation of auth sessions based
1212
on user credentials stored in the config file or on values
1313
passed at runtime.
1414

@@ -23,19 +23,19 @@ OPTIONS
2323
All options must be included before the API method.
2424

2525
-c
26-
This option runs the arc configuration and stores the
26+
This option runs the studio configuration and stores the
2727
domain, email, and password in the preference file
2828
located at ~/.inst
2929

3030
If no preference file is detected on first run, the
3131
configuration process will automatically run. This option
32-
is mainly for adding arc if other Instructure APIs have
32+
is mainly for adding Studio if other Instructure APIs have
3333
already been used, such as canvas or bridge
3434

35-
Arc config stores the following values in ~/.inst:
36-
arc_domain="<domain>"
37-
arc_email="<email>"
38-
arc_password="<password>"
35+
Studio config stores the following values in ~/.inst:
36+
studio_domain="<domain>"
37+
studio_email="<email>"
38+
studio_password="<password>"
3939

4040
-d <domain>
4141
This option allows querying a specified domain,
@@ -47,15 +47,15 @@ OPTIONS
4747
"-d foobar"
4848

4949
-d also requires that -e <email> and -p <password> be included
50-
in the query. arc will not allow you to pass one
50+
in the query. Studio will not allow you to pass one
5151
authentication parameter and read the others from config.
5252

5353
-e <email>
5454
This option allows querying via a specified email log in,
5555
overriding the value set in the .inst config file.
5656

5757
-e also requires that -d <domain> and -p <password> be included
58-
in the query. arc will not allow you to pass one
58+
in the query. Studio will not allow you to pass one
5959
authentication parameter and read the others from config.
6060

6161
-F <name=content>
@@ -72,20 +72,20 @@ OPTIONS
7272
-o <path>
7373
This option outputs the return to a specified path and file.
7474

75-
When an output is specified, arc will always set the output
75+
When an output is specified, Studio will always set the output
7676
rendered to "plain", even if it is explicitly specified.
7777

7878
-p <password>
7979
This option allows querying with a specified login password,
8080
overriding the value set in the .inst config file.
8181

8282
-p also requires that -e <email> and -d <domain> be included
83-
in the query. arc will not allow you to pass one
83+
in the query. Studio will not allow you to pass one
8484
authentication parameter and read the others from config.
8585

8686
-r <renderer>
8787
This option allows you to specify the render method of the
88-
the return from arc. Available options are:
88+
the return from Studio. Available options are:
8989

9090
"color" (default) This will use json (npm) to format the
9191
return and will use pygmentize (pip) to color the return.
@@ -108,7 +108,7 @@ OPTIONS
108108
"PUT"/"put"
109109
"DELETE"/"delete"
110110

111-
The required HTTP method is generally specified in the arc
111+
The required HTTP method is generally specified in the Studio
112112
API documentation.
113113

114114
-v
@@ -127,29 +127,29 @@ METHOD
127127
the current shell has issues with query parameters.
128128
For example when searching for users you can use:
129129

130-
arc "media_management/search_users?query=<name>"
130+
studio "media_management/search_users?query=<name>"
131131

132132
EXAMPLES
133133
List caption files associated with a given media object
134-
arc media_management/media/<media_id>/caption_files
134+
studio media_management/media/<media_id>/caption_files
135135

136136
Get plain format of list of caption files associated with a media object
137-
arc -r plain media_management/media/<media_id>/caption_files
137+
studio -r plain media_management/media/<media_id>/caption_files
138138

139139
Save output of list of caption files associated with a media object
140-
arc -o ~/captions.json media_management/media/<media_id>/caption_files
140+
studio -o ~/captions.json media_management/media/<media_id>/caption_files
141141

142142
Search for users by name or email
143-
arc media_management/search_users?query=<name>
143+
studio media_management/search_users?query=<name>
144144

145145
Delete a tag for the given media and tag
146-
arc -X DELETE tags/<id>?media_id=<media_id>
146+
studio -X DELETE tags/<id>?media_id=<media_id>
147147

148148
Send a password reset email
149-
arc -X POST -F "email=<email>" user_management/users/reset_password
149+
studio -X POST -F "email=<email>" user_management/users/reset_password
150150

151-
Authenticate to Arc without using .inst config file
152-
arc -d <domain> -e <email> -p <password> media_management/media/<id>
151+
Authenticate to Studio without using .inst config file
152+
studio -d <domain> -e <email> -p <password> media_management/media/<id>
153153

154154
FILES
155155
~/.inst
@@ -167,11 +167,11 @@ EXIT CODES
167167
a successful command.
168168

169169
WWW
170-
https://www.arcmedia.com/
171-
Instructure home page for the Arc media software.
170+
https://www.instructure.com/canvas/higher-education/platform/products/canvas-studio
171+
Instructure home page for the Studio media software.
172172

173173
https://instructure.instructuremedia.com/api/docs/
174-
API documentation for Arc media software.
174+
API documentation for Studio media software.
175175

176176
https://github.com/thedannywahl/inst-api
177-
Software repository for arc-cli.
177+
Software repository for studio-cli.

arc/arc renamed to studio/studio

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dependency() {
4747
prompt() {
4848
declare -a dep=("$@")
4949
clear
50-
echo >&2 "arc-cli requires ${dep[1]} (${dep[3]}) but it's not installed"
50+
echo >&2 "studio-cli requires ${dep[1]} (${dep[3]}) but it's not installed"
5151
echo >&2 "would you like to install it now?"
5252
select yn in "Yes" "No"; do
5353
case $yn in
@@ -60,7 +60,7 @@ prompt() {
6060
install() {
6161
declare -a dep=("$@")
6262
clear
63-
echo >&2 "arc-cli will attempt to install ${dep[1]} (${dep[3]})"
63+
echo >&2 "studio-cli will attempt to install ${dep[1]} (${dep[3]})"
6464
hr
6565
if [ ${dep[3]} = "npm" ]; then
6666
command -v ${dep[3]} > /dev/null 2>&1 && npm install -g "${dep[1]}" || manualinstall ${dep[@]} ""
@@ -81,7 +81,7 @@ manualinstall() {
8181
declare -a dep=("$@")
8282
if [ ${#dep[@]} -gt 4 ]; then
8383
hr
84-
echo "arc-cli was unable to install ${dep[1]} (${dep[3]})"
84+
echo "studio-cli was unable to install ${dep[1]} (${dep[3]})"
8585
if [ ${dep[3]} = "npm" ]; then
8686
echo >&2 "\`npm install -g ${dep[1]}\` failed"
8787
elif [ ${dep[3]} = "pip" ]; then
@@ -148,17 +148,17 @@ help() {
148148
}
149149

150150
verbosehelp() {
151-
curl --tlsv1.2 --retry 2 --retry-connrefused -s -S -g -X GET "https://raw.githubusercontent.com/thedannywahl/inst-api/master/arc/README" | less
151+
curl --tlsv1.2 --retry 2 --retry-connrefused -s -S -g -X GET "https://raw.githubusercontent.com/thedannywahl/inst-api/master/studio/README" | less
152152
exit;
153153
}
154154

155155
usage() {
156-
echo -e 2>&1 "Usage: arc [options] method\r\nHelp: arc -h"
156+
echo -e 2>&1 "Usage: studio [options] method\r\nHelp: studio -h"
157157
}
158158

159159
version() {
160160
logo
161-
echo >&2 " arc-cli version 0.3.1"
161+
echo >&2 " studio-cli version 0.3.1"
162162
exit
163163
}
164164

@@ -186,28 +186,28 @@ done
186186
# PREF FILE ####################################################################
187187
# ##############################################################################
188188

189-
arc_domain=""
190-
arc_email=""
191-
arc_password=""
189+
studio_domain=""
190+
studio_email=""
191+
studio_password=""
192192
readconfig() {
193193
if [ -f ~/.inst ]; then
194194
. ~/.inst
195-
if [ -z $arc_domain ]; then
195+
if [ -z $studio_domain ]; then
196196
echo >&2 "unable to read domain from config file \`~/.inst\`"
197197
echo >&2 "It must be manually added or repaired. Format:"
198-
echo >&2 "arc_domain=\"<domain>\""
198+
echo >&2 "studio_domain=\"<domain>\""
199199
exit 2
200200
fi
201-
if [ -z $arc_email ]; then
201+
if [ -z $studio_email ]; then
202202
echo >&2 "unable to read token from config file \`~/.inst\`"
203203
echo >&2 "It must be manually added or repaired. Format:"
204-
echo >&2 "arc_email=\"<token>\""
204+
echo >&2 "studio_email=\"<token>\""
205205
exit 2;
206206
fi
207-
if [ -z $arc_password ]; then
207+
if [ -z $studio_password ]; then
208208
echo >&2 "unable to read token from config file \`~/.inst\`"
209209
echo >&2 "It must be manually added or repaired. Format:"
210-
echo >&2 "arc_password=\"<token>\""
210+
echo >&2 "studio_password=\"<token>\""
211211
exit 2;
212212
fi
213213
else
@@ -220,7 +220,7 @@ readconfig() {
220220
setconfig; break ;;
221221
No )
222222
clear
223-
echo >&2 "arc-cli requires a config file or use \`-d\`, \`-e\`, and \`-p\`"
223+
echo >&2 "studio-cli requires a config file or use \`-d\`, \`-e\`, and \`-p\`"
224224
usage; exit 2 ;;
225225
esac
226226
done
@@ -260,24 +260,24 @@ setconfig() {
260260

261261
setdomain() {
262262
clear
263-
echo >&2 "what is your arc subdomain?"
263+
echo >&2 "what is your Studio subdomain?"
264264
echo >&2 "https://<subdomain>.instructuremedia.com"
265-
read arcdomain
266-
echo "arc_domain=\"$arcdomain\"" >> ~/.inst
265+
read studiodomain
266+
echo "studio_domain=\"$studiodomain\"" >> ~/.inst
267267
}
268268

269269
setemail() {
270270
clear
271-
echo >&2 "What is your arc login email address?"
272-
read arcemail
273-
echo >&2 "arc_email=\"$arcemail\"" >> ~/.inst
271+
echo >&2 "What is your Studio login email address?"
272+
read studioemail
273+
echo >&2 "studio_email=\"$studioemail\"" >> ~/.inst
274274
}
275275

276276
setpassword() {
277277
clear
278-
echo >&2 "What is your arc login password?"
278+
echo >&2 "What is your Studio login password?"
279279
read arcpassword
280-
echo >&2 "arc_password=\"$arcpassword\"" >> ~/.inst
280+
echo >&2 "studio_password=\"$studiopassword\"" >> ~/.inst
281281
}
282282

283283
# OUTPUT FILE ##################################################################
@@ -329,11 +329,11 @@ else
329329
X)
330330
sethttp $OPTARG ;;
331331
d)
332-
arc_domain="$OPTARG" ;;
332+
studio_domain="$OPTARG" ;;
333333
e)
334-
arc_email="$OPTARG" ;;
334+
studio_email="$OPTARG" ;;
335335
p)
336-
arc_password="$OPTARG" ;;
336+
studio_password="$OPTARG" ;;
337337
o)
338338
setoutput $OPTARG;;
339339
F)
@@ -366,9 +366,9 @@ fi
366366
# BUILD COMMAND ################################################################
367367
# ##############################################################################
368368

369-
if [ -z "$arc_domain" ] && [ -z "$arc_email" ] && [ -z "$arc_password" ]; then
369+
if [ -z "$studio_domain" ] && [ -z "$studio_email" ] && [ -z "$studio_password" ]; then
370370
readconfig
371-
elif [ -z "$arc_domain" ] || [ -z "$arc_email" ] || [ -z "$arc_password" ]; then
371+
elif [ -z "$studio_domain" ] || [ -z "$studio_email" ] || [ -z "$studio_password" ]; then
372372
echo >&2 "\`-d\`, \`-e\`, and \`-p\` are required when not using a config file"
373373
usage
374374
exit 2
@@ -386,7 +386,7 @@ userid=""
386386
token=""
387387
curlopts="--tlsv1.2 --retry 2 --retry-connrefused -s -S -g"
388388

389-
session=$(curl $curlopts -H "Content-Type: application/json" --data '{"email":"'$arc_email'","password":"'$arc_password'"}' -X POST "https://$arc_domain.instructuremedia.com/api/auth/session")
389+
session=$(curl $curlopts -H "Content-Type: application/json" --data '{"email":"'$studio_email'","password":"'$studio_password'"}' -X POST "https://$studio_domain.instructuremedia.com/api/auth/session")
390390
if [ $? -gt 0 ]; then
391391
echo >&2 "Unable to generate a session. Please ensure that your credentials are accurate."
392392
exit 2
@@ -405,7 +405,7 @@ fi
405405
# BUILD COMMAND ################################################################
406406
# ##############################################################################
407407

408-
command="curl $curlopts -H 'Authorization: Bearer user_id=\"$userid\", token=\"$token\"' -X $httpmethod \"https://$arc_domain.instructuremedia.com/api/$path\" $formopts $outputrenderer $outputpath"
408+
command="curl $curlopts -H 'Authorization: Bearer user_id=\"$userid\", token=\"$token\"' -X $httpmethod \"https://$studio_domain.instructuremedia.com/api/$path\" $formopts $outputrenderer $outputpath"
409409
if [ "$sample" = true ]; then
410410
echo "$command"
411411
else

0 commit comments

Comments
 (0)