argous 1.2.213 → 1.2.215

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.js CHANGED
@@ -54,13 +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
- // export const headers = (data) => ({ lgTkn: (data?.token) ? data.token : getCookie('lt') });
58
- var headers = function (data) {
59
- var response = { lgTkn: (data === null || data === void 0 ? void 0 : data.token) ? data.token : utils_1.getCookie('lt') };
60
- console.log('headers data', data);
61
- console.log('headers', response);
62
- return response;
63
- };
57
+ var headers = function (data) { return ({ lgTkn: (data === null || data === void 0 ? void 0 : data.token) ? data.token : utils_1.getCookie('lt') }); };
64
58
  exports.headers = headers;
65
59
  /**
66
60
  * @deprecated
@@ -284,27 +278,15 @@ var agSet = function (data) { return __awaiter(void 0, void 0, void 0, function
284
278
  });
285
279
  }); };
286
280
  exports.agSet = agSet;
287
- // export const action = async (data) => {
288
- // const res = await fetch(`${api()}agaction.rslvr`, {
289
- // method: 'POST',
290
- // body: JSON.stringify(data),
291
- // headers: headers(data)
292
- // });
293
- // return await res.json();
294
- // };
295
281
  var action = function (data) { return __awaiter(void 0, void 0, void 0, function () {
296
- var headersResponse, res;
282
+ var res;
297
283
  return __generator(this, function (_a) {
298
284
  switch (_a.label) {
299
- case 0:
300
- headersResponse = exports.headers(data);
301
- console.log('action data', data);
302
- console.log('action headers', headersResponse);
303
- return [4 /*yield*/, fetch(exports.api() + "agaction.rslvr", {
304
- method: 'POST',
305
- body: JSON.stringify(data),
306
- headers: headersResponse
307
- })];
285
+ case 0: return [4 /*yield*/, fetch(exports.api() + "agaction.rslvr", {
286
+ method: 'POST',
287
+ body: JSON.stringify(data),
288
+ headers: exports.headers(data)
289
+ })];
308
290
  case 1:
309
291
  res = _a.sent();
310
292
  return [4 /*yield*/, res.json()];
package/lib/api/index.js CHANGED
@@ -5,15 +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 = (data) => ({ lgTkn: (data?.token) ? data.token : getCookie('lt') });
9
- export const headers = (data) => {
10
- const response = { lgTkn: (data?.token) ? data.token : getCookie('lt') };
11
-
12
- console.log('headers data', data);
13
- console.log('headers', response);
14
-
15
- return response;
16
- };
8
+ export const headers = (data) => ({ lgTkn: (data?.token) ? data.token : getCookie('lt') });
17
9
 
18
10
  /**
19
11
  * @deprecated
@@ -141,24 +133,11 @@ export const agSet = async (data) => {
141
133
  return await res.json();
142
134
  };
143
135
 
144
- // export const action = async (data) => {
145
- // const res = await fetch(`${api()}agaction.rslvr`, {
146
- // method: 'POST',
147
- // body: JSON.stringify(data),
148
- // headers: headers(data)
149
- // });
150
- // return await res.json();
151
- // };
152
136
  export const action = async (data) => {
153
- const headersResponse = headers(data);
154
-
155
- console.log('action data', data);
156
- console.log('action headers', headersResponse);
157
-
158
137
  const res = await fetch(`${api()}agaction.rslvr`, {
159
138
  method: 'POST',
160
139
  body: JSON.stringify(data),
161
- headers: headersResponse
140
+ headers: headers(data)
162
141
  });
163
142
  return await res.json();
164
143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "argous",
3
- "version": "1.2.213",
3
+ "version": "1.2.215",
4
4
  "description": "Argous.",
5
5
  "main": "lib/index.js",
6
6
  "author": "Carlos Schneider",