argous 1.2.215 → 1.2.216
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/api/index.d.ts +2 -2
- package/dist/api/index.js +3 -3
- package/dist/utils/api.js +2 -3
- package/lib/api/index.js +3 -3
- package/lib/utils/api.ts +2 -3
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function server(): string;
|
|
2
2
|
export function api(): string;
|
|
3
|
-
export function headers(
|
|
3
|
+
export function headers(token: any): {
|
|
4
4
|
lgTkn: any;
|
|
5
5
|
};
|
|
6
6
|
export function fetchToArgous(request: string, data: any): any;
|
|
@@ -15,7 +15,7 @@ export function getPostPublicacao(data: any): Promise<any>;
|
|
|
15
15
|
export function getProgram(data: any): Promise<any>;
|
|
16
16
|
export function agGet(data: any): object;
|
|
17
17
|
export function agSet(data: any): object;
|
|
18
|
-
export function action(data: any): Promise<any>;
|
|
18
|
+
export function action(data: any, token: any): Promise<any>;
|
|
19
19
|
export function method(data: any): object;
|
|
20
20
|
export function getFavorites(): Promise<any>;
|
|
21
21
|
export function toggleFavorite(data: any): Promise<any>;
|
package/dist/api/index.js
CHANGED
|
@@ -54,7 +54,7 @@ var server = function () { return "://" + config_1.getConfig()[/^[a-z]+.+\.com\.
|
|
|
54
54
|
exports.server = server;
|
|
55
55
|
var api = function () { return "" + (config_1.getConfig().ssl ? 'https' : 'http') + exports.server() + "argous/"; };
|
|
56
56
|
exports.api = api;
|
|
57
|
-
var headers = function (
|
|
57
|
+
var headers = function (token) { return ({ lgTkn: (token) ? token : utils_1.getCookie('lt') }); };
|
|
58
58
|
exports.headers = headers;
|
|
59
59
|
/**
|
|
60
60
|
* @deprecated
|
|
@@ -278,14 +278,14 @@ var agSet = function (data) { return __awaiter(void 0, void 0, void 0, function
|
|
|
278
278
|
});
|
|
279
279
|
}); };
|
|
280
280
|
exports.agSet = agSet;
|
|
281
|
-
var action = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
281
|
+
var action = function (data, token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
282
282
|
var res;
|
|
283
283
|
return __generator(this, function (_a) {
|
|
284
284
|
switch (_a.label) {
|
|
285
285
|
case 0: return [4 /*yield*/, fetch(exports.api() + "agaction.rslvr", {
|
|
286
286
|
method: 'POST',
|
|
287
287
|
body: JSON.stringify(data),
|
|
288
|
-
headers: exports.headers(
|
|
288
|
+
headers: exports.headers(token)
|
|
289
289
|
})];
|
|
290
290
|
case 1:
|
|
291
291
|
res = _a.sent();
|
package/dist/utils/api.js
CHANGED
|
@@ -147,10 +147,9 @@ var serverAction = function (metodo, dados, pgCode, tratarErro, token) {
|
|
|
147
147
|
data = {
|
|
148
148
|
pgCode: currentProgram,
|
|
149
149
|
action: metodo,
|
|
150
|
-
dados: dados
|
|
151
|
-
token: token
|
|
150
|
+
dados: dados
|
|
152
151
|
};
|
|
153
|
-
return [4 /*yield*/, api_1.action(data)];
|
|
152
|
+
return [4 /*yield*/, api_1.action(data, token)];
|
|
154
153
|
case 3:
|
|
155
154
|
res = _b.sent();
|
|
156
155
|
if (debuging && process.env.NODE_ENV !== 'production') {
|
package/lib/api/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export const server = () => `://${getConfig()[/^[a-z]+.+\.com\.br$/.test(window.
|
|
|
5
5
|
|
|
6
6
|
export const api = () => `${getConfig().ssl ? 'https' : 'http'}${server()}argous/`;
|
|
7
7
|
|
|
8
|
-
export const headers = (
|
|
8
|
+
export const headers = (token) => ({ lgTkn: (token) ? token : getCookie('lt') });
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @deprecated
|
|
@@ -133,11 +133,11 @@ export const agSet = async (data) => {
|
|
|
133
133
|
return await res.json();
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
-
export const action = async (data) => {
|
|
136
|
+
export const action = async (data, token) => {
|
|
137
137
|
const res = await fetch(`${api()}agaction.rslvr`, {
|
|
138
138
|
method: 'POST',
|
|
139
139
|
body: JSON.stringify(data),
|
|
140
|
-
headers: headers(
|
|
140
|
+
headers: headers(token)
|
|
141
141
|
});
|
|
142
142
|
return await res.json();
|
|
143
143
|
};
|
package/lib/utils/api.ts
CHANGED
|
@@ -66,11 +66,10 @@ export const serverAction = async (metodo:string, dados = {}, pgCode?:string|boo
|
|
|
66
66
|
const data = {
|
|
67
67
|
pgCode: currentProgram,
|
|
68
68
|
action: metodo,
|
|
69
|
-
dados
|
|
70
|
-
token
|
|
69
|
+
dados
|
|
71
70
|
};
|
|
72
71
|
|
|
73
|
-
const res = await action(data);
|
|
72
|
+
const res = await action(data, token);
|
|
74
73
|
if (debuging && process.env.NODE_ENV !== 'production') {
|
|
75
74
|
console.log('-------- Server Action ---------');
|
|
76
75
|
console.log('pgCode: ', currentProgram);
|