qcobjects-sdk 2.4.59 → 2.4.61

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 (77) hide show
  1. package/.dockerignore +98 -1
  2. package/.eslintignore +1 -2
  3. package/.github/workflows/static.yml +91 -0
  4. package/VERSION +1 -1
  5. package/config.json +4 -0
  6. package/package.json +31 -9
  7. package/src/QCObjects-SDK.d.ts +26 -0
  8. package/src/QCObjects-SDK.ts +110 -0
  9. package/src/index.d.ts +1 -1
  10. package/src/index.mts +2 -0
  11. package/src/js/org.qcobjects.cloud.auth.session.data.d.ts +1 -0
  12. package/src/js/{org.qcobjects.cloud.auth.session.data.js → org.qcobjects.cloud.auth.session.data.ts} +28 -22
  13. package/src/js/org.qcobjects.cloud.auth.session.usertoken.d.ts +2 -0
  14. package/src/js/org.qcobjects.cloud.auth.session.usertoken.ts +128 -0
  15. package/src/js/org.qcobjects.components.d.ts +10 -0
  16. package/src/js/org.qcobjects.components.grid.d.ts +3 -0
  17. package/src/js/org.qcobjects.components.grid.ts +95 -0
  18. package/src/js/org.qcobjects.components.list.d.ts +3 -0
  19. package/src/js/org.qcobjects.components.list.ts +83 -0
  20. package/src/js/org.qcobjects.components.notifications.d.ts +1 -0
  21. package/src/js/org.qcobjects.components.notifications.ts +191 -0
  22. package/src/js/org.qcobjects.components.slider.d.ts +1 -0
  23. package/src/js/{org.qcobjects.components.slider.js → org.qcobjects.components.slider.ts} +8 -6
  24. package/src/js/org.qcobjects.components.splashscreen.d.ts +28 -0
  25. package/src/js/org.qcobjects.components.splashscreen.ts +680 -0
  26. package/src/js/org.qcobjects.components.ts +336 -0
  27. package/src/js/org.qcobjects.controllers.d.ts +1 -0
  28. package/src/js/org.qcobjects.controllers.form.d.ts +1 -0
  29. package/src/js/{org.qcobjects.controllers.form.js → org.qcobjects.controllers.form.ts} +57 -59
  30. package/src/js/org.qcobjects.controllers.grid.d.ts +1 -0
  31. package/src/js/{org.qcobjects.controllers.grid.js → org.qcobjects.controllers.grid.ts} +103 -98
  32. package/src/js/org.qcobjects.controllers.list.d.ts +1 -0
  33. package/src/js/{org.qcobjects.controllers.list.js → org.qcobjects.controllers.list.ts} +86 -76
  34. package/src/js/org.qcobjects.controllers.slider.d.ts +1 -0
  35. package/src/js/org.qcobjects.controllers.slider.ts +158 -0
  36. package/src/js/org.qcobjects.controllers.swagger.d.ts +1 -0
  37. package/src/js/{org.qcobjects.controllers.swagger.js → org.qcobjects.controllers.swagger.ts} +13 -14
  38. package/src/js/{org.qcobjects.controllers.js → org.qcobjects.controllers.ts} +3 -6
  39. package/src/js/org.qcobjects.effects.d.ts +20 -0
  40. package/src/js/org.qcobjects.effects.ts +430 -0
  41. package/src/js/org.qcobjects.i18n_messages.d.ts +1 -0
  42. package/src/js/{org.qcobjects.i18n_messages.js → org.qcobjects.i18n_messages.ts} +36 -27
  43. package/src/js/org.qcobjects.modal.controllers.d.ts +1 -0
  44. package/src/js/{org.qcobjects.modal.controllers.js → org.qcobjects.modal.controllers.ts} +5 -6
  45. package/src/js/org.qcobjects.modal.effects.d.ts +1 -0
  46. package/src/js/{org.qcobjects.modal.effects.js → org.qcobjects.modal.effects.ts} +4 -1
  47. package/src/js/org.qcobjects.models.d.ts +1 -0
  48. package/src/js/{org.qcobjects.models.js → org.qcobjects.models.ts} +3 -24
  49. package/src/js/org.qcobjects.tools.canvas.d.ts +1 -0
  50. package/src/js/{org.qcobjects.tools.canvas.js → org.qcobjects.tools.canvas.ts} +14 -11
  51. package/src/js/org.qcobjects.tools.d.ts +1 -0
  52. package/src/js/org.qcobjects.tools.layouts.d.ts +1 -0
  53. package/src/js/org.qcobjects.tools.layouts.ts +85 -0
  54. package/src/js/{org.qcobjects.tools.js → org.qcobjects.tools.ts} +19 -11
  55. package/src/js/org.qcobjects.views.d.ts +1 -0
  56. package/src/js/{org.qcobjects.views.js → org.qcobjects.views.ts} +3 -5
  57. package/tsconfig.json +1 -1
  58. package/-m +0 -1
  59. package/src/QCObjects-SDK.js +0 -148
  60. package/src/index.mjs +0 -2
  61. package/src/js/org.qcobjects.cloud.auth.session.usertoken.js +0 -116
  62. package/src/js/org.qcobjects.components.grid.js +0 -65
  63. package/src/js/org.qcobjects.components.js +0 -276
  64. package/src/js/org.qcobjects.components.list.js +0 -59
  65. package/src/js/org.qcobjects.components.notifications.js +0 -190
  66. package/src/js/org.qcobjects.components.splashscreen.js +0 -645
  67. package/src/js/org.qcobjects.controllers.slider.js +0 -154
  68. package/src/js/org.qcobjects.effects.js +0 -345
  69. package/src/js/org.qcobjects.tools.layouts.js +0 -79
  70. /package/{css → src/css}/base-modal.css +0 -0
  71. /package/{css → src/css}/basic-layout-embedded-nav.css +0 -0
  72. /package/{css → src/css}/basic-layout.css +0 -0
  73. /package/{css → src/css}/components/horizontal-list.css +0 -0
  74. /package/{css → src/css}/components/list.css +0 -0
  75. /package/{css → src/css}/components/splashscreen.css +0 -0
  76. /package/{css → src/css}/modal.css +0 -0
  77. /package/src/{index.cjs → index.cts} +0 -0
package/.dockerignore CHANGED
@@ -1,2 +1,99 @@
1
+ .DS_Store
2
+ build
3
+ public
4
+ dist
5
+ .parcel*
6
+ .husky
7
+ hint-report
8
+ # Logs
9
+ logs
10
+ *.log
11
+ npm-debug.log*
12
+ yarn-debug.log*
13
+ yarn-error.log*
14
+ lerna-debug.log*
15
+
16
+ # Certificates
17
+ *.pem
18
+ # Diagnostic reports (https://nodejs.org/api/report.html)
19
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
20
+
21
+ # Runtime data
22
+ pids
23
+ *.pid
24
+ *.seed
25
+ *.pid.lock
26
+
27
+ # Directory for instrumented libs generated by jscoverage/JSCover
28
+ lib-cov
29
+
30
+ # Coverage directory used by tools like istanbul
31
+ coverage
32
+ *.lcov
33
+
34
+ # nyc test coverage
35
+ .nyc_output
36
+
37
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
38
+ .grunt
39
+
40
+ # Bower dependency directory (https://bower.io/)
41
+ bower_components
42
+
43
+ # node-waf configuration
44
+ .lock-wscript
45
+
46
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
47
+ build/Release
48
+
49
+ # Dependency directories
50
+ **/node_modules
1
51
  node_modules
2
- npm-debug.log
52
+ node_modules/
53
+ jspm_packages/
54
+
55
+ # TypeScript v1 declaration files
56
+ typings/
57
+
58
+ # TypeScript cache
59
+ *.tsbuildinfo
60
+
61
+ # Optional npm cache directory
62
+ .npm
63
+
64
+ # Optional eslint cache
65
+ .eslintcache
66
+
67
+ # Optional REPL history
68
+ .node_repl_history
69
+
70
+ # Output of 'npm pack'
71
+ *.tgz
72
+
73
+ # Yarn Integrity file
74
+ .yarn-integrity
75
+
76
+ # dotenv environment variables file
77
+ .env
78
+ .env.test
79
+
80
+ # parcel-bundler cache (https://parceljs.org/)
81
+ .cache
82
+
83
+ # next.js build output
84
+ .next
85
+
86
+ # nuxt.js build output
87
+ .nuxt
88
+
89
+ # vuepress build output
90
+ .vuepress/dist
91
+
92
+ # Serverless directories
93
+ .serverless/
94
+
95
+ # FuseBox cache
96
+ .fusebox/
97
+
98
+ # DynamoDB Local files
99
+ .dynamodb/
package/.eslintignore CHANGED
@@ -1,5 +1,4 @@
1
1
  build
2
2
  dist
3
3
  public
4
- src/**/*.d.ts
5
- src/*.js
4
+ src/**/*.d.ts
@@ -0,0 +1,91 @@
1
+ # Simple workflow for deploying static content to GitHub Pages
2
+ name: Deploy static content to Pages using Jekyll and QCObjects
3
+
4
+ on:
5
+ # Runs on pushes targeting the default branch
6
+ push:
7
+ branches: ["main"]
8
+
9
+ # Allows you to run this workflow manually from the Actions tab
10
+ workflow_dispatch:
11
+
12
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13
+ permissions:
14
+ contents: read
15
+ pages: write
16
+ id-token: write
17
+
18
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20
+ concurrency:
21
+ group: "pages"
22
+ cancel-in-progress: false
23
+
24
+ jobs:
25
+
26
+ # Single deploy job since we're just deploying
27
+ build:
28
+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
29
+ permissions:
30
+ pages: write # to deploy to Pages
31
+ id-token: write # to verify the deployment originates from an appropriate source
32
+
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - name: Checkout
36
+ uses: actions/checkout@v3
37
+ with:
38
+ submodules: true
39
+ - name: Setup Pages
40
+ uses: actions/configure-pages@v3
41
+
42
+ - name: Build Jekyll
43
+ uses: actions/jekyll-build-pages@v1
44
+ with:
45
+ destination: ./jekyll
46
+
47
+ - name: Set up Node.js version
48
+ uses: actions/setup-node@v1
49
+ with:
50
+ node-version: '18.x'
51
+
52
+ - name: npm install, build, and test
53
+ run: |
54
+ npm install
55
+ npm run build --if-present
56
+ npm run test --if-present
57
+ npm run build:jekyll --if-present
58
+
59
+ - name: Upload artifact for deployment job
60
+ uses: actions/upload-pages-artifact@v1
61
+ with:
62
+ name: node-app
63
+ path: ./public
64
+
65
+ - name: Upload artifact
66
+ uses: actions/upload-pages-artifact@v1
67
+ with:
68
+ # Upload entire repository
69
+ path: './public'
70
+ - name: Upload artifact
71
+ uses: actions/upload-pages-artifact@v1
72
+ with:
73
+ # Upload README
74
+ path: './public'
75
+
76
+ deploy:
77
+ runs-on: ubuntu-latest
78
+ needs: build
79
+ steps:
80
+ - name: Deploy to GitHub Pages
81
+ id: deployment
82
+ uses: actions/deploy-pages@v2
83
+
84
+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
85
+ permissions:
86
+ pages: write # to deploy to Pages
87
+ id-token: write # to verify the deployment originates from an appropriate source
88
+
89
+ environment:
90
+ name: github-pages
91
+ url: ${{ steps.deployment.outputs.page_url }}
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.59
1
+ 2.4.61
package/config.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "devmode":"debug",
3
+ "autodiscover":true
4
+ }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "qcobjects-sdk",
3
- "version": "2.4.59",
3
+ "version": "2.4.61",
4
4
  "description": "QCObjects SDK is a set of Controllers, Views and Components that are elementary and useful to assist developers to build applications under MVC patterns using QCObjects, Cross Browser Javascript Framework for MVC Patterns",
5
- "main": "src/index.cjs",
6
- "module": "src/index.mjs",
5
+ "main": "public/QCObjects-SDK.js",
6
+ "module": "public/index.mjs",
7
7
  "exports": {
8
8
  ".": {
9
- "require": "./src/index.cjs",
10
- "import": "./src/index.mjs"
9
+ "require": "./public/index.cjs",
10
+ "import": "./public/index.mjs"
11
11
  },
12
12
  "./package.json": "./package.json",
13
13
  "./js/org.qcobjects.cloud.auth.session.data": "./src/js/org.qcobjects.cloud.auth.session.data.js",
@@ -39,11 +39,30 @@
39
39
  "types": "./src/index.d.ts",
40
40
  "license": "LGPL-3.0",
41
41
  "scripts": {
42
+ "test": "npm run lint",
43
+ "lint": "(npx eslint \"src/**/*.ts\" --fix --ext ts)",
42
44
  "sync": "git add . && git commit -am ",
43
- "test": "(npm run lint && (npx jasmine))",
44
- "lint": "(npx eslint ./**/*.ts --fix --ext ts)",
45
- "preversion": "npm cache verify && npm test",
46
- "postversion": "git push && git push --tags"
45
+ "preversion": "npm i --upgrade && npm test",
46
+ "postversion": "git push && git push --tags",
47
+ "v-patch": "qcobjects v-patch",
48
+ "v-minor": "qcobjects v-minor",
49
+ "v-major": "qcobjects v-major",
50
+ "qcobjects": "qcobjects",
51
+ "cli": "qcobjects",
52
+ "build:static": "npx qcobjects-cli publish:static src/ build/ --exclude js --exclude=.DS_Store",
53
+ "build:jekyll": "npx qcobjects-cli publish:static jekyll/ public/ --exclude=.DS_Store",
54
+ "build:static:css": "npx qcobjects-cli publish:static src/css build/css --exclude js --exclude=.DS_Store",
55
+ "build:static:templates": "npx qcobjects-cli publish:static src/templates build/templates --exclude js --exclude=.DS_Store",
56
+ "build:ts": "npm test && npx tsc",
57
+ "build:ts-types": "npx tsc --project tsconfig.d.json",
58
+ "build": "npm run build:static:css && npm run build:static:templates && npm run build:ts-types && npm run build:ts && npm run publish:static && npm run publish:esbuild && npm run minify:css",
59
+ "publish:static": "(npx qcobjects-cli publish:static build/ public/ --exclude js --exclude=.DS_Store)",
60
+ "publish:esbuild": "npx esbuild \"build/QCObjects-SDK.js\" --bundle --minify --outdir=public --external:qcobjects --keep-names --global-name=global --sourcemap --splitting --chunk-names=chunks/[name]-[hash] --format=esm --target=es2020",
61
+ "minify:css": "(npx esbuild build/css/*.css build/css/**/*.css --outdir=public/css --keep-names --minify --global-name=global --sourcemap --loader:.svg=file)",
62
+ "prepare": "node -e \"if(!require('fs').existsSync('.git')){process.exit(0)}\" || npx -y husky install",
63
+ "prestart": "npm run publish:web",
64
+ "cli:help": "qcobjects --help",
65
+ "tree": "tree -d --gitignore"
47
66
  },
48
67
  "repository": {
49
68
  "type": "git",
@@ -65,6 +84,8 @@
65
84
  "webcomponents"
66
85
  ],
67
86
  "devDependencies": {
87
+ "@types/qcobjects": "github:QCObjects/-types-qcobjects",
88
+ "@types/qcobjects-sdk": "github:QCObjects/-types-qcobjects-sdk",
68
89
  "@typescript-eslint/eslint-plugin": "^5.58.0",
69
90
  "@typescript-eslint/parser": "^5.58.0",
70
91
  "eslint": "^8.38.0",
@@ -78,6 +99,7 @@
78
99
  "eslint-plugin-promise": "^6.1.1",
79
100
  "hint": "^2.0.0",
80
101
  "jasmine": "^3.7.0",
102
+ "qcobjects-command-publish-static": "^1.0.2",
81
103
  "qcobjects-tsconfig": "^2.4.10",
82
104
  "typescript": "^5.0.4"
83
105
  },
@@ -0,0 +1,26 @@
1
+ /**
2
+ * QCObjects SDK 2.4
3
+ * ________________
4
+ *
5
+ * Author: Jean Machuca <correojean@gmail.com>
6
+ *
7
+ * Cross Browser Javascript Framework for MVC Patterns
8
+ * QuickCorp/QCObjects is licensed under the
9
+ * GNU Lesser General Public License v3.0
10
+ * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
11
+ *
12
+ * Permissions of this copyleft license are conditioned on making available
13
+ * complete source code of licensed works and modifications under the same
14
+ * license or the GNU GPLv3. Copyright and license notices must be preserved.
15
+ * Contributors provide an express grant of patent rights. However, a larger
16
+ * work using the licensed work through interfaces provided by the licensed
17
+ * work may be distributed under different terms and without source code for
18
+ * the larger work.
19
+ *
20
+ * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
21
+ *
22
+ * Everyone is permitted to copy and distribute verbatim copies of this
23
+ * license document, but changing it is not allowed.
24
+ */
25
+ declare const _top: {};
26
+ export default _top;
@@ -0,0 +1,110 @@
1
+ /* eslint-disable @typescript-eslint/no-empty-function */
2
+ /**
3
+ * QCObjects SDK 2.4
4
+ * ________________
5
+ *
6
+ * Author: Jean Machuca <correojean@gmail.com>
7
+ *
8
+ * Cross Browser Javascript Framework for MVC Patterns
9
+ * QuickCorp/QCObjects is licensed under the
10
+ * GNU Lesser General Public License v3.0
11
+ * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
12
+ *
13
+ * Permissions of this copyleft license are conditioned on making available
14
+ * complete source code of licensed works and modifications under the same
15
+ * license or the GNU GPLv3. Copyright and license notices must be preserved.
16
+ * Contributors provide an express grant of patent rights. However, a larger
17
+ * work using the licensed work through interfaces provided by the licensed
18
+ * work may be distributed under different terms and without source code for
19
+ * the larger work.
20
+ *
21
+ * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
22
+ *
23
+ * Everyone is permitted to copy and distribute verbatim copies of this
24
+ * license document, but changing it is not allowed.
25
+ */
26
+
27
+ import { CONFIG, GlobalSettings } from "qcobjects";
28
+
29
+ const _top = (typeof module === "object" && typeof module.exports === "object") ? (
30
+ module.exports = (typeof globalThis !== "undefined"
31
+ ? globalThis
32
+ : typeof self !== "undefined"
33
+ ? self
34
+ : typeof window !== "undefined"
35
+ ? window
36
+ : typeof global !== "undefined"
37
+ ? global
38
+ : {})
39
+ ) : ((typeof global === "object") ? (global) : (
40
+ (typeof window === "object") ? (window) : ({})
41
+ ));
42
+
43
+ // eslint-disable-next-line camelcase
44
+ (function __qcobjects_sdk__ (_top:any) {
45
+ "use strict";
46
+ // eslint-disable-next-line camelcase
47
+ _top.__qcobjects_sdk__ = __qcobjects_sdk__;
48
+ if (typeof Object.defineProperty !== "undefined" && typeof _top !== "undefined"){
49
+ try {
50
+ Object.defineProperty(_top,"__qcobjects_sdk__", {
51
+ enumerable: true,
52
+ configurable: false,
53
+ writable: false,
54
+ // eslint-disable-next-line camelcase
55
+ value: __qcobjects_sdk__,
56
+ });
57
+ } catch (e){
58
+ if (typeof _top.__qcobjects_sdk__ !== "undefined"){
59
+ _top.__qcobjects_sdk__.__loaded__ = true;
60
+ }
61
+ }
62
+ }
63
+
64
+ if (typeof _top.__qcobjects_sdk__.__loaded__ === "undefined"){
65
+ _top.__qcobjects_sdk__.__loaded__ = true;
66
+ if (typeof _top === "undefined"){
67
+ throw Error("Top context empty: It should either global, module or window");
68
+ }
69
+
70
+ const __start__ = GlobalSettings.__start__.bind(_top);
71
+
72
+ let _imports_: any[] = [];
73
+
74
+ // non-browsers environment // esbuild compatible
75
+ _imports_ = [
76
+ new Promise<void> ((resolve)=> {
77
+ require("./js/org.qcobjects.i18n_messages");
78
+ require("./js/org.qcobjects.models");
79
+ require("./js/org.qcobjects.components");
80
+ require("./js/org.qcobjects.components.grid");
81
+ require("./js/org.qcobjects.components.list");
82
+ require("./js/org.qcobjects.components.slider");
83
+ require("./js/org.qcobjects.components.notifications");
84
+ require("./js/org.qcobjects.components.splashscreen");
85
+ require("./js/org.qcobjects.controllers");
86
+ require("./js/org.qcobjects.controllers.grid");
87
+ require("./js/org.qcobjects.controllers.list");
88
+ require("./js/org.qcobjects.controllers.slider");
89
+ require("./js/org.qcobjects.controllers.form");
90
+ require("./js/org.qcobjects.controllers.swagger");
91
+ require("./js/org.qcobjects.effects");
92
+ require("./js/org.qcobjects.modal.controllers");
93
+ require("./js/org.qcobjects.views");
94
+ require("./js/org.qcobjects.tools.canvas");
95
+ require("./js/org.qcobjects.tools.layouts");
96
+ require("./js/org.qcobjects.cloud.auth.session.usertoken");
97
+ require("./js/org.qcobjects.cloud.auth.session.data");
98
+ resolve();
99
+ })
100
+ ];
101
+ _top._sdk_ = Promise.all(_imports_).then(()=>{
102
+ CONFIG.set("useSDK", true);
103
+ __start__();
104
+ });
105
+
106
+ }
107
+
108
+ })(_top);
109
+
110
+ export default _top;
package/src/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import sdk from "qcobjects-sdk";
1
+ import * as sdk from "./QCObjects-SDK";
2
2
  export default sdk;
package/src/index.mts ADDED
@@ -0,0 +1,2 @@
1
+ import sdk from "./QCObjects-SDK.js";
2
+ export default sdk;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,6 @@
1
+ import { Package, InheritClass, _DataStringify } from "qcobjects";
2
+ import { SessionUserToken } from "./org.qcobjects.cloud.auth.session.usertoken";
3
+
1
4
  /**
2
5
  * QCObjects SDK 2.4
3
6
  * ________________
@@ -28,7 +31,8 @@
28
31
 
29
32
  class SessionData extends InheritClass{
30
33
 
31
- __session_container__ = null;
34
+ __session_container__:any = null;
35
+ sessionData:any;
32
36
 
33
37
  /**
34
38
  * Sets the session container
@@ -37,6 +41,7 @@
37
41
  *
38
42
  */
39
43
  setSessionContainer() {
44
+ // eslint-disable-next-line prefer-rest-params
40
45
  this.__session_container__ = [...arguments];
41
46
  }
42
47
 
@@ -57,10 +62,13 @@
57
62
  *
58
63
  * @return {*} sessionData
59
64
  */
60
- getSessionData() {
61
- var __instance__ = this;
62
- var s = sessionStorage.getItem(`${__instance__.index(...arguments)}`);
63
- var sessionData = JSON.parse(s);
65
+ getSessionData(...args: any[]) {
66
+ // eslint-disable-next-line prefer-rest-params
67
+ const s = sessionStorage.getItem(`${this.index(args)}`);
68
+ let sessionData;
69
+ if (s!== null) {
70
+ sessionData = JSON.parse(s);
71
+ }
64
72
  if (typeof sessionData === "undefined" || sessionData === null) {
65
73
  sessionData = {};
66
74
  }
@@ -75,20 +83,20 @@
75
83
  * @example sessionInstance.index("me@email.com", "myusername")
76
84
  *
77
85
  */
78
- index() {
86
+ index(...args: any[]) {
79
87
  if (typeof SessionUserToken === "undefined") {
80
88
  throw new Error("You need to import SessionUserToken first: Import (\"org.qcobjects.cloud.auth.session.usertoken\")");
81
89
  }
82
- return `session_${btoa(SessionUserToken.getGlobalUserToken(...arguments))}`;
90
+ return `session_${btoa(SessionUserToken.getGlobalUserToken(args))}`;
83
91
  }
92
+
84
93
  /**
85
94
  * Saves the session instance
86
95
  *
87
96
  */
88
- save() {
89
- var __instance__ = this;
90
- var s = _DataStringify(__instance__.sessionData);
91
- sessionStorage.setItem(`${__instance__.index(...arguments)}`, s);
97
+ save(...args:any[]) {
98
+ const s = _DataStringify(this.sessionData);
99
+ sessionStorage.setItem(`${this.index(args)}`, s);
92
100
  }
93
101
 
94
102
 
@@ -100,9 +108,8 @@
100
108
  * @param {*} defaultValue
101
109
  * @return {*}
102
110
  */
103
- get(name, defaultValue) {
104
- var __instance__ = this;
105
- var sessionData = __instance__.getSessionData(__instance__.getSessionContainer());
111
+ get(name:string, defaultValue:any) {
112
+ const sessionData = this.getSessionData(this.getSessionContainer());
106
113
  return (typeof sessionData[name] !== "undefined") ? (sessionData[name]) : (defaultValue);
107
114
  }
108
115
 
@@ -113,17 +120,16 @@
113
120
  * @param {*} name
114
121
  * @param {*} value
115
122
  */
116
- set(name, value) {
117
- var __instance__ = this;
118
- var __session_container__ = __instance__.getSessionContainer();
119
- var sessionData = __instance__.getSessionData(__session_container__);
120
- __instance__.sessionData = sessionData;
121
- __instance__.sessionData[name] = value;
122
- __instance__.save(__session_container__);
123
+ set(name:string, value:any) {
124
+ const sessionContainer = this.getSessionContainer();
125
+ const sessionData = this.getSessionData(sessionContainer);
126
+ this.sessionData = sessionData;
127
+ this.sessionData[name] = value;
128
+ this.save(sessionContainer);
123
129
  }
124
130
 
125
131
  }
126
132
 
127
133
  ]);
128
134
 
129
- }).call(null);
135
+ })();
@@ -0,0 +1,2 @@
1
+ declare const SessionUserToken: any;
2
+ export { SessionUserToken };
@@ -0,0 +1,128 @@
1
+ import { CONFIG, ComplexStorageCache, InheritClass, New, Package, _Crypt } from "qcobjects";
2
+
3
+ /**
4
+ * QCObjects SDK 2.4
5
+ * ________________
6
+ *
7
+ * Author: Jean Machuca <correojean@gmail.com>
8
+ *
9
+ * Cross Browser Javascript Framework for MVC Patterns
10
+ * QuickCorp/QCObjects is licensed under the
11
+ * GNU Lesser General Public License v3.0
12
+ * [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
13
+ *
14
+ * Permissions of this copyleft license are conditioned on making available
15
+ * complete source code of licensed works and modifications under the same
16
+ * license or the GNU GPLv3. Copyright and license notices must be preserved.
17
+ * Contributors provide an express grant of patent rights. However, a larger
18
+ * work using the licensed work through interfaces provided by the licensed
19
+ * work may be distributed under different terms and without source code for
20
+ * the larger work.
21
+ *
22
+ * Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
23
+ *
24
+ * Everyone is permitted to copy and distribute verbatim copies of this
25
+ * license document, but changing it is not allowed.
26
+ */
27
+
28
+ const _top = (typeof module === "object" && typeof module.exports === "object") ? (
29
+ module.exports = (typeof globalThis !== "undefined"
30
+ ? globalThis
31
+ : typeof self !== "undefined"
32
+ ? self
33
+ : typeof window !== "undefined"
34
+ ? window
35
+ : typeof global !== "undefined"
36
+ ? global
37
+ : {})
38
+ ) : ((typeof global === "object") ? (global) : (
39
+ (typeof window === "object") ? (window) : ({})
40
+ ));
41
+
42
+ (function (global) {
43
+ "use strict";
44
+
45
+ class SessionUserToken extends InheritClass{
46
+ static user = {};
47
+ __cache__:ComplexStorageCache;
48
+
49
+ constructor(o:any){
50
+ super(o);
51
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
52
+ const __instance__ = this;
53
+ this.__cache__ = new ComplexStorageCache({
54
+ index: __instance__.__instanceID.toString(),
55
+ load() {
56
+ let __token__;
57
+ if (typeof navigator !== "undefined" && typeof origin !== "undefined") {
58
+ __token__ = _Crypt.encrypt(`${navigator.userAgent}|${o.username}|${(+(new Date())).toString()}`, origin);
59
+ } else {
60
+ __token__ = _Crypt.encrypt(`${o.username}|${(+(new Date())).toString()}`, CONFIG.get("domain", "localhost"));
61
+ }
62
+ SessionUserToken.user = {
63
+ priority: __instance__.__instanceID.toString(),
64
+ token: __token__
65
+ };
66
+ return SessionUserToken.user;
67
+ },
68
+ alternate(cacheController) {
69
+ SessionUserToken.user = cacheController?.cache.getCached(__instance__.__instanceID.toString()); // setting dataObject with the cached value
70
+ }
71
+ });
72
+
73
+ }
74
+
75
+ static generateIndex(s:any) {
76
+ return (typeof Buffer !== "undefined") ? (Buffer.from(s, "ascii").toString("base64")) : (btoa(s));
77
+ }
78
+
79
+ getGlobalUser(...args:any[]) {
80
+ const username = [args].join("|");
81
+ const __index__ = "userToken_" + SessionUserToken.generateIndex(username);
82
+ if (typeof (global as any).get(__index__) === "undefined" || (global as any).get(__index__) === null) {
83
+ (global as any).set(__index__, New(SessionUserToken, {
84
+ username
85
+ }));
86
+ }
87
+ SessionUserToken.user = (global as any).get(__index__).user;
88
+ return (global as any).get(__index__).user;
89
+ }
90
+
91
+ getGlobalUserToken(...args:any[]) {
92
+ return this.getGlobalUser(args).token;
93
+ }
94
+
95
+ getGlobalUserId(...args:any[]) {
96
+ return this.getGlobalUser(args).id;
97
+ }
98
+
99
+ getGlobalUserPriority(...args:any[]) {
100
+ return this.getGlobalUser(args).priority;
101
+ }
102
+
103
+ getLoginCredentialsToken(username:string, password:string) {
104
+ return _Crypt.encrypt(`${username}${password}`, this.getGlobalUserToken(username));
105
+ }
106
+
107
+ closeGlobalSession(...args:any[]) {
108
+ this.getGlobalUser(args);
109
+ const username = [args].join("|");
110
+ const __index__ = "userToken_" + SessionUserToken.generateIndex(username);
111
+ if (typeof (global as any).get(__index__) !== "undefined") {
112
+ (global as any).get(__index__).__cache__.clear();
113
+ (global as any).set(__index__, null);
114
+ SessionUserToken.user = {};
115
+ }
116
+ }
117
+ }
118
+
119
+ Package("org.qcobjects.cloud.auth.session.usertoken", [
120
+ SessionUserToken
121
+ ]);
122
+
123
+
124
+ })(_top);
125
+
126
+ const SessionUserToken = (_top as any).SessionUserToken;
127
+
128
+ export {SessionUserToken};
@@ -0,0 +1,10 @@
1
+ declare const FormField: any;
2
+ declare const ShadowedComponent: any;
3
+ declare const ButtonField: any;
4
+ declare const InputField: any;
5
+ declare const TextField: any;
6
+ declare const EmailField: any;
7
+ declare const ModalEnclosureComponent: any;
8
+ declare const ModalComponent: any;
9
+ declare const SwaggerUIComponent: any;
10
+ export { FormField, ShadowedComponent, ButtonField, InputField, TextField, EmailField, ModalComponent, ModalEnclosureComponent, SwaggerUIComponent };
@@ -0,0 +1,3 @@
1
+ declare const GridComponent: any;
2
+ declare const GridItemComponent: any;
3
+ export { GridComponent, GridItemComponent };