justoneapi 2.0.1__tar.gz → 2.0.2__tar.gz
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.
- {justoneapi-2.0.1 → justoneapi-2.0.2}/PKG-INFO +1 -1
- justoneapi-2.0.2/justoneapi/_version.py +1 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/amazon.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/beike.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/bilibili.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/douban.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/douyin.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/douyin_xingtu.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/facebook.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/imdb.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/instagram.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/jd.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/kuaishou.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/reddit.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/search.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/taobao.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/tiktok.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/tiktok_shop.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/toutiao.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/twitter.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/weibo.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/weixin.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/xiaohongshu.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/xiaohongshu_pgy.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/youku.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/youtube.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/zhihu.py +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi.egg-info/PKG-INFO +1 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/tests/test_codegen.py +24 -2
- {justoneapi-2.0.1 → justoneapi-2.0.2}/tests/test_generated_surface.py +19 -5
- justoneapi-2.0.1/justoneapi/_version.py +0 -1
- {justoneapi-2.0.1 → justoneapi-2.0.2}/LICENSE +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/README.md +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/__init__.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/_exceptions.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/_resource.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/_response.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/_transport.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/client.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/config.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/__init__.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/models.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/generated/resources/__init__.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi/log.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi.egg-info/SOURCES.txt +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi.egg-info/dependency_links.txt +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi.egg-info/requires.txt +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/justoneapi.egg-info/top_level.txt +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/pyproject.toml +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/setup.cfg +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/tests/test_integration_smoke.py +0 -0
- {justoneapi-2.0.1 → justoneapi-2.0.2}/tests/test_runtime.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.2"
|
|
@@ -14,6 +14,24 @@ RAW_SPEC_PATH = Path("openapi/public-api.json")
|
|
|
14
14
|
OVERRIDES_PATH = Path("openapi/sdk_overrides.yaml")
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
def count_operations(spec: dict) -> int:
|
|
18
|
+
return sum(
|
|
19
|
+
1
|
|
20
|
+
for path_item in spec.get("paths", {}).values()
|
|
21
|
+
for method in path_item
|
|
22
|
+
if not method.startswith("x-")
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def collect_resource_namespaces(spec: dict) -> set[str]:
|
|
27
|
+
return {
|
|
28
|
+
operation["x-sdk-resource"]
|
|
29
|
+
for path_item in spec.get("paths", {}).values()
|
|
30
|
+
for method, operation in path_item.items()
|
|
31
|
+
if not method.startswith("x-")
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
17
35
|
def test_normalize_spec_removes_token_and_adds_security_scheme():
|
|
18
36
|
normalized = normalize_spec(
|
|
19
37
|
load_json(RAW_SPEC_PATH), load_overrides(OVERRIDES_PATH)
|
|
@@ -33,10 +51,14 @@ def test_collect_resources_matches_expected_counts():
|
|
|
33
51
|
load_json(RAW_SPEC_PATH), load_overrides(OVERRIDES_PATH)
|
|
34
52
|
)
|
|
35
53
|
resources = collect_resources(normalized)
|
|
54
|
+
expected_namespaces = collect_resource_namespaces(normalized)
|
|
36
55
|
|
|
37
|
-
assert len(resources) == 25
|
|
38
|
-
assert sum(len(resource.operations) for resource in resources) == 201
|
|
39
56
|
namespace_set = {resource.namespace for resource in resources}
|
|
57
|
+
assert len(resources) == len(expected_namespaces)
|
|
58
|
+
assert sum(len(resource.operations) for resource in resources) == count_operations(
|
|
59
|
+
normalized
|
|
60
|
+
)
|
|
61
|
+
assert namespace_set == expected_namespaces
|
|
40
62
|
assert {"douyin", "douyin_xingtu", "tiktok_shop", "xiaohongshu_pgy"}.issubset(
|
|
41
63
|
namespace_set
|
|
42
64
|
)
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
3
5
|
from justoneapi import JustOneAPIClient
|
|
4
6
|
from justoneapi.generated.models import Result
|
|
5
7
|
from justoneapi.generated.resources import RESOURCE_CLASSES
|
|
8
|
+
from tools.sdk_codegen import load_json
|
|
9
|
+
|
|
10
|
+
NORMALIZED_SPEC_PATH = Path("openapi/public-api.normalized.json")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def expected_resource_namespaces() -> set[str]:
|
|
14
|
+
spec = load_json(NORMALIZED_SPEC_PATH)
|
|
15
|
+
return {
|
|
16
|
+
operation["x-sdk-resource"]
|
|
17
|
+
for path_item in spec.get("paths", {}).values()
|
|
18
|
+
for method, operation in path_item.items()
|
|
19
|
+
if not method.startswith("x-")
|
|
20
|
+
}
|
|
6
21
|
|
|
7
22
|
|
|
8
23
|
def test_generated_resource_registry_matches_public_api_surface():
|
|
9
|
-
assert
|
|
10
|
-
assert "douyin"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
assert "twitter" in RESOURCE_CLASSES
|
|
24
|
+
assert set(RESOURCE_CLASSES) == expected_resource_namespaces()
|
|
25
|
+
assert {"douyin", "douyin_xingtu", "xiaohongshu_pgy", "twitter"}.issubset(
|
|
26
|
+
RESOURCE_CLASSES
|
|
27
|
+
)
|
|
14
28
|
|
|
15
29
|
|
|
16
30
|
def test_client_exposes_generated_resources():
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.0.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|