cloudcommerce 0.30.0 → 0.31.1
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/.github/workflows/test-apps.yml +1 -1
- package/CHANGELOG.md +66 -0
- package/action.yml +13 -1
- 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 +3 -3
- package/packages/api/lib/api.d.ts +2 -2
- package/packages/api/package.json +1 -1
- package/packages/apps/affilate-program/lib/events-to-affilate-program.js +4 -5
- package/packages/apps/affilate-program/lib/events-to-affilate-program.js.map +1 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/affilate-program/src/events-to-affilate-program.ts +6 -7
- package/packages/apps/correios/lib/correios.d.ts +1 -0
- package/packages/apps/correios/lib/correios.js +2 -1
- package/packages/apps/correios/lib/correios.js.map +1 -1
- package/packages/apps/correios/lib-mjs/calculate-shipping.mjs +430 -0
- package/packages/apps/correios/lib-mjs/correios-db.mjs +189 -0
- package/packages/apps/correios/lib-mjs/correios-v2.mjs +84 -0
- package/packages/apps/correios/lib-mjs/utils/constants-parsers.mjs +135 -0
- package/packages/apps/correios/lib-mjs/utils/correios-axios.mjs +93 -0
- package/packages/apps/correios/package.json +13 -5
- package/packages/apps/correios/scripts/tests.sh +11 -0
- package/packages/apps/correios/src/correios.ts +2 -1
- package/packages/apps/correios/tests/calculate-shipping.test.mjs +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/mandae/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 +17 -1
- 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/lib/config.js +1 -1
- package/packages/firebase/lib/config.js.map +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/firebase/src/config.ts +1 -1
- package/packages/i18n/lib/en_us/i19emailWasSentMsg.txt +1 -0
- package/packages/i18n/lib/en_us.d.ts +1 -0
- package/packages/i18n/lib/en_us.js +1 -0
- package/packages/i18n/lib/en_us.js.map +1 -1
- package/packages/i18n/lib/pt_br/i19emailWasSentMsg.txt +1 -0
- package/packages/i18n/lib/pt_br.d.ts +1 -0
- package/packages/i18n/lib/pt_br.js +1 -0
- package/packages/i18n/lib/pt_br.js.map +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/i18n/src/en_us.ts +1 -0
- package/packages/i18n/src/pt_br.ts +1 -0
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +1 -1
- package/packages/storefront/package.json +1 -1
- package/packages/storefront/src/lib/components/ViewTransitions.astro +4 -1
- package/packages/storefront/src/lib/composables/use-login-form.ts +13 -4
- package/packages/storefront/src/lib/scripts/vbeta-app.ts +44 -0
- package/packages/storefront/src/lib/state/customer-session.ts +10 -3
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/apps/correios/lib-mjs/calculate-correios.mjs +0 -470
- package/packages/apps/correios/lib-mjs/correios-ws.mjs +0 -155
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,72 @@
|
|
|
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.31.1](https://github.com/ecomplus/cloud-commerce/compare/v0.31.0...v0.31.1) (2023-11-03)
|
|
6
|
+
|
|
7
|
+
## [0.31.0](https://github.com/ecomplus/cloud-commerce/compare/v0.30.0...v0.31.0) (2023-11-03)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* **correios:** Requires new Correios contracts and credentials
|
|
13
|
+
|
|
14
|
+
* feat(correios v2): Create app
|
|
15
|
+
|
|
16
|
+
* chore(correios db): Add database population and main search in database
|
|
17
|
+
|
|
18
|
+
* chore(action): add correios app environment variables
|
|
19
|
+
|
|
20
|
+
* chore(pnpm lock): update file
|
|
21
|
+
|
|
22
|
+
* fix(pnpm lock): Update file
|
|
23
|
+
|
|
24
|
+
* chore(events): Add event functions
|
|
25
|
+
|
|
26
|
+
* chore(pnpm lock): Update file
|
|
27
|
+
|
|
28
|
+
* fix(correios db): Fix fill database and write fallback data
|
|
29
|
+
|
|
30
|
+
* fix(app correios): Update app package [skip ci]
|
|
31
|
+
|
|
32
|
+
* fix(events): Remove app correios v2
|
|
33
|
+
|
|
34
|
+
* fix(firebase config): Remove correiosV2 app and update appId [skip ci]
|
|
35
|
+
|
|
36
|
+
* fix(modules): Remove correios v2 app
|
|
37
|
+
|
|
38
|
+
* fix(pnpm lock): Return file to main version
|
|
39
|
+
|
|
40
|
+
* fix(test correios): Remove debug
|
|
41
|
+
|
|
42
|
+
* fix(correios): Remove unnecessary comments [skip ci]
|
|
43
|
+
|
|
44
|
+
* fix(correios v2): Add and correct parsers adds declared value check
|
|
45
|
+
|
|
46
|
+
* fix(correios): Add weight check and standardization of parameters
|
|
47
|
+
|
|
48
|
+
* fix(correios): Remove unnecessary comments
|
|
49
|
+
|
|
50
|
+
* fix(correios): Correct conversion of weight to grams
|
|
51
|
+
|
|
52
|
+
* fix(correios): Parameterize weight array to grams
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
* **correios:** Update app to integrate new Correios API and read/save results to db ([#251](https://github.com/ecomplus/cloud-commerce/issues/251)) ([a1fb7e8](https://github.com/ecomplus/cloud-commerce/commit/a1fb7e8ac3581451ca2a2b57001ddb4a374c6c24))
|
|
57
|
+
* **i18n:** Add `i19emailWasSentMsg` ([b3bcb53](https://github.com/ecomplus/cloud-commerce/commit/b3bcb53d0f2603e34ba0ea2ac9193e01dbce178d))
|
|
58
|
+
* **storefront:** Add `linkActionUrl` opt param to `submitLogin` method on login form composable ([a783be6](https://github.com/ecomplus/cloud-commerce/commit/a783be6c9fe5af847a6f00eeb7a15b32a07ebad9))
|
|
59
|
+
* **storefront:** New `vbeta-app` script to load legacy checkout SPA with session compatibility ([ed7cfb7](https://github.com/ecomplus/cloud-commerce/commit/ed7cfb7612016b577f60b05f4db84a28ea5b8550))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Bug Fixes
|
|
63
|
+
|
|
64
|
+
* **affiliate-program:** Preventing error with undefined customer by code and other type fixes ([8340982](https://github.com/ecomplus/cloud-commerce/commit/834098212c539993ec3644c7cc01fcc6b61dbc2e))
|
|
65
|
+
* **cli:** Update default `firebase.json` API routes CORS accepted methods ([31fd1c5](https://github.com/ecomplus/cloud-commerce/commit/31fd1c52e3d395f0b585d12bcacc323342b574bb))
|
|
66
|
+
* **cli:** Update default `firebase.json` with API routes cache control and CORS headers ([c2a6ff2](https://github.com/ecomplus/cloud-commerce/commit/c2a6ff2f5f1cf5c20d048204628fdaab4f14d6fc))
|
|
67
|
+
* **storefront:** Ensure Firebase app init on `useLoginForm` ([3505eda](https://github.com/ecomplus/cloud-commerce/commit/3505eda698ef5f4acdb206f2b4a0b2963fdbd25e))
|
|
68
|
+
* **storefront:** Ensure View Transitions script not started on /app/* routes ([9e14b11](https://github.com/ecomplus/cloud-commerce/commit/9e14b11d01538534f13f33b2160c69e9fc95bb3a))
|
|
69
|
+
* **storefront:** Update `useLoginForm` to throttle login submit and return `isSubmitting` state ([4096aab](https://github.com/ecomplus/cloud-commerce/commit/4096aabf3bfa0a13db911491bb36cac6c7ed53f7))
|
|
70
|
+
|
|
5
71
|
## [0.30.0](https://github.com/ecomplus/cloud-commerce/compare/v0.29.0...v0.30.0) (2023-11-01)
|
|
6
72
|
|
|
7
73
|
|
package/action.yml
CHANGED
|
@@ -80,13 +80,19 @@ inputs:
|
|
|
80
80
|
description: 'App: Webhooks token'
|
|
81
81
|
mandae-token:
|
|
82
82
|
description: 'App: Mandaê token'
|
|
83
|
+
correios-user:
|
|
84
|
+
description: 'App: Correios username'
|
|
85
|
+
correios-access-code:
|
|
86
|
+
description: 'App: Correios access code'
|
|
87
|
+
correios-postcard-number:
|
|
88
|
+
description: 'App: Optional Correios postcard number'
|
|
83
89
|
|
|
84
90
|
outputs: {}
|
|
85
91
|
|
|
86
92
|
runs:
|
|
87
93
|
using: "composite"
|
|
88
94
|
steps:
|
|
89
|
-
- uses: actions/setup-node@
|
|
95
|
+
- uses: actions/setup-node@v4
|
|
90
96
|
with:
|
|
91
97
|
node-version: 18
|
|
92
98
|
cache: 'npm'
|
|
@@ -242,6 +248,9 @@ runs:
|
|
|
242
248
|
FLASHCOURIER_CONTRACT: ${{ inputs.flashcourier-contract }}
|
|
243
249
|
WEBHOOKS_TOKEN: ${{ inputs.webhooks-token }}
|
|
244
250
|
MANDAE_TOKEN: ${{ inputs.mandae-token }}
|
|
251
|
+
CORREIOS_USER: ${{ inputs.correios-user }}
|
|
252
|
+
CORREIOS_ACCESS_CODE: ${{ inputs.correios-access-code }}
|
|
253
|
+
CORREIOS_POSTCARD: ${{ inputs.correios-postcard-number }}
|
|
245
254
|
run: |
|
|
246
255
|
export GAC_FILENAME=".gac-$RANDOM.json"
|
|
247
256
|
echo $FIREBASE_SERVICE_ACCOUNT > $GAC_FILENAME
|
|
@@ -281,6 +290,9 @@ runs:
|
|
|
281
290
|
FLASHCOURIER_CONTRACT=$FLASHCOURIER_CONTRACT
|
|
282
291
|
WEBHOOKS_TOKEN=$WEBHOOKS_TOKEN
|
|
283
292
|
MANDAE_TOKEN=$MANDAE_TOKEN
|
|
293
|
+
CORREIOS_USER=$CORREIOS_USER
|
|
294
|
+
CORREIOS_ACCESS_CODE=$CORREIOS_ACCESS_CODE
|
|
295
|
+
CORREIOS_POSTCARD=$CORREIOS_POSTCARD
|
|
284
296
|
" > functions/.env
|
|
285
297
|
if [ -z "$DEPLOY_CODEBASE" ]; then
|
|
286
298
|
GOOGLE_APPLICATION_CREDENTIALS=$GAC_FILENAME npm run deploy
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/feeds": "^0.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.
|
|
20
|
-
"@cloudcommerce/passport": "^0.
|
|
18
|
+
"@cloudcommerce/feeds": "^0.30.0",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.30.0",
|
|
20
|
+
"@cloudcommerce/passport": "^0.30.0"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cloudcommerce/api": "^0.
|
|
21
|
-
"@cloudcommerce/firebase": "^0.
|
|
22
|
-
"@cloudcommerce/ssr": "^0.
|
|
20
|
+
"@cloudcommerce/api": "^0.30.0",
|
|
21
|
+
"@cloudcommerce/firebase": "^0.30.0",
|
|
22
|
+
"@cloudcommerce/ssr": "^0.30.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@cloudcommerce/i18n": "^0.
|
|
26
|
-
"@cloudcommerce/storefront": "^0.
|
|
27
|
-
"@cloudcommerce/types": "^0.
|
|
25
|
+
"@cloudcommerce/i18n": "^0.30.0",
|
|
26
|
+
"@cloudcommerce/storefront": "^0.30.0",
|
|
27
|
+
"@cloudcommerce/types": "^0.30.0",
|
|
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.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.
|
|
20
|
-
"@cloudcommerce/modules": "^0.
|
|
18
|
+
"@cloudcommerce/events": "^0.30.0",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.30.0",
|
|
20
|
+
"@cloudcommerce/modules": "^0.30.0"
|
|
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.
|
|
26
|
+
"@cloudcommerce/cli": "^0.30.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/eslint": "^0.
|
|
29
|
+
"@cloudcommerce/eslint": "^0.30.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/feeds": "^0.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.
|
|
20
|
-
"@cloudcommerce/passport": "^0.
|
|
18
|
+
"@cloudcommerce/feeds": "^0.30.0",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.30.0",
|
|
20
|
+
"@cloudcommerce/passport": "^0.30.0"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cloudcommerce/api": "^0.
|
|
21
|
-
"@cloudcommerce/firebase": "^0.
|
|
22
|
-
"@cloudcommerce/ssr": "^0.
|
|
20
|
+
"@cloudcommerce/api": "^0.30.0",
|
|
21
|
+
"@cloudcommerce/firebase": "^0.30.0",
|
|
22
|
+
"@cloudcommerce/ssr": "^0.30.0",
|
|
23
23
|
"@vueuse/motion": "2.0.0-beta.22"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@cloudcommerce/i18n": "^0.
|
|
27
|
-
"@cloudcommerce/storefront": "^0.
|
|
28
|
-
"@cloudcommerce/types": "^0.
|
|
26
|
+
"@cloudcommerce/i18n": "^0.30.0",
|
|
27
|
+
"@cloudcommerce/storefront": "^0.30.0",
|
|
28
|
+
"@cloudcommerce/types": "^0.30.0",
|
|
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.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.
|
|
20
|
-
"@cloudcommerce/modules": "^0.
|
|
18
|
+
"@cloudcommerce/events": "^0.30.0",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.30.0",
|
|
20
|
+
"@cloudcommerce/modules": "^0.30.0"
|
|
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.
|
|
26
|
+
"@cloudcommerce/cli": "^0.30.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/eslint": "^0.
|
|
29
|
+
"@cloudcommerce/eslint": "^0.30.0"
|
|
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.31.1",
|
|
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>",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"standard-version": "^9.5.0",
|
|
26
26
|
"ts-node": "^10.9.1",
|
|
27
27
|
"turbo": "^1.10.16",
|
|
28
|
-
"typescript": "~5.
|
|
28
|
+
"typescript": "~5.2.2",
|
|
29
29
|
"uglify-js": "^3.17.4",
|
|
30
30
|
"vite": "^4.5.0",
|
|
31
31
|
"vitest": "^0.34.6",
|
|
32
32
|
"zx": "^7.2.3",
|
|
33
|
-
"@cloudcommerce/eslint": "0.
|
|
33
|
+
"@cloudcommerce/eslint": "0.31.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"fix-install": "bash scripts/pre-install.sh && pnpm i",
|
|
@@ -59,7 +59,7 @@ declare const api: {
|
|
|
59
59
|
_id: import("../types.d").ResourceId;
|
|
60
60
|
};
|
|
61
61
|
}>;
|
|
62
|
-
put: <E_1 extends import("../types.d").ResourceAndFind | `products/${
|
|
62
|
+
put: <E_1 extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `slugs/${string}` | ("search/v1" | `search/v1?${string}` | "search/_els" | `search/_els?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C_1 extends AbstractedConfig>(endpoint: E_1, body: RequestBody<{
|
|
63
63
|
endpoint: E_1;
|
|
64
64
|
method: 'put';
|
|
65
65
|
}>, config?: C_1 | undefined) => Promise<Response & {
|
|
@@ -103,7 +103,7 @@ declare const post: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E
|
|
|
103
103
|
_id: import("../types.d").ResourceId;
|
|
104
104
|
};
|
|
105
105
|
}>;
|
|
106
|
-
declare const put: <E extends import("../types.d").ResourceAndFind | `products/${
|
|
106
|
+
declare const put: <E extends import("../types.d").ResourceAndFind | `products/${import("../types.d").ResourceId}/${string}` | `categories/${import("../types.d").ResourceId}/${string}` | `brands/${import("../types.d").ResourceId}/${string}` | `collections/${import("../types.d").ResourceId}/${string}` | `grids/${import("../types.d").ResourceId}/${string}` | `carts/${import("../types.d").ResourceId}/${string}` | `orders/${import("../types.d").ResourceId}/${string}` | `customers/${import("../types.d").ResourceId}/${string}` | `stores/${import("../types.d").ResourceId}/${string}` | `applications/${import("../types.d").ResourceId}/${string}` | `authentications/${import("../types.d").ResourceId}/${string}` | `products/${string}:${string}/${string}` | `categories/${string}:${string}/${string}` | `brands/${string}:${string}/${string}` | `collections/${string}:${string}/${string}` | `grids/${string}:${string}/${string}` | `carts/${string}:${string}/${string}` | `orders/${string}:${string}/${string}` | `customers/${string}:${string}/${string}` | `stores/${string}:${string}/${string}` | `applications/${string}:${string}/${string}` | `authentications/${string}:${string}/${string}` | `slugs/${string}` | ("search/v1" | `search/v1?${string}` | "search/_els" | `search/_els?${string}`) | ("events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${import("../types.d").ResourceId}` | `events/categories/${import("../types.d").ResourceId}` | `events/brands/${import("../types.d").ResourceId}` | `events/collections/${import("../types.d").ResourceId}` | `events/grids/${import("../types.d").ResourceId}` | `events/carts/${import("../types.d").ResourceId}` | `events/orders/${import("../types.d").ResourceId}` | `events/customers/${import("../types.d").ResourceId}` | `events/stores/${import("../types.d").ResourceId}` | `events/applications/${import("../types.d").ResourceId}` | `events/authentications/${import("../types.d").ResourceId}` | "events/me") | "login" | "authenticate" | "ask-auth-callback" | "check-username" | "$aggregate/products" | "$aggregate/categories" | "$aggregate/brands" | "$aggregate/collections" | "$aggregate/grids" | "$aggregate/carts" | "$aggregate/orders" | "$aggregate/customers" | "schemas/products" | "schemas/categories" | "schemas/brands" | "schemas/collections" | "schemas/grids" | "schemas/carts" | "schemas/orders" | "schemas/customers" | "schemas/stores" | "schemas/applications" | "schemas/authentications", C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
|
|
107
107
|
endpoint: E;
|
|
108
108
|
method: 'put';
|
|
109
109
|
}>, config?: C | undefined) => Promise<Response & {
|
|
@@ -99,11 +99,10 @@ const handleApiEvent = async ({
|
|
|
99
99
|
logger.warn('Inactive customer');
|
|
100
100
|
return null;
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (referralCustomer.doc_number === buyerCustomer.doc_number) {
|
|
102
|
+
const affiliateCode = buyerCustomer.affiliate_code;
|
|
103
|
+
if (!affiliateCode) return null;
|
|
104
|
+
const referralCustomer = (await api.get(`customers/${affiliateCode}`)).data;
|
|
105
|
+
if (referralCustomer?.doc_number === buyerCustomer.doc_number) {
|
|
107
106
|
logger.warn('Order placed by affiliate');
|
|
108
107
|
return null;
|
|
109
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events-to-affilate-program.js","sourceRoot":"","sources":["../src/events-to-affilate-program.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,GAAG,MAAM,oBAAoB,CAAC;AAErC,MAAM,cA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EAAE;gBACvB,OAAO,IAAI,CAAC;aACb;YACD,iDAAiD;YACjD,MAAM,cAAc,GAAG,cAAc,aAAa,CAAC,cAAc,yBAAsD,CAAC;YACxH,MAAM,GAAG,CAAC,IAAI,CACZ,cAAc,EACd;gBACE,IAAI,EAAE,UAAU;gBAChB,UAAU,EAAE,aAAa;gBACzB,aAAa,EAAE,YAAY;gBAC3B,aAAa,EAAE,YAAY;gBAC3B,KAAK,EAAE,CAAC;aACT,CACF,CAAC;YACF,MAAM,MAAM,CAAC,GAAG,CAAC;gBACf,OAAO;gBACP,UAAU,EAAE,aAAa,CAAC,cAAc;gBACxC,YAAY;gBACZ,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;aAClC,CAAC,CAAC;SACJ;QAED,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -86,7 +86,7 @@ const handleApiEvent: ApiEventHandler = async ({
|
|
|
86
86
|
logger.info(`${isOrder ? 'Orders' : 'Customers'}`);
|
|
87
87
|
try {
|
|
88
88
|
if (isCustomer && appData.points_on_signup) {
|
|
89
|
-
const referralCustomer = (await api.get(`customers/${referralId}`)).data;
|
|
89
|
+
const referralCustomer = (await api.get(`customers/${referralId as ResourceId}`)).data;
|
|
90
90
|
if (!referralCustomer?.enabled) {
|
|
91
91
|
logger.warn('Inactive customer');
|
|
92
92
|
return null;
|
|
@@ -118,18 +118,17 @@ const handleApiEvent: ApiEventHandler = async ({
|
|
|
118
118
|
if (appData.min_subtotal_to_earn > orderSubtotal) {
|
|
119
119
|
return null;
|
|
120
120
|
}
|
|
121
|
-
const buyerCustomer = (await api.get(`customers/${buyerId}`)).data;
|
|
121
|
+
const buyerCustomer = (await api.get(`customers/${buyerId as ResourceId}`)).data;
|
|
122
122
|
|
|
123
123
|
if (!buyerCustomer?.enabled) {
|
|
124
124
|
logger.warn('Inactive customer');
|
|
125
125
|
return null;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (referralCustomer.doc_number === buyerCustomer.doc_number) {
|
|
128
|
+
const affiliateCode = buyerCustomer.affiliate_code as ResourceId | undefined;
|
|
129
|
+
if (!affiliateCode) return null;
|
|
130
|
+
const referralCustomer = (await api.get(`customers/${affiliateCode}`)).data;
|
|
131
|
+
if (referralCustomer?.doc_number === buyerCustomer.doc_number) {
|
|
133
132
|
logger.warn('Order placed by affiliate');
|
|
134
133
|
return null;
|
|
135
134
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '@cloudcommerce/firebase/lib/init';
|
|
2
|
+
import handleCalculateShipping from '../lib-mjs/calculate-shipping.mjs';
|
|
2
3
|
|
|
3
4
|
export const calculateShipping = async (modBody) => {
|
|
4
5
|
return handleCalculateShipping(modBody);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correios.js","sourceRoot":"","sources":["../src/correios.ts"],"names":[],"mappings":"AAEA,OAAO,uBAAuB,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAsB,EAAE,EAAE;IAChE,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"correios.js","sourceRoot":"","sources":["../src/correios.ts"],"names":[],"mappings":"AAEA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,uBAAuB,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAsB,EAAE,EAAE;IAChE,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|