cloudcommerce 0.4.1 → 0.5.0

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.
Files changed (86) hide show
  1. package/.github/renovate.json +1 -1
  2. package/CHANGELOG.md +25 -0
  3. package/action.yml +1 -2
  4. package/package.json +7 -7
  5. package/packages/api/package.json +1 -1
  6. package/packages/apps/correios/package.json +1 -1
  7. package/packages/apps/custom-payment/package.json +1 -1
  8. package/packages/apps/custom-shipping/package.json +1 -1
  9. package/packages/apps/datafrete/package.json +1 -1
  10. package/packages/apps/discounts/package.json +1 -1
  11. package/packages/apps/emails/package.json +1 -1
  12. package/packages/apps/fb-conversions/package.json +1 -1
  13. package/packages/apps/frenet/package.json +1 -1
  14. package/packages/apps/galaxpay/package.json +1 -1
  15. package/packages/apps/google-analytics/package.json +1 -1
  16. package/packages/apps/infinitepay/package.json +1 -1
  17. package/packages/apps/jadlog/package.json +1 -1
  18. package/packages/apps/loyalty-points/package.json +1 -1
  19. package/packages/apps/melhor-envio/package.json +1 -1
  20. package/packages/apps/mercadopago/package.json +1 -1
  21. package/packages/apps/pagarme/package.json +2 -2
  22. package/packages/apps/paghiper/package.json +1 -1
  23. package/packages/apps/pix/package.json +1 -1
  24. package/packages/apps/tiny-erp/package.json +1 -1
  25. package/packages/apps/webhooks/package.json +3 -3
  26. package/packages/cli/package.json +1 -1
  27. package/packages/config/package.json +1 -1
  28. package/packages/emails/package.json +1 -1
  29. package/packages/events/package.json +1 -1
  30. package/packages/firebase/package.json +1 -1
  31. package/packages/i18n/package.json +1 -1
  32. package/packages/modules/lib/firebase/checkout.js +4 -1
  33. package/packages/modules/lib/firebase/checkout.js.map +1 -1
  34. package/packages/modules/package.json +1 -1
  35. package/packages/modules/src/firebase/checkout.ts +4 -1
  36. package/packages/passport/package.json +1 -1
  37. package/packages/ssr/package.json +3 -3
  38. package/packages/storefront/config/storefront.cms.cjs +31 -5
  39. package/packages/storefront/config/storefront.cms.mjs +31 -5
  40. package/packages/storefront/dist/client/_astro/PitchBar.df2672ff.js +1 -0
  41. package/packages/storefront/dist/client/_astro/Prices.99fa99bf.js +1 -0
  42. package/packages/storefront/dist/client/_astro/ProductCard.a322c854.js +1 -0
  43. package/packages/storefront/dist/client/_astro/ShopHeader.abd6dec6.js +1 -0
  44. package/packages/storefront/dist/client/_astro/_...slug_.648728f3.css +1 -0
  45. package/packages/storefront/dist/client/_astro/{runtime-core.esm-bundler.a0432a8e.js → _plugin-vue_export-helper.e6f0b936.js} +1 -1
  46. package/packages/storefront/dist/client/_astro/client.e6b58b55.js +1 -0
  47. package/packages/storefront/dist/client/_astro/index.5dd878ac.js +1 -0
  48. package/packages/storefront/dist/client/_astro/modules-info.e8935203.js +1 -0
  49. package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.e8b26f2c.js +1 -0
  50. package/packages/storefront/dist/client/fallback/index.html +8 -8
  51. package/packages/storefront/dist/client/sw.js +1 -1
  52. package/packages/storefront/dist/server/chunks/{astro.0f5b754a.mjs → astro.7d9d5f6e.mjs} +100 -38
  53. package/packages/storefront/dist/server/chunks/pages/{all.671e6bc1.mjs → all.ba8f4b85.mjs} +766 -660
  54. package/packages/storefront/dist/server/chunks/{prerender.fd8cdc24.mjs → prerender.8cd4ad42.mjs} +0 -0
  55. package/packages/storefront/dist/server/entry.mjs +98 -46
  56. package/packages/storefront/package.json +8 -8
  57. package/packages/storefront/src/lib/assets/base.css +6 -0
  58. package/packages/storefront/src/lib/cms.d.ts +25 -0
  59. package/packages/storefront/src/lib/components/Drawer.vue +1 -1
  60. package/packages/storefront/src/lib/composables/use-shop-header.ts +79 -0
  61. package/packages/storefront/src/lib/layouts/Base.astro +4 -5
  62. package/packages/storefront/src/lib/layouts/BaseHead.astro +7 -7
  63. package/packages/storefront/src/lib/layouts/PagesHeader.astro +5 -23
  64. package/packages/storefront/src/lib/ssr-context.ts +3 -4
  65. package/packages/storefront/src/lib/state/modules-info.ts +1 -1
  66. package/packages/storefront/tailwind.config.cjs +0 -4
  67. package/packages/types/index.ts +7 -0
  68. package/packages/types/package.json +1 -1
  69. package/pnpm-workspace.yaml +3 -3
  70. package/packages/storefront/dist/client/_astro/PitchBar.004b6ea4.js +0 -1
  71. package/packages/storefront/dist/client/_astro/Prices.f311909a.js +0 -1
  72. package/packages/storefront/dist/client/_astro/Prices.vue_vue_type_script_setup_true_lang.ef47de70.js +0 -1
  73. package/packages/storefront/dist/client/_astro/ProductCard.34de5097.js +0 -1
  74. package/packages/storefront/dist/client/_astro/ShopHeader.cbfee289.js +0 -1
  75. package/packages/storefront/dist/client/_astro/_...slug_.bcc33d9d.css +0 -1
  76. package/packages/storefront/dist/client/_astro/client.56d86c9b.js +0 -1
  77. package/packages/storefront/dist/client/_astro/index.2d12be6c.js +0 -1
  78. package/packages/storefront/dist/client/_astro/modules-info.0debb0b0.js +0 -1
  79. package/packages/storefront/dist/client/_astro/runtime-dom.esm-bundler.0e5774ce.js +0 -1
  80. package/packages/storefront/src/lib/components/ShopHeader.vue +0 -111
  81. package/packages/storefront/src/lib/components/ShopSidenav.vue +0 -26
  82. package/packages/storefront/src/lib/types/cms-code.d.ts +0 -5
  83. package/packages/storefront/src/lib/types/cms-contacts.d.ts +0 -5
  84. package/packages/storefront/src/lib/types/cms-header.d.ts +0 -5
  85. package/packages/storefront/src/lib/types/cms-settings.d.ts +0 -8
  86. package/packages/storefront/src/lib/types/cms-social.d.ts +0 -5
@@ -9,5 +9,5 @@
9
9
  "dependencies"
10
10
  ],
11
11
  "dependencyDashboard": false,
12
- "ignoreDeps": ["node", "pnpm"]
12
+ "ignoreDeps": ["node", "pnpm", "turbo"]
13
13
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [0.5.0](https://github.com/ecomplus/cloud-commerce/compare/v0.4.1...v0.5.0) (2023-02-16)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * **storefront:** `cms` function is no more always sync
11
+
12
+ ### Features
13
+
14
+ * **storefront:** Return `categoryTrees` and getters on `useShopHeader` ([b19cc85](https://github.com/ecomplus/cloud-commerce/commit/b19cc85c7b82c26ea09da17035830abd01331101))
15
+ * **storefront:** Starting new `useShopHeader` composable ([5b83e21](https://github.com/ecomplus/cloud-commerce/commit/5b83e21f9a0a2b2c1d540c46bc9e50bbd93f2bbd))
16
+ * **storefront:** Update `cms()` to return promise excepting to settings ([a4e011a](https://github.com/ecomplus/cloud-commerce/commit/a4e011aa649f591929181f442f1851a141057b67))
17
+ * **types:** Add social network links and Whatsapp number to `CmsSettings` (optionals) ([eeb7fb2](https://github.com/ecomplus/cloud-commerce/commit/eeb7fb2ee11a4f487e74fc6949f89344a43b43f9))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **deps:** Update all non-major dependencies ([#123](https://github.com/ecomplus/cloud-commerce/issues/123)) ([cb11bc0](https://github.com/ecomplus/cloud-commerce/commit/cb11bc0f6b336f06351252c6294d1ffe1a5c547b))
23
+ * **modules:** Limit `client_user_agent` from header to 355 chars ([9992da0](https://github.com/ecomplus/cloud-commerce/commit/9992da0fdd2d7ca4cdb89873f90fffa8f528dd86))
24
+ * **storefront:** Fix `Drawer` relative container height ([e939f91](https://github.com/ecomplus/cloud-commerce/commit/e939f91f4ad52b8e7e54614402b62dea91dd2878))
25
+ * **storefront:** Fix CMS result typedefs ([c56f09f](https://github.com/ecomplus/cloud-commerce/commit/c56f09fd3278813da9ef3a75f17aff03ba85b15e))
26
+ * **storefront:** Making content files optional excepting settings ([96ce212](https://github.com/ecomplus/cloud-commerce/commit/96ce212d0871363a7b1a196a000bc3160987a9fc))
27
+ * **storefront:** Prevent error throw on CMS collection list if dir not exists ([179e20d](https://github.com/ecomplus/cloud-commerce/commit/179e20dcaf8f64112ea92dbd12fbcba74f5a7c90))
28
+ * **storefront:** Update `PagesHeader` layout to import store src `ShopHeader` component ([6322160](https://github.com/ecomplus/cloud-commerce/commit/63221600b7ab25e7dd5f9f8d01d0a3bb32503c5a))
29
+
5
30
  ### [0.4.1](https://github.com/ecomplus/cloud-commerce/compare/v0.4.0...v0.4.1) (2023-02-09)
6
31
 
7
32
 
package/action.yml CHANGED
@@ -48,7 +48,7 @@ runs:
48
48
  steps:
49
49
  - uses: actions/setup-node@v3
50
50
  with:
51
- node-version: 16
51
+ node-version: 18
52
52
  cache: 'npm'
53
53
  cache-dependency-path: '**/package-lock.json'
54
54
 
@@ -92,7 +92,6 @@ runs:
92
92
  GALAXPAY_PARTNER_ID: ${{ inputs.galaxpay-partner-id }}
93
93
  GALAXPAY_PARTNER_HASH: ${{ inputs.galaxpay-partner-hash }}
94
94
  DATAFRETE_OPERATOR_TOKEN: ${{ inputs.datafrete-operator-token }}
95
-
96
95
  run: |
97
96
  export GAC_FILENAME=".gac-$RANDOM.json"
98
97
  echo $FIREBASE_SERVICE_ACCOUNT > $GAC_FILENAME
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
6
6
  "main": "packages/api/lib/index.js",
7
7
  "author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
@@ -19,18 +19,18 @@
19
19
  "@commitlint/cli": "^17.4.2",
20
20
  "@commitlint/config-conventional": "^17.4.2",
21
21
  "@commitlint/rules": "^17.4.2",
22
- "@types/node": "^18.11.19",
23
- "@typescript-eslint/eslint-plugin": "^5.50.0",
24
- "@typescript-eslint/parser": "^5.50.0",
25
- "esbuild": "^0.17.5",
26
- "eslint": "^8.33.0",
22
+ "@types/node": "^18.13.0",
23
+ "@typescript-eslint/eslint-plugin": "^5.51.0",
24
+ "@typescript-eslint/parser": "^5.51.0",
25
+ "esbuild": "^0.17.8",
26
+ "eslint": "^8.34.0",
27
27
  "eslint-config-airbnb-base": "^15.0.0",
28
28
  "eslint-plugin-import": "^2.27.5",
29
29
  "eslint-plugin-vue": "^9.9.0",
30
30
  "husky": "^8.0.3",
31
31
  "standard-version": "^9.5.0",
32
32
  "ts-node": "^10.9.1",
33
- "turbo": "1.6.x || ^1.8.0",
33
+ "turbo": "1.6.3",
34
34
  "typescript": "^4.9.5",
35
35
  "uglify-js": "^3.17.4",
36
36
  "vite": "^4.1.1",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce APIs client/adapter",
6
6
  "main": "lib/api.js",
7
7
  "types": "lib/api.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-correios",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for Correios shipping calculation",
6
6
  "main": "lib/correios.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-custom-payment",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for simple custom payment methods",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-custom-shipping",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for custom shipping methods",
6
6
  "main": "lib/custom-shipping.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-datafrete",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Datafrete shipping gateway ",
6
6
  "main": "lib/datafrete.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-discounts",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for complex discount rules",
6
6
  "main": "lib/discounts.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-emails",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce default transactional email app",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-fb-conversions",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to send carts/orders to Facebook Conversions API",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-frenet",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for Frenet shipping calculation",
6
6
  "main": "lib/frenet.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-galaxpay",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Galax Pay for recurring payments",
6
6
  "main": "lib/galaxpay.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-google-analytics",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to send carts/orders events to GA Measurement Protocol",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-infinitepay",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate InfinitePay",
6
6
  "main": "lib/infinitepay.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-jadlog",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for Jadlog shipping calculation",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-loyalty-points",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to handle simple loyalty points programs",
6
6
  "main": "lib/loyalty-points.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-melhor-envio",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Melhor Envio",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-mercadopago",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Mercado Pago",
6
6
  "main": "lib/mercadopago.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pagarme",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pagar.me",
6
6
  "main": "lib/pagarme.js",
7
7
  "exports": {
@@ -28,7 +28,7 @@
28
28
  "axios": "^1.3.2",
29
29
  "firebase-admin": "^11.5.0",
30
30
  "firebase-functions": "^4.2.1",
31
- "pagarme": "^4.29.0",
31
+ "pagarme": "^4.30.0",
32
32
  "qs": "^6.11.0"
33
33
  },
34
34
  "devDependencies": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-paghiper",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate PagHiper",
6
6
  "main": "lib/paghiper.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pix",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pix API (Bacen)",
6
6
  "main": "lib/pix.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-tiny-erp",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for Tiny ERP",
6
6
  "main": "lib/tiny-erp.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-webhooks",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app for general order webhooks",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@cloudcommerce/api": "workspace:*",
23
23
  "@cloudcommerce/firebase": "workspace:*",
24
- "axios": "^1.2.6",
24
+ "axios": "^1.3.2",
25
25
  "firebase-admin": "^11.5.0",
26
- "firebase-functions": "^4.2.0"
26
+ "firebase-functions": "^4.2.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@cloudcommerce/types": "workspace:*",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce CLI tools",
6
6
  "bin": {
7
7
  "cloudcommerce": "./bin/run.mjs"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/config",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce base config",
6
6
  "main": "lib/config.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/emails",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/events",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce app events",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/i18n",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce i18n",
6
6
  "main": "lib/all.js",
7
7
  "exports": {
@@ -18,7 +18,10 @@ export default async (req, res) => {
18
18
  const validate = ajv.compile(checkoutSchema.params);
19
19
  const checkoutBody = req.body;
20
20
  req.body.client_ip = req.ip;
21
- req.body.client_user_agent = req.get('user-agent') || '';
21
+ const userAgent = req.get('user-agent');
22
+ req.body.client_user_agent = userAgent === 'string'
23
+ ? userAgent.substring(0, 255)
24
+ : '';
22
25
  if (!validate(checkoutBody)) {
23
26
  return sendRequestError(res, '@checkout', validate.errors);
24
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../src/firebase/checkout.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C"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/modules",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce modules API",
6
6
  "main": "lib/index.cjs",
7
7
  "exports": {
@@ -33,7 +33,10 @@ export default async (req: Request, res: Response) => {
33
33
  const validate = ajv.compile(checkoutSchema.params);
34
34
  const checkoutBody = req.body as CheckoutBody;
35
35
  req.body.client_ip = req.ip;
36
- req.body.client_user_agent = req.get('user-agent') || '';
36
+ const userAgent = req.get('user-agent');
37
+ req.body.client_user_agent = userAgent === 'string'
38
+ ? userAgent.substring(0, 255)
39
+ : '';
37
40
  if (!validate(checkoutBody)) {
38
41
  return sendRequestError(res, '@checkout', validate.errors);
39
42
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/passport",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/ssr",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.5.0",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -23,7 +23,7 @@
23
23
  "build": "sh ../../scripts/build-lib.sh"
24
24
  },
25
25
  "dependencies": {
26
- "@astrojs/image": "^0.14.0",
26
+ "@astrojs/image": "^0.14.1",
27
27
  "@astrojs/node": "^5.0.3",
28
28
  "@cloudcommerce/api": "workspace:*",
29
29
  "@cloudcommerce/firebase": "workspace:*",
@@ -31,7 +31,7 @@
31
31
  "@ecomplus/utils": "1.5.0-rc.3",
32
32
  "@headlessui/vue": "^1.7.9",
33
33
  "@vueuse/core": "^9.12.0",
34
- "astro": "^2.0.6",
34
+ "astro": "^2.0.10",
35
35
  "firebase-admin": "^11.5.0",
36
36
  "firebase-functions": "^4.2.1",
37
37
  "image-size": "^1.0.2",
@@ -13,12 +13,38 @@ module.exports = () => {
13
13
  const dirContent = resolvePath(baseDir, 'content');
14
14
 
15
15
  const cms = (filename) => {
16
- if (filename.endsWith('/')) {
17
- const dirColl = resolvePath(dirContent, filename);
18
- return fs.readdirSync(dirColl).map((_filename) => _filename.replace('.json', ''));
16
+ // MUST be sync for 'settings'
17
+ // Async with other content to support external CMS integration
18
+ const loadLocal = () => {
19
+ if (filename.endsWith('/')) {
20
+ const dirColl = resolvePath(dirContent, filename);
21
+ return new Promise((resolve) => {
22
+ const slugs = fs.existsSync(dirColl)
23
+ ? fs.readdirSync(dirColl).map((file) => file.replace('.json', ''))
24
+ : [];
25
+ resolve(slugs);
26
+ });
27
+ }
28
+ const filepath = resolvePath(dirContent, `${filename}.json`);
29
+ const content = fs.existsSync(filepath)
30
+ ? JSON.parse(fs.readFileSync(filepath, 'utf8'))
31
+ : null;
32
+ return filename === 'settings'
33
+ ? content
34
+ : new Promise((resolve) => { resolve(content); });
35
+ };
36
+ const handler = globalThis.storefront_cms_handler;
37
+ if (typeof handler === 'function') {
38
+ try {
39
+ const content = handler({ dirContent, filename, loadLocal });
40
+ if (content) {
41
+ return content;
42
+ }
43
+ } catch {
44
+ //
45
+ }
19
46
  }
20
- const filepath = resolvePath(dirContent, `${filename}.json`);
21
- return JSON.parse(fs.readFileSync(filepath, 'utf8'));
47
+ return loadLocal();
22
48
  };
23
49
 
24
50
  let settings;
@@ -13,12 +13,38 @@ export default () => {
13
13
  const dirContent = resolvePath(baseDir, 'content');
14
14
 
15
15
  const cms = (filename) => {
16
- if (filename.endsWith('/')) {
17
- const dirColl = resolvePath(dirContent, filename);
18
- return fs.readdirSync(dirColl).map((_filename) => _filename.replace('.json', ''));
16
+ // MUST be sync for 'settings'
17
+ // Async with other content to support external CMS integration
18
+ const loadLocal = () => {
19
+ if (filename.endsWith('/')) {
20
+ const dirColl = resolvePath(dirContent, filename);
21
+ return new Promise((resolve) => {
22
+ const slugs = fs.existsSync(dirColl)
23
+ ? fs.readdirSync(dirColl).map((file) => file.replace('.json', ''))
24
+ : [];
25
+ resolve(slugs);
26
+ });
27
+ }
28
+ const filepath = resolvePath(dirContent, `${filename}.json`);
29
+ const content = fs.existsSync(filepath)
30
+ ? JSON.parse(fs.readFileSync(filepath, 'utf8'))
31
+ : null;
32
+ return filename === 'settings'
33
+ ? content
34
+ : new Promise((resolve) => { resolve(content); });
35
+ };
36
+ const handler = globalThis.storefront_cms_handler;
37
+ if (typeof handler === 'function') {
38
+ try {
39
+ const content = handler({ dirContent, filename, loadLocal });
40
+ if (content) {
41
+ return content;
42
+ }
43
+ } catch {
44
+ //
45
+ }
19
46
  }
20
- const filepath = resolvePath(dirContent, `${filename}.json`);
21
- return JSON.parse(fs.readFileSync(filepath, 'utf8'));
47
+ return loadLocal();
22
48
  };
23
49
 
24
50
  let settings;
@@ -0,0 +1 @@
1
+ import{v as G}from"./runtime-dom.esm-bundler.e8b26f2c.js";import{p as J}from"./modules-info.e8935203.js";import{c as g,d as z,_ as R,l as Q,o as u,a as p,m as x,e as I,n as D,i as d,p as b,q as O,s as X,u as Y,v as Z,x as ee,j as $,w as h,k as q,g as C,y as te,z as ae,A as oe,F as ne,B as re,b as se}from"./_plugin-vue_export-helper.e6f0b936.js";import{u as le,a as ie,b as ue}from"./index.5dd878ac.js";/* empty css */import"./session-utm.72684b84.js";import"./ecom-utils.92f137f6.js";const ce=o=>{const r=g(()=>o.slides.map(({html:e})=>J(e).value)),a=g(()=>r.value.filter(e=>e).length);return{parsedContents:r,countValidSlides:a}},K=Symbol("carousel"),de=z({__name:"CarouselControl",props:{direction:{default:1}},setup(o,{expose:r}){r();const{changeSlide:a}=Q(K),e={changeSlide:a};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}}),fe=["aria-label","data-carousel-control"];function pe(o,r,a,e,s,n){return u(),p("button",{type:"button","aria-label":a.direction>0?"Próximo":"Anterior",onClick:r[0]||(r[0]=i=>e.changeSlide(a.direction)),"data-carousel-control":a.direction>0?"next":"previous"},[x(o.$slots,"default",{},()=>[I("i",{class:D(["m-0",a.direction>0?"i-chevron-right":"i-chevron-left"])},null,2)])],8,fe)}const U=R(de,[["render",pe]]),he=z({__name:"Carousel",props:{as:{default:"ul"},modelValue:{default:1},autoplay:null},emits:["update:modelValue"],setup(o,{expose:r,emit:a}){r();const e=o,s=d(e.modelValue-1);b(O(e,"modelValue"),t=>{s.value=t-1}),b(s,(t,l)=>{t!==l&&a("update:modelValue",t+1)});const n=d(null),{x:i,isScrolling:f,arrivedState:S}=le(n),y=g(()=>S.left),w=g(()=>S.right),m=d([]),B=d(0),P=d(0),V=d(0),j=()=>{B.value=n.value.scrollWidth,P.value=n.value.offsetWidth},A=()=>{const t=[...n.value.children];m.value=t.map(l=>({offsetLeft:l.offsetLeft,width:l.offsetWidth}))},E=t=>{const l=t>0?s.value:s.value+t,M=m.value[l]?.width||0;return M?M*t:0},L=()=>{const t=m.value.findIndex(l=>Math.abs(l.offsetLeft-i.value)<=5);t>-1&&(s.value=t||0)},T=()=>{const t=B.value-P.value;V.value=m.value.findIndex(({offsetLeft:l})=>l>=t-5)};let c=null;const v=()=>{e.autoplay&&(clearTimeout(c),c=setTimeout(()=>{_(1)},e.autoplay))},_=t=>{if(t<0){if(y.value){T(),s.value=V.value-1,_(1);return}}else if(w.value){s.value=1,_(-1);return}const l=E(t);l&&(n.value.scrollBy({left:l,behavior:"smooth"}),v())};b(f,t=>{t?clearTimeout(c):(L(),v())});const N=d(null),F=ie(N);b(F,t=>{t?clearTimeout(c):v()});const W=()=>{n.value&&(j(),A(),L(),T())},k=ue(W,400);X(()=>{W(),Y(()=>{[...n.value.children].forEach(t=>{t.setAttribute("tabindex","0")})}),v(),window.addEventListener("resize",k)}),Z(()=>{window.removeEventListener("resize",k),clearTimeout(c)}),ee(K,{autoplay:O(e,"autoplay"),changeSlide:_,isBoundLeft:y,isBoundRight:w});const H={props:e,emit:a,currentIndex:s,wrapper:n,currentPos:i,isScrolling:f,arrivedState:S,isBoundLeft:y,isBoundRight:w,slidesWidth:m,wrapperScrollWidth:B,wrapperVisibleWidth:P,indexCount:V,calcWrapperWidth:j,calcSlidesWidth:A,calcNextWidth:E,calcCurrentIndex:L,calcIndexCount:T,get autoplayTimer(){return c},set autoplayTimer(t){c=t},restartAutoplay:v,changeSlide:_,carousel:N,isHovered:F,calcOnInit:W,onResize:k,CarouselControl:U};return Object.defineProperty(H,"__isScriptSetup",{enumerable:!1,value:!0}),H}}),me={ref:"carousel","data-carousel":""};function ve(o,r,a,e,s,n){return u(),p("div",me,[(u(),$(q(a.as),{ref:"wrapper","data-carousel-wrapper":""},{default:h(()=>[x(o.$slots,"default")]),_:3},512)),x(o.$slots,"controls",te(ae({changeSlide:e.changeSlide,isBoundLeft:e.isBoundLeft,isBoundRight:e.isBoundRight,currentPage:e.currentIndex+1,pageCount:e.indexCount+1})),()=>[C(e.CarouselControl,{direction:-1},{default:h(()=>[x(o.$slots,"previous")]),_:3}),C(e.CarouselControl,null,{default:h(()=>[x(o.$slots,"next")]),_:3})])],512)}const _e=R(he,[["render",ve]]),xe=z({__name:"PitchBar",props:{slides:null},setup(o,{expose:r}){r();const a=o,{parsedContents:e,countValidSlides:s}=ce(a),n={props:a,parsedContents:e,countValidSlides:s,Carousel:_e,CarouselControl:U};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),Ce={class:"bg-base-100 relative z-1"},be={class:"container md:w-2/3 mx-auto px-3 py-1"},ge=["innerHTML"],Se={class:"text-xl leading-none text-base-400"};function ye(o,r,a,e,s,n){return u(),p("div",Ce,[I("div",be,[C(e.Carousel,{autoplay:e.countValidSlides>1?7e3:null},{controls:h(()=>[oe(I("div",Se,[C(e.CarouselControl,{direction:-1,class:"pr-2 bg-base-100 hover:text-base-700"}),C(e.CarouselControl,{class:"pl-2 bg-base-100 hover:text-base-700"})],512),[[G,e.countValidSlides>1]])]),default:h(()=>[(u(!0),p(ne,null,re(a.slides,(i,f)=>(u(),p("li",{key:f},[(u(),$(q(i.href?"ALink":"span"),{href:i.href,target:i.target,class:D(["inline-block px-8",i.href?"hover:underline":null])},{default:h(()=>[e.parsedContents[f]?(u(),p("span",{key:0,innerHTML:e.parsedContents[f],class:"prose text-sm text-base-800"},null,8,ge)):se("",!0)]),_:2},1032,["href","target","class"]))]))),128))]),_:1},8,["autoplay"])])])}const ke=R(xe,[["render",ye]]);export{ke as default};
@@ -0,0 +1 @@
1
+ import{m as k}from"./modules-info.e8935203.js";import{g,c as S}from"./ecom-utils.92f137f6.js";import{c as a,d as M,_ as T,a as i,t as o,b as u,e as h,f as C,n as I,g as L,w as D,r as z,o as l}from"./_plugin-vue_export-helper.e6f0b936.js";/* empty css */import"./session-utm.72684b84.js";const j=(n,c)=>{const{type:s,value:t}=c;let r;return t?(s==="percentage"?r=n*((100-t)/100):r=n-t,r>0?r:0):n},E=n=>{const c=a(()=>n.product||{price:n.price||0,base_price:n.basePrice}),s=a(()=>{const{variations:e}=c.value;if(e){const d=g(c.value);for(let v=0;v<e.length;v++)if(g({...c.value,...e[v]})>d)return!0}return!1}),t=a(()=>k.apply_discount.available_extra_discount),r=a(()=>{const e=g(c.value),d=t.value;return d&&(!d.min_amount||e>d.min_amount)?j(e,d):e}),f=a(()=>{if(S(c.value))return c.value.base_price;const e=g(c.value);return e>r.value?e:0}),m=a(()=>n.installmentsOption||k.list_payments.installments_option||{max_number:1}),b=a(()=>{if(m.value.max_number<=1)return 1;const e=m.value.min_installment||5,d=Math.round(r.value/e);return Math.min(d,m.value.max_number)}),y=a(()=>m.value.monthly_interest||0),V=a(()=>{if(b.value>=2){if(!y.value)return r.value/b.value;const e=y.value/100;return r.value*e/(1-(1+e)**-b.value)}return 0}),p=a(()=>{const e=n.discountOption||k.list_payments.discount_option;return e&&(!e.min_amount||e.min_amount<=r.value)&&(!n.isAmountTotal||e.apply_at==="total")?e:{}}),x=a(()=>{const{label:e}=p.value;return e?e.includes(" ")?e:`via ${e}`:""}),O=a(()=>j(r.value,p.value)),_=a(()=>{if(n.loyaltyPointsProgram)return n.loyaltyPointsProgram;const e=k.list_payments.loyalty_points_programs;if(e){const d=Object.keys(e);for(let v=0;v<d.length;v++){const P=e[d[v]];if(P&&P.earn_percentage>0)return P}}return{ratio:0}}),W=a(()=>_.value.min_subtotal_to_earn||0),w=a(()=>_.value.name||""),N=a(()=>_.value.earn_percentage||0),B=a(()=>N.value*_.value.ratio),A=a(()=>B.value>=1?r.value*(B.value/100):0);return{hasVariedPrices:s,salePrice:r,comparePrice:f,installmentsObject:m,installmentsNumber:b,monthlyInterest:y,installmentValue:V,discountObject:p,discountLabel:x,priceWithDiscount:O,pointsProgramObject:_,pointsMinPrice:W,pointsProgramName:w,earnPointsPercentage:N,cashbackPercentage:B,cashbackValue:A}},F=M({__name:"Prices",props:{product:null,price:null,basePrice:null,isAmountTotal:{type:Boolean},installmentsOption:null,discountOption:null,isBig:{type:Boolean},isLiteral:{type:Boolean},hasCashback:{type:Boolean,default:!0},hasPriceOptions:{type:Boolean,default:!0}},setup(n,{expose:c}){c();const s=n,{hasVariedPrices:t,salePrice:r,comparePrice:f,cashbackPercentage:m,cashbackValue:b,installmentsNumber:y,monthlyInterest:V,installmentValue:p,priceWithDiscount:x,discountLabel:O}=E(s),_={props:s,hasVariedPrices:t,salePrice:r,comparePrice:f,cashbackPercentage:m,cashbackValue:b,installmentsNumber:y,monthlyInterest:V,installmentValue:p,priceWithDiscount:x,discountLabel:O};return Object.defineProperty(_,"__isScriptSetup",{enumerable:!1,value:!0}),_}}),R={key:0,class:"text-base-500 mr-1"},q={key:0},G={key:1},H={key:0},J={key:0,class:"relative z-10"},K=["data-tooltip"],Q=h("i",{class:"i-cashback mr-1"},null,-1),U={class:"font-medium"},X=h("small",null," cashback",-1),Y={key:0},Z={key:0},$={key:1},ee={key:2},te={key:0},ne={key:0},ae={key:1};function se(n,c,s,t,r,f){const m=z("Fade");return l(),i("div",{class:I(["text-base-600",s.isBig?"text-lg":null]),"data-prices":""},[t.comparePrice?(l(),i("span",R,[s.isLiteral?(l(),i("small",q,o("De "))):u("",!0),h("s",null,o(n.$money(t.comparePrice)),1),s.isLiteral?(l(),i("small",G,o(" Por"))):u("",!0)])):u("",!0),h("strong",{class:I(["inline-block text-base-800",s.isBig?"text-5xl block":null])},[t.hasVariedPrices?(l(),i("small",H,o("A partir de "))):u("",!0),C(" "+o(n.$money(t.salePrice)),1)],2),L(m,{slide:"down"},{default:D(()=>[t.cashbackValue&&s.hasCashback?(l(),i("div",J,[h("span",{"data-tooltip":"Receba $1 de volta".replace("$1",n.$percentage(t.cashbackPercentage))},[Q,h("span",U,o(n.$money(t.cashbackValue)),1),X],8,K)])):u("",!0)]),_:1}),L(m,{slide:"down"},{default:D(()=>[t.installmentValue&&s.hasPriceOptions?(l(),i("div",Y,[s.isLiteral?(l(),i("small",Z,o("Até "))):u("",!0),C(" "+o(t.installmentsNumber)+"x ",1),s.isLiteral?(l(),i("small",$,o(" De "))):u("",!0),h("span",null,o(n.$money(t.installmentValue)),1),!t.monthlyInterest&&s.isLiteral?(l(),i("small",ee,o("Sem juros"))):u("",!0)])):u("",!0)]),_:1}),L(m,{slide:"down"},{default:D(()=>[t.priceWithDiscount<t.salePrice&&s.hasPriceOptions?(l(),i("div",te,[t.discountLabel?u("",!0):(l(),i("small",ne,o("A partir de "))),h("span",null,o(n.$money(t.priceWithDiscount)),1),t.discountLabel?(l(),i("small",ae,o(` ${t.discountLabel}`),1)):u("",!0)])):u("",!0)]),_:1})],2)}const ue=T(F,[["render",se]]);export{ue as default};
@@ -0,0 +1 @@
1
+ import d from"./Prices.99fa99bf.js";import{d as _,_ as u,i as o,j as f,w as t,k as m,o as P,g as r,f as n,t as l}from"./_plugin-vue_export-helper.e6f0b936.js";import"./modules-info.e8935203.js";import"./session-utm.72684b84.js";import"./ecom-utils.92f137f6.js";/* empty css */const b=_({__name:"ProductCard",props:{as:{default:"div"}},setup(p,{expose:s}){s();const i=o(12),e=o(!1);setTimeout(()=>{i.value=8,e.value=!0},5e3);const c={price:i,isBig:e,Prices:d};return Object.defineProperty(c,"__isScriptSetup",{enumerable:!1,value:!0}),c}});function g(p,s,i,e,c,v){return P(),f(m(i.as),null,{default:t(()=>[r(e.Prices,null,{default:t(({salePrice:a})=>[n(" ProductCard "+l(a),1)]),_:1}),r(e.Prices,{product:{price:e.price}},null,8,["product"]),r(e.Prices,{price:12,"base-price":17}),r(e.Prices,{price:12,"base-price":16,"is-literal":!0}),r(e.Prices,{price:12,"is-big":e.isBig},null,8,["is-big"]),r(e.Prices,{price:14,"base-price":18,"is-big":e.isBig,"is-literal":!0},null,8,["is-big"]),r(e.Prices,{price:12,"base-price":16},{"compare-value":t(({comparePrice:a})=>[n(" x"+l(a),1)]),_:1})]),_:1})}const h=u(b,[["render",g]]);export{h as default};