qcobjects 2.4.17-beta → 2.4.21-beta

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.
@@ -0,0 +1,38 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
+
4
+ name: Node.js Publish Beta version
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - 'v*.*-lts'
10
+ tags:
11
+ - 'v*.*.*-lts'
12
+
13
+ jobs:
14
+ build:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - uses: actions/setup-node@v1
19
+ with:
20
+ node-version: 14
21
+ - run: npm ci
22
+ - run: npm test
23
+
24
+ publish-npm:
25
+ needs: build
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v2
29
+ - uses: actions/setup-node@v1
30
+ with:
31
+ node-version: 12
32
+ registry-url: https://registry.npmjs.org/
33
+ - name: Set up NPM authentication
34
+ run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc
35
+ - run: npm ci
36
+ - run: npm publish --tag ${GITHUB_REF##*/}
37
+ env:
38
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
@@ -28,7 +28,7 @@ jobs:
28
28
  - uses: actions/checkout@v2
29
29
  - uses: actions/setup-node@v1
30
30
  with:
31
- node-version: 12
31
+ node-version: 14
32
32
  registry-url: https://registry.npmjs.org/
33
33
  - name: Set up NPM authentication
34
34
  run: echo "registry=https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc
package/QCObjects.js CHANGED
@@ -124,8 +124,8 @@
124
124
  if (typeof String.prototype.matchAll === "undefined"){
125
125
  String.prototype.matchAll = String.prototype.__mAll__;
126
126
  }
127
-
128
- var isBrowser = typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self;
127
+ var isDeno = (typeof window !== "undefined" && "Deno" in window);
128
+ var isBrowser = (typeof window !== "undefined" && typeof window.self !== "undefined" && window === window.self) && !isDeno;
129
129
  var _DOMCreateElement = function(elementName) {
130
130
  var _ret_;
131
131
  if (isBrowser) {
@@ -941,7 +941,7 @@
941
941
  self.__new__ = super.__new__.bind(self);
942
942
  self.__new__.call(self,_o_);
943
943
  }
944
- if (Object.hasOwnProperty.call(self,"_new_") && typeof self._new_.isCalled === "undefined") {
944
+ if (typeof self === "object" && Object.hasOwnProperty.call(self,"_new_") && typeof self._new_.isCalled === "undefined") {
945
945
  try {
946
946
  self._new_.call(self,_o_);
947
947
  self._new_.isCalled = true;
@@ -959,6 +959,10 @@
959
959
  }
960
960
  _new_ (){}
961
961
 
962
+ getClass () {
963
+ return Object.getPrototypeOf(this.constructor);
964
+ }
965
+
962
966
  css (_css) {
963
967
  if (typeof this["body"] !== "undefined" && this["body"]["style"] !== "undefined") {
964
968
  logger.debug("body style");
@@ -1760,16 +1764,18 @@
1760
1764
  } else {
1761
1765
  global.onload = _Ready;
1762
1766
  }
1767
+ Class("InheritClass", Object, {});
1763
1768
 
1764
1769
  /**
1765
1770
  * Dynamic Data Objects Class
1766
1771
  * Usage:
1767
1772
  * Class('TestDDO',{
1773
+ * data: {},
1768
1774
  * _new_ (){
1769
1775
  * this.ddo = New(DDO,{
1770
1776
  * instance:this,
1771
- * name:'ddo',
1772
- * value:0,
1777
+ * name:'data',
1778
+ * value:{},
1773
1779
  * fget (value){
1774
1780
  * logger.debug('returned value '+ value );
1775
1781
  * }
@@ -1778,7 +1784,31 @@
1778
1784
  * });
1779
1785
  *
1780
1786
  */
1781
- Class("DDO", Object, {
1787
+ class DDO extends ClassFactory ("InheritClass") {
1788
+ constructor({
1789
+ instance,
1790
+ name,
1791
+ fget,
1792
+ fset,
1793
+ value
1794
+ }) {
1795
+ super({
1796
+ instance,
1797
+ name,
1798
+ fget,
1799
+ fset,
1800
+ value
1801
+ });
1802
+ this._new_({
1803
+ instance,
1804
+ name,
1805
+ fget,
1806
+ fset,
1807
+ value
1808
+ });
1809
+
1810
+ }
1811
+
1782
1812
  _new_ ({
1783
1813
  instance,
1784
1814
  name,
@@ -1786,13 +1816,12 @@
1786
1816
  fset,
1787
1817
  value
1788
1818
  }) {
1789
- var _value;
1790
1819
  var ddoInstance = this;
1791
1820
  var name = (typeof name === "undefined") ? (ObjectName(ddoInstance)) : (name);
1792
1821
 
1793
1822
  Object.defineProperty(instance, name, {
1794
1823
  set(val) {
1795
- _value = val;
1824
+ let _value = val;
1796
1825
  logger.debug("value changed " + name);
1797
1826
  var ret;
1798
1827
  if (typeof fset !== "undefined" && typeof fset === "function") {
@@ -1800,12 +1829,14 @@
1800
1829
  } else {
1801
1830
  ret = _value;
1802
1831
  }
1832
+ instance["_"+name] = ret;
1803
1833
  return;
1804
1834
  },
1805
1835
  get() {
1836
+ let _value = instance["_"+name];
1806
1837
  logger.debug("returning value " + name);
1807
1838
  var is_ddo = function(v) {
1808
- if (typeof v === "object" && v.hasOwnProperty.call(v,"value")) {
1839
+ if (typeof v === "object" && Object.hasOwnProperty.call(v,"value")) {
1809
1840
  return v.value;
1810
1841
  }
1811
1842
  return v;
@@ -1821,9 +1852,8 @@
1821
1852
  });
1822
1853
  }
1823
1854
 
1824
- });
1825
-
1826
- Class("InheritClass", Object, {});
1855
+ }
1856
+ Export (DDO);
1827
1857
 
1828
1858
  Class("DefaultTemplateHandler", Object, {
1829
1859
  template: "",
@@ -2115,9 +2145,10 @@
2115
2145
  });
2116
2146
  return _promise;
2117
2147
  },
2118
- Cast (o) {
2148
+ Cast (oClass) {
2119
2149
  /* Cast method for components has been deprecated. Don't use this method, it is available only for compatibility purposes */
2120
- return this;
2150
+ let o = _methods_(oClass).map(m=>m.name.replace(/bound /g, "")).map(m=>{return {[m]:oClass[m].bind(this)};}).reduce((c,p)=>Object.assign(c, p), {});
2151
+ return _Cast(this, o);
2121
2152
  },
2122
2153
  routingWay: null,
2123
2154
  validRoutingWays: ["pathname", "hash", "search"],
@@ -3039,6 +3070,10 @@
3039
3070
  var _serviceLoaderInNode = function(service, _async) {
3040
3071
  var _promise = new Promise(
3041
3072
  function(resolve, reject) {
3073
+ if (typeof URL === "undefined") {
3074
+ global.URL = require("url").URL;
3075
+ let URL = global.URL;
3076
+ }
3042
3077
  var serviceURL = new URL(service.url);
3043
3078
  var req;
3044
3079
  service.useHTTP2 = Object.hasOwnProperty.call(service,"useHTTP2") && service.useHTTP2;
@@ -3294,7 +3329,7 @@
3294
3329
  }
3295
3330
  };
3296
3331
  logger.debug("Starting to load the config settings...");
3297
- if (ClassFactory("CONFIG").get("useConfigService", false)) {
3332
+ if (_top.CONFIG.get("useConfigService", false)) {
3298
3333
  logger.debug("Loading settings using local configuration file...");
3299
3334
  _top.global.configService = New(ClassFactory("ConfigService"));
3300
3335
  _top.global.configService.configLoaded = _buildComponents;
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  ![logo](https://qcobjects.dev/qcobjects_01.png)
2
2
 
3
3
  [![GitHub license](https://img.shields.io/github/license/QuickCorp/QCObjects.svg)](https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FQuickCorp%2FQCObjects.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FQuickCorp%2FQCObjects?ref=badge_shield) [![](https://data.jsdelivr.com/v1/package/npm/qcobjects/badge)](https://www.jsdelivr.com/package/npm/qcobjects) [![Badge for version for Visual Studio Code extension Quickcorp.QCObjects-vscode](https://vsmarketplacebadge.apphb.com/version/Quickcorp.QCObjects-vscode.svg)](https://marketplace.visualstudio.com/items?itemName=Quickcorp.QCObjects-vscode) [![Documentation Status](https://readthedocs.org/projects/qcobjects/badge/?version=latest)](https://qcobjects.readthedocs.io/?badge=latest) [![GitHub release](https://img.shields.io/github/issues/QuickCorp/QCObjects.svg)](https://github.com/QuickCorp/QCObjects/releases/) [![GitHub stars](https://img.shields.io/github/stars/QuickCorp/QCObjects.svg)](https://github.com/QuickCorp/QCObjects) [![npm version](https://badge.fury.io/js/qcobjects.svg)](https://badge.fury.io/js/qcobjects) ![apm: version](https://flat.badgen.net/apm/v/qcobjects-syntax?params) ![docker pulls](https://img.shields.io/docker/pulls/quickcorp/qcobjects.svg) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
4
+ [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5295/badge)](https://bestpractices.coreinfrastructure.org/projects/5295)
5
+
4
6
 
5
7
  [![Become a Patreon ](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/join/qcobjects?)
6
8
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.17-beta
1
+ 2.4.21-beta
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjects",
3
- "version": "2.4.17-beta",
3
+ "version": "2.4.21-beta",
4
4
  "description": "QCObjects is an Open-source framework that empowers full-stack developers to make micro-services and micro-frontends into an N-Tier architecture.",
5
5
  "main": "QCObjects.js",
6
6
  "license": "LGPL-3.0",