ey-commerce-lib 1.0.7__tar.gz → 1.0.8__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.
Potentially problematic release.
This version of ey-commerce-lib might be problematic. Click here for more details.
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/PKG-INFO +1 -1
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/pyproject.toml +1 -1
- ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan/main.py +40 -0
- ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan/schemas/query/order.py +20 -0
- ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan/schemas/query/product.py +75 -0
- ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan/schemas/response/order.py +69 -0
- ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan/schemas/response/product.py +96 -0
- ey_commerce_lib-1.0.8/src/ey_commerce_lib/py.typed +0 -0
- ey_commerce_lib-1.0.8/src/ey_commerce_lib/utils/__init__.py +0 -0
- ey_commerce_lib-1.0.8/tests/__init__.py +0 -0
- ey_commerce_lib-1.0.8/tests/dxm/__init__.py +0 -0
- ey_commerce_lib-1.0.8/tests/kogan/__init__.py +0 -0
- ey_commerce_lib-1.0.8/tests/kogan/test_client.py +13 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/.gitignore +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/.python-version +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/README.md +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/pytest.ini +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/constant/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/constant/order.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/exception/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/exception/common.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/main.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/order.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/parser/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/parser/common.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/parser/order.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/parser/purchase.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/parser/warehouse.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/schemas/common.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/schemas/order.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/schemas/warehouse.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/constant/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/constant/response.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/main.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/parser/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/parser/order.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/schemas/query/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/schemas/query/order.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/schemas/vo/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/schemas/vo/order.py +0 -0
- {ey_commerce_lib-1.0.7/src/ey_commerce_lib/utils → ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan}/__init__.py +0 -0
- {ey_commerce_lib-1.0.7/tests → ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan/schemas}/__init__.py +0 -0
- {ey_commerce_lib-1.0.7/tests/dxm → ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan/schemas/query}/__init__.py +0 -0
- /ey_commerce_lib-1.0.7/src/ey_commerce_lib/py.typed → /ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan/schemas/response/__init__.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/model.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/utils/close.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/utils/dxm.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/utils/list_util.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/utils/str.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/tests/dxm/test_purchase.py +0 -0
- {ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/uv.lock +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from httpx import AsyncClient
|
|
2
|
+
|
|
3
|
+
from ey_commerce_lib.kogan.schemas.query.order import KoganOrderQuery
|
|
4
|
+
from ey_commerce_lib.kogan.schemas.query.product import KoganProductQuery
|
|
5
|
+
from ey_commerce_lib.kogan.schemas.response.order import OrderResponseModel
|
|
6
|
+
from ey_commerce_lib.kogan.schemas.response.product import ProductResponse
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class KoganClient:
|
|
10
|
+
|
|
11
|
+
def __init__(self, seller_id: str, seller_token: str):
|
|
12
|
+
self.seller_id = seller_id
|
|
13
|
+
self.seller_token = seller_token
|
|
14
|
+
# 异步客户端
|
|
15
|
+
self.__async_client = AsyncClient(base_url="https://nimda.kogan.com",
|
|
16
|
+
headers={
|
|
17
|
+
'Accept': 'application/json',
|
|
18
|
+
'SellerId': self.seller_id,
|
|
19
|
+
'SellerToken': self.seller_token
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
async def orders(self, query_params: KoganOrderQuery):
|
|
23
|
+
# 设置查询参数
|
|
24
|
+
orders_res = await self.__async_client.get('/api/marketplace/v2/orders/',
|
|
25
|
+
params=query_params.model_dump(by_alias=True,
|
|
26
|
+
exclude_none=True))
|
|
27
|
+
return OrderResponseModel(**orders_res.json())
|
|
28
|
+
|
|
29
|
+
async def products(self, query_params: KoganProductQuery):
|
|
30
|
+
products_res = await self.__async_client.get('/api/marketplace/v2/products/',
|
|
31
|
+
params=query_params.model_dump(by_alias=True,
|
|
32
|
+
exclude_none=True
|
|
33
|
+
))
|
|
34
|
+
return ProductResponse(**products_res.json())
|
|
35
|
+
|
|
36
|
+
async def __aenter__(self):
|
|
37
|
+
return self
|
|
38
|
+
|
|
39
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
40
|
+
await self.__async_client.aclose()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field, ConfigDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class KoganOrderQuery(BaseModel):
|
|
7
|
+
# 订单状态 只能传入 ReleasedForShipment
|
|
8
|
+
status: str = None
|
|
9
|
+
# 数量 默认值不给为无限制
|
|
10
|
+
limit: Optional[int] = None
|
|
11
|
+
# 开始日期
|
|
12
|
+
start_date_utc: Optional[str] = Field(default=None, alias="startDateUTC")
|
|
13
|
+
# 结束日期
|
|
14
|
+
end_date_utc: Optional[str] = Field(default=None, alias="endDateUTC")
|
|
15
|
+
|
|
16
|
+
model_config = ConfigDict(
|
|
17
|
+
# 允许使用别名
|
|
18
|
+
populate_by_name=True
|
|
19
|
+
)
|
|
20
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from pydantic import BaseModel, Field, ConfigDict
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class KoganProductQuery(BaseModel):
|
|
6
|
+
enabled: Optional[bool] = Field(
|
|
7
|
+
None,
|
|
8
|
+
alias="enabled",
|
|
9
|
+
description="启用状态过滤(True/true/1 表示启用,False/false/0 表示禁用)"
|
|
10
|
+
)
|
|
11
|
+
category: Optional[str] = Field(
|
|
12
|
+
None,
|
|
13
|
+
alias="category",
|
|
14
|
+
description="按 Kogan.com 类别名称筛选(不区分大小写,可多选)"
|
|
15
|
+
)
|
|
16
|
+
brand: Optional[str] = Field(
|
|
17
|
+
None,
|
|
18
|
+
alias="brand",
|
|
19
|
+
description="按品牌筛选(不区分大小写,可多选,标题中逗号需要转义,例如 '\\,')"
|
|
20
|
+
)
|
|
21
|
+
created: Optional[str] = Field(
|
|
22
|
+
None,
|
|
23
|
+
alias="created",
|
|
24
|
+
description="创建时间"
|
|
25
|
+
)
|
|
26
|
+
ebay_category: Optional[int] = Field(
|
|
27
|
+
None,
|
|
28
|
+
alias="ebay_category",
|
|
29
|
+
description="按 eBay 类别 ID 筛选"
|
|
30
|
+
)
|
|
31
|
+
sku: Optional[str] = Field(
|
|
32
|
+
None,
|
|
33
|
+
alias="sku",
|
|
34
|
+
description="按 SKU 精确匹配(支持多选)"
|
|
35
|
+
)
|
|
36
|
+
search: Optional[str] = Field(
|
|
37
|
+
None,
|
|
38
|
+
alias="search",
|
|
39
|
+
description="搜索商品标题"
|
|
40
|
+
)
|
|
41
|
+
ordering: Optional[str] = Field(
|
|
42
|
+
None,
|
|
43
|
+
alias="ordering",
|
|
44
|
+
description="结果排序字段"
|
|
45
|
+
)
|
|
46
|
+
cursor: Optional[str] = Field(
|
|
47
|
+
None,
|
|
48
|
+
alias="cursor",
|
|
49
|
+
description="用于分页的游标(续接 'next' URL 的分页查询)"
|
|
50
|
+
)
|
|
51
|
+
size: Optional[int] = Field(
|
|
52
|
+
None,
|
|
53
|
+
alias="size",
|
|
54
|
+
description="每页返回结果数量"
|
|
55
|
+
)
|
|
56
|
+
created_after: Optional[str] = Field(
|
|
57
|
+
None,
|
|
58
|
+
alias="created_after",
|
|
59
|
+
description="筛选创建日期 >= 指定日期(AEST/AEDT 格式 YYYY-MM-DD)"
|
|
60
|
+
)
|
|
61
|
+
created_before: Optional[str] = Field(
|
|
62
|
+
None,
|
|
63
|
+
alias="created_before",
|
|
64
|
+
description="筛选创建日期 <= 指定日期(AEST/AEDT 格式 YYYY-MM-DD)"
|
|
65
|
+
)
|
|
66
|
+
detail: Optional[bool] = Field(
|
|
67
|
+
None,
|
|
68
|
+
alias="detail",
|
|
69
|
+
description="是否启用响应中所有字段(True/true/1 表示启用)"
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
model_config = ConfigDict(
|
|
73
|
+
# 支持别名
|
|
74
|
+
populate_by_name=True
|
|
75
|
+
)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AddressModel(BaseModel):
|
|
7
|
+
address_line1: str = Field(..., alias="AddressLine1") # 地址行1
|
|
8
|
+
address_line2: Optional[str] = Field(None, alias="AddressLine2") # 地址行2
|
|
9
|
+
city: str = Field(..., alias="City") # 城市
|
|
10
|
+
company_name: Optional[str] = Field(None, alias="CompanyName") # 公司名称
|
|
11
|
+
country: str = Field(..., alias="Country") # 国家代码
|
|
12
|
+
daytime_phone: Optional[str] = Field(None, alias="DaytimePhone") # 白天联系电话
|
|
13
|
+
email_address: Optional[str] = Field(None, alias="EmailAddress") # 邮箱地址
|
|
14
|
+
evening_phone: Optional[str] = Field(None, alias="EveningPhone") # 夜间联系电话
|
|
15
|
+
first_name: str = Field(..., alias="FirstName") # 名
|
|
16
|
+
last_name: str = Field(..., alias="LastName") # 姓
|
|
17
|
+
name_suffix: Optional[str] = Field(None, alias="NameSuffix") # 姓名后缀
|
|
18
|
+
postal_code: str = Field(..., alias="PostalCode") # 邮政编码
|
|
19
|
+
state_or_province: Optional[str] = Field(None, alias="StateOrProvince") # 州或省
|
|
20
|
+
location_id: Optional[str] = Field(None, alias="LocationId") # 位置 ID
|
|
21
|
+
location_id_source: Optional[str] = Field(None, alias="LocationIdSource") # 位置 ID 来源
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ItemModel(BaseModel):
|
|
25
|
+
id: str = Field(..., alias="ID") # 商品 ID
|
|
26
|
+
quantity: int = Field(..., alias="Quantity") # 商品数量
|
|
27
|
+
seller_sku: str = Field(..., alias="SellerSku") # 卖家 SKU
|
|
28
|
+
product_title: str = Field(..., alias="ProductTitle") # 商品标题
|
|
29
|
+
unit_price: float = Field(..., alias="UnitPrice") # 单价
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class OrderModel(BaseModel):
|
|
33
|
+
id: str = Field(..., alias="ID") # 订单 ID
|
|
34
|
+
currency: str = Field(..., alias="Currency") # 货币代码
|
|
35
|
+
items: list[ItemModel] = Field(..., alias="Items") # 商品列表
|
|
36
|
+
order_date_utc: datetime = Field(..., alias="OrderDateUtc") # 下单时间
|
|
37
|
+
order_status: str = Field(..., alias="OrderStatus") # 订单状态
|
|
38
|
+
requested_shipping_method: str = Field(..., alias="RequestedShippingMethod") # 请求的配送方式
|
|
39
|
+
total_gift_option_price: float = Field(..., alias="TotalGiftOptionPrice") # 礼品选项总价
|
|
40
|
+
total_gift_option_tax_price: float = Field(..., alias="TotalGiftOptionTaxPrice") # 礼品选项税费总价
|
|
41
|
+
total_price: float = Field(..., alias="TotalPrice") # 订单总价
|
|
42
|
+
total_shipping_price: float = Field(..., alias="TotalShippingPrice") # 运费总价
|
|
43
|
+
total_shipping_tax_price: float = Field(..., alias="TotalShippingTaxPrice") # 运费税费总价
|
|
44
|
+
total_tax_price: float = Field(..., alias="TotalTaxPrice") # 总税费
|
|
45
|
+
vat_inclusive: bool = Field(..., alias="VatInclusive") # 是否含税
|
|
46
|
+
buyer_address: AddressModel = Field(..., alias="BuyerAddress") # 买家地址
|
|
47
|
+
deliver_by_date_utc: datetime = Field(..., alias="DeliverByDateUtc") # 要求送达日期
|
|
48
|
+
other_fees: float = Field(..., alias="OtherFees") # 其他费用
|
|
49
|
+
payment_method: Optional[str] = Field(None, alias="PaymentMethod") # 支付方式
|
|
50
|
+
payment_transaction_id: Optional[str] = Field(None, alias="PaymentTransactionID") # 支付交易号
|
|
51
|
+
private_notes: Optional[str] = Field(None, alias="PrivateNotes") # 私有备注
|
|
52
|
+
shipping_address: AddressModel = Field(..., alias="ShippingAddress") # 收货地址
|
|
53
|
+
shipping_label_url: Optional[str] = Field(None, alias="ShippingLabelURL") # 运单 URL
|
|
54
|
+
special_instructions: Optional[str] = Field(None, alias="SpecialInstructions") # 特殊指示
|
|
55
|
+
total_order_discount: float = Field(..., alias="TotalOrderDiscount") # 订单折扣总额
|
|
56
|
+
total_shipping_discount: float = Field(..., alias="TotalShippingDiscount") # 运费折扣总额
|
|
57
|
+
order_label: str = Field(..., alias="OrderLabel") # 订单标签
|
|
58
|
+
dispatched_items: Optional[list[str]] = Field(None, alias="DispatchedItems") # 已发货商品 ID 列表
|
|
59
|
+
cancelled_items: Optional[list[str]] = Field(None, alias="CancelledItems") # 已取消商品 ID 列表
|
|
60
|
+
customer_date_of_birth: Optional[str] = Field(None, alias="CustomerDateOfBirth") # 客户生日
|
|
61
|
+
web_store: Optional[str] = Field(None, alias="WebStore") # 网店标识
|
|
62
|
+
is_premium_subscription: Optional[bool] = Field(None, alias="IsPremiumSubscription") # 是否高级会员订单
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class OrderResponseModel(BaseModel):
|
|
66
|
+
status: str = Field(..., alias="status") # 响应状态
|
|
67
|
+
error: Optional[str] = Field(None, alias="error") # 错误信息
|
|
68
|
+
pending_url: Optional[str] = Field(None, alias="pending_url") # 挂起处理 URL
|
|
69
|
+
body: list[OrderModel] = Field(..., alias="body") # 订单数据列表
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field, ConfigDict
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class OfferDetail(BaseModel):
|
|
6
|
+
# 价格
|
|
7
|
+
price: str = Field(..., alias="price")
|
|
8
|
+
# Kogan First 价格
|
|
9
|
+
kogan_first_price: Optional[str] = Field(None, alias="kogan_first_price")
|
|
10
|
+
# 是否免税
|
|
11
|
+
tax_exempt: bool = Field(..., alias="tax_exempt")
|
|
12
|
+
# 运费
|
|
13
|
+
shipping: str = Field(..., alias="shipping")
|
|
14
|
+
# 处理天数
|
|
15
|
+
handling_days: int = Field(..., alias="handling_days")
|
|
16
|
+
# 建议零售价
|
|
17
|
+
rrp: Optional[str] = Field(None, alias="rrp")
|
|
18
|
+
|
|
19
|
+
model_config = ConfigDict(
|
|
20
|
+
populate_by_name=True
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class StoreUrl(BaseModel):
|
|
25
|
+
# 商店链接
|
|
26
|
+
url: str = Field(..., alias="url")
|
|
27
|
+
# 商店名称
|
|
28
|
+
store_name: str = Field(..., alias="store_name")
|
|
29
|
+
# 组织名称
|
|
30
|
+
organisation: str = Field(..., alias="organisation")
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class Product(BaseModel):
|
|
38
|
+
# 产品标题
|
|
39
|
+
product_title: str = Field(..., alias="product_title")
|
|
40
|
+
# 产品SKU
|
|
41
|
+
product_sku: str = Field(..., alias="product_sku")
|
|
42
|
+
# 产品副标题
|
|
43
|
+
product_subtitle: str = Field(..., alias="product_subtitle")
|
|
44
|
+
# 产品 GTIN
|
|
45
|
+
product_gtin: str = Field(..., alias="product_gtin")
|
|
46
|
+
# 图片链接列表
|
|
47
|
+
images: list[str] = Field(..., alias="images")
|
|
48
|
+
# 品牌
|
|
49
|
+
brand: Optional[str] = Field(None, alias="brand")
|
|
50
|
+
# 类别
|
|
51
|
+
category: str = Field(..., alias="category")
|
|
52
|
+
# 类别标识
|
|
53
|
+
category_slug: str = Field(..., alias="category_slug")
|
|
54
|
+
# 报价数据
|
|
55
|
+
offer_data: dict[str, OfferDetail] = Field(..., alias="offer_data")
|
|
56
|
+
# 库存数量
|
|
57
|
+
stock: int = Field(..., alias="stock")
|
|
58
|
+
# 是否启用
|
|
59
|
+
enabled: bool = Field(..., alias="enabled")
|
|
60
|
+
# 创建时间
|
|
61
|
+
created: str = Field(..., alias="created")
|
|
62
|
+
# 商店地址列表
|
|
63
|
+
store_urls: list[StoreUrl] = Field(..., alias="store_urls")
|
|
64
|
+
# 标签
|
|
65
|
+
tags: list[str] = Field(..., alias="tags")
|
|
66
|
+
|
|
67
|
+
model_config = ConfigDict(
|
|
68
|
+
populate_by_name=True
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class Body(BaseModel):
|
|
73
|
+
# 下一页链接
|
|
74
|
+
next: Optional[str] = Field(None, alias="next")
|
|
75
|
+
# 产品列表
|
|
76
|
+
results: list[Product] = Field(..., alias="results")
|
|
77
|
+
|
|
78
|
+
model_config = ConfigDict(
|
|
79
|
+
populate_by_name=True
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class ProductResponse(BaseModel):
|
|
84
|
+
# 状态
|
|
85
|
+
status: str = Field(..., alias="status")
|
|
86
|
+
# 待处理URL
|
|
87
|
+
pending_url: Optional[str] = Field(None, alias="pending_url")
|
|
88
|
+
# 错误信息
|
|
89
|
+
error: Optional[str] = Field(None, alias="error")
|
|
90
|
+
# 响应主体
|
|
91
|
+
body: Body = Field(..., alias="body")
|
|
92
|
+
|
|
93
|
+
model_config = ConfigDict(
|
|
94
|
+
populate_by_name=True
|
|
95
|
+
)
|
|
96
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from ey_commerce_lib.kogan.main import KoganClient
|
|
4
|
+
from ey_commerce_lib.kogan.schemas.query.product import KoganProductQuery
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@pytest.mark.asyncio
|
|
8
|
+
async def test_client():
|
|
9
|
+
async with KoganClient(
|
|
10
|
+
seller_id="xxxxx",
|
|
11
|
+
seller_token="xxxxxx"
|
|
12
|
+
) as client:
|
|
13
|
+
await client.products(KoganProductQuery(search="Spider School Bags Kids Superhero Spider-Man Backpack Gift Set (Color:A)"))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/constant/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/exception/__init__.py
RENAMED
|
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
|
{ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/dxm/schemas/warehouse.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/constant/__init__.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/constant/response.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/parser/__init__.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/parser/order.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/schemas/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.7 → ey_commerce_lib-1.0.8}/src/ey_commerce_lib/four_seller/schemas/vo/order.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.7/tests → ey_commerce_lib-1.0.8/src/ey_commerce_lib/kogan/schemas}/__init__.py
RENAMED
|
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
|