From b52e7cfac1cf50ada42fcb4b7cacd28480491fc3 Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Wed, 20 Aug 2025 15:17:29 -0400 Subject: [PATCH] Made some changes to templates (oops). But mostly working on Spark help menu/context aware calls that aren't working as expected. --- .../Headway/styles.css.liquid | 4 +- .../LJ Hooker Lighthouse/styles.css.liquid | 60 +++++++++---------- Scripts/Walmart/Spark/help_menu.py | 37 +++++------- .../Walmart/Spark/helpmenu_from_walmart.sh | 43 +++++++++++++ 4 files changed, 90 insertions(+), 54 deletions(-) create mode 100644 Scripts/Walmart/Spark/helpmenu_from_walmart.sh diff --git a/Custom_Templates/customer_templates/Headway/styles.css.liquid b/Custom_Templates/customer_templates/Headway/styles.css.liquid index 4d400783..71906a7c 100644 --- a/Custom_Templates/customer_templates/Headway/styles.css.liquid +++ b/Custom_Templates/customer_templates/Headway/styles.css.liquid @@ -14,7 +14,7 @@ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap'); html > body, -.np-dashboard.np-dashboard, +.np-dashboard.np-dashboard, .np-learning-paths.np-learning-paths { background: #f8f8f8; } @@ -77,4 +77,4 @@ body *:not(i) { .np-card-container { box-shadow: 0px 0px 16px 0 rgb(161 171 171 / 45%); -} \ No newline at end of file +} diff --git a/Custom_Templates/customer_templates/LJ Hooker Lighthouse/styles.css.liquid b/Custom_Templates/customer_templates/LJ Hooker Lighthouse/styles.css.liquid index f620069d..559aca8c 100644 --- a/Custom_Templates/customer_templates/LJ Hooker Lighthouse/styles.css.liquid +++ b/Custom_Templates/customer_templates/LJ Hooker Lighthouse/styles.css.liquid @@ -12,7 +12,7 @@ /* - 1.0 GLOBAL SYLING + 1.0 GLOBAL SYLING */ body { background: #fff; @@ -70,7 +70,7 @@ div { .np-dashboard-border { background: transparent; - + } .np-dashboard-border .np-card-content, @@ -174,22 +174,22 @@ div { flex:1; } -/* +/* 2.0 - CAROUSEL STYLES */ -.carousel-header-container { +.carousel-header-container { display: flex; justify-content: center; align-items: center; margin-bottom: 2rem; -} +} @media (min-width: 768px) { - .carousel-header-container { + .carousel-header-container { margin-left: 20px; margin-right: 20px; - } + } .row .np-card { padding: 0 12px; } @@ -314,8 +314,8 @@ div { } } -/* - 2.1 - HOMEPAGE +/* + 2.1 - HOMEPAGE */ .np-homepage-hero .np-homepage-headline { @@ -351,8 +351,8 @@ div { } } -/* - 2.4 - COURSE COVER PAGE +/* + 2.4 - COURSE COVER PAGE */ #course-desktop .np-course-content { background: #fff; @@ -409,8 +409,8 @@ div { border-radius: 0px; } -/* - 2.7 - LEARNING PATH COVER PAGE +/* + 2.7 - LEARNING PATH COVER PAGE */ .np-learning-path-outline-inactive-item { @@ -441,7 +441,7 @@ div { } -/* +/* 3.1 - HEADER */ @@ -461,7 +461,7 @@ div { } } -/* +/* 3.3 - FOOTER */ .np-footer { @@ -479,8 +479,8 @@ div { color: #000; } -/* - 3.4 - BUTTONS +/* + 3.4 - BUTTONS */ .np-button { @@ -555,7 +555,7 @@ button.jryxug { } } -/* +/* 3.6 - COURSE CARD */ .np-card-container { @@ -626,8 +626,8 @@ button.jryxug { } } -/* - 3.7 - LEARNING PATH CARD +/* + 3.7 - LEARNING PATH CARD */ .np-card .np-card-container .np-learning-path { @@ -696,7 +696,7 @@ button.jryxug { } } -/* +/* 3.8 - TRAINING EVENTS CARD */ @@ -805,8 +805,8 @@ button.jryxug { } -/* - 3.9 - COURSE BANNER +/* + 3.9 - COURSE BANNER */ .np-course-banner { margin-bottom: 20px; @@ -914,7 +914,7 @@ button.jryxug { } /* - 3.11 - COURSE PROGRESS & CTA + 3.11 - COURSE PROGRESS & CTA */ .np-card-progress-bar-container, .np-progress-bar-container { @@ -1270,16 +1270,16 @@ button.jryxug { .welcome-text-container-black { padding-top: 2rem; } - + .course-carousel-title { font-size: 25px; } - + .bolder-headline { font-weight: 800 !important; font-size: 25px; } - + .subtitle { color: black; opacity: 1; @@ -1353,7 +1353,7 @@ button.jryxug { } .black-bottom { - background: black; + background: black; } .carousel-heading-text { font-size: 2rem; @@ -1388,7 +1388,7 @@ button.jryxug { .np-carousel .slick-arrow.fa-chevron-left { left: -22px; } - + .activities, .np-course-details { text-align: center; } @@ -1426,4 +1426,4 @@ button.jryxug { .np-card-training-sessions { justify-content: flex-end; -} \ No newline at end of file +} diff --git a/Scripts/Walmart/Spark/help_menu.py b/Scripts/Walmart/Spark/help_menu.py index 8d557825..a8a2ffbb 100644 --- a/Scripts/Walmart/Spark/help_menu.py +++ b/Scripts/Walmart/Spark/help_menu.py @@ -15,18 +15,21 @@ driver_auth = "https://walmart.northpass.io/driver/authenticate" stage_url = "https://walmart.np-mt-dev.net/helpMenu" random_uuid = uuid.uuid4() -msg_body = { - "sessionExpiryTimeInSeconds": 3600, - "messageExpirationTimestamp": 1758722640, - "driver": { - "uuid": str(random_uuid), - "accessLevel": "BEGINNER" - }, - "subCategory": "REWARDS", - "appContext": "contextAwareHelp" -} +# msg_body = { +# "sessionExpiryTimeInSeconds": 3600, +# "messageExpirationTimestamp": 1758722640, +# "driver": { +# "uuid": str(random_uuid), +# "accessLevel": "BEGINNER" +# }, +# "subCategory": "REWARDS", +# "appContext": "contextAwareHelp" +# } +msg_body = {"sessionExpiryTimeInSeconds":3600,"messageExpirationTimestamp":1758722640,"driver":{"uuid":str(random_uuid),"accessLevel":"BEGINNER"},"subCategory":"REWARDS","appContext":"contextAwareHelp"} +print(msg_body) msg_body_json = json.dumps(msg_body, sort_keys=True) +print(msg_body_json) body_signature = hmac.new(secret_key, msg_body_json.encode('utf-8'), hashlib.sha256).hexdigest() # "accept": "application/json", @@ -40,7 +43,7 @@ header = { headers = { 'Content-Type': 'application/json','X-Hmac-SHA256': body_signature } # prod = requests.post(prod_url, headers=headers, json=msg_body) -prod = requests.post(prod_url, headers=headers, json=msg_body) +prod = requests.post(prod_url, headers=headers, json=msg_body_json) print(f"Status Code: {prod.status_code}") print(f"Response: {prod.json()}") print(f"Body Signature: {body_signature}") @@ -65,15 +68,5 @@ Testing the same curl respone for Spark: curl -X POST --location "https://walmart.northpass.io/helpMenu" \ -H "X-Hmac-SHA256: fec9bb0355b2b599d6cfc22c73b5e8df3159d0b8b275af5229c900e29e3081c8" \ -H "Content-Type: application/json" \ --d '{ - "sessionExpiryTimeInSeconds": 3600, - "messageExpirationTimestamp": 1758722640, - "driver": { - "uuid": "3949c78e-9a9c-43d6-92f0-8c474c0e1d1e", - "accessLevel": "BEGINNER" - }, - "subCategory": "REWARDS", - "appContext": "contextAwareHelp" - }' - +-d '{"sessionExpiryTimeInSeconds":3600,"messageExpirationTimestamp":1758722640,"driver":{"uuid":"3949c78e-9a9c-43d6-92f0-8c474c0e1d1e","accessLevel":"BEGINNER"},"subCategory":"REWARDS","appContext":"contextAwareHelp"}' """ diff --git a/Scripts/Walmart/Spark/helpmenu_from_walmart.sh b/Scripts/Walmart/Spark/helpmenu_from_walmart.sh new file mode 100644 index 00000000..3c7a9f53 --- /dev/null +++ b/Scripts/Walmart/Spark/helpmenu_from_walmart.sh @@ -0,0 +1,43 @@ +curl +-H "Host: developer.api.us.stg.walmart.com" +-H "Cookie: sid=459EC72D-D101-48E7-9801-FC2482F3C452; vid=E1771553-4506-488B-9E99-ECDB4139A6E2" +-H "wm_consumer.intimestamp: 1755694491125" +-H "wm_consumer.id: 24e928f4-977a-496c-99fe-12cd3218ff23" +-H "wm_qos.correlation_id: 0E39301D-A4BC-470E-8D5D-E5C5B0B4A86B" +-H "device_model: x86_64" +-H "accept: */*" +-H "x-px-os: iOS" +-H "device_os_version: 18.3.1" +-H "wm_device_id: 22C65931-207D-4BF5-BA59-27AE50717DC4" +-H "user-agent: SPARK/4.30.0 (x86_64; iOS 18.3.1)" +-H "wm_country: US" +-H "x-domain: USLM" +-H "wm_consumer.ip: 2405:201:d02c:d029:4456:9df7:1353:aff7" +-H "x-px-hello: CwQKAgUFUgEeBFdQAB4CAlUDHgtVBwoeBAEGUgIFBVcGVQME" +-H "x-px-mobile-sdk-version: 3.1.5" +-H "x-px-device-fp: 25EFAD17-1BA3-4DD9-993E-F81AD64D4200" +-H "accept-language: en-US;q=1.0" +-H "wm_driver_uuid: 6f79dd7f-58e5-492e-840f-dc92e928f62a" +-H "x-px-authorization: 3:151102c6f567a2b4f20d90c9ccf8c851f94dae3000e5fd8d9430eabccc255e57:4AYXHEv5hc8gAEIJxH4x5t113ZsqB6zjI22thhmlVVt3wL5dVB1okoOco376pvppK/DblaxlOuZ5uLXEJX1Uuw==:1000:rNgSMY2ZvRriHlt0O7Oy+aQn+ZSOLV7ItLAkWcq5mRIwkgLKV8/spwNnUzyMUAhnQYL9QH+agCzVK2rnO5PvvxrBDvasl46Q+zO8G+AxPQRPGTyD1qGZLKfBvip0rB1wImm2+xYeR+ei/M2A7vfJ3boBRB/Q514lWVtTVYuU0rVEnS5gh3WCH6LV9zN9hjDRoGr/kVZzAwjMQC5zK3qQn30Z2svQfdaiIlKWORBTwz8=" +-H "cache-control: no-store" +-H "x-px-vid: 7faacc0a-378d-11f0-aa98-9752b65217c3" +-H "x-px-uuid: 879166a2-7dc3-11f0-8f49-725a166d5f07" +-H "wm_market: Walmart New Denver" +-H "wm_locale_id: en_US" +-H "device_type: x86_64" +-H "x-px-os-version: 18.3.1" +-H "wm_tenant_id: 0" +-H "installed_app_version: 4.30.0" +-H "wm_driver_login_id: sanjeev.singh@walmart.com" +-H "content-type: application/json" +-H "x-signature: Q8idkvr5Du3SsDfeN87Lm8OCEWjgzVT/jgVDeTeKjLH/N9BXNCPyXKinKOI9Rc1Dj6bSFLATV05PEYfRU5V5UVuvJKu6PLPFx3Yw39xaRwE0ZPI+wVYahDkJph31ziP6U34gWp2V8gGb93zQprNHXBXvSMvLg2LKqplj5VGNNoVfjut3EFdRkK0o9qvDTLtvP3KNI5aYfbiyRyslm8QHabnYhjpH7SXVfPR002WBAgVLKqXSBFo/UOscvgJxKXZaSnIV+NImH3oj7EOH9GSSizkdL0tmL4RTvHy6ucF072fD9PrVgI6UUzmG4WXNa9HA1I7Rd5FUK34axJESXefHbQ==" +-H "x-px-device-model: Simulator iPhone17,1" +-H "x-timezone: Asia/Kolkata" +-H "device_os: iOS" +-H "installed_app: SPARK" +-H "wm_sec.auth_token: MDkyMDQyMDE45yEZ+lmiZAPh6tWl7WWzzGBK0qrxUULIbyokfMhUppONlYt0AqWHVpxX6VlcY13v3pxPQhzafy+W2ulA+Z++O0AfNXOp0+RyEPHb3tE9BNzMP0d/7aiM2Fh+U+Zw9zBwzJz5s9ZNYgjrZe3A6pIFPVWHB1/V4Ct2kFd2hsk6k2dx+/PTfmLDueH9ztGIQLHiUP7LOV44GhY8WlTRP0XH0SAkzF6ojKPharSya4fhmVhODkcqWKi5z2ko61Vbpyj5JoiGnmjuCHLJXf6fyRKAuQpBniT0lFZRp3Bx7rRPkErgbb1R0l6F2qHCef/e8/aWUbCz5QSFMGUoemeC8ydnp4eaFxzOWiHJCqIiAxdURF102am18IiaBA/pnyTUVW3G6dHjOmVOJ3XNO2KpwpEk5Gj0rGr4IxN74Se2KmP+YwURmEWnrL0m6tutRAqqhvrWO1xkG73w3cYcQwea0sxF2oGZ3fJOXsrhPmsKwQd28jjt8svLfVsoLW0LNOdW40yWBmyb2ofoTonWYhHMHIrZ2SbXwU+tkAkdNSblTaOHsSvg9yt/SI6QIkL9ammHItB4" +-H "x-tenantid: 5" +--data-binary +"{"payload":{"driver_user_id":"sanjeev.singh@walmart.com","sub_category":"REWARDS","app_context":"contextAwareHelp"}}" +--compressed +"https://developer.api.us.stg.walmart.com/api-proxy/service/lastmile/orchestrator/v2/api/dsep/v1/vendor/helpMenu"