@ppdostudio/ppdo-cli 1.0.0-beta.0 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/CHANGELOG.md +96 -54
  2. package/LICENSE +114 -114
  3. package/README.md +381 -331
  4. package/THIRD-PARTY-NOTICES +1 -0
  5. package/dist/bin.js +2 -2
  6. package/dist/chunks/{ado-NLCWVIVQ.js → ado-OTSVKTOE.js} +6 -6
  7. package/dist/chunks/{api-YKKPVMTX.js → api-IRGGH5DJ.js} +1 -1
  8. package/dist/chunks/{api-T5SWGOFX.js → api-TZJXGWWQ.js} +1 -1
  9. package/dist/chunks/auth-7CDWOYJE.js +6 -0
  10. package/dist/chunks/azCli-UEDQHRLP.js +2 -0
  11. package/dist/chunks/batch-LKWCBKAB.js +2 -0
  12. package/dist/chunks/{build-XDCWMEEL.js → build-PBPXO3GJ.js} +3 -3
  13. package/dist/chunks/bulk-NY5XX752.js +2 -0
  14. package/dist/chunks/chunk-2IUXH534.js +2 -0
  15. package/dist/chunks/chunk-3L7657R3.js +5 -0
  16. package/dist/chunks/{chunk-5KZDCOFA.js → chunk-46KBBWEH.js} +1 -1
  17. package/dist/chunks/chunk-6NBCHK6X.js +2 -0
  18. package/dist/chunks/chunk-6VLFO5FJ.js +7 -0
  19. package/dist/chunks/chunk-B3TJ3RJN.js +2 -0
  20. package/dist/chunks/chunk-BG2OIOSN.js +2 -0
  21. package/dist/chunks/chunk-BWOEIEFY.js +6 -0
  22. package/dist/chunks/chunk-ELSYHAYC.js +2 -0
  23. package/dist/chunks/chunk-FOEBNCSD.js +3 -0
  24. package/dist/chunks/{chunk-XL7E7LX5.js → chunk-GLU4X7PT.js} +2 -2
  25. package/dist/chunks/chunk-GQLXEQVQ.js +4 -0
  26. package/dist/chunks/chunk-GY6BUIDP.js +2 -0
  27. package/dist/chunks/chunk-H4OY4EFC.js +3 -0
  28. package/dist/chunks/chunk-HJQJ77F2.js +3 -0
  29. package/dist/chunks/chunk-I7MHI5CU.js +151 -0
  30. package/dist/chunks/chunk-ITP35SAY.js +2 -0
  31. package/dist/chunks/{chunk-J777TCSE.js → chunk-J67P6QFC.js} +2 -2
  32. package/dist/chunks/{chunk-NNHEYYF5.js → chunk-KBZI5UDL.js} +1 -1
  33. package/dist/chunks/chunk-LB7WNZVK.js +5 -0
  34. package/dist/chunks/chunk-MBNUMAAZ.js +2 -0
  35. package/dist/chunks/chunk-MNGA7IHQ.js +4 -0
  36. package/dist/chunks/chunk-P4IFCLVF.js +2 -0
  37. package/dist/chunks/chunk-Q2RD4TRK.js +2 -0
  38. package/dist/chunks/chunk-S6NK6GX2.js +5 -0
  39. package/dist/chunks/chunk-SWXCK5C2.js +2 -0
  40. package/dist/chunks/chunk-T4IH34D7.js +2 -0
  41. package/dist/chunks/{chunk-HLE2WURE.js → chunk-TADCW6ZI.js} +1 -1
  42. package/dist/chunks/{chunk-UYDBLVAM.js → chunk-TCLZ4XM6.js} +1 -1
  43. package/dist/chunks/chunk-VC7ADQ6E.js +2 -0
  44. package/dist/chunks/{chunk-GT52BRS2.js → chunk-XUHLW6B2.js} +18 -18
  45. package/dist/chunks/{commands-GHYN6GZT.js → commands-EOUU353W.js} +1 -1
  46. package/dist/chunks/component-JCIJQELN.js +2 -0
  47. package/dist/chunks/config-WV3NZGTI.js +2 -0
  48. package/dist/chunks/connection-L6CUFUPJ.js +2 -0
  49. package/dist/chunks/connref-IT6K56UT.js +2 -0
  50. package/dist/chunks/convert-ILMJ2HHN.js +5 -0
  51. package/dist/chunks/customizations-AX7ZSXCK.js +2 -0
  52. package/dist/chunks/data-UWOV3LBO.js +5 -0
  53. package/dist/chunks/dependency-V4ZJIWQL.js +3 -0
  54. package/dist/chunks/{discovery-XXVLVHD6.js → discovery-PSGWFMJH.js} +1 -1
  55. package/dist/chunks/{dv-3OESFBNW.js → dv-SD5LTNZJ.js} +109 -48
  56. package/dist/chunks/{env-MZPI3UA2.js → env-6RZCHQUC.js} +2 -2
  57. package/dist/chunks/environment-IBLJHUAL.js +2 -0
  58. package/dist/chunks/{environments-WMBLSAQF.js → environments-3P2I4QUC.js} +1 -1
  59. package/dist/chunks/envvar-KJ2TUZGJ.js +2 -0
  60. package/dist/chunks/fanout-2WQYFUWL.js +2 -0
  61. package/dist/chunks/{fetchxml-ONTNTA6Z.js → fetchxml-M6EOF7N6.js} +1 -1
  62. package/dist/chunks/functions-NILMLS4R.js +2 -0
  63. package/dist/chunks/{graph-JI23YQB5.js → graph-NO2OT2TL.js} +1 -1
  64. package/dist/chunks/{group-DKEPSVRV.js → group-ISSJ4H2A.js} +2 -2
  65. package/dist/chunks/history-JPMLQDJI.js +2 -0
  66. package/dist/chunks/identity-SBQNHSBF.js +2 -0
  67. package/dist/chunks/init-X2VEK4T2.js +2 -0
  68. package/dist/chunks/jobs-XC7EYPBP.js +2 -0
  69. package/dist/chunks/lifecycle-2F7MF6EP.js +2 -0
  70. package/dist/chunks/{main-ZVIKC3VA.js → main-J3O5YMIY.js} +2 -2
  71. package/dist/chunks/metadata-NZFQIAAG.js +2 -0
  72. package/dist/chunks/metadataCreate-XSHK32TR.js +2 -0
  73. package/dist/chunks/msalUser-KC75VDVV.js +2 -0
  74. package/dist/chunks/names-N5JRXO33.js +2 -0
  75. package/dist/chunks/{pack-2UDE25IY.js → pack-3OYGV36R.js} +1 -1
  76. package/dist/chunks/pat-PCMOZYM5.js +2 -0
  77. package/dist/chunks/{pipelines-O3OYNCHT.js → pipelines-OCHSIQ2E.js} +1 -1
  78. package/dist/chunks/pluginRegister-LEVZNDZN.js +4 -0
  79. package/dist/chunks/{plugins-EUDJ7QIS.js → plugins-TEME2R77.js} +1 -1
  80. package/dist/chunks/{policies-KVPQVUHS.js → policies-EWCANNBE.js} +1 -1
  81. package/dist/chunks/{pools-7H2L4QJC.js → pools-54KMEL5D.js} +1 -1
  82. package/dist/chunks/process-KR7LIXZB.js +2 -0
  83. package/dist/chunks/{projects-BHG2B4IX.js → projects-LPVDFLPC.js} +1 -1
  84. package/dist/chunks/protect-X2J7LU7X.js +2 -0
  85. package/dist/chunks/provider-D7DMMAS6.js +2 -0
  86. package/dist/chunks/{prs-NOXIZ7AT.js → prs-C4EKGJWA.js} +1 -1
  87. package/dist/chunks/records-C4RLQXFK.js +2 -0
  88. package/dist/chunks/{run-BXFENCN6.js → run-27MYTWHY.js} +1 -1
  89. package/dist/chunks/run-46PEJS3S.js +2 -0
  90. package/dist/chunks/run-7L6W2YWJ.js +3 -0
  91. package/dist/chunks/run-CD3ZOB5V.js +4 -0
  92. package/dist/chunks/run-EUNN6OZO.js +2 -0
  93. package/dist/chunks/{run-JYU5BTWN.js → run-JDNEQMJC.js} +1 -1
  94. package/dist/chunks/{run-MGLIIM7Z.js → run-T3IIJ7SK.js} +1 -1
  95. package/dist/chunks/run-ZHIDOKQH.js +2 -0
  96. package/dist/chunks/{runtime-VOF7XYXW.js → runtime-FJJPTBEE.js} +1 -1
  97. package/dist/chunks/security-SBIAK6QD.js +2 -0
  98. package/dist/chunks/{service-V2TQEEID.js → service-4N3YP4Z7.js} +1 -1
  99. package/dist/chunks/{service-4PIAYFYF.js → service-HASXLUGE.js} +1 -1
  100. package/dist/chunks/services-C6G4XRXR.js +2 -0
  101. package/dist/chunks/{skills-GD6Z6P3R.js → skills-FW4F3EIW.js} +1 -1
  102. package/dist/chunks/solution-CNBNIS7Z.js +2 -0
  103. package/dist/chunks/solutionExport-Y524HMGN.js +2 -0
  104. package/dist/chunks/{solutionfiles-P223QW2J.js → solutionfiles-2TP3Y2RW.js} +1 -1
  105. package/dist/chunks/spn-YSYMDTOI.js +2 -0
  106. package/dist/chunks/tokenCache-TQFT6LAD.js +2 -0
  107. package/dist/chunks/{unpack-XZLTBUGC.js → unpack-HUH7OJMP.js} +1 -1
  108. package/dist/chunks/{users-KFAPPGF4.js → users-Q7BJKBPP.js} +1 -1
  109. package/dist/chunks/{vargroups-33EZAHGZ.js → vargroups-GNZBODVJ.js} +1 -1
  110. package/dist/chunks/{whoami-ULK5UMZV.js → whoami-6G6UFTNS.js} +1 -1
  111. package/dist/chunks/{workitems-YGES6KKN.js → workitems-2IOGD3EL.js} +1 -1
  112. package/package.json +61 -57
  113. package/schema/ppdo-cli.schema.json +16 -4
  114. package/schema/reference-data.schema.json +192 -0
  115. package/skills/ppdo-cli/SKILL.md +2 -1
  116. package/skills/ppdo-cli-data/SKILL.md +669 -0
  117. package/skills/ppdo-cli-dataverse/SKILL.md +6 -0
  118. package/skills/ppdo-cli-plugins/PluginRegistration.cs +229 -0
  119. package/skills/ppdo-cli-plugins/SKILL.md +95 -0
  120. package/skills/ppdo-cli-plugins/reference.md +72 -0
  121. package/dist/chunks/auth-IP7AOWSF.js +0 -6
  122. package/dist/chunks/azCli-T67ZMIC3.js +0 -2
  123. package/dist/chunks/batch-GCXLGQET.js +0 -4
  124. package/dist/chunks/bulk-5QO343HO.js +0 -2
  125. package/dist/chunks/chunk-3C3GSN3J.js +0 -2
  126. package/dist/chunks/chunk-4S5ETLH4.js +0 -2
  127. package/dist/chunks/chunk-5SBBTR3Y.js +0 -2
  128. package/dist/chunks/chunk-5UOZCXQF.js +0 -5
  129. package/dist/chunks/chunk-BWZ6HZXM.js +0 -2
  130. package/dist/chunks/chunk-JGLUQBCK.js +0 -2
  131. package/dist/chunks/chunk-MME53RWW.js +0 -4
  132. package/dist/chunks/chunk-OP6EXLWQ.js +0 -5
  133. package/dist/chunks/chunk-PDFXH652.js +0 -2
  134. package/dist/chunks/chunk-QE4DELWW.js +0 -2
  135. package/dist/chunks/chunk-RHQP7X6H.js +0 -3
  136. package/dist/chunks/chunk-UKKSN4F7.js +0 -3
  137. package/dist/chunks/chunk-UWFDJKOJ.js +0 -2
  138. package/dist/chunks/chunk-WXCLWAE2.js +0 -2
  139. package/dist/chunks/chunk-X7VWUI6N.js +0 -2
  140. package/dist/chunks/component-PAASRIK6.js +0 -2
  141. package/dist/chunks/config-JN3I5EII.js +0 -2
  142. package/dist/chunks/connection-IWFELK5W.js +0 -2
  143. package/dist/chunks/connref-ZDY7JYK5.js +0 -2
  144. package/dist/chunks/customizations-IE2KO275.js +0 -7
  145. package/dist/chunks/dependency-EFDSIKSN.js +0 -3
  146. package/dist/chunks/environment-NUQHU74A.js +0 -2
  147. package/dist/chunks/envvar-YN35IDWJ.js +0 -2
  148. package/dist/chunks/fanout-DUP5CD5X.js +0 -2
  149. package/dist/chunks/functions-K5TYRB2C.js +0 -2
  150. package/dist/chunks/history-SNSJRV6B.js +0 -2
  151. package/dist/chunks/identity-OW4WCDOA.js +0 -2
  152. package/dist/chunks/jobs-PXNJFWWF.js +0 -2
  153. package/dist/chunks/lifecycle-7RMWV26J.js +0 -2
  154. package/dist/chunks/metadata-74WGGOV5.js +0 -2
  155. package/dist/chunks/metadataCreate-W3NDI5FB.js +0 -2
  156. package/dist/chunks/msalUser-JRNX5HPO.js +0 -2
  157. package/dist/chunks/names-SFYZQY6Q.js +0 -2
  158. package/dist/chunks/process-G7LCTGKS.js +0 -2
  159. package/dist/chunks/protect-WZO3MAHF.js +0 -2
  160. package/dist/chunks/provider-VXRAQRN2.js +0 -2
  161. package/dist/chunks/records-TN7ZKUJ7.js +0 -2
  162. package/dist/chunks/run-F6H4QCWR.js +0 -2
  163. package/dist/chunks/run-HBQCSGYY.js +0 -3
  164. package/dist/chunks/run-MHM3GTGH.js +0 -2
  165. package/dist/chunks/run-SRQPP6N3.js +0 -3
  166. package/dist/chunks/run-ZNDSC7LR.js +0 -2
  167. package/dist/chunks/security-FLEAZ4EA.js +0 -2
  168. package/dist/chunks/services-B6V4VVX5.js +0 -2
  169. package/dist/chunks/solution-HF57MP27.js +0 -2
  170. package/dist/chunks/solutionExport-TLGHMUM5.js +0 -2
  171. package/dist/chunks/spn-AIUWML5R.js +0 -2
  172. package/dist/chunks/tokenCache-3LMJRUTI.js +0 -2
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-RHQP7X6H.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";export{i as STALE_MS,h as atomicWrite,j as hostId,a as loadDpapi,e as readSealed,c as seal,b as setDpapiForTests,g as sleepSync,d as unseal,l as withFileLock,k as withFileLockSync,f as writeSealed};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a as x,b as k,e as O,g,j as v,k as h,l as d,m as p,n as C,o as y,p as I}from"./chunk-3C3GSN3J.js";import{l as f}from"./chunk-RHQP7X6H.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import{a as m,b as w,c as _}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var b=["browser","broker","device_code"],T="https://graph.microsoft.com/.default",$=600;async function L(e,t,n={}){let c=n.log??(()=>{}),i=!!n.forceRefresh;if(e.ephemeral)return(await import("./spn-AIUWML5R.js")).ephemeralToken(e,t,i,c);if(!i){let a=p(e,t);if(a)return c(` token: cache (${e.name})`),a}return f(g(e.name),async()=>{let a=h(e.name);if(!i){let o=p(e,t,a);if(o)return c(` token: cache after lock (${e.name})`),o}let s,r,l;if(b.includes(e.method)){let o=a.account;if(!o||!y(a,e))throw new _(`identity '${e.name}' is not signed in`,{hint:`run: ppdo-cli auth login ${e.name}`});let E=await import("./msalUser-JRNX5HPO.js");c(` token: refreshing via msal (${e.name}${i?", forced":""})`),[s,r]=await E.acquire(e,t,o,i),l=o.tenant_id??null}else if(e.method==="az_cli"){let o=await import("./azCli-T67ZMIC3.js");c(` token: az cli (${e.name})`),[s,r,l]=await o.acquire(e,t)}else if(e.method==="spn"){let o=await import("./spn-AIUWML5R.js");c(` token: client credentials (${e.name})`),[s,r]=await o.acquire(e,t),l=null,o.check(e,k(s))}else throw new w(`sign-in method '${e.method}' is not available yet`);let u=k(s);return O(e.name,e.username,l||(x(e.tenant)?e.tenant:null),u),C(a,e,t,s,r),d(e.name,a),s})}async function P(e,t={}){let n;try{n=h(e.name)}catch(r){if(!(r instanceof m))throw r;n={account:null,tokens:{}}}if(!t.force&&y(n,e))return{identity:e.name,status:"already signed in",account:n.account?.account??null};let c=t.deviceCode?"device_code":e.method;if(c==="az_cli")return{identity:e.name,status:"uses az cli",hint:"run: az login (with this identity's AZURE_CONFIG_DIR)"};let i=t.scope??T,a=await import("./msalUser-JRNX5HPO.js"),s=await f(g(e.name),async()=>{let[r,l]=await a.login(e,{method:c,scopes:[i],usedBy:t.usedBy??[]}),u={account:r,tokens:{}};return l&&C(u,e,i,l.accessToken,l.expiresOn),d(e.name,u),r},$);return{identity:e.name,status:"signed in",account:s.account??null,tenant_id:s.tenant_id??null,method:c}}async function A(e){let t;try{t=h(e.name)}catch(n){if(!(n instanceof m))throw n;t={account:null,tokens:{}}}return t.account&&b.includes(e.method)&&await(await import("./msalUser-JRNX5HPO.js")).logout(e,t.account),{identity:e.name,deleted_files:v(e.name)}}function S(e){let t={identity:e.name,username:e.username,tenant:e.tenant,method:e.method,client_id:e.effectiveClientId};try{return{...t,...I(e)}}catch(n){if(!(n instanceof m))throw n;return{...t,signed_in:!1,error:n.message,...n.hint?{hint:n.hint}:{}}}}export{T as DEFAULT_LOGIN_SCOPE,b as USER_METHODS,L as getToken,P as login,A as logout,S as status};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a,b,c,d,e,f,g,h}from"./chunk-PDFXH652.js";import"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import"./chunk-NNHEYYF5.js";import"./chunk-BALEFXOL.js";import"./chunk-4S5ETLH4.js";import"./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";export{h as batch,d as create,c as get,b as query,g as readRequests,f as remove,a as splitlines,e as update};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a as g}from"./chunk-5UOZCXQF.js";import{E as C,l as v,n as U,o as x}from"./chunk-OP6EXLWQ.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import{b as u}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function h(n,t){return{name:t.name,mode:t.mode,identity:t.identity,environments:n.members(t.name).map(o=>({name:o.name,service:o.service,endpoint:o.endpoint}))}}function w(n){return typeof n=="string"&&n?n:null}async function A(n){let t=String(n.args.name);v(t,"group");let o=w(n.args.identity);if(!o)throw new u("--identity is required",{hint:"the account every environment in the group uses"});let i=w(n.args.mode)??"read-only";await n.emit(await g(t,s=>{if(s.groups.has(t))throw new u(`group '${t}' already exists`,{hint:`run: ppdo-cli group update ${t} ...`});let d=new U(t,o,i);return s.groups.set(t,d),h(s,d)}))}async function G(n){let t=String(n.args.name),o=w(n.args.identity),i=w(n.args.mode);await n.emit(await g(t,s=>{let d=s.group(t);return o&&(d.identity=o),i&&(d.mode=i),h(s,d)}))}async function O(n){let t=await n.config();await n.emit([...t.groups.values()].map(o=>({name:o.name,mode:o.mode,identity:o.identity,environments:t.members(o.name).map(i=>i.name)})))}async function T(n){let t=await n.config();await n.emit(h(t,t.group(String(n.args.name))))}async function q(n){let t=String(n.args.name);await g(t,o=>{o.group(t);let i=o.members(t).map(s=>s.name);if(i.length)throw new u(`group '${t}' still has environments: ${i.join(", ")}`,{hint:"move or remove them first: ppdo-cli env move <env> --to <group>"});o.groups.delete(t)}),await n.emit({removed:t})}function l(n){return typeof n=="string"?n.toLowerCase():""}async function D(n){let{ORG_TYPES:t,instances:o}=await import("./discovery-XXVLVHD6.js"),i=String(n.args.name),s=await n.config(),d=s.group(i);if(!d.identity)throw new u(`group '${i}' has no identity`,{hint:`run: ppdo-cli group update ${i} --identity <name>`});let P=await o(n,s.identity(d.identity)),R=new Map;for(let e of s.environments.values())e.service==="dataverse"&&R.set((e.url??"").toLowerCase(),e);let N=[...P].sort((e,m)=>{let a=l(e.UrlName),r=l(m.UrlName);return a<r?-1:a>r?1:0}),c=[];for(let e of N){let m=C(typeof e.Url=="string"?e.Url:""),a=R.get(m.toLowerCase()),r=e.OrganizationType,L={name:e.UrlName,friendly_name:e.FriendlyName,url:m,type:typeof r=="number"&&r in t?t[r]:r,state:e.State===0?"enabled":"disabled",version:e.Version,region:e.Region,sysadmin:e.IsUserSysAdmin,added:a?a.name:null,added_to:a?a.group:null},$={};for(let[j,y]of Object.entries(L))y!=null&&($[j]=y);c.push($)}let f=typeof n.args.add=="string"?n.args.add:null;if(!f){await n.emit(c);return}let p=f.trim().toLowerCase()==="all"?null:new Set(f.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e));if(p&&p.size){let e=new Set(c.map(a=>l(a.name))),m=[...p].filter(a=>!e.has(a)).sort();if(m.length)throw new u("not found: "+m.join(", "),{hint:`run: ppdo-cli group discover ${i}`})}let k=e=>p===null||p.has(l(e.name)),b=c.filter(e=>!e.added&&k(e)),S=c.filter(e=>e.added&&k(e)).map(e=>e.name);if(!b.length){await n.emit({group:i,added:[],skipped:S,hint:"nothing new to add"});return}await n.emit(await g(i,e=>{let m=[];for(let a of b){let r=l(a.name).replace(/[^a-z0-9_-]/g,"-").replace(/^-+|-+$/g,"")||"dataverse";e.environments.has(r)&&(r=`${i}-${r}`),v(r,"environment"),e.environments.set(r,new x(r,i,"dataverse",{url:a.url})),e.current.dataverse??=r,m.push({name:r,url:a.url})}return{group:i,added:m,skipped:S}}))}export{A as add,h as describe,D as discover,O as list,q as remove,T as show,G as update};
@@ -1,3 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a as d}from"./chunk-5UOZCXQF.js";import{E as j,e as g,f as S,g as R,i as f,l,o as P,p as x,t as w,u as $,x as y}from"./chunk-OP6EXLWQ.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import{b as m}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";import{existsSync as O,realpathSync as I,statSync as E,unlinkSync as N,writeFileSync as C}from"node:fs";import{join as k,resolve as F}from"node:path";function u(n){return typeof n=="string"&&n?n:null}function D(n){return{dataverse:u(n.args.dataverse),devopsOrg:u(n.args.devopsOrg),devopsProject:u(n.args.devopsProject)}}function A(n,e){if(e.dataverse&&(e.devopsOrg||e.devopsProject))throw new m("an environment is either Dataverse or DevOps, not both",{hint:"add a second environment for the other service"});if(e.dataverse){if(n.service!=="dataverse")throw new m(`'${n.name}' is a DevOps environment`,{hint:"remove it and add a new one"});n.url=j(e.dataverse)}if(e.devopsOrg||e.devopsProject){if(n.service!=="devops")throw new m(`'${n.name}' is a Dataverse environment`,{hint:"remove it and add a new one"});e.devopsOrg&&(n.org=e.devopsOrg.trim().replace(/^\/+|\/+$/g,"")),e.devopsProject&&(n.project=e.devopsProject.trim())}}function p(n,e){let t=n.groups.get(e.group),o={name:e.name,service:e.service,endpoint:e.endpoint,group:e.group,mode:t?t.mode:null,identity:t?t.identity:null},r=t&&t.identity?n.identities.get(t.identity):void 0;return r&&(o.account=r.username||r.name),o}async function B(n){let e=String(n.args.name),t=String(n.args.in);l(e,"environment");let o=D(n);if(!(o.dataverse||o.devopsOrg))throw new m("pass --dataverse <url>, or --devops-org <org> [--devops-project <project>]");let r=o.dataverse?"dataverse":"devops";await n.emit(await d(e,s=>{if(s.environments.has(e))throw new m(`environment '${e}' already exists`,{hint:`run: ppdo-cli env update ${e} ...`});s.group(t);let a=new P(e,t,r);return A(a,o),s.environments.set(e,a),s.current[r]??=e,p(s,a)}))}async function M(n){let e=String(n.args.name),t=D(n);await n.emit(await d(e,o=>{let r=o.environment(e);return A(r,t),p(o,r)}))}async function q(n){let e=String(n.args.name),t=String(n.args.newName);l(t,"environment");let o=await d(e,a=>{let i=a.environment(e);if(a.environments.has(t))throw new m(`environment '${t}' already exists`);return i.name=t,a.environments=new Map([...a.environments].map(([c,v])=>[c===e?t:c,v])),a.current[i.service]===e&&(a.current[i.service]=t),p(a,i)}),r=await w(),s=r&&Object.values(r[0]).includes(e);await n.emit({renamed:e,...o,...s?{warning:`${r[1]} still names '${e}'`}:{}})}async function z(n){let e=String(n.args.name),t=String(n.args.to);await n.emit(await d(e,o=>{let r=o.environment(e);return o.group(t),r.group=t,p(o,r)}))}async function G(n){let e=await n.config(),t=u(n.args.group);t&&e.group(t);let o=u(n.args.service),r=o?S[o]:void 0,s={};for(let i of g)try{s[i]=(await y(e,i,null)).env.name}catch(c){if(!(c instanceof m))throw c}let a=[];for(let i of e.environments.values())t&&i.group!==t||r&&i.service!==r||a.push({...p(e,i),default:s[i.service]===i.name});await n.emit(a)}async function H(n){let e=await n.config();await n.emit(p(e,e.environment(String(n.args.name))))}async function K(n){let e=String(n.args.name);await n.emit(await d(e,t=>{let o=t.environment(e);return t.current[o.service]=e,{[`current-${o.service}`]:e}}))}async function Q(n){let e=await n.config(),t={};for(let o of g)try{let r=await y(e,o,null);t[o]={env:r.env.name,group:r.group.name,mode:r.mode,source:r.source}}catch(r){if(!(r instanceof m))throw r;t[o]={error:r.message}}await n.emit(t)}function L(n){try{return E(n).isDirectory()}catch{return!1}}function b(n){if(n){let t=F(n);if(!L(t))throw new m(`not a folder: ${n}`);return I.native(t)}let e=$();if(!e)throw new m("not inside a git repo",{hint:"run inside the repo or pass --path <repo>"});return e}async function W(n){let e=await n.config(),t={},o=Array.isArray(n.args.names)?n.args.names:[];for(let i of o){let c=e.environment(i),v=t[c.service];if(v!==void 0)throw new m(`pin one ${R[c.service]} environment, not '${v}' and '${i}'`);t[c.service]=i}let r=k(b(u(n.args.path)),f),s=null;if(O(r)&&E(r).isFile()){let i={};try{i=x(r)??{}}catch{i={}}let c={};for(let v of g){let h=i[v];typeof h=="string"&&(c[v]=h)}t={...c,...t},s=u(i.$schema)}let a=s?{$schema:s}:{};for(let i of g)t[i]!==void 0&&(a[i]=t[i]);C(r,JSON.stringify(a,null,2)+`
3
- `,"utf8"),await n.emit({pinned:t,file:r})}async function X(n){let e=k(b(u(n.args.path)),f),t=O(e);t&&N(e),await n.emit({removed:t?e:null})}async function Y(n){let e=String(n.args.name);await d(e,r=>{let s=r.environment(e);r.environments.delete(e),r.current[s.service]===e&&delete r.current[s.service]});let t=await w(),o=t&&Object.values(t[0]).includes(e);await n.emit({removed:e,...o?{warning:`${t[1]} still names it`}:{}})}export{B as add,Q as current,p as describe,G as list,z as move,W as pin,Y as remove,q as rename,H as show,X as unpin,M as update,K as use};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{D as v,e as g,f as l,x as f}from"./chunk-OP6EXLWQ.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import{a as m,b as u}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function d(e){return typeof e=="string"&&e?e:null}function h(e,s){let n=d(s.args.service),i=n?l[n]:void 0,o=d(s.args.env);if(o){let r=e.environment(o);if(i&&i!==r.service)throw new u(`environment '${o}' is not a ${i} environment`);return[r.service]}return i?[i]:[...g]}async function E(e){let s=await import("./tokenCache-3LMJRUTI.js"),n=await e.config(),i=h(n,e),o={};for(let r of i){let c;try{c=await f(n,r,d(e.args.env))}catch(t){if(!(t instanceof u)||i.length===1)throw t;continue}let a={env:c.env.name,group:c.group.name,mode:c.mode,source:c.source,endpoint:c.env.endpoint};try{let[t,p]=v(n,c,d(e.args.identity)),w=s.load(t.name);Object.assign(a,{identity:t.name,identity_source:p,username:t.username,method:t.method,signed_in:s.accountMatches(w,t)||t.method==="az_cli"})}catch(t){if(!(t instanceof m))throw t;a.error=t.message}e.args.check&&"identity"in a&&(a.check=await y(e,r)),o[r]=a}if(!Object.keys(o).length)throw new u("no environment selected",{hint:"pass --env <name>, or run: ppdo-cli env use <name> (see ppdo-cli env list)"});await e.emit(o)}async function y(e,s){try{let n=await e.client(s);if(s==="dataverse"){let r=(await n.request("GET","WhoAmI")).json()??{};return{ok:!0,user_id:r.UserId??null,organization_id:r.OrganizationId??null}}let o=((await n.request("GET","_apis/connectionData",{params:[["api-version","7.1-preview"]]})).json()??{}).authenticatedUser??{};return{ok:!0,user:o.providerDisplayName??null,user_id:o.id??null}}catch(n){if(!(n instanceof m))throw n;return{ok:!1,error:n.message,exit_code:n.exitCode}}}export{E as whoami};
@@ -1,3 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{D as l,e as w,f as d,x as f}from"./chunk-OP6EXLWQ.js";import"./chunk-TQLZ3TRU.js";import{e as u}from"./chunk-S4KF5Z3S.js";import{b as p}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function c(e){return typeof e=="string"&&e?e:null}async function y(e){let o=await e.config(),i=c(e.args.name);if(i)return[o.identity(i)];let n=c(e.args.env),s=c(e.args.service),t;n?t=[o.environment(n).service]:t=s?[d[s]]:[...w];let r=[];for(let a of t)try{r.push(await f(o,a,n))}catch(m){if(!(m instanceof p)||t.length===1)throw m}if(!r.length)throw new p("no environment selected",{hint:"name an identity, or pass --env <name>"});let g=[];for(let a of r){let[m]=l(o,a,c(e.args.identity));g.some(v=>v.name===m.name)||g.push(m)}return g}async function k(e){let o=await import("./provider-VXRAQRN2.js"),{loginScope:i}=await import("./services-B6V4VVX5.js"),n=await e.config(),s=!!(c(e.args.name)||c(e.args.service)),t=[];for(let r of await y(e)){let g=[...n.environments.values()].flatMap(a=>{let m=n.groups.get(a.group);return m?.identity===r.name?[{name:a.name,mode:m.mode}]:[]});t.push(await o.login(r,{deviceCode:!!e.args.deviceCode,scope:i(n,r),force:s,usedBy:g}))}await e.emit(t.length!==1?t:t[0])}async function I(e){let o=await import("./provider-VXRAQRN2.js"),i=await e.config(),n=c(e.args.name),s;if(e.args.all)s=[...i.identities.values()];else if(n)s=[i.identity(n)];else throw new p("name an identity or pass --all");let t=[];for(let r of s)t.push(await o.logout(r));await e.emit(t.length!==1?t:t[0])}async function E(e){let o=await import("./provider-VXRAQRN2.js"),i=await e.config(),n=c(e.args.name),t=(n?[i.identity(n)]:[...i.identities.values()]).map(r=>o.status(r));await e.emit(n?t[0]:t)}async function x(e){let o=c(e.args.service),i=c(e.args.scope);if(!o&&!i)throw new p("pass --service dv|ado or --scope <scope>");let n=await e.config(),s,t;if(o){let a=await f(n,d[o],c(e.args.env));[s]=l(n,a,c(e.args.identity));let{scopeFor:m}=await import("./services-B6V4VVX5.js");t=i??m(a.env)}else{let a=c(e.args.identity);if(!a)throw new p("pass --identity <name> or --service");s=n.identity(a),t=i}if(process.stdout.isTTY&&!e.args.show)throw new p("refusing to print a token to the terminal",{hint:"pipe it, or pass --show"});let{getToken:r}=await import("./provider-VXRAQRN2.js"),g=await r(s,t,{log:a=>e.log(a)});process.stdout.write(g+`
3
- `),e.verbose&&u(`token for ${s.name} (${t})`)}export{k as login,I as logout,E as status,x as token};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a as c}from"./chunk-5UOZCXQF.js";import{l as d,m as f}from"./chunk-OP6EXLWQ.js";import"./chunk-TQLZ3TRU.js";import{e as m}from"./chunk-S4KF5Z3S.js";import{b as r}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var p=["broker","browser","device_code"],h=[["tenant","tenant"],["username","username"],["method","method"],["clientId","clientId"],["configDir","configDir"],["secretEnv","secretEnv"],["certificate","certificate"]];function s(e,t){let n=e.args[t];return typeof n=="string"?n:void 0}function l(e){if(!e.tenant)throw new r("--tenant is required");if(p.includes(e.method)&&!e.username)throw new r(`--username is required for method '${e.method}'`,{hint:"it pins sign-in to the right account"});if(e.method==="spn"&&!e.clientId)throw new r(`--client-id is required for method '${e.method}'`);if(e.method==="spn"&&!(e.secretEnv||e.certificate))throw new r("method 'spn' needs --secret-env or --certificate");if(e.configDir&&e.method!=="az_cli")throw new r("--config-dir applies to method 'az_cli' only");if((e.secretEnv||e.certificate)&&e.method!=="spn")throw new r("--secret-env and --certificate apply to method 'spn' only");e.method==="broker"&&e.clientId&&m(`warning: identity '${e.name}' uses the broker with a custom client ID; the app must have ms-appx-web://Microsoft.AAD.BrokerPlugin/${e.clientId} registered as a redirect URI`)}async function D(e){let t=String(e.args.name);d(t,"identity");let n=new f(t,{tenant:s(e,"tenant")??"",username:s(e,"username")??null,method:s(e,"method")??"browser",clientId:s(e,"clientId")??null,configDir:s(e,"configDir")??null,secretEnv:s(e,"secretEnv")??null,certificate:s(e,"certificate")??null});l(n),await c(t,i=>{if(i.identities.has(t))throw new r(`identity '${t}' already exists`,{hint:`run: ppdo-cli identity update ${t} ...`});i.identities.set(t,n.clone())}),await e.emit({name:t,...n.toDict()})}function g(e){let t=[];for(let[n,i]of h){let a=s(e,n);a!==void 0&&t.push([i,a||null])}return t}function u(e,t){for(let[n,i]of t)n==="tenant"?e.tenant=i??"":n==="method"?e.method=i??"":e[n]=i}async function E(e){let t=String(e.args.name),n=g(e),i=(await e.config()).identity(t).clone();u(i,n),l(i),await e.emit(await c(t,a=>{let o=a.identity(t);return u(o,n),{name:t,...o.toDict()}}))}async function b(e){let t=await e.config();await e.emit([...t.identities.values()].map(n=>({name:n.name,username:n.username,tenant:n.tenant,method:n.method})))}async function R(e){let{filesFor:t}=await import("./tokenCache-3LMJRUTI.js"),n=(await e.config()).identity(String(e.args.name));await e.emit({name:n.name,...n.toDict(),client_id:n.effectiveClientId,cache_files:t(n.name)})}async function S(e){let t=String(e.args.name);await c(t,i=>{i.identity(t);let a=[...i.groups.values()].filter(o=>o.identity===t).map(o=>o.name);if(a.length&&!e.args.force)throw new r(`identity '${t}' is used by group(s): ${a.join(", ")}`,{hint:"update those groups first, or pass --force"});i.identities.delete(t);for(let o of i.groups.values())o.identity===t&&(o.identity=null)});let{deleteAll:n}=await import("./tokenCache-3LMJRUTI.js");await e.emit({removed:t,deleted_files:n(t)})}export{D as add,b as list,S as remove,R as show,E as update};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}from"./chunk-X7VWUI6N.js";import"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";export{b as TEAM_LABELS,a as TEAM_TYPES,c as VERBS,f as findRole,e as findTeam,d as findUser,r as origin,r as origin_,k as privileges,q as rights,m as roleGet,l as roleList,s as shared,p as tableOf,i as teamAddRole,h as teamGet,g as teamList,j as teamRemoveRole,n as userGet,o as userPrivileges};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{c as v}from"./chunk-NNHEYYF5.js";import{c as f}from"./chunk-BWZ6HZXM.js";import"./chunk-MTF66YXU.js";import{C as g,D as m,x as a,y as l}from"./chunk-OP6EXLWQ.js";import{d as u}from"./chunk-4S5ETLH4.js";import"./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";function y(e){return e.service==="dataverse"?new v({url:e.url}):new f({org:e.org,project:e.project})}function C(e){return y(e).scope()}function E(e,o){for(let n of e.environments.values()){let t=e.groups.get(n.group);if(t&&t.identity===o.name)return C(n)}return"https://graph.microsoft.com/.default"}async function h(e,o){let n=await e.config(),t,r;if(l(e.args))[t,r]=await g(n,o,e.args);else{let i=e.args.env;t=await a(n,o,typeof i=="string"?i:null);let s=e.args.identity;[r]=m(n,t,typeof s=="string"?s:null)}let p=y(t.env),d=async i=>{let{getToken:s}=await import("./provider-VXRAQRN2.js");return s(r,p.scope(),{forceRefresh:i,log:S=>e.log(S)})},c=new u(p,e,d);return c.target=t,c.identity=r,c}export{h as clientFor,E as loginScope,y as makeService,C as scopeFor};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"./chunk-JGLUQBCK.js";import"./chunk-QE4DELWW.js";import"./chunk-ZUXLC5VX.js";import"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";export{a as OPERATIONS,i as components,j as dependencies,k as exportCmd,c as find,h as get,s as history,p as importCmd,r as importResults,o as isInstalledAtLeast,g as list,d as names,f as objectIds,q as parseImportResults,m as projectZip,t as publish,b as row,l as settingsParameters,e as tableType,n as zipIdentity};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a as R,b as U,c as N,m as v}from"./chunk-HLE2WURE.js";import{ga as f}from"./chunk-TZSB4PR7.js";import"./chunk-C42MGXRN.js";import"./chunk-ZNJ4DRCA.js";import"./chunk-QMTPHZLQ.js";import{c as C}from"./chunk-JGLUQBCK.js";import{b as M,g as $,j as B}from"./chunk-QE4DELWW.js";import{a as P}from"./chunk-ZUXLC5VX.js";import{C as E,D as A,E as S,F as h}from"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import"./chunk-WIA546AL.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import{e as p}from"./chunk-S4KF5Z3S.js";import{a as d,b as y,c as b,d as w,g as x,h as j}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var u=n=>n?"managed":"unmanaged";async function m(n,a,e,i){return S(await A(n,a,"POST",e,{body:h(i)}))}async function D(n,a,e,i){let s=async o=>{try{let g=(await m(n,a,"ExportSolution",{SolutionName:e,Managed:o})).ExportSolutionFile;if(typeof g!="string")return"unexpected response: 'ExportSolutionFile'";try{return f(g)}catch(F){return`unexpected response: ${F.message}`}}catch(t){if(t instanceof b||t instanceof j||t instanceof w||t instanceof y||t instanceof x)throw t;if(t instanceof d){if((t.status??500)<500)throw t;return t.message}throw t}},l=i.map(o=>(p(`exporting ${e} (${u(o)})`),s(o))),c=await Promise.allSettled(l),r=new Map;return c.forEach((o,t)=>{if(o.status==="rejected")throw o.reason;r.set(i[t],o.value)}),r}async function I(n,a,e,i){let s=[];for(let o of i){let t=await m(n,a,"ExportSolutionAsync",{SolutionName:e,Managed:o});s.push({managed:o,job:String(t.AsyncOperationId??""),export:String(t.ExportJobId??"")}),p(`exporting ${e} (${u(o)}), job ${String(t.AsyncOperationId??"None")}`)}let l=typeof n.args.maxWait=="number"&&n.args.maxWait?n.args.maxWait:60,c=await P(async()=>{let o=new Map;for(let t of s)o.set(t.job,await $(n,a,t.job));return o},o=>[...o.values()].every(t=>t.statecode===M),{timeout:l*60,log:p,hint:"raise --max-wait, or check later with the job id",describe:o=>s.map(t=>`${u(t.managed)}: ${String(o.get(t.job).status)}`).join("; ")}),r=new Map;for(let o of s){B(c.get(o.job));let t=await m(n,a,"DownloadSolutionExportData",{ExportJobId:o.export});r.set(o.managed,f(String(t.ExportSolutionFile)))}return r}async function O(n,a,e,i,s=!1){let l=new Map,c=s?[...i]:[];if(!s)for(let[r,o]of await D(n,a,e,i))typeof o!="string"?l.set(r,o):(p(`${u(r)} export didn't finish in one request (${o}); running it as a job`),c.push(r));if(c.length)for(let[r,o]of await I(n,a,e,c))l.set(r,o);return l}async function Z(n,a,e,i=[],s=null){let l=await E(n);await C(n,l,a);let r=await O(n,l,a,e===R?[!1]:e===U?[!0]:[!1,!0],!!n.args.async),o=r.get(!1)??r.get(!0);return v(o,e,{managedZip:e===N?r.get(!0)??null:null,ignore:i,mapping:s})}export{O as exportAll,Z as exportAndPlan};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a,b,c,d,e,f,g,h}from"./chunk-MME53RWW.js";import"./chunk-GT52BRS2.js";import"./chunk-4S5ETLH4.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import"./chunk-UYDBLVAM.js";import"./chunk-3C3GSN3J.js";import"./chunk-RHQP7X6H.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";export{e as acquire,b as askHidden,c as certificate,g as check,d as credential,f as ephemeralToken,a as expandPath,h as resetForTests};
@@ -1,2 +0,0 @@
1
- import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k}from"./chunk-3C3GSN3J.js";import"./chunk-RHQP7X6H.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";export{a as MIN_LIFETIME,j as accountMatches,e as deleteAll,k as describe,d as filesFor,h as getValid,f as load,c as msalPath,i as put,g as save,b as tokensPath};