Skip to content

Commit

Permalink
Merge branch 'main' into feat/correios-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l authored Oct 26, 2023
2 parents e323ecf + efc2dba commit a5c3ead
Show file tree
Hide file tree
Showing 80 changed files with 1,076 additions and 553 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ jobs:
FRENET_TOKEN: ${{ secrets.FRENET_TOKEN }}
GALAXPAY_ID: ${{ secrets.GALAXPAY_ID }}
GALAXPAY_HASH: ${{ secrets.GALAXPAY_HASH }}
INFINITEPAY_ID: ${{ secrets.INFINITEPAY_ID }}
INFINITEPAY_SECRET: ${{ secrets.INFINITEPAY_SECRET }}
run: pnpm build

- name: Get npm global directories
Expand Down
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,53 @@

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.

## [0.29.0](https://github.com/ecomplus/cloud-commerce/compare/v0.28.5...v0.29.0) (2023-10-17)


### ⚠ BREAKING CHANGES

* Default modules and passport APIs URLs changed

### Features

* **storefront:** Update Astro `client:context` custom directive to accept "idle" value ([3ce1f3b](https://github.com/ecomplus/cloud-commerce/commit/3ce1f3b1e60feb3071eec0f5e36ece4af851a658))


### Bug Fixes

* **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)


* Moving modules and passport APIs to /_api/* routes ([eed3d73](https://github.com/ecomplus/cloud-commerce/commit/eed3d731257d06fa81a31ccdec8466f9c465d59b))

### [0.28.5](https://github.com/ecomplus/cloud-commerce/compare/v0.28.4...v0.28.5) (2023-10-17)


### Bug Fixes

* **ssr:** Properly set assets prefix (if configured) to CSS preload Link header ([3f83e56](https://github.com/ecomplus/cloud-commerce/commit/3f83e56e11c7e9a9aceb3c2a7cfd21e704304069))

### [0.28.4](https://github.com/ecomplus/cloud-commerce/compare/v0.28.3...v0.28.4) (2023-10-17)


### Bug Fixes

* **storefront:** Set optimized pictures responsive srcset with assets prefix (CDN) if configured ([36b9ae6](https://github.com/ecomplus/cloud-commerce/commit/36b9ae66fb03609017b06ef6002e4f052f6b40af))

### [0.28.3](https://github.com/ecomplus/cloud-commerce/compare/v0.28.2...v0.28.3) (2023-10-16)


### Features

* **storefront:** Set `Astro.locals.assetsPrefix` globally available on Astro components ([0548fbb](https://github.com/ecomplus/cloud-commerce/commit/0548fbb9c864a300e215a3f2c8c722f34fb07279))


### Bug Fixes

* **deps:** Update non-major dependencies ([#253](https://github.com/ecomplus/cloud-commerce/issues/253)) ([9a29d76](https://github.com/ecomplus/cloud-commerce/commit/9a29d76459541b20f1816b1e572281294f19d4c3))
* **storefront:** Must set cache control stale-while-revalidate even without s-maxage ([3d27496](https://github.com/ecomplus/cloud-commerce/commit/3d274961e0f10f1afae22da1e6cdeb70e17811e8))
* **storefront:** Properly set optimized pictures src with assets prefix (CDN) if configured ([68a8b6e](https://github.com/ecomplus/cloud-commerce/commit/68a8b6e3fb2f1837dfb40dbe996fb46832c4b0b5))

### [0.28.2](https://github.com/ecomplus/cloud-commerce/compare/v0.28.1...v0.28.2) (2023-10-15)

### [0.28.1](https://github.com/ecomplus/cloud-commerce/compare/v0.28.0...v0.28.1) (2023-10-15)
Expand Down
10 changes: 3 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ inputs:
description: 'Emails: SMTP password'
sendgrid-api-key:
description: 'App: SendGrid API key'
tiny-erp-token:
tinyerp-token:
description: 'App: Tiny ERP API token'
galaxpay-partner-id:
description: 'App: Optional Galax Pay partner ID'
Expand Down Expand Up @@ -225,7 +225,7 @@ runs:
SMTP_USER: ${{ inputs.smpt-user }}
SMTP_PASS: ${{ inputs.smpt-pass }}
SENDGRID_API_KEY: ${{ inputs.sendgrid-api-key }}
TINY_ERP_TOKEN: ${{ inputs.tiny-erp-token }}
TINYERP_TOKEN: ${{ inputs.tinyerp-token }}
GALAXPAY_PARTNER_ID: ${{ inputs.galaxpay-partner-id }}
GALAXPAY_PARTNER_HASH: ${{ inputs.galaxpay-partner-hash }}
DATAFRETE_OPERATOR_TOKEN: ${{ inputs.datafrete-operator-token }}
Expand All @@ -235,8 +235,6 @@ runs:
GALAXPAY_HASH: ${{ inputs.galaxpay-hash }}
GA_MEASUREMENT_ID: ${{ inputs.ga-measurement-id }}
GA_API_TOKEN: ${{ inputs.ga-api-token }}
INFINITEPAY_ID: ${{ inputs.infinitepay-id }}
INFINITEPAY_SECRET: ${{ inputs.infinitepay-secret }}
FB_PIXEL_ID: ${{ inputs.fb-pixel-id }}
FB_GRAPH_TOKEN: ${{ inputs.fb-graph-token }}
JADLOG_CONTRACT_TOKEN: ${{ inputs.jadlog-contract-token }}
Expand Down Expand Up @@ -268,7 +266,7 @@ runs:
SMTP_USER=$SMTP_USER
SMTP_PASS=$SMTP_PASS
SENDGRID_API_KEY=$SENDGRID_API_KEY
TINY_ERP_TOKEN=$TINY_ERP_TOKEN
TINYERP_TOKEN=$TINYERP_TOKEN
GALAXPAY_PARTNER_ID=$GALAXPAY_PARTNER_ID
GALAXPAY_PARTNER_HASH=$GALAXPAY_PARTNER_HASH
DATAFRETE_OPERATOR_TOKEN=$DATAFRETE_OPERATOR_TOKEN
Expand All @@ -278,8 +276,6 @@ runs:
GALAXPAY_HASH=$GALAXPAY_HASH
GA_MEASUREMENT_ID=$GA_MEASUREMENT_ID
GA_API_TOKEN=$GA_API_TOKEN
INFINITEPAY_ID=$INFINITEPAY_ID
INFINITEPAY_SECRET=$INFINITEPAY_SECRET
FB_PIXEL_ID=$FB_PIXEL_ID
FB_GRAPH_TOKEN=$FB_GRAPH_TOKEN
JADLOG_CONTRACT_TOKEN=$JADLOG_CONTRACT_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion ecomplus-stores/barra-doce
2 changes: 1 addition & 1 deletion ecomplus-stores/monocard
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cloudcommerce",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
"main": "packages/api/lib/index.js",
"author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
Expand Down Expand Up @@ -32,18 +32,18 @@
},
"devDependencies": {
"@cloudcommerce/eslint": "workspace:*",
"@commitlint/cli": "^17.8.0",
"@commitlint/config-conventional": "^17.8.0",
"@commitlint/rules": "^17.7.0",
"@types/node": "^18.18.5",
"eslint": "^8.51.0",
"@commitlint/cli": "^18.0.0",
"@commitlint/config-conventional": "^18.0.0",
"@commitlint/rules": "^18.0.0",
"@types/node": "^18.18.6",
"eslint": "^8.52.0",
"husky": "^8.0.3",
"standard-version": "^9.5.0",
"ts-node": "^10.9.1",
"turbo": "^1.10.15",
"turbo": "^1.10.16",
"typescript": "~5.0.4",
"uglify-js": "^3.17.4",
"vite": "^4.4.11",
"vite": "^4.5.0",
"vitest": "^0.34.6",
"zx": "^7.2.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/api",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce APIs client/adapter",
"main": "lib/api.js",
"types": "lib/api.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/affilate-program/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-affilate-program",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app for simple affiliate program",
"main": "lib/index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/custom-payment/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-custom-payment",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app for simple custom payment methods",
"main": "lib/index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/custom-shipping/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-custom-shipping",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app for custom shipping methods",
"main": "lib/custom-shipping.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/datafrete/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-datafrete",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app to integrate Datafrete shipping gateway ",
"main": "lib/datafrete.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/discounts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-discounts",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app for complex discount rules",
"main": "lib/discounts.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/emails/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-emails",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce default transactional email app",
"main": "lib/index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/emails/src/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const emails = {
),

cronAbandonedCarts: functions.region(region).pubsub
.schedule('25 */3 * * *')
.schedule(process.env.CRONTAB_EMAILS_ABANDONED_CARTS || '25 */3 * * *')
.onRun(() => {
return handleAbandonedCarts();
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/fb-conversions/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-fb-conversions",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app to send carts/orders to Facebook Conversions API",
"main": "lib/index.js",
"repository": {
Expand All @@ -28,6 +28,6 @@
"devDependencies": {
"@cloudcommerce/types": "workspace:*",
"@firebase/app-types": "^0.9.0",
"@types/facebook-nodejs-business-sdk": "^15.0.2"
"@types/facebook-nodejs-business-sdk": "^15.0.4"
}
}
6 changes: 4 additions & 2 deletions packages/apps/fb-conversions/src/fb-conversions-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ const handleApiEvent: ApiEventHandler = async ({
);

const eventsData = [serverEvent];
const eventRequest = (new EventRequest(process.env.FB_GRAPH_TOKEN, process.env.FB_PIXEL_ID))
.setEvents(eventsData);
const eventRequest = new EventRequest(
process.env.FB_GRAPH_TOKEN,
process.env.FB_PIXEL_ID,
).setEvents(eventsData);

try {
const response = await eventRequest.execute();
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/flash-courier/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-flash-courier",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app to integrate Flash Courier",
"main": "lib/index.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/flash-courier/src/flash-courier-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import handleTrackingCodes from '../lib-mjs/update-tracking.mjs';

export const flashcourier = {
cronTrackingCodes: functions.region(config.get().httpsFunctionOptions.region).pubsub
.schedule('19 * * * *')
.schedule(process.env.CRONTAB_FLASHCOURIER_TRACKING_CODES || '19 * * * *')
.onRun(() => {
return handleTrackingCodes();
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/frenet/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-frenet",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app for Frenet shipping calculation",
"main": "lib/frenet.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/frenet/src/frenet-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { httpsFunctionOptions: { region } } = config.get();

export const frenet = {
cronTrackingCodes: functions.region(region).pubsub
.schedule('*/30 * * * *')
.schedule(process.env.CRONTAB_FRENET_TRACKING_CODES || '19 * * * *')
.onRun(() => {
return handleTrackingCodes;
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/galaxpay/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-galaxpay",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app to integrate Galax Pay for recurring payments",
"main": "lib/galaxpay.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-google-analytics",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app to send carts/orders events to GA Measurement Protocol",
"main": "lib/index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/jadlog/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-jadlog",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app for Jadlog shipping calculation",
"main": "lib/index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/loyalty-points/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-loyalty-points",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app to handle simple loyalty points programs",
"main": "lib/loyalty-points.js",
"exports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const addPoints = async () => {

for (let i = 0; i < docs.length; i++) {
const { customerId, pointEntries } = docs[i].data();
const orderId = docs[i].ref.id;
const orderId = docs[i].ref.id as string & { length: 24 };
let order: Orders | undefined;
try {
// eslint-disable-next-line no-await-in-loop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default async (appData: AppModuleBody) => {

if (transaction.amount) {
const loyaltyPoints = transaction.loyalty_points;
const customerId = params.buyer.customer_id;
const customerId = params.buyer.customer_id as ResourceId;
const orderId = params.order_id as ResourceId;
const usedPointsEntries: UsedPointsEntries[] = [];
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/loyalty-points/src/loyalty-points-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const loyaltypoints = {
),

cronAddPoints: functions.region(region).pubsub
.schedule('28 * * * *')
.schedule(process.env.CRONTAB_LOYALTYPOINTS_ADD_POINTS || '28 * * * *')
.onRun(() => {
return addPoints;
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/melhor-envio/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@cloudcommerce/app-melhor-envio",
"type": "module",
"version": "0.28.2",
"version": "0.29.0",
"description": "E-Com Plus Cloud Commerce app to integrate Melhor Envio",
"main": "lib/index.js",
"exports": {
Expand Down
Loading

0 comments on commit a5c3ead

Please sign in to comment.