cloudcommerce 0.0.50 → 0.0.51

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 (68) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +9 -9
  3. package/packages/api/lib/index.d.ts +40 -104
  4. package/packages/api/lib/types/applications.d.ts +10 -62
  5. package/packages/api/package.json +1 -1
  6. package/packages/api/src/types/applications.d.ts +10 -62
  7. package/packages/apps/_app.config.js +80 -0
  8. package/packages/apps/discounts/lib/discounts.config.d.ts +14 -0
  9. package/packages/apps/discounts/lib/discounts.config.js +19 -0
  10. package/packages/apps/discounts/lib/discounts.config.js.map +1 -0
  11. package/packages/apps/discounts/lib/discounts.d.ts +2 -0
  12. package/packages/apps/discounts/lib/discounts.js +7 -0
  13. package/packages/apps/discounts/lib/discounts.js.map +1 -0
  14. package/packages/apps/discounts/lib/index.d.ts +1 -3
  15. package/packages/apps/discounts/lib/index.js +1 -8
  16. package/packages/apps/discounts/lib/index.js.map +1 -1
  17. package/packages/apps/discounts/package.json +3 -2
  18. package/packages/apps/discounts/src/discounts.config.ts +25 -0
  19. package/packages/apps/discounts/src/discounts.ts +8 -0
  20. package/packages/apps/discounts/src/index.ts +1 -9
  21. package/packages/cli/lib/config-gcloud.js +79 -0
  22. package/packages/cli/lib/create-auth.js +7 -7
  23. package/packages/cli/lib/index.js +12 -1
  24. package/packages/cli/package.json +2 -2
  25. package/packages/cli/src/config-gcloud.ts +93 -0
  26. package/packages/cli/src/create-auth.ts +7 -7
  27. package/packages/cli/src/index.ts +13 -2
  28. package/packages/events/lib/firebase.js +0 -2
  29. package/packages/events/lib/firebase.js.map +1 -1
  30. package/packages/events/package.json +1 -1
  31. package/packages/events/src/firebase.ts +0 -2
  32. package/packages/firebase/lib/config.js +12 -8
  33. package/packages/firebase/lib/config.js.map +1 -1
  34. package/packages/firebase/lib/index.d.ts +0 -1
  35. package/packages/firebase/lib/index.js +0 -4
  36. package/packages/firebase/lib/index.js.map +1 -1
  37. package/packages/firebase/package.json +1 -1
  38. package/packages/firebase/src/config.ts +13 -8
  39. package/packages/firebase/src/index.ts +0 -4
  40. package/packages/modules/lib/firebase/call-app-module.js +1 -1
  41. package/packages/modules/lib/firebase/call-app-module.js.map +1 -1
  42. package/packages/modules/lib/firebase/handle-module.js.map +1 -1
  43. package/packages/modules/lib/firebase.js +0 -2
  44. package/packages/modules/lib/firebase.js.map +1 -1
  45. package/packages/modules/package.json +2 -2
  46. package/packages/modules/src/firebase/call-app-module.ts +1 -1
  47. package/packages/modules/src/firebase/handle-module.ts +3 -3
  48. package/packages/modules/src/firebase.ts +0 -2
  49. package/packages/passport/lib/firebase/handle-passport.js +108 -0
  50. package/packages/passport/lib/firebase/handle-passport.js.map +1 -0
  51. package/packages/passport/lib/firebase/serve-passport-api.js +41 -0
  52. package/packages/passport/lib/firebase/serve-passport-api.js.map +1 -0
  53. package/packages/passport/lib/firebase.js +22 -5
  54. package/packages/passport/lib/firebase.js.map +1 -1
  55. package/packages/passport/package.json +1 -1
  56. package/packages/passport/src/firebase/handle-passport.ts +149 -0
  57. package/packages/passport/src/firebase/serve-passport-api.ts +62 -0
  58. package/packages/passport/src/firebase.ts +32 -7
  59. package/packages/ssr/package.json +1 -1
  60. package/packages/storefront/package.json +12 -2
  61. package/packages/types/index.ts +9 -0
  62. package/packages/types/package.json +1 -1
  63. package/pnpm-lock.yaml +1278 -614
  64. package/packages/firebase/lib/handlers/auth-callback.d.ts +0 -3
  65. package/packages/firebase/lib/handlers/auth-callback.js +0 -45
  66. package/packages/firebase/lib/handlers/auth-callback.js.map +0 -1
  67. package/packages/firebase/src/handlers/auth-callback.ts +0 -49
  68. package/packages/passport/src/firebase/.gitkeep +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
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.51](https://github.com/ecomplus/cloud-commerce/compare/v0.0.50...v0.0.51) (2022-08-17)
6
+
7
+
8
+ ### Features
9
+
10
+ * **cli:** Create Google Cloud IAM account and key on setup ([#40](https://github.com/ecomplus/cloud-commerce/issues/40)) ([f532888](https://github.com/ecomplus/cloud-commerce/commit/f532888957c45ea6cfb6511840f33861ec53ed42))
11
+ * **passport:** Setup Passport API token endpoint handling Firebase Auth ([#38](https://github.com/ecomplus/cloud-commerce/issues/38)) ([bd7863d](https://github.com/ecomplus/cloud-commerce/commit/bd7863df4a8d6511ff7297987ff23a81993c70ad))
12
+ * **types:** Add `AppModuleBody` object definition ([b4a1fbd](https://github.com/ecomplus/cloud-commerce/commit/b4a1fbdf2b2b034408cab83a555c5b7bbcc4c3f8))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **api:** Update applications schema interface ([af7e152](https://github.com/ecomplus/cloud-commerce/commit/af7e152932a9ee9343cf4e7cc10ec886d47cd2b7))
18
+ * **cli:** Must deploy with `--force` option for functions failure police ([384d28a](https://github.com/ecomplus/cloud-commerce/commit/384d28a7406130058112b2f31ece4a81aa6ccfe7))
19
+ * **cli:** Properly run deploy with `--force` option ([d4d8f18](https://github.com/ecomplus/cloud-commerce/commit/d4d8f18cfbabbc61abc360d4649d7db03671da09))
20
+ * **cli:** Setup authentication with almost all permissions ([6f0ccb6](https://github.com/ecomplus/cloud-commerce/commit/6f0ccb6e7852f5c4542f02550ee84d02bd308115))
21
+ * Config getter/setter to work on browser and node ([fedc4c8](https://github.com/ecomplus/cloud-commerce/commit/fedc4c88e2d71a02df0ca87ceade856e489b2a2e))
22
+ * **deps:** Bump astro stable v1 ([8f4d3cb](https://github.com/ecomplus/cloud-commerce/commit/8f4d3cbf43dff334e53150a93df1c0f40c1b9580))
23
+ * **deps:** Update all non-major dependencies ([#37](https://github.com/ecomplus/cloud-commerce/issues/37)) ([5f5bb37](https://github.com/ecomplus/cloud-commerce/commit/5f5bb37a8f2e4477a0a76e564fcdf207df08cada))
24
+ * **deps:** Update all non-major dependencies ([#39](https://github.com/ecomplus/cloud-commerce/issues/39)) ([56e684d](https://github.com/ecomplus/cloud-commerce/commit/56e684d3eaddc8f00b789ca8d429330b69bc26c7))
25
+ * Keep old (discounts) apps IDs for backport compatibility ([28833af](https://github.com/ecomplus/cloud-commerce/commit/28833af45137a1ffd074900d5caf6946dfb4b49a)), closes [#L2](https://github.com/ecomplus/cloud-commerce/issues/L2)
26
+ * **modules:** Must call insternal apps passing module body (data) ([42d6d1d](https://github.com/ecomplus/cloud-commerce/commit/42d6d1d2464ee7fcd7d81e79ac777dc11eb85889))
27
+ * **passport:** Consider valid tokens stored with at least 2 min to expire ([ac2b0b8](https://github.com/ecomplus/cloud-commerce/commit/ac2b0b88645b45dfa2c2d3dda49832b15537e711))
28
+ * Stop hiding cloud commerce default API key ([f4389f7](https://github.com/ecomplus/cloud-commerce/commit/f4389f7b3d82960305f1ef34bdb3c5e83c4ce11a))
29
+
5
30
  ### [0.0.50](https://github.com/ecomplus/cloud-commerce/compare/v0.0.49...v0.0.50) (2022-08-07)
6
31
 
7
32
  ### [0.0.49](https://github.com/ecomplus/cloud-commerce/compare/v0.0.48...v0.0.49) (2022-08-07)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.50",
4
+ "version": "0.0.51",
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>",
@@ -20,21 +20,21 @@
20
20
  "@commitlint/config-conventional": "^17.0.3",
21
21
  "@commitlint/rules": "^17.0.0",
22
22
  "@types/node": "^18.0.5",
23
- "@typescript-eslint/eslint-plugin": "^5.32.0",
24
- "@typescript-eslint/parser": "^5.32.0",
25
- "esbuild": "^0.14.51",
26
- "eslint": "^8.21.0",
23
+ "@typescript-eslint/eslint-plugin": "^5.33.0",
24
+ "@typescript-eslint/parser": "^5.33.0",
25
+ "esbuild": "^0.15.3",
26
+ "eslint": "^8.22.0",
27
27
  "eslint-config-airbnb-base": "^15.0.0",
28
28
  "eslint-plugin-import": "^2.26.0",
29
29
  "eslint-plugin-vue": "^9.3.0",
30
30
  "husky": "^8.0.1",
31
31
  "node-fetch": "^3.2.10",
32
32
  "standard-version": "^9.5.0",
33
- "turbo": "^1.4.0",
33
+ "turbo": "^1.4.3",
34
34
  "typescript": "^4.7.4",
35
- "vite": "3",
36
- "vitest": "^0.20.2",
37
- "zx": "^7.0.7"
35
+ "vite": "^3.0.7",
36
+ "vitest": "^0.21.1",
37
+ "zx": "^7.0.8"
38
38
  },
39
39
  "scripts": {
40
40
  "postinstall": "husky install",
@@ -1220,13 +1220,11 @@ declare const api: {
1220
1220
  version_date?: string | undefined;
1221
1221
  type: "dashboard" | "storefront" | "external";
1222
1222
  modules?: {
1223
- term_searched?: import("./types/applications").Module | undefined;
1224
- cart_confirmed?: import("./types/applications").Module1 | undefined;
1225
- calculate_shipping?: import("./types/applications").Module2 | undefined;
1226
- list_payments?: import("./types/applications").Module3 | undefined;
1227
- apply_discount?: import("./types/applications").Module4 | undefined;
1228
- create_transaction?: import("./types/applications").Module5 | undefined;
1229
- checkout_done?: import("./types/applications").Module6 | undefined;
1223
+ calculate_shipping?: import("./types/applications").Module | undefined;
1224
+ list_payments?: import("./types/applications").Module1 | undefined;
1225
+ apply_discount?: import("./types/applications").Module2 | undefined;
1226
+ create_transaction?: import("./types/applications").Module3 | undefined;
1227
+ checkout_done?: import("./types/applications").Module4 | undefined;
1230
1228
  } | undefined;
1231
1229
  admin_settings?: {
1232
1230
  [k: string]: {
@@ -1236,12 +1234,6 @@ declare const api: {
1236
1234
  hide?: boolean | undefined;
1237
1235
  };
1238
1236
  } | undefined;
1239
- storefront_script_uri?: string | undefined;
1240
- auth_callback_uri?: string | undefined;
1241
- auth_scope?: {
1242
- [k: string]: ("all" | "GET" | "POST" | "PATCH" | "PUT" | "DELETE")[];
1243
- authentications?: "GET"[] | undefined;
1244
- } | undefined;
1245
1237
  data?: {
1246
1238
  [k: string]: unknown;
1247
1239
  } | undefined;
@@ -2467,13 +2459,11 @@ declare const api: {
2467
2459
  version_date?: string | undefined;
2468
2460
  type: "dashboard" | "storefront" | "external";
2469
2461
  modules?: {
2470
- term_searched?: import("./types/applications").Module | undefined;
2471
- cart_confirmed?: import("./types/applications").Module1 | undefined;
2472
- calculate_shipping?: import("./types/applications").Module2 | undefined;
2473
- list_payments?: import("./types/applications").Module3 | undefined;
2474
- apply_discount?: import("./types/applications").Module4 | undefined;
2475
- create_transaction?: import("./types/applications").Module5 | undefined;
2476
- checkout_done?: import("./types/applications").Module6 | undefined;
2462
+ calculate_shipping?: import("./types/applications").Module | undefined;
2463
+ list_payments?: import("./types/applications").Module1 | undefined;
2464
+ apply_discount?: import("./types/applications").Module2 | undefined;
2465
+ create_transaction?: import("./types/applications").Module3 | undefined;
2466
+ checkout_done?: import("./types/applications").Module4 | undefined;
2477
2467
  } | undefined;
2478
2468
  admin_settings?: {
2479
2469
  [k: string]: {
@@ -2483,12 +2473,6 @@ declare const api: {
2483
2473
  hide?: boolean | undefined;
2484
2474
  };
2485
2475
  } | undefined;
2486
- storefront_script_uri?: string | undefined;
2487
- auth_callback_uri?: string | undefined;
2488
- auth_scope?: {
2489
- [k: string]: ("all" | "GET" | "POST" | "PATCH" | "PUT" | "DELETE")[];
2490
- authentications?: "GET"[] | undefined;
2491
- } | undefined;
2492
2476
  data?: {
2493
2477
  [k: string]: unknown;
2494
2478
  } | undefined;
@@ -3712,13 +3696,11 @@ declare const api: {
3712
3696
  version_date?: string | undefined;
3713
3697
  type: "dashboard" | "storefront" | "external";
3714
3698
  modules?: {
3715
- term_searched?: import("./types/applications").Module | undefined;
3716
- cart_confirmed?: import("./types/applications").Module1 | undefined;
3717
- calculate_shipping?: import("./types/applications").Module2 | undefined;
3718
- list_payments?: import("./types/applications").Module3 | undefined;
3719
- apply_discount?: import("./types/applications").Module4 | undefined;
3720
- create_transaction?: import("./types/applications").Module5 | undefined;
3721
- checkout_done?: import("./types/applications").Module6 | undefined;
3699
+ calculate_shipping?: import("./types/applications").Module | undefined;
3700
+ list_payments?: import("./types/applications").Module1 | undefined;
3701
+ apply_discount?: import("./types/applications").Module2 | undefined;
3702
+ create_transaction?: import("./types/applications").Module3 | undefined;
3703
+ checkout_done?: import("./types/applications").Module4 | undefined;
3722
3704
  } | undefined;
3723
3705
  admin_settings?: {
3724
3706
  [k: string]: {
@@ -3728,12 +3710,6 @@ declare const api: {
3728
3710
  hide?: boolean | undefined;
3729
3711
  };
3730
3712
  } | undefined;
3731
- storefront_script_uri?: string | undefined;
3732
- auth_callback_uri?: string | undefined;
3733
- auth_scope?: {
3734
- [k: string]: ("all" | "GET" | "POST" | "PATCH" | "PUT" | "DELETE")[];
3735
- authentications?: "GET"[] | undefined;
3736
- } | undefined;
3737
3713
  data?: {
3738
3714
  [k: string]: unknown;
3739
3715
  } | undefined;
@@ -4959,13 +4935,11 @@ declare const api: {
4959
4935
  version_date?: string | undefined;
4960
4936
  type: "dashboard" | "storefront" | "external";
4961
4937
  modules?: {
4962
- term_searched?: import("./types/applications").Module | undefined;
4963
- cart_confirmed?: import("./types/applications").Module1 | undefined;
4964
- calculate_shipping?: import("./types/applications").Module2 | undefined;
4965
- list_payments?: import("./types/applications").Module3 | undefined;
4966
- apply_discount?: import("./types/applications").Module4 | undefined;
4967
- create_transaction?: import("./types/applications").Module5 | undefined;
4968
- checkout_done?: import("./types/applications").Module6 | undefined;
4938
+ calculate_shipping?: import("./types/applications").Module | undefined;
4939
+ list_payments?: import("./types/applications").Module1 | undefined;
4940
+ apply_discount?: import("./types/applications").Module2 | undefined;
4941
+ create_transaction?: import("./types/applications").Module3 | undefined;
4942
+ checkout_done?: import("./types/applications").Module4 | undefined;
4969
4943
  } | undefined;
4970
4944
  admin_settings?: {
4971
4945
  [k: string]: {
@@ -4975,12 +4949,6 @@ declare const api: {
4975
4949
  hide?: boolean | undefined;
4976
4950
  };
4977
4951
  } | undefined;
4978
- storefront_script_uri?: string | undefined;
4979
- auth_callback_uri?: string | undefined;
4980
- auth_scope?: {
4981
- [k: string]: ("all" | "GET" | "POST" | "PATCH" | "PUT" | "DELETE")[];
4982
- authentications?: "GET"[] | undefined;
4983
- } | undefined;
4984
4952
  data?: {
4985
4953
  [k: string]: unknown;
4986
4954
  } | undefined;
@@ -6228,13 +6196,11 @@ declare const post: <E extends Endpoint, C extends AbstractedAuthConfig>(endpoin
6228
6196
  version_date?: string | undefined;
6229
6197
  type: "dashboard" | "storefront" | "external";
6230
6198
  modules?: {
6231
- term_searched?: import("./types/applications").Module | undefined;
6232
- cart_confirmed?: import("./types/applications").Module1 | undefined;
6233
- calculate_shipping?: import("./types/applications").Module2 | undefined;
6234
- list_payments?: import("./types/applications").Module3 | undefined;
6235
- apply_discount?: import("./types/applications").Module4 | undefined;
6236
- create_transaction?: import("./types/applications").Module5 | undefined;
6237
- checkout_done?: import("./types/applications").Module6 | undefined;
6199
+ calculate_shipping?: import("./types/applications").Module | undefined;
6200
+ list_payments?: import("./types/applications").Module1 | undefined;
6201
+ apply_discount?: import("./types/applications").Module2 | undefined;
6202
+ create_transaction?: import("./types/applications").Module3 | undefined;
6203
+ checkout_done?: import("./types/applications").Module4 | undefined;
6238
6204
  } | undefined;
6239
6205
  admin_settings?: {
6240
6206
  [k: string]: {
@@ -6244,12 +6210,6 @@ declare const post: <E extends Endpoint, C extends AbstractedAuthConfig>(endpoin
6244
6210
  hide?: boolean | undefined;
6245
6211
  };
6246
6212
  } | undefined;
6247
- storefront_script_uri?: string | undefined;
6248
- auth_callback_uri?: string | undefined;
6249
- auth_scope?: {
6250
- [k: string]: ("all" | "GET" | "POST" | "PATCH" | "PUT" | "DELETE")[];
6251
- authentications?: "GET"[] | undefined;
6252
- } | undefined;
6253
6213
  data?: {
6254
6214
  [k: string]: unknown;
6255
6215
  } | undefined;
@@ -7475,13 +7435,11 @@ declare const post: <E extends Endpoint, C extends AbstractedAuthConfig>(endpoin
7475
7435
  version_date?: string | undefined;
7476
7436
  type: "dashboard" | "storefront" | "external";
7477
7437
  modules?: {
7478
- term_searched?: import("./types/applications").Module | undefined;
7479
- cart_confirmed?: import("./types/applications").Module1 | undefined;
7480
- calculate_shipping?: import("./types/applications").Module2 | undefined;
7481
- list_payments?: import("./types/applications").Module3 | undefined;
7482
- apply_discount?: import("./types/applications").Module4 | undefined;
7483
- create_transaction?: import("./types/applications").Module5 | undefined;
7484
- checkout_done?: import("./types/applications").Module6 | undefined;
7438
+ calculate_shipping?: import("./types/applications").Module | undefined;
7439
+ list_payments?: import("./types/applications").Module1 | undefined;
7440
+ apply_discount?: import("./types/applications").Module2 | undefined;
7441
+ create_transaction?: import("./types/applications").Module3 | undefined;
7442
+ checkout_done?: import("./types/applications").Module4 | undefined;
7485
7443
  } | undefined;
7486
7444
  admin_settings?: {
7487
7445
  [k: string]: {
@@ -7491,12 +7449,6 @@ declare const post: <E extends Endpoint, C extends AbstractedAuthConfig>(endpoin
7491
7449
  hide?: boolean | undefined;
7492
7450
  };
7493
7451
  } | undefined;
7494
- storefront_script_uri?: string | undefined;
7495
- auth_callback_uri?: string | undefined;
7496
- auth_scope?: {
7497
- [k: string]: ("all" | "GET" | "POST" | "PATCH" | "PUT" | "DELETE")[];
7498
- authentications?: "GET"[] | undefined;
7499
- } | undefined;
7500
7452
  data?: {
7501
7453
  [k: string]: unknown;
7502
7454
  } | undefined;
@@ -8720,13 +8672,11 @@ declare const put: <E extends `products/${string}` | `categories/${string}` | `b
8720
8672
  version_date?: string | undefined;
8721
8673
  type: "dashboard" | "storefront" | "external";
8722
8674
  modules?: {
8723
- term_searched?: import("./types/applications").Module | undefined;
8724
- cart_confirmed?: import("./types/applications").Module1 | undefined;
8725
- calculate_shipping?: import("./types/applications").Module2 | undefined;
8726
- list_payments?: import("./types/applications").Module3 | undefined;
8727
- apply_discount?: import("./types/applications").Module4 | undefined;
8728
- create_transaction?: import("./types/applications").Module5 | undefined;
8729
- checkout_done?: import("./types/applications").Module6 | undefined;
8675
+ calculate_shipping?: import("./types/applications").Module | undefined;
8676
+ list_payments?: import("./types/applications").Module1 | undefined;
8677
+ apply_discount?: import("./types/applications").Module2 | undefined;
8678
+ create_transaction?: import("./types/applications").Module3 | undefined;
8679
+ checkout_done?: import("./types/applications").Module4 | undefined;
8730
8680
  } | undefined;
8731
8681
  admin_settings?: {
8732
8682
  [k: string]: {
@@ -8736,12 +8686,6 @@ declare const put: <E extends `products/${string}` | `categories/${string}` | `b
8736
8686
  hide?: boolean | undefined;
8737
8687
  };
8738
8688
  } | undefined;
8739
- storefront_script_uri?: string | undefined;
8740
- auth_callback_uri?: string | undefined;
8741
- auth_scope?: {
8742
- [k: string]: ("all" | "GET" | "POST" | "PATCH" | "PUT" | "DELETE")[];
8743
- authentications?: "GET"[] | undefined;
8744
- } | undefined;
8745
8689
  data?: {
8746
8690
  [k: string]: unknown;
8747
8691
  } | undefined;
@@ -9967,13 +9911,11 @@ declare const put: <E extends `products/${string}` | `categories/${string}` | `b
9967
9911
  version_date?: string | undefined;
9968
9912
  type: "dashboard" | "storefront" | "external";
9969
9913
  modules?: {
9970
- term_searched?: import("./types/applications").Module | undefined;
9971
- cart_confirmed?: import("./types/applications").Module1 | undefined;
9972
- calculate_shipping?: import("./types/applications").Module2 | undefined;
9973
- list_payments?: import("./types/applications").Module3 | undefined;
9974
- apply_discount?: import("./types/applications").Module4 | undefined;
9975
- create_transaction?: import("./types/applications").Module5 | undefined;
9976
- checkout_done?: import("./types/applications").Module6 | undefined;
9914
+ calculate_shipping?: import("./types/applications").Module | undefined;
9915
+ list_payments?: import("./types/applications").Module1 | undefined;
9916
+ apply_discount?: import("./types/applications").Module2 | undefined;
9917
+ create_transaction?: import("./types/applications").Module3 | undefined;
9918
+ checkout_done?: import("./types/applications").Module4 | undefined;
9977
9919
  } | undefined;
9978
9920
  admin_settings?: {
9979
9921
  [k: string]: {
@@ -9983,12 +9925,6 @@ declare const put: <E extends `products/${string}` | `categories/${string}` | `b
9983
9925
  hide?: boolean | undefined;
9984
9926
  };
9985
9927
  } | undefined;
9986
- storefront_script_uri?: string | undefined;
9987
- auth_callback_uri?: string | undefined;
9988
- auth_scope?: {
9989
- [k: string]: ("all" | "GET" | "POST" | "PATCH" | "PUT" | "DELETE")[];
9990
- authentications?: "GET"[] | undefined;
9991
- } | undefined;
9992
9928
  data?: {
9993
9929
  [k: string]: unknown;
9994
9930
  } | undefined;
@@ -46,13 +46,11 @@ export interface Applications {
46
46
  * Modules handled by this app
47
47
  */
48
48
  modules?: {
49
- term_searched?: Module;
50
- cart_confirmed?: Module1;
51
- calculate_shipping?: Module2;
52
- list_payments?: Module3;
53
- apply_discount?: Module4;
54
- create_transaction?: Module5;
55
- checkout_done?: Module6;
49
+ calculate_shipping?: Module;
50
+ list_payments?: Module1;
51
+ apply_discount?: Module2;
52
+ create_transaction?: Module3;
53
+ checkout_done?: Module4;
56
54
  };
57
55
  /**
58
56
  * Configuration options for staff on admin dashboard, saved on app data
@@ -77,30 +75,6 @@ export interface Applications {
77
75
  hide?: boolean;
78
76
  };
79
77
  };
80
- /**
81
- * Link to client side script (JS) to load on storefront
82
- */
83
- storefront_script_uri?: string;
84
- /**
85
- * Endpoint that receives POST back with authentication credentials, must be HTTPS
86
- */
87
- auth_callback_uri?: string;
88
- /**
89
- * If this app uses authentication, list the needed permissions
90
- */
91
- auth_scope?: {
92
- /**
93
- * Special scope to read authentications
94
- */
95
- authentications?: 'GET'[];
96
- /**
97
- * Requested resource, cannot be 'applications', 'authentications' or '$update' here
98
- *
99
- * This interface was referenced by `undefined`'s JSON-Schema definition
100
- * via the `patternProperty` "^([$]?(?!app|aut|upd)([a-z][a-z0-9/_]{1,60}[^/]))$".
101
- */
102
- [k: string]: ('all' | 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE')[];
103
- };
104
78
  /**
105
79
  * Application object data, schema free
106
80
  */
@@ -124,36 +98,10 @@ export interface Applications {
124
98
  */
125
99
  notes?: string;
126
100
  }
127
- /**
128
- * Triggered after each term searched on storefront
129
- */
130
- export interface Module {
131
- /**
132
- * Whether current app is enabled to handle the module requests
133
- */
134
- enabled: boolean;
135
- /**
136
- * URL to receive POST request of respective module
137
- */
138
- endpoint: string;
139
- }
140
- /**
141
- * Triggered after each cart saves on storefront, just before checkout
142
- */
143
- export interface Module1 {
144
- /**
145
- * Whether current app is enabled to handle the module requests
146
- */
147
- enabled: boolean;
148
- /**
149
- * URL to receive POST request of respective module
150
- */
151
- endpoint: string;
152
- }
153
101
  /**
154
102
  * Triggered to calculate shipping options, must return calculated values and times
155
103
  */
156
- export interface Module2 {
104
+ export interface Module {
157
105
  /**
158
106
  * Whether current app is enabled to handle the module requests
159
107
  */
@@ -166,7 +114,7 @@ export interface Module2 {
166
114
  /**
167
115
  * Triggered when listing payments, must return available methods
168
116
  */
169
- export interface Module3 {
117
+ export interface Module1 {
170
118
  /**
171
119
  * Whether current app is enabled to handle the module requests
172
120
  */
@@ -179,7 +127,7 @@ export interface Module3 {
179
127
  /**
180
128
  * Triggered to validate and apply discout value, must return discount and conditions
181
129
  */
182
- export interface Module4 {
130
+ export interface Module2 {
183
131
  /**
184
132
  * Whether current app is enabled to handle the module requests
185
133
  */
@@ -192,7 +140,7 @@ export interface Module4 {
192
140
  /**
193
141
  * Triggered when order is being closed, must create payment transaction and return info
194
142
  */
195
- export interface Module5 {
143
+ export interface Module3 {
196
144
  /**
197
145
  * Whether current app is enabled to handle the module requests
198
146
  */
@@ -205,7 +153,7 @@ export interface Module5 {
205
153
  /**
206
154
  * Triggered after each order created from storefront, could return custom fields
207
155
  */
208
- export interface Module6 {
156
+ export interface Module4 {
209
157
  /**
210
158
  * Whether current app is enabled to handle the module requests
211
159
  */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.0.50",
4
+ "version": "0.0.51",
5
5
  "description": "E-Com Plus Cloud Commerce APIs client/adapter",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -46,13 +46,11 @@ export interface Applications {
46
46
  * Modules handled by this app
47
47
  */
48
48
  modules?: {
49
- term_searched?: Module;
50
- cart_confirmed?: Module1;
51
- calculate_shipping?: Module2;
52
- list_payments?: Module3;
53
- apply_discount?: Module4;
54
- create_transaction?: Module5;
55
- checkout_done?: Module6;
49
+ calculate_shipping?: Module;
50
+ list_payments?: Module1;
51
+ apply_discount?: Module2;
52
+ create_transaction?: Module3;
53
+ checkout_done?: Module4;
56
54
  };
57
55
  /**
58
56
  * Configuration options for staff on admin dashboard, saved on app data
@@ -77,30 +75,6 @@ export interface Applications {
77
75
  hide?: boolean;
78
76
  };
79
77
  };
80
- /**
81
- * Link to client side script (JS) to load on storefront
82
- */
83
- storefront_script_uri?: string;
84
- /**
85
- * Endpoint that receives POST back with authentication credentials, must be HTTPS
86
- */
87
- auth_callback_uri?: string;
88
- /**
89
- * If this app uses authentication, list the needed permissions
90
- */
91
- auth_scope?: {
92
- /**
93
- * Special scope to read authentications
94
- */
95
- authentications?: 'GET'[];
96
- /**
97
- * Requested resource, cannot be 'applications', 'authentications' or '$update' here
98
- *
99
- * This interface was referenced by `undefined`'s JSON-Schema definition
100
- * via the `patternProperty` "^([$]?(?!app|aut|upd)([a-z][a-z0-9/_]{1,60}[^/]))$".
101
- */
102
- [k: string]: ('all' | 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE')[];
103
- };
104
78
  /**
105
79
  * Application object data, schema free
106
80
  */
@@ -124,36 +98,10 @@ export interface Applications {
124
98
  */
125
99
  notes?: string;
126
100
  }
127
- /**
128
- * Triggered after each term searched on storefront
129
- */
130
- export interface Module {
131
- /**
132
- * Whether current app is enabled to handle the module requests
133
- */
134
- enabled: boolean;
135
- /**
136
- * URL to receive POST request of respective module
137
- */
138
- endpoint: string;
139
- }
140
- /**
141
- * Triggered after each cart saves on storefront, just before checkout
142
- */
143
- export interface Module1 {
144
- /**
145
- * Whether current app is enabled to handle the module requests
146
- */
147
- enabled: boolean;
148
- /**
149
- * URL to receive POST request of respective module
150
- */
151
- endpoint: string;
152
- }
153
101
  /**
154
102
  * Triggered to calculate shipping options, must return calculated values and times
155
103
  */
156
- export interface Module2 {
104
+ export interface Module {
157
105
  /**
158
106
  * Whether current app is enabled to handle the module requests
159
107
  */
@@ -166,7 +114,7 @@ export interface Module2 {
166
114
  /**
167
115
  * Triggered when listing payments, must return available methods
168
116
  */
169
- export interface Module3 {
117
+ export interface Module1 {
170
118
  /**
171
119
  * Whether current app is enabled to handle the module requests
172
120
  */
@@ -179,7 +127,7 @@ export interface Module3 {
179
127
  /**
180
128
  * Triggered to validate and apply discout value, must return discount and conditions
181
129
  */
182
- export interface Module4 {
130
+ export interface Module2 {
183
131
  /**
184
132
  * Whether current app is enabled to handle the module requests
185
133
  */
@@ -192,7 +140,7 @@ export interface Module4 {
192
140
  /**
193
141
  * Triggered when order is being closed, must create payment transaction and return info
194
142
  */
195
- export interface Module5 {
143
+ export interface Module3 {
196
144
  /**
197
145
  * Whether current app is enabled to handle the module requests
198
146
  */
@@ -205,7 +153,7 @@ export interface Module5 {
205
153
  /**
206
154
  * Triggered after each order created from storefront, could return custom fields
207
155
  */
208
- export interface Module6 {
156
+ export interface Module4 {
209
157
  /**
210
158
  * Whether current app is enabled to handle the module requests
211
159
  */
@@ -0,0 +1,80 @@
1
+ /* eslint-disable comma-dangle, no-multi-spaces, key-spacing, max-len */
2
+
3
+ /**
4
+ * Edit base E-Com Plus Application object here.
5
+ * Ref.: https://developers.e-com.plus/docs/api/#/store/applications/
6
+ */
7
+
8
+ export default () => {
9
+ return {
10
+ app_id: 9000,
11
+ title: 'My Awesome E-Com Plus App',
12
+ slug: 'my-awesome-app',
13
+ type: 'external',
14
+ state: 'active',
15
+
16
+ /**
17
+ * Uncomment modules above to work with E-Com Plus Mods API on Storefront.
18
+ * Ref.: https://developers.e-com.plus/modules-api/
19
+ */
20
+ modules: {
21
+ /**
22
+ * Triggered to calculate shipping options, must return values and deadlines.
23
+ * Start editing `routes/ecom/modules/calculate-shipping.js`
24
+ */
25
+ // calculate_shipping: { enabled: true },
26
+
27
+ /**
28
+ * Triggered to validate and apply discount value, must return discount and conditions.
29
+ * Start editing `routes/ecom/modules/apply-discount.js`
30
+ */
31
+ // apply_discount: { enabled: true },
32
+
33
+ /**
34
+ * Triggered when listing payments, must return available payment methods.
35
+ * Start editing `routes/ecom/modules/list-payments.js`
36
+ */
37
+ // list_payments: { enabled: true },
38
+
39
+ /**
40
+ * Triggered when order is being closed, must create payment transaction and return info.
41
+ * Start editing `routes/ecom/modules/create-transaction.js`
42
+ */
43
+ // create_transaction: { enabled: true },
44
+ },
45
+
46
+ admin_settings: {
47
+ /**
48
+ * JSON schema based fields to be configured by merchant and saved to app `data` / `hidden_data`, such as:
49
+
50
+ webhook_uri: {
51
+ schema: {
52
+ type: 'string',
53
+ maxLength: 255,
54
+ format: 'uri',
55
+ title: 'Notifications URI',
56
+ description: 'Unique notifications URI available on your Custom App dashboard'
57
+ },
58
+ hide: true
59
+ },
60
+ token: {
61
+ schema: {
62
+ type: 'string',
63
+ maxLength: 50,
64
+ title: 'App token'
65
+ },
66
+ hide: true
67
+ },
68
+ opt_in: {
69
+ schema: {
70
+ type: 'boolean',
71
+ default: false,
72
+ title: 'Some config option'
73
+ },
74
+ hide: false
75
+ },
76
+
77
+ */
78
+ },
79
+ };
80
+ };