@cloudcommerce/app-mandae 2.9.0 → 2.10.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/package.json +12 -6
- package/.turbo/turbo-build.log +0 -5
- package/CHANGELOG.md +0 -1
- package/scripts/tests.sh +0 -7
- package/src/index.ts +0 -1
- package/src/mandae.ts +0 -7
- package/tests/calculate-shipping.test.mjs +0 -37
- package/tsconfig.json +0 -6
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-mandae",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.10.0",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app to integrate Mandaê shipping intermediator",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"/lib",
|
|
9
|
+
"/lib-mjs",
|
|
10
|
+
"/types",
|
|
11
|
+
"/*.{js,mjs,ts}"
|
|
12
|
+
],
|
|
7
13
|
"repository": {
|
|
8
14
|
"type": "git",
|
|
9
15
|
"url": "git+https://github.com/ecomplus/cloud-commerce.git",
|
|
@@ -17,13 +23,13 @@
|
|
|
17
23
|
"homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/apps/mandae#readme",
|
|
18
24
|
"dependencies": {
|
|
19
25
|
"@ecomplus/utils": "1.5.0-rc.6",
|
|
20
|
-
"axios": "^1.6.
|
|
21
|
-
"firebase-functions": "^4.8.
|
|
22
|
-
"@cloudcommerce/api": "2.
|
|
26
|
+
"axios": "^1.6.8",
|
|
27
|
+
"firebase-functions": "^4.8.1",
|
|
28
|
+
"@cloudcommerce/api": "2.10.0"
|
|
23
29
|
},
|
|
24
30
|
"devDependencies": {
|
|
25
|
-
"@cloudcommerce/test-base": "2.
|
|
26
|
-
"@cloudcommerce/types": "2.
|
|
31
|
+
"@cloudcommerce/test-base": "2.10.0",
|
|
32
|
+
"@cloudcommerce/types": "2.10.0"
|
|
27
33
|
},
|
|
28
34
|
"scripts": {
|
|
29
35
|
"build": "bash ../../../scripts/build-lib.sh"
|
package/.turbo/turbo-build.log
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Please refer to GitHub [repository releases](https://github.com/ecomplus/cloud-commerce/releases) or monorepo unified [CHANGELOG.md](https://github.com/ecomplus/cloud-commerce/blob/main/CHANGELOG.md).
|
package/scripts/tests.sh
DELETED
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './mandae';
|
package/src/mandae.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/prefer-default-export */
|
|
2
|
-
import type { AppModuleBody } from '@cloudcommerce/types';
|
|
3
|
-
import handleCalculateShipping from '../lib-mjs/calculate-mandae.mjs';
|
|
4
|
-
|
|
5
|
-
export const calculateShipping = async (modBody: AppModuleBody) => {
|
|
6
|
-
return handleCalculateShipping(modBody);
|
|
7
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import test, { before, describe } from 'node:test';
|
|
4
|
-
import {
|
|
5
|
-
modulesUrl,
|
|
6
|
-
bodyCalculateShipping,
|
|
7
|
-
} from '@cloudcommerce/test-base';
|
|
8
|
-
|
|
9
|
-
describe('Test Shipping Calculation in the Mandae App', async () => {
|
|
10
|
-
let req;
|
|
11
|
-
let data;
|
|
12
|
-
const appId = 124677;
|
|
13
|
-
|
|
14
|
-
before(async () => {
|
|
15
|
-
req = await fetch(`${modulesUrl}/calculate_shipping?app_id=${appId}`, {
|
|
16
|
-
method: 'POST',
|
|
17
|
-
body: JSON.stringify(bodyCalculateShipping),
|
|
18
|
-
headers: {
|
|
19
|
-
'Content-Type': 'application/json',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
data = (await req.json()).result;
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test('Check Status 200', async () => {
|
|
27
|
-
assert.strictEqual(req?.status, 200);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
test('Check validated is true', async () => {
|
|
31
|
-
assert.equal(data[0].validated, true);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test('Have shipping services', async () => {
|
|
35
|
-
assert.equal(data[0].response.shipping_services.length > 0, true);
|
|
36
|
-
});
|
|
37
|
-
});
|