Skip to content
This repository was archived by the owner on Sep 18, 2021. It is now read-only.

Commit 1a51814

Browse files
committed
Reworked API
1 parent 2d106ff commit 1a51814

File tree

8 files changed

+113
-183
lines changed

8 files changed

+113
-183
lines changed

example_scripts/REST/Animations.rest

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55

66
###
7-
POST http://{{hostname}}:{{port}}/api/v1/animations/fade HTTP/1.1
7+
POST http://{{hostname}}:{{port}}/api/v2/animation/fade HTTP/1.1
88
Content-Type: application/json
99
Authorization: Basic {{token}}
1010

1111
{
1212
"animation": {
13-
"duration": 10,
13+
"duration": 20,
1414
"smoothness": 1,
1515
"colors": [
1616
{"r": 255, "g": 20, "b": 0, "a": 0.5},
@@ -21,7 +21,7 @@ Authorization: Basic {{token}}
2121
}
2222

2323
###
24-
POST http://{{hostname}}:{{port}}/api/v1/animations/centertoside HTTP/1.1
24+
POST http://{{hostname}}:{{port}}/api/v2/animation/centertoside HTTP/1.1
2525
Content-Type: application/json
2626
Authorization: Basic {{token}}
2727

@@ -37,7 +37,7 @@ Authorization: Basic {{token}}
3737
}
3838

3939
###
40-
POST http://{{hostname}}:{{port}}/api/v1/animations/fire HTTP/1.1
40+
POST http://{{hostname}}:{{port}}/api/v2/animation/fire HTTP/1.1
4141
Content-Type: application/json
4242
Authorization: Basic {{token}}
4343

@@ -57,7 +57,7 @@ Authorization: Basic {{token}}
5757
}
5858

5959
###
60-
POST http://{{hostname}}:{{port}}/api/v1/animations/sidetocenter HTTP/1.1
60+
POST http://{{hostname}}:{{port}}/api/v2/animation/sidetocenter HTTP/1.1
6161
Content-Type: application/json
6262
Authorization: Basic {{token}}
6363

@@ -73,7 +73,7 @@ Authorization: Basic {{token}}
7373
}
7474

7575
###
76-
POST http://{{hostname}}:{{port}}/api/v1/animations/sidetoside HTTP/1.1
76+
POST http://{{hostname}}:{{port}}/api/v2/animation/sidetoside HTTP/1.1
7777
Content-Type: application/json
7878
Authorization: Basic {{token}}
7979

@@ -89,7 +89,7 @@ Authorization: Basic {{token}}
8989
}
9090

9191
###
92-
POST http://{{hostname}}:{{port}}/api/v1/animations/blink HTTP/1.1
92+
POST http://{{hostname}}:{{port}}/api/v2/animation/blink HTTP/1.1
9393
Content-Type: application/json
9494
Authorization: Basic {{token}}
9595

@@ -105,7 +105,7 @@ Authorization: Basic {{token}}
105105
}
106106

107107
###
108-
POST http://{{hostname}}:{{port}}/api/v1/animations/blink HTTP/1.1
108+
POST http://{{hostname}}:{{port}}/api/v2/animation/blink HTTP/1.1
109109
Content-Type: application/json
110110
Authorization: Basic {{token}}
111111

example_scripts/REST/NotificationSync.rest

+10-29
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
@token = token SUPERSECRETCODE
44

55
### Remove
6-
GET http://{{hostname}}:{{port}}/api/v1/persistent/animation/remove/test1 HTTP/1.1
6+
GET http://{{hostname}}:{{port}}/api/v2/persistent/animation/remove/test1 HTTP/1.1
77
Authorization: Basic {{token}}
88

99
### Clear
10-
GET http://{{hostname}}:{{port}}/api/v1/persistent/animation/clear HTTP/1.1
10+
GET http://{{hostname}}:{{port}}/api/v2/persistent/animation/clear HTTP/1.1
1111
Authorization: Basic {{token}}
1212

1313

1414
###
15-
POST http://{{hostname}}:{{port}}/api/v1/persistent/animation/add/blink HTTP/1.1
15+
POST http://{{hostname}}:{{port}}/api/v2/persistent/animation/add/blink/asdf HTTP/1.1
1616
Content-Type: application/json
1717
Authorization: Basic {{token}}
1818

@@ -22,12 +22,11 @@ Authorization: Basic {{token}}
2222
"colors": [
2323
{"r": 255, "g": 100, "b": 0, "a": 0.5}
2424
]
25-
},
26-
"id": "t1"
25+
}
2726
}
2827

2928
###
30-
POST http://{{hostname}}:{{port}}/api/v1/persistent/animation/add/blink HTTP/1.1
29+
POST http://{{hostname}}:{{port}}/api/v2/persistent/animation/add/blink/fdsa HTTP/1.1
3130
Content-Type: application/json
3231
Authorization: Basic {{token}}
3332

@@ -37,27 +36,11 @@ Authorization: Basic {{token}}
3736
"colors": [
3837
{"r": 0, "g": 255, "b": 100, "a": 0.5}
3938
]
40-
},
41-
"id": "t2"
39+
}
4240
}
4341

4442
###
45-
POST http://{{hostname}}:{{port}}/api/v1/persistent/animation/add/blink HTTP/1.1
46-
Content-Type: application/json
47-
Authorization: Basic {{token}}
48-
49-
{
50-
"animation": {
51-
"duration": 30,
52-
"colors": [
53-
{"r": 100, "g": 0, "b": 255, "a": 0.5}
54-
]
55-
},
56-
"id": "t3"
57-
}
58-
59-
###
60-
POST http://{{hostname}}:{{port}}/api/v1/persistent/animation/add/sidetoside HTTP/1.1
43+
POST http://{{hostname}}:{{port}}/api/v2/persistent/animation/add/sidetoside/sts HTTP/1.1
6144
Content-Type: application/json
6245
Authorization: Basic {{token}}
6346

@@ -69,12 +52,11 @@ Authorization: Basic {{token}}
6952
{"r": 0, "g": 255, "b": 0, "a": 1},
7053
{"r": 0, "g": 0, "b": 255, "a": 1}
7154
]
72-
},
73-
"id": "test1"
55+
}
7456
}
7557

7658
###
77-
POST http://{{hostname}}:{{port}}/api/v1/persistent/animation/add/fade HTTP/1.1
59+
POST http://{{hostname}}:{{port}}/api/v2/persistent/animation/add/fade/fd HTTP/1.1
7860
Content-Type: application/json
7961
Authorization: Basic {{token}}
8062

@@ -87,6 +69,5 @@ Authorization: Basic {{token}}
8769
{"r": 0, "g": 255, "b": 0, "a": 0.5},
8870
{"r": 0, "g": 0, "b": 255, "a": 0.5}
8971
]
90-
},
91-
"id": "test2"
72+
}
9273
}

example_scripts/REST/Notifications.rest

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@token = token SUPERSECRETCODE
44

55
###
6-
POST http://{{hostname}}:{{port}}/api/v1/notifications/centertoside HTTP/1.1
6+
POST http://{{hostname}}:{{port}}/api/v2/notification/centertoside HTTP/1.1
77
Content-Type: application/json
88
Authorization: Basic {{token}}
99

@@ -22,7 +22,7 @@ Authorization: Basic {{token}}
2222
}
2323

2424
###
25-
POST http://{{hostname}}:{{port}}/api/v1/notifications/blink HTTP/1.1
25+
POST http://{{hostname}}:{{port}}/api/v2/notification/blink HTTP/1.1
2626
Content-Type: application/json
2727
Authorization: Basic {{token}}
2828

@@ -41,7 +41,7 @@ Authorization: Basic {{token}}
4141
}
4242

4343
###
44-
POST http://{{hostname}}:{{port}}/api/v1/notifications/rippletocenter HTTP/1.1
44+
POST http://{{hostname}}:{{port}}/api/v2/notification/rippletocenter HTTP/1.1
4545
Content-Type: application/json
4646
Authorization: Basic {{token}}
4747

example_scripts/REST/Settings.rest

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
### START
7-
POST http://{{hostname}}:{{port}}/api/v1/start HTTP/1.1
7+
POST http://{{hostname}}:{{port}}/api/v2/start HTTP/1.1
88
Content-Type: application/json
99
Authorization: Basic {{token}}
1010

@@ -13,7 +13,7 @@ Authorization: Basic {{token}}
1313
}
1414

1515
###
16-
POST http://{{hostname}}:{{port}}/api/v1/persistent/settings/mode HTTP/1.1
16+
POST http://{{hostname}}:{{port}}/api/v2/persistent/settings/mode HTTP/1.1
1717
Content-Type: application/json
1818
Authorization: Basic {{token}}
1919

@@ -26,9 +26,9 @@ Authorization: Basic {{token}}
2626

2727

2828
### STOP
29-
GET http://{{hostname}}:{{port}}/api/v1/stop HTTP/1.1
29+
GET http://{{hostname}}:{{port}}/api/v2/stop HTTP/1.1
3030
Authorization: Basic {{token}}
3131

3232
### STATUS
33-
GET http://{{hostname}}:{{port}}/api/v1/status HTTP/1.1
33+
GET http://{{hostname}}:{{port}}/api/v2/status HTTP/1.1
3434
Authorization: Basic {{token}}

package-lock.json

+18-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
},
1515
"dependencies": {
1616
"restify": "^8.5.1",
17+
"restify-errors": "^8.0.2",
1718
"winston": "^3.3.3"
1819
},
1920
"devDependencies": {
2021
"@types/node": "^14.6.4",
2122
"@types/restify": "^8.4.2",
23+
"@types/restify-errors": "^4.3.3",
2224
"@types/restify-plugins": "^1.5.12",
23-
"@types/webpack-env": "^1.15.2",
25+
"@types/webpack-env": "^1.15.3",
2426
"@types/winston": "^2.4.4",
2527
"ts-loader": "^8.0.3",
2628
"typescript": "^4.0.2",

0 commit comments

Comments
 (0)