nc-py-api 0.12.0__py3-none-any.whl → 0.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nc_py_api/__init__.py +1 -1
- nc_py_api/_session.py +17 -3
- nc_py_api/_version.py +1 -1
- nc_py_api/ex_app/__init__.py +1 -1
- nc_py_api/ex_app/events_listener.py +137 -0
- nc_py_api/ex_app/occ_commands.py +153 -0
- nc_py_api/ex_app/providers/providers.py +7 -0
- nc_py_api/ex_app/providers/task_processing.py +189 -0
- nc_py_api/ex_app/ui/files_actions.py +45 -1
- nc_py_api/files/__init__.py +9 -1
- nc_py_api/files/_files.py +12 -0
- nc_py_api/files/files.py +14 -482
- nc_py_api/files/files_async.py +523 -0
- nc_py_api/loginflow_v2.py +161 -0
- nc_py_api/nextcloud.py +42 -5
- nc_py_api/users.py +1 -1
- {nc_py_api-0.12.0.dist-info → nc_py_api-0.14.0.dist-info}/METADATA +16 -4
- {nc_py_api-0.12.0.dist-info → nc_py_api-0.14.0.dist-info}/RECORD +21 -16
- {nc_py_api-0.12.0.dist-info → nc_py_api-0.14.0.dist-info}/WHEEL +1 -1
- {nc_py_api-0.12.0.dist-info → nc_py_api-0.14.0.dist-info}/licenses/AUTHORS +0 -0
- {nc_py_api-0.12.0.dist-info → nc_py_api-0.14.0.dist-info}/licenses/LICENSE.txt +0 -0
nc_py_api/nextcloud.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Nextcloud class providing access to all API endpoints."""
|
|
2
2
|
|
|
3
|
+
import contextlib
|
|
3
4
|
import typing
|
|
4
5
|
from abc import ABC
|
|
5
6
|
|
|
@@ -30,9 +31,13 @@ from .activity import _ActivityAPI, _AsyncActivityAPI
|
|
|
30
31
|
from .apps import _AppsAPI, _AsyncAppsAPI
|
|
31
32
|
from .calendar import _CalendarAPI
|
|
32
33
|
from .ex_app.defs import LogLvl
|
|
34
|
+
from .ex_app.events_listener import AsyncEventsListenerAPI, EventsListenerAPI
|
|
35
|
+
from .ex_app.occ_commands import AsyncOccCommandsAPI, OccCommandsAPI
|
|
33
36
|
from .ex_app.providers.providers import AsyncProvidersApi, ProvidersApi
|
|
34
37
|
from .ex_app.ui.ui import AsyncUiApi, UiApi
|
|
35
|
-
from .files.files import
|
|
38
|
+
from .files.files import FilesAPI
|
|
39
|
+
from .files.files_async import AsyncFilesAPI
|
|
40
|
+
from .loginflow_v2 import _AsyncLoginFlowV2API, _LoginFlowV2API
|
|
36
41
|
from .notes import _AsyncNotesAPI, _NotesAPI
|
|
37
42
|
from .notifications import _AsyncNotificationsAPI, _NotificationsAPI
|
|
38
43
|
from .user_status import _AsyncUserStatusAPI, _UserStatusAPI
|
|
@@ -244,15 +249,18 @@ class Nextcloud(_NextcloudBasic):
|
|
|
244
249
|
"""
|
|
245
250
|
|
|
246
251
|
_session: NcSession
|
|
252
|
+
loginflow_v2: _LoginFlowV2API
|
|
253
|
+
"""Nextcloud Login flow v2."""
|
|
247
254
|
|
|
248
255
|
def __init__(self, **kwargs):
|
|
249
256
|
"""If the parameters are not specified, they will be taken from the environment.
|
|
250
257
|
|
|
251
258
|
:param nextcloud_url: url of the nextcloud instance.
|
|
252
|
-
:param nc_auth_user: login username.
|
|
253
|
-
:param nc_auth_pass: password or app-password for the username.
|
|
259
|
+
:param nc_auth_user: login username. Optional.
|
|
260
|
+
:param nc_auth_pass: password or app-password for the username. Optional.
|
|
254
261
|
"""
|
|
255
262
|
self._session = NcSession(**kwargs)
|
|
263
|
+
self.loginflow_v2 = _LoginFlowV2API(self._session)
|
|
256
264
|
super().__init__(self._session)
|
|
257
265
|
|
|
258
266
|
@property
|
|
@@ -268,15 +276,18 @@ class AsyncNextcloud(_AsyncNextcloudBasic):
|
|
|
268
276
|
"""
|
|
269
277
|
|
|
270
278
|
_session: AsyncNcSession
|
|
279
|
+
loginflow_v2: _AsyncLoginFlowV2API
|
|
280
|
+
"""Nextcloud Login flow v2."""
|
|
271
281
|
|
|
272
282
|
def __init__(self, **kwargs):
|
|
273
283
|
"""If the parameters are not specified, they will be taken from the environment.
|
|
274
284
|
|
|
275
285
|
:param nextcloud_url: url of the nextcloud instance.
|
|
276
|
-
:param nc_auth_user: login username.
|
|
277
|
-
:param nc_auth_pass: password or app-password for the username.
|
|
286
|
+
:param nc_auth_user: login username. Optional.
|
|
287
|
+
:param nc_auth_pass: password or app-password for the username. Optional.
|
|
278
288
|
"""
|
|
279
289
|
self._session = AsyncNcSession(**kwargs)
|
|
290
|
+
self.loginflow_v2 = _AsyncLoginFlowV2API(self._session)
|
|
280
291
|
super().__init__(self._session)
|
|
281
292
|
|
|
282
293
|
@property
|
|
@@ -304,6 +315,10 @@ class NextcloudApp(_NextcloudBasic):
|
|
|
304
315
|
"""Nextcloud UI API for ExApps"""
|
|
305
316
|
providers: ProvidersApi
|
|
306
317
|
"""API for registering providers for Nextcloud"""
|
|
318
|
+
events_listener: EventsListenerAPI
|
|
319
|
+
"""API for registering Events listeners for ExApps"""
|
|
320
|
+
occ_commands: OccCommandsAPI
|
|
321
|
+
"""API for registering OCC command for ExApps"""
|
|
307
322
|
|
|
308
323
|
def __init__(self, **kwargs):
|
|
309
324
|
"""The parameters will be taken from the environment.
|
|
@@ -316,6 +331,15 @@ class NextcloudApp(_NextcloudBasic):
|
|
|
316
331
|
self.preferences_ex = PreferencesExAPI(self._session)
|
|
317
332
|
self.ui = UiApi(self._session)
|
|
318
333
|
self.providers = ProvidersApi(self._session)
|
|
334
|
+
self.events_listener = EventsListenerAPI(self._session)
|
|
335
|
+
self.occ_commands = OccCommandsAPI(self._session)
|
|
336
|
+
|
|
337
|
+
@property
|
|
338
|
+
def enabled_state(self) -> bool:
|
|
339
|
+
"""Returns ``True`` if ExApp is enabled, ``False`` otherwise."""
|
|
340
|
+
with contextlib.suppress(Exception):
|
|
341
|
+
return bool(self._session.ocs("GET", "/ocs/v1.php/apps/app_api/ex-app/state"))
|
|
342
|
+
return False
|
|
319
343
|
|
|
320
344
|
def log(self, log_lvl: LogLvl, content: str) -> None:
|
|
321
345
|
"""Writes log to the Nextcloud log file."""
|
|
@@ -421,6 +445,10 @@ class AsyncNextcloudApp(_AsyncNextcloudBasic):
|
|
|
421
445
|
"""Nextcloud UI API for ExApps"""
|
|
422
446
|
providers: AsyncProvidersApi
|
|
423
447
|
"""API for registering providers for Nextcloud"""
|
|
448
|
+
events_listener: AsyncEventsListenerAPI
|
|
449
|
+
"""API for registering Events listeners for ExApps"""
|
|
450
|
+
occ_commands: AsyncOccCommandsAPI
|
|
451
|
+
"""API for registering OCC command for ExApps"""
|
|
424
452
|
|
|
425
453
|
def __init__(self, **kwargs):
|
|
426
454
|
"""The parameters will be taken from the environment.
|
|
@@ -433,6 +461,15 @@ class AsyncNextcloudApp(_AsyncNextcloudBasic):
|
|
|
433
461
|
self.preferences_ex = AsyncPreferencesExAPI(self._session)
|
|
434
462
|
self.ui = AsyncUiApi(self._session)
|
|
435
463
|
self.providers = AsyncProvidersApi(self._session)
|
|
464
|
+
self.events_listener = AsyncEventsListenerAPI(self._session)
|
|
465
|
+
self.occ_commands = AsyncOccCommandsAPI(self._session)
|
|
466
|
+
|
|
467
|
+
@property
|
|
468
|
+
async def enabled_state(self) -> bool:
|
|
469
|
+
"""Returns ``True`` if ExApp is enabled, ``False`` otherwise."""
|
|
470
|
+
with contextlib.suppress(Exception):
|
|
471
|
+
return bool(await self._session.ocs("GET", "/ocs/v1.php/apps/app_api/ex-app/state"))
|
|
472
|
+
return False
|
|
436
473
|
|
|
437
474
|
async def log(self, log_lvl: LogLvl, content: str) -> None:
|
|
438
475
|
"""Writes log to the Nextcloud log file."""
|
nc_py_api/users.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: nc-py-api
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: Nextcloud Python Framework
|
|
5
5
|
Project-URL: Changelog, https://github.com/cloud-py-api/nc_py_api/blob/main/CHANGELOG.md
|
|
6
6
|
Project-URL: Documentation, https://cloud-py-api.github.io/nc_py_api/
|
|
@@ -38,13 +38,24 @@ Provides-Extra: app
|
|
|
38
38
|
Requires-Dist: uvicorn[standard]>=0.23.2; extra == 'app'
|
|
39
39
|
Provides-Extra: bench
|
|
40
40
|
Requires-Dist: matplotlib; extra == 'bench'
|
|
41
|
-
Requires-Dist: nc-py-api[app]; extra == 'bench'
|
|
42
41
|
Requires-Dist: numpy; extra == 'bench'
|
|
43
42
|
Requires-Dist: py-cpuinfo; extra == 'bench'
|
|
43
|
+
Requires-Dist: uvicorn[standard]>=0.23.2; extra == 'bench'
|
|
44
44
|
Provides-Extra: calendar
|
|
45
45
|
Requires-Dist: caldav==1.3.6; extra == 'calendar'
|
|
46
46
|
Provides-Extra: dev
|
|
47
|
-
Requires-Dist:
|
|
47
|
+
Requires-Dist: caldav==1.3.6; extra == 'dev'
|
|
48
|
+
Requires-Dist: coverage; extra == 'dev'
|
|
49
|
+
Requires-Dist: huggingface-hub; extra == 'dev'
|
|
50
|
+
Requires-Dist: matplotlib; extra == 'dev'
|
|
51
|
+
Requires-Dist: numpy; extra == 'dev'
|
|
52
|
+
Requires-Dist: pillow; extra == 'dev'
|
|
53
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
54
|
+
Requires-Dist: py-cpuinfo; extra == 'dev'
|
|
55
|
+
Requires-Dist: pylint; extra == 'dev'
|
|
56
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
57
|
+
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
58
|
+
Requires-Dist: uvicorn[standard]>=0.23.2; extra == 'dev'
|
|
48
59
|
Provides-Extra: dev-min
|
|
49
60
|
Requires-Dist: coverage; extra == 'dev-min'
|
|
50
61
|
Requires-Dist: huggingface-hub; extra == 'dev-min'
|
|
@@ -55,12 +66,13 @@ Requires-Dist: pytest; extra == 'dev-min'
|
|
|
55
66
|
Requires-Dist: pytest-asyncio; extra == 'dev-min'
|
|
56
67
|
Provides-Extra: docs
|
|
57
68
|
Requires-Dist: autodoc-pydantic>=2.0.1; extra == 'docs'
|
|
58
|
-
Requires-Dist:
|
|
69
|
+
Requires-Dist: caldav==1.3.6; extra == 'docs'
|
|
59
70
|
Requires-Dist: sphinx-copybutton; extra == 'docs'
|
|
60
71
|
Requires-Dist: sphinx-inline-tabs; extra == 'docs'
|
|
61
72
|
Requires-Dist: sphinx-issues>=3.0.1; extra == 'docs'
|
|
62
73
|
Requires-Dist: sphinx-rtd-theme>=1; extra == 'docs'
|
|
63
74
|
Requires-Dist: sphinx>=6.2; extra == 'docs'
|
|
75
|
+
Requires-Dist: uvicorn[standard]>=0.23.2; extra == 'docs'
|
|
64
76
|
Description-Content-Type: text/markdown
|
|
65
77
|
|
|
66
78
|
<p align="center">
|
|
@@ -1,49 +1,54 @@
|
|
|
1
|
-
nc_py_api/__init__.py,sha256=
|
|
1
|
+
nc_py_api/__init__.py,sha256=FOju0DYizwYYzWBgID8Ebx0GeId-faNqd4Z_3K0216o,439
|
|
2
2
|
nc_py_api/_deffered_error.py,sha256=BpEe_tBqflwfj2Zolb67nhW-K16XX-WbcY2IH_6u8fo,319
|
|
3
3
|
nc_py_api/_exceptions.py,sha256=7vbUECaLmD7RJBCU27t4fuP6NmQK6r4508u_gS4szhI,2298
|
|
4
4
|
nc_py_api/_misc.py,sha256=dUzCP9VmyhtICTsn1aexlFAYUioBm40k6Zh-YE5WwCY,3333
|
|
5
5
|
nc_py_api/_preferences.py,sha256=OtovFZuGHnHYKjdDjSnUappO795tW8Oxj7qVaejHWpQ,2479
|
|
6
6
|
nc_py_api/_preferences_ex.py,sha256=tThj6U0ZZMaBZ-jUkjrbaI0xDnafWsBowQKsC6gjOQs,7179
|
|
7
|
-
nc_py_api/_session.py,sha256=
|
|
7
|
+
nc_py_api/_session.py,sha256=ppHbBY3KIPzEzJ9PkHhSuqtu2H2Dx3on9br9c_ilffU,20056
|
|
8
8
|
nc_py_api/_talk_api.py,sha256=0Uo7OduYniuuX3UQPb468RyGJJ-PWBCgJ5HoPuz5Qa0,51068
|
|
9
9
|
nc_py_api/_theming.py,sha256=hTr3nuOemSuRFZaPy9iXNmBM7rDgQHECH43tHMWGqEY,1870
|
|
10
|
-
nc_py_api/_version.py,sha256=
|
|
10
|
+
nc_py_api/_version.py,sha256=WZ-LD23L_ofWcumkGMxJp_6g038O74k-XBh2oT_5dRY,52
|
|
11
11
|
nc_py_api/activity.py,sha256=t9VDSnnaXRNOvALqOSGCeXSQZ-426pCOMSfQ96JHys4,9574
|
|
12
12
|
nc_py_api/apps.py,sha256=6vOFFs6vNHCCvZ_SwXxPq5-X1xfgyLjW8uZSfJKduC8,9774
|
|
13
13
|
nc_py_api/calendar.py,sha256=-T6CJ8cRbJZTLtxSEDWuuYpD29DMJGCTfLONmtxZV9w,1445
|
|
14
|
-
nc_py_api/
|
|
14
|
+
nc_py_api/loginflow_v2.py,sha256=UjkK3gMouzNrIS7BFhjbmB_9m4fP2UY5sfpmvJ2EXWk,5760
|
|
15
|
+
nc_py_api/nextcloud.py,sha256=tk3jJ_9ku0UFzvCr3u3rbBpgxyKXt4ayN9k_miuo2RY,22291
|
|
15
16
|
nc_py_api/notes.py,sha256=ljO3TOe-Qg0bJ0mlFQwjg--Pxmj-XFknoLbcbJmII0A,15106
|
|
16
17
|
nc_py_api/notifications.py,sha256=WgzV21TuLOhLk-UEjhBSbMsIi2isa5MmAx6cbe0pc2Y,9187
|
|
17
18
|
nc_py_api/options.py,sha256=K5co-fIfFVbwF6r3sqWsJF3cKgAbS2CjLAXdyTOkP9s,1717
|
|
18
19
|
nc_py_api/talk.py,sha256=OZFemYkDOaM6o4xAK3EvQbjMFiK75E5qnsCDyihIElg,29368
|
|
19
20
|
nc_py_api/talk_bot.py,sha256=73V2UXQChqiEzC8JxhWgtKWVQ2YD9lxLRjQ5JJWQRRw,16562
|
|
20
21
|
nc_py_api/user_status.py,sha256=I101nwYS8X1WvC8AnLa2f3qJUCPDPHrbq-ke0h1VT4E,13282
|
|
21
|
-
nc_py_api/users.py,sha256=
|
|
22
|
+
nc_py_api/users.py,sha256=ixMHBFJtrlvqmZqJ73VdbOZ6CbRnppdsRpjIJnMUtYY,15488
|
|
22
23
|
nc_py_api/users_groups.py,sha256=IPxw-Ks5NjCm6r8_HC9xmf3IYptH00ulITbp5iazhAo,6289
|
|
23
24
|
nc_py_api/weather_status.py,sha256=wAkjuJPjxc0Rxe4za0BzfwB0XeUmkCXoisJtTH3-qdQ,7582
|
|
24
|
-
nc_py_api/ex_app/__init__.py,sha256=
|
|
25
|
+
nc_py_api/ex_app/__init__.py,sha256=YqzRDfFGe-2BMnkIpPI1ws80uF20FiuvoDaN_KL4xZw,647
|
|
25
26
|
nc_py_api/ex_app/defs.py,sha256=FaQInH3jLugKxDUqpwrXdkMT-lBxmoqWmXJXc11fa6A,727
|
|
27
|
+
nc_py_api/ex_app/events_listener.py,sha256=pgQ4hSQV39NuP9F9IDWxo0Qle6oG15-Ol2FlItnIBGY,4682
|
|
26
28
|
nc_py_api/ex_app/integration_fastapi.py,sha256=2yt24zlfmNcbs-RCueyWhpWHmiD6vKVgXsobJ1iSY7I,10817
|
|
27
29
|
nc_py_api/ex_app/misc.py,sha256=wA6KrcB05SQGwVAo7dgBxXAVm_2r9bgDf6SqioyOJPc,2286
|
|
30
|
+
nc_py_api/ex_app/occ_commands.py,sha256=hb2BJuvFKIigvLycSCyAe9v6hedq4Gfu2junQZTaK_M,5219
|
|
28
31
|
nc_py_api/ex_app/persist_transformers_cache.py,sha256=ZoEBb1RnNaQrtxK_CjSZ8LZ36Oakz2Xciau_ZpNp8Ic,213
|
|
29
32
|
nc_py_api/ex_app/uvicorn_fastapi.py,sha256=WLtNmWXMBKN6CMip2uhKcgy4mC2Ch9AmNfwRScBUsP0,752
|
|
30
33
|
nc_py_api/ex_app/providers/__init__.py,sha256=jmUBdbAgzUCdYyHl8V5UCNYJI-FFpxPQQ4iEAoURKQs,43
|
|
31
|
-
nc_py_api/ex_app/providers/providers.py,sha256=
|
|
34
|
+
nc_py_api/ex_app/providers/providers.py,sha256=_1zWAgg9ol2u82Huf-yxFfxviGwtEeLIxDWTTYY2jJQ,1955
|
|
32
35
|
nc_py_api/ex_app/providers/speech_to_text.py,sha256=JFD1ksdhXjpr5UFm5npqCxepqB5x-kdHG9CpPoGofx0,4959
|
|
36
|
+
nc_py_api/ex_app/providers/task_processing.py,sha256=ceNdpqYFFFQ7SoR5DNYW-_yqp6KJ4HZ4u4B2-THWgmQ,7277
|
|
33
37
|
nc_py_api/ex_app/providers/text_processing.py,sha256=VUZMZ2fof-c6JD7mTKHTZBWbDMOqxDllMCNQFOlHXXk,5265
|
|
34
38
|
nc_py_api/ex_app/providers/translations.py,sha256=io8UgVhdQXFmP7KnrJQx5Vtl8Dz0Z0EVZ0bt3hV7C7A,6112
|
|
35
39
|
nc_py_api/ex_app/ui/__init__.py,sha256=jUMU7_miFF-Q8BQNT90KZYQiLy_a3OvEyK6y8eRMKRk,38
|
|
36
|
-
nc_py_api/ex_app/ui/files_actions.py,sha256=
|
|
40
|
+
nc_py_api/ex_app/ui/files_actions.py,sha256=pKe0VSSy5Zl0NwPe8rwdL_NL374n-0_XBf6M5HmKoIU,7384
|
|
37
41
|
nc_py_api/ex_app/ui/resources.py,sha256=Vwx69oZ93Ouh6HJtGUqaKFUr4Reo74H4vT1YCpb-7j0,12492
|
|
38
42
|
nc_py_api/ex_app/ui/settings.py,sha256=f0R17lGhBfo2JQULVw_hFxhpfoPw_CW7vBu0Rb1ABJw,6623
|
|
39
43
|
nc_py_api/ex_app/ui/top_menu.py,sha256=oCgGtIoMYbp-5iN5aXEbT7Q88HtccR7hg6IBFgbbyX4,5118
|
|
40
44
|
nc_py_api/ex_app/ui/ui.py,sha256=OqFHKn6oIZli8T1wnv6YtQ4glNfeNb90WwGCvtWI1Z4,1632
|
|
41
|
-
nc_py_api/files/__init__.py,sha256=
|
|
42
|
-
nc_py_api/files/_files.py,sha256=
|
|
43
|
-
nc_py_api/files/files.py,sha256=
|
|
45
|
+
nc_py_api/files/__init__.py,sha256=bYLRT4bp-0qRPXGEACvP4DRrbsUknHy3Q712BT5H4eA,17039
|
|
46
|
+
nc_py_api/files/_files.py,sha256=_s_f8xbzQPEH2F2LNwomI9CxscYHryus1pMZ_vW00C4,13666
|
|
47
|
+
nc_py_api/files/files.py,sha256=Yj388MJp_EdM-2neM9EnALaLnSR6zMJbYxXzHpHmOmI,24577
|
|
48
|
+
nc_py_api/files/files_async.py,sha256=rEIT6P1Pb7TeTub1dAB5IKpR4LDqHWc5LclAEzpiHEQ,25410
|
|
44
49
|
nc_py_api/files/sharing.py,sha256=VRZCl-TYK6dbu9rUHPs3_jcVozu1EO8bLGZwoRpiLsU,14439
|
|
45
|
-
nc_py_api-0.
|
|
46
|
-
nc_py_api-0.
|
|
47
|
-
nc_py_api-0.
|
|
48
|
-
nc_py_api-0.
|
|
49
|
-
nc_py_api-0.
|
|
50
|
+
nc_py_api-0.14.0.dist-info/METADATA,sha256=9OzcMRuVp1XyuxTb3UqMZ0wpz2nIFaiaQxuX8Da9Sq8,9449
|
|
51
|
+
nc_py_api-0.14.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
52
|
+
nc_py_api-0.14.0.dist-info/licenses/AUTHORS,sha256=Y1omFHyI8ned9k4jJXs2ATgmgi1GmQ7EZ6S1gxqnX2k,572
|
|
53
|
+
nc_py_api-0.14.0.dist-info/licenses/LICENSE.txt,sha256=OLEMh401fAumGHfRSna365MLIfnjdTcdOHZ6QOzMjkg,1551
|
|
54
|
+
nc_py_api-0.14.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|