@onylab/common-api 1.1.5 → 1.2.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/data/mockup/api/hubrise/account.json +5 -0
- package/data/mockup/api/hubrise/catalog.json +15 -0
- package/data/mockup/api/hubrise/catalogs.json +12 -0
- package/data/mockup/api/hubrise/customer.json +39 -0
- package/data/mockup/api/hubrise/customer_lists.json +12 -0
- package/data/mockup/api/hubrise/customers.json +75 -0
- package/data/mockup/api/hubrise/locations.json +15 -0
- package/data/mockup/api/hubrise/order.json +76 -0
- package/data/mockup/api/hubrise/user.json +13 -0
- package/dist/common-api.d.ts +1200 -66
- package/dist/common-api.node.min.js +1 -1
- package/dist/common-api.node.min.js.map +1 -1
- package/dist/data/mockup/api/hubrise/account.json +5 -0
- package/dist/data/mockup/api/hubrise/catalog.json +15 -0
- package/dist/data/mockup/api/hubrise/catalogs.json +12 -0
- package/dist/data/mockup/api/hubrise/customer.json +39 -0
- package/dist/data/mockup/api/hubrise/customer_lists.json +12 -0
- package/dist/data/mockup/api/hubrise/customers.json +75 -0
- package/dist/data/mockup/api/hubrise/locations.json +15 -0
- package/dist/data/mockup/api/hubrise/order.json +76 -0
- package/dist/data/mockup/api/hubrise/user.json +13 -0
- package/mocha.env.js +1 -0
- package/package.json +30 -32
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "87yu4",
|
|
3
|
+
"location_id": "3r4s3-1",
|
|
4
|
+
"name": "Web",
|
|
5
|
+
"created_at": "2020-06-25T11:43:51+02:00",
|
|
6
|
+
"data": {
|
|
7
|
+
"variants": [],
|
|
8
|
+
"categories": [],
|
|
9
|
+
"products": [],
|
|
10
|
+
"options_lists": [],
|
|
11
|
+
"deals": [],
|
|
12
|
+
"discounts": [],
|
|
13
|
+
"charges": []
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "jdj9v",
|
|
3
|
+
"customer_list_id": "smpse3",
|
|
4
|
+
"anonymised": false,
|
|
5
|
+
"private_ref": null,
|
|
6
|
+
"email": "jimmy.watson@dummy-mail.org",
|
|
7
|
+
"first_name": "Jimmy",
|
|
8
|
+
"last_name": "Watson",
|
|
9
|
+
"gender": "male",
|
|
10
|
+
"birth_date": null,
|
|
11
|
+
"created_at": "2020-01-18T17:12:02+02:00",
|
|
12
|
+
"company_name": null,
|
|
13
|
+
"phone": "+44123456789",
|
|
14
|
+
"phone_access_code": "8888",
|
|
15
|
+
"address_1": "1 Town Road",
|
|
16
|
+
"address_2": null,
|
|
17
|
+
"postal_code": "N9 0HL",
|
|
18
|
+
"city": "London",
|
|
19
|
+
"state": null,
|
|
20
|
+
"country": "GB",
|
|
21
|
+
"latitude": "45.7571206",
|
|
22
|
+
"longitude": "4.8307575",
|
|
23
|
+
"delivery_notes": null,
|
|
24
|
+
"sms_marketing": false,
|
|
25
|
+
"email_marketing": true,
|
|
26
|
+
"nb_orders": 2,
|
|
27
|
+
"order_total": "28.40 GBP",
|
|
28
|
+
"first_order_date": "2020-01-18T17:15:11+02:00",
|
|
29
|
+
"last_order_date": "2020-01-23T10:13:21+02:00",
|
|
30
|
+
"loyalty_cards": [
|
|
31
|
+
{
|
|
32
|
+
"id": "slp8q",
|
|
33
|
+
"ref": null,
|
|
34
|
+
"name": null,
|
|
35
|
+
"balance": "13.5"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"custom_fields": {}
|
|
39
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "jdj9v",
|
|
4
|
+
"customer_list_id": "smpse3",
|
|
5
|
+
"anonymised": false,
|
|
6
|
+
"private_ref": null,
|
|
7
|
+
"email": "jimmy.watson@dummy-mail.org",
|
|
8
|
+
"first_name": "Jimmy",
|
|
9
|
+
"last_name": "Watson",
|
|
10
|
+
"gender": "male",
|
|
11
|
+
"birth_date": null,
|
|
12
|
+
"created_at": "2020-01-18T17:12:02+02:00",
|
|
13
|
+
"company_name": null,
|
|
14
|
+
"phone": "+44123456789",
|
|
15
|
+
"phone_access_code": "8888",
|
|
16
|
+
"address_1": "1 Town Road",
|
|
17
|
+
"address_2": null,
|
|
18
|
+
"postal_code": "N9 0HL",
|
|
19
|
+
"city": "London",
|
|
20
|
+
"state": null,
|
|
21
|
+
"country": "GB",
|
|
22
|
+
"latitude": "45.7571206",
|
|
23
|
+
"longitude": "4.8307575",
|
|
24
|
+
"delivery_notes": null,
|
|
25
|
+
"sms_marketing": false,
|
|
26
|
+
"email_marketing": true,
|
|
27
|
+
"nb_orders": 2,
|
|
28
|
+
"order_total": "28.40 GBP",
|
|
29
|
+
"first_order_date": "2020-01-18T17:15:11+02:00",
|
|
30
|
+
"last_order_date": "2020-01-23T10:13:21+02:00",
|
|
31
|
+
"loyalty_cards": [
|
|
32
|
+
{
|
|
33
|
+
"id": "slp8q",
|
|
34
|
+
"ref": null,
|
|
35
|
+
"name": null,
|
|
36
|
+
"balance": "13.5"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"custom_fields": {}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "asdf2",
|
|
43
|
+
"customer_list_id": "ag8u4",
|
|
44
|
+
"anonymised": false,
|
|
45
|
+
"email": "charles.moore@dummy-mail.org",
|
|
46
|
+
"first_name": "Charles",
|
|
47
|
+
"last_name": "Moore",
|
|
48
|
+
"phone": "+44123456789",
|
|
49
|
+
"phone_access_code": "8888",
|
|
50
|
+
"address_1": "1 Town Road",
|
|
51
|
+
"address_2": null,
|
|
52
|
+
"postal_code": "N9 0HL",
|
|
53
|
+
"city": "London",
|
|
54
|
+
"state": null,
|
|
55
|
+
"country": "GB",
|
|
56
|
+
"latitude": "45.7571206",
|
|
57
|
+
"longitude": "4.8307575",
|
|
58
|
+
"delivery_notes": null,
|
|
59
|
+
"sms_marketing": false,
|
|
60
|
+
"email_marketing": true,
|
|
61
|
+
"nb_orders": 2,
|
|
62
|
+
"order_total": "28.40 GBP",
|
|
63
|
+
"first_order_date": "2020-01-18T17:15:11+02:00",
|
|
64
|
+
"last_order_date": "2020-01-23T10:13:21+02:00",
|
|
65
|
+
"loyalty_cards": [
|
|
66
|
+
{
|
|
67
|
+
"id": "slp8q",
|
|
68
|
+
"ref": null,
|
|
69
|
+
"name": null,
|
|
70
|
+
"balance": "13.5"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"custom_fields": {}
|
|
74
|
+
}
|
|
75
|
+
]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"status": "new",
|
|
3
|
+
"private_ref": "fr:1679f128-4ff6-4a60-9fc2-7fe38af4f84d",
|
|
4
|
+
"service_type": "delivery",
|
|
5
|
+
"service_type_ref": null,
|
|
6
|
+
"expected_time": "2021-11-07T17:17:22Z",
|
|
7
|
+
"customer_notes": "PAS DE COUVERTS",
|
|
8
|
+
"collection_code": "5645",
|
|
9
|
+
"items": [
|
|
10
|
+
{
|
|
11
|
+
"product_name": "LIP15",
|
|
12
|
+
"sku_ref": "LIP15",
|
|
13
|
+
"price": "3.50 EUR",
|
|
14
|
+
"quantity": 1,
|
|
15
|
+
"options": []
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"product_name": "5VANI",
|
|
19
|
+
"sku_ref": "5VANI",
|
|
20
|
+
"price": "6.90 EUR",
|
|
21
|
+
"quantity": 1,
|
|
22
|
+
"options": []
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"product_name": "TSQ2",
|
|
26
|
+
"sku_ref": "TSQ2",
|
|
27
|
+
"price": "13.50 EUR",
|
|
28
|
+
"quantity": 1,
|
|
29
|
+
"options": [
|
|
30
|
+
{
|
|
31
|
+
"option_list_name": "Options",
|
|
32
|
+
"name": "SUPP RACLETTE",
|
|
33
|
+
"ref": "SUPP RACLETTE",
|
|
34
|
+
"price": "1.00 EUR"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"product_name": "SCES",
|
|
40
|
+
"sku_ref": "SCES",
|
|
41
|
+
"price": "10.50 EUR",
|
|
42
|
+
"quantity": 1,
|
|
43
|
+
"options": []
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"deals": {},
|
|
47
|
+
"discounts": [],
|
|
48
|
+
"charges": [
|
|
49
|
+
{
|
|
50
|
+
"type": "delivery",
|
|
51
|
+
"name": "Delivery charge",
|
|
52
|
+
"ref": null,
|
|
53
|
+
"price": "0.99 EUR"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"payments": [
|
|
57
|
+
{
|
|
58
|
+
"type": "online",
|
|
59
|
+
"name": "Paid online",
|
|
60
|
+
"ref": null,
|
|
61
|
+
"amount": "36.39 EUR"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"customer": {
|
|
65
|
+
"address_1": "6a Rue du Tire Pesseau, 21000 Dijon, France",
|
|
66
|
+
"city": "Dijon",
|
|
67
|
+
"postal_code": "21000",
|
|
68
|
+
"phone": "+33175858334",
|
|
69
|
+
"delivery_notes": "Phone access code: 151081499",
|
|
70
|
+
"first_name": "Benoit",
|
|
71
|
+
"last_name": "B.",
|
|
72
|
+
"email": "orders@deliveroo.com",
|
|
73
|
+
"latitude": "47.3166297697847",
|
|
74
|
+
"longitude": "5.00251594930887"
|
|
75
|
+
}
|
|
76
|
+
}
|
package/mocha.env.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
process.env.NODE_ENV = 'test';
|
package/package.json
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
"description": "Common API",
|
|
4
4
|
"main": "dist/common-api.node.min.js",
|
|
5
5
|
"types": "dist/common-api.d.ts",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.2.0",
|
|
7
7
|
"author": "Paul M.",
|
|
8
8
|
"license": "NO LICENSE",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
10
|
+
"node": ">=22"
|
|
11
11
|
},
|
|
12
12
|
"private": false,
|
|
13
13
|
"scripts": {
|
|
@@ -20,68 +20,66 @@
|
|
|
20
20
|
"postinstall": "npm dedupe",
|
|
21
21
|
"release": "bash script/release.sh",
|
|
22
22
|
"start": "node dist/common-api.node.min.js",
|
|
23
|
-
"test": "mocha",
|
|
23
|
+
"test": "mocha test/**/*.ts",
|
|
24
24
|
"validate": "(npm run compile --silent && npm run lint --silent && npm run test || { exit 1; })"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@sentry/node": "^8.35.0",
|
|
28
|
-
"@sentry/profiling-node": "^8.
|
|
28
|
+
"@sentry/profiling-node": "^8.55.0",
|
|
29
29
|
"@types/clean-css": "^4.2.11",
|
|
30
|
-
"@types/compression": "^1.
|
|
30
|
+
"@types/compression": "^1.8.1",
|
|
31
31
|
"@types/html-minifier-terser": "^7.0.2",
|
|
32
|
-
"axios": "^1.
|
|
32
|
+
"axios": "^1.12.2",
|
|
33
33
|
"clean-css": "^5.3.3",
|
|
34
34
|
"color-name": "^1.1.4",
|
|
35
|
-
"compression": "^1.
|
|
36
|
-
"connect-timeout": "^1.9.
|
|
35
|
+
"compression": "^1.8.1",
|
|
36
|
+
"connect-timeout": "^1.9.1",
|
|
37
37
|
"cors": "^2.8.5",
|
|
38
|
-
"emoji-regex": "^10.
|
|
39
|
-
"express": "^
|
|
38
|
+
"emoji-regex": "^10.5.0",
|
|
39
|
+
"express": "^5.1.0",
|
|
40
40
|
"fast-diff": "^1.3.0",
|
|
41
|
-
"helmet": "^8.
|
|
41
|
+
"helmet": "^8.1.0",
|
|
42
42
|
"html-minifier-terser": "^7.2.0",
|
|
43
43
|
"iconv-lite": "^0.6.3",
|
|
44
44
|
"lodash": "^4.17.21",
|
|
45
|
-
"luxon": "^3.
|
|
45
|
+
"luxon": "^3.7.2",
|
|
46
46
|
"mustache": "^4.2.0",
|
|
47
|
-
"node-mailjet": "^6.0.
|
|
47
|
+
"node-mailjet": "^6.0.9",
|
|
48
48
|
"prettyjson": "^1.2.5",
|
|
49
49
|
"retry": "^0.13.1",
|
|
50
|
-
"shopify-api-node": "^3.
|
|
50
|
+
"shopify-api-node": "^3.15.0",
|
|
51
51
|
"shopify-token": "^4.1.0",
|
|
52
52
|
"typeorm": "^0.2.45"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@faker-js/faker": "^9.
|
|
55
|
+
"@faker-js/faker": "^9.9.0",
|
|
56
56
|
"@pamls/eslint-config": "^0.2.24",
|
|
57
57
|
"@types/chai": "^4.3.20",
|
|
58
58
|
"@types/color-name": "^1.1.5",
|
|
59
59
|
"@types/connect-timeout": "^0.0.39",
|
|
60
|
-
"@types/cors": "^2.8.
|
|
61
|
-
"@types/express": "^5.0.
|
|
60
|
+
"@types/cors": "^2.8.19",
|
|
61
|
+
"@types/express": "^5.0.3",
|
|
62
62
|
"@types/glob": "^8.1.0",
|
|
63
|
-
"@types/lodash": "^4.17.
|
|
64
|
-
"@types/luxon": "^3.
|
|
65
|
-
"@types/mocha": "^10.0.
|
|
66
|
-
"@types/mustache": "^4.2.
|
|
67
|
-
"@types/node": "^22.8
|
|
63
|
+
"@types/lodash": "^4.17.20",
|
|
64
|
+
"@types/luxon": "^3.7.1",
|
|
65
|
+
"@types/mocha": "^10.0.10",
|
|
66
|
+
"@types/mustache": "^4.2.6",
|
|
67
|
+
"@types/node": "^22.18.8",
|
|
68
68
|
"@types/node-mailjet": "^3.3.12",
|
|
69
69
|
"@types/prettyjson": "^0.0.33",
|
|
70
70
|
"@types/retry": "^0.12.5",
|
|
71
71
|
"@types/sinon": "^10.0.20",
|
|
72
|
-
"@types/webpack-env": "^1.18.
|
|
72
|
+
"@types/webpack-env": "^1.18.8",
|
|
73
73
|
"chai": "^4.5.0",
|
|
74
74
|
"copy-webpack-plugin": "^12.0.2",
|
|
75
|
-
"mocha": "^10.
|
|
76
|
-
"nock": "^13.5.
|
|
75
|
+
"mocha": "^10.8.2",
|
|
76
|
+
"nock": "^13.5.6",
|
|
77
77
|
"sinon": "^15.2.0",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"typescript": "^5.6.3",
|
|
84
|
-
"webpack": "^5.95.0",
|
|
78
|
+
"ts-loader": "^9.5.4",
|
|
79
|
+
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
80
|
+
"tsx": "^4.20.6",
|
|
81
|
+
"typescript": "^5.9.3",
|
|
82
|
+
"webpack": "^5.102.0",
|
|
85
83
|
"webpack-cli": "^5.1.4",
|
|
86
84
|
"webpack-node-externals": "^3.0.0"
|
|
87
85
|
},
|