@ppdostudio/ppdo-cli 0.0.0-stage → 1.0.0-beta.0
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 +54 -0
- package/LICENSE +114 -0
- package/README.md +330 -2
- package/THIRD-PARTY-NOTICES +25 -0
- package/dist/bin.js +5 -0
- package/dist/chunks/ado-NLCWVIVQ.js +103 -0
- package/dist/chunks/api-T5SWGOFX.js +2 -0
- package/dist/chunks/api-YKKPVMTX.js +2 -0
- package/dist/chunks/auth-IP7AOWSF.js +6 -0
- package/dist/chunks/azCli-T67ZMIC3.js +2 -0
- package/dist/chunks/batch-GCXLGQET.js +4 -0
- package/dist/chunks/build-XDCWMEEL.js +4 -0
- package/dist/chunks/bulk-5QO343HO.js +2 -0
- package/dist/chunks/chunk-3C3GSN3J.js +2 -0
- package/dist/chunks/chunk-4S5ETLH4.js +2 -0
- package/dist/chunks/chunk-5KZDCOFA.js +8 -0
- package/dist/chunks/chunk-5SBBTR3Y.js +2 -0
- package/dist/chunks/chunk-5UOZCXQF.js +5 -0
- package/dist/chunks/chunk-BALEFXOL.js +29 -0
- package/dist/chunks/chunk-BWZ6HZXM.js +2 -0
- package/dist/chunks/chunk-C42MGXRN.js +2 -0
- package/dist/chunks/chunk-GE3XBV3K.js +2 -0
- package/dist/chunks/chunk-GT52BRS2.js +194 -0
- package/dist/chunks/chunk-HLE2WURE.js +2 -0
- package/dist/chunks/chunk-J4R6QXW7.js +2 -0
- package/dist/chunks/chunk-J777TCSE.js +4 -0
- package/dist/chunks/chunk-JAGU2NM5.js +2 -0
- package/dist/chunks/chunk-JEAIFLEN.js +51 -0
- package/dist/chunks/chunk-JGLUQBCK.js +2 -0
- package/dist/chunks/chunk-MME53RWW.js +4 -0
- package/dist/chunks/chunk-MTF66YXU.js +2 -0
- package/dist/chunks/chunk-NNHEYYF5.js +2 -0
- package/dist/chunks/chunk-OP6EXLWQ.js +5 -0
- package/dist/chunks/chunk-PDFXH652.js +2 -0
- package/dist/chunks/chunk-QE4DELWW.js +2 -0
- package/dist/chunks/chunk-QMTPHZLQ.js +2 -0
- package/dist/chunks/chunk-RHQP7X6H.js +3 -0
- package/dist/chunks/chunk-S4KF5Z3S.js +10 -0
- package/dist/chunks/chunk-TQLZ3TRU.js +2 -0
- package/dist/chunks/chunk-TZSB4PR7.js +4 -0
- package/dist/chunks/chunk-UCTMKA2J.js +4 -0
- package/dist/chunks/chunk-UKKSN4F7.js +3 -0
- package/dist/chunks/chunk-UWFDJKOJ.js +2 -0
- package/dist/chunks/chunk-UYDBLVAM.js +2 -0
- package/dist/chunks/chunk-WIA546AL.js +13 -0
- package/dist/chunks/chunk-WXCLWAE2.js +2 -0
- package/dist/chunks/chunk-WXOTXJNG.js +3 -0
- package/dist/chunks/chunk-X7VWUI6N.js +2 -0
- package/dist/chunks/chunk-XL7E7LX5.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-GHYN6GZT.js +2 -0
- package/dist/chunks/component-PAASRIK6.js +2 -0
- package/dist/chunks/components-LRHXR5HR.js +2 -0
- package/dist/chunks/config-JN3I5EII.js +2 -0
- package/dist/chunks/connection-IWFELK5W.js +2 -0
- package/dist/chunks/connref-ZDY7JYK5.js +2 -0
- package/dist/chunks/customizations-IE2KO275.js +7 -0
- package/dist/chunks/dependency-EFDSIKSN.js +3 -0
- package/dist/chunks/discovery-XXVLVHD6.js +2 -0
- package/dist/chunks/dist-ILNYGTM2.js +136 -0
- package/dist/chunks/dv-3OESFBNW.js +192 -0
- package/dist/chunks/env-MZPI3UA2.js +5 -0
- package/dist/chunks/environment-NUQHU74A.js +2 -0
- package/dist/chunks/environments-WMBLSAQF.js +2 -0
- package/dist/chunks/envvar-YN35IDWJ.js +2 -0
- package/dist/chunks/esm-Z4QMBGAD.js +2 -0
- package/dist/chunks/fanout-DUP5CD5X.js +2 -0
- package/dist/chunks/fetchxml-ONTNTA6Z.js +6 -0
- package/dist/chunks/functions-K5TYRB2C.js +2 -0
- package/dist/chunks/graph-JI23YQB5.js +5 -0
- package/dist/chunks/group-DKEPSVRV.js +6 -0
- package/dist/chunks/history-SNSJRV6B.js +2 -0
- package/dist/chunks/identity-OW4WCDOA.js +2 -0
- package/dist/chunks/jobs-PXNJFWWF.js +2 -0
- package/dist/chunks/lifecycle-7RMWV26J.js +2 -0
- package/dist/chunks/main-ZVIKC3VA.js +4 -0
- package/dist/chunks/metadata-74WGGOV5.js +2 -0
- package/dist/chunks/metadataCreate-W3NDI5FB.js +2 -0
- package/dist/chunks/msalUser-JRNX5HPO.js +2 -0
- package/dist/chunks/names-SFYZQY6Q.js +2 -0
- package/dist/chunks/pack-2UDE25IY.js +2 -0
- package/dist/chunks/pipelines-O3OYNCHT.js +4 -0
- package/dist/chunks/plan-ALLKT2QZ.js +2 -0
- package/dist/chunks/plugins-EUDJ7QIS.js +4 -0
- package/dist/chunks/policies-KVPQVUHS.js +2 -0
- package/dist/chunks/pools-7H2L4QJC.js +2 -0
- package/dist/chunks/process-G7LCTGKS.js +2 -0
- package/dist/chunks/project-HSZLY2AY.js +2 -0
- package/dist/chunks/projects-BHG2B4IX.js +4 -0
- package/dist/chunks/protect-WZO3MAHF.js +2 -0
- package/dist/chunks/provider-VXRAQRN2.js +2 -0
- package/dist/chunks/prs-NOXIZ7AT.js +2 -0
- package/dist/chunks/records-TN7ZKUJ7.js +2 -0
- package/dist/chunks/run-BXFENCN6.js +2 -0
- package/dist/chunks/run-F6H4QCWR.js +2 -0
- package/dist/chunks/run-HBQCSGYY.js +3 -0
- package/dist/chunks/run-JYU5BTWN.js +2 -0
- package/dist/chunks/run-MGLIIM7Z.js +3 -0
- package/dist/chunks/run-MHM3GTGH.js +2 -0
- package/dist/chunks/run-SRQPP6N3.js +3 -0
- package/dist/chunks/run-ZNDSC7LR.js +2 -0
- package/dist/chunks/runtime-VOF7XYXW.js +2 -0
- package/dist/chunks/security-FLEAZ4EA.js +2 -0
- package/dist/chunks/service-4PIAYFYF.js +2 -0
- package/dist/chunks/service-V2TQEEID.js +2 -0
- package/dist/chunks/services-B6V4VVX5.js +2 -0
- package/dist/chunks/skills-GD6Z6P3R.js +2 -0
- package/dist/chunks/solution-HF57MP27.js +2 -0
- package/dist/chunks/solutionExport-TLGHMUM5.js +2 -0
- package/dist/chunks/solutionfiles-P223QW2J.js +2 -0
- package/dist/chunks/spn-AIUWML5R.js +2 -0
- package/dist/chunks/tokenCache-3LMJRUTI.js +2 -0
- package/dist/chunks/unpack-XZLTBUGC.js +2 -0
- package/dist/chunks/users-KFAPPGF4.js +2 -0
- package/dist/chunks/vargroups-33EZAHGZ.js +2 -0
- package/dist/chunks/whoami-ULK5UMZV.js +2 -0
- package/dist/chunks/workitems-YGES6KKN.js +2 -0
- package/dist/chunks/xmldoc-B2HUNTVK.js +2 -0
- package/package.json +55 -4
- package/schema/ppdo-cli.schema.json +120 -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-WXCLWAE2.js";import"./chunk-UWFDJKOJ.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-UKKSN4F7.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-HF57MP27.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-HF57MP27.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-7RMWV26J.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-4S5ETLH4.js";import{c as l,g as a}from"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import"./chunk-UYDBLVAM.js";import"./chunk-RHQP7X6H.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-VXRAQRN2.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};
|