@fixefy/fixefy-ui-utils 0.0.18 → 0.0.19

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.
Files changed (169) hide show
  1. package/dist/auth/index.js +89 -0
  2. package/dist/aws/aws_lambda_helper.js +184 -0
  3. package/dist/aws/aws_s3_helper.d.ts +1 -0
  4. package/dist/aws/aws_s3_helper.js +465 -0
  5. package/dist/aws/data_models.js +4 -0
  6. package/dist/aws/index.js +18 -0
  7. package/{dist-types → dist}/commander/index.d.ts +4 -2
  8. package/dist/commander/index.js +390 -0
  9. package/{dist-cjs → dist}/constants/index.d.ts +7 -0
  10. package/{dist-cjs → dist}/constants/index.js +41 -15
  11. package/dist/contents/index.js +154 -0
  12. package/{dist-cjs → dist}/files/index.js +22 -12
  13. package/dist/graphql/index.js +382 -0
  14. package/{dist-cjs → dist}/headers/index.d.ts +2 -4
  15. package/dist/headers/index.js +161 -0
  16. package/dist/images/index.js +18 -0
  17. package/{dist-cjs → dist}/index.d.ts +3 -0
  18. package/dist/index.js +43 -0
  19. package/{dist-cjs → dist}/json/index.js +67 -56
  20. package/{dist-es → dist}/page_context/index.d.ts +14 -0
  21. package/dist/page_context/index.js +742 -0
  22. package/dist/redirect/index.js +31 -0
  23. package/{dist-cjs → dist}/renderer/index.d.ts +1 -1
  24. package/dist/renderer/index.js +125 -0
  25. package/dist/resolvers/index.js +51 -0
  26. package/dist/transform/index.js +96 -0
  27. package/dist/types/index.js +4 -0
  28. package/{dist-cjs → dist}/validate/index.d.ts +1 -1
  29. package/dist/validate/index.js +68 -0
  30. package/package.json +7 -8
  31. package/dist-cjs/auth/index.js +0 -40
  32. package/dist-cjs/auth/index.js.map +0 -1
  33. package/dist-cjs/aws/aws_lambda_helper.js +0 -68
  34. package/dist-cjs/aws/aws_lambda_helper.js.map +0 -1
  35. package/dist-cjs/aws/aws_s3_helper.d.ts +0 -0
  36. package/dist-cjs/aws/aws_s3_helper.js +0 -243
  37. package/dist-cjs/aws/aws_s3_helper.js.map +0 -1
  38. package/dist-cjs/aws/data_models.js +0 -3
  39. package/dist-cjs/aws/data_models.js.map +0 -1
  40. package/dist-cjs/aws/index.js +0 -6
  41. package/dist-cjs/aws/index.js.map +0 -1
  42. package/dist-cjs/commander/index.d.ts +0 -33
  43. package/dist-cjs/commander/index.js +0 -292
  44. package/dist-cjs/commander/index.js.map +0 -1
  45. package/dist-cjs/constants/index.js.map +0 -1
  46. package/dist-cjs/contents/index.js +0 -33
  47. package/dist-cjs/contents/index.js.map +0 -1
  48. package/dist-cjs/files/index.js.map +0 -1
  49. package/dist-cjs/graphql/index.js +0 -338
  50. package/dist-cjs/graphql/index.js.map +0 -1
  51. package/dist-cjs/headers/index.js +0 -103
  52. package/dist-cjs/headers/index.js.map +0 -1
  53. package/dist-cjs/images/index.js +0 -16
  54. package/dist-cjs/images/index.js.map +0 -1
  55. package/dist-cjs/index.js +0 -21
  56. package/dist-cjs/index.js.map +0 -1
  57. package/dist-cjs/json/index.js.map +0 -1
  58. package/dist-cjs/package.json +0 -3
  59. package/dist-cjs/page_context/index.d.ts +0 -248
  60. package/dist-cjs/page_context/index.js +0 -511
  61. package/dist-cjs/page_context/index.js.map +0 -1
  62. package/dist-cjs/redirect/index.js +0 -19
  63. package/dist-cjs/redirect/index.js.map +0 -1
  64. package/dist-cjs/renderer/index.js +0 -67
  65. package/dist-cjs/renderer/index.js.map +0 -1
  66. package/dist-cjs/resolvers/index.js +0 -38
  67. package/dist-cjs/resolvers/index.js.map +0 -1
  68. package/dist-cjs/transform/index.js +0 -44
  69. package/dist-cjs/transform/index.js.map +0 -1
  70. package/dist-cjs/types/index.js +0 -3
  71. package/dist-cjs/types/index.js.map +0 -1
  72. package/dist-cjs/validate/index.js +0 -56
  73. package/dist-cjs/validate/index.js.map +0 -1
  74. package/dist-es/auth/index.d.ts +0 -2
  75. package/dist-es/auth/index.js +0 -38
  76. package/dist-es/auth/index.js.map +0 -1
  77. package/dist-es/aws/aws_lambda_helper.d.ts +0 -5
  78. package/dist-es/aws/aws_lambda_helper.js +0 -60
  79. package/dist-es/aws/aws_lambda_helper.js.map +0 -1
  80. package/dist-es/aws/aws_s3_helper.d.ts +0 -0
  81. package/dist-es/aws/aws_s3_helper.js +0 -243
  82. package/dist-es/aws/aws_s3_helper.js.map +0 -1
  83. package/dist-es/aws/data_models.d.ts +0 -21
  84. package/dist-es/aws/data_models.js +0 -2
  85. package/dist-es/aws/data_models.js.map +0 -1
  86. package/dist-es/aws/index.d.ts +0 -1
  87. package/dist-es/aws/index.js +0 -3
  88. package/dist-es/aws/index.js.map +0 -1
  89. package/dist-es/commander/index.d.ts +0 -33
  90. package/dist-es/commander/index.js +0 -262
  91. package/dist-es/commander/index.js.map +0 -1
  92. package/dist-es/constants/index.d.ts +0 -6
  93. package/dist-es/constants/index.js +0 -86
  94. package/dist-es/constants/index.js.map +0 -1
  95. package/dist-es/contents/index.d.ts +0 -3
  96. package/dist-es/contents/index.js +0 -32
  97. package/dist-es/contents/index.js.map +0 -1
  98. package/dist-es/files/index.d.ts +0 -2
  99. package/dist-es/files/index.js +0 -26
  100. package/dist-es/files/index.js.map +0 -1
  101. package/dist-es/graphql/index.d.ts +0 -38
  102. package/dist-es/graphql/index.js +0 -357
  103. package/dist-es/graphql/index.js.map +0 -1
  104. package/dist-es/headers/index.d.ts +0 -12
  105. package/dist-es/headers/index.js +0 -91
  106. package/dist-es/headers/index.js.map +0 -1
  107. package/dist-es/images/index.d.ts +0 -4
  108. package/dist-es/images/index.js +0 -12
  109. package/dist-es/images/index.js.map +0 -1
  110. package/dist-es/index.d.ts +0 -14
  111. package/dist-es/index.js +0 -17
  112. package/dist-es/index.js.map +0 -1
  113. package/dist-es/json/index.d.ts +0 -7
  114. package/dist-es/json/index.js +0 -144
  115. package/dist-es/json/index.js.map +0 -1
  116. package/dist-es/package.json +0 -3
  117. package/dist-es/page_context/index.js +0 -529
  118. package/dist-es/page_context/index.js.map +0 -1
  119. package/dist-es/redirect/index.d.ts +0 -2
  120. package/dist-es/redirect/index.js +0 -16
  121. package/dist-es/redirect/index.js.map +0 -1
  122. package/dist-es/renderer/index.d.ts +0 -9
  123. package/dist-es/renderer/index.js +0 -61
  124. package/dist-es/renderer/index.js.map +0 -1
  125. package/dist-es/resolvers/index.d.ts +0 -11
  126. package/dist-es/resolvers/index.js +0 -34
  127. package/dist-es/resolvers/index.js.map +0 -1
  128. package/dist-es/transform/index.d.ts +0 -2
  129. package/dist-es/transform/index.js +0 -39
  130. package/dist-es/transform/index.js.map +0 -1
  131. package/dist-es/types/index.d.ts +0 -39
  132. package/dist-es/types/index.js +0 -2
  133. package/dist-es/types/index.js.map +0 -1
  134. package/dist-es/validate/index.d.ts +0 -5
  135. package/dist-es/validate/index.js +0 -48
  136. package/dist-es/validate/index.js.map +0 -1
  137. package/dist-types/auth/index.d.ts +0 -2
  138. package/dist-types/aws/aws_lambda_helper.d.ts +0 -5
  139. package/dist-types/aws/aws_s3_helper.d.ts +0 -0
  140. package/dist-types/aws/data_models.d.ts +0 -21
  141. package/dist-types/aws/index.d.ts +0 -1
  142. package/dist-types/constants/index.d.ts +0 -6
  143. package/dist-types/contents/index.d.ts +0 -3
  144. package/dist-types/files/index.d.ts +0 -2
  145. package/dist-types/graphql/index.d.ts +0 -38
  146. package/dist-types/headers/index.d.ts +0 -12
  147. package/dist-types/images/index.d.ts +0 -4
  148. package/dist-types/index.d.ts +0 -14
  149. package/dist-types/json/index.d.ts +0 -7
  150. package/dist-types/page_context/index.d.ts +0 -248
  151. package/dist-types/redirect/index.d.ts +0 -2
  152. package/dist-types/renderer/index.d.ts +0 -9
  153. package/dist-types/resolvers/index.d.ts +0 -11
  154. package/dist-types/transform/index.d.ts +0 -2
  155. package/dist-types/types/index.d.ts +0 -39
  156. package/dist-types/validate/index.d.ts +0 -5
  157. /package/{dist-cjs → dist}/auth/index.d.ts +0 -0
  158. /package/{dist-cjs → dist}/aws/aws_lambda_helper.d.ts +0 -0
  159. /package/{dist-cjs → dist}/aws/data_models.d.ts +0 -0
  160. /package/{dist-cjs → dist}/aws/index.d.ts +0 -0
  161. /package/{dist-cjs → dist}/contents/index.d.ts +0 -0
  162. /package/{dist-cjs → dist}/files/index.d.ts +0 -0
  163. /package/{dist-cjs → dist}/graphql/index.d.ts +0 -0
  164. /package/{dist-cjs → dist}/images/index.d.ts +0 -0
  165. /package/{dist-cjs → dist}/json/index.d.ts +0 -0
  166. /package/{dist-cjs → dist}/redirect/index.d.ts +0 -0
  167. /package/{dist-cjs → dist}/resolvers/index.d.ts +0 -0
  168. /package/{dist-cjs → dist}/transform/index.d.ts +0 -0
  169. /package/{dist-cjs → dist}/types/index.d.ts +0 -0
@@ -1,11 +1,40 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setJToken = exports.isResultValid = exports.isNested = exports.isJson = exports.isHasKey = exports.getJPart = exports.getJToken = void 0;
4
- const __1 = require("..");
5
- const getJToken = (jToken, jsonPath, defaultValue) => {
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ getJPart: function() {
13
+ return getJPart;
14
+ },
15
+ getJToken: function() {
16
+ return getJToken;
17
+ },
18
+ isHasKey: function() {
19
+ return isHasKey;
20
+ },
21
+ isJson: function() {
22
+ return isJson;
23
+ },
24
+ isNested: function() {
25
+ return isNested;
26
+ },
27
+ isResultValid: function() {
28
+ return isResultValid;
29
+ },
30
+ setJToken: function() {
31
+ return setJToken;
32
+ }
33
+ });
34
+ const _ = require("..");
35
+ const getJToken = (jToken, jsonPath, defaultValue)=>{
6
36
  // input check - if key is invalid - return error
7
- if ((0, __1.isObjectValid)(jToken) === false)
8
- return defaultValue;
37
+ if ((0, _.isObjectValid)(jToken) === false) return defaultValue;
9
38
  // convert indexes to properties
10
39
  jsonPath = jsonPath.replace(/\[(\w+)\]/g, '.$1');
11
40
  // strip a leading dot
@@ -16,15 +45,14 @@ const getJToken = (jToken, jsonPath, defaultValue) => {
16
45
  const jsonPathParts = jsonPath.split('.');
17
46
  try {
18
47
  //for ( let i = 0, n = jsonPathParts.length && isContinueLoop; i < n; ++i ) {
19
- for (let i = 0, n = jsonPathParts.length; isContinueLoop && i < n; ++i) {
48
+ for(let i = 0, n = jsonPathParts.length; isContinueLoop && i < n; ++i){
20
49
  currentToken = jsonPathParts[i];
21
50
  if (typeof jToken === 'string') {
22
51
  jToken = JSON.parse(jToken);
23
52
  }
24
53
  if (currentToken in jToken) {
25
54
  jToken = jToken[currentToken];
26
- }
27
- else {
55
+ } else {
28
56
  // if something in the process failed:
29
57
  // 1. set the rv as the default value
30
58
  // 2. stop the loop
@@ -32,17 +60,14 @@ const getJToken = (jToken, jsonPath, defaultValue) => {
32
60
  isContinueLoop = false;
33
61
  }
34
62
  }
35
- }
36
- catch (e) {
63
+ } catch (e) {
37
64
  jToken = 'No Value Found';
38
65
  }
39
66
  return jToken;
40
67
  };
41
- exports.getJToken = getJToken;
42
- const getJPart = (j, jsonPath, defaultValue) => {
68
+ const getJPart = (j, jsonPath, defaultValue)=>{
43
69
  // if key is invalid - return error
44
- if (j == null)
45
- return defaultValue;
70
+ if (j == null) return defaultValue;
46
71
  // convert indexes to properties
47
72
  jsonPath = jsonPath.replace(/\[(\w+)\]/g, '.$1');
48
73
  // strip a leading dot
@@ -50,33 +75,29 @@ const getJPart = (j, jsonPath, defaultValue) => {
50
75
  // split path by '.'
51
76
  let _isArrayValid = false, _isStringValid = false, currentPathPart, isLoop = true;
52
77
  const pathParts = jsonPath.split('.');
53
- for (let i = 0, n = pathParts.length; isLoop && i < n; ++i) {
78
+ for(let i = 0, n = pathParts.length; isLoop && i < n; ++i){
54
79
  currentPathPart = pathParts[i];
55
- _isStringValid = (0, __1.isStringValid)(j);
56
- _isArrayValid = (0, __1.isArrayValid)(j);
80
+ _isStringValid = (0, _.isStringValid)(j);
81
+ _isArrayValid = (0, _.isArrayValid)(j);
57
82
  if (_isStringValid === true || _isArrayValid === true) {
58
83
  if (_isStringValid === true) {
59
84
  j = JSON.parse(j);
60
- }
61
- else {
62
- j = j.reduce((acc, cur) => {
63
- const innerJ = (0, exports.getJPart)(cur, pathParts.slice(i).join('.'), defaultValue);
64
- if ((0, __1.isArrayValid)(innerJ)) {
85
+ } else {
86
+ j = j.reduce((acc, cur)=>{
87
+ const innerJ = getJPart(cur, pathParts.slice(i).join('.'), defaultValue);
88
+ if ((0, _.isArrayValid)(innerJ)) {
65
89
  acc.push(...innerJ);
66
- }
67
- else {
90
+ } else {
68
91
  acc.push(innerJ);
69
92
  }
70
93
  return acc;
71
94
  }, []);
72
95
  isLoop = false;
73
96
  }
74
- }
75
- else {
97
+ } else {
76
98
  if (j[currentPathPart] != null && currentPathPart in j) {
77
99
  j = j[currentPathPart];
78
- }
79
- else {
100
+ } else {
80
101
  // if something in the process failed:
81
102
  // 1. set the rv as the default value
82
103
  // 2. stop the loop`
@@ -87,10 +108,9 @@ const getJPart = (j, jsonPath, defaultValue) => {
87
108
  }
88
109
  return j;
89
110
  };
90
- exports.getJPart = getJPart;
91
- const isHasKey = (array, key) => {
111
+ const isHasKey = (array, key)=>{
92
112
  let rv = false, isContinueLoop = true, current_keys;
93
- for (let i = 0; i < array.length && isContinueLoop; ++i) {
113
+ for(let i = 0; i < array.length && isContinueLoop; ++i){
94
114
  current_keys = Object.keys(array[i]);
95
115
  if ((current_keys || []).indexOf(key) > -1) {
96
116
  rv = true;
@@ -99,56 +119,47 @@ const isHasKey = (array, key) => {
99
119
  }
100
120
  return rv;
101
121
  };
102
- exports.isHasKey = isHasKey;
103
- const isJson = (obj) => {
122
+ const isJson = (obj)=>{
104
123
  let objAsString;
105
124
  try {
106
125
  objAsString = JSON.stringify(obj);
107
- }
108
- catch (e) {
126
+ } catch (e) {
109
127
  objAsString = null;
110
128
  }
111
- if (!objAsString || (0, __1.isStringValid)(objAsString) === false)
112
- return false;
129
+ if (!objAsString || (0, _.isStringValid)(objAsString) === false) return false;
113
130
  const rv = (objAsString === null || objAsString === void 0 ? void 0 : objAsString.indexOf('{')) === 0 && (objAsString === null || objAsString === void 0 ? void 0 : objAsString.indexOf('}')) === (objAsString === null || objAsString === void 0 ? void 0 : objAsString.length) - 1;
114
131
  return rv;
115
132
  };
116
- exports.isJson = isJson;
117
- const isNested = (obj) => {
118
- const rv = Object.keys(obj).some((key) => {
133
+ const isNested = (obj)=>{
134
+ const rv = Object.keys(obj).some((key)=>{
119
135
  return obj[key] && typeof obj[key] === 'object';
120
136
  });
121
137
  return rv;
122
138
  };
123
- exports.isNested = isNested;
124
- const isResultValid = (jResult) => {
125
- if ((0, __1.isObjectValid)(jResult) === false)
126
- return false;
127
- const rv = (0, exports.getJPart)(jResult, 'ok', 0);
139
+ const isResultValid = (jResult)=>{
140
+ if ((0, _.isObjectValid)(jResult) === false) return false;
141
+ const rv = getJPart(jResult, 'ok', 0);
128
142
  return !!rv;
129
143
  };
130
- exports.isResultValid = isResultValid;
131
- const setJToken = (jEntity, fieldPathsAndValues) => {
144
+ const setJToken = (jEntity, fieldPathsAndValues)=>{
132
145
  let jCurrentToken, currentPath, pathParts, fieldName;
133
- for (let i = 0; i < fieldPathsAndValues.length; ++i) {
146
+ for(let i = 0; i < fieldPathsAndValues.length; ++i){
134
147
  currentPath = fieldPathsAndValues[i]['json_path'];
135
- if ((0, __1.isStringValid)(currentPath)) {
148
+ if ((0, _.isStringValid)(currentPath)) {
136
149
  fieldName = currentPath;
137
150
  pathParts = currentPath.split('.');
138
- if ((0, __1.isArrayValid)(pathParts)) {
151
+ if ((0, _.isArrayValid)(pathParts)) {
139
152
  fieldName = pathParts[pathParts.length - 1];
140
153
  pathParts = pathParts.splice(0, Math.max(0, pathParts.length - 1));
141
- if ((0, __1.isArrayValid)(pathParts)) {
154
+ if ((0, _.isArrayValid)(pathParts)) {
142
155
  currentPath = pathParts.join('.');
143
156
  }
144
157
  }
145
- jCurrentToken = (0, exports.getJPart)(jEntity, currentPath, null);
146
- if ((0, __1.isObjectValid)(jCurrentToken) || (0, exports.isJson)(jCurrentToken) === false) {
158
+ jCurrentToken = getJPart(jEntity, currentPath, null);
159
+ if ((0, _.isObjectValid)(jCurrentToken) || isJson(jCurrentToken) === false) {
147
160
  jCurrentToken = jEntity;
148
161
  }
149
162
  jCurrentToken[fieldName] = fieldPathsAndValues[i]['value'];
150
163
  }
151
164
  }
152
165
  };
153
- exports.setJToken = setJToken;
154
- //# sourceMappingURL=index.js.map
@@ -45,6 +45,7 @@ declare module '@mui/material/styles' {
45
45
  score: ScorePaletteColorOptions;
46
46
  invoiceAnalysis: InvoiceAnalysisPaletteColorOptions;
47
47
  status: StatusPaletteColorOptions;
48
+ tag: TagPaletteColorOptions;
48
49
  invoiceState: InvoiceStatesPaletteColorOptions;
49
50
  reconcilationState: RecosStatesPaletteColorOptions;
50
51
  trends: TrendsPaletteColorOptions;
@@ -74,6 +75,7 @@ declare module '@mui/material/styles' {
74
75
  trends: TrendsPaletteColorOptions;
75
76
  uploader: UploaderPaletteColorOptions;
76
77
  status: StatusPaletteColorOptions;
78
+ tag: TagPaletteColorOptions;
77
79
  invoiceState: InvoiceStatesPaletteColorOptions;
78
80
  reconcilationState: RecosStatesPaletteColorOptions;
79
81
  snackbar: SnackbarPaletteColorOptions;
@@ -119,6 +121,7 @@ declare module '@mui/material/styles' {
119
121
  high: string;
120
122
  low: string;
121
123
  medium: string;
124
+ marginal: string;
122
125
  }
123
126
  interface UploaderPaletteColorOptions {
124
127
  processing: {
@@ -177,6 +180,17 @@ declare module '@mui/material/styles' {
177
180
  no_pricing: StatusColorOption;
178
181
  pending: StatusColorOption;
179
182
  }
183
+ interface TagPaletteColorOptions {
184
+ approved: StatusColorOption;
185
+ created: StatusColorOption;
186
+ declined: StatusColorOption;
187
+ in_dispute: StatusColorOption;
188
+ in_progress: StatusColorOption;
189
+ paid: StatusColorOption;
190
+ closed: StatusColorOption;
191
+ refunded: StatusColorOption;
192
+ low: StatusColorOption;
193
+ }
180
194
  interface InvoiceStatesPaletteColorOptions {
181
195
  approved: StatusColorOption;
182
196
  created: StatusColorOption;