@vocollege/app 0.0.56 → 0.0.59
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/{types.d.ts → global.d.ts} +4 -0
- package/dist/{types.js → global.js} +0 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +9 -3
- package/dist/interceptor.js +41 -12
- package/dist/modules/Services/I18n/I18n.js +1 -1
- package/dist/modules/Services/I18n/strings.json +716 -21
- package/dist/modules/Services/Vapor/Vapor.js +15 -7
- package/dist/modules/VoApi/GraphClient.d.ts +3 -2
- package/dist/modules/VoApi/GraphClient.js +57 -14
- package/dist/modules/VoApi/VoApi.d.ts +4 -1
- package/dist/modules/VoApi/VoApi.js +20 -2
- package/dist/modules/VoApi/graphql.d.ts +32 -0
- package/dist/modules/VoApi/graphql.js +57 -0
- package/dist/modules/VoApi/index.d.ts +1 -21
- package/dist/modules/VoApi/index.js +7 -31
- package/dist/modules/VoApi/mutations/acl.js +5 -5
- package/dist/modules/VoApi/mutations/applications.d.ts +3 -0
- package/dist/modules/VoApi/mutations/applications.js +12 -0
- package/dist/modules/VoApi/mutations/articles.js +3 -3
- package/dist/modules/VoApi/mutations/books.d.ts +3 -0
- package/dist/modules/VoApi/mutations/books.js +12 -0
- package/dist/modules/VoApi/mutations/cards.d.ts +3 -0
- package/dist/modules/VoApi/mutations/cards.js +12 -0
- package/dist/modules/VoApi/mutations/events.d.ts +3 -0
- package/dist/modules/VoApi/mutations/events.js +12 -0
- package/dist/modules/VoApi/mutations/navigation.js +3 -3
- package/dist/modules/VoApi/mutations/pages.js +3 -3
- package/dist/modules/VoApi/mutations/queues.js +3 -3
- package/dist/modules/VoApi/mutations/sections.d.ts +3 -0
- package/dist/modules/VoApi/mutations/sections.js +12 -0
- package/dist/modules/VoApi/mutations/settings.js +1 -1
- package/dist/modules/VoApi/mutations/users.js +3 -3
- package/dist/modules/VoApi/mutations/vodocs.js +9 -9
- package/dist/modules/VoApi/mutations/vogroups.d.ts +1 -0
- package/dist/modules/VoApi/mutations/vogroups.js +10 -9
- package/dist/modules/VoApi/queries/acl.js +4 -4
- package/dist/modules/VoApi/queries/applications.d.ts +2 -0
- package/dist/modules/VoApi/queries/applications.js +11 -0
- package/dist/modules/VoApi/queries/articles.js +2 -2
- package/dist/modules/VoApi/queries/books.d.ts +4 -0
- package/dist/modules/VoApi/queries/books.js +13 -0
- package/dist/modules/VoApi/queries/cards.d.ts +2 -0
- package/dist/modules/VoApi/queries/cards.js +11 -0
- package/dist/modules/VoApi/queries/events.d.ts +2 -0
- package/dist/modules/VoApi/queries/events.js +11 -0
- package/dist/modules/VoApi/queries/help.d.ts +1 -0
- package/dist/modules/VoApi/queries/help.js +11 -0
- package/dist/modules/VoApi/queries/navigation.js +4 -4
- package/dist/modules/VoApi/queries/pages.js +2 -2
- package/dist/modules/VoApi/queries/queues.js +2 -2
- package/dist/modules/VoApi/queries/search.d.ts +2 -0
- package/dist/modules/VoApi/queries/search.js +5 -3
- package/dist/modules/VoApi/queries/sections.d.ts +2 -0
- package/dist/modules/VoApi/queries/sections.js +11 -0
- package/dist/modules/VoApi/queries/settings.js +1 -1
- package/dist/modules/VoApi/queries/users.d.ts +1 -0
- package/dist/modules/VoApi/queries/users.js +5 -4
- package/dist/modules/VoApi/queries/vodocs.js +3 -3
- package/dist/modules/VoApi/queries/vogroups.d.ts +1 -0
- package/dist/modules/VoApi/queries/vogroups.js +9 -8
- package/dist/modules/VoApp.d.ts +1 -0
- package/dist/modules/VoApp.js +17 -0
- package/dist/modules/VoAuth.d.ts +2 -1
- package/dist/modules/VoAuth.js +126 -42
- package/dist/modules/VoBase.js +2 -2
- package/dist/modules/VoConfig.js +10 -0
- package/dist/modules/VoDocs/VoDocs.d.ts +1 -2
- package/dist/modules/VoDocs/VoDocs.js +12 -44
- package/dist/modules/VoGroups.d.ts +7 -0
- package/dist/modules/VoGroups.js +39 -0
- package/dist/modules/VoHelpers.d.ts +38 -1
- package/dist/modules/VoHelpers.js +348 -51
- package/dist/modules/VoRouter.js +10 -2
- package/dist/modules/{VoUtils.d.ts → VoUtils_REMOVE.d.ts} +1 -1
- package/dist/modules/{VoUtils.js → VoUtils_REMOVE.js} +16 -12
- package/package.json +17 -8
- package/src/global.ts +44 -0
- package/src/index.ts +3 -2
- package/src/interceptor.ts +39 -8
- package/src/modules/Services/I18n/strings.json +718 -22
- package/src/modules/Services/Vapor/Vapor.ts +14 -15
- package/src/modules/VoApi/GraphClient.ts +87 -24
- package/src/modules/VoApi/VoApi.ts +23 -3
- package/src/modules/VoApi/graphql.ts +47 -0
- package/src/modules/VoApi/index.ts +1 -37
- package/src/modules/VoApi/mutations/applications.ts +27 -0
- package/src/modules/VoApi/mutations/books.ts +27 -0
- package/src/modules/VoApi/mutations/cards.ts +27 -0
- package/src/modules/VoApi/mutations/events.ts +27 -0
- package/src/modules/VoApi/mutations/queues.ts +9 -1
- package/src/modules/VoApi/mutations/sections.ts +27 -0
- package/src/modules/VoApi/mutations/settings.ts +11 -3
- package/src/modules/VoApi/mutations/users.ts +19 -9
- package/src/modules/VoApi/mutations/vodocs.ts +4 -0
- package/src/modules/VoApi/mutations/vogroups.ts +21 -7
- package/src/modules/VoApi/queries/applications.ts +71 -0
- package/src/modules/VoApi/queries/articles.ts +26 -4
- package/src/modules/VoApi/queries/books.ts +101 -0
- package/src/modules/VoApi/queries/cards.ts +87 -0
- package/src/modules/VoApi/queries/events.ts +80 -0
- package/src/modules/VoApi/queries/help.ts +12 -0
- package/src/modules/VoApi/queries/navigation.ts +3 -4
- package/src/modules/VoApi/queries/pages.ts +29 -4
- package/src/modules/VoApi/queries/queues.ts +69 -4
- package/src/modules/VoApi/queries/search.ts +105 -4
- package/src/modules/VoApi/queries/sections.ts +63 -0
- package/src/modules/VoApi/queries/settings.ts +9 -3
- package/src/modules/VoApi/queries/users.ts +93 -8
- package/src/modules/VoApi/queries/vodocs.ts +8 -4
- package/src/modules/VoApi/queries/vogroups.ts +48 -2
- package/src/modules/VoApp.ts +25 -8
- package/src/modules/VoAuth.ts +136 -37
- package/src/modules/VoConfig.ts +13 -0
- package/src/modules/VoDocs/VoDocs.ts +31 -58
- package/src/modules/VoGroups.ts +33 -0
- package/src/modules/VoHelpers.ts +283 -43
- package/src/modules/VoRouter.ts +10 -3
- package/src/modules/{VoUtils.ts → VoUtils_REMOVE.ts} +17 -13
- package/src/types.ts +0 -38
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ import VoAuth from "./modules/VoAuth";
|
|
|
4
4
|
import VoRouter from "./modules/VoRouter";
|
|
5
5
|
import VoConfig from "./modules/VoConfig";
|
|
6
6
|
import VoDocs from "./modules/VoDocs";
|
|
7
|
+
import VoGroups from "./modules/VoGroups";
|
|
7
8
|
import "./interceptor";
|
|
8
|
-
export { VoApi, VoApp, VoAuth, VoRouter, VoConfig, VoDocs };
|
|
9
|
+
export { VoApi, VoApp, VoAuth, VoRouter, VoConfig, VoDocs, VoGroups };
|
|
9
10
|
export * from "./modules/VoApi";
|
|
10
11
|
export * from "./modules/VoHelpers";
|
|
11
12
|
export * from "./modules/Services";
|
|
12
|
-
export * from "./
|
|
13
|
+
export * from "./global";
|
|
13
14
|
export default VoApp;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -13,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
18
|
};
|
|
15
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.VoDocs = exports.VoConfig = exports.VoRouter = exports.VoAuth = exports.VoApp = exports.VoApi = void 0;
|
|
20
|
+
exports.VoGroups = exports.VoDocs = exports.VoConfig = exports.VoRouter = exports.VoAuth = exports.VoApp = exports.VoApi = void 0;
|
|
17
21
|
var VoApi_1 = __importDefault(require("./modules/VoApi"));
|
|
18
22
|
exports.VoApi = VoApi_1.default;
|
|
19
23
|
var VoApp_1 = __importDefault(require("./modules/VoApp"));
|
|
@@ -26,9 +30,11 @@ var VoConfig_1 = __importDefault(require("./modules/VoConfig"));
|
|
|
26
30
|
exports.VoConfig = VoConfig_1.default;
|
|
27
31
|
var VoDocs_1 = __importDefault(require("./modules/VoDocs"));
|
|
28
32
|
exports.VoDocs = VoDocs_1.default;
|
|
33
|
+
var VoGroups_1 = __importDefault(require("./modules/VoGroups"));
|
|
34
|
+
exports.VoGroups = VoGroups_1.default;
|
|
29
35
|
require("./interceptor");
|
|
30
36
|
__exportStar(require("./modules/VoApi"), exports);
|
|
31
37
|
__exportStar(require("./modules/VoHelpers"), exports);
|
|
32
38
|
__exportStar(require("./modules/Services"), exports);
|
|
33
|
-
__exportStar(require("./
|
|
39
|
+
__exportStar(require("./global"), exports);
|
|
34
40
|
exports.default = VoApp_1.default;
|
package/dist/interceptor.js
CHANGED
|
@@ -42,23 +42,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
42
42
|
var axios_1 = __importDefault(require("axios"));
|
|
43
43
|
var VoAuth_1 = __importDefault(require("./modules/VoAuth"));
|
|
44
44
|
var VoRouter_1 = __importDefault(require("./modules/VoRouter"));
|
|
45
|
+
// import VoApp from "./modules/VoApp";
|
|
46
|
+
var react_toastify_1 = require("react-toastify");
|
|
47
|
+
// Custom.
|
|
48
|
+
var I18n_1 = __importDefault(require("./modules/Services/I18n"));
|
|
45
49
|
(function () {
|
|
46
50
|
var _this = this;
|
|
47
51
|
var retry = 0;
|
|
48
52
|
function redirect() {
|
|
49
53
|
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
+
var error_1;
|
|
50
55
|
return __generator(this, function (_a) {
|
|
51
56
|
switch (_a.label) {
|
|
52
|
-
case 0:
|
|
57
|
+
case 0:
|
|
58
|
+
_a.trys.push([0, 2, , 3]);
|
|
59
|
+
return [4 /*yield*/, VoAuth_1.default.logout()];
|
|
53
60
|
case 1:
|
|
54
61
|
_a.sent();
|
|
55
62
|
VoRouter_1.default.redirectToLogout();
|
|
56
|
-
return [
|
|
63
|
+
return [3 /*break*/, 3];
|
|
64
|
+
case 2:
|
|
65
|
+
error_1 = _a.sent();
|
|
66
|
+
console.error("Interceptor", error_1);
|
|
67
|
+
return [3 /*break*/, 3];
|
|
68
|
+
case 3: return [2 /*return*/];
|
|
57
69
|
}
|
|
58
70
|
});
|
|
59
71
|
});
|
|
60
72
|
}
|
|
61
73
|
axios_1.default.defaults.withCredentials = true;
|
|
74
|
+
axios_1.default.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
|
|
62
75
|
axios_1.default.interceptors.request.use(function (req) {
|
|
63
76
|
// console.log('Interceptor request', `${req.method} ${req.url}`);
|
|
64
77
|
return req;
|
|
@@ -66,7 +79,7 @@ var VoRouter_1 = __importDefault(require("./modules/VoRouter"));
|
|
|
66
79
|
axios_1.default.interceptors.response.use(function (res) {
|
|
67
80
|
return res;
|
|
68
81
|
}, function (error) { return __awaiter(_this, void 0, void 0, function () {
|
|
69
|
-
var status, _a, token,
|
|
82
|
+
var status, _a, token, error_2;
|
|
70
83
|
return __generator(this, function (_b) {
|
|
71
84
|
switch (_b.label) {
|
|
72
85
|
case 0:
|
|
@@ -77,7 +90,6 @@ var VoRouter_1 = __importDefault(require("./modules/VoRouter"));
|
|
|
77
90
|
switch (_a) {
|
|
78
91
|
case 400: return [3 /*break*/, 1];
|
|
79
92
|
case 401: return [3 /*break*/, 1];
|
|
80
|
-
case 403: return [3 /*break*/, 1];
|
|
81
93
|
}
|
|
82
94
|
return [3 /*break*/, 5];
|
|
83
95
|
case 1:
|
|
@@ -86,24 +98,41 @@ var VoRouter_1 = __importDefault(require("./modules/VoRouter"));
|
|
|
86
98
|
case 2:
|
|
87
99
|
_b.sent();
|
|
88
100
|
token = VoAuth_1.default.getToken();
|
|
89
|
-
retry = 0;
|
|
90
101
|
// Update the failed request with the new access token
|
|
91
|
-
// in order to
|
|
102
|
+
// in order to redo the call.
|
|
92
103
|
if (token) {
|
|
104
|
+
retry = 0;
|
|
93
105
|
error.config.headers["Authorization"] =
|
|
94
106
|
token.token_type + " " + token.access_token;
|
|
95
107
|
}
|
|
96
108
|
return [2 /*return*/, axios_1.default.request(error.config)];
|
|
97
109
|
case 3:
|
|
98
|
-
|
|
110
|
+
error_2 = _b.sent();
|
|
99
111
|
redirect();
|
|
100
|
-
console.error("Interceptor",
|
|
112
|
+
console.error("Interceptor", error_2);
|
|
101
113
|
return [3 /*break*/, 4];
|
|
102
114
|
case 4: return [3 /*break*/, 5];
|
|
103
|
-
case 5:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
115
|
+
case 5:
|
|
116
|
+
// redirect();
|
|
117
|
+
// console.error("Interceptor", error);
|
|
118
|
+
// return Promise.reject(error);
|
|
119
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
120
|
+
switch (status) {
|
|
121
|
+
// case 403:
|
|
122
|
+
// reject(error);
|
|
123
|
+
// break;
|
|
124
|
+
case 419:
|
|
125
|
+
react_toastify_1.toast.error(I18n_1.default.get.messages.sessionExpired);
|
|
126
|
+
setTimeout(function () {
|
|
127
|
+
redirect();
|
|
128
|
+
}, 5000);
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
reject(error);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
console.error("Interceptor", error);
|
|
135
|
+
})];
|
|
107
136
|
}
|
|
108
137
|
});
|
|
109
138
|
}); });
|
|
@@ -24,7 +24,7 @@ var I18n = /** @class */ (function () {
|
|
|
24
24
|
}
|
|
25
25
|
var result = str;
|
|
26
26
|
for (var placeholder in placeholders) {
|
|
27
|
-
result = result.replace("::"
|
|
27
|
+
result = result.replace("::".concat(placeholder), placeholders[placeholder]);
|
|
28
28
|
}
|
|
29
29
|
return result;
|
|
30
30
|
};
|