tgshops-integrations 3.3__tar.gz → 3.5__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/PKG-INFO +1 -1
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/setup.py +1 -1
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/middlewares/gateway.py +4 -4
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/models/products.py +4 -5
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/nocodb_connector/categories_management.py +2 -2
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/nocodb_connector/model_mapping.py +6 -4
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/nocodb_connector/products_management.py +3 -2
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations.egg-info/PKG-INFO +1 -1
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/README.md +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/setup.cfg +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/__init__.py +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/middlewares/__init__.py +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/models/__init__.py +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/models/categories.py +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/nocodb_connector/__init__.py +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/nocodb_connector/client.py +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/nocodb_connector/tables.py +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations.egg-info/SOURCES.txt +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations.egg-info/dependency_links.txt +0 -0
- {tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: tgshops_integrations
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.5
|
4
4
|
Summary: Library is intended to provide the integration of the external service or CRM system with the TelegramShops/It allows to configure the relationship between NocoDB list of the products used further to display in the shop/As a resultss the products can be synchronized and updated uppon the request.
|
5
5
|
Home-page: https://git.the-devs.com/virtual-shops/shop-system/shop-backend-integrations/integration-library/integration-library
|
6
6
|
Author: Dimi Latoff
|
{tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/middlewares/gateway.py
RENAMED
@@ -9,8 +9,8 @@ from models.products import ProductModel
|
|
9
9
|
import sys
|
10
10
|
sys.path.append('/home/latoff/Desktop/MarketBots')
|
11
11
|
|
12
|
-
from
|
13
|
-
from
|
12
|
+
from nocodb_connector.client import NocodbClient
|
13
|
+
from nocodb_connector.model_mapping import (
|
14
14
|
dump_product_data,
|
15
15
|
dump_product_data_with_check,
|
16
16
|
get_pagination_info,
|
@@ -23,8 +23,8 @@ from tgshops_integrations.nocodb_connector.model_mapping import (
|
|
23
23
|
PRODUCT_IMAGES_LOOKUP_FIELD,
|
24
24
|
PRODUCT_EXTERNAL_ID,
|
25
25
|
)
|
26
|
-
from
|
27
|
-
from
|
26
|
+
from nocodb_connector.categories_management import CategoryManager
|
27
|
+
from nocodb_connector.products_management import ProductManager
|
28
28
|
from loguru import logger
|
29
29
|
|
30
30
|
|
{tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/models/products.py
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
from pydantic import BaseModel
|
2
|
-
from typing import Any, List,
|
2
|
+
from typing import Any, List,Dict,Optional
|
3
3
|
from datetime import datetime
|
4
4
|
|
5
5
|
from pydantic import BaseModel, Field, schema, validator
|
@@ -10,7 +10,6 @@ class ExtraAttribute(BaseModel):
|
|
10
10
|
|
11
11
|
class ExternalProductModel(BaseModel):
|
12
12
|
external_id: str
|
13
|
-
|
14
13
|
category: Optional[List[str]]
|
15
14
|
category_name: Optional[List[str]]
|
16
15
|
name: str
|
@@ -28,12 +27,12 @@ class ExternalProductModel(BaseModel):
|
|
28
27
|
class ProductModel(BaseModel):
|
29
28
|
id: Optional[str]
|
30
29
|
external_id: Optional[str]
|
31
|
-
|
32
|
-
|
30
|
+
product_properties: Optional[List[str]]
|
31
|
+
categories_structure: Optional[Dict[str, Any]]
|
33
32
|
name: str
|
34
33
|
description: Optional[str]
|
35
34
|
price: Optional[float]
|
36
|
-
final_price: Optional[
|
35
|
+
final_price: Optional[float]
|
37
36
|
currency: Optional[str]
|
38
37
|
stock_qty: int
|
39
38
|
orders_qty: int = Field(0, hidden_field=True)
|
@@ -3,8 +3,8 @@ from loguru import logger
|
|
3
3
|
from aiocache import cached
|
4
4
|
from models.categories import CategoryModel, CategoryResponseModel, CategoryListResponseModel
|
5
5
|
from models.products import ProductModel
|
6
|
-
from
|
7
|
-
from
|
6
|
+
from nocodb_connector.client import custom_key_builder, NocodbClient
|
7
|
+
from nocodb_connector.model_mapping import (
|
8
8
|
CATEGORY_IMAGE_FIELD,
|
9
9
|
CATEGORY_NAME_FIELD,
|
10
10
|
CATEGORY_PARENT_FIELD,
|
@@ -3,8 +3,8 @@ import secrets
|
|
3
3
|
import importlib.util
|
4
4
|
from pathlib import Path
|
5
5
|
|
6
|
-
from
|
7
|
-
from
|
6
|
+
from models.categories import CategoryModel, CategoryResponseModel, PaginationResponseModel
|
7
|
+
from models.products import ExtraAttribute, ProductModel
|
8
8
|
|
9
9
|
|
10
10
|
# Helper function to load `config.py` dynamically
|
@@ -33,7 +33,7 @@ def initialize_model_mapping(config_path: str):
|
|
33
33
|
global PRODUCT_IMAGE_FIELD, PRODUCT_DISCOUNT_PRICE_FIELD, PRODUCT_CATEGORY_ID_LOOKUP_FIELD, PRODUCT_IMAGES_LOOKUP_FIELD
|
34
34
|
global PRODUCT_REQUIRED_OPTIONS_FIELD, PRODUCT_CATEGORIES_EXTRA_OPTIONS_FIELD, PRODUCT_CATEGORIES_EXTRA_OPTION_NAMES_FIELD
|
35
35
|
global PRODUCT_EXTRA_CHOICE_REQUIRED_FIELD, PRODUCT_ID_FIELD, PRODUCT_EXTERNAL_ID, PRODUCT_CHECKOUT_MODE
|
36
|
-
global NEW_ID_FIELD, NOCODB_CHECKOUT_MODES
|
36
|
+
global NEW_ID_FIELD, NOCODB_CHECKOUT_MODES,PRODUCT_CATEGORY_STRUCTURE
|
37
37
|
|
38
38
|
config = load_config(config_path)
|
39
39
|
|
@@ -50,6 +50,7 @@ def initialize_model_mapping(config_path: str):
|
|
50
50
|
PRODUCT_CURRENCY_FIELD = config.PRODUCT_CURRENCY_FIELD
|
51
51
|
PRODUCT_STOCK_FIELD = config.PRODUCT_STOCK_FIELD
|
52
52
|
PRODUCT_CATEGORY_NAME_FIELD = config.PRODUCT_CATEGORY_NAME_FIELD
|
53
|
+
PRODUCT_CATEGORY_STRUCTURE=config.PRODUCT_CATEGORY_STRUCTURE
|
53
54
|
PRODUCT_CATEGORY_ID_FIELD = config.PRODUCT_CATEGORY_ID_FIELD
|
54
55
|
PRODUCT_IMAGE_FIELD = config.PRODUCT_IMAGE_FIELD
|
55
56
|
PRODUCT_DISCOUNT_PRICE_FIELD = config.PRODUCT_DISCOUNT_PRICE_FIELD
|
@@ -187,7 +188,8 @@ async def parse_product_data(data: dict) -> ProductModel:
|
|
187
188
|
currency=data.get(PRODUCT_CURRENCY_FIELD, "RUB"),
|
188
189
|
stock_qty=data.get(PRODUCT_STOCK_FIELD, 0),
|
189
190
|
preview_url=preview_url,
|
190
|
-
|
191
|
+
product_properties=data.get(PRODUCT_CATEGORY_NAME_FIELD, []),
|
192
|
+
categories_structure=data.get(PRODUCT_CATEGORY_STRUCTURE, {}),
|
191
193
|
category=data.get(PRODUCT_CATEGORY_ID_LOOKUP_FIELD, []),
|
192
194
|
extra_attributes=extra_attributes,
|
193
195
|
extra_option_choice_required=bool(data.get(PRODUCT_EXTRA_CHOICE_REQUIRED_FIELD, [])),
|
@@ -3,8 +3,8 @@ import hashlib
|
|
3
3
|
from aiocache import cached
|
4
4
|
from loguru import logger
|
5
5
|
from models.products import ProductModel
|
6
|
-
from
|
7
|
-
from
|
6
|
+
from nocodb_connector.client import custom_key_builder, NocodbClient
|
7
|
+
from nocodb_connector.model_mapping import (
|
8
8
|
dump_product_data,
|
9
9
|
dump_product_data_with_check,
|
10
10
|
get_pagination_info,
|
@@ -18,6 +18,7 @@ from tgshops_integrations.nocodb_connector.model_mapping import (
|
|
18
18
|
PRODUCT_IMAGES_LOOKUP_FIELD,
|
19
19
|
)
|
20
20
|
|
21
|
+
|
21
22
|
class ProductManager(NocodbClient):
|
22
23
|
def __init__(self, table_id=None, logging=False, NOCODB_HOST=None, NOCODB_API_KEY=None, SOURCE=None):
|
23
24
|
super().__init__(NOCODB_HOST=NOCODB_HOST, NOCODB_API_KEY=NOCODB_API_KEY, SOURCE=SOURCE)
|
{tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations.egg-info/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: tgshops-integrations
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.5
|
4
4
|
Summary: Library is intended to provide the integration of the external service or CRM system with the TelegramShops/It allows to configure the relationship between NocoDB list of the products used further to display in the shop/As a resultss the products can be synchronized and updated uppon the request.
|
5
5
|
Home-page: https://git.the-devs.com/virtual-shops/shop-system/shop-backend-integrations/integration-library/integration-library
|
6
6
|
Author: Dimi Latoff
|
File without changes
|
File without changes
|
File without changes
|
{tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/middlewares/__init__.py
RENAMED
File without changes
|
{tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/models/__init__.py
RENAMED
File without changes
|
{tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations/models/categories.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{tgshops_integrations-3.3 → tgshops_integrations-3.5}/tgshops_integrations.egg-info/top_level.txt
RENAMED
File without changes
|