smartpush 2.0.2__py3-none-any.whl → 2.0.4__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.
- smartpush/base/url_enum.py +1 -0
- smartpush/email/activity.py +25 -11
- {smartpush-2.0.2.dist-info → smartpush-2.0.4.dist-info}/METADATA +1 -1
- {smartpush-2.0.2.dist-info → smartpush-2.0.4.dist-info}/RECORD +6 -6
- {smartpush-2.0.2.dist-info → smartpush-2.0.4.dist-info}/WHEEL +0 -0
- {smartpush-2.0.2.dist-info → smartpush-2.0.4.dist-info}/top_level.txt +0 -0
smartpush/base/url_enum.py
CHANGED
|
@@ -64,6 +64,7 @@ class URL:
|
|
|
64
64
|
step1 = "/marketing/insertOrUpdateActivity/step1", POST
|
|
65
65
|
step2 = "/marketing/insertOrUpdateActivity/step2", POST
|
|
66
66
|
step2_get = "/marketing/activityDetail/step2", GET
|
|
67
|
+
delete = "/marketing/deleteActivity",GET
|
|
67
68
|
|
|
68
69
|
|
|
69
70
|
if __name__ == '__main__':
|
smartpush/email/activity.py
CHANGED
|
@@ -13,6 +13,7 @@ from smartpush.email.schema import *
|
|
|
13
13
|
更新活动草稿内容
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
+
|
|
16
17
|
class ActivityTemplate(ActivityTemplateRequestBase):
|
|
17
18
|
|
|
18
19
|
def create_activity_template(self):
|
|
@@ -44,11 +45,17 @@ class ActivityTemplate(ActivityTemplateRequestBase):
|
|
|
44
45
|
data=requestParam)
|
|
45
46
|
return result
|
|
46
47
|
|
|
47
|
-
def
|
|
48
|
+
def get_activity_template_step2(self):
|
|
48
49
|
requestParam = {"id": self.activityTemplateId}
|
|
49
|
-
result = self.request(path=URL.Activity.step2_get.url, method=URL.Activity.step2_get.method,
|
|
50
|
+
result = self.request(path=URL.Activity.step2_get.url, method=URL.Activity.step2_get.method,
|
|
51
|
+
params=requestParam)
|
|
50
52
|
return result
|
|
51
53
|
|
|
54
|
+
def delete_activity_template(self, mtoken='123456'):
|
|
55
|
+
requestParam = {"id": self.activityTemplateId, "mtoken": mtoken}
|
|
56
|
+
result = self.request(path=URL.Activity.delete.url, method=URL.Activity.delete.method,
|
|
57
|
+
params=requestParam)
|
|
58
|
+
return result
|
|
52
59
|
|
|
53
60
|
@staticmethod
|
|
54
61
|
def add_element_to_section_column_children(currentJsonSchema, new_schema):
|
|
@@ -69,26 +76,33 @@ class ActivityTemplate(ActivityTemplateRequestBase):
|
|
|
69
76
|
break # 若有多个Column可根据需求调整,这里匹配第一个Column
|
|
70
77
|
break # 若有多个Section可根据需求调整,这里匹配第一个Section
|
|
71
78
|
return currentJsonSchema
|
|
79
|
+
|
|
72
80
|
@staticmethod
|
|
73
|
-
def get_column_children_universal_property(currentJsonSchema,universalId,property):
|
|
74
|
-
_currentJsonSchema = currentJsonSchema if isinstance(currentJsonSchema,dict) else json.loads(currentJsonSchema)
|
|
81
|
+
def get_column_children_universal_property(currentJsonSchema, universalId, property):
|
|
82
|
+
_currentJsonSchema = currentJsonSchema if isinstance(currentJsonSchema, dict) else json.loads(currentJsonSchema)
|
|
75
83
|
for child in _currentJsonSchema.get("children", []):
|
|
76
84
|
if child.get("type") == "Section":
|
|
77
85
|
# 2. 在Section的children中找到Column节点
|
|
78
86
|
for column in child.get("children", []):
|
|
79
87
|
if column.get("type") == "Column":
|
|
80
|
-
|
|
81
|
-
|
|
88
|
+
for block in column.get("children", []):
|
|
89
|
+
if block.get("universalId") == universalId:
|
|
82
90
|
result = block.get('props').get(property)
|
|
83
91
|
return result
|
|
84
92
|
return None
|
|
85
93
|
|
|
86
|
-
def assert_activity_template_schema_is_update(self,universalId,property='containerBackgroundColor',
|
|
87
|
-
|
|
94
|
+
def assert_activity_template_schema_is_update(self, universalId, property='containerBackgroundColor',
|
|
95
|
+
value='#123456'):
|
|
96
|
+
step2_result = self.get_activity_template_step2()
|
|
88
97
|
currentJsonSchema = json.loads(step2_result['resultData']['currentJsonSchema'])
|
|
89
|
-
assert self.get_column_children_universal_property(currentJsonSchema,universalId,property) == value
|
|
98
|
+
assert self.get_column_children_universal_property(currentJsonSchema, universalId, property) == value
|
|
90
99
|
|
|
91
100
|
|
|
92
101
|
if __name__ == '__main__':
|
|
93
|
-
currentJsonSchema = json.loads(
|
|
94
|
-
|
|
102
|
+
# currentJsonSchema = json.loads(
|
|
103
|
+
# "{\"id\":\"6ou4lnz43\",\"type\":\"Stage\",\"props\":{\"backgroundColor\":\"#EAEDF1\",\"width\":\"600px\",\"fullWidth\":\"normal-width\"},\"children\":[{\"id\":\"wrgsuiu5a\",\"type\":\"Header\",\"props\":{\"backgroundColor\":\"#ffffff\",\"borderLeft\":\"1px none #ffffff\",\"borderRight\":\"1px none #ffffff\",\"borderTop\":\"1px none #ffffff\",\"borderBottom\":\"1px none #ffffff\",\"paddingTop\":\"0px\",\"paddingBottom\":\"0px\",\"paddingLeft\":\"0px\",\"paddingRight\":\"0px\",\"cols\":[12]},\"children\":[{\"id\":\"jk2qppaqu\",\"type\":\"Column\",\"props\":{},\"children\":[]}]},{\"id\":\"2yowv8vnc\",\"type\":\"Section\",\"props\":{\"backgroundColor\":\"#ffffff\",\"borderLeft\":\"1px none #ffffff\",\"borderRight\":\"1px none #ffffff\",\"borderTop\":\"1px none #ffffff\",\"borderBottom\":\"1px none #ffffff\",\"paddingTop\":\"0px\",\"paddingBottom\":\"0px\",\"paddingLeft\":\"0px\",\"paddingRight\":\"0px\",\"cols\":[12]},\"children\":[{\"id\":\"emkpt5gqk\",\"type\":\"Column\",\"props\":{},\"children\":[{\"id\":\"jpbphqkmt\",\"universalId\":\"08424a7a-cbf5-46ca-808c-cc4eec061d9a\",\"universalName\":\"Auto-Logo-2025-11-26 17:06:31\",\"type\":\"Logo\",\"props\":{\"width\":120,\"height\":120,\"imgRatio\":1,\"src\":\"https://cdn.smartpushedm.com/frontend/smart-push/staging/1741054956275/1758595834300_74d62ae6.png?width=120&height=120\",\"href\":\"https://smartpush4.myshoplinestg.com\",\"align\":\"center\",\"containerBackgroundColor\":\"#123456\",\"paddingLeft\":\"20px\",\"paddingRight\":\"20px\",\"paddingTop\":\"20px\",\"paddingBottom\":\"20px\",\"paddingCondition\":true,\"segmentTypeConfig\":1},\"children\":[]}]}]},{\"id\":\"x3fqcszdh\",\"type\":\"Footer\",\"props\":{\"backgroundColor\":\"#ffffff\",\"borderLeft\":\"1px none #ffffff\",\"borderRight\":\"1px none #ffffff\",\"borderTop\":\"1px none #ffffff\",\"borderBottom\":\"1px none #ffffff\",\"paddingTop\":\"0px\",\"paddingBottom\":\"0px\",\"paddingLeft\":\"0px\",\"paddingRight\":\"0px\",\"cols\":[12]},\"children\":[{\"id\":\"tyqqxszro\",\"type\":\"Column\",\"props\":{},\"children\":[{\"id\":\"xarkbgqzj\",\"type\":\"Subscribe\",\"props\":{\"content\":\"<p style=\\\"text-align:center;\\\"><span style=\\\"font-size:12px\\\"><span style=\\\"font-family:Arial, Helvetica, sans-serif\\\">在此處輸入聯繫地址,可以讓你的顧客更加信任這封郵件</span></span></p>\"},\"children\":[]}]}]}],\"extend\":{\"version\":\"1.0.0\",\"updateTime\":null}}")
|
|
104
|
+
# print(ActivityTemplate.get_column_children_universal_property(currentJsonSchema,
|
|
105
|
+
# '4c8a94eb-fb4f-4cba-934c-8bbcf4f02f63',
|
|
106
|
+
# 'containerBackgroundColor'))
|
|
107
|
+
headers = {"cookie":"osudb_appid=SMARTPUSH;osudb_oar=#01#SID0000142BBMtQZENFwRum+auwG8xaPKEtK5HgGx0lValeKMgM9lpDwayeZG4gcRV7ZCuWuhkHOLinjdGep+EhqYgs+3jHB4HX+JlKMjwHl+xti50WubQSH0AdBVthnmGoGxKTnB6xlaZ+IjorbD+HKOoEBuJ;osudb_subappid=1;osudb_uid=4213785247;ecom_http_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NjY2MzUyNTYsImp0aSI6ImRiOGNkNTIyLTkwMmQtNDcwNS1iM2JkLTc4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pZW50X2lkIjoiZW1haWwtbWFya2V0In0.dAPLGpef8jYXrIu9Wr-diKNGksWZ3mKmDW_f0djxtKs;"}
|
|
108
|
+
ActivityTemplate(444893,'https://test.smartpushedm.com/bff/api-em-ec2',headers=headers).delete_activity_template()
|
|
@@ -6,11 +6,11 @@ smartpush/account/operate_account.py,sha256=nzJLLAEwNElavZeWVqnA_MSGTBzQrSrknmez
|
|
|
6
6
|
smartpush/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
smartpush/base/faker_data.py,sha256=-OcFFQnDGpjZR3guo_tHfxV7zQEHo9ciidWGqKv_jNs,25437
|
|
8
8
|
smartpush/base/request_base.py,sha256=jQRnURl9-BA5BnymjyD5auqFc256CtmepM_woFVkE6g,2754
|
|
9
|
-
smartpush/base/url_enum.py,sha256=
|
|
9
|
+
smartpush/base/url_enum.py,sha256=g1TdiKwLJusIwyhIxJ9rR0PW3a0ZxFrq1rCh2sVVaFk,2275
|
|
10
10
|
smartpush/crowd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
smartpush/crowd/crowd.py,sha256=KNwvX-BnBnMVVuHM79a-VeBMp_guB-Kqw3tFaAPiAp8,9768
|
|
12
12
|
smartpush/email/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
smartpush/email/activity.py,sha256=
|
|
13
|
+
smartpush/email/activity.py,sha256=7kewCH8znKzwCgK217Mw9ETqFDUARQRTMEqZ79TICZI,9697
|
|
14
14
|
smartpush/email/schema.py,sha256=Uef41D0Z_xw07khOyLiJhjfZ9GVE0urN0tG8orQjIfY,31220
|
|
15
15
|
smartpush/email/universal_content.py,sha256=0VaY_-2--AofdJBuRrOClDXZqn-tCU_FOxSPY-GIRIk,11954
|
|
16
16
|
smartpush/export/__init__.py,sha256=D9GbWcmwnetEndFDty5XbVienFK1WjqV2yYcQp3CM84,99
|
|
@@ -34,7 +34,7 @@ smartpush/utils/StringUtils.py,sha256=n8mo9k0JQN63MReImgv-66JxmmymOGknR8pH2fkQrA
|
|
|
34
34
|
smartpush/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
smartpush/utils/date_utils.py,sha256=Xgx2DbmWYri71xXBiaKYTZDeh2a8MFhYns_xB0U2JOA,13159
|
|
36
36
|
smartpush/utils/form_utils.py,sha256=ld-g_Dm_ZlnagQt7imYfUc87bcBRVlTctywuLtzmjXQ,849
|
|
37
|
-
smartpush-2.0.
|
|
38
|
-
smartpush-2.0.
|
|
39
|
-
smartpush-2.0.
|
|
40
|
-
smartpush-2.0.
|
|
37
|
+
smartpush-2.0.4.dist-info/METADATA,sha256=xoYqHjYUnAfMy8_Avvrm7NX4tlQvb7b_bwDlMBXe3gs,131
|
|
38
|
+
smartpush-2.0.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
39
|
+
smartpush-2.0.4.dist-info/top_level.txt,sha256=5_CXqu08EfbPaKLjuSAOAqCmGU6shiatwDU_ViBGCmg,10
|
|
40
|
+
smartpush-2.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|