cloudcommerce 0.0.33 → 0.0.37

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 (94) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/action.yml +4 -0
  3. package/package.json +6 -6
  4. package/packages/__skeleton/package.json +4 -1
  5. package/packages/__skeleton/src/{index.js → index.ts} +0 -0
  6. package/packages/__skeleton/tsconfig.json +3 -0
  7. package/packages/api/lib/index.d.ts +2 -112
  8. package/packages/api/lib/types.d.ts +1 -1
  9. package/packages/api/package.json +1 -1
  10. package/packages/api/src/types.ts +4 -0
  11. package/packages/apps/discounts/lib/index.js +4 -0
  12. package/packages/apps/discounts/lib/index.js.map +1 -0
  13. package/packages/apps/discounts/package.json +4 -1
  14. package/packages/apps/discounts/src/index.ts +7 -0
  15. package/packages/apps/discounts/tsconfig.json +3 -0
  16. package/packages/cli/lib/index.js +11 -2
  17. package/packages/cli/package.json +1 -1
  18. package/packages/cli/src/index.ts +12 -3
  19. package/packages/firebase/lib/config.d.ts +15 -0
  20. package/packages/firebase/lib/config.js +3 -0
  21. package/packages/firebase/lib/config.js.map +1 -1
  22. package/packages/firebase/lib/defaults.d.ts +4 -0
  23. package/packages/firebase/lib/env.d.ts +8 -0
  24. package/packages/firebase/lib/handlers/check-store-events.d.ts +2 -0
  25. package/packages/firebase/lib/{methods → handlers}/check-store-events.js +11 -0
  26. package/packages/firebase/lib/handlers/check-store-events.js.map +1 -0
  27. package/packages/firebase/lib/index.d.ts +3 -0
  28. package/packages/firebase/lib/index.js +6 -30
  29. package/packages/firebase/lib/index.js.map +1 -1
  30. package/packages/firebase/lib/types.d.ts +6 -0
  31. package/packages/firebase/lib/types.js +2 -0
  32. package/packages/firebase/lib/types.js.map +1 -0
  33. package/packages/firebase/package.json +3 -1
  34. package/packages/firebase/src/config.ts +3 -0
  35. package/packages/firebase/src/handlers/check-store-events.ts +32 -0
  36. package/packages/firebase/src/index.ts +7 -31
  37. package/packages/firebase/src/types.ts +11 -0
  38. package/packages/firebase/tsconfig.json +4 -1
  39. package/packages/modules/CHANGELOG.md +1 -0
  40. package/packages/modules/README.md +1 -0
  41. package/packages/modules/lib/firebase.js +16 -0
  42. package/packages/modules/lib/firebase.js.map +1 -0
  43. package/packages/modules/lib/index.js +21 -0
  44. package/packages/modules/lib/index.js.map +1 -0
  45. package/packages/modules/package.json +37 -0
  46. package/packages/modules/schemas/@checkout.cjs +1015 -0
  47. package/packages/modules/schemas/apply_discount.cjs +324 -0
  48. package/packages/modules/schemas/calculate_shipping.cjs +666 -0
  49. package/packages/modules/schemas/create_transaction.cjs +1001 -0
  50. package/packages/modules/schemas/list_payments.cjs +852 -0
  51. package/packages/modules/scripts/build-types.sh +33 -0
  52. package/packages/modules/src/firebase/.gitkeep +0 -0
  53. package/packages/modules/src/firebase.ts +16 -0
  54. package/packages/modules/src/index.ts +21 -0
  55. package/packages/modules/tsconfig.json +3 -0
  56. package/packages/passport/CHANGELOG.md +1 -0
  57. package/packages/passport/README.md +1 -0
  58. package/packages/passport/lib/firebase.js +16 -0
  59. package/packages/passport/lib/firebase.js.map +1 -0
  60. package/packages/passport/lib/index.js +1 -0
  61. package/packages/passport/lib/index.js.map +1 -0
  62. package/packages/passport/package.json +36 -0
  63. package/packages/passport/src/firebase/.gitkeep +0 -0
  64. package/packages/passport/src/firebase.ts +16 -0
  65. package/packages/passport/src/index.ts +0 -0
  66. package/packages/passport/tsconfig.json +3 -0
  67. package/packages/ssr/CHANGELOG.md +1 -0
  68. package/packages/ssr/README.md +1 -0
  69. package/packages/ssr/lib/firebase.js +15 -0
  70. package/packages/ssr/lib/firebase.js.map +1 -0
  71. package/packages/ssr/lib/index.js +1 -0
  72. package/packages/ssr/lib/index.js.map +1 -0
  73. package/packages/ssr/package.json +37 -0
  74. package/packages/ssr/src/firebase/.gitkeep +0 -0
  75. package/packages/ssr/src/firebase.ts +15 -0
  76. package/packages/ssr/src/index.ts +0 -0
  77. package/packages/ssr/tsconfig.json +3 -0
  78. package/packages/storefront/package.json +2 -2
  79. package/packages/types/CHANGELOG.md +1 -0
  80. package/packages/types/README.md +1 -0
  81. package/packages/types/index.ts +66 -0
  82. package/packages/types/modules/@checkout:params.d.ts +920 -0
  83. package/packages/types/modules/apply_discount:params.d.ts +154 -0
  84. package/packages/types/modules/apply_discount:response.d.ts +71 -0
  85. package/packages/types/modules/calculate_shipping:params.d.ts +275 -0
  86. package/packages/types/modules/calculate_shipping:response.d.ts +402 -0
  87. package/packages/types/modules/create_transaction:params.d.ts +515 -0
  88. package/packages/types/modules/create_transaction:response.d.ts +261 -0
  89. package/packages/types/modules/list_payments:params.d.ts +323 -0
  90. package/packages/types/modules/list_payments:response.d.ts +266 -0
  91. package/packages/types/package.json +21 -0
  92. package/pnpm-lock.yaml +543 -274
  93. package/packages/firebase/lib/methods/check-store-events.js.map +0 -1
  94. package/packages/firebase/src/methods/check-store-events.ts +0 -20
package/CHANGELOG.md CHANGED
@@ -2,6 +2,50 @@
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.37](https://github.com/ecomplus/cloud-commerce/compare/v0.0.36...v0.0.37) (2022-07-27)
6
+
7
+
8
+ ### Features
9
+
10
+ * **passport:** Setup `@cloudcommerce/passport` pkg for passport API (customers authentication) ([00a5c4b](https://github.com/ecomplus/cloud-commerce/commit/00a5c4bfb08083a770a9148377e506b920037242))
11
+ * **ssr:** Setup `@cloudcommerce/ssr` pkg to deploy isolated function ([59b8686](https://github.com/ecomplus/cloud-commerce/commit/59b8686efece3256b7a3809762601d4949d116f3))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **firebase:** Proper named imports from `firebase-admin` (cjs) package ([74aca73](https://github.com/ecomplus/cloud-commerce/commit/74aca73a76431d7d8f3f3e5c862085284cb2a6bd))
17
+ * **firebase:** Remove (test only) z function and ssr (moved to `@cloudcommerce/ssr`) ([dc8b8e5](https://github.com/ecomplus/cloud-commerce/commit/dc8b8e5d706f535806b306d8b24c34e4acdf8d7f))
18
+ * **modules:** Add `/firebase` named export to package.json ([0d3520f](https://github.com/ecomplus/cloud-commerce/commit/0d3520fc9b24877af5b14127e168ad2280b8ca4e))
19
+
20
+ ### [0.0.36](https://github.com/ecomplus/cloud-commerce/compare/v0.0.35...v0.0.36) (2022-07-27)
21
+
22
+ ### [0.0.35](https://github.com/ecomplus/cloud-commerce/compare/v0.0.34...v0.0.35) (2022-07-27)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **modules:** Prevent cyclic dependencies moving types to `@cloudcommerce/types` pkg ([52f46ab](https://github.com/ecomplus/cloud-commerce/commit/52f46ab0332050b8e661e47c400a8084728d47e8))
28
+
29
+ ### [0.0.34](https://github.com/ecomplus/cloud-commerce/compare/v0.0.33...v0.0.34) (2022-07-27)
30
+
31
+
32
+ ### Features
33
+
34
+ * **cli:** Suggest `npx kill-port` on serve "port taken" error ([99f955e](https://github.com/ecomplus/cloud-commerce/commit/99f955eeb1f11664a988d969c48de217921f35fd))
35
+ * **deps:** Update astro to RC and vite v3 ([4336f81](https://github.com/ecomplus/cloud-commerce/commit/4336f81d18d82654f638ba25fc618d6cb6612f24))
36
+ * **firebase:** Move base functions options (region) to config object ([b691149](https://github.com/ecomplus/cloud-commerce/commit/b691149c3744d56f2f472f86218cf72c4bc56669))
37
+ * GH Action also pass optional `ecom-store-id` input to functions .env ([ed7771f](https://github.com/ecomplus/cloud-commerce/commit/ed7771fe50e987ffff120d4061c5c73f85e3f091))
38
+ * **modules:** Add new `@cloudcommerce/modules` pkg for app modules schema and typedefs [[#29](https://github.com/ecomplus/cloud-commerce/issues/29)] ([a7b833c](https://github.com/ecomplus/cloud-commerce/commit/a7b833c53cc814d89a8137aeb49bc3a41f87a2ce))
39
+ * **modules:** Start setting modules Firebase Functions ([53bb594](https://github.com/ecomplus/cloud-commerce/commit/53bb594585966c56cfa36a8cd35c17e50eb704a7))
40
+ * **types:** Add new `@cloudcommerce/types` pkg for reusable types ([a5ca712](https://github.com/ecomplus/cloud-commerce/commit/a5ca7127c80a48fdbca6fec1c14badfc078f5aa8))
41
+ * **types:** Also exporting modules params and responses type interfaces ([57c207c](https://github.com/ecomplus/cloud-commerce/commit/57c207cb6f7af3c8c0007173cc49859e4ecba1f3))
42
+ * **types:** New `@cloudcommerce/types` pkg with reusable types ([fa59792](https://github.com/ecomplus/cloud-commerce/commit/fa59792ccc322d1b6f23766daefe4278f671775c))
43
+
44
+
45
+ ### Bug Fixes
46
+
47
+ * **deps:** Update all non-major dependencies ([#33](https://github.com/ecomplus/cloud-commerce/issues/33)) ([ac90a64](https://github.com/ecomplus/cloud-commerce/commit/ac90a64ca72fda97d30c3b214a801f5947267e12))
48
+
5
49
  ### [0.0.33](https://github.com/ecomplus/cloud-commerce/compare/v0.0.32...v0.0.33) (2022-07-20)
6
50
 
7
51
 
package/action.yml CHANGED
@@ -14,6 +14,8 @@ inputs:
14
14
  ecom-api-key:
15
15
  description: 'E-Com Plus store API key'
16
16
  required: true
17
+ ecom-store-id:
18
+ description: 'Store ID if defined in config.json'
17
19
 
18
20
  outputs: {}
19
21
 
@@ -47,11 +49,13 @@ runs:
47
49
  FIREBASE_SERVICE_ACCOUNT: ${{ inputs.firebase-service-account }}
48
50
  ECOM_AUTHENTICATION_ID: ${{ inputs.ecom-authentication-id }}
49
51
  ECOM_API_KEY: ${{ inputs.ecom-api-key }}
52
+ ECOM_STORE_ID: ${{ inputs.ecom-store-id }}
50
53
  run: |
51
54
  export GAC_FILENAME=".gac-$RANDOM.json"
52
55
  echo $FIREBASE_SERVICE_ACCOUNT > $GAC_FILENAME
53
56
  printf "ECOM_AUTHENTICATION_ID=$ECOM_AUTHENTICATION_ID
54
57
  ECOM_API_KEY=$ECOM_API_KEY
58
+ ECOM_STORE_ID=$ECOM_STORE_ID
55
59
  GITHUB_TOKEN=$GITHUB_TOKEN
56
60
  " > functions/.env
57
61
  GOOGLE_APPLICATION_CREDENTIALS=$GAC_FILENAME npm run deploy
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.33",
4
+ "version": "0.0.37",
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>",
@@ -22,18 +22,18 @@
22
22
  "@types/node": "^18.0.5",
23
23
  "@typescript-eslint/eslint-plugin": "^5.30.7",
24
24
  "@typescript-eslint/parser": "^5.30.7",
25
- "esbuild": "^0.14.49",
25
+ "esbuild": "^0.14.50",
26
26
  "eslint": "^8.20.0",
27
27
  "eslint-config-airbnb-base": "^15.0.0",
28
28
  "eslint-plugin-import": "^2.26.0",
29
- "eslint-plugin-vue": "^9.2.0",
29
+ "eslint-plugin-vue": "^9.3.0",
30
30
  "husky": "^8.0.1",
31
31
  "node-fetch": "^3.2.9",
32
32
  "standard-version": "^9.5.0",
33
- "turbo": "^1.3.1",
33
+ "turbo": "^1.3.4",
34
34
  "typescript": "^4.7.4",
35
- "vite": "^2.9.14",
36
- "vitest": "^0.18.1",
35
+ "vite": "3",
36
+ "vitest": "^0.19.1",
37
37
  "zx": "^7.0.7"
38
38
  },
39
39
  "scripts": {
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "version": "0.0.0",
5
5
  "description": "E-Com Plus Cloud Commerce",
6
- "main": "src/index.js",
6
+ "main": "lib/index.js",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/ecomplus/cloud-commerce.git",
@@ -20,5 +20,8 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@cloudcommerce/api": "workspace:*"
23
+ },
24
+ "devDependencies": {
25
+ "@cloudcommerce/types": "workspace:*"
23
26
  }
24
27
  }
File without changes
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../tsconfig.json"
3
+ }
@@ -26,62 +26,7 @@ declare const api: {
26
26
  }>;
27
27
  get: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E, config?: C | undefined) => Promise<Response & {
28
28
  config: Config;
29
- data: E extends `${string}/${string}/${string}` ? any : E extends `products/${string}` ? import("./types").Products : E extends `categories/${string}` ? import("./types").Categories : E extends `brands/${string}` ? import("./types").Brands : E extends `collections/${string}` ? import("./types").Collections : E extends `grids/${string}` ? import("./types").Grids : E extends `carts/${string}` ? import("./types").Carts : E extends `orders/${string}` ? import("./types").Orders : E extends `customers/${string}` ? import("./types").Customers : E extends `stores/${string}` ? import("./types").Stores : E extends `applications/${string}` ? import("./types").Applications : E extends `authentications/${string}` ? import("./types/authentications").Authentications : E extends ResourceOpQuery ? {
30
- result: E extends infer T_1 ? T_1 extends E ? T_1 extends "products" | `products?${string}` ? import("./types").Products[] : T_1 extends "categories" | `categories?${string}` ? import("./types").Categories[] : T_1 extends "brands" | `brands?${string}` ? import("./types").Brands[] : T_1 extends "collections" | `collections?${string}` ? import("./types").Collections[] : T_1 extends "grids" | `grids?${string}` ? import("./types").Grids[] : T_1 extends "carts" | `carts?${string}` ? import("./types").Carts[] : T_1 extends "orders" | `orders?${string}` ? import("./types").Orders[] : T_1 extends "customers" | `customers?${string}` ? import("./types").Customers[] : T_1 extends "stores" | `stores?${string}` ? import("./types").Stores[] : T_1 extends "applications" | `applications?${string}` ? import("./types").Applications[] : T_1 extends "authentications" | `authentications?${string}` ? import("./types/authentications").Authentications[] : never : never : never;
31
- meta: {
32
- offset: number;
33
- limit: number;
34
- fields: string[];
35
- } & {
36
- count?: number | undefined;
37
- sort: {
38
- field: string;
39
- order: 1 | -1;
40
- }[];
41
- query: {
42
- [key: string]: any;
43
- };
44
- };
45
- } : E extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` | "events/me" ? {
46
- result: ({
47
- timestamp: string;
48
- store_id?: number | undefined;
49
- resource?: string | undefined;
50
- authentication_id?: (string & {
51
- length: 24;
52
- }) | null | undefined;
53
- resource_id?: (string & {
54
- length: 24;
55
- }) | undefined;
56
- action: string;
57
- modified_fields: string[];
58
- method?: number | undefined;
59
- endpoint?: string | undefined;
60
- body?: any;
61
- ip?: string | undefined;
62
- } & (E extends infer T_2 ? T_2 extends E ? T_2 extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" ? {
63
- resource_id: string & {
64
- length: 24;
65
- };
66
- authentication_id: (string & {
67
- length: 24;
68
- }) | null;
69
- } : T_2 extends `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` ? {
70
- authentication_id: (string & {
71
- length: 24;
72
- }) | null;
73
- } : T_2 extends "events/me" ? {
74
- resource: import("./types").Resource;
75
- resource_id: string & {
76
- length: 24;
77
- };
78
- } : never : never : never))[];
79
- meta: {
80
- offset: number;
81
- limit: number;
82
- fields: string[];
83
- };
84
- } : any;
29
+ data: E extends `${string}/${string}/${string}` ? any : E extends `products/${string}` ? import("./types").Products : E extends `categories/${string}` ? import("./types").Categories : E extends `brands/${string}` ? import("./types").Brands : E extends `collections/${string}` ? import("./types").Collections : E extends `grids/${string}` ? import("./types").Grids : E extends `carts/${string}` ? import("./types").Carts : E extends `orders/${string}` ? import("./types").Orders : E extends `customers/${string}` ? import("./types").Customers : E extends `stores/${string}` ? import("./types").Stores : E extends `applications/${string}` ? import("./types").Applications : E extends `authentications/${string}` ? import("./types").Authentications : E extends ResourceOpQuery ? import("./types").ResourceListResult<E> : E extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` | "events/me" ? import("./types").EventsResult<E> : any;
85
30
  }>;
86
31
  post: <E_1 extends Endpoint, C_1 extends AbstractedAuthConfig>(endpoint: E_1, body: E_1 extends "products" | `products/${string}` ? {
87
32
  categories?: {
@@ -5089,62 +5034,7 @@ declare type AbstractedAuthConfig = AbstractedConfig & {
5089
5034
  };
5090
5035
  declare const get: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E, config?: C | undefined) => Promise<Response & {
5091
5036
  config: Config;
5092
- data: E extends `${string}/${string}/${string}` ? any : E extends `products/${string}` ? import("./types").Products : E extends `categories/${string}` ? import("./types").Categories : E extends `brands/${string}` ? import("./types").Brands : E extends `collections/${string}` ? import("./types").Collections : E extends `grids/${string}` ? import("./types").Grids : E extends `carts/${string}` ? import("./types").Carts : E extends `orders/${string}` ? import("./types").Orders : E extends `customers/${string}` ? import("./types").Customers : E extends `stores/${string}` ? import("./types").Stores : E extends `applications/${string}` ? import("./types").Applications : E extends `authentications/${string}` ? import("./types/authentications").Authentications : E extends ResourceOpQuery ? {
5093
- result: E extends infer T_1 ? T_1 extends E ? T_1 extends "products" | `products?${string}` ? import("./types").Products[] : T_1 extends "categories" | `categories?${string}` ? import("./types").Categories[] : T_1 extends "brands" | `brands?${string}` ? import("./types").Brands[] : T_1 extends "collections" | `collections?${string}` ? import("./types").Collections[] : T_1 extends "grids" | `grids?${string}` ? import("./types").Grids[] : T_1 extends "carts" | `carts?${string}` ? import("./types").Carts[] : T_1 extends "orders" | `orders?${string}` ? import("./types").Orders[] : T_1 extends "customers" | `customers?${string}` ? import("./types").Customers[] : T_1 extends "stores" | `stores?${string}` ? import("./types").Stores[] : T_1 extends "applications" | `applications?${string}` ? import("./types").Applications[] : T_1 extends "authentications" | `authentications?${string}` ? import("./types/authentications").Authentications[] : never : never : never;
5094
- meta: {
5095
- offset: number;
5096
- limit: number;
5097
- fields: string[];
5098
- } & {
5099
- count?: number | undefined;
5100
- sort: {
5101
- field: string;
5102
- order: 1 | -1;
5103
- }[];
5104
- query: {
5105
- [key: string]: any;
5106
- };
5107
- };
5108
- } : E extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` | "events/me" ? {
5109
- result: ({
5110
- timestamp: string;
5111
- store_id?: number | undefined;
5112
- resource?: string | undefined;
5113
- authentication_id?: (string & {
5114
- length: 24;
5115
- }) | null | undefined;
5116
- resource_id?: (string & {
5117
- length: 24;
5118
- }) | undefined;
5119
- action: string;
5120
- modified_fields: string[];
5121
- method?: number | undefined;
5122
- endpoint?: string | undefined;
5123
- body?: any;
5124
- ip?: string | undefined;
5125
- } & (E extends infer T_2 ? T_2 extends E ? T_2 extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" ? {
5126
- resource_id: string & {
5127
- length: 24;
5128
- };
5129
- authentication_id: (string & {
5130
- length: 24;
5131
- }) | null;
5132
- } : T_2 extends `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` ? {
5133
- authentication_id: (string & {
5134
- length: 24;
5135
- }) | null;
5136
- } : T_2 extends "events/me" ? {
5137
- resource: import("./types").Resource;
5138
- resource_id: string & {
5139
- length: 24;
5140
- };
5141
- } : never : never : never))[];
5142
- meta: {
5143
- offset: number;
5144
- limit: number;
5145
- fields: string[];
5146
- };
5147
- } : any;
5037
+ data: E extends `${string}/${string}/${string}` ? any : E extends `products/${string}` ? import("./types").Products : E extends `categories/${string}` ? import("./types").Categories : E extends `brands/${string}` ? import("./types").Brands : E extends `collections/${string}` ? import("./types").Collections : E extends `grids/${string}` ? import("./types").Grids : E extends `carts/${string}` ? import("./types").Carts : E extends `orders/${string}` ? import("./types").Orders : E extends `customers/${string}` ? import("./types").Customers : E extends `stores/${string}` ? import("./types").Stores : E extends `applications/${string}` ? import("./types").Applications : E extends `authentications/${string}` ? import("./types").Authentications : E extends ResourceOpQuery ? import("./types").ResourceListResult<E> : E extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` | "events/me" ? import("./types").EventsResult<E> : any;
5148
5038
  }>;
5149
5039
  declare const post: <E extends Endpoint, C extends AbstractedAuthConfig>(endpoint: E, body: E extends "products" | `products/${string}` ? {
5150
5040
  categories?: {
@@ -91,4 +91,4 @@ declare type ResponseBody<TConfig extends Config> = TConfig['method'] extends 'p
91
91
  declare type DocSchema<Document extends any> = Omit<Document, '_id' | 'store_id' | 'store_ids' | 'created_at' | 'updated_at'>;
92
92
  declare type SetDocEndpoint<TResource extends Resource> = TResource | `${TResource}/${ResourceId}`;
93
93
  declare type RequestBody<TConfig extends Config> = TConfig['method'] extends undefined | 'get' | 'delete' ? undefined : TConfig['method'] extends 'patch' ? any : TConfig['endpoint'] extends SetDocEndpoint<'products'> ? DocSchema<Products> : TConfig['endpoint'] extends SetDocEndpoint<'categories'> ? DocSchema<Categories> : TConfig['endpoint'] extends SetDocEndpoint<'brands'> ? DocSchema<Brands> : TConfig['endpoint'] extends SetDocEndpoint<'collections'> ? DocSchema<Collections> : TConfig['endpoint'] extends SetDocEndpoint<'grids'> ? DocSchema<Grids> : TConfig['endpoint'] extends SetDocEndpoint<'carts'> ? DocSchema<Carts> : TConfig['endpoint'] extends SetDocEndpoint<'orders'> ? DocSchema<Orders> : TConfig['endpoint'] extends SetDocEndpoint<'customers'> ? DocSchema<Customers> : TConfig['endpoint'] extends SetDocEndpoint<'stores'> ? DocSchema<Stores> : TConfig['endpoint'] extends SetDocEndpoint<'applications'> ? DocSchema<Applications> : TConfig['endpoint'] extends SetDocEndpoint<'authentications'> ? DocSchema<Authentications> : any;
94
- export type { Products, Categories, Brands, Collections, Grids, Carts, Orders, Customers, Stores, Applications, Resource, ResourceAndId, ResourceOpQuery, Endpoint, Method, Config, ResponseBody, RequestBody, };
94
+ export type { Products, Categories, Brands, Collections, Grids, Carts, Orders, Customers, Stores, Applications, Authentications, Resource, ResourceId, ResourceAndId, ResourceOpQuery, Endpoint, Method, Config, ResourceListResult, EventsResult, ResponseBody, RequestBody, };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.0.33",
4
+ "version": "0.0.37",
5
5
  "description": "E-Com Plus Cloud Commerce APIs client/adapter",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -182,12 +182,16 @@ export type {
182
182
  Customers,
183
183
  Stores,
184
184
  Applications,
185
+ Authentications,
185
186
  Resource,
187
+ ResourceId,
186
188
  ResourceAndId,
187
189
  ResourceOpQuery,
188
190
  Endpoint,
189
191
  Method,
190
192
  Config,
193
+ ResourceListResult,
194
+ EventsResult,
191
195
  ResponseBody,
192
196
  RequestBody,
193
197
  };
@@ -0,0 +1,4 @@
1
+ export const events = [];
2
+
3
+ export const modules = {};
4
+ // # sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAiB,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-discounts",
3
3
  "type": "module",
4
- "version": "0.0.33",
4
+ "version": "0.0.37",
5
5
  "description": "E-Com Plus Cloud Commerce app for complex discount rules",
6
6
  "main": "functions/dist/index.js",
7
7
  "repository": {
@@ -20,5 +20,8 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@cloudcommerce/api": "workspace:*"
23
+ },
24
+ "devDependencies": {
25
+ "@cloudcommerce/types": "workspace:*"
23
26
  }
24
27
  }
@@ -0,0 +1,7 @@
1
+ import type { AppEventsTopic } from '@cloudcommerce/types';
2
+
3
+ export const events: AppEventsTopic[] = [];
4
+
5
+ export const applyDiscount = () => {
6
+ return {};
7
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../../tsconfig.json"
3
+ }
@@ -41,11 +41,20 @@ export default async () => {
41
41
  }
42
42
  return opts;
43
43
  }, '');
44
- const $firebase = async (cmd) => {
44
+ const $firebase = (cmd) => {
45
45
  return $`firebase --project=${projectId} ${cmd}${options}`;
46
46
  };
47
47
  if (argv._.includes('serve')) {
48
- return $firebase('emulators:start');
48
+ return $firebase('emulators:start').catch(async (err) => {
49
+ await echo`
50
+ Try killing open emulators with:
51
+ ${chalk.bold('npx kill-port 4000 9099 5001 8080 5000 8085 9199 4400 4500')}
52
+ `;
53
+ if (err.stdout.includes('port taken')) {
54
+ return process.exit(1);
55
+ }
56
+ throw err;
57
+ });
49
58
  }
50
59
  if (argv._.find((cmd) => /^(\w+:)?(shell|start)$/.test(cmd))) {
51
60
  return $firebase('functions:shell');
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.0.33",
4
+ "version": "0.0.37",
5
5
  "description": "E-Com Plus Cloud Commerce CLI tools",
6
6
  "bin": {
7
7
  "cloudcommerce": "./bin/run.mjs"
@@ -54,13 +54,23 @@ export default async () => {
54
54
  }
55
55
  return opts;
56
56
  }, '');
57
- const $firebase = async (cmd: string) => {
57
+ const $firebase = (cmd: string) => {
58
58
  return $`firebase --project=${projectId} ${cmd}${options}`;
59
59
  };
60
60
 
61
61
  if (argv._.includes('serve')) {
62
- return $firebase('emulators:start');
62
+ return $firebase('emulators:start').catch(async (err: any) => {
63
+ await echo`
64
+ Try killing open emulators with:
65
+ ${chalk.bold('npx kill-port 4000 9099 5001 8080 5000 8085 9199 4400 4500')}
66
+ `;
67
+ if (err.stdout.includes('port taken')) {
68
+ return process.exit(1);
69
+ }
70
+ throw err;
71
+ });
63
72
  }
73
+
64
74
  if (argv._.find((cmd) => /^(\w+:)?(shell|start)$/.test(cmd))) {
65
75
  return $firebase('functions:shell');
66
76
  }
@@ -70,7 +80,6 @@ export default async () => {
70
80
  if (argv._.includes('deploy')) {
71
81
  return $firebase('deploy');
72
82
  }
73
-
74
83
  if (argv._.includes('login')) {
75
84
  await $firebase('login');
76
85
  return login();
@@ -0,0 +1,15 @@
1
+ declare const _default: {
2
+ get(): {
3
+ hello: string;
4
+ lang: string;
5
+ currency: string;
6
+ currencySymbol: string;
7
+ countryCode: string;
8
+ storeId: number;
9
+ httpsFunctionOptions: {
10
+ region: string;
11
+ };
12
+ };
13
+ set(config: any): void;
14
+ };
15
+ export default _default;
@@ -12,6 +12,9 @@ const self = {
12
12
  currencySymbol: process.env.ECOM_CURRENCY_SYMBOL || DEFAULT_CURRENCY_SYMBOL,
13
13
  countryCode: process.env.ECOM_COUNTRY_CODE || DEFAULT_COUNTRY_CODE,
14
14
  storeId: Number(process.env.ECOM_STORE_ID),
15
+ httpsFunctionOptions: {
16
+ region: process.env.DEPLOY_REGION || 'us-east1',
17
+ },
15
18
  },
16
19
  };
17
20
 
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AAE9B,MAAM,IAAI,GAAG;IACX,QAAQ,EAAE;QACR,KAAK,EAAE,8BAA8B;QACrC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,YAAY;QAC3C,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,gBAAgB;QACvD,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,uBAAuB;QAC3E,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,oBAAoB;QAClE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;KAC3C;CACF,CAAC;AAEF,eAAe;IACb,GAAG;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IACD,GAAG,CAAC,MAAM;QACR,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AAE9B,MAAM,IAAI,GAAG;IACX,QAAQ,EAAE;QACR,KAAK,EAAE,8BAA8B;QACrC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,YAAY;QAC3C,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,gBAAgB;QACvD,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,uBAAuB;QAC3E,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,oBAAoB;QAClE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QAC1C,oBAAoB,EAAE;YACpB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,UAAU;SAChD;KACF;CACF,CAAC;AAEF,eAAe;IACb,GAAG;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IACD,GAAG,CAAC,MAAM;QACR,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const DEFAULT_LANG = "pt_br";
2
+ export declare const DEFAULT_CURRENCY = "BRL";
3
+ export declare const DEFAULT_CURRENCY_SYMBOL = "R$";
4
+ export declare const DEFAULT_COUNTRY_CODE = "BR";
@@ -0,0 +1,8 @@
1
+ declare type Env = {
2
+ authenticationId: string;
3
+ apiKey: string;
4
+ githubToken?: string;
5
+ };
6
+ declare const _default: () => Env;
7
+ export default _default;
8
+ export type { Env };
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<boolean>;
2
+ export default _default;
@@ -1,9 +1,20 @@
1
+ // eslint-disable-next-line import/no-unresolved
2
+ import { getFirestore } from 'firebase-admin/firestore';
1
3
  import { logger } from 'firebase-functions';
2
4
  import api from '@cloudcommerce/api';
3
5
  import getEnv from '../env.js';
4
6
 
5
7
  export default async () => {
6
8
  const { authenticationId, apiKey } = getEnv();
9
+ const eventsSubs = await getFirestore().collection('eventsSubs').get();
10
+ const listenedEvents = [];
11
+ eventsSubs.forEach((doc) => {
12
+ const eventSub = doc.data();
13
+ if (!listenedEvents.includes(eventSub.event)) {
14
+ listenedEvents.push(eventSub.event);
15
+ }
16
+ });
17
+ logger.info({ listenedEvents });
7
18
  [
8
19
  'orders',
9
20
  'products',
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-store-events.js","sourceRoot":"","sources":["../../src/handlers/check-store-events.ts"],"names":[],"mappings":"AACA,gDAAgD;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,GAAG,MAAM,oBAAoB,CAAC;AACrC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,eAAe,KAAK,IAAI,EAAE;IACxB,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9C,MAAM,UAAU,GAAG,MAAM,YAAY,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC;IACvE,MAAM,cAAc,GAAwB,EAAE,CAAC;IAC/C,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACzB,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAc,CAAC;QACxC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAC5C,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SACrC;IACH,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;IAChC;QACE,QAAQ;QACR,UAAU;QACV,OAAO;KACR,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAC3B,MAAM,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,GAAG,CAAC;YACrC,gBAAgB;YAChB,MAAM;YACN,QAAQ,EAAE,UAAU,QAAoB,EAAE;SAC3C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import 'source-map-support/register.js';
2
+ import '@cloudcommerce/api/fetch-polyfill.js';
3
+ export declare const cronStoreEvents: import("firebase-functions/v1").CloudFunction<unknown>;
@@ -1,37 +1,13 @@
1
+ /* eslint-disable import/prefer-default-export */
1
2
  import 'source-map-support/register.js';
2
3
  import '@cloudcommerce/api/fetch-polyfill.js';
3
- import { pubsub, logger } from 'firebase-functions';
4
+ // https://github.com/import-js/eslint-plugin-import/issues/1810
4
5
  // eslint-disable-next-line import/no-unresolved
5
- import { onRequest } from 'firebase-functions/v2/https';
6
- import config from './config.js';
7
- import checkStoreEvents from './methods/check-store-events.js';
6
+ import { initializeApp } from 'firebase-admin/app';
7
+ import { pubsub } from 'firebase-functions';
8
+ import checkStoreEvents from './handlers/check-store-events.js';
8
9
 
9
- const processId = String(Date.now());
10
- const options = {
11
- region: process.env.DEPLOY_REGION || 'us-east1',
12
- };
13
-
14
- export const z = onRequest(options, ({ url }, response) => {
15
- process.env.ECOM_API_KEY = '***';
16
- if (url === '/hello') {
17
- logger.info('Hello logs!', {
18
- structuredData: true,
19
- });
20
- response.send(config.get().hello);
21
- return;
22
- }
23
- if (url === '/pid') {
24
- response.send(processId);
25
- return;
26
- }
27
- response.send({
28
- config: config.get(),
29
- });
30
- });
31
-
32
- export const ssr = onRequest(options, (request, response) => {
33
- response.send('<h1>Hello SSR!</h1>');
34
- });
10
+ initializeApp();
35
11
 
36
12
  export const cronStoreEvents = pubsub.schedule('* * * * *').onRun(() => {
37
13
  return checkStoreEvents();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpD,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,gBAAgB,MAAM,8BAA8B,CAAC;AAE5D,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;AAErC,MAAM,OAAO,GAAG;IACd,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,UAAU;CAChD,CAAC;AAEF,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE;IACxD,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC;IACjC,IAAI,GAAG,KAAK,QAAQ,EAAE;QACpB,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE;YACzB,cAAc,EAAE,IAAI;SACrB,CAAC,CAAC;QACH,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO;KACR;IACD,IAAI,GAAG,KAAK,MAAM,EAAE;QAClB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzB,OAAO;KACR;IACD,QAAQ,CAAC,IAAI,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE;KACrB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;IAC1D,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;IACrE,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,gEAAgE;AAChE,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAE7D,aAAa,EAAE,CAAC;AAEhB,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;IACrE,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { AppEventsTopic } from '@cloudcommerce/types';
2
+ declare type EventSub = {
3
+ event: AppEventsTopic;
4
+ appId: number;
5
+ };
6
+ export type { EventSub, };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ // # sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.0.33",
4
+ "version": "0.0.37",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
+ "types": "lib/index.d.ts",
7
8
  "exports": {
8
9
  ".": "./lib/index.js",
9
10
  "./config": "./config.js"
@@ -31,6 +32,7 @@
31
32
  "source-map-support": "^0.5.21"
32
33
  },
33
34
  "devDependencies": {
35
+ "@cloudcommerce/types": "workspace:*",
34
36
  "@firebase/app-types": "^0.7.0"
35
37
  }
36
38
  }
@@ -16,6 +16,9 @@ const self = {
16
16
  currencySymbol: process.env.ECOM_CURRENCY_SYMBOL || DEFAULT_CURRENCY_SYMBOL,
17
17
  countryCode: process.env.ECOM_COUNTRY_CODE || DEFAULT_COUNTRY_CODE,
18
18
  storeId: Number(process.env.ECOM_STORE_ID),
19
+ httpsFunctionOptions: {
20
+ region: process.env.DEPLOY_REGION || 'us-east1',
21
+ },
19
22
  },
20
23
  };
21
24