@live-change/framework 0.9.173 → 0.9.175

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/LICENSE.md ADDED
@@ -0,0 +1,11 @@
1
+ Copyright 2019-2024 Michał Łaszczewski
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/lib/App.js CHANGED
@@ -374,7 +374,6 @@ class App {
374
374
  }, async (commandSpan) => {
375
375
  const testTrace = {}
376
376
  propagation.inject(context.active(), testTrace)
377
- console.log("CALL COMMAND TRACE - INJECTED TRACE", testTrace)
378
377
  try {
379
378
 
380
379
  if(!data.id) data.id = this.generateUid()
@@ -3,7 +3,7 @@ import getAccessMethod from "./accessMethod.js"
3
3
  export default function(module, app) {
4
4
  for(let actionName in module.actions) {
5
5
  const action = module.actions[actionName]
6
- if(!action.access) continue;
6
+ if(!action.access) continue;
7
7
  let access = getAccessMethod(action.access)
8
8
  if(access) {
9
9
  const oldExec = action.execute
@@ -1,10 +1,15 @@
1
1
  import { prepareParameters, processReturn } from "./params.js"
2
+ import { loggingHelpers } from '../utils.js'
2
3
 
3
4
  class EventHandler {
4
5
 
5
6
  constructor(definition, service) {
6
7
  this.definition = definition
7
8
  this.service = service
9
+
10
+ this.loggingHelpers = loggingHelpers(service.name, service.app.config.clientConfig.version, {
11
+ eventType: definition.name,
12
+ })
8
13
  }
9
14
 
10
15
  async execute(parameters, bucket) {
@@ -17,7 +22,8 @@ class EventHandler {
17
22
  }, {
18
23
  action: this,
19
24
  service: this.service,
20
- bucket: bucket
25
+ bucket: bucket,
26
+ ...this.loggingHelpers
21
27
  })
22
28
 
23
29
  resultPromise = resultPromise.then(async result => {
package/lib/utils.js CHANGED
@@ -415,6 +415,10 @@ export function expandObjectAttributes(object, prefix = '', acc = {}) {
415
415
  acc[prefix] = object
416
416
  return
417
417
  }
418
+ if(object === null || object === undefined) {
419
+ acc[prefix] = object
420
+ return
421
+ }
418
422
  //if(Array.isArray(object)) return object.map(item => expandObjectAttributes(item, prefix))
419
423
  for(const [key, value] of Object.entries(object)) {
420
424
  expandObjectAttributes(value, prefix + '_' + key, acc)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/framework",
3
- "version": "0.9.173",
3
+ "version": "0.9.175",
4
4
  "description": "Live Change Framework - ultimate solution for real time mobile/web apps",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,11 +22,11 @@
22
22
  },
23
23
  "homepage": "https://github.com/live-change/live-change-stack",
24
24
  "devDependencies": {
25
- "@live-change/dao": "^0.9.173",
26
- "@live-change/uid": "^0.9.173",
25
+ "@live-change/dao": "^0.9.175",
26
+ "@live-change/uid": "^0.9.175",
27
27
  "typedoc": "0.28.3",
28
28
  "typedoc-plugin-markdown": "^4.6.3",
29
29
  "typedoc-plugin-rename-defaults": "^0.7.3"
30
30
  },
31
- "gitHead": "1d70f7baf204d8f9848f53f5023db91016c6093f"
31
+ "gitHead": "526a46cfabf1044ceb3f6ad39dbb3749acca68fb"
32
32
  }