@putkoff/abstract-utilities 0.1.119 → 0.1.122
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/cjs/functions/path_utils/imports.d.ts +3 -2
- package/dist/cjs/index.js +58 -50
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/functions/path_utils/imports.d.ts +3 -2
- package/dist/esm/index.js +58 -50
- package/dist/esm/index.js.map +1 -1
- package/dist/functions/auth_utils/imports.js +1 -0
- package/dist/functions/auth_utils/index.js +1 -0
- package/dist/functions/auth_utils/src/index.js +1 -0
- package/dist/functions/auth_utils/src/token_utils.js +95 -0
- package/dist/functions/config_utils/imports.js +1 -0
- package/dist/functions/config_utils/index.js +1 -0
- package/dist/functions/config_utils/src/config_utils.js +33 -0
- package/dist/functions/config_utils/src/index.js +1 -0
- package/dist/functions/constants_utils/index.js +1 -0
- package/dist/functions/constants_utils/src/constants.js +7 -0
- package/dist/functions/constants_utils/src/index.js +1 -0
- package/dist/functions/env_utils/imports.js +1 -0
- package/dist/functions/env_utils/index.js +1 -0
- package/dist/functions/env_utils/src/index.js +1 -0
- package/dist/functions/env_utils/src/window_utils.js +47 -0
- package/dist/functions/fetch_utils/imports.js +7 -0
- package/dist/functions/fetch_utils/index.js +1 -0
- package/dist/functions/fetch_utils/src/fetchIt_utils.js +116 -0
- package/dist/functions/fetch_utils/src/index.js +1 -0
- package/dist/functions/fetch_utils/src/utils.js +171 -0
- package/dist/functions/index.js +12 -0
- package/dist/functions/path_utils/imports.d.ts +3 -2
- package/dist/functions/path_utils/imports.js +26 -0
- package/dist/functions/path_utils/index.js +1 -0
- package/dist/functions/path_utils/src/base_dirs.js +17 -0
- package/dist/functions/path_utils/src/function_dirs.js +42 -0
- package/dist/functions/path_utils/src/index.js +6 -0
- package/dist/functions/path_utils/src/misc_dirs.js +15 -0
- package/dist/functions/path_utils/src/path_utils.js +75 -0
- package/dist/functions/path_utils/src/paths.js +12 -0
- package/dist/functions/path_utils/src/src_dirs.js +25 -0
- package/dist/functions/read_utils/imports.js +1 -0
- package/dist/functions/read_utils/index.js +1 -0
- package/dist/functions/read_utils/src/index.js +1 -0
- package/dist/functions/read_utils/src/read_utils.js +55 -0
- package/dist/functions/rndm_utils/imports.js +1 -0
- package/dist/functions/rndm_utils/index.js +1 -0
- package/dist/functions/rndm_utils/src/index.js +1 -0
- package/dist/functions/rndm_utils/src/utils.js +12 -0
- package/dist/functions/string_utils/index.js +1 -0
- package/dist/functions/string_utils/src/index.js +1 -0
- package/dist/functions/string_utils/src/string_utils.js +113 -0
- package/dist/functions/type_utils/imports.js +1 -0
- package/dist/functions/type_utils/index.js +1 -0
- package/dist/functions/type_utils/src/index.js +1 -0
- package/dist/functions/type_utils/src/type_utils.js +4 -0
- package/dist/functions/ui_utils/imports.js +5 -0
- package/dist/functions/ui_utils/index.js +1 -0
- package/dist/functions/ui_utils/src/button.js +32 -0
- package/dist/functions/ui_utils/src/checkbox.js +16 -0
- package/dist/functions/ui_utils/src/index.js +4 -0
- package/dist/functions/ui_utils/src/input.js +16 -0
- package/dist/functions/ui_utils/src/spinner.js +4 -0
- package/dist/index.js +5 -0
- package/dist/types/index.js +1 -0
- package/dist/types/src/ChangePassword.js +1 -0
- package/dist/types/src/Files.js +1 -0
- package/dist/types/src/index.js +5 -0
- package/dist/types/src/login.js +1 -0
- package/dist/types/src/logout.js +1 -0
- package/dist/types/src/utils.js +1 -0
- package/dist/utils/imports.js +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/src/Input.js +2 -0
- package/dist/utils/src/config.js +20 -0
- package/dist/utils/src/index.js +2 -0
- package/package.json +8 -1
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* In the browser we already have a WHATWG URL constructor on window.
|
|
3
3
|
* Here we re-export it as “url” so other modules can import it.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
declare const _url: {
|
|
6
6
|
new (url: string | URL, base?: string | URL): URL;
|
|
7
7
|
prototype: URL;
|
|
8
8
|
canParse(url: string | URL, base?: string | URL): boolean;
|
|
9
9
|
createObjectURL(obj: Blob | MediaSource): string;
|
|
10
10
|
parse(url: string | URL, base?: string | URL): URL | null;
|
|
11
11
|
revokeObjectURL(url: string): void;
|
|
12
|
-
};
|
|
12
|
+
} | undefined;
|
|
13
|
+
export { _url as url };
|
|
13
14
|
/**
|
|
14
15
|
* Minimal fileURLToPath implementation for browser-side code.
|
|
15
16
|
* If you only ever need to strip off “file://” in development, this is enough.
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,6 +4,50 @@ var react = require('react');
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
|
+
/******************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */
|
|
21
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function __rest(s, e) {
|
|
25
|
+
var t = {};
|
|
26
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
27
|
+
t[p] = s[p];
|
|
28
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
29
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
30
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
31
|
+
t[p[i]] = s[p[i]];
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
47
|
+
var e = new Error(message);
|
|
48
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
49
|
+
};
|
|
50
|
+
|
|
7
51
|
/**
|
|
8
52
|
***Changes**:
|
|
9
53
|
*- Updated import path for `InputProps` to `../../types/interfaces`.
|
|
@@ -155,50 +199,6 @@ function get_window_parts() {
|
|
|
155
199
|
return null;
|
|
156
200
|
}
|
|
157
201
|
|
|
158
|
-
/******************************************************************************
|
|
159
|
-
Copyright (c) Microsoft Corporation.
|
|
160
|
-
|
|
161
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
162
|
-
purpose with or without fee is hereby granted.
|
|
163
|
-
|
|
164
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
165
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
166
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
167
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
168
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
169
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
170
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
171
|
-
***************************************************************************** */
|
|
172
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
function __rest(s, e) {
|
|
176
|
-
var t = {};
|
|
177
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
178
|
-
t[p] = s[p];
|
|
179
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
180
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
181
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
182
|
-
t[p[i]] = s[p[i]];
|
|
183
|
-
}
|
|
184
|
-
return t;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
188
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
189
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
190
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
191
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
192
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
193
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
198
|
-
var e = new Error(message);
|
|
199
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
200
|
-
};
|
|
201
|
-
|
|
202
202
|
function assertPath(path) {
|
|
203
203
|
if (typeof path !== 'string') {
|
|
204
204
|
throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
|
|
@@ -1042,7 +1042,7 @@ function getConfig(key) {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
|
|
1044
1044
|
function ensureAbstractUrl(endpoint, slices = []) {
|
|
1045
|
-
slices = ['https//thedailydialectics.com', 'api'
|
|
1045
|
+
slices = slices || ['https//thedailydialectics.com', 'api'];
|
|
1046
1046
|
// 1) build a prefix string like "api/v1/"
|
|
1047
1047
|
const prefix = slices.map((s) => `${s}/`).join("");
|
|
1048
1048
|
// 2) normalize the list you’ll use for stripping
|
|
@@ -1169,14 +1169,18 @@ function getFetchVars(headers = null, method = null, body = null) {
|
|
|
1169
1169
|
function get_app_config_url(endpoint_1) {
|
|
1170
1170
|
return __awaiter(this, arguments, void 0, function* (endpoint, appKey = 'BASE_API_URL') {
|
|
1171
1171
|
const cleanEndpoint = endpoint.replace(/^\/+/, '');
|
|
1172
|
-
console.log(`cleanEndpoint == ${cleanEndpoint}`)
|
|
1173
|
-
const config = yield getConfig(
|
|
1174
|
-
console.log(`config == ${config}`)
|
|
1175
|
-
const baseUrl =
|
|
1172
|
+
//console.log(`cleanEndpoint == ${cleanEndpoint}`)
|
|
1173
|
+
const config = yield getConfig();
|
|
1174
|
+
//console.log(`config == ${config}`)
|
|
1175
|
+
const baseUrl = config;
|
|
1176
1176
|
appKey = appKey || 'BASE_API_URL';
|
|
1177
|
+
//console.log(`appKey == ${appKey}`)
|
|
1177
1178
|
const base = baseUrl[appKey]; // full AppConfig object
|
|
1178
|
-
console.log()
|
|
1179
|
+
//console.log(`base == ${base}`)
|
|
1180
|
+
if (!base)
|
|
1181
|
+
throw new Error(`Missing API URL for key "${appKey}"`);
|
|
1179
1182
|
const slices = base.split('/').filter(Boolean);
|
|
1183
|
+
//console.log(`slices == ${slices}`)
|
|
1180
1184
|
return ensureAbstractUrl(cleanEndpoint, slices);
|
|
1181
1185
|
});
|
|
1182
1186
|
}
|
|
@@ -1351,6 +1355,10 @@ function loadConfig() {
|
|
|
1351
1355
|
});
|
|
1352
1356
|
}
|
|
1353
1357
|
|
|
1358
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
1359
|
+
console.log(yield get_app_config_url('api'));
|
|
1360
|
+
}))(); // ← note the () here to invoke it
|
|
1361
|
+
|
|
1354
1362
|
Object.defineProperty(exports, "useCallback", {
|
|
1355
1363
|
enumerable: true,
|
|
1356
1364
|
get: function () { return react.useCallback; }
|