cloudcommerce 0.0.39 → 0.0.42
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 +11 -0
- package/package.json +8 -8
- package/packages/api/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/firebase/lib/config.js +18 -22
- package/packages/firebase/lib/defaults.js +1 -4
- package/packages/firebase/lib/env.js +17 -17
- package/packages/firebase/lib/handlers/check-store-events.js +23 -24
- package/packages/firebase/lib/index.js +2 -4
- package/packages/firebase/lib/types.js +1 -1
- package/packages/firebase/package.json +3 -3
- package/packages/modules/package.json +2 -2
- package/packages/passport/package.json +2 -2
- package/packages/ssr/package.json +2 -2
- package/packages/storefront/package.json +2 -2
- package/packages/types/package.json +1 -1
- package/pnpm-lock.yaml +390 -163
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
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.42](https://github.com/ecomplus/cloud-commerce/compare/v0.0.41...v0.0.42) (2022-08-02)
|
|
6
|
+
|
|
7
|
+
### [0.0.41](https://github.com/ecomplus/cloud-commerce/compare/v0.0.40...v0.0.41) (2022-08-02)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **deps:** Update all non-major dependencies ([#35](https://github.com/ecomplus/cloud-commerce/issues/35)) ([77dcab8](https://github.com/ecomplus/cloud-commerce/commit/77dcab840825e3ca05a05ccd9998a0e8012c9125))
|
|
13
|
+
|
|
14
|
+
### [0.0.40](https://github.com/ecomplus/cloud-commerce/compare/v0.0.39...v0.0.40) (2022-07-29)
|
|
15
|
+
|
|
5
16
|
### [0.0.39](https://github.com/ecomplus/cloud-commerce/compare/v0.0.38...v0.0.39) (2022-07-29)
|
|
6
17
|
|
|
7
18
|
### [0.0.38](https://github.com/ecomplus/cloud-commerce/compare/v0.0.37...v0.0.38) (2022-07-28)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
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>",
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
"@commitlint/config-conventional": "^17.0.3",
|
|
21
21
|
"@commitlint/rules": "^17.0.0",
|
|
22
22
|
"@types/node": "^18.0.5",
|
|
23
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
24
|
-
"@typescript-eslint/parser": "^5.
|
|
25
|
-
"esbuild": "^0.14.
|
|
26
|
-
"eslint": "^8.
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
24
|
+
"@typescript-eslint/parser": "^5.32.0",
|
|
25
|
+
"esbuild": "^0.14.51",
|
|
26
|
+
"eslint": "^8.21.0",
|
|
27
27
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
28
28
|
"eslint-plugin-import": "^2.26.0",
|
|
29
29
|
"eslint-plugin-vue": "^9.3.0",
|
|
30
30
|
"husky": "^8.0.1",
|
|
31
|
-
"node-fetch": "^3.2.
|
|
31
|
+
"node-fetch": "^3.2.10",
|
|
32
32
|
"standard-version": "^9.5.0",
|
|
33
|
-
"turbo": "^1.
|
|
33
|
+
"turbo": "^1.4.0",
|
|
34
34
|
"typescript": "^4.7.4",
|
|
35
35
|
"vite": "3",
|
|
36
|
-
"vitest": "^0.
|
|
36
|
+
"vitest": "^0.20.2",
|
|
37
37
|
"zx": "^7.0.7"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
import Deepmerge from '@fastify/deepmerge';
|
|
2
|
-
import {
|
|
3
|
-
DEFAULT_LANG, DEFAULT_CURRENCY, DEFAULT_CURRENCY_SYMBOL, DEFAULT_COUNTRY_CODE,
|
|
4
|
-
} from './defaults.js';
|
|
5
|
-
|
|
2
|
+
import { DEFAULT_LANG, DEFAULT_CURRENCY, DEFAULT_CURRENCY_SYMBOL, DEFAULT_COUNTRY_CODE, } from './defaults.js';
|
|
6
3
|
const deepmerge = Deepmerge();
|
|
7
4
|
const self = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
__config: {
|
|
6
|
+
hello: 'from @cloudcommerce/firebase',
|
|
7
|
+
lang: process.env.ECOM_LANG || DEFAULT_LANG,
|
|
8
|
+
currency: process.env.ECOM_CURRENCY || DEFAULT_CURRENCY,
|
|
9
|
+
currencySymbol: process.env.ECOM_CURRENCY_SYMBOL || DEFAULT_CURRENCY_SYMBOL,
|
|
10
|
+
countryCode: process.env.ECOM_COUNTRY_CODE || DEFAULT_COUNTRY_CODE,
|
|
11
|
+
storeId: Number(process.env.ECOM_STORE_ID),
|
|
12
|
+
httpsFunctionOptions: {
|
|
13
|
+
region: process.env.DEPLOY_REGION || 'us-east1',
|
|
14
|
+
},
|
|
17
15
|
},
|
|
18
|
-
},
|
|
19
16
|
};
|
|
20
|
-
|
|
21
17
|
export default {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
get() {
|
|
19
|
+
return self.__config;
|
|
20
|
+
},
|
|
21
|
+
set(config) {
|
|
22
|
+
self.__config = deepmerge(self.__config, config);
|
|
23
|
+
},
|
|
28
24
|
};
|
|
29
|
-
|
|
25
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export default () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
const { ECOM_AUTHENTICATION_ID, ECOM_API_KEY, GITHUB_TOKEN, } = process.env;
|
|
3
|
+
if (!ECOM_AUTHENTICATION_ID) {
|
|
4
|
+
throw new Error('ECOM_AUTHENTICATION_ID is not set');
|
|
5
|
+
}
|
|
6
|
+
if (!ECOM_API_KEY) {
|
|
7
|
+
throw new Error('ECOM_API_KEY is not set');
|
|
8
|
+
}
|
|
9
|
+
const authenticationId = ECOM_AUTHENTICATION_ID;
|
|
10
|
+
const apiKey = ECOM_API_KEY;
|
|
11
|
+
const githubToken = GITHUB_TOKEN;
|
|
12
|
+
const env = {
|
|
13
|
+
authenticationId,
|
|
14
|
+
apiKey,
|
|
15
|
+
githubToken,
|
|
16
|
+
};
|
|
17
|
+
return env;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -3,30 +3,29 @@ import { getFirestore } from 'firebase-admin/firestore';
|
|
|
3
3
|
import { logger } from 'firebase-functions';
|
|
4
4
|
import api from '@cloudcommerce/api';
|
|
5
5
|
import getEnv from '../env.js';
|
|
6
|
-
|
|
7
6
|
export default async () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
logger.info({ listenedEvents });
|
|
18
|
-
[
|
|
19
|
-
'orders',
|
|
20
|
-
'products',
|
|
21
|
-
'carts',
|
|
22
|
-
].forEach(async (resource) => {
|
|
23
|
-
const { data: { result } } = await api({
|
|
24
|
-
authenticationId,
|
|
25
|
-
apiKey,
|
|
26
|
-
endpoint: `events/${resource}`,
|
|
7
|
+
const { authenticationId, apiKey } = getEnv();
|
|
8
|
+
const eventsSubs = await getFirestore().collection('eventsSubs').get();
|
|
9
|
+
const listenedEvents = [];
|
|
10
|
+
eventsSubs.forEach((doc) => {
|
|
11
|
+
const eventSub = doc.data();
|
|
12
|
+
if (!listenedEvents.includes(eventSub.event)) {
|
|
13
|
+
listenedEvents.push(eventSub.event);
|
|
14
|
+
}
|
|
27
15
|
});
|
|
28
|
-
logger.info(
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
logger.info({ listenedEvents });
|
|
17
|
+
[
|
|
18
|
+
'orders',
|
|
19
|
+
'products',
|
|
20
|
+
'carts',
|
|
21
|
+
].forEach(async (resource) => {
|
|
22
|
+
const { data: { result } } = await api({
|
|
23
|
+
authenticationId,
|
|
24
|
+
apiKey,
|
|
25
|
+
endpoint: `events/${resource}`,
|
|
26
|
+
});
|
|
27
|
+
logger.info(`${resource} events: `, result);
|
|
28
|
+
});
|
|
29
|
+
return true;
|
|
31
30
|
};
|
|
32
|
-
|
|
31
|
+
//# sourceMappingURL=check-store-events.js.map
|
|
@@ -6,10 +6,8 @@ import '@cloudcommerce/api/fetch-polyfill.js';
|
|
|
6
6
|
import { initializeApp } from 'firebase-admin/app';
|
|
7
7
|
import { pubsub } from 'firebase-functions';
|
|
8
8
|
import checkStoreEvents from './handlers/check-store-events.js';
|
|
9
|
-
|
|
10
9
|
initializeApp();
|
|
11
|
-
|
|
12
10
|
export const cronStoreEvents = pubsub.schedule('* * * * *').onRun(() => {
|
|
13
|
-
|
|
11
|
+
return checkStoreEvents();
|
|
14
12
|
});
|
|
15
|
-
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/firebase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce on Firebase",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@cloudcommerce/api": "workspace:*",
|
|
29
29
|
"@fastify/deepmerge": "^1.1.0",
|
|
30
|
-
"firebase-admin": "^11.0.
|
|
30
|
+
"firebase-admin": "^11.0.1",
|
|
31
31
|
"firebase-functions": "^3.22.0",
|
|
32
|
-
"node-fetch": "^3.2.
|
|
32
|
+
"node-fetch": "^3.2.10",
|
|
33
33
|
"source-map-support": "^0.5.21"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/modules",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce modules API",
|
|
6
6
|
"main": "lib/index.cjs",
|
|
7
7
|
"exports": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@cloudcommerce/firebase": "workspace:*",
|
|
28
|
-
"firebase-admin": "^11.0.
|
|
28
|
+
"firebase-admin": "^11.0.1",
|
|
29
29
|
"firebase-functions": "^3.22.0",
|
|
30
30
|
"source-map-support": "^0.5.21"
|
|
31
31
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/passport",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@cloudcommerce/api": "workspace:*",
|
|
27
27
|
"@cloudcommerce/firebase": "workspace:*",
|
|
28
|
-
"firebase-admin": "^11.0.
|
|
28
|
+
"firebase-admin": "^11.0.1",
|
|
29
29
|
"firebase-functions": "^3.22.0",
|
|
30
30
|
"source-map-support": "^0.5.21"
|
|
31
31
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/ssr",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront SSR",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@cloudcommerce/api": "workspace:*",
|
|
27
27
|
"@cloudcommerce/firebase": "workspace:*",
|
|
28
28
|
"@cloudcommerce/storefront": "workspace:*",
|
|
29
|
-
"firebase-admin": "^11.0.
|
|
29
|
+
"firebase-admin": "^11.0.1",
|
|
30
30
|
"firebase-functions": "^3.22.0",
|
|
31
31
|
"source-map-support": "^0.5.21"
|
|
32
32
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@cloudcommerce/api": "workspace:*",
|
|
23
|
-
"astro": "1.0.0-rc.
|
|
23
|
+
"astro": "1.0.0-rc.3"
|
|
24
24
|
}
|
|
25
25
|
}
|