@mohsinonxrm/pptb-dataverse-request-studio 1.4.0-beta.2 → 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.
- package/CHANGELOG.md +61 -0
- package/dist/assets/AssociateMode-Bs_R9XbQ.js +1 -0
- package/dist/assets/AssociateTargetsEditor-CVWE3tbv.js +1 -0
- package/dist/assets/{BatchMode-CHTXXyh5.js → BatchMode-XGXMc2XF.js} +9 -9
- package/dist/assets/{BinaryColumnPickers-xRDRVLGn.js → BinaryColumnPickers-mrnLqk3Z.js} +1 -1
- package/dist/assets/{BulkDeleteMode-8wZ9ILFr.js → BulkDeleteMode-DowWcbnA.js} +1 -1
- package/dist/assets/BulkWriteMode-Dt3M0dGV.js +6 -0
- package/dist/assets/DisassociateMode-qIc2CUpE.js +2 -0
- package/dist/assets/ExecuteWorkflowMode-Ce6sKYci.js +1 -0
- package/dist/assets/{ManageFileMode-BWGAVS0m.js → ManageFileMode-CcNSQkJf.js} +1 -1
- package/dist/assets/{ManageImageMode-BrOtm2A4.js → ManageImageMode-Dn4P4D6H.js} +1 -1
- package/dist/assets/{MergeMode-dDHs2-no.js → MergeMode-DzPQq2Ao.js} +1 -1
- package/dist/assets/{PredefinedQueryMode-B4zzRppz.js → PredefinedQueryMode-CaQqp2lm.js} +1 -1
- package/dist/assets/{RetrieveNextLinkMode-bLLnlOMS.js → RetrieveNextLinkMode-BNbknSwe.js} +1 -1
- package/dist/assets/{cssMode-DL5lLcAs.js → cssMode-B4BP9f3X.js} +1 -1
- package/dist/assets/{freemarker2-BCOyezro.js → freemarker2-DFKOu_2v.js} +1 -1
- package/dist/assets/{handlebars-OAtZzz2T.js → handlebars-cWHtgvCj.js} +1 -1
- package/dist/assets/{html-DEDOENUr.js → html-DSPQITYl.js} +1 -1
- package/dist/assets/{htmlMode-CbTgJqB3.js → htmlMode-Cr-uAXsT.js} +1 -1
- package/dist/assets/{index-DGsVifiB.js → index-D0g0tm7R.js} +66 -66
- package/dist/assets/{javascript-CZCBdW2I.js → javascript-B3oRul8j.js} +1 -1
- package/dist/assets/{jsonMode-DlcExoVE.js → jsonMode-_zXsQ367.js} +1 -1
- package/dist/assets/{liquid-DqAKLfE-.js → liquid-Cib5dNaW.js} +1 -1
- package/dist/assets/{mdx-NkZXeCnk.js → mdx-8A_8JwPK.js} +1 -1
- package/dist/assets/{monacoSetup-BIbZ_vQb.js → monacoSetup-DObeMDBe.js} +3 -3
- package/dist/assets/{python-DewoE6OC.js → python-DsudPCj1.js} +1 -1
- package/dist/assets/{razor-41Lf02tV.js → razor-CrmV2uj7.js} +1 -1
- package/dist/assets/{tsMode-DRTJQ7Fk.js → tsMode-BnycW89y.js} +1 -1
- package/dist/assets/{typescript-C7yUoo-S.js → typescript-Bs6iTDav.js} +1 -1
- package/dist/assets/{xml-D8F8OJXA.js → xml-DuKZPRNV.js} +1 -1
- package/dist/assets/{yaml-DGFY75wt.js → yaml-DDDa6myK.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AssociateMode-d9KnV2ms.js +0 -1
- package/dist/assets/AssociateTargetsEditor-CuQhdosb.js +0 -1
- package/dist/assets/BulkWriteMode-Rw-BEdWo.js +0 -6
- package/dist/assets/DisassociateMode-CKUtzpgc.js +0 -2
- package/dist/assets/ExecuteWorkflowMode-lUjZeNYk.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as o}from"./monacoSetup-
|
|
1
|
+
import{m as o}from"./monacoSetup-DObeMDBe.js";import"./index-D0g0tm7R.js";var a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,g=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!c.call(t,r)&&r!==n&&a(t,r,{get:()=>e[r],enumerable:!(s=l(e,r))||s.enumerable});return t},d=(t,e,n)=>(g(t,e,"default"),n),i={};d(i,o);var f={comments:{lineComment:"#",blockComment:["'''","'''"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp("^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async|match|case).*?:\\s*$"),action:{indentAction:i.languages.IndentAction.Indent}}],folding:{offSide:!0,markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},b={defaultToken:"",tokenPostfix:".python",keywords:["False","None","True","_","and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","match","nonlocal","not","or","pass","print","raise","return","try","type","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","self","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],tokenizer:{root:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},[/[,:;]/,"delimiter"],[/[{}\[\]()]/,"@brackets"],[/@[a-zA-Z_]\w*/,"tag"],[/[a-zA-Z_]\w*/,{cases:{"@keywords":"keyword","@default":"identifier"}}]],whitespace:[[/\s+/,"white"],[/(^#.*$)/,"comment"],[/'''/,"string","@endDocString"],[/"""/,"string","@endDblDocString"]],endDocString:[[/[^']+/,"string"],[/\\'/,"string"],[/'''/,"string","@popall"],[/'/,"string"]],endDblDocString:[[/[^"]+/,"string"],[/\\"/,"string"],[/"""/,"string","@popall"],[/"/,"string"]],numbers:[[/-?0x([abcdef]|[ABCDEF]|\d)+[lL]?/,"number.hex"],[/-?(\d*\.)?\d+([eE][+\-]?\d+)?[jJ]?[lL]?/,"number"]],strings:[[/'$/,"string.escape","@popall"],[/f'{1,3}/,"string.escape","@fStringBody"],[/'/,"string.escape","@stringBody"],[/"$/,"string.escape","@popall"],[/f"{1,3}/,"string.escape","@fDblStringBody"],[/"/,"string.escape","@dblStringBody"]],fStringBody:[[/[^\\'\{\}]+$/,"string","@popall"],[/[^\\'\{\}]+/,"string"],[/\{[^\}':!=]+/,"identifier","@fStringDetail"],[/\\./,"string"],[/'/,"string.escape","@popall"],[/\\$/,"string"]],stringBody:[[/[^\\']+$/,"string","@popall"],[/[^\\']+/,"string"],[/\\./,"string"],[/'/,"string.escape","@popall"],[/\\$/,"string"]],fDblStringBody:[[/[^\\"\{\}]+$/,"string","@popall"],[/[^\\"\{\}]+/,"string"],[/\{[^\}':!=]+/,"identifier","@fStringDetail"],[/\\./,"string"],[/"/,"string.escape","@popall"],[/\\$/,"string"]],dblStringBody:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string"],[/"/,"string.escape","@popall"],[/\\$/,"string"]],fStringDetail:[[/[:][^}]+/,"string"],[/[!][ars]/,"string"],[/=/,"string"],[/\}/,"identifier","@pop"]]}};export{f as conf,b as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m}from"./monacoSetup-
|
|
1
|
+
import{m}from"./monacoSetup-DObeMDBe.js";import"./index-D0g0tm7R.js";var s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,p=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!d.call(t,r)&&r!==o&&s(t,r,{get:()=>e[r],enumerable:!(n=c(e,r))||n.enumerable});return t},h=(t,e,o)=>(p(t,e,"default"),o),a={};h(a,m);var i=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],y={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["<!--","-->"]},brackets:[["<!--","-->"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${i.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:a.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${i.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:a.languages.IndentAction.Indent}}]},k={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/@@@@/],[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@comment"],[/(<)([\w\-]+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)([\w\-]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/[ \t\r\n]+/],[/[^<@]+/]],doctype:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/@[^@]/,{token:"@rematch",switchTo:"@razorInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],razorInSimpleState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3"}]],razorInEmbeddedState:[[/@\*/,"comment.cs","@razorBlockCommentTopLevel"],[/@[{(]/,"metatag.cs","@razorRootTopLevel"],[/(@)(\s*[\w]+)/,["metatag.cs",{token:"identifier.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],[/[})]/,{token:"metatag.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],[/\*@/,{token:"comment.cs",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}]],razorBlockCommentTopLevel:[[/\*@/,"@rematch","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorBlockComment:[[/\*@/,"comment.cs","@pop"],[/[^*]+/,"comment.cs"],[/./,"comment.cs"]],razorRootTopLevel:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/[})]/,"@rematch","@pop"],{include:"razorCommon"}],razorRoot:[[/\{/,"delimiter.bracket.cs","@razorRoot"],[/\(/,"delimiter.parenthesis.cs","@razorRoot"],[/\}/,"delimiter.bracket.cs","@pop"],[/\)/,"delimiter.parenthesis.cs","@pop"],{include:"razorCommon"}],razorCommon:[[/[a-zA-Z_]\w*/,{cases:{"@razorKeywords":{token:"keyword.cs"},"@default":"identifier.cs"}}],[/[\[\]]/,"delimiter.array.cs"],[/[ \t\r\n]+/],[/\/\/.*$/,"comment.cs"],[/@\*/,"comment.cs","@razorBlockComment"],[/"([^"]*)"/,"string.cs"],[/'([^']*)'/,"string.cs"],[/(<)([\w\-]+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)([\w\-]+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<\/)([\w\-]+)(>)/,["delimiter.html","tag.html","delimiter.html"]],[/[\+\-\*\%\&\|\^\~\!\=\<\>\/\?\;\:\.\,]/,"delimiter.cs"],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float.cs"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float.cs"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex.cs"],[/0[0-7']*[0-7]/,"number.octal.cs"],[/0[bB][0-1']*[0-1]/,"number.binary.cs"],[/\d[\d']*/,"number.cs"],[/\d/,"number.cs"]]},razorKeywords:["abstract","as","async","await","base","bool","break","by","byte","case","catch","char","checked","class","const","continue","decimal","default","delegate","do","double","descending","explicit","event","extern","else","enum","false","finally","fixed","float","for","foreach","from","goto","group","if","implicit","in","int","interface","internal","into","is","lock","long","nameof","new","null","namespace","object","operator","out","override","orderby","params","private","protected","public","readonly","ref","return","switch","struct","sbyte","sealed","short","sizeof","stackalloc","static","string","select","this","throw","true","try","typeof","uint","ulong","unchecked","unsafe","ushort","using","var","virtual","volatile","void","when","while","where","yield","model","inject"],escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/};export{y as conf,k as language};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as I,m as M}from"./monacoSetup-
|
|
1
|
+
import{t as I,m as M}from"./monacoSetup-DObeMDBe.js";import"./index-D0g0tm7R.js";var N=Object.defineProperty,R=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,K=Object.prototype.hasOwnProperty,H=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of E(t))!K.call(e,n)&&n!==r&&N(e,n,{get:()=>t[n],enumerable:!(a=R(t,n))||a.enumerable});return e},W=(e,t,r)=>(H(e,t,"default"),r),o={};W(o,M);function j(e,t){const r=globalThis.MonacoEnvironment;if(r?.createTrustedTypesPolicy)try{return r.createTrustedTypesPolicy(e,t)}catch(a){console.error(a);return}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(a){console.error(a);return}}var D;typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope"&&globalThis.workerttPolicy!==void 0?D=globalThis.workerttPolicy:D=j("defaultWorkerFactory",{createScriptURL:e=>e});function V(e){const t=e.label,r=globalThis.MonacoEnvironment;if(r){if(typeof r.getWorker=="function")return r.getWorker("workerMain.js",t);if(typeof r.getWorkerUrl=="function"){const a=r.getWorkerUrl("workerMain.js",t);return new Worker(D?D.createScriptURL(a):a,{name:t,type:"module"})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function U(e){const t=Promise.resolve(V({label:e.label??"monaco-editor-worker"})).then(r=>(r.postMessage("ignore"),r.postMessage(e.createData),r));return o.editor.createWebWorker({worker:t,host:e.host,keepIdleModels:e.keepIdleModels})}var B=class{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;const e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||(this._client=(async()=>(this._worker=U({label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(o.editor.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))()),this._client}async getLanguageServiceWorker(...e){const t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}},i={};i["lib.d.ts"]=!0;i["lib.decorators.d.ts"]=!0;i["lib.decorators.legacy.d.ts"]=!0;i["lib.dom.asynciterable.d.ts"]=!0;i["lib.dom.d.ts"]=!0;i["lib.dom.iterable.d.ts"]=!0;i["lib.es2015.collection.d.ts"]=!0;i["lib.es2015.core.d.ts"]=!0;i["lib.es2015.d.ts"]=!0;i["lib.es2015.generator.d.ts"]=!0;i["lib.es2015.iterable.d.ts"]=!0;i["lib.es2015.promise.d.ts"]=!0;i["lib.es2015.proxy.d.ts"]=!0;i["lib.es2015.reflect.d.ts"]=!0;i["lib.es2015.symbol.d.ts"]=!0;i["lib.es2015.symbol.wellknown.d.ts"]=!0;i["lib.es2016.array.include.d.ts"]=!0;i["lib.es2016.d.ts"]=!0;i["lib.es2016.full.d.ts"]=!0;i["lib.es2016.intl.d.ts"]=!0;i["lib.es2017.d.ts"]=!0;i["lib.es2017.date.d.ts"]=!0;i["lib.es2017.full.d.ts"]=!0;i["lib.es2017.intl.d.ts"]=!0;i["lib.es2017.object.d.ts"]=!0;i["lib.es2017.sharedmemory.d.ts"]=!0;i["lib.es2017.string.d.ts"]=!0;i["lib.es2017.typedarrays.d.ts"]=!0;i["lib.es2018.asyncgenerator.d.ts"]=!0;i["lib.es2018.asynciterable.d.ts"]=!0;i["lib.es2018.d.ts"]=!0;i["lib.es2018.full.d.ts"]=!0;i["lib.es2018.intl.d.ts"]=!0;i["lib.es2018.promise.d.ts"]=!0;i["lib.es2018.regexp.d.ts"]=!0;i["lib.es2019.array.d.ts"]=!0;i["lib.es2019.d.ts"]=!0;i["lib.es2019.full.d.ts"]=!0;i["lib.es2019.intl.d.ts"]=!0;i["lib.es2019.object.d.ts"]=!0;i["lib.es2019.string.d.ts"]=!0;i["lib.es2019.symbol.d.ts"]=!0;i["lib.es2020.bigint.d.ts"]=!0;i["lib.es2020.d.ts"]=!0;i["lib.es2020.date.d.ts"]=!0;i["lib.es2020.full.d.ts"]=!0;i["lib.es2020.intl.d.ts"]=!0;i["lib.es2020.number.d.ts"]=!0;i["lib.es2020.promise.d.ts"]=!0;i["lib.es2020.sharedmemory.d.ts"]=!0;i["lib.es2020.string.d.ts"]=!0;i["lib.es2020.symbol.wellknown.d.ts"]=!0;i["lib.es2021.d.ts"]=!0;i["lib.es2021.full.d.ts"]=!0;i["lib.es2021.intl.d.ts"]=!0;i["lib.es2021.promise.d.ts"]=!0;i["lib.es2021.string.d.ts"]=!0;i["lib.es2021.weakref.d.ts"]=!0;i["lib.es2022.array.d.ts"]=!0;i["lib.es2022.d.ts"]=!0;i["lib.es2022.error.d.ts"]=!0;i["lib.es2022.full.d.ts"]=!0;i["lib.es2022.intl.d.ts"]=!0;i["lib.es2022.object.d.ts"]=!0;i["lib.es2022.regexp.d.ts"]=!0;i["lib.es2022.sharedmemory.d.ts"]=!0;i["lib.es2022.string.d.ts"]=!0;i["lib.es2023.array.d.ts"]=!0;i["lib.es2023.collection.d.ts"]=!0;i["lib.es2023.d.ts"]=!0;i["lib.es2023.full.d.ts"]=!0;i["lib.es5.d.ts"]=!0;i["lib.es6.d.ts"]=!0;i["lib.esnext.collection.d.ts"]=!0;i["lib.esnext.d.ts"]=!0;i["lib.esnext.decorators.d.ts"]=!0;i["lib.esnext.disposable.d.ts"]=!0;i["lib.esnext.full.d.ts"]=!0;i["lib.esnext.intl.d.ts"]=!0;i["lib.esnext.object.d.ts"]=!0;i["lib.esnext.promise.d.ts"]=!0;i["lib.scripthost.d.ts"]=!0;i["lib.webworker.asynciterable.d.ts"]=!0;i["lib.webworker.d.ts"]=!0;i["lib.webworker.importscripts.d.ts"]=!0;i["lib.webworker.iterable.d.ts"]=!0;function T(e,t,r=0){if(typeof e=="string")return e;if(e===void 0)return"";let a="";if(r){a+=t;for(let n=0;n<r;n++)a+=" "}if(a+=e.messageText,r++,e.next)for(const n of e.next)a+=T(n,t,r);return a}function w(e){return e?e.map(t=>t.text).join(""):""}var y=class{constructor(e){this._worker=e}_textSpanToRange(e,t){let r=e.getPositionAt(t.start),a=e.getPositionAt(t.start+t.length),{lineNumber:n,column:l}=r,{lineNumber:u,column:s}=a;return{startLineNumber:n,startColumn:l,endLineNumber:u,endColumn:s}}},$=class{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e&&e.path.indexOf("/lib.")===0?!!i[e.path.slice(1)]:!1}getOrCreateModel(e){const t=o.Uri.parse(e),r=o.editor.getModel(t);if(r)return r;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return o.editor.createModel(this._libFiles[t.path.slice(1)],"typescript",t);const a=I.getExtraLibs()[e];return a?o.editor.createModel(a.content,"typescript",t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||(this._fetchLibFilesPromise=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e})),this._fetchLibFilesPromise}},z=class extends y{constructor(e,t,r,a){super(a),this._libFiles=e,this._defaults=t,this._selector=r,this._disposables=[],this._listener=Object.create(null);const n=s=>{if(s.getLanguageId()!==r)return;const c=()=>{const{onlyVisible:h}=this._defaults.getDiagnosticsOptions();h?s.isAttachedToEditor()&&this._doValidate(s):this._doValidate(s)};let g;const d=s.onDidChangeContent(()=>{clearTimeout(g),g=window.setTimeout(c,500)}),b=s.onDidChangeAttached(()=>{const{onlyVisible:h}=this._defaults.getDiagnosticsOptions();h&&(s.isAttachedToEditor()?c():o.editor.setModelMarkers(s,this._selector,[]))});this._listener[s.uri.toString()]={dispose(){d.dispose(),b.dispose(),clearTimeout(g)}},c()},l=s=>{o.editor.setModelMarkers(s,this._selector,[]);const c=s.uri.toString();this._listener[c]&&(this._listener[c].dispose(),delete this._listener[c])};this._disposables.push(o.editor.onDidCreateModel(s=>n(s))),this._disposables.push(o.editor.onWillDisposeModel(l)),this._disposables.push(o.editor.onDidChangeModelLanguage(s=>{l(s.model),n(s.model)})),this._disposables.push({dispose(){for(const s of o.editor.getModels())l(s)}});const u=()=>{for(const s of o.editor.getModels())l(s),n(s)};this._disposables.push(this._defaults.onDidChange(u)),this._disposables.push(this._defaults.onDidExtraLibsChange(u)),o.editor.getModels().forEach(s=>n(s))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){const t=await this._worker(e.uri);if(e.isDisposed())return;const r=[],{noSyntaxValidation:a,noSemanticValidation:n,noSuggestionDiagnostics:l}=this._defaults.getDiagnosticsOptions();a||r.push(t.getSyntacticDiagnostics(e.uri.toString())),n||r.push(t.getSemanticDiagnostics(e.uri.toString())),l||r.push(t.getSuggestionDiagnostics(e.uri.toString()));const u=await Promise.all(r);if(!u||e.isDisposed())return;const s=u.reduce((g,d)=>d.concat(g),[]).filter(g=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(g.code)===-1),c=s.map(g=>g.relatedInformation||[]).reduce((g,d)=>d.concat(g),[]).map(g=>g.file?o.Uri.parse(g.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(c),!e.isDisposed()&&o.editor.setModelMarkers(e,this._selector,s.map(g=>this._convertDiagnostics(e,g)))}_convertDiagnostics(e,t){const r=t.start||0,a=t.length||1,{lineNumber:n,column:l}=e.getPositionAt(r),{lineNumber:u,column:s}=e.getPositionAt(r+a),c=[];return t.reportsUnnecessary&&c.push(o.MarkerTag.Unnecessary),t.reportsDeprecated&&c.push(o.MarkerTag.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:n,startColumn:l,endLineNumber:u,endColumn:s,message:T(t.messageText,`
|
|
2
2
|
`),code:t.code.toString(),tags:c,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];const r=[];return t.forEach(a=>{let n=e;if(a.file&&(n=this._libFiles.getOrCreateModel(a.file.fileName)),!n)return;const l=a.start||0,u=a.length||1,{lineNumber:s,column:c}=n.getPositionAt(l),{lineNumber:g,column:d}=n.getPositionAt(l+u);r.push({resource:n.uri,startLineNumber:s,startColumn:c,endLineNumber:g,endColumn:d,message:T(a.messageText,`
|
|
3
3
|
`)})}),r}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return o.MarkerSeverity.Error;case 3:return o.MarkerSeverity.Info;case 0:return o.MarkerSeverity.Warning;case 2:return o.MarkerSeverity.Hint}return o.MarkerSeverity.Info}},G=class C extends y{get triggerCharacters(){return["."]}async provideCompletionItems(t,r,a,n){const l=t.getWordUntilPosition(r),u=new o.Range(r.lineNumber,l.startColumn,r.lineNumber,l.endColumn),s=t.uri,c=t.getOffsetAt(r),g=await this._worker(s);if(t.isDisposed())return;const d=await g.getCompletionsAtPosition(s.toString(),c);return!d||t.isDisposed()?void 0:{suggestions:d.entries.map(h=>{let _=u;if(h.replacementSpan){const S=t.getPositionAt(h.replacementSpan.start),x=t.getPositionAt(h.replacementSpan.start+h.replacementSpan.length);_=new o.Range(S.lineNumber,S.column,x.lineNumber,x.column)}const v=[];return h.kindModifiers!==void 0&&h.kindModifiers.indexOf("deprecated")!==-1&&v.push(o.languages.CompletionItemTag.Deprecated),{uri:s,position:r,offset:c,range:_,label:h.name,insertText:h.name,sortText:h.sortText,kind:C.convertKind(h.kind),tags:v}})}}async resolveCompletionItem(t,r){const a=t,n=a.uri,l=a.position,u=a.offset,c=await(await this._worker(n)).getCompletionEntryDetails(n.toString(),u,a.label);return c?{uri:n,position:l,label:c.name,kind:C.convertKind(c.kind),detail:w(c.displayParts),documentation:{value:C.createDocumentationString(c)}}:a}static convertKind(t){switch(t){case f.primitiveType:case f.keyword:return o.languages.CompletionItemKind.Keyword;case f.variable:case f.localVariable:return o.languages.CompletionItemKind.Variable;case f.memberVariable:case f.memberGetAccessor:case f.memberSetAccessor:return o.languages.CompletionItemKind.Field;case f.function:case f.memberFunction:case f.constructSignature:case f.callSignature:case f.indexSignature:return o.languages.CompletionItemKind.Function;case f.enum:return o.languages.CompletionItemKind.Enum;case f.module:return o.languages.CompletionItemKind.Module;case f.class:return o.languages.CompletionItemKind.Class;case f.interface:return o.languages.CompletionItemKind.Interface;case f.warning:return o.languages.CompletionItemKind.File}return o.languages.CompletionItemKind.Property}static createDocumentationString(t){let r=w(t.documentation);if(t.tags)for(const a of t.tags)r+=`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as s}from"./monacoSetup-
|
|
1
|
+
import{m as s}from"./monacoSetup-DObeMDBe.js";import"./index-D0g0tm7R.js";var c=Object.defineProperty,a=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,l=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of p(e))!g.call(t,n)&&n!==o&&c(t,n,{get:()=>e[n],enumerable:!(i=a(e,n))||i.enumerable});return t},d=(t,e,o)=>(l(t,e,"default"),o),r={};d(r,s);var b={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:r.languages.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:r.languages.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:r.languages.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:r.languages.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},u={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","out","package","private","protected","public","override","readonly","require","global","return","satisfies","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<","</",">>",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,"delimiter.bracket"],{include:"common"}],common:[[/#?[a-z_$][\w$]*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],[/[A-Z][\w\$]*/,"type.identifier"],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([dgimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}};export{b as conf,u as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as r}from"./monacoSetup-
|
|
1
|
+
import{m as r}from"./monacoSetup-DObeMDBe.js";import"./index-D0g0tm7R.js";var m=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,p=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of l(e))!d.call(t,n)&&n!==o&&m(t,n,{get:()=>e[n],enumerable:!(i=c(e,n))||i.enumerable});return t},s=(t,e,o)=>(p(t,e,"default"),o),a={};s(a,r);var k={comments:{blockComment:["<!--","-->"]},brackets:[["<",">"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],onEnterRules:[{beforeText:new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:a.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:a.languages.IndentAction.Indent}}]},_={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/<!--/,{token:"comment",next:"@comment"}]],comment:[[/[^<\-]+/,"comment.content"],[/-->/,{token:"comment",next:"@pop"}],[/<!--/,"comment.content.invalid"],[/[<\-]/,"comment.content"]]}};export{k as conf,_ as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as l}from"./monacoSetup-
|
|
1
|
+
import{m as l}from"./monacoSetup-DObeMDBe.js";import"./index-D0g0tm7R.js";var i=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,d=(n,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!s.call(n,t)&&t!==r&&i(n,t,{get:()=>e[t],enumerable:!(o=c(e,t))||o.enumerable});return n},m=(n,e,r)=>(d(n,e,"default"),r),a={};m(a,l);var f={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:a.languages.IndentAction.Indent}}]},g={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{f as conf,g as language};
|
package/dist/index.html
CHANGED
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
--colorNeutralForegroundOnBrand: #000000;
|
|
293
293
|
}
|
|
294
294
|
</style>
|
|
295
|
-
<script type="module" crossorigin src="./assets/index-
|
|
295
|
+
<script type="module" crossorigin src="./assets/index-D0g0tm7R.js"></script>
|
|
296
296
|
</head>
|
|
297
297
|
<body>
|
|
298
298
|
<div id="boot-splash">
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ae,b6 as se,bL as U,r,u as re,e as oe,bM as ne,bN as le,bO as ie,f as de,bP as ce,bQ as ue,ba as ge,i as I,k as he,T as be,l as pe,bR as me,bS as ye,bG as ve,bH as fe,bT as R,L as Se,q as xe,t as a,H as Te,B as Pe,D as Ne,J as je,w as we,bU as ke,y as Ce,z as Me,A as Ie,G as Re,R as Ae,bV as D,U as He,S as Fe,I as Le,bm as $e,aT as Be,bn as qe,b5 as Ee,a9 as Oe,Y as P,bl as Ue,Z as De,a$ as ze}from"./index-DGsVifiB.js";import{A as Ve,N as We}from"./AssociateTargetsEditor-CuQhdosb.js";const Ge=()=>({table:"",sourceId:null,navProperty:null,targets:[],targetNames:{},headers:Le(),dirty:new Set});function _e({themeMode:d}){const p=ae("associate"),n=se("associate",U,Ge),[e,c]=r.useState(n.state),{table:N}=re(e.table||null),{entities:A}=oe(),[H,F]=r.useState("source"),[m,j]=r.useState("builder"),[L,w]=r.useState(null),[V,$]=r.useState(!1),[W,G]=r.useState([]),[y,v]=r.useState(n.lastSavedId),[f,S]=r.useState(n.lastSavedHash),[B,k]=r.useState(""),b=r.useMemo(()=>ne(e),[e,N]),J=r.useMemo(()=>le(e),[e,N]),l=r.useMemo(()=>ie(e),[e,N]),x=de(e.table),o=e.navProperty?x?.navigationProperties.find(t=>t.name===e.navProperty):void 0,q=o?ce(o):!1,u=q?"PATCH":"POST",C=t=>c(s=>{const i=new Set(s.dirty);return i.add(t),{...s,dirty:i}}),T=(t,s,i)=>{c(M=>({...M,[t]:s})),i&&C(i)},Q=x?e.sourceId?e.navProperty?e.targets.length===0?"Pick at least one target record.":e.headers.some(t=>t.enabled&&!t.name)?"Fix empty header name.":null:"Pick a navigation property.":"Pick a source record.":"Pick a source table first.",Y=async()=>{$(!0);const t=await Be.associate(e);w(t),$(!1),j("results"),G(s=>[{id:`r-${Date.now()}`,snapshot:g,modeId:"associate",url:b.relativeUrl,method:u,ts:Date.now(),status:t.status,ms:t.ms,rowCount:D(t,l.length)??0},...s].slice(0,8)),c(s=>({...s,dirty:new Set}))},g=r.useMemo(()=>ue(e),[e]);ge("associate",g,y,f);const Z=r.useMemo(()=>I(g),[g]),E=f===null?!0:Z!==f,_=t=>{v(t.id),S(I(t.state))},O=t=>{if(t.modeId!=="associate")return;const s=t.state;if(A.length>0&&!A.some(i=>i.logicalName===s.table)){$e(`Can't load "${t.name}": entity \`${s.table}\` isn't available in this environment. The solution may have been removed or you may be connected to a different org.`);return}c(U(s)),v(t.id),S(I(s)),w(null),k(""),F("source")},K=t=>{const s=qe(t,"associate");if(!s)return;const i=y,M=f;O(s),v(i),S(M)};he(r.useMemo(()=>e.table?{state:g,modeId:"associate",dirty:E,lastSavedId:y,onSaved:_,onLoadSaved:O}:null,[g,E,y,e.table]));const X=[{id:"source",label:"Target",meta:x?.displayName??"Pick a table",items:[{id:"source",icon:pe,iconFilled:be,label:e.sourceId?B||`${x?.displayName??""} (selected)`:"Pick a record",badge:o?u:null,badgeAppearance:"tint",badgeColor:"brand",dirty:e.dirty.has("source")}]},{id:"relationship",label:"Relationship",meta:o?z(o.cardinality):"pick one",items:[{id:"nav",icon:ye,iconFilled:me,label:o?o.name:"Navigation property",code:!!o,badge:o?z(o.cardinality):null,badgeAppearance:"ghost",dirty:e.dirty.has("nav")}]},{id:"targets",label:"Related",meta:e.targets.length?`${e.targets.length} target${e.targets.length===1?"":"s"}`:"none",items:[{id:"targets",icon:fe,iconFilled:ve,label:q?"Target record":"Target records",badge:e.targets.length||null,badgeAppearance:"tint",badgeColor:e.targets.length>0?"success":"subtle",dirty:e.dirty.has("targets")},...l.length>0?[{id:"preview",icon:R,iconFilled:R,label:`${l.length} request${l.length===1?"":"s"}`,badge:l.length,badgeAppearance:"ghost"}]:[]]},{id:"headers",label:"Headers",meta:`${e.headers.filter(t=>t.enabled).length} active`,items:[{id:"headers",icon:xe,iconFilled:Se,label:"HTTP headers",badge:e.headers.filter(t=>t.enabled).length||null,dirty:e.dirty.has("headers")}]}];let h;switch(H){case"source":h=a.jsx(we,{table:e.table,onTableChange:t=>{c(s=>({...s,table:t,sourceId:null,navProperty:null,targets:[],targetNames:{},dirty:new Set(["source","nav","targets"])})),k(""),w(null),v(void 0),S(null)},recordId:e.sourceId,onRecordChange:(t,s)=>{T("sourceId",t,"source"),k(s??"")},group:"relate",sub:"Pick the source entity and the record that the relationship anchors on."});break;case"nav":h=a.jsx(We,{table:e.table,value:e.navProperty,onChange:t=>{c(s=>({...s,navProperty:t,targets:[],targetNames:{}})),C("nav"),C("targets")},group:"relate",forOperation:"associate",footer:a.jsx(Pe,{layout:"multiline",intent:"info",children:a.jsxs(Ne,{children:[a.jsx(je,{children:"How cardinality drives the request"}),a.jsx("strong",{children:"Collection-valued"})," (1:N / N:N) → ",a.jsx("code",{children:"POST /…/$ref"})," with one request per target. ",a.jsx("strong",{children:"Single-valued"})," (N:1) →"," ",a.jsx("code",{children:"PATCH /source(id)"})," with body"," ",a.jsx("code",{children:'{ "<nav>@odata.bind": "<target-set>(<id>)" }'})," (one target). This is the docs-preferred shape — the URL bar verb updates automatically. The PATCH is sent with ",a.jsx("code",{children:"If-Match: *"}),", so a wrong source id fails with 404 instead of creating a record; Power Platform ToolBox asks you to approve that header once."," ",a.jsx("a",{href:"https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/associate-disassociate-entities-using-web-api",target:"_blank",rel:"noopener noreferrer",style:{color:"inherit"},children:"MS Learn ↗"})]})})});break;case"targets":h=a.jsx(Ve,{table:e.table,navProperty:e.navProperty,targets:e.targets,setTargets:t=>T("targets",t,"targets"),targetNames:e.targetNames,setTargetNames:t=>T("targetNames",t),group:"relate",resolvedMethod:o?u:null});break;case"preview":h=a.jsx(Je,{requests:l});break;case"headers":h=a.jsx(Te,{items:e.headers,setItems:t=>T("headers",t,"headers"),group:"relate"});break}const ee=ke(u,Ce(e.headers,null)),te={method:u,built:b,headers:ee,body:J,entityLogical:b.entityLogical,multiRequests:l.length>1?l.map(t=>({method:t.method,relativeUrl:t.relativeUrl,body:t.body,description:`target ${t.targetId}`})):void 0};return a.jsx(Me,{sidebar:a.jsx(Fe,{type:p,urlPreview:b.relativeNoBase,sections:X,activeNode:H,onSelect:t=>{F(t),j("builder")},recents:W,onRecentClick:K}),urlBar:a.jsx(He,{method:u,url:b.relativeUrl,executeVerb:p.executeVerb,disabledReason:Q,loading:V,onExecute:Y}),children:a.jsxs(Ie,{tab:m,onTabChange:j,resultCount:D(L,l.length),children:[m==="builder"&&h,m==="code"&&a.jsx(Re,{themeMode:d,inputs:te}),m==="results"&&a.jsx(Ae,{result:L,mode:"single",table:e.table,writeContext:{operation:"associate",table:e.table,recordId:e.sourceId,recordName:B||null,navProperty:e.navProperty??void 0,targetCount:e.targets.length,targetNames:e.targets.map(t=>e.targetNames[t]).filter(t=>!!t),targetNameById:e.targetNames}})]})})}function Je({requests:d}){const p=Ee();return a.jsxs("div",{children:[a.jsx(Oe,{icon:R,title:`Generated requests (${d.length})`,sub:"Each target queues a separate HTTP request. For large counts, prefer a $batch request.",group:"relate"}),a.jsxs("div",{className:ze(p.inlineCard),style:{padding:12,maxWidth:980,fontFamily:P.fontFamilyMonospace,fontSize:11},children:[d.map((n,e)=>a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"60px 1fr",gap:8,padding:"8px 0",borderBottom:e<d.length-1?`1px solid ${P.colorNeutralStroke3}`:"none"},children:[a.jsx(Ue,{appearance:"filled",color:n.method==="POST"?"success":"warning",style:{fontWeight:700,justifySelf:"start"},children:n.method}),a.jsxs("div",{style:{minWidth:0},children:[a.jsx("div",{style:{wordBreak:"break-all"},children:n.relativeUrl}),a.jsx("div",{style:{marginTop:4,color:P.colorNeutralForeground3},children:JSON.stringify(n.body)})]})]},n.targetId)),d.length===0&&a.jsx(De,{style:{color:P.colorNeutralForeground3,fontStyle:"italic",padding:"12px 4px",textAlign:"center",display:"block"},children:"No requests queued — pick at least one target on the Related pane."})]})]})}function z(d){switch(d){case"OneToMany":return"1:N";case"ManyToOne":return"N:1";case"ManyToMany":return"N:N"}}export{_e as AssociateMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as j,u as I,t as e,a9 as k,bR as v,a5 as E,bj as L,b3 as K,Y as r,bl as p,Z as b,r as P,b5 as U,B as S,D as O,aD as B,c0 as G,bK as H,O as V,aP as J,a$ as Y,b4 as Z,aB as _,J as Q}from"./index-DGsVifiB.js";function ne({table:t,value:s,onChange:n,group:o="relate",forOperation:u,footer:y}){const g=j(t)?.navigationProperties??[],d=g.find(i=>i.name===s);return I(d?.targetEntity??null),e.jsxs("div",{children:[e.jsx(k,{icon:v,title:"Navigation property",sub:"Cardinality is detected from metadata — the URL bar verb + shape adapt automatically.",group:o}),e.jsxs("div",{style:{maxWidth:720},children:[e.jsx(E,{label:"Navigation property",children:e.jsx(L,{value:d?.name??"",selectedOptions:d?[d.name]:[],onOptionSelect:(i,x)=>n(x.optionValue??null),placeholder:"Pick a navigation property…",children:g.map(i=>e.jsx(K,{value:i.name,text:i.name,children:e.jsx(X,{nav:i,forOperation:u})},i.name))})}),d&&e.jsx("div",{style:{marginTop:16},children:e.jsx(ee,{nav:d,forOperation:u})}),y&&e.jsx("div",{style:{marginTop:14},children:y})]})]})}function X({nav:t,forOperation:s}){const n=j(t.targetEntity),o=R(t,s);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontFamily:r.fontFamilyMonospace,fontWeight:600},children:t.name}),e.jsx(p,{appearance:"ghost",size:"extra-small",children:M(t.cardinality)}),e.jsx(p,{appearance:"tint",color:"brand",size:"extra-small",style:{marginLeft:"auto"},children:o})]}),e.jsxs(b,{style:{color:r.colorNeutralForeground3},children:["→ ",n?.displayName??t.targetEntity," · ",te(t.cardinality)]})]})}function ee({nav:t,forOperation:s}){const n=j(t.targetEntity),o=R(t,s),u=t.cardinality==="ManyToOne"?"single-valued":"collection-valued",y=o==="POST"?r.colorPaletteGreenForeground1:o==="PATCH"?r.colorPaletteDarkOrangeForeground1:r.colorPaletteRedForeground1;return e.jsxs("div",{style:{border:`1px solid ${r.colorNeutralStroke2}`,borderRadius:r.borderRadiusMedium,padding:12,background:r.colorNeutralBackground1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx(v,{style:{width:18,height:18,color:r.colorBrandForeground1}}),e.jsx("strong",{style:{fontFamily:r.fontFamilyMonospace,fontSize:13},children:t.name}),e.jsx(p,{appearance:"tint",color:"brand",children:M(t.cardinality)}),e.jsx("span",{style:{flexGrow:1}}),e.jsx(p,{appearance:"filled",style:{background:y,color:r.colorNeutralForegroundOnBrand,fontWeight:700},children:o})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",rowGap:4,fontSize:11},children:[e.jsx("span",{style:{color:r.colorNeutralForeground3},children:"Target entity"}),e.jsxs("span",{style:{fontFamily:r.fontFamilyMonospace},children:[n?.entitySetName??t.targetEntity," ",e.jsxs(b,{style:{color:r.colorNeutralForeground3},children:["· ",n?.displayName??t.targetEntity]})]}),e.jsx("span",{style:{color:r.colorNeutralForeground3},children:"Cardinality"}),e.jsxs("span",{children:[u," (",t.cardinality,")"]}),e.jsx("span",{style:{color:r.colorNeutralForeground3},children:"Relationship"}),e.jsx("span",{style:{fontFamily:r.fontFamilyMonospace,fontSize:10},children:t.relationshipName})]})]})}function M(t){switch(t){case"OneToMany":return"1:N";case"ManyToOne":return"N:1";case"ManyToMany":return"N:N"}}function te(t){return t==="ManyToOne"?"single-valued lookup":"collection-valued"}function R(t,s){return t.cardinality==="ManyToOne"?"PATCH":s==="disassociate"?"DELETE":"POST"}function ae({table:t,navProperty:s,targets:n,setTargets:o,targetNames:u,setTargetNames:y,group:N="relate",resolvedMethod:g}){const[d,i]=P.useState({}),x=u??d,F=y??i,C=U(),W=j(t),h=s?W?.navigationProperties.find(a=>a.name===s):void 0,m=h?j(h.targetEntity):void 0,l=h?.cardinality==="ManyToOne",w=l?1:1/0,[z,A]=P.useState(0);if(!h)return e.jsxs("div",{children:[e.jsx(k,{icon:v,title:"Target records",sub:"Pick a navigation property first.",group:N}),e.jsx(S,{layout:"multiline",intent:"info",style:{maxWidth:720},children:e.jsxs(O,{children:["Switch to the ",e.jsx("strong",{children:"Navigation property"})," pane and pick one — the target entity comes from there."]})})]});const T=n.length>=w,D=(a,c)=>{if(!a||n.includes(a)||T)return;const f=l?[a]:[...n,a];o(f),c&&F({...x,[a]:c}),A(q=>q+1)},$=a=>{if(o(n.filter(c=>c!==a)),x[a]!=null){const c={...x};delete c[a],F(c)}};return e.jsxs("div",{children:[e.jsxs(k,{icon:v,title:l?"Target record":"Target records",sub:e.jsx("span",{children:l?e.jsxs(e.Fragment,{children:["One target is allowed for ",e.jsx("code",{children:h.cardinality})," nav props — the server PUT sets the lookup."]}):e.jsxs(e.Fragment,{children:["One or more targets — each fires a separate POST request. For many targets, Dataverse recommends a ",e.jsx("code",{children:"$batch"})," request."]})}),group:N,children:[e.jsxs(p,{appearance:"tint",color:n.length>0?"brand":"subtle",children:[n.length," target",n.length===1?"":"s"]}),g&&e.jsx(p,{appearance:"filled",color:g==="POST"?"success":"informative",style:{fontWeight:700},children:g}),!l&&n.length>1&&e.jsx(B,{content:"Will fire one request per target — Dataverse recommends $batch for large counts. Batch transport lands in a later pass.",relationship:"description",children:e.jsxs(p,{appearance:"ghost",icon:e.jsx(G,{style:{width:12,height:12}}),children:[n.length," requests queued"]})})]}),e.jsx("div",{className:Y(C.inlineCard),style:{padding:12,marginBottom:14,maxWidth:880},children:n.length===0?e.jsxs(b,{style:{padding:"12px 4px",color:r.colorNeutralForeground3,fontStyle:"italic",display:"block",textAlign:"center"},children:["No targets selected — use the picker below to choose"," ",l?"one":"one or more"," ",e.jsx("strong",{children:m?.displayName??h.targetEntity})," record",l?"":"s","."]}):e.jsx("div",{style:{display:"flex",flexDirection:"column"},children:n.map((a,c)=>{const f=x[a];return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 4px",borderBottom:c<n.length-1?`1px solid ${r.colorNeutralStroke3}`:"none"},children:[e.jsx(H,{size:"small",name:f??"?",avatar:{color:"colorful"}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600},children:f??e.jsx("span",{style:{fontStyle:"italic",color:r.colorNeutralForeground3},children:"(name not resolved)"})}),e.jsxs("div",{style:{fontFamily:r.fontFamilyMonospace,fontSize:10,color:r.colorNeutralForeground3},children:["/",m?.entitySetName??"?","(",a,")"]})]}),e.jsx(B,{content:"Remove target",relationship:"label",children:e.jsx(V,{size:"small",appearance:"subtle",icon:e.jsx(J,{}),onClick:()=>$(a),"aria-label":"Remove target"})})]},a)})})}),!T&&e.jsxs("div",{style:{maxWidth:560},children:[e.jsx(E,{label:l?"Pick target":"Add target",hint:l?`Pick a single ${m?.displayName??"record"} — the PUT sets this as the lookup value.`:`Each pick queues a separate POST. Currently ${n.length} target${n.length===1?"":"s"} queued.`,children:e.jsx(Z,{table:m?.logicalName??h.targetEntity,selectedId:null,onPick:a=>D(a?.id??null,a?.primary),placeholder:`Search ${m?.displayName??"record"}s…`},z)}),!l&&e.jsxs(b,{style:{display:"block",marginTop:6,color:r.colorNeutralForeground3},children:[e.jsx(_,{style:{width:12,height:12,verticalAlign:"middle"}})," picking a record adds it to the queue and resets the picker for the next pick."]})]}),T&&l&&e.jsx(S,{layout:"multiline",intent:"info",style:{maxWidth:720,marginTop:12},children:e.jsxs(O,{children:[e.jsx(Q,{children:"Single-valued nav property — one target only."}),"To change the target, remove the current one first. The server PUT atomically replaces the previous lookup value."]})})]})}export{ae as A,ne as N};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{f as P,E as Je,af as Ze,ag as we,b as Ye,d as je,m as ge,ah as Qe,j as Xe,c as et,r as y,u as tt,e as st,ai as at,aj as rt,ak as nt,al as it,am as ot,i as X,k as lt,an as ke,ao as dt,T as ct,l as ut,ap as ve,aq as pt,ar as Se,as as ht,L as mt,q as yt,at as fe,au as gt,t,Z as M,av as ft,H as bt,w as xt,y as be,z as wt,A as jt,B as $,D as R,G as kt,R as vt,U as St,S as Ct,a9 as ae,O as k,aw as $t,ax as Ce,ay as $e,W as re,az as te,a5 as Rt,a6 as Re,aA as Mt,aB as It,aC as Dt,J as Me,Y as E,aD as ee,aE as Ft,aa as Nt,ab as Bt,a3 as At,K as Ut,N as Lt,V as Tt,_ as Ot,$ as Et,a0 as Pt,a1 as qt,a2 as Vt,ad as _t,a4 as Kt,a7 as zt,aF as Gt,I as Wt,aG as Ht}from"./index-DGsVifiB.js";const Ie=["CreateMultiple","UpdateMultiple","UpsertMultiple","DeleteMultiple"],Jt=1e3,Zt=100,Yt=/^\{?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\}?$/i,De=s=>Yt.test(s.trim()),Fe=s=>s.trim().replace(/^\{|\}$/g,"").toLowerCase();let Qt=1;function G(s){return{id:typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`row_${crypto.randomUUID()}`:`row_${Date.now().toString(36)}_${(Qt++).toString(36)}`,key:s?.key??"",fieldValues:s?.fieldValues??{},nullFields:s?.nullFields??[]}}function Xt(s){return G({key:"",fieldValues:es(s.fieldValues),nullFields:[...s.nullFields]})}function es(s){return JSON.parse(JSON.stringify(s))}const q={CreateMultiple:{label:"Create multiple",description:"Creates every row in one request and returns the new ids.",keyRequired:!1,allowsAlternateKey:!1,usesFields:!0,fieldPurpose:"create",successStatus:200},UpdateMultiple:{label:"Update multiple",description:"Updates rows addressed by their primary key (GUID). Send only changed columns.",keyRequired:!0,allowsAlternateKey:!1,usesFields:!0,fieldPurpose:"update",successStatus:204},UpsertMultiple:{label:"Upsert multiple",description:"Creates or updates each row, addressed by primary key or an alternate key. Needs a table that supports both CreateMultiple and UpdateMultiple.",keyRequired:!0,allowsAlternateKey:!0,usesFields:!0,fieldPurpose:"upsert",successStatus:204},DeleteMultiple:{label:"Delete multiple",description:"Deletes rows by primary key. Elastic tables only — for standard tables use Bulk Delete.",keyRequired:!0,allowsAlternateKey:!1,usesFields:!0,fieldPurpose:"update",successStatus:204}};function ts(s,a){return Ze({table:s,fieldValues:a.fieldValues,nullFields:a.nullFields})}function ss(s,a,e){const r=q[s.operation],i={"@odata.type":`Microsoft.Dynamics.CRM.${a.logicalName}`},o=r.usesFields?ts(s.table,e):{};Object.assign(i,o);const u=e.key.trim();let c;if(u?De(u)?i[a.primaryKey]=Fe(u):r.allowsAlternateKey?i["@odata.id"]=`${a.entitySetName}(${u})`:c=s.operation==="UpdateMultiple"?"Key must be a GUID — UpdateMultiple in the Web API does not accept alternate keys.":"Key must be a GUID.":r.keyRequired&&(c=s.operation==="UpsertMultiple"?"Missing key — a GUID or an alternate key such as name='value'.":"Missing primary key (GUID)."),!c&&s.operation!=="DeleteMultiple"&&Object.keys(o).length===0&&(c="No column values set."),!c&&s.operation==="CreateMultiple"){const l=as(a,e);l.length>0&&(c=`Required column${l.length===1?"":"s"} unset: ${l.slice(0,3).join(", ")}${l.length>3?"…":""}`)}return{target:i,issue:c}}function as(s,a){return s.columns.filter(e=>e.requiredLevel==="ApplicationRequired"&&e.isValidForCreate!==!1).filter(e=>{const r=a.fieldValues[e.logicalName];return r==null||r===""?!0:Array.isArray(r)?r.length===0:we(e)?!r?.id:!1}).map(e=>e.logicalName)}function Ne(s){const a=P(s.table);if(!a)return{body:{Targets:[]},issues:[]};const e=[],r=new Map;return{body:{Targets:s.rows.map((o,u)=>{const{target:c,issue:l}=ss(s,a,o);l&&e.push({rowIndex:u,rowId:o.id,message:l});const h=o.key.trim().toLowerCase();if(h){const p=r.get(h);p!==void 0?e.push({rowIndex:u,rowId:o.id,message:s.operation==="UpdateMultiple"?`Same key as row ${p+1} — UpdateMultiple applies only the first of them.`:`Same key as row ${p+1} — duplicate keys fail the request.`}):r.set(h,u)}return c})},issues:e}}function rs(s){const a=P(s.table);if(!a)return{relativeUrl:"",relativeNoBase:"",bytes:0,queryParts:[],entitySet:"",entityLogical:""};const e=`/${a.entitySetName}/Microsoft.Dynamics.CRM.${s.operation}`,r=`${Je.apiBase}${e}`;return{relativeUrl:r,relativeNoBase:e,bytes:r.length,queryParts:[],entitySet:a.entitySetName,entityLogical:a.logicalName}}function ns(s){return s==="UpsertMultiple"?["CreateMultiple","UpdateMultiple"]:[s]}function is(s,a){const e=r=>`'${r.replace(/'/g,"''")}'`;return`sdkmessagefilters?$select=sdkmessagefilterid&$filter=sdkmessageid/name eq ${e(s)} and primaryobjecttypecode eq ${e(a)}`}function os(s,a,e){const r=P(s.table);if(!s.table)return"Pick a target table first.";if(!r)return"Loading table metadata…";if(e.state==="unsupported")return e.message;if(s.rows.length===0)return"Add at least one row.";if(a.length>0){const i=a[0];return`Row ${i.rowIndex+1}: ${i.message}${a.length>1?` (+${a.length-1} more)`:""}`}return s.headers.some(i=>i.enabled&&!i.name)?"Fix empty header name.":null}function ls(s,a,e){return s==="DeleteMultiple"?`DeleteMultiple isn't available for '${a}'. It's supported on elastic tables only — use the Bulk Delete mode (an asynchronous job) for standard tables.`:s==="UpsertMultiple"?`UpsertMultiple needs both CreateMultiple and UpdateMultiple, and '${a}' doesn't support ${e.join(" or ")}.`:`'${a}' doesn't support ${s} (no sdkmessagefilter for this table).`}const ds=new Set(["@key","key","id","@odata.id"]);function cs(s,a){const e=s.trim();if(!e)return{rows:[],skippedColumns:[],errors:[]};let r;if(e.startsWith("[")||e.startsWith("{")){let c;try{c=JSON.parse(e)}catch(h){return{rows:[],skippedColumns:[],errors:[`Invalid JSON: ${h instanceof Error?h.message:String(h)}`]}}const l=Array.isArray(c)?c:c&&typeof c=="object"?c.Targets??c.value:void 0;if(!Array.isArray(l))return{rows:[],skippedColumns:[],errors:['JSON must be an array of objects (or { "Targets": [ … ] }).']};r=l.filter(h=>!!h&&typeof h=="object")}else{const c=gs(e);if(c.length<2)return{rows:[],skippedColumns:[],errors:["CSV needs a header row and at least one data row."]};const[l,...h]=c;r=h.filter(p=>p.some(g=>g.trim()!=="")).map(p=>{const g={};return l.forEach((j,S)=>{const b=p[S];b!==void 0&&b!==""&&(g[j.trim()]=b)}),g})}const i=new Set,o=[];return{rows:r.map((c,l)=>{const h=G();for(const[p,g]of Object.entries(c)){const j=p.trim();if(j==="@odata.type"||j==="@odata.etag"||g===void 0)continue;if(ds.has(j.toLowerCase())||j.toLowerCase()===a.primaryKey){h.key=us(String(g??""),a);continue}const S=/^(.+)@odata\.bind$/i.exec(j),b=ps(a,S?S[1]:j);if(!b){i.add(j);continue}if(g===null){h.nullFields.push(b.logicalName);continue}const x=hs(b,g);"error"in x?o.push(`Row ${l+1}, ${j}: ${x.error}`):h.fieldValues[b.logicalName]=x.value}return h}),skippedColumns:[...i],errors:o}}function us(s,a){const e=/^\/?([A-Za-z0-9_]+)\((.*)\)$/.exec(s.trim());return e&&e[1]===a.entitySetName?e[2]:s.trim()}function ps(s,a){const e=a.toLowerCase(),r=Ye(s,e);if(r)return r;const i=s.columns.find(o=>we(o)&&e.startsWith(`${o.logicalName}_`));return i||s.columns.find(o=>o.displayName.toLowerCase()===e)}function xe(s,a){if(typeof a=="number")return a;const e=String(a).trim();return/^-?\d+$/.test(e)?Number(e):s.find(r=>r.label.toLowerCase()===e.toLowerCase())?.value}function hs(s,a){const e=typeof a=="string"?a.trim():a;switch(s.attributeType){case"Integer":case"BigInt":case"Decimal":case"Double":case"Money":{const r=typeof e=="number"?e:Number(String(e).replace(/,/g,""));return Number.isFinite(r)?(s.attributeType==="Integer"||s.attributeType==="BigInt")&&!Number.isInteger(r)?{error:`"${String(a)}" is not a whole number`}:{value:r}:{error:`"${String(a)}" is not a number`}}case"Boolean":{if(typeof e=="boolean")return{value:e};const r=String(e).toLowerCase();return["true","1","yes","y"].includes(r)?{value:!0}:["false","0","no","n"].includes(r)?{value:!1}:r===s.trueOption.label.toLowerCase()?{value:!0}:r===s.falseOption.label.toLowerCase()?{value:!1}:{error:`"${String(a)}" is not a yes/no value`}}case"Picklist":case"State":case"Status":case"EntityName":{const r=xe(s.options,e);return r===void 0?{error:`unknown choice "${String(a)}"`}:{value:r}}case"MultiSelectPicklist":{const r=Array.isArray(e)?e:String(e).split(/[,;]/).map(o=>o.trim()).filter(Boolean),i=[];for(const o of r){const u=xe(s.options,o);if(u===void 0)return{error:`unknown choice "${String(o)}"`};i.push(u)}return{value:i}}case"Lookup":case"Customer":case"Owner":{const r=String(e),i=/^\/?([A-Za-z0-9_]+)\(\{?([0-9a-fA-F-]{36})\}?\)$/.exec(r);if(i){const l=s.targets.find(h=>P(h)?.entitySetName===i[1]);return l?{value:{id:i[2].toLowerCase(),targetEntity:l}}:{error:`"${i[1]}" is not a target of ${s.logicalName}`}}const o=/^([A-Za-z0-9_]+):\s*(.+)$/.exec(r),u=o?o[1].toLowerCase():s.targets[0],c=o?o[2]:r;return De(c)?s.targets.includes(u)?{value:{id:Fe(c),targetEntity:u}}:{error:`"${u}" is not a target of ${s.logicalName}`}:{error:`"${r}" is not a GUID`}}case"File":case"Image":return{error:"file and image columns can’t be set in a bulk write"};default:return{value:typeof e=="string"?e:String(e)}}}function ms(s){const{dirty:a,...e}=s;return e}function ys(s,a){return{...a,...s,operation:Ie.includes(s.operation)?s.operation:"CreateMultiple",rows:(s.rows??[]).map(e=>({id:e.id||G().id,key:e.key??"",fieldValues:e.fieldValues??{},nullFields:e.nullFields??[]})),dirty:new Set}}function gs(s){const a=s.split(/\r?\n/,1)[0],e=a.includes(" ")&&!a.includes(",")?" ":",",r=[];let i=[],o="",u=!1;for(let c=0;c<s.length;c++){const l=s[c];if(u){l==='"'?s[c+1]==='"'?(o+='"',c++):u=!1:o+=l;continue}l==='"'&&o===""?u=!0:l===e?(i.push(o),o=""):l===`
|
|
2
|
-
`||l==="\r"?(l==="\r"&&s[c+1]===`
|
|
3
|
-
`&&c++,i.push(o),r.push(i),i=[],o=""):o+=l}return i.push(o),r.push(i),r}async function fs(s,a){try{const e=[];for(const r of ns(a))(await je.queryData(is(r,s)))?.value?.length||e.push(r);return e.length===0?{state:"supported"}:{state:"unsupported",message:ls(a,s,e)}}catch(e){return{state:"unknown",message:`Couldn't check ${a} availability: ${e instanceof Error?e.message:String(e)}`}}}async function bs(s,a){const{body:e,issues:r}=Ne(s);if(r.length>0)return ge({statusCode:400,message:`Row ${r[0].rowIndex+1}: ${r[0].message}`},0);const i=Qe(a),o=performance.now();try{const u=await je.execute({operationName:s.operation,operationType:"action",entityName:s.table,parameters:e},i),c=Math.round(performance.now()-o),l=u&&Object.keys(u).length>0?u:null;return{status:l?200:204,statusText:l?"OK":"No Content",ms:c,bytes:Xe(l),ok:!0,outcome:"ok",body:l,headers:{"OData-Version":"4.0"}}}catch(u){return ge(u,Math.round(performance.now()-o),i)}}function se(s){if(!s||typeof s!="object")return[];const a=s.Ids;return Array.isArray(a)?a.filter(e=>typeof e=="string"):[]}const z="bulk-write",D="bulk",A=100,xs=25,Be=()=>({table:"",operation:"CreateMultiple",rows:[],headers:Wt(),bypass:Gt()}),ws=()=>({...Be(),dirty:new Set}),O=s=>`row:${s}`;function Ms({themeMode:s}){const a=et(z),[e,r]=y.useState(ws),{table:i}=tt(e.table||null),{entities:o}=st(),[u,c]=y.useState("target"),[l,h]=y.useState("builder"),[p,g]=y.useState(null),[j,S]=y.useState("CreateMultiple"),[b,x]=y.useState(!1),[W,H]=y.useState([]),[w,v]=y.useState({state:"idle"}),[J,F]=y.useState(!1),[I,U]=y.useState(null),[Z,V]=y.useState(void 0),[ne,ie]=y.useState(null),C=P(e.table),L=y.useMemo(()=>rs(e),[e,i]),{body:Ae,issues:T}=y.useMemo(()=>Ne(e),[e,i]),Ue=q[e.operation];y.useEffect(()=>{if(!e.table){v({state:"idle"});return}if(!at()){v({state:"unknown",message:"Not connected to Power Platform ToolBox — availability not checked."});return}let n=!1;return v({state:"checking"}),fs(e.table,e.operation).then(d=>{n||v(d)}),()=>{n=!0}},[e.table,e.operation]);const oe=(n,d)=>{const m=new Set(n.dirty);return m.add(d),m},Y=(n,d,m)=>r(f=>({...f,[n]:d,dirty:oe(f,m)})),B=n=>r(d=>({...d,rows:n(d.rows),dirty:oe(d,"rows")})),le=(n,d)=>B(m=>m.map(f=>f.id===n?{...f,...d}:f)),Le=()=>G({fieldValues:C&&e.operation==="CreateMultiple"?Ht(C):{}}),Te=n=>{const d=Le();B(m=>[...m,d])},de=n=>{const d=e.rows.find(f=>f.id===n);if(!d)return;const m=Xt(d);B(f=>{const We=f.findIndex(He=>He.id===n),ye=[...f];return ye.splice(We+1,0,m),ye})},ce=n=>{B(d=>d.filter(m=>m.id!==n)),u===O(n)&&c("rows")},_=y.useMemo(()=>rt(e.headers,e.bypass),[e.headers,e.bypass]),ue=y.useMemo(()=>[...nt(e.bypass,"bypass"),...it({op:"create",bypass:e.bypass})],[e.bypass]),Oe=ot(ue),Ee=os(e,T,w)??(w.state==="checking"?`Checking ${e.operation} availability…`:null),Pe=async()=>{x(!0);const n=e.operation,d=await bs(e,be(_,null));g(d),S(n),x(!1),h("results");const m=se(d.body);H(f=>[{id:`r-${Date.now()}`,modeId:z,url:L.relativeUrl,method:"POST",ts:Date.now(),status:d.status,ms:d.ms,rowCount:d.ok?m.length||e.rows.length:0},...f].slice(0,8)),r(f=>({...f,dirty:new Set}))},K=y.useMemo(()=>ms(e),[e]),qe=y.useMemo(()=>X(K),[K]),pe=ne===null?!0:qe!==ne,Ve=n=>{V(n.id),ie(X(n.state))},_e=n=>{if(n.modeId!==z)return;const d=n.state;if(o.length>0&&!o.some(m=>m.logicalName===d.table)){U(`Can't load "${n.name}": table '${d.table}' isn't available in this environment.`);return}U(null),r(ys(d,Be())),V(n.id),ie(X(d)),g(null),c("rows")};lt(y.useMemo(()=>e.table?{state:K,modeId:z,dirty:pe,lastSavedId:Z,onSaved:Ve,onLoadSaved:_e}:null,[K,pe,Z,e.table]));const Q=y.useMemo(()=>{const n=new Map;for(const d of T)n.has(d.rowId)||n.set(d.rowId,d.message);return n},[T]),he=(n,d)=>{const m=C?n.fieldValues[C.primaryName]:void 0,f=n.key||typeof m=="string"&&m||"";return f?`#${d+1} · ${f}`:`#${d+1}`},Ke=e.rows.slice(0,xs).map((n,d)=>{const m=Q.get(n.id),f=Object.keys(n.fieldValues).length+n.nullFields.length;return{id:O(n.id),icon:dt,iconFilled:ke,label:he(n,d),badge:m?"!":f||null,badgeAppearance:"tint",badgeColor:m?"danger":"success"}}),me=w.state==="supported"?{badge:"supported",color:"success"}:w.state==="unsupported"?{badge:"unsupported",color:"danger"}:w.state==="checking"?{badge:"…",color:"subtle"}:w.state==="unknown"?{badge:"?",color:"warning"}:{badge:null,color:"subtle"},ze=[{id:"target",label:"Target",meta:C?`${C.displayName} · ${C.entitySetName}`:"Pick a table",items:[{id:"target",icon:ut,iconFilled:ct,label:C?.displayName??"Pick a table",dirty:e.dirty.has("target")}]},{id:"operation",label:"Operation",meta:e.operation,items:[{id:"operation",icon:pt,iconFilled:ve,label:Ue.label,badge:me.badge,badgeAppearance:"tint",badgeColor:me.color,dirty:e.dirty.has("operation")}]},{id:"rows",label:"Rows",meta:`${e.rows.length} row${e.rows.length===1?"":"s"}`,items:[{id:"rows",icon:ht,iconFilled:Se,label:"All rows",badge:T.length||null,badgeAppearance:"tint",badgeColor:"danger",dirty:e.dirty.has("rows"),children:Ke}]},{id:"headers",label:"Headers",meta:`${_.filter(n=>n.enabled).length} active`,items:[{id:"headers",icon:yt,iconFilled:mt,label:"HTTP headers",badge:_.filter(n=>n.enabled).length||null,dirty:e.dirty.has("headers")},{id:"bypass",icon:fe,iconFilled:fe,label:"Bypass logic",badge:gt(e.bypass),badgeAppearance:e.bypass.businessLogic!=="none"||e.bypass.suppressFlows?"tint":"ghost",badgeColor:e.bypass.businessLogic!=="none"||e.bypass.suppressFlows?"warning":"subtle",dirty:e.dirty.has("bypass")}]}];let N=null;if(u.startsWith("row:")){const n=e.rows.findIndex(m=>O(m.id)===u),d=e.rows[n];N=d?t.jsx(Ss,{row:d,index:n,count:e.rows.length,table:e.table,tbl:C,operation:e.operation,issue:Q.get(d.id),themeMode:s,onPatch:m=>le(d.id,m),onNavigate:m=>c(O(e.rows[m].id)),onBack:()=>c("rows"),onDuplicate:()=>de(d.id),onRemove:()=>ce(d.id)},d.id):t.jsx(M,{children:"That row was removed."})}else switch(u){case"target":N=t.jsx(xt,{table:e.table,onTableChange:n=>{r(d=>({...d,table:n,rows:[],dirty:new Set(["target","rows"])})),g(null)},group:D,sub:"Every row in a bulk request targets the same table. Switching the target clears the rows."});break;case"operation":N=t.jsx(js,{operation:e.operation,setOperation:n=>Y("operation",n,"operation"),support:w,table:e.table});break;case"rows":N=t.jsx(vs,{state:e,tbl:C,issueByRow:Q,issueCount:T.length,rowLabel:he,onAdd:()=>Te(),onImport:()=>F(!0),onClear:()=>B(()=>[]),onEdit:n=>c(O(n)),onDuplicate:de,onRemove:ce,onKeyChange:(n,d)=>le(n,{key:d})});break;case"headers":N=t.jsx(bt,{items:e.headers,setItems:n=>Y("headers",n,"headers"),group:D,sendsHeaders:!0});break;case"bypass":N=t.jsx(ft,{value:e.bypass,onChange:n=>Y("bypass",n,"bypass"),group:D});break}const Ge={method:"POST",built:L,headers:be(_,null),body:Ae,entityLogical:L.entityLogical};return t.jsxs(wt,{sidebar:t.jsx(Ct,{type:a,urlPreview:L.relativeNoBase,sections:ze,activeNode:u,onSelect:n=>{c(n),h("builder")},recents:W}),urlBar:t.jsx(St,{method:"POST",url:L.relativeUrl,executeVerb:a.executeVerb,disabledReason:Ee??Oe,loading:b,onExecute:Pe,advisories:ue,onAdvisoryFocus:c}),children:[t.jsxs(jt,{tab:l,onTabChange:h,resultCount:p?.ok&&se(p.body).length||null,children:[l==="builder"&&t.jsxs(t.Fragment,{children:[I&&t.jsx($,{intent:"error",style:{marginBottom:12},children:t.jsx(R,{children:I})}),N]}),l==="code"&&t.jsx(kt,{themeMode:s,inputs:Ge,group:D}),l==="results"&&(p&&p.ok?t.jsx($s,{result:p,operation:j}):t.jsx(vt,{result:p,mode:"single",table:e.table}))]}),t.jsx(Cs,{open:J,tbl:C,onClose:()=>F(!1),onImport:(n,d)=>{B(m=>d?n:[...m,...n]),F(!1),c("rows")}})]})}function js({operation:s,setOperation:a,support:e,table:r}){return t.jsxs("div",{style:{maxWidth:760},children:[t.jsx(ae,{icon:ve,title:"Operation",sub:"One request, many rows of the same table. On standard tables the whole request rolls back if any row fails.",group:D}),t.jsx(Nt,{value:s,onChange:(i,o)=>a(o.value),"aria-label":"Bulk operation",children:Ie.map(i=>t.jsx(Bt,{value:i,label:t.jsxs("span",{children:[t.jsx("code",{children:i}),t.jsx("br",{}),t.jsx(M,{children:q[i].description})]})},i))}),t.jsxs("div",{style:{marginTop:16,display:"flex",flexDirection:"column",gap:8},children:[r?e.state==="checking"?t.jsx(At,{size:"tiny",label:`Checking ${s} availability for ${r}…`}):e.state==="supported"?t.jsx($,{intent:"success",children:t.jsxs(R,{children:[t.jsx("code",{children:r})," supports ",s,"."]})}):e.state==="unsupported"?t.jsx($,{intent:"error",layout:"multiline",children:t.jsxs(R,{children:[t.jsx(Me,{children:"Not available"}),e.message]})}):e.state==="unknown"?t.jsx($,{intent:"warning",layout:"multiline",children:t.jsx(R,{children:e.message})}):null:t.jsx($,{intent:"info",children:t.jsxs(R,{children:["Pick a table to check whether it supports ",s,"."]})}),t.jsx($,{intent:"info",layout:"multiline",children:t.jsxs(R,{children:["Availability comes from the table's ",t.jsx("code",{children:"sdkmessagefilters"}),"."," ",t.jsx("code",{children:"UpsertMultiple"})," has no filter of its own — it's available where both"," ",t.jsx("code",{children:"CreateMultiple"})," and ",t.jsx("code",{children:"UpdateMultiple"})," are. Send 100–1,000 rows per request on standard tables (",Zt," on elastic tables); there's no fixed cap, but large payloads hit size and time limits."," ",t.jsx("a",{href:"https://learn.microsoft.com/en-us/power-apps/developer/data-platform/bulk-operations",target:"_blank",rel:"noreferrer",children:"Use bulk operation messages"})]})})]})]})}function ks(s,a){const e=a?.primaryKey??"primary key";switch(s){case"CreateMultiple":return`optional ${e} GUID`;case"UpsertMultiple":return`${e} GUID or key='value'`;default:return`${e} GUID`}}function vs({state:s,tbl:a,issueByRow:e,issueCount:r,rowLabel:i,onAdd:o,onImport:u,onClear:c,onEdit:l,onDuplicate:h,onRemove:p,onKeyChange:g}){const[j,S]=y.useState(0),b=Math.max(1,Math.ceil(s.rows.length/A)),x=Math.min(j,b-1),W=s.rows.slice(x*A,(x+1)*A),H=q[s.operation],w={padding:"4px 8px",borderBottom:`1px solid ${E.colorNeutralStroke2}`};return t.jsxs("div",{children:[t.jsxs(ae,{icon:Se,title:"Rows",sub:`Each row becomes one item in Targets. ${H.keyRequired?"Every row needs a key.":"A key is optional."}`,group:D,children:[t.jsx(k,{icon:t.jsx(It,{}),onClick:o,disabled:!a,children:"Add row"}),t.jsx(k,{icon:t.jsx(Dt,{}),onClick:u,disabled:!a,children:"Import CSV / JSON…"}),t.jsx(k,{icon:t.jsx(te,{}),appearance:"subtle",onClick:c,disabled:s.rows.length===0,children:"Clear"})]}),!a&&t.jsx($,{intent:"info",children:t.jsx(R,{children:"Pick a target table first."})}),s.rows.length>Jt&&t.jsx($,{intent:"warning",layout:"multiline",style:{marginBottom:8},children:t.jsxs(R,{children:[t.jsxs(Me,{children:[s.rows.length.toLocaleString()," rows"]}),"Microsoft recommends 100–1,000 rows per request. Larger requests are more likely to hit message-size or time limits, and on standard tables a failure rolls back every row. Consider splitting the rows into several requests."]})}),r>0&&t.jsx($,{intent:"error",style:{marginBottom:8},children:t.jsxs(R,{children:[r," row issue",r===1?"":"s"," — fix them before sending."]})}),a&&s.rows.length===0&&t.jsx(M,{children:"No rows yet. Add rows one by one, or import them from CSV (header row of column names — Excel copy-paste works) or a JSON array of objects."}),s.rows.length>0&&t.jsxs("table",{style:{borderCollapse:"collapse",width:"100%",fontSize:13},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{textAlign:"left"},children:[t.jsx("th",{style:w,children:"#"}),t.jsx("th",{style:w,children:"Key"}),t.jsx("th",{style:w,children:"Columns"}),t.jsx("th",{style:w,children:"Status"}),t.jsx("th",{style:w,"aria-label":"Actions"})]})}),t.jsx("tbody",{children:W.map((v,J)=>{const F=x*A+J,I=[...Object.keys(v.fieldValues),...v.nullFields],U=e.get(v.id);return t.jsxs("tr",{children:[t.jsx("td",{style:w,children:F+1}),t.jsx("td",{style:{...w,minWidth:220},children:t.jsx(Re,{size:"small",value:v.key,placeholder:ks(s.operation,a),onChange:(Z,V)=>g(v.id,V.value),"aria-label":`Row ${F+1} key`,style:{width:"100%"}})}),t.jsx("td",{style:w,children:t.jsx(M,{title:I.join(", "),children:I.length===0?"—":`${I.length}: ${I.slice(0,3).join(", ")}${I.length>3?"…":""}`})}),t.jsx("td",{style:w,children:U?t.jsx(M,{style:{color:E.colorPaletteRedForeground1},children:U}):t.jsx(M,{style:{color:E.colorPaletteGreenForeground1},children:"Ready"})}),t.jsxs("td",{style:{...w,whiteSpace:"nowrap"},children:[t.jsx(ee,{content:`Edit ${i(v,F)}`,relationship:"label",children:t.jsx(k,{size:"small",appearance:"subtle",icon:t.jsx(Ft,{}),onClick:()=>l(v.id)})}),t.jsx(ee,{content:"Duplicate row",relationship:"label",children:t.jsx(k,{size:"small",appearance:"subtle",icon:t.jsx(re,{}),onClick:()=>h(v.id)})}),t.jsx(ee,{content:"Remove row",relationship:"label",children:t.jsx(k,{size:"small",appearance:"subtle",icon:t.jsx(te,{}),onClick:()=>p(v.id)})})]})]},v.id)})})]}),b>1&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[t.jsx(k,{size:"small",icon:t.jsx(Ce,{}),disabled:x===0,onClick:()=>S(x-1),"aria-label":"Previous page"}),t.jsxs(M,{children:["Rows ",x*A+1,"–",Math.min((x+1)*A,s.rows.length)," of"," ",s.rows.length]}),t.jsx(k,{size:"small",icon:t.jsx($e,{}),disabled:x>=b-1,onClick:()=>S(x+1),"aria-label":"Next page"})]})]})}function Ss({row:s,index:a,count:e,table:r,tbl:i,operation:o,issue:u,themeMode:c,onPatch:l,onNavigate:h,onBack:p,onDuplicate:g,onRemove:j}){const S=q[o];return t.jsxs("div",{children:[t.jsxs(ae,{icon:ke,title:`Row ${a+1} of ${e}`,sub:o==="DeleteMultiple"?"Only the key (and partitionid on partitioned elastic tables) is needed.":void 0,group:D,children:[t.jsx(k,{icon:t.jsx($t,{}),appearance:"subtle",onClick:p,children:"All rows"}),t.jsx(k,{icon:t.jsx(Ce,{}),disabled:a===0,onClick:()=>h(a-1),"aria-label":"Previous row"}),t.jsx(k,{icon:t.jsx($e,{}),disabled:a>=e-1,onClick:()=>h(a+1),"aria-label":"Next row"}),t.jsx(k,{icon:t.jsx(re,{}),onClick:g,children:"Duplicate"}),t.jsx(k,{icon:t.jsx(te,{}),appearance:"subtle",onClick:j,children:"Remove"})]}),t.jsx(Rt,{label:S.keyRequired?"Key (required)":"Key (optional)",hint:o==="UpsertMultiple"?`A ${i?.primaryKey??"primary key"} GUID, or an alternate key segment such as name='Contoso' — sent as @odata.id.`:o==="CreateMultiple"?`Leave empty to let Dataverse assign the id, or set a ${i?.primaryKey??"primary key"} GUID.`:`The ${i?.primaryKey??"primary key"} GUID of the row.`,validationState:u?"error":"none",validationMessage:u,style:{maxWidth:520,marginBottom:12},children:t.jsx(Re,{value:s.key,onChange:(b,x)=>l({key:x.value})})}),S.usesFields&&t.jsx(Mt,{table:r,values:s.fieldValues,setValues:b=>l({fieldValues:b}),nullFields:s.nullFields,setNullFields:b=>l({nullFields:b}),group:D,themeMode:c,purpose:S.fieldPurpose})]})}function Cs({open:s,tbl:a,onClose:e,onImport:r}){const[i,o]=y.useState(""),[u,c]=y.useState(!1),l=y.useMemo(()=>a?cs(i,a):{rows:[],skippedColumns:[],errors:[]},[i,a]),h=async p=>{p&&o(await p.text())};return t.jsx(Ot,{open:s,onOpenChange:(p,g)=>!g.open&&e(),children:t.jsx(Et,{style:{maxWidth:760},children:t.jsxs(Pt,{children:[t.jsxs(qt,{children:["Import rows",a?` into ${a.displayName}`:""]}),t.jsxs(Vt,{style:{display:"flex",flexDirection:"column",gap:10},children:[t.jsxs(M,{children:["Paste CSV / tab-separated text with a header row of column logical (or display) names, or a JSON array of objects. A ",t.jsx("code",{children:a?.primaryKey??"primary key"}),","," ",t.jsx("code",{children:"id"})," or ",t.jsx("code",{children:"@key"})," column fills the row key. Lookups take a GUID (first target) or ",t.jsx("code",{children:"table:guid"}),"; choices take the value or the label."]}),t.jsx(_t,{value:i,onChange:(p,g)=>o(g.value),rows:12,"aria-label":"Rows to import",placeholder:`name,numberofemployees
|
|
4
|
-
Contoso,10
|
|
5
|
-
Fabrikam,25`,textarea:{style:{fontFamily:E.fontFamilyMonospace,fontSize:12}}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[t.jsx("input",{type:"file",accept:".csv,.tsv,.txt,.json","aria-label":"Load rows from a file",onChange:p=>{h(p.target.files?.[0])}}),t.jsx(Kt,{checked:u,onChange:(p,g)=>c(!!g.checked),label:"Replace existing rows"})]}),i.trim()&&t.jsx($,{intent:l.errors.length?"warning":l.rows.length?"success":"info",layout:"multiline",children:t.jsxs(R,{children:[l.rows.length," row",l.rows.length===1?"":"s"," parsed.",l.skippedColumns.length>0&&t.jsxs(t.Fragment,{children:[" Skipped columns (not on this table): ",l.skippedColumns.join(", "),"."]}),l.errors.length>0&&t.jsxs("ul",{style:{margin:"4px 0 0",paddingLeft:18},children:[l.errors.slice(0,6).map(p=>t.jsx("li",{children:p},p)),l.errors.length>6&&t.jsxs("li",{children:["…and ",l.errors.length-6," more"]})]})]})})]}),t.jsxs(zt,{children:[t.jsx(k,{appearance:"secondary",onClick:e,children:"Cancel"}),t.jsxs(k,{appearance:"primary",disabled:l.rows.length===0,onClick:()=>{r(l.rows,u),o("")},children:["Import ",l.rows.length||""," row",l.rows.length===1?"":"s"]})]})]})})})}function $s({result:s,operation:a}){const e=se(s.body),[r,i]=y.useState(!1);return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,maxWidth:760},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[t.jsx(Ut,{status:"success",code:s.status,ms:s.ms}),t.jsxs(Lt,{weight:"semibold",children:[a," ",e.length>0?`created ${e.length} row${e.length===1?"":"s"}`:"completed"]})]}),e.length>0?t.jsxs(t.Fragment,{children:[t.jsx("div",{children:t.jsx(k,{icon:t.jsx(re,{}),onClick:()=>{Tt(e.join(`
|
|
6
|
-
`)).then(()=>i(!0))},children:r?"Copied":"Copy ids"})}),t.jsx("ol",{style:{margin:0,paddingLeft:32,fontFamily:E.fontFamilyMonospace,fontSize:12,maxHeight:480,overflow:"auto"},children:e.map(o=>t.jsx("li",{children:o},o))})]}):t.jsxs(M,{children:[a," returns 204 No Content — Dataverse doesn't report per-row results for it. Every row in the request succeeded (a failure would have rolled back the request on a standard table)."]})]})}export{Ms as BulkWriteMode};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as ke,b6 as Ie,bW as ae,r as n,u as Pe,e as Ne,bX as Ce,bY as we,f as L,bZ as Ee,bP as Z,b_ as Re,ba as De,i as O,k as Me,T as Fe,l as $e,bR as Ae,bS as Be,bG as z,bH as He,L as Le,q as ze,t as e,H as qe,w as Ue,bU as Ve,y as We,z as Oe,A as _e,G as Ge,R as Ye,bV as se,U as Ze,S as Je,I as Ke,bm as Xe,a9 as _,B as G,D as Y,J as re,at as Qe,Y as d,Z as C,a3 as et,b$ as tt,b5 as at,a$ as st,aT as rt,bn as nt,bl as ot}from"./index-DGsVifiB.js";import{N as lt,A as it}from"./AssociateTargetsEditor-CuQhdosb.js";const dt=()=>({table:"",sourceId:null,navProperty:null,targetIds:[],targetNames:{},headers:Ke(),dirty:new Set});function mt({themeMode:l}){const y=ke("disassociate"),g=Ie("disassociate",ae,dt),[t,o]=n.useState(g.state),{table:f}=Pe(t.table||null),{entities:S}=Ne(),[w,c]=n.useState("source"),[b,E]=n.useState("builder"),[R,q]=n.useState(null),[le,J]=n.useState(!1),[ie,de]=n.useState([]),[D,M]=n.useState(g.lastSavedId),[F,$]=n.useState(g.lastSavedHash),[K,U]=n.useState(""),[m,v]=n.useState(null),[X,j]=n.useState(!1),[V,A]=n.useState(null),T=n.useMemo(()=>Ce(t),[t,f]),k=n.useMemo(()=>we(t),[t,f]),p=L(t.table),r=t.navProperty?p?.navigationProperties.find(a=>a.name===t.navProperty):void 0,ce=r?Ee(r):!1,h=r?Z(r):!1,I=h?"PATCH":"DELETE";n.useEffect(()=>{let a=!1;if(A(null),!h||!t.sourceId||!p||!r){v(null),j(!1);return}if(typeof window>"u"||!window.dataverseAPI?.queryData){v(null),j(!1),A("The PPTB host is not available, so the current value cannot be read.");return}v(null),j(!0);const s=`_${r.referencingAttribute||r.name}_value`,u=`/${p.entitySetName}(${t.sourceId})?$select=${s}`;return window.dataverseAPI.queryData(u).then(i=>{if(a)return;const N=i?.value,H=Array.isArray(N)?N[0]??null:N&&typeof N=="object"?N:i&&typeof i=="object"&&(s in i||p.primaryKey in i)?i:null;if(!H)A("Dataverse returned no row for the source record.");else{const te=String(H[s]??""),je=String(H[`${s}@OData.Community.Display.V1.FormattedValue`]??""),Te=String(H[`${s}@Microsoft.Dynamics.CRM.lookuplogicalname`]??"");v(te?{id:te,name:je||null,entity:Te||null}:null)}j(!1)}).catch(i=>{a||(v(null),j(!1),A(i instanceof Error?i.message:String(i)))}),()=>{a=!0}},[h,t.sourceId,t.navProperty,p,r]);const W=a=>o(s=>{const u=new Set(s.dirty);return u.add(a),{...s,dirty:u}}),B=(a,s,u)=>{o(i=>({...i,[a]:s})),u&&W(u)},ue=p?t.sourceId?t.navProperty?ce&&t.targetIds.length===0?"Pick at least one target record to disassociate.":h&&m===null&&!X&&!V?"Source's lookup is already empty — nothing to disassociate.":t.headers.some(a=>a.enabled&&!a.name)?"Fix empty header name.":null:"Pick a navigation property.":"Pick a source record.":"Pick a source table first.",ge=async()=>{J(!0);const a=await rt.disassociate(t);q(a),J(!1),E("results"),de(s=>[{id:`r-${Date.now()}`,snapshot:x,modeId:"disassociate",url:T.relativeUrl,method:I,ts:Date.now(),status:a.status,ms:a.ms,rowCount:se(a,k.length)??0},...s].slice(0,8)),o(s=>({...s,dirty:new Set}))},x=n.useMemo(()=>Re(t),[t]);De("disassociate",x,D,F);const he=n.useMemo(()=>O(x),[x]),Q=F===null?!0:he!==F,ye=a=>{M(a.id),$(O(a.state))},ee=a=>{if(a.modeId!=="disassociate")return;const s=a.state;if(S.length>0&&!S.some(u=>u.logicalName===s.table)){Xe(`Can't load "${a.name}": entity \`${s.table}\` isn't available in this environment. The solution may have been removed or you may be connected to a different org.`);return}o(ae(s)),M(a.id),$(O(s)),q(null),U(""),c("source")},me=a=>{const s=nt(a,"disassociate");if(!s)return;const u=D,i=F;ee(s),M(u),$(i)};Me(n.useMemo(()=>t.table?{state:x,modeId:"disassociate",dirty:Q,lastSavedId:D,onSaved:ye,onLoadSaved:ee}:null,[x,Q,D,t.table]));const pe=[{id:"source",label:"Target",meta:p?.displayName??"Pick a table",items:[{id:"source",icon:$e,iconFilled:Fe,label:t.sourceId?K||`${p?.displayName??""} (selected)`:"Pick a record",badge:r?I:null,badgeAppearance:"tint",badgeColor:"brand",dirty:t.dirty.has("source")}]},{id:"relationship",label:"Relationship",meta:r?oe(r.cardinality):"pick one",items:[{id:"nav",icon:Be,iconFilled:Ae,label:r?r.name:"Navigation property",code:!!r,badge:r?oe(r.cardinality):null,badgeAppearance:"ghost",dirty:t.dirty.has("nav")}]},{id:"target",label:"Related",meta:h?m?`clear: ${m.name??m.id.slice(0,8)}…`:V?"value unknown":"lookup empty":t.targetIds.length?`${t.targetIds.length} target${t.targetIds.length===1?"":"s"}`:"none",items:[{id:"target",icon:He,iconFilled:z,label:h?"Target — implicit":t.targetIds.length>1?"Target records":"Target record",badge:h?"∅":t.targetIds.length||null,badgeAppearance:"tint",badgeColor:t.targetIds.length>0?"success":"subtle",dirty:t.dirty.has("target")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(a=>a.enabled).length} active`,items:[{id:"headers",icon:ze,iconFilled:Le,label:"HTTP headers",badge:t.headers.filter(a=>a.enabled).length||null,dirty:t.dirty.has("headers")}]}];let P;switch(w){case"source":P=e.jsx(Ue,{table:t.table,onTableChange:a=>{o(s=>({...s,table:a,sourceId:null,navProperty:null,targetIds:[],targetNames:{},dirty:new Set(["source","nav","target"])})),U(""),v(null),q(null),M(void 0),$(null)},recordId:t.sourceId,onRecordChange:(a,s)=>{B("sourceId",a,"source"),U(s??"")},group:"relate",sub:"Pick the source record holding the relationship link to remove."});break;case"nav":P=e.jsx("div",{children:e.jsx(lt,{table:t.table,value:t.navProperty,onChange:a=>{o(s=>({...s,navProperty:a,targetIds:[],targetNames:{}})),W("nav"),W("target")},group:"relate",forOperation:"disassociate",footer:r&&e.jsx(ut,{nav:r})})});break;case"target":P=e.jsx(ct,{state:t,setTargetIds:a=>B("targetIds",a,"target"),targetNames:t.targetNames,setTargetNames:a=>B("targetNames",a),currentLookup:m,currentLookupLoading:X,currentLookupError:V});break;case"headers":P=e.jsx(qe,{items:t.headers,setItems:a=>B("headers",a,"headers"),group:"relate"});break}const be=Ve(I,We(t.headers,null)),ve=k[0],xe={method:I,built:T,headers:be,body:ve?.body,entityLogical:T.entityLogical,multiRequests:k.length>1?k.map(a=>({method:a.method,relativeUrl:a.relativeUrl,body:a.body,description:a.targetId?`target ${a.targetId}`:"clear lookup (null)"})):void 0},fe=h?m?.name?[m.name]:[]:t.targetIds.map(a=>t.targetNames[a]).filter(a=>!!a),Se=h?m?1:0:t.targetIds.length;return e.jsx(Oe,{sidebar:e.jsx(Je,{type:y,urlPreview:T.relativeNoBase,sections:pe,activeNode:w,onSelect:a=>{c(a),E("builder")},recents:ie,onRecentClick:me}),urlBar:e.jsx(Ze,{method:I,url:T.relativeUrl,executeVerb:y.executeVerb,disabledReason:ue,loading:le,onExecute:ge}),children:e.jsxs(_e,{tab:b,onTabChange:E,resultCount:se(R,k.length),children:[b==="builder"&&P,b==="code"&&e.jsx(Ge,{themeMode:l,inputs:xe}),b==="results"&&e.jsx(Ye,{result:R,mode:"single",table:t.table,writeContext:{operation:"disassociate",table:t.table,recordId:t.sourceId,recordName:K||null,navProperty:t.navProperty??void 0,targetCount:Se,targetNames:fe,targetNameById:t.targetNames}})]})})}function ct({state:l,setTargetIds:y,targetNames:g,setTargetNames:t,currentLookup:o,currentLookupLoading:f,currentLookupError:S}){const w=L(l.table),c=l.navProperty?w?.navigationProperties.find(R=>R.name===l.navProperty):void 0;if(!c)return e.jsxs("div",{children:[e.jsx(_,{icon:z,title:"Target record",sub:"Pick a navigation property first.",group:"relate"}),e.jsx(G,{layout:"multiline",intent:"info",style:{maxWidth:720},children:e.jsxs(Y,{children:["Switch to the ",e.jsx("strong",{children:"Relationship"})," pane and pick a navigation property."]})})]});const b=L(c.targetEntity);return Z(c)?e.jsxs("div",{children:[e.jsx(_,{icon:z,title:"Target — implicit (single-valued)",sub:e.jsxs(e.Fragment,{children:["Single-valued nav props don't take a target id. The ",e.jsx("code",{children:"PATCH"})," body"," ",e.jsx("code",{children:`{ "${c.name}@odata.bind": null }`})," clears the lookup on the source row."]}),group:"relate"}),e.jsx(G,{layout:"multiline",intent:"warning",icon:e.jsx(Qe,{}),style:{maxWidth:880,marginBottom:14},children:e.jsxs(Y,{children:[e.jsx(re,{children:"This clears the lookup."}),e.jsx("code",{children:c.name})," on the source row becomes ",e.jsx("code",{children:"null"}),". The related row is"," ",e.jsx("strong",{children:"not"})," deleted — only the link is removed."]})}),e.jsxs("div",{style:{border:`1px solid ${d.colorNeutralStroke2}`,borderRadius:d.borderRadiusMedium,padding:12,maxWidth:560},children:[e.jsxs(C,{style:{color:d.colorNeutralForeground3,display:"block",marginBottom:8},children:["Current lookup value",f?" (loading…)":""]}),f?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(et,{size:"tiny"}),e.jsx(C,{children:"Fetching the lookup's current value from Dataverse…"})]}):o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx(tt,{size:28,name:o.name??void 0,color:"colorful"}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600},children:o.name??"(name not available)"}),e.jsxs("div",{style:{fontFamily:d.fontFamilyMonospace,fontSize:10,color:d.colorNeutralForeground3},children:["/",(o.entity&&L(o.entity)?.entitySetName)??b?.entitySetName??c.targetEntity,"(",o.id,")"]})]})]}),o.entity&&o.entity!==c.targetEntity&&e.jsxs(C,{style:{display:"block",marginTop:8,color:d.colorNeutralForeground3},children:["The lookup currently references a ",e.jsx("code",{children:o.entity})," row, not"," ",e.jsx("code",{children:c.targetEntity}),"."]})]}):S?e.jsx(G,{layout:"multiline",intent:"warning",children:e.jsxs(Y,{children:[e.jsx(re,{children:"Couldn't read the current value."}),"Execute still sends the ",e.jsx("code",{children:"PATCH"}),"; if the lookup is already empty it changes nothing. ",e.jsx("code",{children:S})]})}):e.jsx(C,{style:{color:d.colorNeutralForeground3,fontStyle:"italic"},children:"Source's lookup is already empty — the PATCH would be a no-op."})]})]}):e.jsxs("div",{children:[e.jsx(_,{icon:z,title:l.targetIds.length>1?"Target records":"Target record",sub:e.jsxs(e.Fragment,{children:["Pick one or more ",e.jsx("code",{children:b?.logicalName})," rows to remove from the collection. Each fires a separate DELETE request per docs — the target rows are"," ",e.jsx("strong",{children:"not"})," deleted, only the links."]}),group:"relate"}),e.jsx(it,{table:l.table,navProperty:l.navProperty,targets:l.targetIds,setTargets:y,targetNames:g,setTargetNames:t,group:"relate",resolvedMethod:null})]})}function ut({nav:l}){const y=at(),g=Z(l);return e.jsxs("div",{className:st(y.inlineCard),style:{padding:12},children:[e.jsx("strong",{style:{fontSize:12,display:"block",marginBottom:8},children:"URL shape per cardinality"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:10},children:[e.jsx(ne,{label:"Collection-valued (1:N / N:N)",syntax:"DELETE /<set>(<id>)/<nav>(<related-id>)/$ref",note:"One DELETE per target id.",active:!g}),e.jsx(ne,{label:"Single-valued (N:1)",syntax:`PATCH /<set>(<id>)
|
|
2
|
-
{ "<nav>@odata.bind": null }`,note:"Clears the lookup — docs-preferred over DELETE/$ref (and the only path PPTB exposes).",active:g})]})]})}function ne({label:l,syntax:y,note:g,active:t}){return e.jsxs("div",{style:{padding:10,border:`1px solid ${t?d.colorBrandStroke1:d.colorNeutralStroke2}`,background:t?d.colorBrandBackground2:"transparent",borderRadius:d.borderRadiusMedium,opacity:t?1:.55},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[e.jsx("strong",{style:{fontSize:11},children:l}),t&&e.jsx(ot,{appearance:"tint",color:"brand",size:"extra-small",style:{marginLeft:"auto",fontWeight:700},children:"ACTIVE"})]}),e.jsx("code",{style:{fontFamily:d.fontFamilyMonospace,fontSize:11,wordBreak:"break-all",display:"block",whiteSpace:"pre-wrap"},children:y}),e.jsx(C,{style:{display:"block",marginTop:4,color:d.colorNeutralForeground3},children:g})]})}function oe(l){switch(l){case"OneToMany":return"1:N";case"ManyToOne":return"N:1";case"ManyToMany":return"N:N"}}export{mt as DisassociateMode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b5 as X,t as e,a$ as he,Y as p,r as l,Z as j,a3 as Z,B as q,D as L,J as Q,bl as k,c as pe,b6 as ge,c1 as _,c2 as we,c3 as xe,u as ke,f as be,e as je,c4 as Se,ba as ve,i as H,k as Ee,c5 as M,c6 as Ie,T as K,l as Te,L as Ne,q as Pe,H as Ce,a9 as ee,a5 as te,b4 as qe,y as Y,z as Le,A as Me,G as Ae,R as Re,U as We,S as $e,I as Be,bm as Fe,bj as De,b3 as J,aT as He,bn as Oe}from"./index-DGsVifiB.js";function ze({rows:i,keyWidth:s,className:d}){const t=X(),a=s!=null?{gridTemplateColumns:`${typeof s=="number"?`${s}px`:s} 1fr`}:void 0;return e.jsx("div",{className:he(t.kvGrid,d),style:a,children:i.map((n,m)=>e.jsx(Ve,{k:n.k,v:n.v,mono:n.mono},m))})}function Ve({k:i,v:s,mono:d}){const t=X();return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:t.kvKey,children:i}),e.jsx("span",{className:d?t.kvValMono:t.kvVal,children:s==null||s===""?e.jsx("em",{style:{color:p.colorNeutralForeground4},children:"—"}):s})]})}const Ue="http://schemas.microsoft.com/winfx/2006/xaml",Ge=new Set(["InputEntities","CreatedEntities"]);function _e(i){if(!i||typeof DOMParser>"u")return[];let s;try{s=new DOMParser().parseFromString(i,"application/xml")}catch{return[]}if(s.getElementsByTagName("parsererror").length>0)return[];const d=[],t=s.getElementsByTagNameNS(Ue,"Property");for(const a of Array.from(t)){const n=a.getAttribute("Name"),m=/^(In|InOut)Argument\((.*)\)$/.exec((a.getAttribute("Type")??"").trim());if(!n||!m||Ge.has(n))continue;let h=!1,g=null;for(const o of Array.from(a.getElementsByTagName("*"))){const y=o.getAttribute("Value");o.localName==="ArgumentRequiredAttribute"&&(h=y?.toLowerCase()==="true"),o.localName==="ArgumentDescriptionAttribute"&&y&&(g=y)}d.push({name:n,direction:m[1],type:m[2].trim(),required:h,description:g})}return d}function Ke(i){return i.replace(/\b[a-z]+:/g,"")}function Ye({workflowId:i}){const[s,d]=l.useState({status:"loading"});l.useEffect(()=>{if(typeof window>"u"||!window.dataverseAPI?.queryData){d({status:"ready",args:[]});return}let a=!1;return d({status:"loading"}),window.dataverseAPI.queryData(`workflows?$select=xaml&$filter=workflowid eq ${i}`).then(n=>{if(a)return;const m=n?.value?.[0],h=typeof m?.xaml=="string"?m.xaml:null;d({status:"ready",args:_e(h)})}).catch(n=>{a||d({status:"error",message:n instanceof Error?n.message:String(n)})}),()=>{a=!0}},[i]);const t={color:p.colorNeutralForeground3,display:"block",marginTop:10};return s.status==="loading"?e.jsxs(j,{style:{...t,display:"flex",alignItems:"center",gap:6},children:[e.jsx(Z,{size:"extra-tiny"})," Reading the workflow's input arguments…"]}):s.status==="error"?e.jsxs(j,{style:t,children:["Couldn't read the workflow definition to check for input arguments: ",s.message]}):s.args.length===0?e.jsxs(j,{style:t,children:["No input arguments declared — ",e.jsx("code",{children:"EntityId"})," is the whole request body."]}):e.jsx(q,{layout:"multiline",intent:"warning",style:{marginTop:12},children:e.jsxs(L,{children:[e.jsxs(Q,{children:["This workflow declares ",s.args.length," input argument",s.args.length===1?"":"s"]}),"The Web API ",e.jsx("code",{children:"ExecuteWorkflow"})," action only takes ",e.jsx("code",{children:"EntityId"}),", so these can't be set from here; the workflow runs with their default values.",e.jsx("ul",{style:{margin:"6px 0 0",paddingLeft:18},children:s.args.map(a=>e.jsxs("li",{children:[e.jsx("code",{children:a.name})," ",e.jsx(k,{appearance:"outline",size:"small",children:Ke(a.type)}),a.direction==="InOut"&&e.jsx(k,{appearance:"tint",size:"small",style:{marginLeft:4},children:"in/out"}),a.required&&e.jsx(k,{appearance:"tint",color:"danger",size:"small",style:{marginLeft:4},children:"required"}),a.description&&e.jsxs("span",{style:{color:p.colorNeutralForeground3},children:[" — ",a.description]})]},a.name))})]})})}const Je=()=>({workflowId:null,entityId:null,headers:Be(),dirty:new Set});function et({themeMode:i}){const s=pe("exec-workflow"),d=ge("exec-workflow",_,Je),[t,a]=l.useState(d.state),[n,m]=l.useState("pick"),[h,g]=l.useState("builder"),[o,y]=l.useState(null),[S,I]=l.useState(!1),[A,re]=l.useState([]),v=l.useMemo(()=>we(t),[t]),se=l.useMemo(()=>xe(t),[t]),[T,O]=l.useState([]),[ne,R]=l.useState(!1),[ae,W]=l.useState(null);l.useEffect(()=>{let r=!1;if(typeof window>"u"||!window.dataverseAPI?.queryData){O([]),W("Workflows can only be loaded from a live Dataverse connection (PPTB).");return}return R(!0),W(null),window.dataverseAPI.queryData("workflows?$select=workflowid,name,uniquename,primaryentity,description&$filter=(statecode eq 1 and type eq 1 and ondemand eq true and category eq 0)&$orderby=name asc").then(f=>{if(r)return;const w=f?.value??[];O(w.map(x=>({id:String(x.workflowid??""),name:String(x.name??"(unnamed)"),uniqueName:x.uniquename!=null?String(x.uniquename):null,primaryEntity:String(x.primaryentity??""),description:x.description!=null?String(x.description):null}))),R(!1)}).catch(f=>{r||(W(f instanceof Error?f.message:String(f)),R(!1))}),()=>{r=!0}},[]);const c=t.workflowId?T.find(r=>r.id===t.workflowId):void 0;ke(c?.primaryEntity??null);const E=c?be(c.primaryEntity):void 0,{entities:z}=je(),[N,$]=l.useState(d.lastSavedId),[P,B]=l.useState(d.lastSavedHash),[oe,F]=l.useState(""),D=r=>a(u=>{const f=new Set(u.dirty);return f.add(r),{...u,dirty:f}}),V=(r,u,f)=>{a(w=>({...w,[r]:u})),f&&D(f)},ie=c?t.entityId?t.headers.some(r=>r.enabled&&!r.name)?"Fix empty header name.":null:`Pick a ${c.primaryEntity} record to run the workflow on.`:"Pick a workflow.",le=async()=>{I(!0);const r=await He.workflow(t,Y(t.headers,null));y(r),I(!1),g("results"),re(u=>[{id:`r-${Date.now()}`,snapshot:b,modeId:"exec-workflow",url:v.relativeUrl,method:"POST",ts:Date.now(),status:r.status,ms:r.ms,rowCount:r.ok?1:0},...u].slice(0,8)),a(u=>({...u,dirty:new Set}))},b=l.useMemo(()=>Se(t),[t]);ve("exec-workflow",b,N,P);const de=l.useMemo(()=>H(b),[b]),U=P===null?!0:de!==P,ce=r=>{$(r.id),B(H(r.state))},G=r=>{if(r.modeId!=="exec-workflow")return;const u=r.state,f=T.find(w=>w.id===u.workflowId);if(f&&z.length>0&&!z.some(w=>w.logicalName===f.primaryEntity)){Fe(`Can't load "${r.name}": workflow's primary entity \`${f.primaryEntity}\` isn't available in this environment.`);return}a(_(u)),$(r.id),B(H(u)),y(null),F(""),m("pick")},ue=r=>{const u=Oe(r,"exec-workflow");if(!u)return;const f=N,w=P;G(u),$(f),B(w)};Ee(l.useMemo(()=>t.workflowId?{state:b,modeId:"exec-workflow",dirty:U,lastSavedId:N,onSaved:ce,onLoadSaved:G}:null,[b,U,N,t.workflowId,T]));const me=[{id:"workflow",label:"Target",meta:c?.name??"pick one",items:[{id:"pick",icon:Ie,iconFilled:M,label:c?.name??"Pick on-demand workflow",dirty:t.dirty.has("pick")}]},{id:"target",label:"Bound to",meta:c?`${E?.displayName??c.primaryEntity} record`:"—",items:[{id:"target",icon:Te,iconFilled:K,label:t.entityId?`${E?.displayName??""} (selected)`:"Pick a record",badge:t.entityId?"✓":null,badgeAppearance:"ghost",dirty:t.dirty.has("target")}]},{id:"headers",label:"Headers",meta:`${t.headers.filter(r=>r.enabled).length} active`,items:[{id:"headers",icon:Pe,iconFilled:Ne,label:"HTTP headers",badge:t.headers.filter(r=>r.enabled).length||null,dirty:t.dirty.has("headers")}]}];let C;switch(n){case"pick":C=e.jsx(Xe,{workflows:T,loading:ne,error:ae,workflowId:t.workflowId,setWorkflowId:r=>{a(u=>({...u,workflowId:r,entityId:null})),F(""),D("pick"),D("target")}});break;case"target":C=c?e.jsxs("div",{children:[e.jsx(ee,{icon:K,title:"Target record",sub:`The ${E?.displayName??c.primaryEntity} record the workflow operates on. Slots into the request body as "EntityId".`,group:"execute"}),e.jsxs("div",{style:{maxWidth:480},children:[e.jsx(te,{label:`${E?.displayName??c.primaryEntity} record`,children:e.jsx(qe,{table:c.primaryEntity,selectedId:t.entityId,onPick:r=>{V("entityId",r?.id??null,"target"),F(r?.primary??"")},placeholder:`Search ${E?.displayName??c.primaryEntity} records…`})}),e.jsx(Ye,{workflowId:c.id})]})]}):e.jsx(q,{layout:"multiline",intent:"info",children:e.jsx(L,{children:"Pick a workflow first."})});break;case"headers":C=e.jsx(Ce,{items:t.headers,setItems:r=>V("headers",r,"headers"),group:"execute",sendsHeaders:!0});break}const fe=Y(t.headers,null),ye={method:"POST",built:v,headers:fe,body:se,entityLogical:v.entityLogical};return e.jsx(Le,{sidebar:e.jsx($e,{type:s,urlPreview:v.relativeNoBase,sections:me,activeNode:n,onSelect:r=>{m(r),g("builder")},recents:A,onRecentClick:ue}),urlBar:e.jsx(We,{method:"POST",url:v.relativeUrl,executeVerb:s.executeVerb,executeIcon:M,disabledReason:ie,loading:S,onExecute:le}),children:e.jsxs(Me,{tab:h,onTabChange:g,resultCount:o?.ok?1:null,children:[h==="builder"&&C,h==="code"&&e.jsx(Ae,{themeMode:i,inputs:ye}),h==="results"&&e.jsx(Re,{result:o,mode:"single",table:c?.primaryEntity??"",writeContext:{operation:"workflow",table:c?.primaryEntity??"",recordId:t.entityId,recordName:oe||null,operationName:c?.name??void 0}})]})})}function Xe({workflows:i,loading:s,error:d,workflowId:t,setWorkflowId:a}){const n=t?i.find(o=>o.id===t):void 0,[m,h]=l.useState("");l.useEffect(()=>{h(n?.name??"")},[n?.name]);const g=l.useMemo(()=>{const o=m.trim().toLowerCase();return!o||o===(n?.name??"").toLowerCase()?i:i.filter(y=>y.name.toLowerCase().includes(o)||(y.uniqueName?.toLowerCase().includes(o)??!1)||y.primaryEntity.toLowerCase().includes(o)||(y.description?.toLowerCase().includes(o)??!1))},[i,m,n]);return e.jsxs("div",{children:[e.jsx(ee,{icon:M,title:"On-demand workflow",sub:"Pick an activated workflow (type=Definition, category=Workflow). The workflow's primary entity drives the Target picker.",group:"execute",children:s?e.jsx(k,{appearance:"ghost",icon:e.jsx(Z,{size:"extra-tiny"}),children:"loading…"}):e.jsxs(k,{appearance:"ghost",children:[i.length," workflow",i.length===1?"":"s"]})}),d&&e.jsx(q,{intent:"error",layout:"multiline",style:{marginBottom:12,maxWidth:760},children:e.jsxs(L,{children:["Couldn't load workflows: ",d]})}),e.jsxs("div",{style:{maxWidth:760},children:[e.jsx(te,{label:"Workflow",children:e.jsxs(De,{freeform:!0,clearable:!0,value:m,selectedOptions:t?[t]:[],onChange:o=>{const y=o.target.value;h(y),y===""&&t&&a(null)},onOptionSelect:(o,y)=>{const S=y.optionValue??null;if(a(S),S){const I=i.find(A=>A.id===S);h(I?.name??"")}else h("")},placeholder:s?"Loading workflows…":i.length===0?"No activated workflows in this environment":"Search workflows…",disabled:s||i.length===0,listbox:{style:{maxHeight:420}},children:[g.length===0&&m.trim()&&e.jsx(J,{value:"__none",text:"",disabled:!0,children:e.jsxs(j,{style:{color:p.colorNeutralForeground3},children:['No workflows match "',m.trim(),'"']})}),g.map(o=>e.jsx(J,{value:o.id,text:o.name,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("span",{children:o.name}),e.jsxs(j,{style:{color:p.colorNeutralForeground3},children:["Primary entity:"," ",e.jsx("span",{style:{fontFamily:p.fontFamilyMonospace},children:o.primaryEntity}),o.description?` · ${o.description}`:""]})]})},o.id))]})}),n&&e.jsxs("div",{style:{marginTop:16,padding:12,border:`1px solid ${p.colorNeutralStroke2}`,borderRadius:p.borderRadiusMedium,background:p.colorNeutralBackground1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx(M,{style:{color:p.colorBrandForeground1}}),e.jsx("strong",{style:{fontSize:13},children:n.name}),e.jsx(k,{appearance:"ghost",children:n.primaryEntity}),e.jsx("span",{style:{flexGrow:1}}),e.jsx(k,{appearance:"filled",color:"success",style:{fontWeight:700},children:"POST"})]}),e.jsx(j,{style:{color:p.colorNeutralForeground2,display:"block",marginBottom:8},children:n.description}),e.jsx(ze,{keyWidth:120,rows:[{k:"Workflow id",v:n.id,mono:!0},{k:"Primary entity",v:n.primaryEntity,mono:!0},{k:"URL shape",v:`POST /workflows(${n.id})/Microsoft.Dynamics.CRM.ExecuteWorkflow`,mono:!0},{k:"Body shape",v:'{ "EntityId": "<target-guid>" }',mono:!0},{k:"Response",v:"204 No Content — workflow runs async"}]}),e.jsx(q,{layout:"multiline",intent:"info",style:{marginTop:12},children:e.jsxs(L,{children:[e.jsx(Q,{children:"Workflow runs are asynchronous."}),"The 204 only confirms the request was accepted. Check the ",e.jsx("code",{children:"workflowlogs"})," ","/ ",e.jsx("code",{children:"asyncoperations"})," tables for completion + result."]})})]})]})]})}export{et as ExecuteWorkflowMode};
|