Skip to content

Commit 4d10dbe

Browse files
authored
replaced numerical values of API Scopes by names (#96)
From now as we became closer to first Beta, we replace numerical values of API scope group to names, as they will be in release. --------- Signed-off-by: Alexander Piskun <[email protected]>
1 parent 8928782 commit 4d10dbe

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

.github/workflows/analysis-coverage.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
cd ..
137137
php occ app_ecosystem_v2:daemon:register manual_install "Manual Install" manual-install 0 0 0
138138
php occ app_ecosystem_v2:app:register $APP_ID manual_install --json-info \
139-
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[2, 10, 11],\"optional\":[30, 31, 32, 33, 50]},\"port\":$APP_PORT,\"protocol\":\"http\",\"system_app\":1}" \
139+
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[\"SYSTEM\", \"FILES\", \"FILES_SHARING\"],\"optional\":[\"USER_INFO\", \"USER_STATUS\", \"NOTIFICATIONS\", \"WEATHER_STATUS\", \"TALK\"]},\"port\":$APP_PORT,\"protocol\":\"http\",\"system_app\":1}" \
140140
-e --force-scopes
141141
kill -15 $(cat /tmp/_install.pid)
142142
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
@@ -290,7 +290,7 @@ jobs:
290290
cd ..
291291
php occ app_ecosystem_v2:daemon:register manual_install "Manual Install" manual-install 0 0 0
292292
php occ app_ecosystem_v2:app:register $APP_ID manual_install --json-info \
293-
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[2, 10, 11],\"optional\":[30, 31, 32, 33, 50]},\"port\":$APP_PORT,\"protocol\":\"http\",\"system_app\":1}" \
293+
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[\"SYSTEM\", \"FILES\", \"FILES_SHARING\"],\"optional\":[\"USER_INFO\", \"USER_STATUS\", \"NOTIFICATIONS\", \"WEATHER_STATUS\", \"TALK\"]},\"port\":$APP_PORT,\"protocol\":\"http\",\"system_app\":1}" \
294294
-e --force-scopes
295295
kill -15 $(cat /tmp/_install.pid)
296296
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
@@ -429,7 +429,7 @@ jobs:
429429
cd ..
430430
php occ app_ecosystem_v2:daemon:register manual_install "Manual Install" manual-install 0 0 0
431431
php occ app_ecosystem_v2:app:register $APP_ID manual_install --json-info \
432-
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[2, 10, 11],\"optional\":[30, 31, 32, 33, 50]},\"port\":$APP_PORT,\"protocol\":\"http\",\"system_app\":1}" \
432+
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[\"SYSTEM\", \"FILES\", \"FILES_SHARING\"],\"optional\":[\"USER_INFO\", \"USER_STATUS\", \"NOTIFICATIONS\", \"WEATHER_STATUS\", \"TALK\"]},\"port\":$APP_PORT,\"protocol\":\"http\",\"system_app\":1}" \
433433
-e --force-scopes
434434
kill -15 $(cat /tmp/_install.pid)
435435
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
@@ -549,7 +549,7 @@ jobs:
549549
cd ..
550550
php occ app_ecosystem_v2:daemon:register manual_install "Manual Install" manual-install 0 0 0
551551
php occ app_ecosystem_v2:app:register $APP_ID manual_install --json-info \
552-
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[2, 10, 11],\"optional\":[30, 31, 32, 33, 50]},\"port\":$APP_PORT,\"protocol\":\"http\",\"system_app\":1}" \
552+
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[\"SYSTEM\", \"FILES\", \"FILES_SHARING\"],\"optional\":[\"USER_INFO\", \"USER_STATUS\", \"NOTIFICATIONS\", \"WEATHER_STATUS\", \"TALK\"]},\"port\":$APP_PORT,\"protocol\":\"http\",\"system_app\":1}" \
553553
-e --force-scopes
554554
kill -15 $(cat /tmp/_install.pid)
555555
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
@@ -795,7 +795,7 @@ jobs:
795795
cd ..
796796
php occ app_ecosystem_v2:daemon:register manual_install "Manual Install" manual-install 0 0 0
797797
php occ app_ecosystem_v2:app:register $APP_ID manual_install --json-info \
798-
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[2, 10, 11],\"optional\":[30, 31, 32, 33, 50]},\"protocol\":\"http\",\"port\":$APP_PORT,\"system_app\":1}" \
798+
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"scopes\":{\"required\":[\"SYSTEM\", \"FILES\", \"FILES_SHARING\"],\"optional\":[\"USER_INFO\", \"USER_STATUS\", \"NOTIFICATIONS\", \"WEATHER_STATUS\", \"TALK\"]},\"protocol\":\"http\",\"port\":$APP_PORT,\"system_app\":1}" \
799799
-e --force-scopes
800800
kill -15 $(cat /tmp/_install.pid)
801801
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nc_py_api[app]>=0.0.31
1+
nc_py_api[app]>=0.0.40

examples/as_app/to_gif/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ run27:
4545
manual_register:
4646
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:unregister to_gif --silent || true
4747
docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:register to_gif manual_install --json-info \
48-
"{\"appid\":\"to_gif\",\"name\":\"to_gif\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"port\":9031,\"scopes\":{\"required\":[10],\"optional\":[32]},\"protocol\":\"http\",\"system_app\":0}" \
48+
"{\"appid\":\"to_gif\",\"name\":\"to_gif\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"port\":9031,\"scopes\":{\"required\":[\"FILES\"],\"optional\":[\"NOTIFICATIONS\"]},\"protocol\":\"http\",\"system_app\":0}" \
4949
-e --force-scopes

examples/as_app/to_gif/appinfo/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
</docker-install>
2727
<scopes>
2828
<required>
29-
<value>10</value>
29+
<value>FILES</value>
3030
</required>
3131
<optional>
32-
<value>32</value>
32+
<value>NOTIFICATIONS</value>
3333
</optional>
3434
</scopes>
3535
<protocol>http</protocol>

examples/as_app/to_gif/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
nc_py_api[app]>=0.0.31
1+
nc_py_api[app]>=0.0.40
22
pygifsicle
33
imageio
44
opencv-python

examples/as_app/to_gif/src/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ def convert_video_to_gif(input_file: FsNode, nc: NextcloudApp):
5959
nc.log(LogLvl.WARNING, "GIF is ready")
6060
nc.files.upload_stream(save_path, tmp_out)
6161
nc.log(LogLvl.WARNING, "Result uploaded")
62-
nc.users.notifications.create(f"{input_file.name} finished!", f"{save_path} is waiting for you!")
62+
nc.notifications.create(f"{input_file.name} finished!", f"{save_path} is waiting for you!")
6363
except Exception as e:
6464
nc.log(LogLvl.ERROR, str(e))
65-
nc.users.notifications.create("Error occurred", "Error information was written to log file")
65+
nc.notifications.create("Error occurred", "Error information was written to log file")
6666

6767

6868
@APP.post("/video_to_gif")

scripts/dev_register.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ NEXTCLOUD_URL="http://$2" APP_PORT=9009 APP_ID="nc_py_api" APP_SECRET="12345" AP
1313
echo $! > /tmp/_install.pid
1414
python3 tests/_install_wait.py "http://localhost:9009/heartbeat" "\"status\":\"ok\"" 15 0.5
1515
docker exec "$1" sudo -u www-data php occ app_ecosystem_v2:app:register nc_py_api manual_install --json-info \
16-
"{\"appid\":\"nc_py_api\",\"name\":\"nc_py_api\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"scopes\":{\"required\":[2, 10, 11],\"optional\":[30, 31, 32, 33, 50]},\"port\":9009,\"protocol\":\"http\",\"system_app\":1}" \
16+
"{\"appid\":\"nc_py_api\",\"name\":\"nc_py_api\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"scopes\":{\"required\":[\"SYSTEM\", \"FILES\", \"FILES_SHARING\"],\"optional\":[\"USER_INFO\", \"USER_STATUS\", \"NOTIFICATIONS\", \"WEATHER_STATUS\", \"TALK\"]},\"port\":9009,\"protocol\":\"http\",\"system_app\":1}" \
1717
-e --force-scopes
1818
cat /tmp/_install.pid
1919
kill -15 "$(cat /tmp/_install.pid)"

tests/talk_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_get_conversations_modified_since(nc):
6969
try:
7070
conversations = nc.talk.get_user_conversations()
7171
assert conversations
72-
nc.talk.modified_since += 1 # read notes for ``modified_since`` param in docs.
72+
nc.talk.modified_since += 2 # read notes for ``modified_since`` param in docs.
7373
conversations = nc.talk.get_user_conversations(modified_since=True)
7474
assert not conversations
7575
conversations = nc.talk.get_user_conversations(modified_since=9992708529, no_status_update=False)

0 commit comments

Comments
 (0)