@mohsinonxrm/pptb-dataverse-request-studio 1.4.0-beta.1 → 1.4.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +179 -0
  2. package/README.md +12 -7
  3. package/dist/assets/AssociateMode-Bs_R9XbQ.js +1 -0
  4. package/dist/assets/AssociateTargetsEditor-CVWE3tbv.js +1 -0
  5. package/dist/assets/{BatchMode-D1J8HcNO.js → BatchMode-XGXMc2XF.js} +8 -8
  6. package/dist/assets/{BinaryColumnPickers-DLIbx4hp.js → BinaryColumnPickers-mrnLqk3Z.js} +1 -1
  7. package/dist/assets/BulkDeleteMode-DowWcbnA.js +1 -0
  8. package/dist/assets/BulkWriteMode-Dt3M0dGV.js +6 -0
  9. package/dist/assets/DisassociateMode-qIc2CUpE.js +2 -0
  10. package/dist/assets/ExecuteWorkflowMode-Ce6sKYci.js +1 -0
  11. package/dist/assets/{ManageFileMode-DP3KXgFw.js → ManageFileMode-CcNSQkJf.js} +1 -1
  12. package/dist/assets/{ManageImageMode-F0Dki5VQ.js → ManageImageMode-Dn4P4D6H.js} +1 -1
  13. package/dist/assets/{MergeMode-PeKTZ75X.js → MergeMode-DzPQq2Ao.js} +1 -1
  14. package/dist/assets/PredefinedQueryMode-CaQqp2lm.js +1 -0
  15. package/dist/assets/RetrieveNextLinkMode-BNbknSwe.js +1 -0
  16. package/dist/assets/{cssMode-DXyl4xBX.js → cssMode-B4BP9f3X.js} +1 -1
  17. package/dist/assets/{freemarker2-CR_qGQP2.js → freemarker2-DFKOu_2v.js} +1 -1
  18. package/dist/assets/{handlebars-Buz2RscQ.js → handlebars-cWHtgvCj.js} +1 -1
  19. package/dist/assets/{html-B66Hfdqd.js → html-DSPQITYl.js} +1 -1
  20. package/dist/assets/{htmlMode-3ft3GC0g.js → htmlMode-Cr-uAXsT.js} +1 -1
  21. package/dist/assets/index-D0g0tm7R.js +702 -0
  22. package/dist/assets/{javascript-Cy8u5Pbx.js → javascript-B3oRul8j.js} +1 -1
  23. package/dist/assets/{jsonMode-CvLp-1ik.js → jsonMode-_zXsQ367.js} +1 -1
  24. package/dist/assets/{liquid-BxIE_8lr.js → liquid-Cib5dNaW.js} +1 -1
  25. package/dist/assets/{mdx-Bbo0ENZs.js → mdx-8A_8JwPK.js} +1 -1
  26. package/dist/assets/{monacoSetup-C4aSY1Tw.js → monacoSetup-DObeMDBe.js} +176 -175
  27. package/dist/assets/{python-B6K3FYWG.js → python-DsudPCj1.js} +1 -1
  28. package/dist/assets/{razor-7sN2ZaJq.js → razor-CrmV2uj7.js} +1 -1
  29. package/dist/assets/{tsMode-CIH2Hja3.js → tsMode-BnycW89y.js} +1 -1
  30. package/dist/assets/{typescript-rqW7IEk7.js → typescript-Bs6iTDav.js} +1 -1
  31. package/dist/assets/{xml-Bm2nJGx3.js → xml-DuKZPRNV.js} +1 -1
  32. package/dist/assets/{yaml-Z6ahf7o7.js → yaml-DDDa6myK.js} +1 -1
  33. package/dist/index.html +1 -1
  34. package/package.json +6 -1
  35. package/dist/assets/AssociateMode-BVHaHiUu.js +0 -1
  36. package/dist/assets/AssociateTargetsEditor-C-QKaWaJ.js +0 -1
  37. package/dist/assets/BulkDeleteMode-CFcjcWta.js +0 -1
  38. package/dist/assets/BulkWriteMode-C3ZGwTjw.js +0 -6
  39. package/dist/assets/DisassociateMode-BwMK4UvP.js +0 -2
  40. package/dist/assets/ExecuteWorkflowMode-CkZdayJ4.js +0 -1
  41. package/dist/assets/PredefinedQueryMode-CDuc-WrN.js +0 -1
  42. package/dist/assets/RetrieveNextLinkMode-DenFlpEh.js +0 -1
  43. package/dist/assets/index-C4fO68cu.js +0 -704
@@ -1 +0,0 @@
1
- import{aU as Re,aV as Be,aW as Le,aX as Qe,aY as Ee,aZ as De,a_ as K,a$ as He,r as c,b0 as Oe,u as Z,q as t,a4 as X,b1 as Ae,b2 as A,Y as f,X as p,a2 as be,b3 as Xe,f as ge,c as We,b4 as Ge,b5 as _e,b6 as ie,e as Ve,b7 as Ue,b8 as Ye,b9 as Je,i as Y,j as Ke,ba as Ze,bb as et,F as oe,l as tt,bc as at,bd as rt,aJ as nt,aK as st,L as lt,p as it,aL as de,H as ot,aM as dt,be as ct,a8 as ut,A as ce,B as ue,I as pe,bf as pt,v as mt,bg as yt,bh as me,bi as ht,bj as J,bk as P,aC as ft,x as bt,y as gt,z as xt,D as vt,R as jt,U as St,S as kt,aQ as wt,aR as Tt,bl as Nt,aS as qt,aT as Ct,bm as Ft}from"./index-C4fO68cu.js";const Pt=(n,r)=>{const u=Re("group-label"),{label:o}=n;return{components:{root:"div",label:"span"},root:Le(Qe("div",{ref:r,role:"group","aria-labelledby":o?u:void 0,...n}),{elementType:"div"}),label:Be(o,{defaultProps:{id:u,role:"presentation"},elementType:"span"})}},$t=n=>Ee(n.root,{children:[n.label&&De(n.label,{children:n.label.children}),n.root.children]}),ye={root:"fui-OptionGroup",label:"fui-OptionGroup__label"},zt=He({root:{mc9l5x:"f22iagw",Beiy3e4:"f1vx9l62",Belr9w4:"fiut8dr",B8lkq7l:"f1xxzjds",eii1in:0,H93o2g:0,Gwp8xu:0,Bd39igo:"f16cmn8k",om0q45:"f5642y",Hl9o3s:"ffdf81h",sl1c2c:0,z4hxbw:0,B0i58d9:0,Bi9x0x4:0,Bgurq3m:"f1bsn9kn"},label:{Beyfa6y:0,Bbmb7ep:0,Btl43ni:0,B7oj6ja:0,Dimara:"ft85np5",sj55zd:"f11d4kpn",mc9l5x:"ftgm304",Be2twd7:"fy9rknc",Bhrd7zp:"fl43uef",Bg96gwp:"fwrc4pm",Byoj8tv:0,uwmqm3:0,z189sj:0,z8tnut:0,B0ocmuz:"f1mpq0zz"}},{d:[".f22iagw{display:flex;}",".f1vx9l62{flex-direction:column;}",".fiut8dr{row-gap:var(--spacingHorizontalXXS);}",'.f1xxzjds:not(:last-child)::after{content:"";}',[".f16cmn8k:not(:last-child)::after{border-bottom:var(--strokeWidthThin) solid var(--colorNeutralStroke2);}",{p:-1}],".f5642y:not(:last-child)::after{display:block;}",".ffdf81h:not(:last-child)::after{padding-bottom:var(--spacingHorizontalXS);}",[".f1bsn9kn:not(:last-child)::after{margin:0 calc(var(--spacingHorizontalXS) * -1) var(--spacingVerticalXS);}",{p:-1}],[".ft85np5{border-radius:var(--borderRadiusMedium);}",{p:-1}],".f11d4kpn{color:var(--colorNeutralForeground3);}",".ftgm304{display:block;}",".fy9rknc{font-size:var(--fontSizeBase200);}",".fl43uef{font-weight:var(--fontWeightSemibold);}",".fwrc4pm{line-height:var(--lineHeightBase200);}",[".f1mpq0zz{padding:var(--spacingHorizontalS) var(--spacingHorizontalSNudge);}",{p:-1}]]}),It=n=>{"use no memo";const r=zt();return n.root.className=K(ye.root,r.root,n.root.className),n.label&&(n.label.className=K(ye.label,r.label,n.label.className)),n},ee=c.forwardRef((n,r)=>{const u=Pt(n,r);return It(u),Oe("useOptionGroupStyles_unstable")(u),$t(u)});ee.displayName="OptionGroup";function Mt(n){const r=new Set,u=[];for(const o of n.navigationProperties){if(o.cardinality==="OneToMany")continue;const a=`${o.relationshipName}|${o.targetEntity}`;r.has(a)||(r.add(a),u.push({relationshipName:o.relationshipName,sourceTable:o.targetEntity,via:o.referencingAttribute??o.name,manyToMany:o.cardinality==="ManyToMany"}))}return u.sort((o,a)=>o.sourceTable.localeCompare(a.sourceTable)||o.relationshipName.localeCompare(a.relationshipName))}function Rt(n,r,u){return n.navigationProperties.find(a=>a.relationshipName===r&&a.cardinality!=="ManyToOne"&&a.targetEntity===u)?.name??null}function Bt({table:n,value:r,onChange:u}){const o=c.useMemo(()=>Mt(n),[n]),{table:a,loading:y}=Z(r.sourceTable||null);c.useEffect(()=>{if(!a||!r.relationshipName)return;const l=Rt(a,r.relationshipName,n.logicalName)??"";l!==r.navProperty&&u({...r,navProperty:l})},[a,r.relationshipName,n.logicalName]);const h=l=>`${l.relationshipName}|${l.sourceTable}`,g=o.find(l=>l.relationshipName===r.relationshipName&&l.sourceTable===r.sourceTable),x=l=>`${ge(l.sourceTable)?.displayName??l.sourceTable} · ${l.relationshipName}`;return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[t.jsx(X,{label:"Relationship",hint:o.length?`Rows of ${n.displayName} related to one row of another table.`:void 0,validationState:o.length?"none":"warning",validationMessage:o.length?void 0:`${n.displayName} has no lookups or many-to-many relationships.`,children:t.jsx(Ae,{placeholder:"Pick a relationship…",value:g?x(g):"",selectedOptions:g?[h(g)]:[],onOptionSelect:(l,T)=>{const v=o.find($=>h($)===T.optionValue);v&&u({sourceTable:v.sourceTable,relationshipName:v.relationshipName,navProperty:"",recordId:v.sourceTable===r.sourceTable?r.recordId:null,recordName:v.sourceTable===r.sourceTable?r.recordName:void 0})},listbox:{style:{maxHeight:360}},children:o.map(l=>t.jsx(A,{value:h(l),text:x(l),children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0},children:[t.jsx("span",{children:x(l)}),t.jsx(f,{style:{color:p.colorNeutralForeground3,fontFamily:p.fontFamilyMonospace},children:l.manyToMany?`many-to-many · ${l.via}`:`via ${l.via}`})]})},h(l)))})}),r.sourceTable&&y&&!a&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.jsx(be,{size:"tiny"}),t.jsxs(f,{children:["Loading ",r.sourceTable," metadata…"]})]}),a&&r.relationshipName&&!r.navProperty&&t.jsxs(f,{style:{color:p.colorPaletteRedForeground1},children:[a.displayName," has no collection navigation property for ",r.relationshipName,"."]}),a&&r.navProperty&&t.jsx(X,{label:`${a.displayName} row`,hint:t.jsxs("span",{children:["Collection: ",t.jsx("code",{children:`${a.entitySetName}(…)/${r.navProperty}`})]}),children:t.jsx(Xe,{table:a.logicalName,selectedId:r.recordId,onPick:l=>u({...r,recordId:l?.id??null,recordName:l?.primary})})})]})}const Lt=()=>({table:"",queryId:null,queryType:"savedQuery",top:50,prefer:{...Tt(),formattedValues:!0},headers:wt(),dirty:new Set}),he={sourceTable:"",relationshipName:"",navProperty:"",recordId:null};function fe(n){if(!n)return[];const r=[...n.matchAll(/<cell\s+([^>]+?)\s*\/?>/g)],u=[];for(const o of r){const a=o[1],y=/name="([^"]+)"/.exec(a);if(!y)continue;const h=y[1],g=/width="([^"]+)"/.exec(a),x=g&&parseInt(g[1],10)||100,l=h.indexOf(".");l>=0?u.push({fullName:h,width:x,isLink:!0,linkAlias:h.slice(0,l),attr:h.slice(l+1)}):u.push({fullName:h,width:x,isLink:!1,attr:h})}return u}function Qt(n){switch(n){case 0:return"Main view";case 1:return"Advanced Find";case 2:return"Subgrid";case 4:return"Quick Find";case 8:return"Reserved";case 16:return"Lookup";case 32:return"Marketing list";case 64:return"Address book";case 128:return"Main (no subj)";case 256:return"Outlook filter";case 512:return"Reserved";case 1024:return"Offline filter";case 2048:return"Outlook template";case 4096:return"Reserved";case 8192:return"Svc mgmt app";default:return`Type ${n}`}}function Dt({themeMode:n}){const r=We("predefined-query"),u=Ge(),o=_e("predefined-query",ie,Lt),[a,y]=c.useState(o.state),{table:h}=Z(a.table||null),{entities:g}=Ve(),[x,l]=c.useState("target"),[T,v]=c.useState("builder"),[$,te]=c.useState(null),[xe,ae]=c.useState(!1),[ve,je]=c.useState([]),[z,I]=c.useState(o.lastSavedId),[M,R]=c.useState(o.lastSavedHash),[N,B]=c.useState([]),[W,G]=c.useState(!1),[re,_]=c.useState(null),[k,L]=c.useState(""),{table:Se}=Z(a.related?.sourceTable||null),Q=c.useMemo(()=>Ue(a),[a,h,Se]),V=ge(a.table),d=N.find(e=>e.id===a.queryId)??null,E=N.filter(e=>e.kind==="savedQuery"),D=N.filter(e=>e.kind==="userQuery"),H=c.useMemo(()=>{const e=k.trim().toLowerCase();return e?E.filter(i=>i.name.toLowerCase().includes(e)):E},[E,k]),O=c.useMemo(()=>{const e=k.trim().toLowerCase();return e?D.filter(i=>i.name.toLowerCase().includes(e)):D},[D,k]);c.useEffect(()=>{L(d?.name??"")},[d?.name,a.table]),c.useEffect(()=>{let e=!1;if(!a.table){B([]),_(null);return}if(typeof window>"u"||!window.dataverseAPI?.queryData){B([]);return}G(!0),_(null);const i="savedqueryid,name,description,fetchxml,layoutxml,returnedtypecode,querytype,isdefault,isquickfindquery,iscustomizable,ismanaged",m="userqueryid,name,description,fetchxml,layoutxml,returnedtypecode,querytype",b=`savedqueries?$select=${i}&$filter=returnedtypecode eq '${a.table}' and statecode eq 0&$orderby=name asc`,ze=`userqueries?$select=${m}&$filter=returnedtypecode eq '${a.table}' and statecode eq 0&$orderby=name asc`;return Promise.all([window.dataverseAPI.queryData(b).catch(j=>{throw j instanceof Error?j:new Error(String(j))}),window.dataverseAPI.queryData(ze).catch(()=>({value:[]}))]).then(([j,U])=>{if(e)return;const Ie=j?.value??[],Me=U?.value??[],le=[...Ie.map(s=>{const S=s.layoutxml!=null?String(s.layoutxml):null;return{id:String(s.savedqueryid??""),name:String(s.name??"(unnamed)"),description:s.description!=null?String(s.description):null,fetchXml:s.fetchxml!=null?String(s.fetchxml):null,layoutXml:S,layoutColumns:fe(S),returnedTypeCode:String(s.returnedtypecode??a.table),queryType:typeof s.querytype=="number"?s.querytype:0,isDefault:s.isdefault===!0,isQuickFind:s.isquickfindquery===!0,isCustom:s.iscustomizable?.Value===!0,isManaged:s.ismanaged===!0,kind:"savedQuery"}}),...Me.map(s=>{const S=s.layoutxml!=null?String(s.layoutxml):null;return{id:String(s.userqueryid??""),name:String(s.name??"(unnamed)"),description:s.description!=null?String(s.description):null,fetchXml:s.fetchxml!=null?String(s.fetchxml):null,layoutXml:S,layoutColumns:fe(S),returnedTypeCode:String(s.returnedtypecode??a.table),queryType:typeof s.querytype=="number"?s.querytype:0,isDefault:!1,isQuickFind:!1,isCustom:!0,isManaged:!1,kind:"userQuery"}})];le.sort((s,S)=>s.kind!==S.kind?s.kind==="savedQuery"?-1:1:s.isDefault!==S.isDefault?s.isDefault?-1:1:s.name.localeCompare(S.name)),B(le),G(!1)}).catch(j=>{if(e)return;const U=j instanceof Error?j.message:String(j);_(U),B([]),G(!1)}),()=>{e=!0}},[a.table]);const F=e=>y(i=>{const m=new Set(i.dirty);return m.add(e),{...i,dirty:m}}),w=(e,i,m)=>{y(b=>({...b,[e]:i})),m&&F(m)},ke=e=>{y(i=>({...i,table:e,queryId:null})),F("target"),I(void 0),R(null)},we=async()=>{ae(!0);const e=await qt.predefined(a);te(e),ae(!1),v("results"),je(i=>[{id:`r-${Date.now()}`,snapshot:q,modeId:"predefined-query",url:Q.relativeUrl,method:"GET",ts:Date.now(),status:e.status,ms:e.ms,rowCount:Ct(e.body)??0},...i].slice(0,8)),y(i=>({...i,dirty:new Set}))},Te=a.table?a.queryId?a.related&&!(a.related.navProperty&&a.related.recordId)?"Pick the relationship and the row whose related records to query.":null:"Pick a saved query or user view.":"Pick a table first.",q=c.useMemo(()=>Ye(a),[a]);Je("predefined-query",q,z,M);const Ne=c.useMemo(()=>Y(q),[q]),ne=M===null?!0:Ne!==M,qe=e=>{I(e.id),R(Y(e.state))},se=e=>{if(e.modeId!=="predefined-query")return;const i=e.state;if(g.length>0&&!g.some(m=>m.logicalName===i.table)){Nt(`Can't load "${e.name}": entity \`${i.table}\` isn't available in this environment. The solution may have been removed or you may be connected to a different org.`);return}y(ie(i)),I(e.id),R(Y(i)),te(null),l("target")},Ce=e=>{const i=Ft(e,"predefined-query");if(!i)return;const m=z,b=M;se(i),I(m),R(b)};Ke(c.useMemo(()=>a.table?{state:q,modeId:"predefined-query",dirty:ne,lastSavedId:z,onSaved:qe,onLoadSaved:se}:null,[q,ne,z,a.table]));const Fe=[{id:"target",label:"Target",meta:V?.displayName,items:[{id:"target",icon:et,iconFilled:Ze,label:d?.name??(a.table?"Pick a query":"Pick a table"),badge:d?.kind==="savedQuery"?"system":d?.kind==="userQuery"?"user":null,badgeAppearance:"ghost",dirty:a.dirty.has("target")}]},{id:"conditions",label:"Conditions",items:[{id:"conditions",icon:tt,iconFilled:oe,label:"Filter (read-only)",badge:d?"inherited":null,badgeAppearance:"ghost"}]},{id:"top",label:"Top",items:[{id:"top",icon:rt,iconFilled:at,label:"$top",code:!0,badge:a.top?a.top.toString():"default",badgeAppearance:"ghost",dirty:a.dirty.has("top")}]},{id:"prefer",label:"Prefer",items:[{id:"prefer",icon:st,iconFilled:nt,label:"Prefer header",badge:de(a.prefer)?"on":null,badgeAppearance:"ghost",dirty:a.dirty.has("prefer")}]},{id:"headers",label:"Headers",meta:`${a.headers.filter(e=>e.enabled).length} active`,items:[{id:"headers",icon:it,iconFilled:lt,label:"HTTP headers",badge:a.headers.filter(e=>e.enabled).length||null,dirty:a.dirty.has("headers")}]}];let C;switch(x){case"target":C=t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsx(mt,{table:a.table,onTableChange:e=>{ke(e),a.related&&w("related",he)},group:"read",sub:"Pick the table whose saved queries (system views) or user queries (personal views) you want to execute."}),a.table&&t.jsxs("div",{style:{maxWidth:640,display:"flex",flexDirection:"column",gap:14},children:[t.jsx(X,{label:"Run against",hint:a.related?"The query runs over one row’s related records: /<set>(<id>)/<nav>?savedQuery=…":"The query runs over the whole table: /<set>?savedQuery=…",children:t.jsxs(yt,{ariaLabel:"Run the query against",children:[t.jsx(me,{checked:!a.related,onClick:()=>{a.related&&w("related",null,"target")},children:"Table"}),t.jsx(me,{checked:!!a.related,onClick:()=>{a.related||w("related",he,"target")},children:"Related records of a row"})]})}),a.related&&V&&t.jsx(Bt,{table:V,value:a.related,onChange:e=>w("related",e,"target")}),t.jsx(X,{label:"View",hint:N.length>0?`${E.length} system · ${D.length} personal`:void 0,children:t.jsxs(ht,{freeform:!0,clearable:!0,value:k,selectedOptions:a.queryId?[a.queryId]:[],placeholder:W?"Loading queries…":N.length===0?"No queries on this table":"Search views by name…",disabled:W,onChange:e=>{const i=e.target.value;L(i),i===""&&a.queryId&&(y(m=>({...m,queryId:null})),F("target"))},onOptionSelect:(e,i)=>{if(!i.optionValue){y(b=>({...b,queryId:null})),L(""),F("target");return}const m=N.find(b=>b.id===i.optionValue);m&&(y(b=>({...b,queryId:m.id,queryType:m.kind})),L(m.name),F("target"))},listbox:{style:{maxHeight:420}},children:[H.length===0&&O.length===0&&k.trim()&&t.jsx(A,{value:"__none",text:"",disabled:!0,children:t.jsxs(f,{style:{color:p.colorNeutralForeground3},children:['No views match "',k.trim(),'"']})}),H.length>0&&t.jsx(ee,{label:`System views (${H.length})`,children:H.map(e=>t.jsx(A,{value:e.id,text:e.name,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t.jsx(J,{style:{fontWeight:e.isDefault?600:400},children:e.name}),e.description&&t.jsx(f,{style:{color:p.colorNeutralForeground3},children:e.description})]})},e.id))}),O.length>0&&t.jsx(ee,{label:`Personal views (${O.length})`,children:O.map(e=>t.jsx(A,{value:e.id,text:e.name,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[t.jsx(J,{children:e.name}),e.description&&t.jsx(f,{style:{color:p.colorNeutralForeground3},children:e.description})]})},e.id))})]})}),W&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:p.colorNeutralForeground3},children:[t.jsx(be,{size:"tiny"}),t.jsx(f,{children:"Fetching saved + user queries…"})]}),re&&t.jsx(ce,{intent:"error",layout:"multiline",children:t.jsxs(ue,{children:[t.jsx(pe,{children:"Couldn't load queries"}),re]})}),d&&t.jsxs("div",{className:K(u.inlineCard),style:{padding:14,display:"flex",flexDirection:"column",gap:10},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[t.jsx(J,{style:{fontWeight:600},children:d.name}),t.jsx(P,{appearance:"ghost",size:"small",children:Qt(d.queryType)}),d.isDefault&&t.jsx(P,{appearance:"tint",color:"brand",size:"small",children:"default view"}),d.isQuickFind&&t.jsx(P,{appearance:"tint",color:"informative",size:"small",children:"quick find"}),d.kind==="savedQuery"&&d.isManaged&&t.jsx(P,{appearance:"ghost",size:"small",children:"managed"}),d.kind==="savedQuery"&&!d.isManaged&&t.jsx(P,{appearance:"ghost",size:"small",children:"unmanaged"})]}),t.jsxs("div",{children:[t.jsx(f,{style:{fontWeight:600,color:p.colorNeutralForeground2},children:"Query GUID"}),t.jsx("div",{children:t.jsx("code",{style:{fontFamily:p.fontFamilyMonospace,fontSize:11,color:p.colorNeutralForeground2},children:d.id})})]}),d.layoutColumns.length>0&&t.jsxs("div",{children:[t.jsxs(f,{style:{fontWeight:600,color:p.colorNeutralForeground2},children:["Result columns (",d.layoutColumns.length,") — from layoutxml"]}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:d.layoutColumns.map(e=>t.jsx(ft,{relationship:"label",content:e.isLink?`${e.fullName} — joined column via link alias \`${e.linkAlias}\` · width ${e.width}px`:`${e.fullName} — width ${e.width}px`,children:t.jsx("span",{style:{fontFamily:p.fontFamilyMonospace,fontSize:11,padding:"2px 6px",borderRadius:4,background:e.isLink?p.colorPaletteBlueBackground2:p.colorNeutralBackground3,color:e.isLink?p.colorPaletteBlueForeground2:p.colorNeutralForeground1,cursor:"help"},children:e.isLink?`${e.linkAlias}.${e.attr}`:e.attr})},e.fullName))}),d.layoutColumns.some(e=>e.isLink)&&t.jsx(f,{style:{display:"block",marginTop:6,color:p.colorNeutralForeground3},children:"Blue pills are joined columns (link-entity in FetchXml)."})]})]})]})]});break;case"conditions":C=t.jsxs("div",{children:[t.jsx(ut,{icon:oe,title:"Conditions",sub:"Read-only summary — predefined queries embed their own FetchXml. Edit the saved query in the model-driven app to change conditions."}),t.jsx(ce,{layout:"multiline",intent:"warning",style:{marginBottom:12},children:t.jsxs(ue,{children:[t.jsx(pe,{children:"$select / $filter / $orderby / $expand are locked"}),"With ",t.jsx("code",{children:"?savedQuery=…"})," / ",t.jsx("code",{children:"?userQuery=…"}),", the FetchXml in the query owns column projection, filter, sort and joins. Only ",t.jsx("code",{children:"$top"})," and"," ",t.jsx("code",{children:"Prefer"})," headers remain editable."]})}),d?.fetchXml?t.jsx("div",{style:{border:`1px solid ${p.colorNeutralStroke2}`,borderRadius:p.borderRadiusMedium,overflow:"hidden",height:480},children:t.jsx(pt,{height:"100%",language:"xml",value:d.fetchXml,theme:n==="dark"?"vs-dark":"light",options:{readOnly:!0,domReadOnly:!0,lineNumbers:"on",renderLineHighlight:"line",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontFamily:"Cascadia Mono, Consolas, monospace",fontSize:13,tabSize:2,wordWrap:"on",automaticLayout:!0,padding:{top:12,bottom:12},bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},smoothScrolling:!0}})}):d?t.jsx(f,{style:{color:p.colorNeutralForeground3},children:"(No FetchXml available for this query — it may be a layout-only definition.)"}):t.jsx(f,{style:{color:p.colorNeutralForeground3},children:"Pick a query in Target to see its FetchXml."})]});break;case"top":C=t.jsx(ct,{top:a.top,setTop:e=>w("top",e,"top"),maxPageSize:a.prefer.maxpagesize});break;case"prefer":C=t.jsx(dt,{spec:a.prefer,setSpec:e=>w("prefer",e,"prefer")});break;case"headers":C=t.jsx(ot,{items:a.headers,setItems:e=>w("headers",e,"headers")});break}const Pe=bt(a.headers,de(a.prefer)),$e={method:"GET",built:Q,headers:Pe};return t.jsx(gt,{sidebar:t.jsx(kt,{type:r,urlPreview:Q.relativeNoBase,sections:Fe,activeNode:x,onSelect:e=>{l(e),v("builder")},recents:ve,onRecentClick:Ce}),urlBar:t.jsx(St,{method:"GET",url:Q.relativeUrl,executeVerb:r.executeVerb,disabledReason:Te,loading:xe,onExecute:we}),children:t.jsxs(xt,{tab:T,onTabChange:v,resultCount:$?.body?.value?.length??null,children:[T==="builder"&&C,T==="code"&&t.jsx(vt,{themeMode:n,inputs:$e}),T==="results"&&t.jsx(jt,{result:$,mode:"multi",table:a.table,preferredColumnOrder:d?.layoutColumns.map(e=>e.fullName)})]})})}export{Dt as PredefinedQueryMode};
@@ -1 +0,0 @@
1
- import{c as A,aG as G,r as o,aH as q,aI as R,ax as O,aJ as V,aK as W,L as _,p as J,aL as L,q as e,H as K,aM as Q,a8 as X,A as S,B as w,I as T,aC as k,N as j,aN as Y,aO as Z,a4 as ee,ac as te,X as i,Y as ae,aP as se,W as re,x as ne,y as oe,z as ie,D as le,R as de,U as ce,S as ue,aQ as he,aR as pe,aS as xe,aT as me}from"./index-C4fO68cu.js";const ye=()=>({url:"",prefer:{...pe(),maxpagesize:50},headers:he(),dirty:new Set});function ge(y,l){const d={ok:!1,url:null,host:"",path:"",entitySet:null,skiptoken:null,params:[],errors:[]};if(!y.trim())return d;let t;try{t=new URL(y)}catch{return{...d,errors:["Not a valid URL — paste the full https://… string."]}}const n=[];t.protocol!=="https:"&&n.push("Must be https:// — Dataverse rejects plain HTTP.");const c=t.pathname.match(/^\/api\/data\/v\d+\.\d+\/([^/?]+)/);c||n.push("Path doesn't look like a Dataverse Web API URL (expected /api/data/v<x>.<x>/<entityset>)."),l&&t.host&&t.host.toLowerCase()!==l.toLowerCase()&&n.push(`URL host (${t.host}) doesn't match the connected environment (${l}). Switch connections or paste a URL from the current org.`);const h=[];t.searchParams.forEach((p,g)=>h.push({key:g,value:p}));const u=t.searchParams.get("$skiptoken");return{ok:n.length===0,url:t,host:t.host,path:t.pathname,entitySet:c?c[1]:null,skiptoken:u,params:h,errors:n}}function fe({themeMode:y}){const l=A("retrieve-nextlink"),d=G(),[t,n]=o.useState(ye),[c,h]=o.useState("url"),[u,p]=o.useState("builder"),[g,C]=o.useState(null),[P,v]=o.useState(!1),[N,U]=o.useState([]),f=o.useMemo(()=>q(t),[t]),r=o.useMemo(()=>ge(t.url,d.host),[t.url,d.host]),F=a=>n(s=>{const m=new Set(s.dirty);return m.add(a),{...s,dirty:m}}),x=(a,s,m)=>{n(I=>({...I,[a]:s})),m&&F(m)},M=o.useMemo(()=>r.errors.map((a,s)=>({id:`nl-err-${s}`,severity:"error",source:"validation",focusNode:"url",title:"Invalid next-link URL",body:a})),[r]),B=async()=>{if(!r.ok)return;v(!0);const a=await xe.nextLink(t);C(a),v(!1),p("results"),U(s=>[{id:`r-${Date.now()}`,modeId:"retrieve-nextlink",url:t.url,method:"GET",ts:Date.now(),status:a.status,ms:a.ms,rowCount:me(a.body)??0},...s].slice(0,8)),n(s=>({...s,dirty:new Set}))},$=t.url.trim()?r.ok?null:r.errors[0]??"URL is not safe to follow.":"Paste an @odata.nextLink URL first.",E=async()=>{try{const a=await navigator.clipboard?.readText();a&&x("url",a.trim(),"url")}catch{}},z=[{id:"url",label:"Target",meta:"Server-issued",items:[{id:"url",icon:O,iconFilled:R,label:"@odata.nextLink",badge:r.entitySet??(t.url?"invalid":"empty"),badgeAppearance:"ghost",badgeColor:r.errors.length?"danger":r.entitySet?"informative":"subtle",dirty:t.dirty.has("url")}]},{id:"prefer",label:"Prefer",items:[{id:"prefer",icon:W,iconFilled:V,label:"Prefer header",badge:L(t.prefer)?"on":null,badgeAppearance:"ghost",dirty:t.dirty.has("prefer")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(a=>a.enabled).length} active`,items:[{id:"headers",icon:J,iconFilled:_,label:"HTTP headers",badge:t.headers.filter(a=>a.enabled).length||null,dirty:t.dirty.has("headers")}]}];let b;switch(c){case"url":b=e.jsxs("div",{children:[e.jsx(X,{icon:R,title:"Next-link URL",sub:"Paste the @odata.nextLink returned by the previous page. The URL is opaque — clauses are not editable here."}),e.jsx(S,{layout:"multiline",intent:"info",style:{marginBottom:12},children:e.jsxs(w,{children:[e.jsx(T,{children:"Why no clause editor?"}),"The next page must use the ",e.jsx("strong",{children:"same shape"})," as the original query. Dataverse encodes paging state in a ",e.jsx("code",{children:"$skiptoken"})," cookie — editing any other clause invalidates the cursor."]})}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:8},children:[e.jsx(k,{content:"Paste from clipboard",relationship:"label",children:e.jsx(j,{icon:e.jsx(Y,{}),appearance:"outline",size:"small",onClick:E,children:"Paste"})}),e.jsx(k,{content:"Clear the URL field",relationship:"label",children:e.jsx(j,{icon:e.jsx(Z,{}),appearance:"subtle",size:"small",disabled:!t.url,onClick:()=>x("url","","url"),children:"Clear"})})]}),e.jsx(ee,{label:"@odata.nextLink",hint:"The full URL including https://. Skiptoken cookies are URL-encoded inside.",children:e.jsx(te,{rows:6,value:t.url,onChange:(a,s)=>x("url",s.value,"url"),placeholder:`https://${d.host}/api/data/v9.2/<entityset>?$select=…&$skiptoken=…`,style:{fontFamily:i.fontFamilyMonospace,fontSize:11}})}),r.errors.map((a,s)=>e.jsx(S,{intent:"error",layout:"multiline",style:{marginTop:12},children:e.jsxs(w,{children:[e.jsx(T,{children:"Can't follow this URL"}),a]})},s)),r.url&&r.ok&&e.jsxs("div",{style:{marginTop:16,padding:12,border:`1px solid ${i.colorNeutralStroke2}`,borderRadius:i.borderRadiusMedium,background:i.colorNeutralBackground1},children:[e.jsx(ae,{style:{display:"block",fontWeight:600,marginBottom:8,color:i.colorNeutralForeground2},children:"Parsed (read-only)"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",rowGap:4,columnGap:12,fontFamily:i.fontFamilyMonospace,fontSize:11},children:[e.jsx("span",{style:{color:i.colorNeutralForeground3},children:"host"}),e.jsx("span",{children:r.host}),e.jsx("span",{style:{color:i.colorNeutralForeground3},children:"entityset"}),e.jsx("span",{children:r.entitySet??"—"}),r.params.map((a,s)=>e.jsxs("span",{style:{display:"contents"},children:[e.jsx("span",{style:{color:i.colorBrandForeground1},children:a.key}),e.jsx("span",{style:{wordBreak:"break-all"},children:se(a.value)})]},s))]})]}),r.ok&&e.jsx("div",{style:{marginTop:16},children:e.jsx(k,{content:"Open the parsed URL in a new tab (auth will be required)",relationship:"description",children:e.jsx(j,{icon:e.jsx(re,{}),appearance:"outline",onClick:()=>window.open(t.url,"_blank","noopener"),children:"Open in new tab"})})})]});break;case"prefer":b=e.jsx(Q,{spec:t.prefer,setSpec:a=>x("prefer",a,"prefer")});break;case"headers":b=e.jsx(K,{items:t.headers,setItems:a=>x("headers",a,"headers")});break}const D=ne(t.headers,L(t.prefer)),H={method:"GET",built:f,headers:D,isNextLink:!0,rawNextLink:t.url};return e.jsx(oe,{sidebar:e.jsx(ue,{type:l,urlPreview:f.relativeNoBase,sections:z,activeNode:c,onSelect:a=>{h(a),p("builder")},recents:N}),urlBar:e.jsx(ce,{method:"GET",url:f.relativeUrl,executeVerb:l.executeVerb,disabledReason:$,loading:P,onExecute:B,advisories:M,onAdvisoryFocus:a=>h(a)}),children:e.jsxs(ie,{tab:u,onTabChange:p,resultCount:g?.body?.value?.length??null,children:[u==="builder"&&b,u==="code"&&e.jsx(le,{themeMode:y,inputs:H}),u==="results"&&e.jsx(de,{result:g,mode:"next"})]})})}export{fe as RetrieveNextLinkMode};