cloudcommerce 0.0.45 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
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.46](https://github.com/ecomplus/cloud-commerce/compare/v0.0.45...v0.0.46) (2022-08-05)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Set Firebase Functions v2 names with one word at all ([23d5f17](https://github.com/ecomplus/cloud-commerce/commit/23d5f17bbeca0bccc14047c6a5fa4a92753ae9b8))
11
+
5
12
  ### [0.0.45](https://github.com/ecomplus/cloud-commerce/compare/v0.0.44...v0.0.45) (2022-08-05)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloudcommerce",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
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>",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/api",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "description": "E-Com Plus Cloud Commerce APIs client/adapter",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-discounts",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "description": "E-Com Plus Cloud Commerce app for complex discount rules",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
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/events",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "description": "E-Com Plus Cloud Commerce app events",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -4,16 +4,18 @@ import type { AppEventsTopic } from '@cloudcommerce/types';
4
4
  import 'source-map-support/register.js';
5
5
  // eslint-disable-next-line import/no-unresolved
6
6
  import { initializeApp } from 'firebase-admin/app';
7
- // eslint-disable-next-line import/no-unresolved
8
- import { runWith, logger } from 'firebase-functions';
7
+ import functions from 'firebase-functions';
8
+ import config from '@cloudcommerce/firebase/lib/config';
9
9
 
10
+ const { logger } = functions;
10
11
  initializeApp();
11
12
 
12
13
  const eventMaxAgeMs = 60000;
13
14
  const newOrderTopic: AppEventsTopic = 'orders-new';
15
+ const { httpsFunctionOptions: { region } } = config.get();
14
16
 
15
- // eslint-disable-next-line camelcase
16
- export const on_new_order = runWith({ failurePolicy: true })
17
+ export const onNewOrder = functions.region(region)
18
+ .runWith({ failurePolicy: true })
17
19
  .pubsub.topic(newOrderTopic).onPublish((message, context) => {
18
20
  const eventAgeMs = Date.now() - Date.parse(context.timestamp);
19
21
  if (eventAgeMs > eventMaxAgeMs) {
@@ -1,3 +1,4 @@
1
1
  import 'source-map-support/register.js';
2
2
  import '@cloudcommerce/api/fetch-polyfill.js';
3
- export declare const cron_store_events: import("firebase-functions/v1").CloudFunction<unknown>;
3
+ import functions from 'firebase-functions';
4
+ export declare const cronStoreEvents: functions.CloudFunction<unknown>;
@@ -4,13 +4,15 @@ import '@cloudcommerce/api/fetch-polyfill.js';
4
4
  // https://github.com/import-js/eslint-plugin-import/issues/1810
5
5
  // eslint-disable-next-line import/no-unresolved
6
6
  import { initializeApp } from 'firebase-admin/app';
7
- import { pubsub } from 'firebase-functions';
7
+ import functions from 'firebase-functions';
8
+ import config from './config.js';
8
9
  import checkStoreEvents from './handlers/check-store-events.js';
9
10
 
10
11
  initializeApp();
12
+ const { httpsFunctionOptions: { region } } = config.get();
11
13
 
12
- // eslint-disable-next-line camelcase
13
- export const cron_store_events = pubsub.schedule('* * * * *').onRun(() => {
14
- return checkStoreEvents();
15
- });
14
+ export const cronStoreEvents = functions.region(region)
15
+ .pubsub.schedule('* * * * *').onRun(() => {
16
+ return checkStoreEvents();
17
+ });
16
18
  // # sourceMappingURL=index.js.map
@@ -1 +1 @@
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,qCAAqC;AACrC,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;IACvE,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,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAE7D,aAAa,EAAE,CAAC;AAEhB,MAAM,EAAE,oBAAoB,EAAE,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;AAE1D,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;KACpD,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;IACvC,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/firebase",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "description": "E-Com Plus Cloud Commerce on Firebase",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -5,12 +5,15 @@ import '@cloudcommerce/api/fetch-polyfill.js';
5
5
  // https://github.com/import-js/eslint-plugin-import/issues/1810
6
6
  // eslint-disable-next-line import/no-unresolved
7
7
  import { initializeApp } from 'firebase-admin/app';
8
- import { pubsub } from 'firebase-functions';
8
+ import functions from 'firebase-functions';
9
+ import config from './config';
9
10
  import checkStoreEvents from './handlers/check-store-events';
10
11
 
11
12
  initializeApp();
12
13
 
13
- // eslint-disable-next-line camelcase
14
- export const cron_store_events = pubsub.schedule('* * * * *').onRun(() => {
15
- return checkStoreEvents();
16
- });
14
+ const { httpsFunctionOptions: { region } } = config.get();
15
+
16
+ export const cronStoreEvents = functions.region(region)
17
+ .pubsub.schedule('* * * * *').onRun(() => {
18
+ return checkStoreEvents();
19
+ });
@@ -11,8 +11,7 @@ import serveModulesApi from './firebase/serve-modules-api.js';
11
11
  initializeApp();
12
12
  const { httpsFunctionOptions } = config.get();
13
13
 
14
- // eslint-disable-next-line camelcase
15
- export const modules_api = onRequest(httpsFunctionOptions, (req, res) => {
14
+ export const modules = onRequest(httpsFunctionOptions, (req, res) => {
16
15
  const { authenticationId, apiKey } = getEnv();
17
16
  // Hide API key for security
18
17
  process.env.ECOM_API_KEY = '***';
@@ -1 +1 @@
1
- {"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,gCAAgC,CAAC;AACxC,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,MAAM,MAAM,iCAAiC,CAAC;AACrD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAE3D,aAAa,EAAE,CAAC;AAChB,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;AAE9C,qCAAqC;AACrC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,oBAAoB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACtE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9C,4BAA4B;IAC5B,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC;IACjC,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE;QACxB,gBAAgB;QAChB,MAAM;KACP,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,gCAAgC,CAAC;AACxC,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AACxD,OAAO,MAAM,MAAM,iCAAiC,CAAC;AACrD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAE3D,aAAa,EAAE,CAAC;AAChB,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,oBAAoB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAClE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9C,4BAA4B;IAC5B,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC;IACjC,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE;QACxB,gBAAgB;QAChB,MAAM;KACP,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/modules",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "description": "E-Com Plus Cloud Commerce modules API",
6
6
  "main": "lib/index.cjs",
7
7
  "exports": {
@@ -12,8 +12,7 @@ import serveModulesApi from './firebase/serve-modules-api';
12
12
  initializeApp();
13
13
  const { httpsFunctionOptions } = config.get();
14
14
 
15
- // eslint-disable-next-line camelcase
16
- export const modules_api = onRequest(httpsFunctionOptions, (req, res) => {
15
+ export const modules = onRequest(httpsFunctionOptions, (req, res) => {
17
16
  const { authenticationId, apiKey } = getEnv();
18
17
  // Hide API key for security
19
18
  process.env.ECOM_API_KEY = '***';
@@ -9,8 +9,7 @@ import config from '@cloudcommerce/firebase/lib/config';
9
9
  initializeApp();
10
10
  const options = config.get().httpsFunctionOptions;
11
11
 
12
- // eslint-disable-next-line camelcase
13
- export const passport_api = onRequest(options, (request, response) => {
12
+ export const passport = onRequest(options, (request, response) => {
14
13
  process.env.ECOM_API_KEY = '***';
15
14
  response.send('Hello passport!');
16
15
  });
@@ -1 +1 @@
1
- {"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,gCAAgC,CAAC;AACxC,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AAExD,aAAa,EAAE,CAAC;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC;AAElD,qCAAqC;AACrC,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;IACnE,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"firebase.js","sourceRoot":"","sources":["../src/firebase.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,gCAAgC,CAAC;AACxC,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,MAAM,MAAM,oCAAoC,CAAC;AAExD,aAAa,EAAE,CAAC;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;IAC/D,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/passport",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "description": "E-Com Plus Cloud Commerce customers authentication (passport) API",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -10,8 +10,7 @@ import config from '@cloudcommerce/firebase/lib/config';
10
10
  initializeApp();
11
11
  const options = config.get().httpsFunctionOptions;
12
12
 
13
- // eslint-disable-next-line camelcase
14
- export const passport_api = onRequest(options, (request, response) => {
13
+ export const passport = onRequest(options, (request, response) => {
15
14
  process.env.ECOM_API_KEY = '***';
16
15
  response.send('Hello passport!');
17
16
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/ssr",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "description": "E-Com Plus Cloud Commerce storefront SSR",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "0.0.45",
4
+ "version": "0.0.46",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {
package/pnpm-lock.yaml CHANGED
@@ -198,36 +198,36 @@ importers:
198
198
 
199
199
  store:
200
200
  specifiers:
201
- '@cloudcommerce/cli': ^0.0.44
201
+ '@cloudcommerce/cli': ^0.0.45
202
202
  dependencies:
203
203
  '@cloudcommerce/cli': link:../packages/cli
204
204
 
205
205
  store/functions/core:
206
206
  specifiers:
207
- '@cloudcommerce/firebase': ^0.0.44
207
+ '@cloudcommerce/firebase': ^0.0.45
208
208
  dependencies:
209
209
  '@cloudcommerce/firebase': link:../../../packages/firebase
210
210
 
211
211
  store/functions/modules:
212
212
  specifiers:
213
- '@cloudcommerce/firebase': ^0.0.44
214
- '@cloudcommerce/modules': ^0.0.44
213
+ '@cloudcommerce/firebase': ^0.0.45
214
+ '@cloudcommerce/modules': ^0.0.45
215
215
  dependencies:
216
216
  '@cloudcommerce/firebase': link:../../../packages/firebase
217
217
  '@cloudcommerce/modules': link:../../../packages/modules
218
218
 
219
219
  store/functions/passport:
220
220
  specifiers:
221
- '@cloudcommerce/firebase': ^0.0.44
222
- '@cloudcommerce/passport': ^0.0.44
221
+ '@cloudcommerce/firebase': ^0.0.45
222
+ '@cloudcommerce/passport': ^0.0.45
223
223
  dependencies:
224
224
  '@cloudcommerce/firebase': link:../../../packages/firebase
225
225
  '@cloudcommerce/passport': link:../../../packages/passport
226
226
 
227
227
  store/functions/ssr:
228
228
  specifiers:
229
- '@cloudcommerce/firebase': ^0.0.44
230
- '@cloudcommerce/ssr': ^0.0.44
229
+ '@cloudcommerce/firebase': ^0.0.45
230
+ '@cloudcommerce/ssr': ^0.0.45
231
231
  dependencies:
232
232
  '@cloudcommerce/firebase': link:../../../packages/firebase
233
233
  '@cloudcommerce/ssr': link:../../../packages/ssr