@fixefy/fixefy-ui-utils 0.2.70 → 0.2.71
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/auth/index.d.ts +1 -1
- package/dist/headers/index.d.ts +1 -1
- package/package.json +3 -2
- package/dist/fixefy-ui-utils/src/auth/index.js +0 -80
- package/dist/fixefy-ui-utils/src/commander/index.js +0 -391
- package/dist/fixefy-ui-utils/src/constants/index.js +0 -177
- package/dist/fixefy-ui-utils/src/files/index.js +0 -41
- package/dist/fixefy-ui-utils/src/graphql/index.js +0 -375
- package/dist/fixefy-ui-utils/src/headers/index.js +0 -148
- package/dist/fixefy-ui-utils/src/images/index.js +0 -34
- package/dist/fixefy-ui-utils/src/index.js +0 -41
- package/dist/fixefy-ui-utils/src/json/index.js +0 -170
- package/dist/fixefy-ui-utils/src/makeStyles/index.js +0 -23
- package/dist/fixefy-ui-utils/src/page_context/index.js +0 -1000
- package/dist/fixefy-ui-utils/src/redirect/index.js +0 -31
- package/dist/fixefy-ui-utils/src/resolvers/index.js +0 -51
- package/dist/fixefy-ui-utils/src/transform/index.js +0 -96
- package/dist/fixefy-ui-utils/src/types/index.js +0 -4
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _router = /*#__PURE__*/ _interop_require_default(require("next/router"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
const redirect = (context, target)=>{
|
|
18
|
-
if (context.res) {
|
|
19
|
-
// server
|
|
20
|
-
// 303: "See other"
|
|
21
|
-
// console.log('SERVER RESPONSE :', context.res)
|
|
22
|
-
context.res.writeHead(303, {
|
|
23
|
-
Location: target
|
|
24
|
-
});
|
|
25
|
-
context.res.end();
|
|
26
|
-
} else {
|
|
27
|
-
// In the browser, we just pretend like this never even happened ;)
|
|
28
|
-
_router.default.replace(target);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const _default = redirect;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "resolvers", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return resolvers;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _graphqltag = /*#__PURE__*/ _interop_require_default(require("graphql-tag"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
const CURRENT_PAGE_QUERY = (0, _graphqltag.default)`
|
|
18
|
-
query CURRENT_PAGE_QUERY {
|
|
19
|
-
currentPage @client {
|
|
20
|
-
name
|
|
21
|
-
path
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
const resolvers = {
|
|
26
|
-
Mutation: {
|
|
27
|
-
changePage (_, args, { cache }) {
|
|
28
|
-
// console.log(_, args, cache)
|
|
29
|
-
// read the page value from the cache
|
|
30
|
-
const { currentPage } = cache.readQuery({
|
|
31
|
-
query: CURRENT_PAGE_QUERY
|
|
32
|
-
});
|
|
33
|
-
// if navigating to new page Write the Page State to that
|
|
34
|
-
if (args.to !== currentPage.name) {
|
|
35
|
-
const data = {
|
|
36
|
-
currentPage: {
|
|
37
|
-
name: args.to,
|
|
38
|
-
path: '/' + args.to,
|
|
39
|
-
__typename: 'currentPage'
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
cache.writeQuery({
|
|
43
|
-
query: CURRENT_PAGE_QUERY,
|
|
44
|
-
data
|
|
45
|
-
});
|
|
46
|
-
return data;
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "transform", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return transform;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _csvtojson = /*#__PURE__*/ _interop_require_default(require("csvtojson"));
|
|
12
|
-
const _convertexceltojson = /*#__PURE__*/ _interop_require_default(require("convert-excel-to-json"));
|
|
13
|
-
require("regenerator-runtime/runtime.js");
|
|
14
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
15
|
-
try {
|
|
16
|
-
var info = gen[key](arg);
|
|
17
|
-
var value = info.value;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
reject(error);
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (info.done) {
|
|
23
|
-
resolve(value);
|
|
24
|
-
} else {
|
|
25
|
-
Promise.resolve(value).then(_next, _throw);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _async_to_generator(fn) {
|
|
29
|
-
return function() {
|
|
30
|
-
var self = this, args = arguments;
|
|
31
|
-
return new Promise(function(resolve, reject) {
|
|
32
|
-
var gen = fn.apply(self, args);
|
|
33
|
-
function _next(value) {
|
|
34
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
35
|
-
}
|
|
36
|
-
function _throw(err) {
|
|
37
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
38
|
-
}
|
|
39
|
-
_next(undefined);
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function _interop_require_default(obj) {
|
|
44
|
-
return obj && obj.__esModule ? obj : {
|
|
45
|
-
default: obj
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
const defaultOptions = {
|
|
49
|
-
columns: true,
|
|
50
|
-
skip_empty_lines: true,
|
|
51
|
-
quote: '"',
|
|
52
|
-
ltrim: true,
|
|
53
|
-
rtrim: true,
|
|
54
|
-
delimiter: ','
|
|
55
|
-
};
|
|
56
|
-
const transform = function() {
|
|
57
|
-
var _ref = _async_to_generator(function*({ data, data_type, options = defaultOptions }) {
|
|
58
|
-
let rv = data;
|
|
59
|
-
data_type = data_type.substring(data_type.lastIndexOf('/') + 1, data_type.length + 1).toLowerCase();
|
|
60
|
-
switch(data_type){
|
|
61
|
-
case 'csv':
|
|
62
|
-
rv = yield _csvToJson({
|
|
63
|
-
csv: data,
|
|
64
|
-
options
|
|
65
|
-
});
|
|
66
|
-
rv = JSON.stringify(rv).trim();
|
|
67
|
-
break;
|
|
68
|
-
case 'xls':
|
|
69
|
-
rv = _xlsToJson({
|
|
70
|
-
xls: data
|
|
71
|
-
});
|
|
72
|
-
break;
|
|
73
|
-
case 'xml':
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
return rv;
|
|
77
|
-
});
|
|
78
|
-
return function transform(_) {
|
|
79
|
-
return _ref.apply(this, arguments);
|
|
80
|
-
};
|
|
81
|
-
}();
|
|
82
|
-
const _csvToJson = function() {
|
|
83
|
-
var _ref = _async_to_generator(function*({ csv, options = defaultOptions }) {
|
|
84
|
-
const rv = yield (0, _csvtojson.default)(options).fromString(csv);
|
|
85
|
-
return rv;
|
|
86
|
-
});
|
|
87
|
-
return function _csvToJson(_) {
|
|
88
|
-
return _ref.apply(this, arguments);
|
|
89
|
-
};
|
|
90
|
-
}();
|
|
91
|
-
const _xlsToJson = ({ xls })=>{
|
|
92
|
-
const rv = (0, _convertexceltojson.default)({
|
|
93
|
-
source: xls
|
|
94
|
-
});
|
|
95
|
-
return rv;
|
|
96
|
-
};
|