@klauswuestefeld/jux-web 2024.12.7 → 2024.12.17

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/jux-web.js CHANGED
@@ -311,7 +311,7 @@ var juxWeb = (function (exports) {
311
311
  requestRunning = false;
312
312
  }
313
313
  });
314
- const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
314
+ const post = (endpoint, params, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
315
315
  const options = {
316
316
  method: 'POST',
317
317
  headers: {
@@ -319,9 +319,13 @@ var juxWeb = (function (exports) {
319
319
  'Content-Type': 'application/json',
320
320
  }
321
321
  };
322
- if (body) {
322
+ if (params) {
323
+ let content = params;
324
+ if (!(params instanceof File)) {
325
+ content = JSON.stringify(params);
326
+ }
323
327
  // @ts-ignore
324
- options.body = JSON.stringify(body);
328
+ options.body = content;
325
329
  }
326
330
  return backendRequest(getApiUrl() + endpoint, options, onSuccess, onError, onRedirect, requestType, handleUnauthorized);
327
331
  };
@@ -14464,7 +14468,7 @@ var juxWeb = (function (exports) {
14464
14468
  return result;
14465
14469
  };
14466
14470
 
14467
- const unauthorizedMagicLinkRequestPage = (backgroundImg, onReturn) => {
14471
+ const unauthorizedMagicLinkRequestPage = (backgroundImg, onReturn, failInfo) => {
14468
14472
  const content = [];
14469
14473
  const notSent = document.createElement('p');
14470
14474
  notSent.id = 'magic-link-not-sent';
@@ -14476,7 +14480,7 @@ var juxWeb = (function (exports) {
14476
14480
  email.style.marginBottom = '10px';
14477
14481
  const info = document.createElement('p');
14478
14482
  info.id = 'magic-link-fail-info';
14479
- info.innerHTML = getTranslation(info.id);
14483
+ info.innerHTML = getTranslation(failInfo || info.id);
14480
14484
  info.style.padding = '0 30px';
14481
14485
  info.style.textAlign = 'center';
14482
14486
  const back = document.createElement('a');
@@ -14668,7 +14672,7 @@ var juxWeb = (function (exports) {
14668
14672
  };
14669
14673
  const onUnauthorized = () => {
14670
14674
  disableSignInLayout();
14671
- const page = unauthorizedMagicLinkRequestPage(backgroundImg, onReturn);
14675
+ const page = unauthorizedMagicLinkRequestPage(backgroundImg, onReturn, 'auth-password-fail-info');
14672
14676
  const magicLinkEmail = page.querySelector('#magic-link-email');
14673
14677
  magicLinkEmail.textContent = email;
14674
14678
  displayPage(clientApp, page);
@@ -1 +1 @@
1
- export declare const unauthorizedMagicLinkRequestPage: (backgroundImg: string, onReturn: any) => HTMLElement;
1
+ export declare const unauthorizedMagicLinkRequestPage: (backgroundImg: string, onReturn: any, failInfo?: string) => HTMLElement;
package/dist/main.esm.js CHANGED
@@ -310,7 +310,7 @@ const backendRequest = (url_1, options_1, onSuccess_1, onError_1, onRedirect_1,
310
310
  requestRunning = false;
311
311
  }
312
312
  });
313
- const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
313
+ const post = (endpoint, params, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
314
314
  const options = {
315
315
  method: 'POST',
316
316
  headers: {
@@ -318,9 +318,13 @@ const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "que
318
318
  'Content-Type': 'application/json',
319
319
  }
320
320
  };
321
- if (body) {
321
+ if (params) {
322
+ let content = params;
323
+ if (!(params instanceof File)) {
324
+ content = JSON.stringify(params);
325
+ }
322
326
  // @ts-ignore
323
- options.body = JSON.stringify(body);
327
+ options.body = content;
324
328
  }
325
329
  return backendRequest(getApiUrl() + endpoint, options, onSuccess, onError, onRedirect, requestType, handleUnauthorized);
326
330
  };
@@ -949,7 +953,7 @@ const magicLinkRequestedPage = (backgroundImg, onReturn) => {
949
953
  return result;
950
954
  };
951
955
 
952
- const unauthorizedMagicLinkRequestPage = (backgroundImg, onReturn) => {
956
+ const unauthorizedMagicLinkRequestPage = (backgroundImg, onReturn, failInfo) => {
953
957
  const content = [];
954
958
  const notSent = document.createElement('p');
955
959
  notSent.id = 'magic-link-not-sent';
@@ -961,7 +965,7 @@ const unauthorizedMagicLinkRequestPage = (backgroundImg, onReturn) => {
961
965
  email.style.marginBottom = '10px';
962
966
  const info = document.createElement('p');
963
967
  info.id = 'magic-link-fail-info';
964
- info.innerHTML = getTranslation(info.id);
968
+ info.innerHTML = getTranslation(failInfo || info.id);
965
969
  info.style.padding = '0 30px';
966
970
  info.style.textAlign = 'center';
967
971
  const back = document.createElement('a');
@@ -1153,7 +1157,7 @@ const onAuthPasswordLogin = (credentials, onUserLogin, onLoginError, onReturn, c
1153
1157
  };
1154
1158
  const onUnauthorized = () => {
1155
1159
  disableSignInLayout();
1156
- const page = unauthorizedMagicLinkRequestPage(backgroundImg, onReturn);
1160
+ const page = unauthorizedMagicLinkRequestPage(backgroundImg, onReturn, 'auth-password-fail-info');
1157
1161
  const magicLinkEmail = page.querySelector('#magic-link-email');
1158
1162
  magicLinkEmail.textContent = email;
1159
1163
  displayPage(clientApp, page);
package/dist/main.js CHANGED
@@ -334,7 +334,7 @@ const backendRequest = (url_1, options_1, onSuccess_1, onError_1, onRedirect_1,
334
334
  requestRunning = false;
335
335
  }
336
336
  });
337
- const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
337
+ const post = (endpoint, params, onSuccess, onError, onRedirect, requestType = "query", handleUnauthorized) => {
338
338
  const options = {
339
339
  method: 'POST',
340
340
  headers: {
@@ -342,9 +342,13 @@ const post = (endpoint, body, onSuccess, onError, onRedirect, requestType = "que
342
342
  'Content-Type': 'application/json',
343
343
  }
344
344
  };
345
- if (body) {
345
+ if (params) {
346
+ let content = params;
347
+ if (!(params instanceof File)) {
348
+ content = JSON.stringify(params);
349
+ }
346
350
  // @ts-ignore
347
- options.body = JSON.stringify(body);
351
+ options.body = content;
348
352
  }
349
353
  return backendRequest(getApiUrl() + endpoint, options, onSuccess, onError, onRedirect, requestType, handleUnauthorized);
350
354
  };
@@ -973,7 +977,7 @@ const magicLinkRequestedPage = (backgroundImg, onReturn) => {
973
977
  return result;
974
978
  };
975
979
 
976
- const unauthorizedMagicLinkRequestPage = (backgroundImg, onReturn) => {
980
+ const unauthorizedMagicLinkRequestPage = (backgroundImg, onReturn, failInfo) => {
977
981
  const content = [];
978
982
  const notSent = document.createElement('p');
979
983
  notSent.id = 'magic-link-not-sent';
@@ -985,7 +989,7 @@ const unauthorizedMagicLinkRequestPage = (backgroundImg, onReturn) => {
985
989
  email.style.marginBottom = '10px';
986
990
  const info = document.createElement('p');
987
991
  info.id = 'magic-link-fail-info';
988
- info.innerHTML = getTranslation(info.id);
992
+ info.innerHTML = getTranslation(failInfo || info.id);
989
993
  info.style.padding = '0 30px';
990
994
  info.style.textAlign = 'center';
991
995
  const back = document.createElement('a');
@@ -1177,7 +1181,7 @@ const onAuthPasswordLogin = (credentials, onUserLogin, onLoginError, onReturn, c
1177
1181
  };
1178
1182
  const onUnauthorized = () => {
1179
1183
  disableSignInLayout();
1180
- const page = unauthorizedMagicLinkRequestPage(backgroundImg, onReturn);
1184
+ const page = unauthorizedMagicLinkRequestPage(backgroundImg, onReturn, 'auth-password-fail-info');
1181
1185
  const magicLinkEmail = page.querySelector('#magic-link-email');
1182
1186
  magicLinkEmail.textContent = email;
1183
1187
  displayPage(clientApp, page);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klauswuestefeld/jux-web",
3
- "version": "2024.12.7",
3
+ "version": "2024.12.17",
4
4
  "author": "Jux.House",
5
5
  "license": "Copyrighted",
6
6
  "description": "",