m365 0.1.0a2__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.
Potentially problematic release.
This version of m365 might be problematic. Click here for more details.
- m365/__init__.py +14 -0
- m365/graph/__init__.py +73 -0
- m365/graph/_core_dates.py +105 -0
- m365/graph/_drive_walk.py +116 -0
- m365/graph/_graph.py +474 -0
- m365/graph/_legacy_paths.py +103 -0
- m365/graph/_local_paths.py +90 -0
- m365/graph/_mail_common.py +173 -0
- m365/graph/_mail_graph.py +89 -0
- m365/graph/_misc.py +90 -0
- m365/graph/_site_resolution.py +216 -0
- m365/graph/auth_types.py +103 -0
- m365/graph/dateplumb/__init__.py +77 -0
- m365/graph/dateplumb/_advanced.py +245 -0
- m365/graph/dateplumb/base.py +914 -0
- m365/graph/dateplumb/proxy.py +124 -0
- m365/graph/mailbox.py +1579 -0
- m365/graph/operations/__init__.py +65 -0
- m365/graph/operations/doc_dispatch.py +118 -0
- m365/graph/operations/doc_management.py +172 -0
- m365/graph/operations/doc_sync.py +214 -0
- m365/graph/operations/doc_transfer.py +342 -0
- m365/graph/operations/mail_compose.py +208 -0
- m365/graph/operations/mail_dispatch.py +92 -0
- m365/graph/operations/mail_management.py +403 -0
- m365/graph/operations/mail_transfer.py +182 -0
- m365/graph/preprocessing/__init__.py +62 -0
- m365/graph/preprocessing/deduping.py +166 -0
- m365/graph/preprocessing/filters.py +379 -0
- m365/graph/preprocessing/lists.py +319 -0
- m365/graph/preprocessing/structures.py +186 -0
- m365/graph/preprocessing/transforms.py +194 -0
- m365/graph/sharepoint.py +884 -0
- m365/graph/syslib/__init__.py +101 -0
- m365/graph/syslib/_appdata.py +340 -0
- m365/graph/syslib/_loc.py +84 -0
- m365/graph/syslib/_paradigm.py +124 -0
- m365/graph/syslib/_unix.py +184 -0
- m365/graph/syslib/_utils.py +79 -0
- m365/graph/syslib/_windows.py +545 -0
- m365/graph/syslib/base.py +1840 -0
- m365/graph/syslib/ref_data/__init__.py +54 -0
- m365/graph/syslib/ref_data/extensions.txt +924 -0
- m365/graph/utils.py +69 -0
- m365-0.1.0a2.dist-info/METADATA +640 -0
- m365-0.1.0a2.dist-info/RECORD +54 -0
- m365-0.1.0a2.dist-info/WHEEL +5 -0
- m365-0.1.0a2.dist-info/licenses/LICENSE +21 -0
- m365-0.1.0a2.dist-info/licenses/assets/png/LOGO-LICENSE +21 -0
- m365-0.1.0a2.dist-info/licenses/assets/svg/LOGO-LICENSE +21 -0
- m365-0.1.0a2.dist-info/licenses/assets/third-party/ONEDRIVE-NOTICE.txt +15 -0
- m365-0.1.0a2.dist-info/licenses/assets/third-party/OUTLOOK-NOTICE.txt +15 -0
- m365-0.1.0a2.dist-info/licenses/assets/third-party/SHAREPOINT-NOTICE.txt +15 -0
- m365-0.1.0a2.dist-info/top_level.txt +1 -0
m365/__init__.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""Independent Microsoft Graph toolkit with a lazy Graph namespace."""
|
|
3
|
+
from importlib import import_module
|
|
4
|
+
|
|
5
|
+
__version__ = "0.1.0a2"
|
|
6
|
+
__all__ = ["graph"]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def __getattr__(name):
|
|
10
|
+
if name in __all__:
|
|
11
|
+
module = import_module("." + name, __name__)
|
|
12
|
+
globals()[name] = module
|
|
13
|
+
return module
|
|
14
|
+
raise AttributeError("module {!r} has no attribute {!r}".format(__name__, name))
|
m365/graph/__init__.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# DOYDL's Microsoft Graph Integration Toolkit — m365.graph
|
|
4
|
+
#
|
|
5
|
+
# The `m365.graph` module is a reusable Python toolkit for working with Microsoft
|
|
6
|
+
# Graph, providing interfaces for mailbox operations, SharePoint document
|
|
7
|
+
# management, and OneDrive file workflows.
|
|
8
|
+
#
|
|
9
|
+
# Designed for use across organizations, `m365.graph` separates application
|
|
10
|
+
# workflows from tenant-specific configuration, authentication, and permissions.
|
|
11
|
+
# It supports integrations without imposing a particular company's environment,
|
|
12
|
+
# folder structure, or operational processes.
|
|
13
|
+
#
|
|
14
|
+
# The toolkit supports tasks such as reading and composing email, managing
|
|
15
|
+
# attachments, searching and querying files, traversing folders, and transferring
|
|
16
|
+
# documents through Microsoft Graph.
|
|
17
|
+
#
|
|
18
|
+
# Shared utilities provide date handling, input validation, pagination, and
|
|
19
|
+
# URL/path processing. Advanced temporal methods can optionally use `dately`,
|
|
20
|
+
# while core Graph date handling remains independent of that dependency.
|
|
21
|
+
#
|
|
22
|
+
# Whether used in internal applications, administrative tools, or data pipelines,
|
|
23
|
+
# `m365.graph` provides building blocks for Microsoft 365 automation. Available
|
|
24
|
+
# operations remain subject to Microsoft Graph capabilities, tenant policies,
|
|
25
|
+
# and the permissions granted to the calling application.
|
|
26
|
+
#
|
|
27
|
+
# Microsoft, Microsoft Graph, Microsoft 365, Outlook, SharePoint, and OneDrive
|
|
28
|
+
# are trademarks of Microsoft Corporation. Associated third-party names and
|
|
29
|
+
# logos remain the property of their respective owners. This project is not
|
|
30
|
+
# an official Microsoft product and does not imply Microsoft affiliation,
|
|
31
|
+
# sponsorship, or endorsement. Third-party assets remain subject to their
|
|
32
|
+
# applicable terms and notices; the license below does not grant rights to
|
|
33
|
+
# Microsoft's trademarks or logos.
|
|
34
|
+
#
|
|
35
|
+
# Copyright (c) 2024 by DOYDL Technologies. All rights reserved.
|
|
36
|
+
#
|
|
37
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
38
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
39
|
+
# in the Software without restriction, including without limitation the rights
|
|
40
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
41
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
42
|
+
# furnished to do so, subject to the following conditions:
|
|
43
|
+
#
|
|
44
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
45
|
+
# copies or substantial portions of the Software.
|
|
46
|
+
#
|
|
47
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
48
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
49
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
50
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
51
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
52
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
53
|
+
# SOFTWARE.
|
|
54
|
+
#
|
|
55
|
+
import os
|
|
56
|
+
import sys
|
|
57
|
+
import logging
|
|
58
|
+
|
|
59
|
+
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
|
60
|
+
|
|
61
|
+
from .sharepoint import Site
|
|
62
|
+
from ._graph import GraphError
|
|
63
|
+
from . import syslib, dateplumb
|
|
64
|
+
|
|
65
|
+
__version__ = "3.3.1"
|
|
66
|
+
from .mailbox import Mailbox
|
|
67
|
+
|
|
68
|
+
def __dir__():
|
|
69
|
+
mod = sys.modules[__name__]
|
|
70
|
+
builtins = [name for name in mod.__dict__ if name.startswith('__') and name.endswith('__')]
|
|
71
|
+
if 'sharepoint' not in builtins:
|
|
72
|
+
builtins.append('sharepoint')
|
|
73
|
+
return sorted(builtins)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# DOYDL's Microsoft Graph Integration Toolkit — m365.graph
|
|
4
|
+
#
|
|
5
|
+
# The `m365.graph` module is a reusable Python toolkit for working with Microsoft
|
|
6
|
+
# Graph, providing interfaces for mailbox operations, SharePoint document
|
|
7
|
+
# management, and OneDrive file workflows.
|
|
8
|
+
#
|
|
9
|
+
# Designed for use across organizations, `m365.graph` separates application
|
|
10
|
+
# workflows from tenant-specific configuration, authentication, and permissions.
|
|
11
|
+
# It supports integrations without imposing a particular company's environment,
|
|
12
|
+
# folder structure, or operational processes.
|
|
13
|
+
#
|
|
14
|
+
# The toolkit supports tasks such as reading and composing email, managing
|
|
15
|
+
# attachments, searching and querying files, traversing folders, and transferring
|
|
16
|
+
# documents through Microsoft Graph.
|
|
17
|
+
#
|
|
18
|
+
# Shared utilities provide date handling, input validation, pagination, and
|
|
19
|
+
# URL/path processing. Advanced temporal methods can optionally use `dately`,
|
|
20
|
+
# while core Graph date handling remains independent of that dependency.
|
|
21
|
+
#
|
|
22
|
+
# Whether used in internal applications, administrative tools, or data pipelines,
|
|
23
|
+
# `m365.graph` provides building blocks for Microsoft 365 automation. Available
|
|
24
|
+
# operations remain subject to Microsoft Graph capabilities, tenant policies,
|
|
25
|
+
# and the permissions granted to the calling application.
|
|
26
|
+
#
|
|
27
|
+
# Microsoft, Microsoft Graph, Microsoft 365, Outlook, SharePoint, and OneDrive
|
|
28
|
+
# are trademarks of Microsoft Corporation. Associated third-party names and
|
|
29
|
+
# logos remain the property of their respective owners. This project is not
|
|
30
|
+
# an official Microsoft product and does not imply Microsoft affiliation,
|
|
31
|
+
# sponsorship, or endorsement. Third-party assets remain subject to their
|
|
32
|
+
# applicable terms and notices; the license below does not grant rights to
|
|
33
|
+
# Microsoft's trademarks or logos.
|
|
34
|
+
#
|
|
35
|
+
# Copyright (c) 2024 by DOYDL Technologies. All rights reserved.
|
|
36
|
+
#
|
|
37
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
38
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
39
|
+
# in the Software without restriction, including without limitation the rights
|
|
40
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
41
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
42
|
+
# furnished to do so, subject to the following conditions:
|
|
43
|
+
#
|
|
44
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
45
|
+
# copies or substantial portions of the Software.
|
|
46
|
+
#
|
|
47
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
48
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
49
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
50
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
51
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
52
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
53
|
+
# SOFTWARE.
|
|
54
|
+
#
|
|
55
|
+
"""Small standard-library ISO/Graph timestamp boundary. Never imports dately."""
|
|
56
|
+
import re
|
|
57
|
+
from datetime import date, datetime, timezone, timedelta
|
|
58
|
+
|
|
59
|
+
_ISO = re.compile(r"^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def offset_timezone(value):
|
|
63
|
+
if value.upper() == "Z":
|
|
64
|
+
return timezone.utc
|
|
65
|
+
digits = value[1:].replace(":", "")
|
|
66
|
+
hours, minutes = int(digits[:2]), int(digits[2:])
|
|
67
|
+
if hours > 23 or minutes > 59:
|
|
68
|
+
raise ValueError("Invalid UTC offset")
|
|
69
|
+
return timezone(timedelta(minutes=(60 * hours + minutes) * (-1 if value[0] == "-" else 1)))
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def try_iso(value):
|
|
73
|
+
if isinstance(value, datetime):
|
|
74
|
+
return value
|
|
75
|
+
if isinstance(value, date):
|
|
76
|
+
return datetime.combine(value, datetime.min.time())
|
|
77
|
+
if not isinstance(value, str):
|
|
78
|
+
return None
|
|
79
|
+
value = value.strip()
|
|
80
|
+
# Year and year-month shorthand must not be interpreted as compact MDY.
|
|
81
|
+
if re.fullmatch(r"\d{4}", value):
|
|
82
|
+
return datetime(int(value), 1, 1)
|
|
83
|
+
if re.fullmatch(r"\d{4}-\d{2}", value):
|
|
84
|
+
return datetime(int(value[:4]), int(value[5:]), 1)
|
|
85
|
+
if not _ISO.fullmatch(value):
|
|
86
|
+
return None
|
|
87
|
+
zone = re.search(r"(Z|[+-]\d{2}:?\d{2})$", value) if ":" in value else None
|
|
88
|
+
if zone:
|
|
89
|
+
offset_timezone(zone.group()) # fromisoformat otherwise normalizes bad minutes.
|
|
90
|
+
if len(zone.group()) == 5:
|
|
91
|
+
value = value[:zone.start()] + zone.group()[:3] + ":" + zone.group()[3:]
|
|
92
|
+
# Python 3.8 accepts fewer fraction forms than newer runtimes. Graph can
|
|
93
|
+
# send seven digits; datetime precision is explicitly microseconds.
|
|
94
|
+
value = re.sub(r"\.(\d+)", lambda m: "." + m.group(1)[:6].ljust(6, "0"), value)
|
|
95
|
+
return datetime.fromisoformat(value[:-1] + "+00:00" if value.endswith("Z") else value)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def parse_graph_datetime(value):
|
|
99
|
+
if isinstance(value, str) and not _ISO.fullmatch(value.strip()):
|
|
100
|
+
raise ValueError("Expected a complete ISO Graph date or timestamp")
|
|
101
|
+
parsed = try_iso(value)
|
|
102
|
+
if parsed is None:
|
|
103
|
+
raise ValueError("Expected an ISO Graph timestamp")
|
|
104
|
+
# Graph values are UTC when no offset is supplied; never use the host timezone.
|
|
105
|
+
return parsed.replace(tzinfo=timezone.utc) if parsed.tzinfo is None else parsed
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# DOYDL's Microsoft Graph Integration Toolkit — m365.graph
|
|
4
|
+
#
|
|
5
|
+
# The `m365.graph` module is a reusable Python toolkit for working with Microsoft
|
|
6
|
+
# Graph, providing interfaces for mailbox operations, SharePoint document
|
|
7
|
+
# management, and OneDrive file workflows.
|
|
8
|
+
#
|
|
9
|
+
# Designed for use across organizations, `m365.graph` separates application
|
|
10
|
+
# workflows from tenant-specific configuration, authentication, and permissions.
|
|
11
|
+
# It supports integrations without imposing a particular company's environment,
|
|
12
|
+
# folder structure, or operational processes.
|
|
13
|
+
#
|
|
14
|
+
# The toolkit supports tasks such as reading and composing email, managing
|
|
15
|
+
# attachments, searching and querying files, traversing folders, and transferring
|
|
16
|
+
# documents through Microsoft Graph.
|
|
17
|
+
#
|
|
18
|
+
# Shared utilities provide date handling, input validation, pagination, and
|
|
19
|
+
# URL/path processing. Advanced temporal methods can optionally use `dately`,
|
|
20
|
+
# while core Graph date handling remains independent of that dependency.
|
|
21
|
+
#
|
|
22
|
+
# Whether used in internal applications, administrative tools, or data pipelines,
|
|
23
|
+
# `m365.graph` provides building blocks for Microsoft 365 automation. Available
|
|
24
|
+
# operations remain subject to Microsoft Graph capabilities, tenant policies,
|
|
25
|
+
# and the permissions granted to the calling application.
|
|
26
|
+
#
|
|
27
|
+
# Microsoft, Microsoft Graph, Microsoft 365, Outlook, SharePoint, and OneDrive
|
|
28
|
+
# are trademarks of Microsoft Corporation. Associated third-party names and
|
|
29
|
+
# logos remain the property of their respective owners. This project is not
|
|
30
|
+
# an official Microsoft product and does not imply Microsoft affiliation,
|
|
31
|
+
# sponsorship, or endorsement. Third-party assets remain subject to their
|
|
32
|
+
# applicable terms and notices; the license below does not grant rights to
|
|
33
|
+
# Microsoft's trademarks or logos.
|
|
34
|
+
#
|
|
35
|
+
# Copyright (c) 2024 by DOYDL Technologies. All rights reserved.
|
|
36
|
+
#
|
|
37
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
38
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
39
|
+
# in the Software without restriction, including without limitation the rights
|
|
40
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
41
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
42
|
+
# furnished to do so, subject to the following conditions:
|
|
43
|
+
#
|
|
44
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
45
|
+
# copies or substantial portions of the Software.
|
|
46
|
+
#
|
|
47
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
48
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
49
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
50
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
51
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
52
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
53
|
+
# SOFTWARE.
|
|
54
|
+
#
|
|
55
|
+
"""Bounded, selected-drive traversal shared by name and document-GUID lookup."""
|
|
56
|
+
from collections import deque
|
|
57
|
+
from ._graph import (
|
|
58
|
+
DriveChildrenScope, GraphError, collection_next_link, drive_item_kind, drive_item_name,
|
|
59
|
+
read_response,
|
|
60
|
+
)
|
|
61
|
+
from ._site_resolution import graph_id
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def walk_drive(client, *, root=None, document_ids=False):
|
|
65
|
+
"""Yield (item, relative_path); paths are known when starting at library root.
|
|
66
|
+
|
|
67
|
+
Limits cover the whole traversal. Shortcuts are never followed; no partial
|
|
68
|
+
traversal should be used to establish a unique organization-independent match.
|
|
69
|
+
"""
|
|
70
|
+
prefix = "drives/" + graph_id(client.drive_id)
|
|
71
|
+
endpoint = prefix + ("/items/" + graph_id(root) if root else "/root")
|
|
72
|
+
queue = deque([(endpoint, 0, None if root else "")])
|
|
73
|
+
seen_pages, seen_items = set(), set()
|
|
74
|
+
requests = items = 0
|
|
75
|
+
while queue:
|
|
76
|
+
parent, depth, parent_path = queue.popleft()
|
|
77
|
+
url = parent + "/children?$top=200"
|
|
78
|
+
if document_ids:
|
|
79
|
+
url += "&$select=id,name,file,folder,parentReference,sharepointIds"
|
|
80
|
+
scope = DriveChildrenScope(client.api._url(url), prefix="search")
|
|
81
|
+
while url:
|
|
82
|
+
if requests >= getattr(client, "search_max_requests", 200):
|
|
83
|
+
raise GraphError(code="search_request_limit")
|
|
84
|
+
absolute = client.api._url(url)
|
|
85
|
+
scope.check_page_url(absolute)
|
|
86
|
+
if absolute in seen_pages:
|
|
87
|
+
raise GraphError(code="search_pagination_cycle")
|
|
88
|
+
seen_pages.add(absolute)
|
|
89
|
+
page = read_response(client.api.graph_call, resource_url=url)
|
|
90
|
+
requests += 1
|
|
91
|
+
if not isinstance(page, dict) or "error" in page or not isinstance(page.get("value"), list):
|
|
92
|
+
raise GraphError(code="invalid_search_page")
|
|
93
|
+
next_link = collection_next_link(page, "invalid_search_continuation")
|
|
94
|
+
if next_link is not None:
|
|
95
|
+
scope.check_page_url(client.api._url(next_link))
|
|
96
|
+
for item in page["value"]:
|
|
97
|
+
items += 1
|
|
98
|
+
if items > getattr(client, "search_max_items", 5000):
|
|
99
|
+
raise GraphError(code="search_item_limit")
|
|
100
|
+
if not isinstance(item, dict) or not isinstance(item.get("id"), str) or not item["id"]:
|
|
101
|
+
raise GraphError(code="invalid_search_item")
|
|
102
|
+
if "remoteItem" in item:
|
|
103
|
+
continue
|
|
104
|
+
scope.check_item(item, "invalid_search_item")
|
|
105
|
+
if item["id"] in seen_items:
|
|
106
|
+
raise GraphError(code="search_duplicate_item")
|
|
107
|
+
seen_items.add(item["id"])
|
|
108
|
+
name = drive_item_name(item, "invalid_search_item")
|
|
109
|
+
kind = drive_item_kind(item, "invalid_search_item")
|
|
110
|
+
path = None if parent_path is None else (parent_path + "/" if parent_path else "") + name
|
|
111
|
+
yield item, path
|
|
112
|
+
if kind == "folder":
|
|
113
|
+
if depth >= getattr(client, "search_max_depth", 30):
|
|
114
|
+
raise GraphError(code="search_depth_limit")
|
|
115
|
+
queue.append((prefix + "/items/" + graph_id(item["id"]), depth + 1, path))
|
|
116
|
+
url = next_link
|