@ppdostudio/ppdo-cli 0.0.0-stage → 1.0.0-beta.1
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 +66 -0
- package/LICENSE +114 -0
- package/README.md +362 -3
- package/THIRD-PARTY-NOTICES +25 -0
- package/dist/bin.js +5 -0
- package/dist/chunks/ado-XAHQWYNQ.js +103 -0
- package/dist/chunks/api-7RAWLIQV.js +2 -0
- package/dist/chunks/api-KN24TLH6.js +2 -0
- package/dist/chunks/auth-VZSJMSMF.js +6 -0
- package/dist/chunks/azCli-AEZK2RBQ.js +2 -0
- package/dist/chunks/batch-EZPKLWEI.js +4 -0
- package/dist/chunks/build-LSQEAEFK.js +4 -0
- package/dist/chunks/bulk-7FZCDH5U.js +2 -0
- package/dist/chunks/chunk-4KP27OCL.js +2 -0
- package/dist/chunks/chunk-5SBBTR3Y.js +2 -0
- package/dist/chunks/chunk-B4FPKDMH.js +2 -0
- package/dist/chunks/chunk-BALEFXOL.js +29 -0
- package/dist/chunks/chunk-BCAXUZIO.js +2 -0
- package/dist/chunks/chunk-BODUSF3V.js +2 -0
- package/dist/chunks/chunk-C42MGXRN.js +2 -0
- package/dist/chunks/chunk-DVQ7OYIJ.js +2 -0
- package/dist/chunks/chunk-GE3XBV3K.js +2 -0
- package/dist/chunks/chunk-H4OY4EFC.js +3 -0
- package/dist/chunks/chunk-HIW2K6OP.js +4 -0
- package/dist/chunks/chunk-I3TMFYRJ.js +194 -0
- package/dist/chunks/chunk-J4R6QXW7.js +2 -0
- package/dist/chunks/chunk-JAGU2NM5.js +2 -0
- package/dist/chunks/chunk-JEAIFLEN.js +51 -0
- package/dist/chunks/chunk-KBQYSAJX.js +2 -0
- package/dist/chunks/chunk-LB7WNZVK.js +5 -0
- package/dist/chunks/chunk-LL4XQ3L7.js +4 -0
- package/dist/chunks/chunk-MBNUMAAZ.js +2 -0
- package/dist/chunks/chunk-MGZDEW3X.js +8 -0
- package/dist/chunks/chunk-MK6QZ4ES.js +2 -0
- package/dist/chunks/chunk-MTF66YXU.js +2 -0
- package/dist/chunks/chunk-MZEUD7ET.js +6 -0
- package/dist/chunks/chunk-OXZG44O5.js +2 -0
- package/dist/chunks/chunk-PYTSDUPY.js +2 -0
- package/dist/chunks/chunk-QMTPHZLQ.js +2 -0
- package/dist/chunks/chunk-RC5VPVGC.js +2 -0
- package/dist/chunks/chunk-S4KF5Z3S.js +10 -0
- package/dist/chunks/chunk-STWQDANK.js +5 -0
- package/dist/chunks/chunk-TADCW6ZI.js +2 -0
- package/dist/chunks/chunk-TM3M633T.js +3 -0
- package/dist/chunks/chunk-TQLZ3TRU.js +2 -0
- package/dist/chunks/chunk-TXVNEV3M.js +3 -0
- package/dist/chunks/chunk-TZSB4PR7.js +4 -0
- package/dist/chunks/chunk-UCTMKA2J.js +4 -0
- package/dist/chunks/chunk-WIA546AL.js +13 -0
- package/dist/chunks/chunk-WMDKJRDC.js +2 -0
- package/dist/chunks/chunk-WNQERCOO.js +2 -0
- package/dist/chunks/chunk-WXOTXJNG.js +3 -0
- package/dist/chunks/chunk-ZHHVG47C.js +2 -0
- package/dist/chunks/chunk-ZNJ4DRCA.js +2 -0
- package/dist/chunks/chunk-ZUXLC5VX.js +2 -0
- package/dist/chunks/commands-GRWX32IX.js +2 -0
- package/dist/chunks/component-TCL43QXZ.js +2 -0
- package/dist/chunks/components-LRHXR5HR.js +2 -0
- package/dist/chunks/config-UKI5TBH5.js +2 -0
- package/dist/chunks/connection-QNXMJGHZ.js +2 -0
- package/dist/chunks/connref-U3CMQ64O.js +2 -0
- package/dist/chunks/customizations-VNEASPWI.js +7 -0
- package/dist/chunks/dependency-U6OQA5PS.js +3 -0
- package/dist/chunks/discovery-IWAWXXWF.js +2 -0
- package/dist/chunks/dist-ILNYGTM2.js +136 -0
- package/dist/chunks/dv-C45WDXRG.js +192 -0
- package/dist/chunks/env-GL5ZPAZI.js +5 -0
- package/dist/chunks/environment-FPS4AFM5.js +2 -0
- package/dist/chunks/environments-VZWNFJYE.js +2 -0
- package/dist/chunks/envvar-52V6K6LF.js +2 -0
- package/dist/chunks/esm-Z4QMBGAD.js +2 -0
- package/dist/chunks/fanout-Q3656CCP.js +2 -0
- package/dist/chunks/fetchxml-FWUQZP4M.js +6 -0
- package/dist/chunks/functions-SNCK2IYV.js +2 -0
- package/dist/chunks/graph-OK24IOUV.js +5 -0
- package/dist/chunks/group-TLGLTTUG.js +6 -0
- package/dist/chunks/history-67SQS54S.js +2 -0
- package/dist/chunks/identity-SRTOEQVC.js +2 -0
- package/dist/chunks/jobs-2ZPBDDHT.js +2 -0
- package/dist/chunks/lifecycle-OJRM7K2I.js +2 -0
- package/dist/chunks/main-HOYSLMHZ.js +4 -0
- package/dist/chunks/metadata-WYVJ7NP7.js +2 -0
- package/dist/chunks/metadataCreate-PBA3KH3A.js +2 -0
- package/dist/chunks/msalUser-3PBGT655.js +2 -0
- package/dist/chunks/names-ZRM6SAYU.js +2 -0
- package/dist/chunks/pack-3OYGV36R.js +2 -0
- package/dist/chunks/pat-KGOBISLG.js +2 -0
- package/dist/chunks/pipelines-62CVDRXV.js +4 -0
- package/dist/chunks/plan-ALLKT2QZ.js +2 -0
- package/dist/chunks/plugins-SBMDFXVA.js +4 -0
- package/dist/chunks/policies-BZR5437X.js +2 -0
- package/dist/chunks/pools-I4NVR67Z.js +2 -0
- package/dist/chunks/process-WS76WV3T.js +2 -0
- package/dist/chunks/project-HSZLY2AY.js +2 -0
- package/dist/chunks/projects-GXIQO7HV.js +4 -0
- package/dist/chunks/protect-X2J7LU7X.js +2 -0
- package/dist/chunks/provider-FN7TXWRE.js +2 -0
- package/dist/chunks/prs-F2EVQJRV.js +2 -0
- package/dist/chunks/records-7IQET422.js +2 -0
- package/dist/chunks/run-APD3TRCW.js +2 -0
- package/dist/chunks/run-G2MVOV3C.js +3 -0
- package/dist/chunks/run-H2OLE76P.js +2 -0
- package/dist/chunks/run-ICS4FNZA.js +3 -0
- package/dist/chunks/run-KP2SNX2A.js +3 -0
- package/dist/chunks/run-LNEOCXZA.js +2 -0
- package/dist/chunks/run-SB4QN5Q4.js +2 -0
- package/dist/chunks/run-XRPU3YZF.js +2 -0
- package/dist/chunks/runtime-MIU5CS5B.js +2 -0
- package/dist/chunks/security-RC3EI7CZ.js +2 -0
- package/dist/chunks/service-4VHAPTA6.js +2 -0
- package/dist/chunks/service-RFKOKM72.js +2 -0
- package/dist/chunks/services-4BORTJPM.js +2 -0
- package/dist/chunks/skills-6O2GSTU4.js +2 -0
- package/dist/chunks/solution-3WUUDYF3.js +2 -0
- package/dist/chunks/solutionExport-GTBTHG2D.js +2 -0
- package/dist/chunks/solutionfiles-VWZHFZZ6.js +2 -0
- package/dist/chunks/spn-2RZJLCML.js +2 -0
- package/dist/chunks/tokenCache-TQFT6LAD.js +2 -0
- package/dist/chunks/unpack-HUH7OJMP.js +2 -0
- package/dist/chunks/users-JIBQKPYA.js +2 -0
- package/dist/chunks/vargroups-Q2KG7LHR.js +2 -0
- package/dist/chunks/whoami-V54TCLT5.js +2 -0
- package/dist/chunks/workitems-UG5O3EGB.js +2 -0
- package/dist/chunks/xmldoc-B2HUNTVK.js +2 -0
- package/package.json +57 -6
- package/schema/ppdo-cli.schema.json +132 -0
- package/skills/README.md +12 -0
- package/skills/ppdo-cli/SKILL.md +84 -0
- package/skills/ppdo-cli-dataverse/SKILL.md +302 -0
- package/skills/ppdo-cli-devops/SKILL.md +150 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
import{e as Z}from"./chunk-DVQ7OYIJ.js";import"./chunk-PYTSDUPY.js";import{B as K,C as W,D as X,E as P,G as V,H as Y,I as k,P as T,Q,a as v,b as O,d as I,e as N,j as B,m as b,n as q,o as u,p as L,q as E,t as _,u as H,w as J}from"./chunk-TXVNEV3M.js";import"./chunk-UCTMKA2J.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{b as F}from"./chunk-5SBBTR3Y.js";import{e as A}from"./chunk-S4KF5Z3S.js";import{a as z,b as R,d as U}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";import{writeFileSync as dt}from"node:fs";import{basename as ut}from"node:path";import{crc32 as mt,deflateRawSync as pt}from"node:zlib";var it=500,tt=25,G=["required","dependent"],rt=["componenttype","componentobjectid","componentparentid","componentbasesolutionid"],ft=["dependencyid","dependencytype",...G.flatMap(t=>rt.map(e=>t+e))].join(","),et="($select=_topsolutionid_value)",gt=`requiredcomponentnodeid${et},dependentcomponentnodeid${et}`,yt=["PicklistAttributeMetadata","MultiSelectPicklistAttributeMetadata","StateAttributeMetadata","StatusAttributeMetadata","BooleanAttributeMetadata"],at=[["Attributes","columns"],["Keys","keys"],["OneToManyRelationships","relationships"],["ManyToOneRelationships","relationships"],["ManyToManyRelationships","relationships"]];function ht(t){let e=b(t.solution)||b(t.required)||b(t.dependent);if(!e&&t.all&&!t.includeSystem)throw new R("--all with no filter reads every dependency row in the environment",{hint:"filter with --solution, --required or --dependent, or pass --include-system"});if(t.type!==void 0&&t.type!==null&&!e)throw new R("--type needs --solution, --required or --dependent")}function wt(t,e){let n=e.filter(o=>!O(o));if(n.length)throw new R(`not a component id: '${n[0]}'`);let s=e.map(o=>`'${I(o)}'`).join(",");return`Microsoft.Dynamics.CRM.In(PropertyName='${t}',PropertyValues=[${s}])`}function bt(t,e,n=it,s=[]){let o=[];for(let r of G){let m=r==="required"?"dependent":"required",g=e!=null?` and ${m}componenttype eq ${Math.trunc(e)}`:"",y=t[r]??[];for(let p=0;p<y.length;p+=n)o.push(wt(`${r}componentobjectid`,y.slice(p,p+n))+g);for(let p of s){if(!O(p))throw new R(`not a solution id: '${p}'`);o.push(`${r}componentbasesolutionid eq ${I(p)}${g}`)}}return o}var Tt=["membership","base-solution","component"];function $t(t,e,n){return n?"component":e.has(String(q(u(t,"requiredcomponentobjectid"),"")).toLowerCase())||e.has(String(q(u(t,"dependentcomponentobjectid"),"")).toLowerCase())?"membership":"base-solution"}function nt(t,e,n=null){let s={dependencyid:u(t,"dependencyid"),dependencytype:u(t,"dependencytype")};n&&(s.found_by=n);for(let o of G){for(let g of rt)s[o+g]=u(t,o+g);let r=u(t,o+"componentbasesolutionid"),m=u(L(u(t,o+"componentnodeid")),"_topsolutionid_value");s[o+"componentbasesolution"]=e.get(String(q(r,"")).toLowerCase())??null,s[o+"componenttopsolutionid"]=m,s[o+"componenttopsolution"]=e.get(String(q(m,"")).toLowerCase())??null}return s}function Rt(t){let e={};for(let[n,s]of at){let o=e[s]??=[];for(let r of E(u(t,n)))b(u(r,"MetadataId"))&&o.push(r.MetadataId)}return e}function St(t){return t.filter(e=>b(u(L(u(e,"OptionSet")),"MetadataId"))&&!b(e.OptionSet.IsGlobal)).map(e=>e.OptionSet.MetadataId)}function Mt(t){let e=new Set;for(let n of E(u(t,"ManyToManyRelationships")))b(u(n,"IntersectEntityName"))&&e.add(n.IntersectEntityName);return _(e,n=>n)}async function xt(t,e,n){let{find:s}=await import("./solution-3WUUDYF3.js"),o=new Set,r=new Set,m=[];for(let l of n){let c=await s(t,e,l);b(u(c,"ismanaged"))&&m.push(c.solutionid);let[a]=await k(t,e,"solutioncomponents",[["$select","objectid,componenttype,rootcomponentbehavior"],["$filter",`_solutionid_value eq ${c.solutionid}`]],null,null);for(let i of a)o.add(String(i.objectid).toLowerCase()),u(i,"componenttype")===1&&u(i,"rootcomponentbehavior")===0&&r.add(String(i.objectid).toLowerCase())}let g=o.size,y={columns:0,keys:0,relationships:0,intersect_tables:0,choices:0,forms:0,views:0},p=[],h=at.map(([l])=>`${l}($select=MetadataId${l.startsWith("ManyToMany")?",IntersectEntityName":""})`).join(","),f=(l,c)=>{let a=H(c.map(i=>i.toLowerCase()).filter(i=>!o.has(i)));for(let i of a)o.add(i);y[l]=(y[l]??0)+a.length},C=[],x=[...r].map(l=>[`EntityDefinitions(${l})`,!1]),$=new Set;for(;x.length;){let[l,c]=x.shift(),a;try{a=P(await X(t,e,"GET",l,{params:[["$select","LogicalName"],["$expand",h]]}))}catch(i){if(i instanceof U){C.push(l);continue}throw i}if(!$.has(a.LogicalName)){$.add(a.LogicalName),p.push(a.LogicalName),c&&f("intersect_tables",[a.MetadataId]);for(let[i,d]of Object.entries(Rt(a)))f(i,d);for(let i of Mt(a))$.has(i)||x.push([`EntityDefinitions(LogicalName=${N(v(i,"table"))})`,!0])}}let w=p.flatMap(l=>yt.map(c=>({method:"GET",path:`EntityDefinitions(LogicalName=${N(l)})/Attributes/Microsoft.Dynamics.CRM.${c}?$select=LogicalName&$expand=OptionSet($select=MetadataId,IsGlobal)`})));for await(let[,l,c]of Q(t,e,w,!1,!0))l.forEach((a,i)=>{let d=c[i];if(!d||d.status!==200)throw new z(`couldn't list the choices of a table: ${a.path}`,{service:"dataverse",...d?{status:d.status}:{},hint:(typeof d?.body=="string"?d.body:Z(d?.body??null)).slice(0,300)});f("choices",St(E(u(L(d.body),"value"))))});for(let[l,c,a,i]of[["systemforms","objecttypecode","formid","forms"],["savedqueries","returnedtypecode","savedqueryid","views"]])for(let d=0;d<p.length;d+=tt){let S=p.slice(d,d+tt).map(j=>`${c} eq ${N(v(j,"table"))}`).join(" or "),[M]=await k(t,e,l,[["$select",a],["$filter",S]],null,null);f(i,M.map(j=>j[a]))}return[[...o],{solutions:n,components:g,full_tables:r.size,added:y,managed:m,missing_tables:C}]}function ct(t){return[["$select",ft],["$expand",gt],...t?[["$filter",t]]:[]]}async function jt(t,e,n){let s=V(`odata.maxpagesize=${n?Math.min(B,n):B}`),o=[];for await(let r of Y(t,"dependencies",e,s))if(o=o.concat(E(P(r).value)),n!==null&&o.length>=n)break;return o}async function qt(t,e,n){let s=new Map;for(let o of e){for(let r of await jt(t,ct(o),n===null?null:n+1-s.size))s.has(r.dependencyid)||s.set(r.dependencyid,r);if(n!==null&&s.size>n)return[s,!0]}return[s,!1]}async function Et(t,e,n,s,o,r){let[m]=await k(t,e,"solutions",[["$select","solutionid,uniquename"]],null,null),g=new Map(m.map(h=>[String(h.solutionid).toLowerCase(),h.uniquename])),y=new Set;if(o)for(let h of Object.values(s))for(let f of h??[])y.add(f.toLowerCase());let p=Object.keys(s).length>0;return _(n.keys(),h=>h).map(h=>{let f=n.get(h);return p?nt(f,g,$t(f,y,r)):nt(f,g)})}function ot(t,e){if(t==null)return null;let n=t;if(n.length<2)throw new R(`argument ${e}: expected 2 arguments`,{hint:"run: ppdo-cli dv dependency list --help"});if(n.length>2)throw new R(`unrecognized arguments: ${n.slice(2).join(" ")}`,{hint:"run: ppdo-cli --help"});return[n[0],n[1]]}async function Dt(t){let e=t.args;K(e,{solution:"--solution",required:"--required",dependent:"--dependent"},!1,"dv dependency list");let n=ot(e.required,"--required"),s=ot(e.dependent,"--dependent");ht(e);let o=await W(t);F(t,o,"GET","dependencies",null);let r={},m=[],g=T(e.solution),y=await o.lookups(async()=>{if(g){let{names:c}=await import("./solution-3WUUDYF3.js"),[a,i]=await xt(t,o,c(g));m=i.managed??[],delete i.managed,i.base_solution_filter=m.length>0,r=i;let d=Object.values(i.added).reduce((j,lt)=>j+lt,0);i.missing_tables.length&&A(`${i.missing_tables.length} table(s) in the solution no longer exist: `+i.missing_tables.join(", "));let S=i.components,M=i.full_tables;return A(`${S} component${S!==1?"s":""} in ${i.solutions.join(", ")}`+(d?`, plus ${d} subcomponents of ${M} full table${M!==1?"s":""}`:"")),{required:a,dependent:a}}if(n||s){let c=n?"required":"dependent",[a,i]=n??s,{componentId:d,componentType:S}=await import("./lifecycle-OJRM7K2I.js"),M=await S(t,o,a);return{[c]:[await d(t,o,M,i,a)]}}return{}},["$batch"]),p=typeof e.type=="number"?e.type:null,h=Object.keys(y).length?bt(y,p,it,m):[null];if(t.dryRun){await t.emit({dry_run:!0,...r,requests:h.map(c=>({method:"GET",path:"dependencies",params:Object.fromEntries(ct(c))}))});return}let f=J(e),[C,x]=await qt(o,h,f),$=x,w=await Et(t,o,C,y,!!g,!!(n||s));if(g){let c=new Map;for(let a of w)c.set(a.found_by,(c.get(a.found_by)??0)+1);r.found_by=Object.fromEntries(_(c.entries(),([a])=>a))}f!==null&&w.length>f&&($=!0,w=w.slice(0,f)),$&&A(`showing the first ${f} rows; pass --limit n or --all for more`);let l=T(e.save);l?(await Ct(l,w),await t.emit({saved:l,rows:w.length,truncated:$,...r})):await t.emit(w)}function D(t){if(Array.isArray(t))return"["+t.map(e=>D(e===void 0?null:e)).join(", ")+"]";if(typeof t=="object"&&t!==null){let e=Object.entries(t).filter(([,s])=>s!==void 0);return"{"+_(e,([s])=>s).map(([s,o])=>`${st(s)}: ${D(o)}`).join(", ")+"}"}return typeof t=="string"?st(t):JSON.stringify(t)??"null"}function st(t){return JSON.stringify(t).replace(/[^\x00-\x7f]/g,e=>"\\u"+e.charCodeAt(0).toString(16).padStart(4,"0"))}function _t(t,e){let n=ut(e);n.endsWith(".gz")&&(n=n.slice(0,-3));let s=Buffer.from(n,"latin1"),o=Buffer.from([31,139,8,s.length?8:0,0,0,0,0,2,255]),r=Buffer.alloc(8);r.writeUInt32LE(mt(t)>>>0,0),r.writeUInt32LE(t.length%4294967296,4);let m=[o];return s.length&&m.push(s,Buffer.from([0])),m.push(pt(t,{level:9,memLevel:8}),r),Buffer.concat(m)}async function Ct(t,e){let n=Buffer.from(e.map(s=>D(s)+`
|
|
3
|
+
`).join(""),"ascii");dt(t,t.toLowerCase().endsWith(".gz")?_t(n,t):n)}export{it as CHUNK,Tt as FOUND_BY,tt as NAME_CHUNK,G as SIDES,ht as checkScope,bt as filters,$t as foundBy,wt as inFilter,Mt as intersects,Dt as list,St as localChoices,nt as row,Ct as save,Rt as subcomponents};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
import{b as u,d}from"./chunk-4KP27OCL.js";import{c as l,g as a}from"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import"./chunk-WMDKJRDC.js";import"./chunk-H4OY4EFC.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var s="globaldisco.crm.dynamics.com",v={0:"production",5:"sandbox",6:"sandbox-free",7:"preview",9:"test-drive",11:"email-trial",12:"default",13:"developer",14:"trial",15:"teams"},i=class extends u{name="discovery";scope(){return`https://${s}//.default`}url(t,e){let n=t.includes("://")?t:`https://${s}/${t.replace(/^\/+/,"")}`;return e&&e.length&&(n+=(n.includes("?")?"&":"?")+l(e)),n}allowed(t){let e=a(t);return e.scheme==="https"&&e.host===s}};async function w(r,t){let e=new i,{getToken:n}=await import("./provider-FN7TXWRE.js"),o=(await new d(e,r,p=>n(t,e.scope(),{forceRefresh:p,log:m=>r.log(m)})).request("GET","api/discovery/v2.0/Instances")).json(),c=o&&typeof o=="object"?o.value:null;return Array.isArray(c)?c:[]}export{i as Discovery,s as HOST,v as ORG_TYPES,w as instances};
|