cloudcommerce 0.0.73 → 0.0.74

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.json +8 -8
  3. package/packages/api/package.json +1 -1
  4. package/packages/apps/correios/package.json +1 -1
  5. package/packages/apps/custom-shipping/package.json +1 -1
  6. package/packages/apps/discounts/package.json +1 -1
  7. package/packages/apps/frenet/package.json +1 -1
  8. package/packages/apps/tiny-erp/package.json +1 -1
  9. package/packages/cli/config/firebase.json +47 -0
  10. package/packages/cli/package.json +1 -1
  11. package/packages/config/package.json +1 -1
  12. package/packages/events/package.json +1 -1
  13. package/packages/firebase/package.json +1 -1
  14. package/packages/modules/package.json +2 -1
  15. package/packages/modules/schemas/@checkout.cjs +28 -28
  16. package/packages/modules/schemas/apply_discount.cjs +2 -2
  17. package/packages/modules/schemas/calculate_shipping.cjs +4 -4
  18. package/packages/modules/schemas/create_transaction.cjs +30 -30
  19. package/packages/modules/schemas/list_payments.cjs +6 -6
  20. package/packages/modules/src/firebase/ajv.ts +2 -1
  21. package/packages/modules/src/firebase/handle-module.ts +5 -1
  22. package/packages/modules/src/firebase/serve-modules-api.ts +5 -3
  23. package/packages/passport/lib/firebase/handle-passport.js +96 -92
  24. package/packages/passport/lib/firebase/serve-passport-api.js +35 -34
  25. package/packages/passport/lib/firebase.js +5 -7
  26. package/packages/passport/lib/index.js +2 -1
  27. package/packages/passport/package.json +1 -1
  28. package/packages/ssr/lib/firebase/serve-storefront.js +33 -33
  29. package/packages/ssr/lib/firebase.js +2 -4
  30. package/packages/ssr/lib/index.js +1 -2
  31. package/packages/ssr/package.json +1 -1
  32. package/packages/storefront/astro.config.mjs +2 -0
  33. package/packages/storefront/dist/client/LoginModal.d6b935cf.js +1 -0
  34. package/packages/storefront/dist/client/assets/{_...c08e0a75.css → _...27b7eb4d.css} +1 -1
  35. package/packages/storefront/dist/client/assets/_...b3f65c5c.css +1 -0
  36. package/packages/storefront/dist/client/assets/fallback-index.90217cf0.css +1 -0
  37. package/packages/storefront/dist/client/assets/{fallback.9745a8aa.css → fallback.9cd2ed3f.css} +1 -1
  38. package/packages/storefront/dist/client/assets/{index.9745690c.css → index.c5a9ea80.css} +1 -1
  39. package/packages/storefront/dist/client/chunks/index.esm.69f70489.js +1726 -0
  40. package/packages/storefront/dist/client/chunks/index.esm2017.1194d1a1.js +457 -0
  41. package/packages/storefront/dist/client/chunks/runtime-core.esm-bundler.a7337834.js +1 -0
  42. package/packages/storefront/dist/client/client.80b904f3.js +1 -0
  43. package/packages/storefront/dist/client/hoisted.24787260.js +376 -0
  44. package/packages/storefront/dist/server/entry.mjs +342 -69
  45. package/packages/storefront/package.json +11 -9
  46. package/packages/storefront/src/assets/firebaseui.css +648 -0
  47. package/packages/storefront/src/lib/components/LoginModal.vue +42 -9
  48. package/packages/storefront/src/lib/layouts/Layout.astro +24 -0
  49. package/packages/types/package.json +1 -1
  50. package/packages/apps/tiny-erp/lib/event-to-tiny.js +0 -115
  51. package/packages/apps/tiny-erp/lib/event-to-tiny.js.map +0 -1
  52. package/packages/apps/tiny-erp/lib/index.js +0 -2
  53. package/packages/apps/tiny-erp/lib/index.js.map +0 -1
  54. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js +0 -79
  55. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js.map +0 -1
  56. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js +0 -84
  57. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js.map +0 -1
  58. package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js +0 -58
  59. package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js.map +0 -1
  60. package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js +0 -7
  61. package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js.map +0 -1
  62. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +0 -92
  63. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js.map +0 -1
  64. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +0 -158
  65. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js.map +0 -1
  66. package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js +0 -46
  67. package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js.map +0 -1
  68. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js +0 -193
  69. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js.map +0 -1
  70. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +0 -199
  71. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js.map +0 -1
  72. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js +0 -129
  73. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js.map +0 -1
  74. package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js +0 -34
  75. package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js.map +0 -1
  76. package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js +0 -39
  77. package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js.map +0 -1
  78. package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js +0 -47
  79. package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js.map +0 -1
  80. package/packages/apps/tiny-erp/lib/tiny-erp.js +0 -18
  81. package/packages/apps/tiny-erp/lib/tiny-erp.js.map +0 -1
  82. package/packages/apps/tiny-erp/lib/tiny-webhook.js +0 -92
  83. package/packages/apps/tiny-erp/lib/tiny-webhook.js.map +0 -1
  84. package/packages/modules/lib/firebase/ajv.js +0 -33
  85. package/packages/modules/lib/firebase/ajv.js.map +0 -1
  86. package/packages/modules/lib/firebase/call-app-module.js +0 -135
  87. package/packages/modules/lib/firebase/call-app-module.js.map +0 -1
  88. package/packages/modules/lib/firebase/checkout.js +0 -1
  89. package/packages/modules/lib/firebase/checkout.js.map +0 -1
  90. package/packages/modules/lib/firebase/handle-module.js +0 -165
  91. package/packages/modules/lib/firebase/handle-module.js.map +0 -1
  92. package/packages/modules/lib/firebase/proxy-apps.js +0 -1
  93. package/packages/modules/lib/firebase/proxy-apps.js.map +0 -1
  94. package/packages/modules/lib/firebase/serve-modules-api.js +0 -57
  95. package/packages/modules/lib/firebase/serve-modules-api.js.map +0 -1
  96. package/packages/modules/lib/firebase.js +0 -13
  97. package/packages/modules/lib/firebase.js.map +0 -1
  98. package/packages/modules/lib/index.js +0 -25
  99. package/packages/modules/lib/index.js.map +0 -1
  100. package/packages/storefront/dist/client/assets/_...d4aa8aff.css +0 -1
  101. package/packages/storefront/dist/client/assets/fallback-index.d9230d24.css +0 -1
  102. package/packages/storefront/dist/client/client.6d48c590.js +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
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.74](https://github.com/ecomplus/cloud-commerce/compare/v0.0.73...v0.0.74) (2022-09-13)
6
+
7
+
8
+ ### Features
9
+
10
+ * **cli:** Update default `firbase.json` config with cache headers ([d9e3e99](https://github.com/ecomplus/cloud-commerce/commit/d9e3e995e26ce75c8d19748313fa31d0982629e5))
11
+ * **storefront:** Initialize Firebase app with Analytics ([2a5fe36](https://github.com/ecomplus/cloud-commerce/commit/2a5fe36dea7d3c1b0bfeeb66dc4866e5c6c13cd0))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **modules:** Fix schemas to draft-07 and properly call module handler ([#48](https://github.com/ecomplus/cloud-commerce/issues/48)) ([bd1fd5b](https://github.com/ecomplus/cloud-commerce/commit/bd1fd5b8e3f1b4c7f35ad66570f542738d388ac6))
17
+
5
18
  ### [0.0.73](https://github.com/ecomplus/cloud-commerce/compare/v0.0.72...v0.0.73) (2022-09-10)
6
19
 
7
20
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.73",
4
+ "version": "0.0.74",
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>",
@@ -19,11 +19,11 @@
19
19
  "@commitlint/cli": "^17.1.2",
20
20
  "@commitlint/config-conventional": "^17.1.0",
21
21
  "@commitlint/rules": "^17.0.0",
22
- "@types/node": "^18.0.5",
23
- "@typescript-eslint/eslint-plugin": "^5.36.1",
24
- "@typescript-eslint/parser": "^5.36.1",
22
+ "@types/node": "^18.7.17",
23
+ "@typescript-eslint/eslint-plugin": "^5.37.0",
24
+ "@typescript-eslint/parser": "^5.37.0",
25
25
  "esbuild": "^0.15.7",
26
- "eslint": "^8.23.0",
26
+ "eslint": "^8.23.1",
27
27
  "eslint-config-airbnb-base": "^15.0.0",
28
28
  "eslint-plugin-import": "^2.26.0",
29
29
  "eslint-plugin-vue": "^9.4.0",
@@ -31,10 +31,10 @@
31
31
  "node-fetch": "^3.2.10",
32
32
  "standard-version": "^9.5.0",
33
33
  "ts-node": "^10.9.1",
34
- "turbo": "^1.4.5",
35
- "typescript": "^4.8.2",
34
+ "turbo": "^1.4.6",
35
+ "typescript": "^4.8.3",
36
36
  "vite": "^3.1.0",
37
- "vitest": "^0.23.1",
37
+ "vitest": "^0.23.2",
38
38
  "zx": "^7.0.8"
39
39
  },
40
40
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.0.73",
4
+ "version": "0.0.74",
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.73",
4
+ "version": "0.0.74",
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.73",
4
+ "version": "0.0.74",
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.73",
4
+ "version": "0.0.74",
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-frenet",
3
3
  "type": "module",
4
- "version": "0.0.73",
4
+ "version": "0.0.74",
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-tiny-erp",
3
3
  "type": "module",
4
- "version": "0.0.73",
4
+ "version": "0.0.74",
5
5
  "description": "E-Com Plus Cloud Commerce app for Tiny ERP",
6
6
  "main": "lib/tiny-erp.js",
7
7
  "repository": {
@@ -54,6 +54,53 @@
54
54
  "region": "southamerica-east1"
55
55
  }
56
56
  ],
57
+ "headers": [
58
+ {
59
+ "source": "/api/**",
60
+ "headers": [
61
+ {
62
+ "key": "Cache-Control",
63
+ "value": "private, max-age=30, must-revalidate"
64
+ }
65
+ ]
66
+ },
67
+ {
68
+ "source": "/img/**",
69
+ "headers": [
70
+ {
71
+ "key": "Cache-Control",
72
+ "value": "public, max-age=300, s-maxage=60, must-revalidate"
73
+ }
74
+ ]
75
+ },
76
+ {
77
+ "source": "/assets/**",
78
+ "headers": [
79
+ {
80
+ "key": "Cache-Control",
81
+ "value": "public, max-age=86400, s-maxage=600"
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ "source": "/app/**",
87
+ "headers": [
88
+ {
89
+ "key": "Cache-Control",
90
+ "value": "public, max-age=600, stale-while-revalidate=900"
91
+ }
92
+ ]
93
+ },
94
+ {
95
+ "source": "**/*.?????*.@(js|css|webp|avif)",
96
+ "headers": [
97
+ {
98
+ "key": "Cache-Control",
99
+ "value": "public, max-age=31536000, immutable"
100
+ }
101
+ ]
102
+ }
103
+ ],
57
104
  "cleanUrls": true
58
105
  },
59
106
  "storage": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.0.73",
4
+ "version": "0.0.74",
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.73",
4
+ "version": "0.0.74",
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/events",
3
3
  "type": "module",
4
- "version": "0.0.73",
4
+ "version": "0.0.74",
5
5
  "description": "E-Com Plus Cloud Commerce app events",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.0.73",
4
+ "version": "0.0.74",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/modules",
3
3
  "type": "module",
4
- "version": "0.0.73",
4
+ "version": "0.0.74",
5
5
  "description": "E-Com Plus Cloud Commerce modules API",
6
6
  "main": "lib/index.cjs",
7
7
  "exports": {
@@ -31,6 +31,7 @@
31
31
  "@cloudcommerce/app-frenet": "workspace:*",
32
32
  "@cloudcommerce/firebase": "workspace:*",
33
33
  "ajv": "^8.11.0",
34
+ "ajv-formats": "^2.1.1",
34
35
  "axios": "^0.27.2",
35
36
  "firebase-admin": "^11.0.1",
36
37
  "firebase-functions": "^3.23.0",
@@ -25,8 +25,8 @@ exports.params = {
25
25
  },
26
26
  'number': {
27
27
  'type': 'integer',
28
- 'min': 1,
29
- 'max': 9999999,
28
+ 'minimum': 1,
29
+ 'maximum': 9999999,
30
30
  'description': 'House or building street number'
31
31
  },
32
32
  'complement': {
@@ -95,8 +95,8 @@ exports.params = {
95
95
  'properties': {
96
96
  'country_code': {
97
97
  'type': 'integer',
98
- 'min': 1,
99
- 'max': 999,
98
+ 'minimum': 1,
99
+ 'maximum': 999,
100
100
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
101
101
  },
102
102
  'number': {
@@ -230,20 +230,20 @@ exports.params = {
230
230
  'properties': {
231
231
  'day': {
232
232
  'type': 'integer',
233
- 'min': 1,
234
- 'max': 31,
233
+ 'minimum': 1,
234
+ 'maximum': 31,
235
235
  'description': 'Day of birth'
236
236
  },
237
237
  'month': {
238
238
  'type': 'integer',
239
- 'min': 1,
240
- 'max': 12,
239
+ 'minimum': 1,
240
+ 'maximum': 12,
241
241
  'description': 'Number of month of birth'
242
242
  },
243
243
  'year': {
244
244
  'type': 'integer',
245
- 'min': 1800,
246
- 'max': 2200,
245
+ 'minimum': 1800,
246
+ 'maximum': 2200,
247
247
  'description': 'Year of birth'
248
248
  }
249
249
  },
@@ -256,8 +256,8 @@ exports.params = {
256
256
  'properties': {
257
257
  'country_code': {
258
258
  'type': 'integer',
259
- 'min': 1,
260
- 'max': 999,
259
+ 'minimum': 1,
260
+ 'maximum': 999,
261
261
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
262
262
  },
263
263
  'number': {
@@ -320,20 +320,20 @@ exports.params = {
320
320
  'properties': {
321
321
  'day': {
322
322
  'type': 'integer',
323
- 'min': 1,
324
- 'max': 31,
323
+ 'minimum': 1,
324
+ 'maximum': 31,
325
325
  'description': 'Day of birth'
326
326
  },
327
327
  'month': {
328
328
  'type': 'integer',
329
- 'min': 1,
330
- 'max': 12,
329
+ 'minimum': 1,
330
+ 'maximum': 12,
331
331
  'description': 'Number of month of birth'
332
332
  },
333
333
  'year': {
334
334
  'type': 'integer',
335
- 'min': 1800,
336
- 'max': 2200,
335
+ 'minimum': 1800,
336
+ 'maximum': 2200,
337
337
  'description': 'Year of birth'
338
338
  }
339
339
  },
@@ -346,8 +346,8 @@ exports.params = {
346
346
  'properties': {
347
347
  'country_code': {
348
348
  'type': 'integer',
349
- 'min': 1,
350
- 'max': 999,
349
+ 'minimum': 1,
350
+ 'maximum': 999,
351
351
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
352
352
  },
353
353
  'number': {
@@ -409,8 +409,8 @@ exports.params = {
409
409
  },
410
410
  'bin': {
411
411
  'type': 'integer',
412
- 'min': 1,
413
- 'max': 9999999,
412
+ 'minimum': 1,
413
+ 'maximum': 9999999,
414
414
  'description': 'Issuer identification number (IIN), known as bank identification number (BIN)'
415
415
  },
416
416
  'company': {
@@ -431,8 +431,8 @@ exports.params = {
431
431
  },
432
432
  'cvv': {
433
433
  'type': 'integer',
434
- 'min': 99,
435
- 'max': 99999,
434
+ 'minimum': 99,
435
+ 'maximum': 99999,
436
436
  'description': 'Credit card CVV number (Card Verification Value)'
437
437
  },
438
438
  'hash': {
@@ -829,8 +829,8 @@ exports.params = {
829
829
  },
830
830
  'channel_id': {
831
831
  'type': 'integer',
832
- 'min': 10000,
833
- 'max': 4294967295,
832
+ 'minimum': 10000,
833
+ 'maximum': 4294967295,
834
834
  'description': 'Channel unique identificator'
835
835
  },
836
836
  'channel_type': {
@@ -955,8 +955,8 @@ exports.params = {
955
955
  'properties': {
956
956
  'country_code': {
957
957
  'type': 'integer',
958
- 'min': 1,
959
- 'max': 999,
958
+ 'minimum': 1,
959
+ 'maximum': 999,
960
960
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
961
961
  },
962
962
  'number': {
@@ -179,8 +179,8 @@ const schema = {
179
179
  },
180
180
  'channel_id': {
181
181
  'type': 'integer',
182
- 'min': 10000,
183
- 'max': 4294967295,
182
+ 'minimum': 10000,
183
+ 'maximum': 4294967295,
184
184
  'description': 'Channel unique identificator'
185
185
  },
186
186
  'channel_type': {
@@ -22,8 +22,8 @@ const schema = {
22
22
  },
23
23
  'number': {
24
24
  'type': 'integer',
25
- 'min': 1,
26
- 'max': 9999999,
25
+ 'minimum': 1,
26
+ 'maximum': 9999999,
27
27
  'description': 'House or building street number'
28
28
  },
29
29
  'complement': {
@@ -92,8 +92,8 @@ const schema = {
92
92
  'properties': {
93
93
  'country_code': {
94
94
  'type': 'integer',
95
- 'min': 1,
96
- 'max': 999,
95
+ 'minimum': 1,
96
+ 'maximum': 999,
97
97
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
98
98
  },
99
99
  'number': {
@@ -23,8 +23,8 @@ const schema = {
23
23
  },
24
24
  'number': {
25
25
  'type': 'integer',
26
- 'min': 1,
27
- 'max': 9999999,
26
+ 'minimum': 1,
27
+ 'maximum': 9999999,
28
28
  'description': 'House or building street number'
29
29
  },
30
30
  'complement': {
@@ -93,8 +93,8 @@ const schema = {
93
93
  'properties': {
94
94
  'country_code': {
95
95
  'type': 'integer',
96
- 'min': 1,
97
- 'max': 999,
96
+ 'minimum': 1,
97
+ 'maximum': 999,
98
98
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
99
99
  },
100
100
  'number': {
@@ -306,20 +306,20 @@ const schema = {
306
306
  'properties': {
307
307
  'day': {
308
308
  'type': 'integer',
309
- 'min': 1,
310
- 'max': 31,
309
+ 'minimum': 1,
310
+ 'maximum': 31,
311
311
  'description': 'Day of birth'
312
312
  },
313
313
  'month': {
314
314
  'type': 'integer',
315
- 'min': 1,
316
- 'max': 12,
315
+ 'minimum': 1,
316
+ 'maximum': 12,
317
317
  'description': 'Number of month of birth'
318
318
  },
319
319
  'year': {
320
320
  'type': 'integer',
321
- 'min': 1800,
322
- 'max': 2200,
321
+ 'minimum': 1800,
322
+ 'maximum': 2200,
323
323
  'description': 'Year of birth'
324
324
  }
325
325
  },
@@ -332,8 +332,8 @@ const schema = {
332
332
  'properties': {
333
333
  'country_code': {
334
334
  'type': 'integer',
335
- 'min': 1,
336
- 'max': 999,
335
+ 'minimum': 1,
336
+ 'maximum': 999,
337
337
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
338
338
  },
339
339
  'number': {
@@ -396,20 +396,20 @@ const schema = {
396
396
  'properties': {
397
397
  'day': {
398
398
  'type': 'integer',
399
- 'min': 1,
400
- 'max': 31,
399
+ 'minimum': 1,
400
+ 'maximum': 31,
401
401
  'description': 'Day of birth'
402
402
  },
403
403
  'month': {
404
404
  'type': 'integer',
405
- 'min': 1,
406
- 'max': 12,
405
+ 'minimum': 1,
406
+ 'maximum': 12,
407
407
  'description': 'Number of month of birth'
408
408
  },
409
409
  'year': {
410
410
  'type': 'integer',
411
- 'min': 1800,
412
- 'max': 2200,
411
+ 'minimum': 1800,
412
+ 'maximum': 2200,
413
413
  'description': 'Year of birth'
414
414
  }
415
415
  },
@@ -422,8 +422,8 @@ const schema = {
422
422
  'properties': {
423
423
  'country_code': {
424
424
  'type': 'integer',
425
- 'min': 1,
426
- 'max': 999,
425
+ 'minimum': 1,
426
+ 'maximum': 999,
427
427
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
428
428
  },
429
429
  'number': {
@@ -485,8 +485,8 @@ const schema = {
485
485
  },
486
486
  'bin': {
487
487
  'type': 'integer',
488
- 'min': 1,
489
- 'max': 9999999,
488
+ 'minimum': 1,
489
+ 'maximum': 9999999,
490
490
  'description': 'Issuer identification number (IIN), known as bank identification number (BIN)'
491
491
  },
492
492
  'company': {
@@ -507,8 +507,8 @@ const schema = {
507
507
  },
508
508
  'cvv': {
509
509
  'type': 'integer',
510
- 'min': 99,
511
- 'max': 99999,
510
+ 'minimum': 99,
511
+ 'maximum': 99999,
512
512
  'description': 'Credit card CVV number (Card Verification Value)'
513
513
  },
514
514
  'hash': {
@@ -552,8 +552,8 @@ const schema = {
552
552
  },
553
553
  'order_number': {
554
554
  'type': 'integer',
555
- 'min': 1,
556
- 'max': 999999999,
555
+ 'minimum': 1,
556
+ 'maximum': 999999999,
557
557
  'description': 'Number of created order'
558
558
  },
559
559
  'open_payment_id': {
@@ -605,8 +605,8 @@ const schema = {
605
605
  },
606
606
  'channel_id': {
607
607
  'type': 'integer',
608
- 'min': 10000,
609
- 'max': 4294967295,
608
+ 'minimum': 10000,
609
+ 'maximum': 4294967295,
610
610
  'description': 'Channel unique identificator'
611
611
  },
612
612
  'channel_type': {
@@ -723,8 +723,8 @@ exports.response = {
723
723
  },
724
724
  'bin': {
725
725
  'type': 'integer',
726
- 'min': 1,
727
- 'max': 9999999,
726
+ 'minimum': 1,
727
+ 'maximum': 9999999,
728
728
  'description': 'Issuer identification number (IIN), known as bank identification number (BIN)'
729
729
  },
730
730
  'company': {
@@ -250,8 +250,8 @@ const schema = {
250
250
  'properties': {
251
251
  'country_code': {
252
252
  'type': 'integer',
253
- 'min': 1,
254
- 'max': 999,
253
+ 'minimum': 1,
254
+ 'maximum': 999,
255
255
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
256
256
  },
257
257
  'number': {
@@ -328,8 +328,8 @@ const schema = {
328
328
  },
329
329
  'number': {
330
330
  'type': 'integer',
331
- 'min': 1,
332
- 'max': 9999999,
331
+ 'minimum': 1,
332
+ 'maximum': 9999999,
333
333
  'description': 'House or building street number'
334
334
  },
335
335
  'complement': {
@@ -398,8 +398,8 @@ const schema = {
398
398
  'properties': {
399
399
  'country_code': {
400
400
  'type': 'integer',
401
- 'min': 1,
402
- 'max': 999,
401
+ 'minimum': 1,
402
+ 'maximum': 999,
403
403
  'description': 'Country calling code (without +), defined by standards E.123 and E.164'
404
404
  },
405
405
  'number': {
@@ -1,5 +1,6 @@
1
1
  import type { Response } from 'firebase-functions';
2
2
  import Ajv, { Options, ErrorObject } from 'ajv';
3
+ import addFormats from 'ajv-formats';
3
4
 
4
5
  const ajvOptions: Options = {
5
6
  coerceTypes: false,
@@ -10,7 +11,7 @@ const ajvOptions: Options = {
10
11
  multipleOfPrecision: 5,
11
12
  allowMatchingProperties: true,
12
13
  };
13
- const ajv = new Ajv(ajvOptions);
14
+ const ajv = addFormats(new Ajv(ajvOptions));
14
15
 
15
16
  const parseAjvErrors = (errors?: ErrorObject[] | null, ajvInstance = ajv) => {
16
17
  return ajvInstance.errorsText(errors, { separator: '\n' });
@@ -2,6 +2,7 @@ import type { Request, Response } from 'firebase-functions';
2
2
  import type { Applications, AppModuleName, AppModuleBody } from '@cloudcommerce/types';
3
3
  import { logger } from 'firebase-functions';
4
4
  import Ajv, { ValidateFunction } from 'ajv';
5
+ import addFormats from 'ajv-formats';
5
6
  import api, { ApiError, ApiConfig } from '@cloudcommerce/api';
6
7
  import config from '@cloudcommerce/firebase/lib/config';
7
8
  import {
@@ -12,7 +13,7 @@ import {
12
13
  } from './ajv';
13
14
  import callAppModule from './call-app-module';
14
15
 
15
- const ajvAppsResponse = new Ajv({ ...ajvOptions, allErrors: true });
16
+ const ajvAppsResponse = addFormats(new Ajv({ ...ajvOptions, allErrors: true }));
16
17
 
17
18
  // Cache apps list and no params modules results
18
19
  const appsCache = {};
@@ -46,6 +47,9 @@ async function runModule(
46
47
  appId
47
48
  && (typeof appId === 'number' || (typeof appId === 'string' && /^\d+$/.test(appId)))
48
49
  ) {
50
+ if (typeof appId === 'string') {
51
+ appId = parseInt(appId, 10);
52
+ }
49
53
  canCache = false;
50
54
  listAppsParams.app_id = appId;
51
55
  listAppsParams.limit = 1;