cloudcommerce 0.0.127 → 0.0.128

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,13 @@
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.128](https://github.com/ecomplus/cloud-commerce/compare/v0.0.127...v0.0.128) (2022-12-01)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **config:** Check `SETTINGS_FILEPATH` and add last fallback to _functions/ssr/..._ ([ae6e92a](https://github.com/ecomplus/cloud-commerce/commit/ae6e92a03c9a12ad8d8e7b690592f6e673a71362))
11
+
5
12
  ### [0.0.127](https://github.com/ecomplus/cloud-commerce/compare/v0.0.126...v0.0.127) (2022-12-01)
6
13
 
7
14
 
package/action.yml CHANGED
@@ -19,19 +19,19 @@ inputs:
19
19
  tiny-erp-token:
20
20
  description: 'App: Tiny ERP API token'
21
21
  mail-sender:
22
- description: "Emails: sender email"
22
+ description: 'Emails: sender email'
23
23
  mail-sender-name:
24
- description: "Emails: sender name (default is store name)"
24
+ description: 'Emails: sender name (default is store name)'
25
25
  mail-reply-to:
26
- description: "Emails: Reply email"
26
+ description: 'Emails: Reply email'
27
27
  smpt-host:
28
- description: "Emails": SMTP hostname"
28
+ description: 'Emails: SMTP hostname'
29
29
  smpt-port:
30
- description: "Emails": SMTP port number"
30
+ description: 'Emails: SMTP port number'
31
31
  smpt-user:
32
- description: "Emails": SMTP username"
32
+ description: 'Emails: SMTP username'
33
33
  smpt-pass:
34
- description: "Emails": SMTP password"
34
+ description: 'Emails: SMTP password'
35
35
  sendgrid-api-key:
36
36
  description: 'Emails: SendGrid API key configuration'
37
37
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
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.127",
4
+ "version": "0.0.128",
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.127",
4
+ "version": "0.0.128",
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.127",
4
+ "version": "0.0.128",
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.127",
4
+ "version": "0.0.128",
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.0.127",
4
+ "version": "0.0.128",
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-frenet",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
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-infinitepay",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
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-mercadopago",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
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.0.127",
4
+ "version": "0.0.128",
5
5
  "description": "E-Com Plus Cloud Commerce app to integrate Pagar.me",
6
6
  "main": "lib/pagarme.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-pix",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
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.0.127",
4
+ "version": "0.0.128",
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/cli",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
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.127",
4
+ "version": "0.0.128",
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.0.127",
4
+ "version": "0.0.128",
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.0.127",
4
+ "version": "0.0.128",
5
5
  "description": "E-Com Plus Cloud Commerce app events",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,5 +1,5 @@
1
- import { join as joinPath } from 'path';
2
- import { readFileSync } from 'fs';
1
+ import { join as joinPath } from 'node:path';
2
+ import { existsSync, readFileSync } from 'node:fs';
3
3
  import config from '@cloudcommerce/config';
4
4
 
5
5
  const tinyErpEvents = [
@@ -13,9 +13,14 @@ const emailsEvents = [
13
13
  'orders-anyStatusSet',
14
14
  ];
15
15
  const {
16
- DEPLOY_REGION, SSR_DEPLOY_REGION, SSR_DEPLOY_MEMORY, SSR_DEPLOY_TIMEOUT_SECONDS, SSR_DEPLOY_MIN_INSTANCES,
16
+ SETTINGS_FILEPATH, DEPLOY_REGION, SSR_DEPLOY_REGION, SSR_DEPLOY_MEMORY, SSR_DEPLOY_TIMEOUT_SECONDS, SSR_DEPLOY_MIN_INSTANCES,
17
17
  } = process.env;
18
- const cmsSettingsFile = joinPath(process.cwd(), 'content/settings.json');
18
+ let cmsSettingsFile = SETTINGS_FILEPATH && existsSync(SETTINGS_FILEPATH)
19
+ ? SETTINGS_FILEPATH
20
+ : joinPath(process.cwd(), 'content/settings.json');
21
+ if (!existsSync(cmsSettingsFile)) {
22
+ cmsSettingsFile = joinPath(process.cwd(), 'functions/ssr/content/settings.json');
23
+ }
19
24
  const cmsSettings = JSON.parse(readFileSync(cmsSettingsFile, 'utf-8'));
20
25
  const mergeConfig = {
21
26
  hello: 'from @cloudcommerce/firebase',
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,MAAsB,MAAM,uBAAuB,CAAC;AAE3D,MAAM,aAAa,GAAmB;IACpC,qBAAqB;IACrB,cAAc;IACd,mBAAmB;IACnB,sBAAsB;CACvB,CAAC;AAEF,MAAM,YAAY,GAAmB;IACnC,YAAY;IACZ,qBAAqB;CACtB,CAAC;AAEF,MAAM,EACJ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,EAC1B,wBAAwB,GACzB,GAAG,OAAO,CAAC,GAAG,CAAC;AAEhB,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,uBAAuB,CAAC,CAAC;AACzE,MAAM,WAAW,GAAgB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;AAEpF,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,8BAA8B;IACrC,oBAAoB,EAAE;QACpB,MAAM,EAAE,aAAa,IAAI,oBAAoB;KAC9C;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,iBAAiB,IAAI,aAAa;QAC1C,MAAM,EAAG,iBAA6D,IAAI,QAAQ;QAClF,cAAc,EAAE,0BAA0B,CAAC,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,EAAE;QACpF,YAAY,EAAE,wBAAwB,CAAC,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC;KAC9E;IACD,IAAI,EAAE;QACJ,SAAS,EAAE;YACT,KAAK,EAAE,IAAI;SACZ;QACD,QAAQ,EAAE;YAC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AAe,MAId,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  import type { ApiEventName, CmsSettings } from '@cloudcommerce/types';
2
- import { join as joinPath } from 'path';
3
- import { readFileSync } from 'fs';
2
+ import { join as joinPath } from 'node:path';
3
+ import { existsSync, readFileSync } from 'node:fs';
4
4
  import config, { BaseConfig } from '@cloudcommerce/config';
5
5
 
6
6
  const tinyErpEvents: ApiEventName[] = [
@@ -16,6 +16,7 @@ const emailsEvents: ApiEventName[] = [
16
16
  ];
17
17
 
18
18
  const {
19
+ SETTINGS_FILEPATH,
19
20
  DEPLOY_REGION,
20
21
  SSR_DEPLOY_REGION,
21
22
  SSR_DEPLOY_MEMORY,
@@ -23,7 +24,12 @@ const {
23
24
  SSR_DEPLOY_MIN_INSTANCES,
24
25
  } = process.env;
25
26
 
26
- const cmsSettingsFile = joinPath(process.cwd(), 'content/settings.json');
27
+ let cmsSettingsFile = SETTINGS_FILEPATH && existsSync(SETTINGS_FILEPATH)
28
+ ? SETTINGS_FILEPATH
29
+ : joinPath(process.cwd(), 'content/settings.json');
30
+ if (!existsSync(cmsSettingsFile)) {
31
+ cmsSettingsFile = joinPath(process.cwd(), 'functions/ssr/content/settings.json');
32
+ }
27
33
  const cmsSettings: CmsSettings = JSON.parse(readFileSync(cmsSettingsFile, 'utf-8'));
28
34
 
29
35
  const mergeConfig = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/i18n",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
5
5
  "description": "E-Com Plus Cloud Commerce i18n",
6
6
  "main": "lib/all.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/modules",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
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.127",
4
+ "version": "0.0.128",
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.0.127",
4
+ "version": "0.0.128",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "0.0.127",
4
+ "version": "0.0.128",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {