@beinformed/ui 2.0.0-beta.1 → 2.0.0-beta.2
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/CHANGELOG.md +6 -0
- package/dist/{Constants-Cw7d8vue.d.cts → Constants-CYAEbTZ4.d.cts} +13 -1
- package/dist/{Constants-Cw7d8vue.d.ts → Constants-CYAEbTZ4.d.ts} +13 -1
- package/dist/{FormModel-VQaB1SCS.d.ts → FormModel-Cmzm2g7k.d.ts} +1 -1
- package/dist/{FormModel-DnizzHJs.d.cts → FormModel-Qa655sE-.d.cts} +1 -1
- package/dist/chunk-24FITWGX.js +2 -0
- package/dist/{chunk-WVQSFYWD.js.map → chunk-24FITWGX.js.map} +1 -1
- package/dist/chunk-4BYHEGUN.js +2 -0
- package/dist/{chunk-6GV6KLAV.js.map → chunk-4BYHEGUN.js.map} +1 -1
- package/dist/chunk-GDEYM54A.js +2 -0
- package/dist/chunk-GDEYM54A.js.map +1 -0
- package/dist/{chunk-VIKUDFQV.js → chunk-GHQP5QNP.js} +2 -2
- package/dist/{chunk-UE323PGR.js → chunk-NOB2I3DW.js} +2 -2
- package/dist/{chunk-KCZQQTX6.js → chunk-QTZ77JJN.js} +2 -2
- package/dist/{chunk-LCMAAW7B.js → chunk-RI2O4J7J.js} +2 -2
- package/dist/chunk-SFI46XCV.js +2 -0
- package/dist/{chunk-OBB3YOFC.js.map → chunk-SFI46XCV.js.map} +1 -1
- package/dist/chunk-VLKSMXSB.js +2 -0
- package/dist/chunk-VLKSMXSB.js.map +1 -0
- package/dist/{chunk-333J3Q2L.js → chunk-WHWNPOV6.js} +2 -2
- package/dist/{chunk-ZDZHA43Q.js → chunk-XWOLLK42.js} +2 -2
- package/dist/{chunk-YOBCFXEM.js → chunk-Y3XZHSPE.js} +2 -2
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +6 -2
- package/dist/constants/index.d.ts +6 -2
- package/dist/constants/index.js +1 -1
- package/dist/exceptions/index.cjs +1 -1
- package/dist/exceptions/index.d.cts +3 -3
- package/dist/exceptions/index.d.ts +3 -3
- package/dist/exceptions/index.js +1 -1
- package/dist/{index-BFD-cKUB.d.cts → index-BxJE8Lob.d.ts} +1 -1
- package/dist/{index-CEg8Nt57.d.ts → index-RuAoNZgc.d.cts} +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/layouthints/index.cjs +7 -7
- package/dist/layouthints/index.cjs.map +1 -1
- package/dist/layouthints/index.d.cts +2 -2
- package/dist/layouthints/index.d.ts +2 -2
- package/dist/layouthints/index.js +1 -1
- package/dist/models/index.cjs +4 -4
- package/dist/models/index.cjs.map +1 -1
- package/dist/models/index.d.cts +5 -5
- package/dist/models/index.d.ts +5 -5
- package/dist/models/index.js +1 -1
- package/dist/modularui/index.cjs +6 -6
- package/dist/modularui/index.cjs.map +1 -1
- package/dist/modularui/index.d.cts +35 -8
- package/dist/modularui/index.d.ts +35 -8
- package/dist/modularui/index.js +1 -1
- package/dist/settings/index.cjs +1 -1
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.d.cts +5 -1
- package/dist/settings/index.d.ts +5 -1
- package/dist/settings/index.js +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/index.cjs +8 -8
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +3 -3
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-5BR5HMNQ.js +0 -2
- package/dist/chunk-5BR5HMNQ.js.map +0 -1
- package/dist/chunk-6GV6KLAV.js +0 -2
- package/dist/chunk-BTDN4ZDB.js +0 -2
- package/dist/chunk-BTDN4ZDB.js.map +0 -1
- package/dist/chunk-OBB3YOFC.js +0 -2
- package/dist/chunk-WVQSFYWD.js +0 -2
- /package/dist/{chunk-VIKUDFQV.js.map → chunk-GHQP5QNP.js.map} +0 -0
- /package/dist/{chunk-UE323PGR.js.map → chunk-NOB2I3DW.js.map} +0 -0
- /package/dist/{chunk-KCZQQTX6.js.map → chunk-QTZ77JJN.js.map} +0 -0
- /package/dist/{chunk-LCMAAW7B.js.map → chunk-RI2O4J7J.js.map} +0 -0
- /package/dist/{chunk-333J3Q2L.js.map → chunk-WHWNPOV6.js.map} +0 -0
- /package/dist/{chunk-ZDZHA43Q.js.map → chunk-XWOLLK42.js.map} +0 -0
- /package/dist/{chunk-YOBCFXEM.js.map → chunk-Y3XZHSPE.js.map} +0 -0
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { dd as RequestOptions, c8 as Href, aQ as SectionFragment, c_ as HrefState, cW as ISO_DATE, c$ as HistoryLocation, d3 as ErrorMessage, d1 as TextWithPlaceholders, a9 as MaybeAttributeValue } from '../index-
|
|
2
|
-
export { d9 as BaseDateTimeUtil, d5 as DateTimeUtil, d4 as DateUtil, df as ModularUIRequestOptions, d8 as OffsetInfo, db as ProgressHandler, dc as RequestBaseOptions, da as RequestURLOptions, d6 as TimeUtil, d7 as TimestampUtil, de as UpdateHandler } from '../index-
|
|
3
|
-
import '../Constants-
|
|
1
|
+
import { dd as RequestOptions, c8 as Href, aQ as SectionFragment, c_ as HrefState, cW as ISO_DATE, c$ as HistoryLocation, d3 as ErrorMessage, d1 as TextWithPlaceholders, a9 as MaybeAttributeValue } from '../index-RuAoNZgc.cjs';
|
|
2
|
+
export { d9 as BaseDateTimeUtil, d5 as DateTimeUtil, d4 as DateUtil, df as ModularUIRequestOptions, d8 as OffsetInfo, db as ProgressHandler, dc as RequestBaseOptions, da as RequestURLOptions, d6 as TimeUtil, d7 as TimestampUtil, de as UpdateHandler } from '../index-RuAoNZgc.cjs';
|
|
3
|
+
import '../Constants-CYAEbTZ4.cjs';
|
|
4
4
|
import 'immer';
|
|
5
5
|
import '@date-fns/tz/date';
|
|
6
6
|
import 'date-fns';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { dd as RequestOptions, c8 as Href, aQ as SectionFragment, c_ as HrefState, cW as ISO_DATE, c$ as HistoryLocation, d3 as ErrorMessage, d1 as TextWithPlaceholders, a9 as MaybeAttributeValue } from '../index-
|
|
2
|
-
export { d9 as BaseDateTimeUtil, d5 as DateTimeUtil, d4 as DateUtil, df as ModularUIRequestOptions, d8 as OffsetInfo, db as ProgressHandler, dc as RequestBaseOptions, da as RequestURLOptions, d6 as TimeUtil, d7 as TimestampUtil, de as UpdateHandler } from '../index-
|
|
3
|
-
import '../Constants-
|
|
1
|
+
import { dd as RequestOptions, c8 as Href, aQ as SectionFragment, c_ as HrefState, cW as ISO_DATE, c$ as HistoryLocation, d3 as ErrorMessage, d1 as TextWithPlaceholders, a9 as MaybeAttributeValue } from '../index-BxJE8Lob.js';
|
|
2
|
+
export { d9 as BaseDateTimeUtil, d5 as DateTimeUtil, d4 as DateUtil, df as ModularUIRequestOptions, d8 as OffsetInfo, db as ProgressHandler, dc as RequestBaseOptions, da as RequestURLOptions, d6 as TimeUtil, d7 as TimestampUtil, de as UpdateHandler } from '../index-BxJE8Lob.js';
|
|
3
|
+
import '../Constants-CYAEbTZ4.js';
|
|
4
4
|
import 'immer';
|
|
5
5
|
import '@date-fns/tz/date';
|
|
6
6
|
import 'date-fns';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r,b as s,c as t,d as u,e as v,f as w,g as x,h as y,i as z}from"../chunk-
|
|
1
|
+
import{a as r,b as s,c as t,d as u,e as v,f as w,g as x,h as y,i as z}from"../chunk-XWOLLK42.js";import{a as b,b as c,c as d}from"../chunk-VLKSMXSB.js";import"../chunk-WHWNPOV6.js";import{b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,m,n,o,p,q}from"../chunk-QTZ77JJN.js";import{b as a}from"../chunk-GHQP5QNP.js";import"../chunk-VGAPPKHA.js";import"../chunk-SFI46XCV.js";import"../chunk-24FITWGX.js";import"../chunk-NOB2I3DW.js";import"../chunk-4BYHEGUN.js";export{h as BaseDateTimeUtil,a as Cache,j as DateTimeUtil,i as DateUtil,p as DecimalFormat,x as IS_DEV,q as NumberUtil,k as TimeUtil,l as TimestampUtil,g as clearCookie,m as createHash,n as createHashFromHref,v as createHref,w as createUUID,u as filterParameters,e as getCookie,y as getRepositoryResourceUrl,b as graalFetch,t as parseUrl,z as removeUnwantedHtml,r as resourceExists,s as resourceRedirectsToSecureLogin,o as retrieveText,f as setCookie,d as universalFetch,c as xhr};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beinformed/ui",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"description": "Be Informed UI core",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"hash-it": "^7.0.2",
|
|
23
23
|
"html-entities": "^2.6.0",
|
|
24
24
|
"iban": "^0.0.14",
|
|
25
|
-
"immer": "^11.1.
|
|
25
|
+
"immer": "^11.1.4",
|
|
26
26
|
"js-cookie": "^3.0.5",
|
|
27
27
|
"klona": "^2.0.6",
|
|
28
28
|
"timezone-soft": "^1.5.2"
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@types/iban": "^0.0.35",
|
|
34
34
|
"@types/js-cookie": "^3.0.6",
|
|
35
35
|
"date-fns": "^4.1.0",
|
|
36
|
-
"msw": "^2.12.
|
|
37
|
-
"@beinformed/typescript-config": "0.0.0"
|
|
36
|
+
"msw": "^2.12.10",
|
|
37
|
+
"@beinformed/typescript-config": "0.0.1-beta.0"
|
|
38
38
|
},
|
|
39
39
|
"exports": {
|
|
40
40
|
"./constants": {
|
package/dist/chunk-5BR5HMNQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as L}from"./chunk-YOBCFXEM.js";import{b as g,c as h}from"./chunk-BTDN4ZDB.js";import{f as H}from"./chunk-333J3Q2L.js";import{Ea as j,Fa as B,Ga as z,Ia as V,Ka as G,La as W,Ua as Y,Wa as Q,Xa as M,Ya as K,bb as v,db as u,e as w,eb as X,j as I,k as N,o as $,pb as Z,rb as tt,s as J,ub as et,vb as ot,wb as it,x as q,xb as rt,yb as nt}from"./chunk-LCMAAW7B.js";import{l as U}from"./chunk-KCZQQTX6.js";import{a as D,b as p}from"./chunk-VIKUDFQV.js";import{a}from"./chunk-VGAPPKHA.js";import{A as S,h as y,o as P,p as T,q as F,r as O,s as k,v as l,w as d}from"./chunk-OBB3YOFC.js";import{g as m}from"./chunk-UE323PGR.js";import{b as E,h as A,q as R}from"./chunk-6GV6KLAV.js";var st=class{_isBasicAuthentication;_authenticationType;constructor(){this._isBasicAuthentication=!1,this._authenticationType=this.getAuthenticationType()}getAuthenticationType(){let t=P(),e=R[t];return!e||e==="JAAS"?"JAAS":e==="PAC4J_FORM"||t.includes("FormClient")?"PAC4J_FORM":e==="PAC4J_BASIC"||t.includes("IndirectBasicClient")?"PAC4J_BASIC":"PAC4J_INDIRECT"}get authenticationType(){return this._authenticationType}set authenticationType(t){this._authenticationType=t}get isBasicAuthentication(){return this._isBasicAuthentication||this.authenticationType==="PAC4J_BASIC"}set isBasicAuthentication(t){this._isBasicAuthentication=t}requestLogin(){return h({url:`${l()}/login`,method:"GET",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}})}initLogin(t){return this.isBasicAuthentication||!t?Promise.resolve(!0):this.requestLogin().catch(e=>(e instanceof H&&(this.isBasicAuthentication=!0),Promise.resolve({})))}login(t,e){switch(this.authenticationType){case"PAC4J_FORM":return this.doFormLogin(t,e);case"PAC4J_BASIC":return this.doBasicAuthentication(t,e);case"PAC4J_INDIRECT":return Promise.resolve();default:return this.doJaasAuthentication(t,e)}}getFormLoginUrl(){switch(this.authenticationType){case"PAC4J_BASIC":return`${l()}${T("DirectBasicAuthClient")}`;case"PAC4J_FORM":return`${l()}${T("FormClient")}`;case"PAC4J_INDIRECT":return"";default:return`${l()}/j_security_check`}}getFormLoginData(t,e){let i=encodeURIComponent(t),r=encodeURIComponent(e);switch(this.authenticationType){case"PAC4J_BASIC":case"PAC4J_FORM":return`${F()}=${i}&${O()}=${r}`;case"JAAS":return`j_username=${i}&j_password=${r}`;default:return""}}doFormLogin(t,e){return h({url:this.getFormLoginUrl(),method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},data:this.getFormLoginData(t,e)})}doBasicAuthentication(t,e){return p.addItem("basic",btoa(`${t}:${e}`)),this.requestLogin()}doJaasAuthentication(t,e){return this.initLogin(!0).then(()=>this.isBasicAuthentication?(p.removeItem("basic-ok"),this.doBasicAuthentication(t,e).then(()=>{p.addItem("basic-ok",!0)})):this.doFormLogin(t,e))}getLogoutUrl(){let t=P();return!t||t==="JAAS"?`${l()}/Logoff`:`${l()}${k()}`}redirectToLogout(t){p.clear();let e=window.location.origin,i=t?.startsWith("http")?t:`${e}${l()}`;window.location.assign(this.getLogoutUrl()+"?url="+i)}logout(){return h({url:this.getLogoutUrl()}).then(t=>(p.clear(),t))}};var at=class{_tokenId;_image;_origin="";_contextPath=d();CaptchaRequest(t){this._origin=t?.origin||"",this._contextPath=t?.contextPath||d()}captchaResponse(t){return this._tokenId="tokenId"in t?t.tokenId:this._tokenId,this._image="image"in t?t.image:this._image,{tokenId:this._tokenId,image:this._image,valid:"valid"in t?t.valid:!1,error:"error"in t?t.error:null}}init(){return g({url:S(this._contextPath,this._origin)}).then(t=>this.captchaResponse(t))}send(t){return g({url:S(this._contextPath,this._origin),method:"POST",data:{tokenId:this._tokenId??"",answer:t??""}}).then(e=>this.captchaResponse(e)).catch(e=>this.captchaResponse(e.response))}refresh(){return this.init()}};var f=class o extends Error{response;href;constructor(t,e,i){super(t),Object.setPrototypeOf(this,o.prototype),this.response=e,this.href=i,"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}get resource(){return this.href}};var lt=E(D(),1);var b=[{name:"Application",isMatch:({resourcetype:o})=>o==="Application",Model:z},{name:"Tab",isMatch:({resourcetype:o})=>o.endsWith("Tab")||o.endsWith("KnowledgeBank"),Model:rt},{name:"ListDetail",isMatch:({resourcetype:o})=>{let t=o.toLowerCase();return t.endsWith("listdetail")||t.endsWith("listpaneldetail")||t.endsWith("datastorepaneldetail")},Model:X},{name:"List",isMatch:({resourcetype:o})=>o.endsWith("List")||o.endsWith("ListPanel")||o.endsWith("RelatedDataStorePanel")||o.endsWith("RelatedDatastorePanel")||["list-related-cases","RecordPanel","EventHistoryPanel","NotePanel","AppointmentPanel","DocumentPanel","AssignmentPanel"].includes(o),Model:Z},{name:"GroupingPanel",isMatch:({resourcetype:o})=>["GroupingPanel","CaseTabGroupingPanel","TabGroupingPanel"].includes(o),Model:ot},{name:"CaseSearch",isMatch:({resourcetype:o})=>o==="CaseSearch",Model:it},{name:"CaseView",isMatch:({resourcetype:o})=>o==="CaseView",Model:W},{name:"Detail",isMatch:({resourcetype:o})=>o.endsWith("DetailPanel")||["Detail","CasePropertiesPanel","CasePropertiesPanelDetail"].includes(o),Model:V},{name:"TaskGroup",isMatch:({resourcetype:o})=>o==="TaskGroup",Model:G},{name:"Form",isMatch:({resourcetype:o})=>o==="Form",Model:u},{name:"User",isMatch:({resourcetype:o})=>o==="userdata",Model:j},{name:"UserProfile",isMatch:({resourcetype:o})=>o==="userdata",Model:nt},{name:"UserServices",isMatch:({resourcetype:o})=>o==="user_services",Model:B},{name:"ModelCatalog",isMatch:({resourcetype:o})=>o==="ModelCatalog",Model:et},{name:"ConceptIndex",isMatch:({resourcetype:o})=>o==="ConceptSearch"||o.toLowerCase()==="relatedconcepts",Model:Y},{name:"ConceptDetail",isMatch:({resourcetype:o})=>o==="ConceptDetail",Model:J},{name:"ConceptTypeDetail",isMatch:({resourcetype:o})=>o==="ConceptTypeDetail",Model:N},{name:"ContentIndex",isMatch:({resourcetype:o})=>o==="ContentSearch",Model:Q},{name:"ContentTOC",isMatch:({resourcetype:o})=>o==="ContentTOC",Model:K},{name:"Content",isMatch:({resourcetype:o})=>o==="ContentDetail",Model:M},{name:"ContentType",isMatch:({resourcetype:o})=>o==="ContentTypeDetail",Model:$},{name:"LookupOptions",isMatch:({resourcetype:o})=>o==="lookupOptions",Model:tt}];var C=class{static resolve(t,e,i=!1){if(!t)throw new a("No data or contribution available, cannot resolve model");if(!(0,lt.has)(t.contributions,"resourcetype"))throw new a(`Contributions has wrong format, missing resourcetype property in contributions of ${t.requestHref?.toString()}`);if(e){let n=Array.isArray(e)?e:[e];return n.length===1||i?n[0]:b.find(s=>s.isMatch(t)&&n.includes(s.Model))?.Model}return b.find(n=>n.isMatch(t))?.Model}};var ct=E(D(),1);import dt from"deepmerge";import{klona as pt}from"klona/full";var ht=class o{_response=new w;_href;_options;_targetModel;_forceTargetModel=!1;_contributionsHref;_locale="en";_method="GET";_progressEvent;_origin="";_contextPath=d();_layoutHintProcessor;constructor(t,e={}){if(!t)throw new a("You must pass a href to the resource that is requested");this._href=typeof t=="string"?new U(t):t,this._options=e,this._layoutHintProcessor=new L(this._origin,this._contextPath,this.options),this._response=new w,this._response.requestHref=this.href,this.locale=this.getRequestLocale(e.locale),this._response.parameters=this.href.parameters.all,this.contextPath=e.contextPath||this.href.contextPath,this.origin=e.origin||this.href.origin,this._targetModel=e.targetModel,this.method=e.method||this.href.method}getRequestLocale(t){return t||typeof navigator<"u"&&navigator?.language&&navigator.language.split("-")[0]||"en"}get origin(){return this._origin}set origin(t){this._origin=t??"",this._response.origin=t??"",this._layoutHintProcessor.setOrigin(this._origin)}get contextPath(){return this._contextPath}set contextPath(t){let e=t??d();this._contextPath=e,this._response.contextPath=e,this._layoutHintProcessor.setContextPath(e)}get contributionsHref(){return this._contributionsHref}set contributionsHref(t){this._contributionsHref=t}set locale(t){this._locale=t,this._response.locale=t,this._layoutHintProcessor.setRequestOptions(this.options)}get locale(){return this._locale}get response(){return this._response}set href(t){this._href=t}get href(){return this._href}set method(t){this._method=t}get method(){return this._method}get options(){return{...this._options,locale:this.locale,method:this.method}}set options(t){this._options=t,this._layoutHintProcessor.setRequestOptions(t)}get requestOptions(){let{targetModel:t,forceTargetModel:e,updateHandler:i,childmodels:r,isValidationRequest:n,removeOnUnmount:c,...s}=this.options;return s}get withChildModels(){return!("childmodels"in this.options)||this.options.childmodels===!0}set targetModel(t){this._targetModel=t}get targetModel(){return this._targetModel}set forceTargetModel(t){this._forceTargetModel=t??!1}get forceTargetModel(){return this._forceTargetModel}resolveModel(){let t=C.resolve(this.response,this.targetModel,this.forceTargetModel);if(t)return t;let e=this.href.toString(),i=this.response?.resourcetype||"unknown";if(this.targetModel){let r=Array.isArray(this.targetModel)?this.targetModel.map(n=>n.type||n.name).join(", "):this.targetModel.type||this.targetModel.name;throw new m(`Cannot find a matching model for URL: '${e}', resourcetype: '${i}'. Available overrides: [${r}]`)}throw new m(`No JavaScript model is applicable for the request to ${e}. Response resourcetype: '${i}'.`)}createModel(){let t=this.resolveModel();return new t(this.response)}processContributionsService(t){if(!(0,ct.isPlainObject)(t))throw new a("Missing contributions data or contributions is not JSON");if(typeof t=="object"&&t!=null){let e=t,[i]=Object.keys(e),r=e[i];i==="error"&&this.handleContributionsError(r),typeof r=="object"&&r!=null&&(this.response.key in r||(this.response.key=i),this.response.contributions=r)}}handleContributionsError(t){let e=t.properties?.message??"Error in contribution";throw new f(e,t,this.contributionsHref)}handleDataError(t){if(typeof t=="object"&&t.properties){let e=t.properties?.message??"Error in data";throw new f(e,t,this.href.absolutepath.toString())}throw new a(JSON.stringify(t))}handleData(t,e){this.response.key=t,this.response.data=e;let i=e?._links;if(!i)throw new a(`No _links object found in the data of ${this.href.toString()}`);if(i?.contributions)this.contributionsHref=i.contributions.href;else if(Array.isArray(i)&&i[0].contributions)this.contributionsHref=i[0].contributions.href;else throw new a(`Contributions link not found for data with key ${t}`)}processDataService(t){if(typeof t!="object"||t===null)throw new a("Missing data or data is not JSON");let e=t,[i]=Object.keys(e),r=e[i];if(i==="error")this.handleDataError(r);else{let[n]=Object.keys(t);this.handleData(n,r)}}fetchContributionsService(){if(!this.contributionsHref)throw new m("Missing a contributions href");return h({url:`${this.origin}${this.contextPath}${this.contributionsHref}`,cache:!0,locale:this.options.locale})}fetchDataService(){return h({...this.requestOptions,url:`${this.origin}${this.contextPath}${this.href.path}`,params:this.href.getQuerystringForModularUI(),locale:this.options.locale,onProgress:this.onProgress})}set onProgress(t){this._progressEvent=t}get onProgress(){return this._progressEvent}getDynamicValidationData(t){let e=typeof this.options.data=="string"?JSON.parse(this.options.data):this.options.data;if(t instanceof u){let i=JSON.parse(t.validationData);return JSON.stringify(dt(e||{},i))}return JSON.stringify(e)??"{}"}async loadDynamicValidations(t){if(!this.options.isValidationRequest&&y("USE_INSTANT_SERVER_VALIDATION")&&t instanceof u&&t.currentFormObject?.hasDynamicValidations){let e=this.href.setParameter("commit","false"),i=await h({...this.requestOptions,url:`${this.origin}${this.contextPath}${this.href.path}`,params:e.getQuerystringForModularUI(),data:this.getDynamicValidationData(t)});if(i==null||typeof i!="object")return t;let r=i,[n]=Object.keys(r);return t.updateValidations(r[n])}return t}fetchFromCache(){return this.options={...this.options,cache:!0},this.fetch()}fetchChildModels(t){let i=t.getInitialChildModelLinks().map(r=>{let n=new o(r.href,{locale:this.locale});return r.targetModel&&(n.targetModel=r.targetModel),r.isCacheable?n.fetchFromCache():n.fetch()});return Promise.allSettled(i).then(r=>{let n=[],c=[];return r.forEach(s=>{if(s.status==="rejected"){let{reason:_}=s;_.name!=="Error.ChangePasswordRequired"&&console.debug("Unexpected error when retrieving child model:",_),c.push(new v(_,"",{origin:this.origin,contextPath:this.contextPath}))}else n.push(s.value)}),t instanceof I&&t.addChildModels(n,c),t})}async fetchContent(t){let e=await this.fetchFromCache();return t&&e instanceof M&&e.childSectionLinks.length>0?this.fetchContentChildSections(e):e}async fetchContentChildSections(t){let e=pt(t),i=await Promise.all(t.childSectionLinks.map(r=>{let n=r.selfhref.addParameter(A,t.entryDate);return new o(n,{locale:this.locale}).fetchContent(!0)}));return e.childSections=i.filter(r=>r instanceof q),e}async fetch(){let t=await this.fetchDataService();if(t==null)throw new Error(`No data received for ${this.href.toString()}`);this.processDataService(t);let e=await this.fetchContributionsService();if(e==null)throw new Error(`No contributions data received for ${this.contributionsHref}`);this.processContributionsService(e),await this._layoutHintProcessor.processAsyncLayoutHints(this.response);let i=this.createModel(),r=await this.loadDynamicValidations(i);return this.withChildModels?await this.fetchChildModels(r):r}post(t){return this.method="POST",this.options={...this.options,data:t},this.fetch()}postForm(t){return this.method="POST",this.options={...this.options,data:t.formdata},this.fetch().then(e=>e instanceof u?t.update(e):t)}fetchSync(){let t={headers:{"Accept-Language":this.locale}},e=dataFetcher.fetch(this.href.toString(),t);if(e==null)throw new Error(`No data received for ${this.href.toString()}`);if(this.processDataService(JSON.parse(e)),this.contributionsHref==null)throw new Error(`No constributions received for ${this.href.toString()}`);let i=dataFetcher.fetch(this.contributionsHref.toString(),t);if(i==null)throw new Error(`No constributions received for ${this.contributionsHref.toString()}`);this.processContributionsService(JSON.parse(i));let r=this.createModel(),c=r.getInitialChildModelLinks().map(s=>new o(s.href,{locale:this.locale}).fetchSync());return r instanceof I&&r.addChildModels(c,[]),r}};export{st as a,at as b,f as c,C as d,ht as e};
|
|
2
|
-
//# sourceMappingURL=chunk-5BR5HMNQ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/modularui/Authenticate.ts","../src/modularui/CaptchaRequest.ts","../src/modularui/ModularUIError.ts","../src/modularui/ModelResolver.ts","../src/modularui/ModelRegistry.ts","../src/modularui/ModularUIRequest.ts"],"sourcesContent":["import { HTTP_METHODS, INTERNAL_LOGIN_TYPE } from \"../constants/Constants\";\nimport { UnauthorizedException } from \"../exceptions/UnauthorizedException\";\nimport { getContextPath } from \"../settings/Paths\";\nimport {\n loginPasswordField,\n loginPath,\n loginType,\n loginUsernameField,\n logoutPath,\n} from \"../settings/Settings\";\nimport { universalFetch } from \"../utils/fetch/universalFetch\";\nimport { Cache } from \"../utils/storage/Cache\";\n\nexport class Authenticate {\n private _isBasicAuthentication: boolean;\n private _authenticationType: INTERNAL_LOGIN_TYPE;\n\n constructor() {\n this._isBasicAuthentication = false;\n this._authenticationType = this.getAuthenticationType();\n }\n\n getAuthenticationType() {\n const type = loginType();\n\n const enumType =\n INTERNAL_LOGIN_TYPE[type as keyof typeof INTERNAL_LOGIN_TYPE];\n\n if (!enumType || enumType === INTERNAL_LOGIN_TYPE.JAAS) {\n return INTERNAL_LOGIN_TYPE.JAAS;\n }\n\n if (\n enumType === INTERNAL_LOGIN_TYPE.PAC4J_FORM ||\n type.includes(\"FormClient\")\n ) {\n return INTERNAL_LOGIN_TYPE.PAC4J_FORM;\n } else if (\n enumType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC ||\n type.includes(\"IndirectBasicClient\")\n ) {\n return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;\n }\n\n return INTERNAL_LOGIN_TYPE.PAC4J_INDIRECT;\n }\n\n get authenticationType() {\n return this._authenticationType;\n }\n\n set authenticationType(authenticationType: INTERNAL_LOGIN_TYPE) {\n this._authenticationType = authenticationType;\n }\n\n get isBasicAuthentication() {\n return (\n this._isBasicAuthentication ||\n this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC\n );\n }\n\n set isBasicAuthentication(isBasicAuthentication: boolean) {\n this._isBasicAuthentication = isBasicAuthentication;\n }\n\n requestLogin() {\n return universalFetch({\n url: `${getContextPath()}/login`,\n method: HTTP_METHODS.GET,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n });\n }\n\n initLogin(initLogin: boolean) {\n if (this.isBasicAuthentication || !initLogin) {\n return Promise.resolve(true);\n }\n\n return this.requestLogin().catch((error) => {\n // when an unauthorizedexception is received on a request to the login service,\n // this indicates a basic authorization scenario\n // in case of form based authentication other exceptions are thrown\n if (error instanceof UnauthorizedException) {\n this.isBasicAuthentication = true;\n }\n\n return Promise.resolve({});\n });\n }\n\n login(username: string, password: string) {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return this.doFormLogin(username, password);\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return this.doBasicAuthentication(username, password);\n case INTERNAL_LOGIN_TYPE.PAC4J_INDIRECT:\n // pac4j should handle this\n return Promise.resolve();\n default:\n return this.doJaasAuthentication(username, password);\n }\n }\n\n getFormLoginUrl() {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return `${getContextPath()}${loginPath(\"DirectBasicAuthClient\")}`;\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getContextPath()}${loginPath(\"FormClient\")}`;\n case INTERNAL_LOGIN_TYPE.PAC4J_INDIRECT:\n //pac4j should handle this\n return \"\";\n default:\n return `${getContextPath()}/j_security_check`;\n }\n }\n\n getFormLoginData(username: string, password: string) {\n const encodedUsername = encodeURIComponent(username);\n const encodedPassword = encodeURIComponent(password);\n\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;\n case INTERNAL_LOGIN_TYPE.JAAS:\n return `j_username=${encodedUsername}&j_password=${encodedPassword}`;\n default:\n return \"\";\n }\n }\n\n doFormLogin(username: string, password: string) {\n return universalFetch({\n url: this.getFormLoginUrl(),\n method: HTTP_METHODS.POST,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n data: this.getFormLoginData(username, password),\n });\n }\n\n doBasicAuthentication(username: string, password: string) {\n Cache.addItem(\"basic\", btoa(`${username}:${password}`));\n return this.requestLogin();\n }\n\n doJaasAuthentication(username: string, password: string) {\n return this.initLogin(true).then(() => {\n if (this.isBasicAuthentication) {\n Cache.removeItem(\"basic-ok\");\n return this.doBasicAuthentication(username, password).then(() => {\n Cache.addItem(\"basic-ok\", true);\n });\n }\n return this.doFormLogin(username, password);\n });\n }\n\n getLogoutUrl() {\n const type = loginType();\n\n if (!type || type === INTERNAL_LOGIN_TYPE.JAAS) {\n return `${getContextPath()}/Logoff`;\n }\n\n return `${getContextPath()}${logoutPath()}`;\n }\n\n /**\n * Browser redirect to the logout url. (no xmlhttp)\n */\n redirectToLogout(postRedirectUrl?: string) {\n Cache.clear();\n\n const origin = window.location.origin;\n const redirectUrl = postRedirectUrl?.startsWith(\"http\")\n ? postRedirectUrl\n : `${origin}${getContextPath()}`;\n\n window.location.assign(this.getLogoutUrl() + \"?url=\" + redirectUrl);\n }\n\n /**\n * Logout the user with xmlhttp\n */\n logout() {\n return universalFetch({\n url: this.getLogoutUrl(),\n }).then((response) => {\n // clear cache because of cached contributions\n Cache.clear();\n return response;\n });\n }\n}\n","import { HTTP_METHODS } from \"../constants/Constants\";\nimport { getCaptchaPath, getContextPathModularUI } from \"../settings/Paths\";\nimport { xhr } from \"../utils/fetch/xhr\";\n\ninterface CaptchaInitialResponse {\n tokenId: string;\n image: string;\n}\n\ninterface CaptchaValidResponse {\n valid: boolean;\n}\n\ninterface CaptchaInvalidResponse {\n tokenId: string;\n image: string;\n valid: boolean;\n error: { id: string };\n}\n\ntype PossibleCaptchaResponse =\n | CaptchaInitialResponse\n | CaptchaValidResponse\n | CaptchaInvalidResponse;\n\ninterface CaptchaRequestOptions {\n origin?: string;\n contextPath?: string;\n}\n\nexport class CaptchaRequest {\n private _tokenId: string | undefined;\n private _image: string | undefined;\n private _origin = \"\";\n private _contextPath: string = getContextPathModularUI();\n\n CaptchaRequest(options?: CaptchaRequestOptions) {\n this._origin = options?.origin || \"\";\n this._contextPath = options?.contextPath || getContextPathModularUI();\n }\n\n captchaResponse(response: PossibleCaptchaResponse) {\n this._tokenId = \"tokenId\" in response ? response.tokenId : this._tokenId;\n this._image = \"image\" in response ? response.image : this._image;\n\n return {\n tokenId: this._tokenId,\n image: this._image,\n valid: \"valid\" in response ? response.valid : false,\n error: \"error\" in response ? response.error : null,\n };\n }\n\n /**\n * Initiate the captcha request\n */\n init() {\n return xhr<CaptchaInitialResponse>({\n url: getCaptchaPath(this._contextPath, this._origin),\n }).then((response) => this.captchaResponse(response));\n }\n\n /**\n * Answer the captcha\n */\n send(answer?: string) {\n return xhr<CaptchaValidResponse | CaptchaInvalidResponse>({\n url: getCaptchaPath(this._contextPath, this._origin),\n method: HTTP_METHODS.POST,\n data: {\n tokenId: this._tokenId ?? \"\",\n answer: answer ?? \"\",\n },\n })\n .then((response) => this.captchaResponse(response))\n .catch((error) => this.captchaResponse(error.response));\n }\n\n /**\n * Reset the captcha and receive a new token and image\n */\n refresh() {\n return this.init();\n }\n}\n\nexport default CaptchaRequest;\n","import type { Href } from \"../models/href/Href\";\n\nexport class ModularUIError extends Error {\n response: object;\n href: Href | string | undefined;\n\n constructor(message: string, response: object, href?: string | Href) {\n super(message);\n\n Object.setPrototypeOf(this, ModularUIError.prototype);\n\n this.response = response;\n this.href = href;\n\n if (\n \"captureStackTrace\" in Error &&\n typeof Error.captureStackTrace === \"function\"\n ) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = new Error(message).stack;\n }\n }\n\n get resource() {\n return this.href;\n }\n}\n","import { has } from \"lodash\";\n\nimport { IllegalArgumentException } from \"../exceptions/IllegalArgumentException\";\n\nimport { MODEL_REGISTRY } from \"./ModelRegistry\";\n\nimport type { ModularUIResponse } from \"./ModularUIResponse\";\nimport type { TargetModel } from \"./types\";\n\n/**\n * Utility to determine which JavaScript Model class should be instantiated\n * based on a Modular UI response.\n */\nexport class ModelResolver {\n /**\n * Resolves a response to a specific Model constructor.\n * The resolution order is:\n * 1. If a single override is provided, it is returned immediately (forced).\n * 2. If multiple overrides are provided, it returns the first one that matches the response.\n * 3. If no overrides match or are provided, it searches the global `MODEL_REGISTRY`.\n *\n * @param response - The Modular UI response object containing data and contributions.\n * @param overrides - Optional class or array of classes to prefer over the global registry.\n * @param forceTargetModel - Force the first model from the overrides array to be returned.\n *\n * @throws {IllegalArgumentException} If the response is missing or the contributions\n * lack a `resourcetype` property.\n *\n * @returns The matching Model constructor, or `undefined` if no match is found.\n *\n * @example\n * const resolver = new ModelResolver();\n * const Model = resolver.resolve(response, [FormModel, TaskModel]);\n */\n static resolve(\n response: ModularUIResponse,\n overrides?: TargetModel | TargetModel[],\n forceTargetModel = false,\n ) {\n if (!response) {\n throw new IllegalArgumentException(\n `No data or contribution available, cannot resolve model`,\n );\n }\n\n if (!has(response.contributions, \"resourcetype\")) {\n throw new IllegalArgumentException(\n `Contributions has wrong format, missing resourcetype property in contributions of ${response.requestHref?.toString()}`,\n );\n }\n\n if (overrides) {\n const overrideList = Array.isArray(overrides) ? overrides : [overrides];\n\n if (overrideList.length === 1 || forceTargetModel) {\n return overrideList[0];\n }\n\n const overrideMatch = MODEL_REGISTRY.find(\n (config) =>\n config.isMatch(response) && overrideList.includes(config.Model),\n );\n\n return overrideMatch?.Model;\n }\n\n const match = MODEL_REGISTRY.find((config) => config.isMatch(response));\n\n return match?.Model;\n }\n}\n","import { ApplicationModel } from \"../models/application/ApplicationModel\";\nimport { CaseViewModel } from \"../models/caseview/CaseViewModel\";\nimport { ConceptDetailModel } from \"../models/concepts/ConceptDetailModel\";\nimport { ConceptIndexModel } from \"../models/concepts/ConceptIndexModel\";\nimport { ConceptTypeDetailModel } from \"../models/concepts/ConceptTypeDetailModel\";\nimport { ContentIndexModel } from \"../models/content/ContentIndexModel\";\nimport { ContentModel } from \"../models/content/ContentModel\";\nimport { ContentTOCModel } from \"../models/content/ContentTOCModel\";\nimport { ContentTypeModel } from \"../models/content/ContentTypeModel\";\nimport { DetailModel } from \"../models/detail/DetailModel\";\nimport { FormModel } from \"../models/form/FormModel\";\nimport { ListDetailModel } from \"../models/list/detail/ListDetailModel\";\nimport { ListModel } from \"../models/list/ListModel\";\nimport { LookupOptionsModel } from \"../models/lookup/LookupOptionsModel\";\nimport { ModelCatalogModel } from \"../models/modelcatalog/ModelCatalogModel\";\nimport { GroupingPanelModel } from \"../models/panels/GroupingPanelModel\";\nimport { CaseSearchModel } from \"../models/search/CaseSearchModel\";\nimport { TabModel } from \"../models/tab/TabModel\";\nimport { TaskGroupModel } from \"../models/taskgroup/TaskGroupModel\";\nimport { UserModel } from \"../models/user/UserModel\";\nimport { UserProfileModel } from \"../models/user/UserProfileModel\";\nimport { UserServicesModel } from \"../models/user/UserServicesModel\";\n\nimport type { ModelConfig } from \"./types\";\n\nexport const MODEL_REGISTRY: ModelConfig[] = [\n {\n name: \"Application\",\n isMatch: ({ resourcetype }) => resourcetype === \"Application\",\n Model: ApplicationModel,\n },\n {\n name: \"Tab\",\n isMatch: ({ resourcetype }) =>\n resourcetype.endsWith(\"Tab\") || resourcetype.endsWith(\"KnowledgeBank\"),\n Model: TabModel,\n },\n {\n name: \"ListDetail\",\n isMatch: ({ resourcetype }) => {\n const normalized = resourcetype.toLowerCase();\n return (\n normalized.endsWith(\"listdetail\") ||\n normalized.endsWith(\"listpaneldetail\") ||\n normalized.endsWith(\"datastorepaneldetail\")\n );\n },\n Model: ListDetailModel,\n },\n {\n name: \"List\",\n isMatch: ({ resourcetype }) =>\n resourcetype.endsWith(\"List\") ||\n resourcetype.endsWith(\"ListPanel\") ||\n resourcetype.endsWith(\"RelatedDataStorePanel\") ||\n resourcetype.endsWith(\"RelatedDatastorePanel\") ||\n [\n \"list-related-cases\",\n \"RecordPanel\",\n \"EventHistoryPanel\",\n \"NotePanel\",\n \"AppointmentPanel\",\n \"DocumentPanel\",\n \"AssignmentPanel\",\n ].includes(resourcetype),\n Model: ListModel,\n },\n {\n name: \"GroupingPanel\",\n isMatch: ({ resourcetype }) =>\n [\"GroupingPanel\", \"CaseTabGroupingPanel\", \"TabGroupingPanel\"].includes(\n resourcetype,\n ),\n Model: GroupingPanelModel,\n },\n {\n name: \"CaseSearch\",\n isMatch: ({ resourcetype }) => resourcetype === \"CaseSearch\",\n Model: CaseSearchModel,\n },\n {\n name: \"CaseView\",\n isMatch: ({ resourcetype }) => resourcetype === \"CaseView\",\n Model: CaseViewModel,\n },\n {\n name: \"Detail\",\n isMatch: ({ resourcetype }) =>\n resourcetype.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourcetype,\n ),\n Model: DetailModel,\n },\n {\n name: \"TaskGroup\",\n isMatch: ({ resourcetype }) => resourcetype === \"TaskGroup\",\n Model: TaskGroupModel,\n },\n {\n name: \"Form\",\n isMatch: ({ resourcetype }) => resourcetype === \"Form\",\n Model: FormModel,\n },\n {\n name: \"User\",\n isMatch: ({ resourcetype }) => resourcetype === \"userdata\",\n Model: UserModel,\n },\n {\n name: \"UserProfile\",\n isMatch: ({ resourcetype }) => resourcetype === \"userdata\",\n Model: UserProfileModel,\n },\n {\n name: \"UserServices\",\n isMatch: ({ resourcetype }) => resourcetype === \"user_services\",\n Model: UserServicesModel,\n },\n {\n name: \"ModelCatalog\",\n isMatch: ({ resourcetype }) => resourcetype === \"ModelCatalog\",\n Model: ModelCatalogModel,\n },\n {\n name: \"ConceptIndex\",\n isMatch: ({ resourcetype }) =>\n resourcetype === \"ConceptSearch\" ||\n resourcetype.toLowerCase() === \"relatedconcepts\",\n Model: ConceptIndexModel,\n },\n {\n name: \"ConceptDetail\",\n isMatch: ({ resourcetype }) => resourcetype === \"ConceptDetail\",\n Model: ConceptDetailModel,\n },\n {\n name: \"ConceptTypeDetail\",\n isMatch: ({ resourcetype }) => resourcetype === \"ConceptTypeDetail\",\n Model: ConceptTypeDetailModel,\n },\n {\n name: \"ContentIndex\",\n isMatch: ({ resourcetype }) => resourcetype === \"ContentSearch\",\n Model: ContentIndexModel,\n },\n {\n name: \"ContentTOC\",\n isMatch: ({ resourcetype }) => resourcetype === \"ContentTOC\",\n Model: ContentTOCModel,\n },\n {\n name: \"Content\",\n isMatch: ({ resourcetype }) => resourcetype === \"ContentDetail\",\n Model: ContentModel,\n },\n {\n name: \"ContentType\",\n isMatch: ({ resourcetype }) => resourcetype === \"ContentTypeDetail\",\n Model: ContentTypeModel,\n },\n {\n name: \"LookupOptions\",\n isMatch: ({ resourcetype }) => resourcetype === \"lookupOptions\",\n Model: LookupOptionsModel,\n },\n];\n","import deepmerge from \"deepmerge\";\nimport { klona } from \"klona/full\";\nimport { isPlainObject } from \"lodash\";\n\nimport { HTTP_METHODS, TIMEVERSION_FILTER_NAME } from \"../constants/Constants\";\nimport { IllegalArgumentException } from \"../exceptions/IllegalArgumentException\";\nimport { IllegalStateException } from \"../exceptions/IllegalStateException\";\nimport { LayoutHintProcessor } from \"../layouthints/LayoutHintProcessor\";\nimport { ResourceModel } from \"../models/base/ResourceModel\";\nimport { ContentModel } from \"../models/content/ContentModel\";\nimport { SectionModel } from \"../models/content/SectionModel\";\nimport { ErrorResponse } from \"../models/error/ErrorResponse\";\nimport { FormModel } from \"../models/form/FormModel\";\nimport { Href } from \"../models/href/Href\";\nimport { getContextPathModularUI } from \"../settings/Paths\";\nimport { getBooleanSetting } from \"../settings/Settings\";\nimport { universalFetch } from \"../utils/fetch/universalFetch\";\n\nimport { ModelResolver } from \"./ModelResolver\";\nimport { ModularUIError } from \"./ModularUIError\";\nimport { ModularUIResponse } from \"./ModularUIResponse\";\n\nimport type { FormData } from \"../models/form/types\";\nimport type {\n ModularUIModel,\n ModularUIModelWithChildModels,\n} from \"../models/types\";\nimport type { Contributions, Data, DefaultLinksData } from \"../types/types\";\nimport type {\n ModularUIRequestOptions,\n ProgressHandler,\n} from \"../utils/fetch/types\";\nimport type { ModularUISpecificErrorResponse, TargetModel } from \"./types\";\n\n/**\n * Helper for fetching data and contributions from the Be Informed modular ui\n * and merge it into a target or resolvable model.\n *\n * @example\n * const model = new ModularUIRequest(\"url-to-request\").fetch();\n * const post = new ModularUIRequest(\"url-to-request\", { method: \"POST\"}).fetch();\n */\nexport class ModularUIRequest {\n private _response: ModularUIResponse = new ModularUIResponse();\n\n private _href: Href;\n private _options: ModularUIRequestOptions;\n private _targetModel: TargetModel | TargetModel[] | undefined;\n private _forceTargetModel = false;\n private _contributionsHref: Href | string | undefined;\n private _locale = \"en\";\n private _method: HTTP_METHODS = HTTP_METHODS.GET;\n\n private _progressEvent: ProgressHandler | undefined;\n\n private _origin = \"\";\n private _contextPath: string = getContextPathModularUI();\n\n private _layoutHintProcessor: LayoutHintProcessor;\n\n constructor(href: Href | string, options: ModularUIRequestOptions = {}) {\n if (!href) {\n throw new IllegalArgumentException(\n \"You must pass a href to the resource that is requested\",\n );\n }\n\n this._href = typeof href === \"string\" ? new Href(href) : href;\n this._options = options;\n\n this._layoutHintProcessor = new LayoutHintProcessor(\n this._origin,\n this._contextPath,\n this.options,\n );\n\n this._response = new ModularUIResponse();\n this._response.requestHref = this.href;\n\n this.locale = this.getRequestLocale(options.locale);\n\n // copy request parameters to response, to be able to use them in the models\n // self links are missing the request parameters\n this._response.parameters = this.href.parameters.all;\n\n this.contextPath = options.contextPath || this.href.contextPath;\n this.origin = options.origin || this.href.origin;\n\n this._targetModel = options.targetModel;\n this.method = options.method || this.href.method;\n }\n\n /**\n * Retrieve the preferred language for this request, falls back to the browser language or english\n */\n getRequestLocale(optionLocale: string | undefined) {\n if (optionLocale) {\n return optionLocale;\n }\n\n if (typeof navigator !== \"undefined\" && navigator?.language) {\n return navigator.language.split(\"-\")[0] || \"en\";\n }\n\n return \"en\";\n }\n\n get origin() {\n return this._origin;\n }\n\n set origin(origin: string | undefined) {\n this._origin = origin ?? \"\";\n this._response.origin = origin ?? \"\";\n this._layoutHintProcessor.setOrigin(this._origin);\n }\n\n get contextPath() {\n return this._contextPath;\n }\n\n set contextPath(contextPath: string | undefined) {\n const path = contextPath ?? getContextPathModularUI();\n this._contextPath = path;\n this._response.contextPath = path;\n this._layoutHintProcessor.setContextPath(path);\n }\n\n get contributionsHref() {\n return this._contributionsHref;\n }\n\n set contributionsHref(contributionsHref: string | Href | undefined) {\n this._contributionsHref = contributionsHref;\n }\n\n set locale(locale: string) {\n this._locale = locale;\n this._response.locale = locale;\n this._layoutHintProcessor.setRequestOptions(this.options);\n }\n\n get locale() {\n return this._locale;\n }\n\n get response() {\n return this._response;\n }\n\n set href(href: Href) {\n this._href = href;\n }\n\n get href() {\n return this._href;\n }\n\n set method(method: HTTP_METHODS) {\n this._method = method;\n }\n\n get method() {\n return this._method;\n }\n\n get options() {\n return {\n ...this._options,\n locale: this.locale,\n method: this.method,\n };\n }\n\n set options(options: ModularUIRequestOptions) {\n this._options = options;\n this._layoutHintProcessor.setRequestOptions(options);\n }\n\n get requestOptions() {\n const {\n targetModel,\n forceTargetModel,\n updateHandler,\n childmodels,\n isValidationRequest,\n removeOnUnmount,\n ...requestOptions\n } = this.options;\n\n return requestOptions;\n }\n\n get withChildModels() {\n return (\n !(\"childmodels\" in this.options) || this.options.childmodels === true\n );\n }\n\n set targetModel(targetModel: TargetModel | TargetModel[] | undefined) {\n this._targetModel = targetModel;\n }\n\n get targetModel() {\n return this._targetModel;\n }\n\n set forceTargetModel(forceTargetModel: boolean) {\n this._forceTargetModel = forceTargetModel ?? false;\n }\n\n get forceTargetModel() {\n return this._forceTargetModel;\n }\n\n /**\n * Resolves the appropriate Model class for the current response.\n * Uses the ModelResolver to check against targetModel overrides or the global registry.\n */\n private resolveModel(): TargetModel {\n const Model = ModelResolver.resolve(\n this.response,\n this.targetModel,\n this.forceTargetModel,\n );\n\n if (Model) {\n return Model;\n }\n\n const url = this.href.toString();\n const resourceType = this.response?.resourcetype || \"unknown\";\n\n if (this.targetModel) {\n const availableTypes = Array.isArray(this.targetModel)\n ? this.targetModel\n .map((m) => (m as unknown as ResourceModel).type || m.name)\n .join(\", \")\n : (this.targetModel as unknown as ResourceModel).type ||\n this.targetModel.name;\n\n throw new IllegalStateException(\n `Cannot find a matching model for URL: '${url}', resourcetype: '${resourceType}'. Available overrides: [${availableTypes}]`,\n );\n }\n\n throw new IllegalStateException(\n `No JavaScript model is applicable for the request to ${url}. Response resourcetype: '${resourceType}'.`,\n );\n }\n\n private createModel() {\n const Model = this.resolveModel();\n return new Model(this.response);\n }\n\n private processContributionsService(contributions: unknown) {\n if (!isPlainObject(contributions)) {\n throw new IllegalArgumentException(\n \"Missing contributions data or contributions is not JSON\",\n );\n }\n\n if (typeof contributions === \"object\" && contributions != null) {\n const record = contributions as Record<string, Contributions>;\n const [key] = Object.keys(record);\n const contributionsBody = record[key];\n if (key === \"error\") {\n this.handleContributionsError(contributionsBody);\n }\n if (typeof contributionsBody === \"object\" && contributionsBody != null) {\n // The key of the data service is different from the contributions service for forms\n if (!(this.response.key in contributionsBody)) {\n this.response.key = key;\n }\n\n this.response.contributions = contributionsBody;\n }\n }\n }\n\n private handleContributionsError(error: ModularUISpecificErrorResponse) {\n const errorMessage = error.properties?.message ?? \"Error in contribution\";\n throw new ModularUIError(errorMessage, error, this.contributionsHref);\n }\n\n private handleDataError(error: ModularUISpecificErrorResponse | string) {\n if (typeof error === \"object\" && error.properties) {\n const errorMessage = error.properties?.message ?? \"Error in data\";\n throw new ModularUIError(\n errorMessage,\n error,\n this.href.absolutepath.toString(),\n );\n }\n\n throw new IllegalArgumentException(JSON.stringify(error));\n }\n\n private handleData(key: string, data: Data | undefined) {\n this.response.key = key;\n this.response.data = data;\n\n const links = data?._links as DefaultLinksData | undefined;\n\n if (!links) {\n throw new IllegalArgumentException(\n `No _links object found in the data of ${this.href.toString()}`,\n );\n }\n\n if (links?.contributions) {\n this.contributionsHref = links.contributions.href;\n } else if (Array.isArray(links) && links[0].contributions) {\n this.contributionsHref = links[0].contributions.href;\n } else {\n throw new IllegalArgumentException(\n `Contributions link not found for data with key ${key}`,\n );\n }\n }\n\n private processDataService(data: unknown) {\n if (typeof data !== \"object\" || data === null) {\n throw new IllegalArgumentException(\"Missing data or data is not JSON\");\n }\n\n const record = data as Record<string, Data>;\n const [key] = Object.keys(record);\n const dataBody = record[key];\n\n if (key === \"error\") {\n this.handleDataError(dataBody);\n } else {\n const [key] = Object.keys(data);\n this.handleData(key, dataBody);\n }\n }\n\n private fetchContributionsService() {\n if (!this.contributionsHref) {\n throw new IllegalStateException(\"Missing a contributions href\");\n }\n\n return universalFetch({\n url: `${this.origin}${this.contextPath}${this.contributionsHref}`,\n cache: true,\n locale: this.options.locale,\n });\n }\n\n private fetchDataService() {\n return universalFetch({\n ...this.requestOptions,\n url: `${this.origin}${this.contextPath}${this.href.path}`,\n params: this.href.getQuerystringForModularUI(),\n locale: this.options.locale,\n onProgress: this.onProgress,\n });\n }\n\n set onProgress(progressEvent: ProgressHandler | undefined) {\n this._progressEvent = progressEvent;\n }\n\n get onProgress() {\n return this._progressEvent;\n }\n\n /**\n * Combine previous send request data with new validation data to create a complete request object\n * The received model is new FormModel containing ONLY the current question, not the previously entered questions\n * to create a complete request we append the originally send form objects\n */\n private getDynamicValidationData(model: ModularUIModel) {\n const prevData =\n typeof this.options.data === \"string\"\n ? JSON.parse(this.options.data)\n : this.options.data;\n\n if (model instanceof FormModel) {\n const newData = JSON.parse(model.validationData);\n return JSON.stringify(deepmerge(prevData || {}, newData));\n }\n\n return JSON.stringify(prevData) ?? \"{}\";\n }\n\n /**\n * First load of dynamic values when a form is loaded\n */\n private async loadDynamicValidations(model: ModularUIModel) {\n if (\n !this.options.isValidationRequest &&\n getBooleanSetting(\"USE_INSTANT_SERVER_VALIDATION\") &&\n model instanceof FormModel &&\n model.currentFormObject?.hasDynamicValidations\n ) {\n const validationHref = this.href.setParameter(\"commit\", \"false\");\n const data = await universalFetch({\n ...this.requestOptions,\n url: `${this.origin}${this.contextPath}${this.href.path}`,\n params: validationHref.getQuerystringForModularUI(),\n data: this.getDynamicValidationData(model),\n });\n\n if (data == null || typeof data !== \"object\") {\n return model;\n }\n\n const formResponse = data as Record<string, FormData>;\n const [key] = Object.keys(formResponse);\n return model.updateValidations(formResponse[key]);\n }\n\n return model;\n }\n\n private fetchFromCache() {\n this.options = {\n ...this.options,\n cache: true,\n };\n\n return this.fetch();\n }\n\n private fetchChildModels(model: ModularUIModel) {\n const childModelLinks = (\n model as ModularUIModelWithChildModels\n ).getInitialChildModelLinks();\n\n const childModelRequests: Promise<ModularUIModel>[] = childModelLinks.map(\n (childModelLink) => {\n const request = new ModularUIRequest(childModelLink.href, {\n locale: this.locale,\n });\n\n if (childModelLink.targetModel) {\n request.targetModel = childModelLink.targetModel;\n }\n\n if (childModelLink.isCacheable) {\n return request.fetchFromCache();\n }\n\n return request.fetch();\n },\n );\n\n return Promise.allSettled(childModelRequests).then((childModels) => {\n const resolvedChildModels: ModularUIModelWithChildModels[] = [];\n const errorChildModels: ErrorResponse[] = [];\n\n childModels.forEach((childModel) => {\n if (childModel.status === \"rejected\") {\n const { reason } = childModel;\n if (reason.name !== \"Error.ChangePasswordRequired\") {\n console.debug(\n \"Unexpected error when retrieving child model:\",\n reason,\n );\n }\n errorChildModels.push(\n new ErrorResponse(reason, \"\", {\n origin: this.origin,\n contextPath: this.contextPath,\n }),\n );\n } else {\n resolvedChildModels.push(\n childModel.value as ModularUIModelWithChildModels,\n );\n }\n });\n\n if (model instanceof ResourceModel) {\n model.addChildModels(resolvedChildModels, errorChildModels);\n }\n\n return model;\n });\n }\n\n async fetchContent(withChildSections: boolean) {\n const model = await this.fetchFromCache();\n if (\n withChildSections &&\n model instanceof ContentModel &&\n model.childSectionLinks.length > 0\n ) {\n return this.fetchContentChildSections(model);\n }\n return model;\n }\n\n /**\n * Recursively return child sections defined on the content model\n */\n async fetchContentChildSections(\n contentModel: ContentModel,\n ): Promise<ContentModel> {\n const newContentModel = klona(contentModel);\n\n const sectionModels = await Promise.all(\n contentModel.childSectionLinks.map((childSectionLink) => {\n const contentHrefWithEntryDate = childSectionLink.selfhref.addParameter(\n TIMEVERSION_FILTER_NAME,\n contentModel.entryDate,\n );\n\n const request = new ModularUIRequest(contentHrefWithEntryDate, {\n locale: this.locale,\n });\n\n return request.fetchContent(true);\n }),\n );\n newContentModel.childSections = sectionModels.filter(\n (sectionModel) => sectionModel instanceof SectionModel,\n );\n return newContentModel;\n }\n\n async fetch() {\n const data = await this.fetchDataService();\n if (data == null) {\n throw new Error(`No data received for ${this.href.toString()}`);\n }\n\n this.processDataService(data);\n\n const contributions = await this.fetchContributionsService();\n if (contributions == null) {\n throw new Error(\n `No contributions data received for ${this.contributionsHref}`,\n );\n }\n\n this.processContributionsService(contributions);\n\n await this._layoutHintProcessor.processAsyncLayoutHints(this.response);\n\n const model = this.createModel();\n\n const validatedModel = await this.loadDynamicValidations(model);\n if (this.withChildModels) {\n return await this.fetchChildModels(validatedModel);\n }\n return validatedModel;\n }\n\n /**\n * Make a post request with optionally data to send\n * @param data\n */\n post(data: string) {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data,\n };\n\n return this.fetch();\n }\n\n /**\n * Make a POST request using the form, an updated form is returned (merge of old and new form)\n * @param form\n * @returns {Promise<FormModel>}\n */\n postForm(form: FormModel) {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data: form.formdata,\n };\n\n return this.fetch().then((response) => {\n if (response instanceof FormModel) {\n return form.update(response);\n }\n return form;\n });\n }\n\n /**\n * Simplified synchronous version of fetch (returns the model, not a Promise)\n * This can be used on the server to retrieve a model. It only loads the request url and it's child models\n */\n fetchSync() {\n const options = { headers: { \"Accept-Language\": this.locale } };\n\n const dataString = dataFetcher.fetch(this.href.toString(), options);\n if (dataString == null) {\n throw new Error(`No data received for ${this.href.toString()}`);\n }\n\n this.processDataService(JSON.parse(dataString));\n\n if (this.contributionsHref == null) {\n throw new Error(`No constributions received for ${this.href.toString()}`);\n }\n\n const contributionsString = dataFetcher.fetch(\n this.contributionsHref.toString(),\n options,\n );\n if (contributionsString == null) {\n throw new Error(\n `No constributions received for ${this.contributionsHref.toString()}`,\n );\n }\n this.processContributionsService(JSON.parse(contributionsString));\n\n const model: ResourceModel = this.createModel();\n\n const childModelLinks = model.getInitialChildModelLinks();\n\n const childModels = childModelLinks.map((childModelLink) => {\n return new ModularUIRequest(childModelLink.href, {\n locale: this.locale,\n }).fetchSync();\n });\n if (model instanceof ResourceModel) {\n model.addChildModels(childModels, []);\n }\n\n return model;\n }\n}\n"],"mappings":"wqBAaO,IAAMA,GAAN,KAAmB,CAChB,uBACA,oBAER,aAAc,CACZ,KAAK,uBAAyB,GAC9B,KAAK,oBAAsB,KAAK,sBAAsB,CACxD,CAEA,uBAAwB,CACtB,IAAMC,EAAOC,EAAU,EAEjBC,EACJC,EAAoBH,CAAwC,EAE9D,MAAI,CAACE,GAAYA,IAAa,cAK5BA,IAAa,cACbF,EAAK,SAAS,YAAY,eAI1BE,IAAa,eACbF,EAAK,SAAS,qBAAqB,gCAMvC,CAEA,IAAI,oBAAqB,CACvB,OAAO,KAAK,mBACd,CAEA,IAAI,mBAAmBI,EAAyC,CAC9D,KAAK,oBAAsBA,CAC7B,CAEA,IAAI,uBAAwB,CAC1B,OACE,KAAK,wBACL,KAAK,qBAAuB,aAEhC,CAEA,IAAI,sBAAsBC,EAAgC,CACxD,KAAK,uBAAyBA,CAChC,CAEA,cAAe,CACb,OAAOC,EAAe,CACpB,IAAK,GAAGC,EAAe,CAAC,SACxB,aACA,QAAS,CACP,OAAQ,mBACR,eAAgB,mCAClB,CACF,CAAC,CACH,CAEA,UAAUC,EAAoB,CAC5B,OAAI,KAAK,uBAAyB,CAACA,EAC1B,QAAQ,QAAQ,EAAI,EAGtB,KAAK,aAAa,EAAE,MAAOC,IAI5BA,aAAiBC,IACnB,KAAK,sBAAwB,IAGxB,QAAQ,QAAQ,CAAC,CAAC,EAC1B,CACH,CAEA,MAAMC,EAAkBC,EAAkB,CACxC,OAAQ,KAAK,mBAAoB,CAC/B,iBACE,OAAO,KAAK,YAAYD,EAAUC,CAAQ,EAC5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AL_LOGIN_TYPE","authenticationType","isBasicAuthentication","universalFetch","getContextPath","initLogin","error","UnauthorizedException","username","password","loginPath","encodedUsername","encodedPassword","loginUsernameField","loginPasswordField","cacheInstance","logoutPath","postRedirectUrl","origin","redirectUrl","response","CaptchaRequest","getContextPathModularUI","options","response","xhr","getCaptchaPath","answer","error","ModularUIError","_ModularUIError","message","response","href","import_lodash","MODEL_REGISTRY","resourcetype","ApplicationModel","TabModel","normalized","ListDetailModel","ListModel","GroupingPanelModel","CaseSearchModel","CaseViewModel","DetailModel","TaskGroupModel","FormModel","UserModel","UserProfileModel","UserServicesModel","ModelCatalogModel","ConceptIndexModel","ConceptDetailModel","ConceptTypeDetailModel","ContentIndexModel","ContentTOCModel","ContentModel","ContentTypeModel","LookupOptionsModel","ModelResolver","response","overrides","forceTargetModel","IllegalArgumentException","overrideList","MODEL_REGISTRY","config","import_lodash","deepmerge","klona","ModularUIRequest","_ModularUIRequest","ModularUIResponse","getContextPathModularUI","href","options","IllegalArgumentException","Href","LayoutHintProcessor","optionLocale","origin","contextPath","path","contributionsHref","locale","method","targetModel","forceTargetModel","updateHandler","childmodels","isValidationRequest","removeOnUnmount","requestOptions","Model","ModelResolver","url","resourceType","availableTypes","m","IllegalStateException","contributions","record","key","contributionsBody","error","errorMessage","ModularUIError","data","links","dataBody","universalFetch","progressEvent","model","prevData","FormModel","newData","deepmerge","getBooleanSetting","validationHref","formResponse","childModelRequests","childModelLink","request","childModels","resolvedChildModels","errorChildModels","childModel","reason","ErrorResponse","ResourceModel","withChildSections","ContentModel","contentModel","newContentModel","klona","sectionModels","childSectionLink","contentHrefWithEntryDate","TIMEVERSION_FILTER_NAME","sectionModel","SectionModel","validatedModel","form","response","dataString","contributionsString"]}
|
package/dist/chunk-6GV6KLAV.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var _=Object.create;var S=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var m=(e,t,o,A)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of E(t))!x.call(e,r)&&r!==o&&S(e,r,{get:()=>t[r],enumerable:!(A=s(t,r))||A.enumerable});return e};var R=(e,t,o)=>(o=e!=null?_(M(e)):{},m(t||!e||!e.__esModule?S(o,"default",{value:e,enumerable:!0}):o,e));var p=typeof Graal<"u",C=p,c=(o=>(o.GET="GET",o.POST="POST",o))(c||{}),O=(o=>(o.BODY="bodyParameter",o.QUERY="queryParameter",o))(O||{}),T="~",u="entryDate",I="yyyy-MM-dd",l="yyyy-MM-dd'T'HH:mm:ss",L="HH:mm:ss",d="yyyy-MM-dd'T'HH:mm:ss.SSS",G="xxx",J=1,P=1,F=(n=>(n.EXTRA_SMALL="EXTRA_SMALL",n.SMALL="SMALL",n.MEDIUM="MEDIUM",n.LARGE="LARGE",n.EXTRA_LARGE="EXTRA_LARGE",n))(F||{}),a=(r=>(r.JAAS="JAAS",r.PAC4J_FORM="PAC4J_FORM",r.PAC4J_BASIC="PAC4J_BASIC",r.PAC4J_INDIRECT="PAC4J_INDIRECT",r))(a||{}),D="security.clients",N="FormClient.login_url",f="FormClient.username_field_name",U="FormClient.password_field_name",X="FormClient.logout_url",b={name:"Form based authentication",authentication:"DefaultFormClient",isPrimary:!0};export{y as a,R as b,p as c,C as d,c as e,O as f,T as g,u as h,I as i,l as j,L as k,d as l,G as m,J as n,P as o,F as p,a as q,D as r,N as s,f as t,U as u,X as v,b as w};
|
|
2
|
-
//# sourceMappingURL=chunk-6GV6KLAV.js.map
|
package/dist/chunk-BTDN4ZDB.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as h,b as x,c as u,d as O,e as g,f as y}from"./chunk-333J3Q2L.js";import{a as T,b as o}from"./chunk-VIKUDFQV.js";import{a}from"./chunk-VGAPPKHA.js";import{e as w,g as H,k as c,v}from"./chunk-OBB3YOFC.js";import{b as R,c as E}from"./chunk-6GV6KLAV.js";var C=e=>{let t=e.url.includes("http")?e.url:e.url.replace(v(),""),s=e.params?e.params.replace("includeContext=true",""):"",n=s===""?t:`${t}?${s}`,r=dataFetcher.fetch(n,e);try{let i=JSON.parse(r);return i.error?Promise.reject(new h(i,void 0,e)):Promise.resolve(i)}catch(i){return Promise.reject(i)}};var p=R(T(),1);var L=0,q=200,S=400,P=401,b=300,F=404,m="application/json",l=class{_options;_attempts=0;_xmlhttp=new XMLHttpRequest;constructor(t){this._options=t}get xmlhttp(){return this._xmlhttp}set xmlhttp(t){this._xmlhttp=t}get options(){return this._options}set options(t){this._options=t}get attempts(){return this._attempts}set attempts(t){this._attempts=t}get url(){let{url:t}=this.options;if(this.params!==""){if(t.includes("?")){let s=t.split("?");return`${s[0]}?${s[1]}&${this.params}`}return`${t}?${this.params}`}return t}get params(){return this.options.params||""}get data(){return this.options.data||null}get method(){return this.options.method||"GET"}get timeout(){return this.options.timeout||H("XHR_TIMEOUT_MS",3e5)}get responseType(){return this.options.responseType||"json"}get events(){return this.options.events||{}}getBaseLocale(){return typeof navigator<"u"&&navigator.language&&navigator.language.split("-")[0]||"en"}get headers(){let t={Accept:m,"Content-Type":m,"X-Requested-With":"XMLHttpRequest","Accept-Language":this.getBaseLocale()};return this.options.headers?{...t,...this.options.headers}:t}timeoutHandler(t){return t(new g(this.url,this.method))}errorHandler(t,s){let{status:n}=this.xmlhttp,{isReload:r}=this.options;return t(n===L?new u(this.url,this.method):n===F?new O(this.url,this.method,r):n===P?new y(this.url,this.method,s):new h(s,this.xmlhttp,this.options))}getResponse(){let{responseType:t,response:s}=this.xmlhttp;if((t===""||t==="text")&&this.getResponseHeader("Content-Type")===m){if((0,p.isPlainObject)(s))return s;try{return JSON.parse(s)}catch(n){throw new x(n)}}return s}responseHandler(t,s){let{status:n}=this.xmlhttp,r=null;try{r=this.getResponse()}catch(i){return s(i)}return n>=q&&n<b||n===S&&(0,p.has)(r,"formresponse")?t(r):this.errorHandler(s,r)}setEventListeners(t,s){let n=this.options.onProgress;n&&["load","loadend","loadstart","progress"].forEach(r=>{this.xmlhttp.addEventListener(r,i=>n(i))}),["abort","error"].forEach(r=>{this.xmlhttp.addEventListener(r,()=>this.errorHandler(s))}),this.xmlhttp.addEventListener("timeout",()=>this.timeoutHandler(s)),this.xmlhttp.addEventListener("load",()=>this.responseHandler(t,s)),Object.keys(this.events).forEach(r=>{this.xmlhttp.addEventListener(r,this.events[r])})}openConnection(){this.xmlhttp.open(this.method,this.url,!0)}setBasicAuthentication(){if(o.hasItem("basic")){let t=o.getItem("basic");typeof t=="string"&&this.xmlhttp.setRequestHeader("Authorization",`Basic ${t}`)}}getResponseHeader(t){return this.xmlhttp.getResponseHeader(t)}setCustomHeaders(){let t=this.headers;Object.keys(t).forEach(s=>{this.xmlhttp.setRequestHeader(s,t[s])})}setOtherOptions(){(this.options.withCredentials||w("XHR_ALWAYS_WITH_CREDENTIALS",o.hasItem("basic")))&&(this.xmlhttp.withCredentials=!0),this.xmlhttp.responseType=this.responseType,this.xmlhttp.timeout=this.timeout}sendData(){if(this.data==null)this.xmlhttp.send();else{let t=typeof this.data=="object"?JSON.stringify(this.data):this.data;this.xmlhttp.send(t)}}handleXMLHttpRequest(){return new Promise((t,s)=>{this.setEventListeners(t,s),this.openConnection(),this.setBasicAuthentication(),this.setCustomHeaders(),this.setOtherOptions(),this.sendData()})}async fetch(){try{return await this.handleXMLHttpRequest()}catch(t){if(t instanceof u&&this.attempts<2)return this.attempts+=1,this.fetch();throw t}}},M=e=>{if(e==null)throw new a("Missing request options, expecting an object as argument for xhr");if(!(0,p.isPlainObject)(e))throw new a(`Expecting an object as argument for xhr, but received: ${e.toString()}`);if(!(0,p.has)(e,"url"))throw new a(`No url property found in arguments of xhr, received: ${JSON.stringify(e)}`);return!0},_=e=>(M(e),new l(e).fetch());var I=R(T(),1);var d="is-fetching",N=e=>{let t=3e3,s=100;return new Promise((n,r)=>{let i=()=>{if(o.getItem(e)!==d){let f=o.getItem(e);f!=null?n(f):r(new Error("Empty cached item"))}else t<=0?r(new Error("Empty cached item")):(t=t-s,setTimeout(i,s))};setTimeout(i,s)})},D=e=>{if(c()&&e.cache){let t=o.createResourceKey(e);if(o.hasItem(t)){let s=o.getItem(t);if(s!=null){if(s===d)return N(t);if((0,I.isPlainObject)(s))return Promise.resolve(s)}}o.addItem(t,d)}return _(e).then(t=>{if(c()&&e.cache&&(typeof t=="string"||typeof t=="object")){let s=o.createResourceKey(e);o.addItem(s,t)}return t})},nt=e=>(e.locale&&(e.headers={...e.headers,"Accept-Language":e.locale}),e.includeContext&&(e.url=`${e.url}?includeContext=true`),E?C(e):D(e));export{C as a,_ as b,nt as c};
|
|
2
|
-
//# sourceMappingURL=chunk-BTDN4ZDB.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/fetch/graalFetch.ts","../src/utils/fetch/xhr.ts","../src/utils/fetch/universalFetch.ts"],"sourcesContent":["import { FetchException } from \"../../exceptions/FetchException\";\nimport { getContextPath } from \"../../settings/Paths\";\n\nimport type { RequestOptions } from \"./types\";\n\n/**\n * Fetch data from server (expects graaljs).\n */\nexport const graalFetch = (args: RequestOptions): Promise<unknown> => {\n // remove contextPath of url, when the request is internal the context path is not needed\n const urlNoBase = args.url.includes(\"http\")\n ? args.url\n : args.url.replace(getContextPath(), \"\");\n const params = args.params\n ? args.params.replace(\"includeContext=true\", \"\")\n : \"\";\n const url = params === \"\" ? urlNoBase : `${urlNoBase}?${params}`;\n\n const data = dataFetcher.fetch(url, args);\n\n try {\n const jsonData = JSON.parse(data);\n\n if (jsonData.error) {\n return Promise.reject(new FetchException(jsonData, undefined, args));\n }\n\n return Promise.resolve(jsonData);\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","import { has, isPlainObject } from \"lodash\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport { FetchException } from \"../../exceptions/FetchException\";\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { JsonParseException } from \"../../exceptions/JsonParseException\";\nimport { NetworkException } from \"../../exceptions/NetworkException\";\nimport { NotFoundException } from \"../../exceptions/NotFoundException\";\nimport { TimeoutException } from \"../../exceptions/TimeoutException\";\nimport { UnauthorizedException } from \"../../exceptions/UnauthorizedException\";\nimport { getNumberSetting, getSetting } from \"../../settings/Settings\";\nimport { Cache } from \"../storage/Cache\";\n\nimport type { ModularUIErrorJSON } from \"../../exceptions/types\";\nimport type { RequestOptions } from \"./types\";\n\ntype RejectFunction = (reason?: unknown) => void;\ntype ResolveFunction<R = unknown> = (value: R | PromiseLike<R>) => void;\n\nconst NETWORK_ERROR_CODE = 0;\nconst SUCCESS_CODE = 200;\nconst CLIENT_ERROR_CODE = 400;\nconst UNAUTHORIZED_CODE = 401;\nconst REDIRECTION_CODE = 300;\nconst NOT_FOUND_CODE = 404;\n\nconst JSON_TYPE = \"application/json\";\n\nclass XHR<R = unknown> {\n private _options: RequestOptions;\n private _attempts = 0;\n\n private _xmlhttp: XMLHttpRequest = new XMLHttpRequest();\n\n constructor(options: RequestOptions) {\n this._options = options;\n }\n\n get xmlhttp() {\n return this._xmlhttp;\n }\n\n set xmlhttp(xmlhttp: XMLHttpRequest) {\n this._xmlhttp = xmlhttp;\n }\n\n get options() {\n return this._options;\n }\n\n set options(options: RequestOptions) {\n this._options = options;\n }\n\n get attempts() {\n return this._attempts;\n }\n\n set attempts(attempts: number) {\n this._attempts = attempts;\n }\n\n /**\n * Create and fix url when params or both querystring and params exist.\n */\n get url() {\n const { url } = this.options;\n if (this.params !== \"\") {\n if (url.includes(\"?\")) {\n const aUrl = url.split(\"?\");\n\n return `${aUrl[0]}?${aUrl[1]}&${this.params}`;\n }\n\n return `${url}?${this.params}`;\n }\n\n return url;\n }\n\n get params() {\n return this.options.params || \"\";\n }\n\n get data() {\n return this.options.data || null;\n }\n\n get method(): HTTP_METHODS {\n return this.options.method || HTTP_METHODS.GET;\n }\n\n get timeout() {\n return this.options.timeout || getNumberSetting(\"XHR_TIMEOUT_MS\", 300000);\n }\n\n get responseType(): XMLHttpRequestResponseType {\n return this.options.responseType || \"json\";\n }\n\n private get events(): Record<string, () => undefined> {\n return this.options.events || {};\n }\n\n private getBaseLocale() {\n if (typeof navigator !== \"undefined\" && navigator.language) {\n return navigator.language.split(\"-\")[0] || \"en\";\n }\n\n return \"en\";\n }\n\n get headers(): Record<string, string> {\n const baseHeaders = {\n Accept: JSON_TYPE,\n \"Content-Type\": JSON_TYPE,\n\n // needed for csrf, see: https://plaza.beinformed.com/amdoc/csrf-protection-in-modular-ui-services-40054554.html\n \"X-Requested-With\": \"XMLHttpRequest\",\n\n \"Accept-Language\": this.getBaseLocale(),\n };\n\n if (this.options.headers) {\n return {\n ...baseHeaders,\n ...this.options.headers,\n };\n }\n\n return baseHeaders;\n }\n\n timeoutHandler(reject: RejectFunction) {\n return reject(new TimeoutException(this.url, this.method));\n }\n\n errorHandler(reject: RejectFunction, responseJSON?: ModularUIErrorJSON) {\n const { status } = this.xmlhttp;\n const { isReload } = this.options;\n\n if (status === NETWORK_ERROR_CODE) {\n return reject(new NetworkException(this.url, this.method));\n }\n\n if (status === NOT_FOUND_CODE) {\n return reject(new NotFoundException(this.url, this.method, isReload));\n }\n\n if (status === UNAUTHORIZED_CODE) {\n return reject(\n new UnauthorizedException(this.url, this.method, responseJSON),\n );\n }\n\n return reject(new FetchException(responseJSON, this.xmlhttp, this.options));\n }\n\n getResponse(): R {\n const { responseType, response } = this.xmlhttp;\n\n if (\n (responseType === \"\" || responseType === \"text\") &&\n this.getResponseHeader(\"Content-Type\") === JSON_TYPE\n ) {\n if (isPlainObject(response)) {\n return response;\n }\n\n try {\n return JSON.parse(response);\n } catch (error) {\n throw new JsonParseException(error as SyntaxError);\n }\n }\n\n return response;\n }\n\n responseHandler(resolve: ResolveFunction<R>, reject: RejectFunction) {\n const { status } = this.xmlhttp;\n\n let response = null;\n try {\n response = this.getResponse();\n } catch (error) {\n return reject(error);\n }\n\n if (\n (status >= SUCCESS_CODE && status < REDIRECTION_CODE) ||\n (status === CLIENT_ERROR_CODE && has(response, \"formresponse\"))\n ) {\n return resolve(response);\n }\n\n return this.errorHandler(reject, response as ModularUIErrorJSON);\n }\n\n setEventListeners(resolve: ResolveFunction<R>, reject: RejectFunction) {\n const progressEvent = this.options.onProgress;\n if (progressEvent) {\n [\"load\", \"loadend\", \"loadstart\", \"progress\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, (event) =>\n progressEvent(event as ProgressEvent<XMLHttpRequest>),\n );\n });\n }\n\n [\"abort\", \"error\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, () => this.errorHandler(reject));\n });\n\n this.xmlhttp.addEventListener(\"timeout\", () => this.timeoutHandler(reject));\n\n this.xmlhttp.addEventListener(\"load\", () =>\n this.responseHandler(resolve, reject),\n );\n\n // Set custom events\n Object.keys(this.events).forEach((eventName) => {\n this.xmlhttp.addEventListener(eventName, this.events[eventName]);\n });\n }\n\n openConnection() {\n this.xmlhttp.open(this.method, this.url, true);\n }\n\n setBasicAuthentication() {\n if (Cache.hasItem(\"basic\")) {\n const basicToken = Cache.getItem(\"basic\");\n if (typeof basicToken === \"string\") {\n this.xmlhttp.setRequestHeader(\"Authorization\", `Basic ${basicToken}`);\n }\n }\n }\n\n getResponseHeader(headerName: string) {\n return this.xmlhttp.getResponseHeader(headerName);\n }\n\n setCustomHeaders() {\n const allHeaders = this.headers;\n\n Object.keys(allHeaders).forEach((headerName) => {\n this.xmlhttp.setRequestHeader(headerName, allHeaders[headerName]);\n });\n }\n\n setOtherOptions() {\n if (\n this.options.withCredentials ||\n getSetting(\"XHR_ALWAYS_WITH_CREDENTIALS\", Cache.hasItem(\"basic\"))\n ) {\n this.xmlhttp.withCredentials = true;\n }\n this.xmlhttp.responseType = this.responseType;\n this.xmlhttp.timeout = this.timeout;\n }\n\n sendData() {\n if (this.data == null) {\n this.xmlhttp.send();\n } else {\n const stringData =\n typeof this.data === \"object\" ? JSON.stringify(this.data) : this.data;\n this.xmlhttp.send(stringData);\n }\n }\n\n handleXMLHttpRequest(): Promise<R> {\n return new Promise((resolve, reject) => {\n this.setEventListeners(resolve, reject);\n\n this.openConnection();\n\n this.setBasicAuthentication();\n\n this.setCustomHeaders();\n\n this.setOtherOptions();\n\n this.sendData();\n });\n }\n\n async fetch(): Promise<R> {\n try {\n return await this.handleXMLHttpRequest();\n } catch (err) {\n if (err instanceof NetworkException && this.attempts < 2) {\n this.attempts += 1;\n return this.fetch();\n }\n\n throw err;\n }\n }\n}\n\nconst validateInputArguments = (args: RequestOptions) => {\n if (args == null) {\n throw new IllegalArgumentException(\n \"Missing request options, expecting an object as argument for xhr\",\n );\n }\n\n if (!isPlainObject(args)) {\n throw new IllegalArgumentException(\n `Expecting an object as argument for xhr, but received: ${args.toString()}`,\n );\n }\n\n if (!has(args, \"url\")) {\n throw new IllegalArgumentException(\n `No url property found in arguments of xhr, received: ${JSON.stringify(\n args,\n )}`,\n );\n }\n\n return true;\n};\n\nexport const xhr = <R = unknown>(args: RequestOptions): Promise<R> => {\n validateInputArguments(args);\n\n return new XHR<R>(args).fetch();\n};\n","import { isPlainObject } from \"lodash\";\n\nimport { IS_GRAALJS } from \"../../constants/Constants\";\nimport { cacheContributions } from \"../../settings/Settings\";\nimport { Cache } from \"../storage/Cache\";\n\nimport { graalFetch } from \"./graalFetch\";\nimport { xhr } from \"./xhr\";\n\nimport type { RequestOptions } from \"./types\";\n\ntype CachedResponse = unknown;\n\nconst IS_FETCHING = \"is-fetching\";\n\n/**\n * Checks each x ms if a cache item is set after fetching the item.\n */\nconst waitForCachedItem = (cacheKey: string) => {\n let TIMEOUT = 3000;\n const CHECK_TIMEOUT = 100;\n\n return new Promise<CachedResponse>((resolve, reject) => {\n const check = () => {\n if (Cache.getItem(cacheKey) !== IS_FETCHING) {\n const cachedItem = Cache.getItem(cacheKey);\n if (cachedItem != null) {\n resolve(cachedItem);\n } else {\n reject(new Error(\"Empty cached item\"));\n }\n } else if (TIMEOUT <= 0) {\n reject(new Error(\"Empty cached item\"));\n } else {\n TIMEOUT = TIMEOUT - CHECK_TIMEOUT;\n setTimeout(check, CHECK_TIMEOUT);\n }\n };\n\n setTimeout(check, CHECK_TIMEOUT);\n });\n};\n\nconst browserFetch = (args: RequestOptions) => {\n if (cacheContributions() && args.cache) {\n const cacheKey = Cache.createResourceKey(args);\n\n if (Cache.hasItem(cacheKey)) {\n const cacheItem = Cache.getItem(cacheKey);\n\n if (cacheItem != null) {\n if (cacheItem === IS_FETCHING) {\n return waitForCachedItem(cacheKey);\n } else if (isPlainObject(cacheItem)) {\n return Promise.resolve(cacheItem);\n }\n }\n }\n\n Cache.addItem(cacheKey, IS_FETCHING);\n }\n\n return xhr(args).then((response) => {\n if (cacheContributions() && args.cache) {\n if (typeof response === \"string\" || typeof response === \"object\") {\n const cacheKey = Cache.createResourceKey(args);\n Cache.addItem(cacheKey, response);\n }\n }\n\n return response;\n });\n};\n\n/**\n * Request data from server, uses server datafetcher or xhr in browser.\n */\nexport const universalFetch = (args: RequestOptions) => {\n // Set locale as Accept-Language header\n if (args.locale) {\n args.headers = {\n ...args.headers,\n \"Accept-Language\": args.locale,\n };\n }\n\n if (args.includeContext) {\n args.url = `${args.url}?includeContext=true`;\n }\n\n // server side no access to the browser cache apis, no cache available\n if (IS_GRAALJS) {\n return graalFetch(args);\n }\n\n return browserFetch(args);\n};\n"],"mappings":"oQAQO,IAAMA,EAAcC,GAA2C,CAEpE,IAAMC,EAAYD,EAAK,IAAI,SAAS,MAAM,EACtCA,EAAK,IACLA,EAAK,IAAI,QAAQE,EAAe,EAAG,EAAE,EACnCC,EAASH,EAAK,OAChBA,EAAK,OAAO,QAAQ,sBAAuB,EAAE,EAC7C,GACEI,EAAMD,IAAW,GAAKF,EAAY,GAAGA,CAAS,IAAIE,CAAM,GAExDE,EAAO,YAAY,MAAMD,EAAKJ,CAAI,EAExC,GAAI,CACF,IAAMM,EAAW,KAAK,MAAMD,CAAI,E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BAAmBA,EAAK,MAC1B,GAGEA,EAAK,iBACPA,EAAK,IAAM,GAAGA,EAAK,GAAG,wBAIpBM,EACKC,EAAWP,CAAI,EAGjBD,EAAaC,CAAI","names":["graalFetch","args","urlNoBase","getContextPath","params","url","data","jsonData","FetchException","error","import_lodash","NETWORK_ERROR_CODE","SUCCESS_CODE","CLIENT_ERROR_CODE","UNAUTHORIZED_CODE","REDIRECTION_CODE","NOT_FOUND_CODE","JSON_TYPE","XHR","options","xmlhttp","attempts","url","aUrl","getNumberSetting","baseHeaders","reject","TimeoutException","responseJSON","status","isReload","NetworkException","NotFoundException","UnauthorizedException","FetchException","responseType","response","error","JsonParseException","resolve","progressEvent","eventType","event","eventName","cacheInstance","basicToken","headerName","allHeaders","getSetting","stringData","err","validateInputArguments","args","IllegalArgumentException","xhr","import_lodash","IS_FETCHING","waitForCachedItem","cacheKey","TIMEOUT","CHECK_TIMEOUT","resolve","reject","check","cacheInstance","cachedItem","browserFetch","args","cacheContributions","cacheItem","xhr","response","universalFetch","IS_GRAALJS","graalFetch"]}
|
package/dist/chunk-OBB3YOFC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u,b as E,c as A}from"./chunk-WVQSFYWD.js";import{c as d,d as R,f as H,g as i}from"./chunk-UE323PGR.js";import{a,b as c,r as T,s as p,t as _,u as l,v as S}from"./chunk-6GV6KLAV.js";var f=a((J,O)=>{"use strict";function $(t,e){return function(o){return t(e(o))}}O.exports=$});var N=a((z,I)=>{"use strict";var w=f(),D=w(Object.getPrototypeOf,Object);I.exports=D});var x=a((Q,b)=>{"use strict";var j=d(),v=N(),G=R(),U="[object Object]",y=Function.prototype,M=Object.prototype,P=y.toString,F=M.hasOwnProperty,W=P.call(Object);function B(t){if(!G(t)||j(t)!=U)return!1;var e=v(t);if(e===null)return!0;var o=F.call(e,"constructor")&&e.constructor;return typeof o=="function"&&o instanceof o&&P.call(o)==W}b.exports=B});var m=c(H(),1),C=c(x(),1);var V="hasAllContentInData",Y="isIncludeTimeOffsetInDateTimes",q={UI_PARAMETERS:[],USE_CLIENTSIDE_VALIDATION:!0,USE_INSTANT_SERVER_VALIDATION:!0,CALENDAR_WEEK_STARTS_ON:1,ALWAYS_COMMIT_FORM:!1,ALLOW_HIDE_WHEN_EMPTY_ON_TABS:!0,HIDE_WHEN_EMPTY_IGNORE_TASKS:!1,SHOW_AVATARS:!0,COMPLETE_SOURCE:!1},r=q,et=t=>{(0,C.default)(t)&&(r=Object.assign(r,t))},s=(t,e)=>{if(!(0,m.default)(r,t)&&e===void 0)throw new Error(`Setting with name ${t} not found and no defaultValue given`);return r[t]??e},n=(t,e)=>{let o=s(t,e);if(typeof o=="string")return o;throw new i(`Expected the value of ${t} to be a string, but was ${typeof o}`)},ot=(t,e)=>{let o=s(t,e);if(typeof o=="number")return o;throw new i(`Expected the value of ${t} to be a number, but was ${typeof o}`)},L=(t,e)=>{let o=s(t,e);if(typeof o=="boolean")return o;throw new i(`Expected the value of ${t} to be a boolean, but was ${typeof o}`)},nt=(t,e)=>{r[t]=e},rt=()=>r,st=()=>L("CACHE_CONTRIBUTIONS",!0),it=()=>L(V,!0),at=()=>s(Y,!1),gt=()=>{let t=s("ENABLED_LOCALES",["en"]);return Array.isArray(t)?t:["en"]},ct=()=>n(T,"PAC4J_FORM"),X=(t="FormClient")=>n(p,`/callback?client_name=${t}`),Tt=()=>n(_,"j_username"),pt=()=>n(l,"j_password"),K=()=>n(S,"/logout"),_t=X(),lt=K();var h=()=>n("CONTEXT_PATH","/BeInformed"),g=()=>n("CONTEXT_PATH_MODULARUI",h()),At=()=>n("CONTEXT_PATH_SERVER",h()),Ot=(t=g(),e="")=>`${e}${t}${u}`,ft=(t=g(),e="")=>`${e}${t}${E}`,It=(t=g(),e="")=>`${e}${t}${A}`;export{x as a,V as b,Y as c,et as d,s as e,n as f,ot as g,L as h,nt as i,rt as j,st as k,it as l,at as m,gt as n,ct as o,X as p,Tt as q,pt as r,K as s,_t as t,lt as u,h as v,g as w,At as x,Ot as y,ft as z,It as A};
|
|
2
|
-
//# sourceMappingURL=chunk-OBB3YOFC.js.map
|
package/dist/chunk-WVQSFYWD.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|