cloudcommerce 0.28.5 → 0.29.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.
- package/CHANGELOG.md +19 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/ecomplus-stores/monocard/functions/many/package.json +3 -3
- package/ecomplus-stores/monocard/functions/ssr/package.json +6 -6
- package/ecomplus-stores/monocard/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/monocard/package.json +2 -2
- package/package.json +2 -2
- package/packages/api/package.json +1 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/config/firebase.json +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +1 -1
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/lib/firebase/serve-modules-api.js +1 -1
- package/packages/modules/lib/firebase/serve-modules-api.js.map +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/modules/src/firebase/serve-modules-api.ts +1 -1
- package/packages/passport/lib/firebase/serve-passport-api.js +1 -1
- package/packages/passport/lib/firebase/serve-passport-api.js.map +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/passport/src/firebase/serve-passport-api.ts +1 -1
- package/packages/ssr/package.json +1 -1
- package/packages/storefront/config/astro/context-directive.mjs +14 -3
- package/packages/storefront/config/astro/index.d.ts +1 -1
- package/packages/storefront/config/storefront.config.mjs +0 -4
- package/packages/storefront/package.json +1 -1
- package/packages/storefront/src/lib/components/AccountLink.vue +2 -2
- package/packages/storefront/src/lib/state/customer-session.ts +1 -1
- package/packages/storefront/src/lib/state/modules-info.ts +1 -1
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
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.29.0](https://github.com/ecomplus/cloud-commerce/compare/v0.28.5...v0.29.0) (2023-10-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* Default modules and passport APIs URLs changed
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **storefront:** Update Astro `client:context` custom directive to accept "idle" value ([3ce1f3b](https://github.com/ecomplus/cloud-commerce/commit/3ce1f3b1e60feb3071eec0f5e36ece4af851a658))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **ssr:** Set default demoStore CDN assets prefix as done by storefront config ([5de0ac1](https://github.com/ecomplus/cloud-commerce/commit/5de0ac1c18e481317d2f10f4aad5d77ad80a5488)), closes [#L53-L55](https://github.com/ecomplus/cloud-commerce/issues/L53-L55)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* Moving modules and passport APIs to /_api/* routes ([eed3d73](https://github.com/ecomplus/cloud-commerce/commit/eed3d731257d06fa81a31ccdec8466f9c465d59b))
|
|
23
|
+
|
|
5
24
|
### [0.28.5](https://github.com/ecomplus/cloud-commerce/compare/v0.28.4...v0.28.5) (2023-10-17)
|
|
6
25
|
|
|
7
26
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/feeds": "^0.28.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
20
|
-
"@cloudcommerce/passport": "^0.28.
|
|
18
|
+
"@cloudcommerce/feeds": "^0.28.5",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.28.5",
|
|
20
|
+
"@cloudcommerce/passport": "^0.28.5"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cloudcommerce/api": "^0.28.
|
|
21
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
22
|
-
"@cloudcommerce/ssr": "^0.28.
|
|
20
|
+
"@cloudcommerce/api": "^0.28.5",
|
|
21
|
+
"@cloudcommerce/firebase": "^0.28.5",
|
|
22
|
+
"@cloudcommerce/ssr": "^0.28.5"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@cloudcommerce/i18n": "^0.28.
|
|
26
|
-
"@cloudcommerce/storefront": "^0.28.
|
|
27
|
-
"@cloudcommerce/types": "^0.28.
|
|
25
|
+
"@cloudcommerce/i18n": "^0.28.5",
|
|
26
|
+
"@cloudcommerce/storefront": "^0.28.5",
|
|
27
|
+
"@cloudcommerce/types": "^0.28.5",
|
|
28
28
|
"@fontsource/croissant-one": "^5.0.9",
|
|
29
29
|
"@iconify-json/mingcute": "^1.1.9"
|
|
30
30
|
}
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/events": "^0.28.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
20
|
-
"@cloudcommerce/modules": "^0.28.
|
|
18
|
+
"@cloudcommerce/events": "^0.28.5",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.28.5",
|
|
20
|
+
"@cloudcommerce/modules": "^0.28.5"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cloudcommerce/cli": "^0.28.
|
|
26
|
+
"@cloudcommerce/cli": "^0.28.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/eslint": "^0.28.
|
|
29
|
+
"@cloudcommerce/eslint": "^0.28.5"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/feeds": "^0.28.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
20
|
-
"@cloudcommerce/passport": "^0.28.
|
|
18
|
+
"@cloudcommerce/feeds": "^0.28.5",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.28.5",
|
|
20
|
+
"@cloudcommerce/passport": "^0.28.5"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cloudcommerce/api": "^0.28.
|
|
21
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
22
|
-
"@cloudcommerce/ssr": "^0.28.
|
|
20
|
+
"@cloudcommerce/api": "^0.28.5",
|
|
21
|
+
"@cloudcommerce/firebase": "^0.28.5",
|
|
22
|
+
"@cloudcommerce/ssr": "^0.28.5",
|
|
23
23
|
"@vueuse/motion": "2.0.0-beta.22"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@cloudcommerce/i18n": "^0.28.
|
|
27
|
-
"@cloudcommerce/storefront": "^0.28.
|
|
28
|
-
"@cloudcommerce/types": "^0.28.
|
|
26
|
+
"@cloudcommerce/i18n": "^0.28.5",
|
|
27
|
+
"@cloudcommerce/storefront": "^0.28.5",
|
|
28
|
+
"@cloudcommerce/types": "^0.28.5",
|
|
29
29
|
"@fontsource-variable/inter": "^5.0.8",
|
|
30
30
|
"@iconify-json/ri": "^1.1.8",
|
|
31
31
|
"@iconify-json/wpf": "^1.1.4",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/events": "^0.28.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.28.
|
|
20
|
-
"@cloudcommerce/modules": "^0.28.
|
|
18
|
+
"@cloudcommerce/events": "^0.28.5",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.28.5",
|
|
20
|
+
"@cloudcommerce/modules": "^0.28.5"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cloudcommerce/cli": "^0.28.
|
|
26
|
+
"@cloudcommerce/cli": "^0.28.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/eslint": "^0.28.
|
|
29
|
+
"@cloudcommerce/eslint": "^0.28.5"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.29.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>",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vite": "^4.4.11",
|
|
31
31
|
"vitest": "^0.34.6",
|
|
32
32
|
"zx": "^7.2.3",
|
|
33
|
-
"@cloudcommerce/eslint": "0.
|
|
33
|
+
"@cloudcommerce/eslint": "0.29.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"fix-install": "bash scripts/pre-install.sh && pnpm i",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
],
|
|
48
48
|
"rewrites": [
|
|
49
49
|
{
|
|
50
|
-
"source": "/
|
|
50
|
+
"source": "/_api/modules/**",
|
|
51
51
|
"function": "modules",
|
|
52
52
|
"region": "us-east4"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
"source": "/
|
|
55
|
+
"source": "/_api/passport/**",
|
|
56
56
|
"function": "passport",
|
|
57
57
|
"region": "us-east4"
|
|
58
58
|
},
|
|
@@ -16,7 +16,7 @@ export default (req, res) => {
|
|
|
16
16
|
url = url.slice(0, -5);
|
|
17
17
|
}
|
|
18
18
|
[url] = url.split('?');
|
|
19
|
-
url = url.replace('/
|
|
19
|
+
url = url.replace('/_api/modules', ''); // due to hosting rewrite
|
|
20
20
|
const modName = url.split('/')[1];
|
|
21
21
|
const sendSchema = (isResponseSchema = false) => {
|
|
22
22
|
return res.status(200)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-modules-api.js","sourceRoot":"","sources":["../../src/firebase/serve-modules-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,eAAe,CAAC,GAAY,EAAE,GAAa,EAAE,EAAE;IAC7C,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACvB,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,KAAK,EAAE;QACzC,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;KAC5B;IACD,IACE,MAAM,KAAK,MAAM;WACd,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EACzE;QACA,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;KAC5B;IAED,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IAClB,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACzB,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACxB;IACD,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"serve-modules-api.js","sourceRoot":"","sources":["../../src/firebase/serve-modules-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,eAAe,CAAC,GAAY,EAAE,GAAa,EAAE,EAAE;IAC7C,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACvB,IAAI,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);
|
|
21
21
|
}
|
|
22
22
|
[url] = url.split('?');
|
|
23
|
-
url = url.replace('/
|
|
23
|
+
url = url.replace('/_api/modules', ''); // due to hosting rewrite
|
|
24
24
|
const modName = url.split('/')[1];
|
|
25
25
|
|
|
26
26
|
const sendSchema = (isResponseSchema = false) => {
|
|
@@ -6,7 +6,7 @@ export default async (req, res) => {
|
|
|
6
6
|
if (url.endsWith('.json')) {
|
|
7
7
|
url = url.slice(0, -5);
|
|
8
8
|
}
|
|
9
|
-
url = url.replace('/
|
|
9
|
+
url = url.replace('/_api/passport', ''); // due to hosting rewrite
|
|
10
10
|
const endpoint = url.split('/')[1];
|
|
11
11
|
if (endpoint !== 'token') {
|
|
12
12
|
res.sendStatus(404);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-passport-api.js","sourceRoot":"","sources":["../../src/firebase/serve-passport-api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D,eAAe,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IACnD,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IAClB,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACzB,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACxB;IACD,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"serve-passport-api.js","sourceRoot":"","sources":["../../src/firebase/serve-passport-api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D,eAAe,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,EAAE;IACnD,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IACl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url = url.replace('/
|
|
11
|
+
url = url.replace('/_api/passport', ''); // due to hosting rewrite
|
|
12
12
|
const endpoint = url.split('/')[1];
|
|
13
13
|
|
|
14
14
|
if (endpoint !== 'token') {
|
|
@@ -3,19 +3,30 @@
|
|
|
3
3
|
* Check event emits at BaseHead.astro
|
|
4
4
|
* @type {import('astro').ClientDirective}
|
|
5
5
|
*/
|
|
6
|
-
export default (load) => {
|
|
6
|
+
export default (load, opts) => {
|
|
7
7
|
const hy = async () => {
|
|
8
8
|
const hydrate = await load();
|
|
9
9
|
await hydrate();
|
|
10
10
|
};
|
|
11
|
+
const next = () => {
|
|
12
|
+
if (opts.value === 'idle') {
|
|
13
|
+
if (typeof window.requestIdleCallback === 'function') {
|
|
14
|
+
setTimeout(() => window.requestIdleCallback(hy), 9);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setTimeout(hy, 200);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
hy();
|
|
21
|
+
};
|
|
11
22
|
const id = window.$storefront?.apiContext?.doc._id || null;
|
|
12
23
|
if (window._firstLoadContextId === id && window._emitedContextId === id) {
|
|
13
24
|
console.log('[ctx] first load');
|
|
14
|
-
|
|
25
|
+
next();
|
|
15
26
|
setTimeout(() => {
|
|
16
27
|
delete window._firstLoadContextId;
|
|
17
28
|
}, 49);
|
|
18
29
|
return;
|
|
19
30
|
}
|
|
20
|
-
window.addEventListener('storefront:apiContext',
|
|
31
|
+
window.addEventListener('storefront:apiContext', next, { once: true });
|
|
21
32
|
};
|
|
@@ -4,7 +4,7 @@ import { computed } from 'vue';
|
|
|
4
4
|
export interface Props {
|
|
5
5
|
to?: 'orders' | 'favorites';
|
|
6
6
|
accountUrl?: string;
|
|
7
|
-
returnUrl?: string;
|
|
7
|
+
returnUrl?: string | null;
|
|
8
8
|
isSignUp?: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ const href = computed(() => {
|
|
|
20
20
|
} else {
|
|
21
21
|
url += '?';
|
|
22
22
|
}
|
|
23
|
-
return `${url}return_url=${props.returnUrl}
|
|
23
|
+
return props.returnUrl ? `${url}return_url=${props.returnUrl}` : url;
|
|
24
24
|
}
|
|
25
25
|
const { settings } = globalThis.$storefront;
|
|
26
26
|
if (props.to === 'orders' && settings.ordersUrl) {
|
|
@@ -63,7 +63,7 @@ const authenticate = async () => {
|
|
|
63
63
|
}
|
|
64
64
|
const { domain } = window.$storefront.settings;
|
|
65
65
|
try {
|
|
66
|
-
const resAuth = await fetch(`https://${domain}/
|
|
66
|
+
const resAuth = await fetch(`https://${domain}/_api/passport/token`, {
|
|
67
67
|
method: 'POST',
|
|
68
68
|
headers: {
|
|
69
69
|
'Content-Type': 'application/json',
|
|
@@ -67,7 +67,7 @@ if (!import.meta.env.SSR) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
modulesToFetch.forEach(({ modName, reqOptions }) => {
|
|
70
|
-
afetch(`/
|
|
70
|
+
afetch(`/_api/modules/${modName}`, reqOptions)
|
|
71
71
|
.then(async (response) => {
|
|
72
72
|
if (response.ok) {
|
|
73
73
|
const modInfo = {};
|