educoreapp2 1.0.66 → 1.0.68
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/dist/index.js +21 -1
- package/dist/lib/API.js +1 -1
- package/dist/lib/APILocal.js +76 -0
- package/dist/spxbasecode/cmps/BaseInputString.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -9,6 +9,24 @@ Object.defineProperty(exports, "API", {
|
|
9
9
|
return _API.default;
|
10
10
|
}
|
11
11
|
});
|
12
|
+
Object.defineProperty(exports, "APIFaker", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function () {
|
15
|
+
return _APIFaker.default;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
Object.defineProperty(exports, "APILocal", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function () {
|
21
|
+
return _APIServer.default;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
Object.defineProperty(exports, "APIServer", {
|
25
|
+
enumerable: true,
|
26
|
+
get: function () {
|
27
|
+
return _APIServer.default;
|
28
|
+
}
|
29
|
+
});
|
12
30
|
Object.defineProperty(exports, "ApiCode", {
|
13
31
|
enumerable: true,
|
14
32
|
get: function () {
|
@@ -179,6 +197,9 @@ Object.defineProperty(exports, "Validators", {
|
|
179
197
|
});
|
180
198
|
var _EduApp = _interopRequireDefault(require("./EduApp"));
|
181
199
|
var _Tools = _interopRequireDefault(require("./Tools"));
|
200
|
+
var _API = _interopRequireDefault(require("./lib/API"));
|
201
|
+
var _APIFaker = _interopRequireDefault(require("./lib/APIFaker"));
|
202
|
+
var _APIServer = _interopRequireDefault(require("./lib/APIServer"));
|
182
203
|
var _ApiCode = _interopRequireDefault(require("./lib/ApiCode"));
|
183
204
|
var _Translate = _interopRequireDefault(require("./Translate"));
|
184
205
|
var _Validators = _interopRequireDefault(require("./spxbasecode/Validators"));
|
@@ -203,7 +224,6 @@ var _BaseList = _interopRequireDefault(require("./spxbasecode/cmps/BaseList"));
|
|
203
224
|
var _LogoEdupanel = _interopRequireDefault(require("./spxbasecode/cmps/LogoEdupanel"));
|
204
225
|
var _BaseSlimPage = _interopRequireDefault(require("./spxbasecode/cmps/BaseSlimPage"));
|
205
226
|
var _TextToCommand = _interopRequireDefault(require("./spxbasecode/cmps/TextToCommand"));
|
206
|
-
var _API = _interopRequireDefault(require("./lib/API"));
|
207
227
|
var _BaseLabel = _interopRequireDefault(require("./spxbasecode/cmps/BaseLabel"));
|
208
228
|
var _ProfileMenu = _interopRequireDefault(require("./spxbasecode/cmps/ProfileMenu"));
|
209
229
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/dist/lib/API.js
CHANGED
@@ -43,7 +43,7 @@ class API extends _react.Component {
|
|
43
43
|
params.sessid = _Tools.default.LSGet("sessid");
|
44
44
|
return params;
|
45
45
|
}
|
46
|
-
async exec(module, name, params, success, error) {
|
46
|
+
async exec(isLocal, module, name, params, success, error) {
|
47
47
|
let modName = module + "/" + name;
|
48
48
|
let path = this.api + "/" + modName;
|
49
49
|
params = await this.addBaseParams(params);
|
@@ -0,0 +1,76 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _Tools = _interopRequireDefault(require("./../Tools"));
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
12
|
+
class APILocal extends _react.Component {
|
13
|
+
constructor(props) {
|
14
|
+
super();
|
15
|
+
this.props = props;
|
16
|
+
this.api = this.getAPI();
|
17
|
+
}
|
18
|
+
static IsProd() {
|
19
|
+
//console.log(window.App.Config.isProd);
|
20
|
+
return window.App.Config.isProd;
|
21
|
+
//console.log(window.location.host);
|
22
|
+
return ["localhost", "edumag.edupanel.pl", "edupanel.pl"].indexOf(window.location.host) >= 0;
|
23
|
+
}
|
24
|
+
static IsDev() {
|
25
|
+
return window.App.Config.isDev;
|
26
|
+
}
|
27
|
+
getAPI() {
|
28
|
+
if (APIServer.IsProd()) {
|
29
|
+
return window.App.Config.API_HOST_PROD;
|
30
|
+
} else {
|
31
|
+
return window.App.Config.API_HOST_DEV;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
async addBaseParams(params) {
|
35
|
+
if (_Tools.default.empty(params)) {
|
36
|
+
params = {};
|
37
|
+
}
|
38
|
+
if (!(_Tools.default.IsArray(params) || _Tools.default.IsObject(params))) {
|
39
|
+
//console.log(params);
|
40
|
+
return null;
|
41
|
+
}
|
42
|
+
params.devid = await _Tools.default.GetDeviceId();
|
43
|
+
params.sessid = _Tools.default.LSGet("sessid");
|
44
|
+
return params;
|
45
|
+
}
|
46
|
+
async exec(module, name, params, success, error) {
|
47
|
+
let path = this.api + "/" + module + "/" + name;
|
48
|
+
//(params);
|
49
|
+
//Tools.log(path);
|
50
|
+
params = await this.addBaseParams(params);
|
51
|
+
//console.log("pppppppssss",params);
|
52
|
+
_Tools.default.SendToApi(path, params, success, error);
|
53
|
+
/* fetch(path, {
|
54
|
+
method: 'POST',
|
55
|
+
headers: {
|
56
|
+
'Content-Type': 'application/json'
|
57
|
+
},
|
58
|
+
body: JSON.stringify(params),
|
59
|
+
mode: 'cors'
|
60
|
+
})
|
61
|
+
.then(response => response.json())
|
62
|
+
.then(data => {
|
63
|
+
Tools.log(data);
|
64
|
+
console.log(data);
|
65
|
+
})
|
66
|
+
.catch(error => {
|
67
|
+
Tools.log(error);
|
68
|
+
console.error(error);
|
69
|
+
});
|
70
|
+
*/
|
71
|
+
}
|
72
|
+
render() {
|
73
|
+
return /*#__PURE__*/_react.default.createElement("div", null);
|
74
|
+
}
|
75
|
+
}
|
76
|
+
var _default = exports.default = APILocal;
|
@@ -87,7 +87,7 @@ class BaseInputString extends _react.Component {
|
|
87
87
|
let xx = "inputStringError";
|
88
88
|
this.states.className2 = xx;
|
89
89
|
let str = TT[error];
|
90
|
-
console.log(this.states.validator.minLength);
|
90
|
+
console.log(error, this.states.validator.minLength);
|
91
91
|
let MAP = {
|
92
92
|
"label": this.states.label,
|
93
93
|
"minLength": this.states.validator.minLength,
|