diff --git a/cloud/classic/com-pwa/compose.yml b/cloud/classic/com-pwa/compose.yml index 6f62148e7..50f3971a6 100644 --- a/cloud/classic/com-pwa/compose.yml +++ b/cloud/classic/com-pwa/compose.yml @@ -23,6 +23,9 @@ services: max-size: '10m' max-file: '2' + environment: + - DOMAIN=${DOMAIN} + labels: traefik.enable: true traefik.port: 80 @@ -58,7 +61,6 @@ services: - STORAGE_HOST=${APP_ID}-storage-server - STORAGE_PORT=80 - STORAGE_TOKEN=${STORAGE_ACCESS_TOKEN} - - ACCESS_TOKEN=${COM_API_ACCESS_TOKEN} - ADMIN_TOKEN=${COM_API_ADMIN_TOKEN} - ALWATR_DEBUG=${COM_API_DEBUG:-} diff --git a/cloud/classic/com-pwa/env/soffit-order-beta.env b/cloud/classic/com-pwa/env/soffit-order-beta.env new file mode 100644 index 000000000..e69bd809c --- /dev/null +++ b/cloud/classic/com-pwa/env/soffit-order-beta.env @@ -0,0 +1,14 @@ +U2FsdGVkX19Cmy8vo9c4NK8T3Hbz6KkRDx1scSHvsxjxjuOPaLtsDqricZhDljq/ +oAx+ujzUnJpj9SQYJv43QwqOdT4/Nt2XVBUdsWbUwfec8J7qI+1lLymZR3fW/z6a +Q7PvyL1p99YaaD1H10jzwGsDr3kiv2Eq2xBhaa+he8zutyUFXsR0DW1GcCcnjXxi +Q9e1ceZeZYorFWQRQWjDuiL2hw4tfYpzZDAmMIv3r9LlIi3/+8HZNdc2nYsmwWA7 +m5Edgyn5b3ROd5Ji64UQbXv7imsvrpE2JKXf/EYcXVTRTEATNbXG2wHCNc2+ieFX +YHtVcEfuAE07kB9SjWlKtbBR4DUFxdgKqcqQmzSydSLd7g8Rr0CMKRZafHaaBIW5 +eHkkNPttNlvrNTcausyJ1FytGRbg1vdyl1KQsEzowu3JA37mD7JHDY3UbGaro9WY +NfOFtrZtc+5yWG3eE4PLe8Sd4Ejr4w3I/C1TXdr4lWwsur4uFO4zv1f9GJVdQHmj +/BZ18mqo7iPi2onu1f5W5NHClSEc1ouArHqwBIb6L0LJJ4GSpBgdJ7Ri4K0vkqOW +xUsu3TWiUFfZLGWYEIhSDtAJuZVsFMXt59bFaVOV4VYf8OoZhSTSIaO5API/NJqP +m+p8ZW6PDJK0HS7iFmVZXcCJ25PdpvV3CGJ9uQJn0ygiT/A2JAJEBLh5i714ENqt +gZ5DUx8ErVq3fHJpyoiqrG2Zrh1qGdaPK97oBcc4GN7ZrRtAQ3J0ELtv6DRzIOt+ +ANLFrOB54sH8E3zUjQYQoBVokjnXb8n3JE1jDpYp2UnNZSIjNd2gad9FRJZDDm0X +bMCU89gAlPxhlVfzD3lNfARcCmJANZEfEOG/xPq21jbQBj3rwgMF43LLmA6EFxhl diff --git a/cloud/classic/com-pwa/env/soffit-order-canary.env b/cloud/classic/com-pwa/env/soffit-order-canary.env new file mode 100644 index 000000000..5e123e70e --- /dev/null +++ b/cloud/classic/com-pwa/env/soffit-order-canary.env @@ -0,0 +1,14 @@ +U2FsdGVkX1+vcmmS1/AgXQFnh6umKKDieztfvakWKCObwtV7XKSq42+633XsXtbR +qAUaXzip5AtalEFi1KwhzsX4PgNd/TKzd7pCFmyWaN/nVZphL4ukRL5zBzBruuFe +WAFw+PpZpVWr2nwtMBJlTEH8ALoLpbhLY4AmRtDJB1gYA/eEeTqFWfFB0X3EM8cm +BBQZlekHtrPZiX1HpytBTml2HsNfGYupHDha1lxEUJTLTuSdBAmyfYmuejrtJ37T +97udMhgpD1KfL/o9jqgg71tMTKcucZ4RU8/OSyYHF4FeHAJLnPfuFJ9hPUY69CWx +et6QNwIrLZi8NNvuG9lMcKfJx6yNe8SnAgmyfQybADF5VQLoxcRDYT1D3qpskUwW +1QxddhzLUlJpVRVfAxI/q2vYZd1zsZGiCJLQm3tgCA6diMV9SmUUpn9W/zX0orFl +8hiMtrTNXDPQN8hdyAl72zc9e/4Qbgki73zbt+KdbF4ew+ufGRBFZ5ulmX6ZMzzU +duJUpSUBH9x2sxzghZT9kyieVKgxkkX/GAfE4OTxa//8Pxf6sONF6fhY2ekgniib +D4EWF7LrgxJ35+4JHPRn6sMDXjFr/LPixKJIEclyaYG2b9wVGyoZH8gmuamiNq+x +tLapS0s29UxZwcYck+sEqo5reer8gHR0yzsUxsPk0TahtvqNgP3BjEK5vewEAUEn +ZmkE5IJwl5gp/T6g/eiuv2hQ1vDMooBN4GzKubLB9TGoqxeo+DV8zaKPzNxZAoxn +Tu5CF6j4KO+Tj2pufqQy9tDkAdYXfhXHbYtyJwczKYCy0MEYMICw3SALHwAK3xQZ +IW5nMPSCkau0d1yfx30ErSDsi1O8Lq935RXyizQM5EFTTwCPDJCU7c7OeNWN+G5u diff --git a/cloud/classic/com-pwa/env/soffit-order.env b/cloud/classic/com-pwa/env/soffit-order.env index 5f23bac50..76e49be12 100644 --- a/cloud/classic/com-pwa/env/soffit-order.env +++ b/cloud/classic/com-pwa/env/soffit-order.env @@ -1,16 +1,14 @@ -U2FsdGVkX1/042AOBwTHj12Hta3KuFf4gFJ/JHoK3U3BMect8Is8Vvy8nJWhLVe6 -eipOw19+FkE2DUB5VvIhYG3k0gH7Fwqqa8IdelZu3JRfXL0PyVFWSU3J077TyFY1 -iqjx+aT6bM0mUc2eRQNTeVyiStDLlqHJpQKrduSVLgq4pqz3gW1gbCqiMnYiefkE -Y0zuvztnf4hYM85ksqC0KXBhrOTHRz2mmzxX6CjnURDzDoYwe8skY916BHwJrluC -tuhI+6N7+3vp7IwuTmbGvthRAXaVClBdwCUJ/UALICIHkJy3/h/YhRCkPLbHb3NT -P8ss+Ag4rOw91AVSB/YFMy9xDCa4SwY8zIiVpFzpfFVkVCG/O2KBdjA5HAlK+zIL -DK1hobuG4HyABKuhRLdenDC/5A9s8cJeXU06fpTBo3O+rABuSksUHZeotLbPXve+ -Q6FuQAD7E+dnXrhQmi45gTJgHJnxcnYm+YjuALbN5JSwoAedeG/BGxRP9k5SNZZg -pznzFTnE00yveWSTMrMwvfujrxrVDr9lVZBGqsQDxqZUsZzXgJ7SWAsoC5Io2M8N -mHewD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9RGZwXgUb +PhEZESBG/USLY5U8/x/UeMj9xRbBOQzC27N4AILv1Dz3LUS3sUQ7iKgCxUpV8Ncp +cpzohudPgt15ZBvpMprCYOrsN9rJGPnxc2Ojjl/F7qFcRUzmum+Vcx5t5Aj1Eyjs +kibQJfdAdohLlL6gekQdApvnZA/iMHEIusLrH2Q1QfTsXbX7rdxAhTO2S3j33Ale +JiGvUb9YA6o3myPUR2JrYPij9gyOdbjVhzWI52FflvQ= diff --git a/cloud/container/nginx-pwa/conf/entrypoint.d/30-envsubst-on-config-js.sh b/cloud/container/nginx-pwa/conf/entrypoint.d/30-envsubst-on-config-js.sh index 9a2abd5dc..228c52d89 100755 --- a/cloud/container/nginx-pwa/conf/entrypoint.d/30-envsubst-on-config-js.sh +++ b/cloud/container/nginx-pwa/conf/entrypoint.d/30-envsubst-on-config-js.sh @@ -15,7 +15,8 @@ config_js_envsubst() { return 0 fi echo >&3 "$ME: Running envsubst on $config_js_path" - envsubst "$defined_envs" < "$config_js_path" > "$config_js_path" + envsubst "$defined_envs" < "$config_js_path" > "${config_js_path}.tmp" + mv -f "${config_js_path}.tmp" "$config_js_path" } config_js_envsubst diff --git a/uniquely/com-api/src/index.ts b/uniquely/com-api/src/index.ts index da4671273..51cda2fa7 100644 --- a/uniquely/com-api/src/index.ts +++ b/uniquely/com-api/src/index.ts @@ -2,6 +2,7 @@ import {logger} from './lib/config.js'; import './route/home.js'; import './route/patch-price-list.js'; import './route/patch-product-list.js'; +import './route/patch-user.js'; import './route/put-order.js'; logger.logOther?.('..:: Alwatr Customer Order Management API ::..'); diff --git a/uniquely/com-api/src/route/patch-user.ts b/uniquely/com-api/src/route/patch-user.ts index 3080a6fc0..26310fdf0 100644 --- a/uniquely/com-api/src/route/patch-user.ts +++ b/uniquely/com-api/src/route/patch-user.ts @@ -29,13 +29,11 @@ nanoServer.route('PATCH', '/user-list/', async (connection) => { }; } - userStorage.set(user); - saveSeparateUserProfile(user); return { ok: true, - data: {}, + data: await userStorage.set(user), }; }); diff --git a/uniquely/com-api/src/route/put-order.ts b/uniquely/com-api/src/route/put-order.ts index fc1cdc087..ebfa71028 100644 --- a/uniquely/com-api/src/route/put-order.ts +++ b/uniquely/com-api/src/route/put-order.ts @@ -8,7 +8,6 @@ import type {Order} from '@alwatr/type/customer-order-management.js'; nanoServer.route('PUT', '/order/', async (connection) => { logger.logMethod?.('put-order'); - connection.requireToken(config.nanoServer.accessToken); const params = connection.requireQueryParams<{userId: string}>({userId: 'string'}); const remoteAddress = connection.getRemoteAddress(); const clientId = connection.requireClientId(); diff --git a/uniquely/com-pwa/src/manager/context-provider/order-storage.ts b/uniquely/com-pwa/src/manager/context-provider/order-storage.ts index 165118507..10dc041cd 100644 --- a/uniquely/com-pwa/src/manager/context-provider/order-storage.ts +++ b/uniquely/com-pwa/src/manager/context-provider/order-storage.ts @@ -8,10 +8,7 @@ import type {ComUser, Order} from '@alwatr/type/customer-order-management.js'; export const orderStorageContextConsumer = serverContextConsumer>( 'order_storage_context', - { - ...config.fetchContextOptions, - url: config.api + '/order-list/', - }, + config.fetchContextOptions, ); orderStorageContextConsumer.fsm.defineSignals([ @@ -19,9 +16,7 @@ orderStorageContextConsumer.fsm.defineSignals([ signalId: userProfileContextConsumer.id, callback: (user: ComUser): void => { orderStorageContextConsumer.request({ - queryParameters: { - userId: user.id, - }, + url: config.api + '/storage/order-list-' + user.id, }); }, receivePrevious: 'NextCycle', diff --git a/uniquely/com-pwa/src/manager/context-provider/price-storage.ts b/uniquely/com-pwa/src/manager/context-provider/price-storage.ts index 914f01769..294ec2b56 100644 --- a/uniquely/com-pwa/src/manager/context-provider/price-storage.ts +++ b/uniquely/com-pwa/src/manager/context-provider/price-storage.ts @@ -12,10 +12,7 @@ export const productPriceStorageContextConsumer = serverContextConsumer { export const signIn = (phoneNumber: number, token: string): void => { signInServerContext.request({ - url: `${config.api}/storage/${simpleHashNumber(phoneNumber)}-${token}`, + url: `${config.api}/storage/user/${simpleHashNumber(phoneNumber)}-${token}`, }); }; diff --git a/uniquely/com-pwa/src/ui/alwatr-pwa.ts b/uniquely/com-pwa/src/ui/alwatr-pwa.ts index 9c871054e..493b7c5b6 100644 --- a/uniquely/com-pwa/src/ui/alwatr-pwa.ts +++ b/uniquely/com-pwa/src/ui/alwatr-pwa.ts @@ -28,7 +28,7 @@ class AlwatrPwa extends AlwatrPwaElement { } protected override _routesConfig: RoutesConfig = { - routeId: (routeContext) => routeContext.sectionList[0]?.toString(), + routeId: (routeContext) => routeContext.sectionList[0]?.toString() ?? '', templates: { 'home': this._renderPageHome, '_404': this._renderPage404, diff --git a/uniquely/com-pwa/src/ui/page/order.ts b/uniquely/com-pwa/src/ui/page/order.ts index 35f138a8c..2e1f24872 100644 --- a/uniquely/com-pwa/src/ui/page/order.ts +++ b/uniquely/com-pwa/src/ui/page/order.ts @@ -344,9 +344,12 @@ export class AlwatrPageNewOrder extends UnresolvedMixin(LocalizeMixin(SignalMixi return html` - - ${message('retry')} - +
+ ${message('retry')} + +
`; }