cloudcommerce 0.0.103 → 0.0.104

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
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.0.104](https://github.com/ecomplus/cloud-commerce/compare/v0.0.103...v0.0.104) (2022-09-28)
6
+
5
7
  ### [0.0.103](https://github.com/ecomplus/cloud-commerce/compare/v0.0.102...v0.0.103) (2022-09-27)
6
8
 
7
9
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
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>",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
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.0.103",
4
+ "version": "0.0.104",
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-shipping",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
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-discounts",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
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-frenet",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
5
5
  "description": "E-Com Plus Cloud Commerce app for Frenet shipping calculation",
6
6
  "main": "lib/frenet.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-tiny-erp",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
5
5
  "description": "E-Com Plus Cloud Commerce app for Tiny ERP",
6
6
  "main": "lib/tiny-erp.js",
7
7
  "repository": {
@@ -25,13 +25,13 @@
25
25
  "codebase": "passport"
26
26
  },
27
27
  {
28
- "predeploy": "npm --prefix \"$RESOURCE_DIR/storefront\" run build && npm run build -- --codebase ssr",
28
+ "predeploy": "npm --prefix \"$RESOURCE_DIR\" run build && npm run build -- --codebase ssr",
29
29
  "source": "functions/ssr",
30
30
  "codebase": "ssr"
31
31
  }
32
32
  ],
33
33
  "hosting": {
34
- "public": "functions/ssr/storefront/dist/client",
34
+ "public": "functions/ssr/dist/client",
35
35
  "ignore": [
36
36
  "firebase.json",
37
37
  "**/.*",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
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.0.103",
4
+ "version": "0.0.104",
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/events",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
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.0.103",
4
+ "version": "0.0.104",
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/modules",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
5
5
  "description": "E-Com Plus Cloud Commerce modules API",
6
6
  "main": "lib/index.cjs",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/passport",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
5
5
  "description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,9 +1,9 @@
1
- /* eslint-disable import/no-unresolved, import/first */
1
+ /* eslint-disable import/prefer-default-export, import/no-unresolved, import/first */
2
2
  import '@cloudcommerce/api/fetch-polyfill';
3
3
  import { initializeApp } from 'firebase-admin/app';
4
4
 
5
5
  initializeApp();
6
- import functions from 'firebase-functions';
6
+ import { onRequest } from 'firebase-functions/v2/https';
7
7
  import config from '@cloudcommerce/firebase/lib/config';
8
8
  import serveStorefront from './firebase/serve-storefront.js';
9
9
 
@@ -13,14 +13,12 @@ const {
13
13
  },
14
14
  } = config.get();
15
15
 
16
- // eslint-disable-next-line import/prefer-default-export
17
- export const ssr = functions
18
- .region(region)
19
- .runWith({
20
- timeoutSeconds: timeoutSeconds || 15,
21
- memory: memory ? memory.replace('i', '') : '256MB',
22
- minInstances: minInstances || 1,
23
- }).https.onRequest((req, res) => {
24
- serveStorefront(req, res);
25
- });
16
+ export const ssr = onRequest({
17
+ region,
18
+ timeoutSeconds: timeoutSeconds || 15,
19
+ memory: memory || '256MiB',
20
+ minInstances: minInstances || 1,
21
+ }, (req, res) => {
22
+ serveStorefront(req, res);
23
+ });
26
24
  // # sourceMappingURL=firebase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,aAAa,EAAE,CAAC;AAEhB,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAE1D,MAAM,EACJ,oBAAoB,EAAE,EACpB,MAAM,EACN,cAAc,EACd,MAAM,EACN,YAAY,GACb,GACF,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;AAEjB,wDAAwD;AACxD,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS;KACzB,MAAM,CAAC,MAAM,CAAC;KACd,OAAO,CAAC;IACP,cAAc,EAAE,cAAc,IAAI,EAAE;IACpC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAY,CAAC,CAAC,CAAC,OAAO;IAC7D,YAAY,EAAE,YAAY,IAAI,CAAC;CAChC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAC9B,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,aAAa,EAAE,CAAC;AAEhB,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAE1D,MAAM,EACJ,oBAAoB,EAAE,EACpB,MAAM,EACN,cAAc,EACd,MAAM,EACN,YAAY,GACb,GACF,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;AAEjB,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC;IAC3B,MAAM;IACN,cAAc,EAAE,cAAc,IAAI,EAAE;IACpC,MAAM,EAAE,MAAM,IAAI,QAAQ;IAC1B,YAAY,EAAE,YAAY,IAAI,CAAC;CAChC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACd,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/ssr",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -32,7 +32,6 @@
32
32
  "firebase-admin": "^11.0.1",
33
33
  "firebase-functions": "^3.24.0",
34
34
  "image-size": "^1.0.2",
35
- "path-to-regexp": "^6.2.1",
36
35
  "vue": "^3.2.39"
37
36
  },
38
37
  "devDependencies": {
@@ -1,10 +1,10 @@
1
- /* eslint-disable import/no-unresolved, import/first */
1
+ /* eslint-disable import/prefer-default-export, import/no-unresolved, import/first */
2
2
  import '@cloudcommerce/api/fetch-polyfill';
3
3
  import { initializeApp } from 'firebase-admin/app';
4
4
 
5
5
  initializeApp();
6
6
 
7
- import functions from 'firebase-functions';
7
+ import { onRequest } from 'firebase-functions/v2/https';
8
8
  import config from '@cloudcommerce/firebase/lib/config';
9
9
  import serveStorefront from './firebase/serve-storefront';
10
10
 
@@ -17,13 +17,11 @@ const {
17
17
  },
18
18
  } = config.get();
19
19
 
20
- // eslint-disable-next-line import/prefer-default-export
21
- export const ssr = functions
22
- .region(region)
23
- .runWith({
24
- timeoutSeconds: timeoutSeconds || 15,
25
- memory: memory ? memory.replace('i', '') as '256MB' : '256MB',
26
- minInstances: minInstances || 1,
27
- }).https.onRequest((req, res) => {
28
- serveStorefront(req, res);
29
- });
20
+ export const ssr = onRequest({
21
+ region,
22
+ timeoutSeconds: timeoutSeconds || 15,
23
+ memory: memory || '256MiB',
24
+ minInstances: minInstances || 1,
25
+ }, (req, res) => {
26
+ serveStorefront(req, res);
27
+ });
@@ -1713,6 +1713,7 @@ const loadPageContext = async (Astro, {
1713
1713
  cmsCollection,
1714
1714
  apiPrefetchEndpoints = globalThis.api_prefetch_endpoints
1715
1715
  } = {}) => {
1716
+ const startedAt = Date.now();
1716
1717
  const urlPath = Astro.url.pathname;
1717
1718
  const { slug } = Astro.params;
1718
1719
  const config = getConfig();
@@ -1768,6 +1769,7 @@ const loadPageContext = async (Astro, {
1768
1769
  <body></body>`;
1769
1770
  throw err;
1770
1771
  }
1772
+ Astro.response.headers.set("X-Load-Took", Date.now() - startedAt);
1771
1773
  if (urlPath === "/fallback") {
1772
1774
  setResponseCache(Astro, 3600, 86400);
1773
1775
  } else {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash
2
2
 
3
- rm -rf content && ln -s ../../store/functions/ssr/storefront/content content
4
- rm -rf public && ln -s ../../store/functions/ssr/storefront/public public
3
+ rm -rf content && ln -s ../../store/functions/ssr/content content
4
+ rm -rf public && ln -s ../../store/functions/ssr/public public
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash
2
2
 
3
- rm content && cp -r ../../store/functions/ssr/storefront/content ./
4
- rm public && cp -r ../../store/functions/ssr/storefront/public ./
3
+ rm content && cp -r ../../store/functions/ssr/content ./
4
+ rm public && cp -r ../../store/functions/ssr/public ./
@@ -48,6 +48,7 @@ const loadPageContext = async (Astro: AstroGlobal, {
48
48
  cmsCollection?: string;
49
49
  apiPrefetchEndpoints?: ApiPrefetchEndpoints;
50
50
  } = {}) => {
51
+ const startedAt = Date.now();
51
52
  const urlPath = Astro.url.pathname;
52
53
  const { slug } = Astro.params;
53
54
  const config = getConfig();
@@ -103,6 +104,7 @@ const loadPageContext = async (Astro: AstroGlobal, {
103
104
  <body></body>`;
104
105
  throw err;
105
106
  }
107
+ Astro.response.headers.set('X-Load-Took', Date.now() - startedAt);
106
108
  if (urlPath === '/fallback') {
107
109
  setResponseCache(Astro, 3600, 86400);
108
110
  } else {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "0.0.103",
4
+ "version": "0.0.104",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {