@ppdostudio/ppdo-cli 1.0.0-beta.0 → 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.
Files changed (124) hide show
  1. package/CHANGELOG.md +66 -54
  2. package/LICENSE +114 -114
  3. package/README.md +362 -331
  4. package/dist/bin.js +2 -2
  5. package/dist/chunks/{ado-NLCWVIVQ.js → ado-XAHQWYNQ.js} +6 -6
  6. package/dist/chunks/{api-T5SWGOFX.js → api-7RAWLIQV.js} +1 -1
  7. package/dist/chunks/{api-YKKPVMTX.js → api-KN24TLH6.js} +1 -1
  8. package/dist/chunks/auth-VZSJMSMF.js +6 -0
  9. package/dist/chunks/azCli-AEZK2RBQ.js +2 -0
  10. package/dist/chunks/{batch-GCXLGQET.js → batch-EZPKLWEI.js} +1 -1
  11. package/dist/chunks/{build-XDCWMEEL.js → build-LSQEAEFK.js} +3 -3
  12. package/dist/chunks/{bulk-5QO343HO.js → bulk-7FZCDH5U.js} +1 -1
  13. package/dist/chunks/chunk-4KP27OCL.js +2 -0
  14. package/dist/chunks/chunk-B4FPKDMH.js +2 -0
  15. package/dist/chunks/chunk-BCAXUZIO.js +2 -0
  16. package/dist/chunks/{chunk-X7VWUI6N.js → chunk-BODUSF3V.js} +1 -1
  17. package/dist/chunks/{chunk-WXCLWAE2.js → chunk-DVQ7OYIJ.js} +1 -1
  18. package/dist/chunks/chunk-H4OY4EFC.js +3 -0
  19. package/dist/chunks/chunk-HIW2K6OP.js +4 -0
  20. package/dist/chunks/{chunk-GT52BRS2.js → chunk-I3TMFYRJ.js} +18 -18
  21. package/dist/chunks/{chunk-PDFXH652.js → chunk-KBQYSAJX.js} +1 -1
  22. package/dist/chunks/chunk-LB7WNZVK.js +5 -0
  23. package/dist/chunks/{chunk-J777TCSE.js → chunk-LL4XQ3L7.js} +1 -1
  24. package/dist/chunks/chunk-MBNUMAAZ.js +2 -0
  25. package/dist/chunks/{chunk-5KZDCOFA.js → chunk-MGZDEW3X.js} +1 -1
  26. package/dist/chunks/chunk-MK6QZ4ES.js +2 -0
  27. package/dist/chunks/chunk-MZEUD7ET.js +6 -0
  28. package/dist/chunks/{chunk-JGLUQBCK.js → chunk-OXZG44O5.js} +1 -1
  29. package/dist/chunks/{chunk-UWFDJKOJ.js → chunk-PYTSDUPY.js} +1 -1
  30. package/dist/chunks/{chunk-QE4DELWW.js → chunk-RC5VPVGC.js} +1 -1
  31. package/dist/chunks/chunk-STWQDANK.js +5 -0
  32. package/dist/chunks/{chunk-HLE2WURE.js → chunk-TADCW6ZI.js} +1 -1
  33. package/dist/chunks/{chunk-XL7E7LX5.js → chunk-TM3M633T.js} +2 -2
  34. package/dist/chunks/{chunk-UKKSN4F7.js → chunk-TXVNEV3M.js} +1 -1
  35. package/dist/chunks/{chunk-UYDBLVAM.js → chunk-WMDKJRDC.js} +1 -1
  36. package/dist/chunks/{chunk-NNHEYYF5.js → chunk-WNQERCOO.js} +1 -1
  37. package/dist/chunks/{commands-GHYN6GZT.js → commands-GRWX32IX.js} +1 -1
  38. package/dist/chunks/{component-PAASRIK6.js → component-TCL43QXZ.js} +1 -1
  39. package/dist/chunks/config-UKI5TBH5.js +2 -0
  40. package/dist/chunks/{connection-IWFELK5W.js → connection-QNXMJGHZ.js} +1 -1
  41. package/dist/chunks/{connref-ZDY7JYK5.js → connref-U3CMQ64O.js} +1 -1
  42. package/dist/chunks/{customizations-IE2KO275.js → customizations-VNEASPWI.js} +2 -2
  43. package/dist/chunks/{dependency-EFDSIKSN.js → dependency-U6OQA5PS.js} +1 -1
  44. package/dist/chunks/{discovery-XXVLVHD6.js → discovery-IWAWXXWF.js} +1 -1
  45. package/dist/chunks/{dv-3OESFBNW.js → dv-C45WDXRG.js} +21 -21
  46. package/dist/chunks/{env-MZPI3UA2.js → env-GL5ZPAZI.js} +1 -1
  47. package/dist/chunks/{environment-NUQHU74A.js → environment-FPS4AFM5.js} +1 -1
  48. package/dist/chunks/{environments-WMBLSAQF.js → environments-VZWNFJYE.js} +1 -1
  49. package/dist/chunks/{envvar-YN35IDWJ.js → envvar-52V6K6LF.js} +1 -1
  50. package/dist/chunks/{fanout-DUP5CD5X.js → fanout-Q3656CCP.js} +1 -1
  51. package/dist/chunks/{fetchxml-ONTNTA6Z.js → fetchxml-FWUQZP4M.js} +1 -1
  52. package/dist/chunks/{functions-K5TYRB2C.js → functions-SNCK2IYV.js} +1 -1
  53. package/dist/chunks/{graph-JI23YQB5.js → graph-OK24IOUV.js} +1 -1
  54. package/dist/chunks/{group-DKEPSVRV.js → group-TLGLTTUG.js} +2 -2
  55. package/dist/chunks/{history-SNSJRV6B.js → history-67SQS54S.js} +1 -1
  56. package/dist/chunks/identity-SRTOEQVC.js +2 -0
  57. package/dist/chunks/{jobs-PXNJFWWF.js → jobs-2ZPBDDHT.js} +1 -1
  58. package/dist/chunks/{lifecycle-7RMWV26J.js → lifecycle-OJRM7K2I.js} +1 -1
  59. package/dist/chunks/{main-ZVIKC3VA.js → main-HOYSLMHZ.js} +2 -2
  60. package/dist/chunks/{metadata-74WGGOV5.js → metadata-WYVJ7NP7.js} +1 -1
  61. package/dist/chunks/{metadataCreate-W3NDI5FB.js → metadataCreate-PBA3KH3A.js} +1 -1
  62. package/dist/chunks/msalUser-3PBGT655.js +2 -0
  63. package/dist/chunks/{names-SFYZQY6Q.js → names-ZRM6SAYU.js} +1 -1
  64. package/dist/chunks/{pack-2UDE25IY.js → pack-3OYGV36R.js} +1 -1
  65. package/dist/chunks/pat-KGOBISLG.js +2 -0
  66. package/dist/chunks/{pipelines-O3OYNCHT.js → pipelines-62CVDRXV.js} +1 -1
  67. package/dist/chunks/{plugins-EUDJ7QIS.js → plugins-SBMDFXVA.js} +1 -1
  68. package/dist/chunks/{policies-KVPQVUHS.js → policies-BZR5437X.js} +1 -1
  69. package/dist/chunks/{pools-7H2L4QJC.js → pools-I4NVR67Z.js} +1 -1
  70. package/dist/chunks/{process-G7LCTGKS.js → process-WS76WV3T.js} +1 -1
  71. package/dist/chunks/{projects-BHG2B4IX.js → projects-GXIQO7HV.js} +1 -1
  72. package/dist/chunks/protect-X2J7LU7X.js +2 -0
  73. package/dist/chunks/provider-FN7TXWRE.js +2 -0
  74. package/dist/chunks/{prs-NOXIZ7AT.js → prs-F2EVQJRV.js} +1 -1
  75. package/dist/chunks/{records-TN7ZKUJ7.js → records-7IQET422.js} +1 -1
  76. package/dist/chunks/run-APD3TRCW.js +2 -0
  77. package/dist/chunks/{run-MGLIIM7Z.js → run-G2MVOV3C.js} +1 -1
  78. package/dist/chunks/{run-JYU5BTWN.js → run-H2OLE76P.js} +1 -1
  79. package/dist/chunks/run-ICS4FNZA.js +3 -0
  80. package/dist/chunks/run-KP2SNX2A.js +3 -0
  81. package/dist/chunks/{run-BXFENCN6.js → run-LNEOCXZA.js} +1 -1
  82. package/dist/chunks/run-SB4QN5Q4.js +2 -0
  83. package/dist/chunks/run-XRPU3YZF.js +2 -0
  84. package/dist/chunks/{runtime-VOF7XYXW.js → runtime-MIU5CS5B.js} +1 -1
  85. package/dist/chunks/{security-FLEAZ4EA.js → security-RC3EI7CZ.js} +1 -1
  86. package/dist/chunks/{service-V2TQEEID.js → service-4VHAPTA6.js} +1 -1
  87. package/dist/chunks/{service-4PIAYFYF.js → service-RFKOKM72.js} +1 -1
  88. package/dist/chunks/services-4BORTJPM.js +2 -0
  89. package/dist/chunks/{skills-GD6Z6P3R.js → skills-6O2GSTU4.js} +1 -1
  90. package/dist/chunks/{solution-HF57MP27.js → solution-3WUUDYF3.js} +1 -1
  91. package/dist/chunks/{solutionExport-TLGHMUM5.js → solutionExport-GTBTHG2D.js} +1 -1
  92. package/dist/chunks/{solutionfiles-P223QW2J.js → solutionfiles-VWZHFZZ6.js} +1 -1
  93. package/dist/chunks/spn-2RZJLCML.js +2 -0
  94. package/dist/chunks/tokenCache-TQFT6LAD.js +2 -0
  95. package/dist/chunks/{unpack-XZLTBUGC.js → unpack-HUH7OJMP.js} +1 -1
  96. package/dist/chunks/{users-KFAPPGF4.js → users-JIBQKPYA.js} +1 -1
  97. package/dist/chunks/{vargroups-33EZAHGZ.js → vargroups-Q2KG7LHR.js} +1 -1
  98. package/dist/chunks/{whoami-ULK5UMZV.js → whoami-V54TCLT5.js} +1 -1
  99. package/dist/chunks/{workitems-YGES6KKN.js → workitems-UG5O3EGB.js} +1 -1
  100. package/package.json +57 -57
  101. package/schema/ppdo-cli.schema.json +16 -4
  102. package/skills/ppdo-cli/SKILL.md +1 -1
  103. package/dist/chunks/auth-IP7AOWSF.js +0 -6
  104. package/dist/chunks/azCli-T67ZMIC3.js +0 -2
  105. package/dist/chunks/chunk-3C3GSN3J.js +0 -2
  106. package/dist/chunks/chunk-4S5ETLH4.js +0 -2
  107. package/dist/chunks/chunk-5UOZCXQF.js +0 -5
  108. package/dist/chunks/chunk-BWZ6HZXM.js +0 -2
  109. package/dist/chunks/chunk-MME53RWW.js +0 -4
  110. package/dist/chunks/chunk-OP6EXLWQ.js +0 -5
  111. package/dist/chunks/chunk-RHQP7X6H.js +0 -3
  112. package/dist/chunks/config-JN3I5EII.js +0 -2
  113. package/dist/chunks/identity-OW4WCDOA.js +0 -2
  114. package/dist/chunks/msalUser-JRNX5HPO.js +0 -2
  115. package/dist/chunks/protect-WZO3MAHF.js +0 -2
  116. package/dist/chunks/provider-VXRAQRN2.js +0 -2
  117. package/dist/chunks/run-F6H4QCWR.js +0 -2
  118. package/dist/chunks/run-HBQCSGYY.js +0 -3
  119. package/dist/chunks/run-MHM3GTGH.js +0 -2
  120. package/dist/chunks/run-SRQPP6N3.js +0 -3
  121. package/dist/chunks/run-ZNDSC7LR.js +0 -2
  122. package/dist/chunks/services-B6V4VVX5.js +0 -2
  123. package/dist/chunks/spn-AIUWML5R.js +0 -2
  124. package/dist/chunks/tokenCache-3LMJRUTI.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{A as w,v as r,x as c,y as Q,z as g}from"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import{d as Y,e as l,h as q,i as f,j as y,k as B,l as V,o as p,r as t}from"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import{c as h}from"./chunk-ZHHVG47C.js";var R={};h(R,{add:()=>le});function le(o){let e=()=>import("./bulk-5QO343HO.js"),n=t(o,"upsert","W","create or update many rows, by alternate key or id, with a result per row",{description:`create or update many rows, by alternate key or id, with a result per row
2
+ import{A as w,v as r,x as c,y as Q,z as g}from"./chunk-TXVNEV3M.js";import"./chunk-UCTMKA2J.js";import{d as Y,e as l,h as q,i as f,j as y,k as B,l as V,o as p,r as t}from"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import{c as h}from"./chunk-ZHHVG47C.js";var R={};h(R,{add:()=>le});function le(o){let e=()=>import("./bulk-7FZCDH5U.js"),n=t(o,"upsert","W","create or update many rows, by alternate key or id, with a result per row",{description:`create or update many rows, by alternate key or id, with a result per row
3
3
 
4
4
  --body is one JSON object per line (or a JSON array). With --key the rows are matched on
5
5
  those columns (an alternate key on the table); without it each row needs the table's
@@ -10,7 +10,7 @@ relationship's); <target> is a record reference such as contacts(<id>) or contac
10
10
 
11
11
  For a lookup, leave out <target>; for a collection, name the record to unlink.`}).argument("<entityset>").argument("<id>","id or alternate key (name=value)").argument("<navigation>").argument("[target]","e.g. contacts(<id>); not needed for a lookup").handler(async a=>(await e()).disassociate(a))}var C={};h(C,{add:()=>ce});var x=`<type> and <component> as for dv solution add-component: a type name (table, column,
12
12
  form, view, webresource, process, role, step, envvar, connref, ...) or number, and an id
13
- or, for most types, a name (a column is <table>.<column>).`;function b(o){return o.argument("<type>").argument("<component>","id or name")}function ce(o){let e=p(o,"component","solution components: layers, dependencies, drafts, unmanaged layer"),n=()=>import("./component-PAASRIK6.js");b(t(e,"layers","R","the layers on a component, bottom to top, and what each one changes",{description:`the layers on a component, bottom to top, and what each one changes
13
+ or, for most types, a name (a column is <table>.<column>).`;function b(o){return o.argument("<type>").argument("<component>","id or name")}function ce(o){let e=p(o,"component","solution components: layers, dependencies, drafts, unmanaged layer"),n=()=>import("./component-TCL43QXZ.js");b(t(e,"layers","R","the layers on a component, bottom to top, and what each one changes",{description:`the layers on a component, bottom to top, and what each one changes
14
14
 
15
15
  `+x+`
16
16
 
@@ -27,16 +27,16 @@ stdin): lines of {"type", "id", "parent_id"}, solutioncomponents rows, or dv dep
27
27
  list rows (both sides). .gz files are read as gzip.
28
28
  Each component gets name_status resolved, not-found or type-unsupported, its name,
29
29
  logical and schema name, and its parent table (columns, keys, forms, views, ...) or
30
- column (local choices).`}).argument("[type]").argument("[component]","id or name").option("--file <file.ndjson|->","components to name, one JSON object per line").option("--save <file>","write the rows to a file as NDJSON (gzip if it ends .gz); stdout gets a summary").handler(async i=>(await import("./names-SFYZQY6Q.js")).names(i)),b(t(e,"remove-active","D","remove a component's unmanaged (Active) layer, going back to the managed one",{description:`remove a component's unmanaged (Active) layer, going back to the managed one
30
+ column (local choices).`}).argument("[type]").argument("[component]","id or name").option("--file <file.ndjson|->","components to name, one JSON object per line").option("--save <file>","write the rows to a file as NDJSON (gzip if it ends .gz); stdout gets a summary").handler(async i=>(await import("./names-ZRM6SAYU.js")).names(i)),b(t(e,"remove-active","D","remove a component's unmanaged (Active) layer, going back to the managed one",{description:`remove a component's unmanaged (Active) layer, going back to the managed one
31
31
 
32
32
  RemoveActiveCustomization. Unmanaged changes to the component are lost.
33
33
  `+x})).handler(async i=>(await n()).removeActive(i))}var T={};h(T,{add:()=>me});function me(o){let e=p(o,"connection","Power Platform connections (for dv connref set)"),n=t(e,"list","R","connections you can use in this environment, and the references bound to each",{description:`connections you can use in this environment, and the references bound to each
34
34
 
35
35
  The id is what dv connref set --connection takes. Connections come from the Power Apps
36
- API with the environment's account: yours, and those shared with you.`}).option("--connector <name>","e.g. shared_commondataserviceforapps or commondataserviceforapps").option("--unused","only connections no connection reference here is bound to");r(n),n.handler(async a=>(await import("./connection-IWFELK5W.js")).list(a))}var L={};h(L,{add:()=>ue});function ue(o){let e=()=>import("./connref-ZDY7JYK5.js"),n=p(o,"connref","connection references"),a=t(n,"list","R","connection references and the connection each one uses").option("--solution <name>[,<name>...]","only connection references in these solutions").option("--name <pattern>","logical name; * is a wildcard").option("--unbound","only those with no connection");r(a),a.handler(async i=>(await e()).list(i)),t(n,"get","R","one connection reference").argument("<name>","logical name or id").handler(async i=>(await e()).get(i)),t(n,"set","W","point a connection reference at a connection",{description:`point a connection reference at a connection
36
+ API with the environment's account: yours, and those shared with you.`}).option("--connector <name>","e.g. shared_commondataserviceforapps or commondataserviceforapps").option("--unused","only connections no connection reference here is bound to");r(n),n.handler(async a=>(await import("./connection-QNXMJGHZ.js")).list(a))}var L={};h(L,{add:()=>ue});function ue(o){let e=()=>import("./connref-U3CMQ64O.js"),n=p(o,"connref","connection references"),a=t(n,"list","R","connection references and the connection each one uses").option("--solution <name>[,<name>...]","only connection references in these solutions").option("--name <pattern>","logical name; * is a wildcard").option("--unbound","only those with no connection");r(a),a.handler(async i=>(await e()).list(i)),t(n,"get","R","one connection reference").argument("<name>","logical name or id").handler(async i=>(await e()).get(i)),t(n,"set","W","point a connection reference at a connection",{description:`point a connection reference at a connection
37
37
 
38
38
  --connection is the connection's id, <connector>/<id>, or the connection's URL from
39
- Power Automate > Connections; it must be a connection for the same connector.`}).argument("<name>","logical name or id").requiredOption("--connection <id>|<connector>/<id>|<url>","the connection").handler(async i=>(await e()).set(i))}var z={};h(z,{add:()=>ge});function A(o){return r(o),o}var he=["address-book-filters","advanced-find","appointment-book","associated","custom-defined","interactive-workflow","lookup","main-without-subject","offline-filters","offline-template","other","outlook-filters","public","quick-find","reporting"],fe=["card","dashboard","main","main-interactive","mobile","quick-create","quick-view"],ye=["main","quick-create","quick-view","card"],Z=["html","css","js","xml","png","jpg","gif","xap","xsl","ico","svg","resx"];function k(o,e){return o.argument(`<${e}>`,`${e} id or name`).option("--table <logical name>",`the table, when the ${e} name isn't unique`)}function j(o){return o.option("--solution <name>","add it to this unmanaged solution").option("--no-publish","leave it unpublished")}function ge(o){let e=()=>import("./customizations-IE2KO275.js"),n=p(o,"view","views (saved queries), edited as FetchXML and layout XML files");A(t(n,"list","R","a table's views").argument("<table>","table logical name").addOption(c("--type <type>",void 0,he)).option("--name <pattern>","view name; * is a wildcard")).handler(async s=>(await e()).viewList(s)),k(t(n,"get","R","a view's columns, sort and filter; --save-* write its XML to edit"),"view").option("--save-fetchxml <file>").option("--save-layoutxml <file>").handler(async s=>(await e()).viewGet(s)),j(t(n,"create","W","create a public view (empty, a copy, or from XML files), then publish",{description:`create a public view (empty, a copy, or from XML files), then publish
39
+ Power Automate > Connections; it must be a connection for the same connector.`}).argument("<name>","logical name or id").requiredOption("--connection <id>|<connector>/<id>|<url>","the connection").handler(async i=>(await e()).set(i))}var z={};h(z,{add:()=>ge});function A(o){return r(o),o}var he=["address-book-filters","advanced-find","appointment-book","associated","custom-defined","interactive-workflow","lookup","main-without-subject","offline-filters","offline-template","other","outlook-filters","public","quick-find","reporting"],fe=["card","dashboard","main","main-interactive","mobile","quick-create","quick-view"],ye=["main","quick-create","quick-view","card"],Z=["html","css","js","xml","png","jpg","gif","xap","xsl","ico","svg","resx"];function k(o,e){return o.argument(`<${e}>`,`${e} id or name`).option("--table <logical name>",`the table, when the ${e} name isn't unique`)}function j(o){return o.option("--solution <name>","add it to this unmanaged solution").option("--no-publish","leave it unpublished")}function ge(o){let e=()=>import("./customizations-VNEASPWI.js"),n=p(o,"view","views (saved queries), edited as FetchXML and layout XML files");A(t(n,"list","R","a table's views").argument("<table>","table logical name").addOption(c("--type <type>",void 0,he)).option("--name <pattern>","view name; * is a wildcard")).handler(async s=>(await e()).viewList(s)),k(t(n,"get","R","a view's columns, sort and filter; --save-* write its XML to edit"),"view").option("--save-fetchxml <file>").option("--save-layoutxml <file>").handler(async s=>(await e()).viewGet(s)),j(t(n,"create","W","create a public view (empty, a copy, or from XML files), then publish",{description:`create a public view (empty, a copy, or from XML files), then publish
40
40
 
41
41
  Empty shows the table's primary name column. --copy takes another view's XML; the
42
42
  XML options replace either part. The XML is checked before anything is written.`}).argument("<table>","table logical name").requiredOption("--name <name>").option("--copy <view>","view to copy (id or name)").option("--fetchxml <@file>").option("--layoutxml <@file>").option("--description <description>")).handler(async s=>(await e()).viewCreate(s)),k(t(n,"update","W","change a view's name or description, or replace its XML, then publish",{description:`change a view's name or description, or replace its XML, then publish
@@ -63,15 +63,15 @@ Each row's found_by says how it was found: membership, base-solution or componen
63
63
  --dependent <type> <component>: rows where it is the dependent component (what it requires).
64
64
  <type> and <component> as for dv solution add-component.
65
65
  --type n keeps rows whose component at the other end has type n.
66
- Each row has both sides' type, id, parent id, and base and top (winning layer) solution.`}).option("--solution <a,b>","solution unique names").addOption(ee("--required","rows where this component is required")).addOption(ee("--dependent","rows where this component is the dependent")).addOption(new l("--type <n>","only rows whose component at the other end has this type").argParser(f)).option("--include-system","allow --all with no filter (a bare environment has about 200,000 rows)");r(n),n.option("--save <file>","write the rows to a file as NDJSON (gzip if it ends .gz); stdout gets a summary"),n.handler(async a=>(await import("./dependency-EFDSIKSN.js")).list(a))}var E={};h(E,{add:()=>be});function be(o){let e=()=>import("./environment-NUQHU74A.js"),n=p(o,"org","the environment's organization");t(n,"get","R","version, ids, names, type and endpoints of the environment",{description:`version, ids, names, type and endpoints of the environment
66
+ Each row has both sides' type, id, parent id, and base and top (winning layer) solution.`}).option("--solution <a,b>","solution unique names").addOption(ee("--required","rows where this component is required")).addOption(ee("--dependent","rows where this component is the dependent")).addOption(new l("--type <n>","only rows whose component at the other end has this type").argParser(f)).option("--include-system","allow --all with no filter (a bare environment has about 200,000 rows)");r(n),n.option("--save <file>","write the rows to a file as NDJSON (gzip if it ends .gz); stdout gets a summary"),n.handler(async a=>(await import("./dependency-U6OQA5PS.js")).list(a))}var E={};h(E,{add:()=>be});function be(o){let e=()=>import("./environment-FPS4AFM5.js"),n=p(o,"org","the environment's organization");t(n,"get","R","version, ids, names, type and endpoints of the environment",{description:`version, ids, names, type and endpoints of the environment
67
67
 
68
68
  With --env a,b or --group, compare versions across environments.`}).handler(async s=>(await e()).orgGet(s));let a=p(o,"setting","environment and app settings"),i=t(a,"list","R","setting definitions with their type, default and where they can be overridden");i.option("--name <pattern>","setting name; * is a wildcard"),r(i),i.handler(async s=>(await e()).list(s)),t(a,"get","R","the value a setting actually has, and where it comes from",{description:`the value a setting actually has, and where it comes from
69
69
 
70
70
  source is app (an app override, with --app), organization (an environment override) or
71
- default. With --env a,b or --group, compare across environments.`}).argument("<name>","setting unique name").option("--app <uniquename>","the value for this model-driven app").handler(async s=>(await e()).get(s))}var S={};h(S,{add:()=>ve});function ve(o){let e=()=>import("./envvar-YN35IDWJ.js"),n=p(o,"envvar","environment variables"),a=t(n,"list","R","environment variables with their default, current and effective values").option("--solution <name>[,<name>...]","only variables in these solutions").option("--name <pattern>","schema name; * is a wildcard");r(a),a.handler(async i=>(await e()).list(i)),t(n,"get","R","one environment variable").argument("<name>","schema name or definition id").handler(async i=>(await e()).get(i)),t(n,"set","W","set an environment variable's current value (creating the value row if needed)",{description:`set an environment variable's current value (creating the value row if needed)
71
+ default. With --env a,b or --group, compare across environments.`}).argument("<name>","setting unique name").option("--app <uniquename>","the value for this model-driven app").handler(async s=>(await e()).get(s))}var S={};h(S,{add:()=>ve});function ve(o){let e=()=>import("./envvar-52V6K6LF.js"),n=p(o,"envvar","environment variables"),a=t(n,"list","R","environment variables with their default, current and effective values").option("--solution <name>[,<name>...]","only variables in these solutions").option("--name <pattern>","schema name; * is a wildcard");r(a),a.handler(async i=>(await e()).list(i)),t(n,"get","R","one environment variable").argument("<name>","schema name or definition id").handler(async i=>(await e()).get(i)),t(n,"set","W","set an environment variable's current value (creating the value row if needed)",{description:`set an environment variable's current value (creating the value row if needed)
72
72
 
73
73
  The value is checked against the variable's type: a number, valid JSON, or
74
- yes/no for a boolean (true/false are stored as yes/no).`}).argument("<name>","schema name or definition id").requiredOption("--value <text>|@file|-","the value, a file with @file, or - for stdin").handler(async i=>(await e()).set(i))}var W={};h(W,{add:()=>xe});function xe(o){let e=()=>import("./functions-K5TYRB2C.js");t(o,"fn","R","call a function (GET); parameters are escaped by type",{description:`Values are typed for you: GUIDs, numbers, true/false and JSON stay bare; text is quoted.
74
+ yes/no for a boolean (true/false are stored as yes/no).`}).argument("<name>","schema name or definition id").requiredOption("--value <text>|@file|-","the value, a file with @file, or - for stdin").handler(async i=>(await e()).set(i))}var W={};h(W,{add:()=>xe});function xe(o){let e=()=>import("./functions-SNCK2IYV.js");t(o,"fn","R","call a function (GET); parameters are escaped by type",{description:`Values are typed for you: GUIDs, numbers, true/false and JSON stay bare; text is quoted.
75
75
  Use --string NAME to force a value to be text.
76
76
  Examples:
77
77
  ppdo-cli dv fn RetrieveTotalRecordCount --param 'EntityNames=["account"]'
@@ -80,8 +80,8 @@ Examples:
80
80
  ppdo-cli dv action PublishAllXml
81
81
  ppdo-cli dv action AddToQueue --bound queues/<id> --body @target.json`}).argument("<name>").option("--bound <<entityset>/<key>>");w(n),n.handler(async a=>(await e()).action(a))}var D={};h(D,{add:()=>ke});function ke(o){let e=t(o,"history","R","audit history of a record (or one column): who changed what, when",{description:`Newest first. Each change lists the columns with old and new values; choices and
82
82
  lookups show their label, with the raw value in old_value/new_value. Needs auditing
83
- on for the organization, the table and the column; an empty result says which is off.`}).argument("<entityset>","entity set name, e.g. accounts").argument("<id>","row id (GUID)").option("--column <logical name>","only changes to this column").option("--since <when>","30m, 12h, 7d, 2w or a date");r(e),e.handler(async n=>(await import("./history-SNSJRV6B.js")).history(n))}var _={};h(_,{add:()=>Oe});var te=["waiting","suspended","running","succeeded","failed","canceled"];function Oe(o){let e=()=>import("./jobs-PXNJFWWF.js"),n=p(o,"job","system jobs (async operations)"),a=t(n,"list","R","system jobs, newest first",{description:`--type takes an operation type number, e.g. 1 system event (async plugin), 10 workflow,
84
- 13 bulk delete, 54 execute async request (solution import/export), 57 rollup field.`}).addOption(c("--state <"+te.join("|")+">",void 0,te)).option("--name <pattern>","job name; * is a wildcard").addOption(new l("--type <n>","operation type number").argParser(f)).option("--since <when>","created in the last 30m, 12h, 7d, 2w, or since a date");r(a),a.handler(async i=>(await e()).list(i)),t(n,"get","R","status of a system job").argument("<id>","asyncoperationid").handler(async i=>(await e()).get(i)),t(n,"wait","R","wait for a system job to finish; non-zero exit if it failed").argument("<id>","asyncoperationid").handler(async i=>(await e()).waitCmd(i)),t(n,"cancel","W","cancel a waiting, suspended or running system job").argument("<id>","asyncoperationid").handler(async i=>(await e()).cancel(i))}var N={};h(N,{add:()=>qe,addToSolutionGroup:()=>M});var ne=["major","minor","build","revision"];function qe(o){let e=()=>import("./lifecycle-7RMWV26J.js"),n=p(o,"publisher","solution publishers"),a=t(n,"list","R","publishers with their prefixes").option("--name <pattern>","unique name; * is a wildcard");r(a),a.handler(async i=>(await e()).publisherList(i)),t(n,"create","W","create a publisher").argument("<prefix>","customization prefix: 2-8 lower-case letters or digits, starting with a letter").requiredOption("--name <uniquename>").option("--display-name <text>","default: the unique name").addOption(new l("--option-prefix <10000-99999>","choice value prefix; default derived from the prefix").argParser(f)).handler(async i=>(await e()).publisherCreate(i))}function M(o){let e=()=>import("./lifecycle-7RMWV26J.js");t(o,"create","W","create an unmanaged solution").argument("<uniquename>").requiredOption("--publisher <prefix|uniquename>").option("--version <x.y.z.w>","default 1.0.0.0","1.0.0.0").option("--display-name <text>","default: the unique name").option("--description <text>").handler(async n=>(await e()).create(n)),t(o,"update","W","change a solution's version, display name or description",{description:`change a solution's version, display name or description
83
+ on for the organization, the table and the column; an empty result says which is off.`}).argument("<entityset>","entity set name, e.g. accounts").argument("<id>","row id (GUID)").option("--column <logical name>","only changes to this column").option("--since <when>","30m, 12h, 7d, 2w or a date");r(e),e.handler(async n=>(await import("./history-67SQS54S.js")).history(n))}var _={};h(_,{add:()=>Oe});var te=["waiting","suspended","running","succeeded","failed","canceled"];function Oe(o){let e=()=>import("./jobs-2ZPBDDHT.js"),n=p(o,"job","system jobs (async operations)"),a=t(n,"list","R","system jobs, newest first",{description:`--type takes an operation type number, e.g. 1 system event (async plugin), 10 workflow,
84
+ 13 bulk delete, 54 execute async request (solution import/export), 57 rollup field.`}).addOption(c("--state <"+te.join("|")+">",void 0,te)).option("--name <pattern>","job name; * is a wildcard").addOption(new l("--type <n>","operation type number").argParser(f)).option("--since <when>","created in the last 30m, 12h, 7d, 2w, or since a date");r(a),a.handler(async i=>(await e()).list(i)),t(n,"get","R","status of a system job").argument("<id>","asyncoperationid").handler(async i=>(await e()).get(i)),t(n,"wait","R","wait for a system job to finish; non-zero exit if it failed").argument("<id>","asyncoperationid").handler(async i=>(await e()).waitCmd(i)),t(n,"cancel","W","cancel a waiting, suspended or running system job").argument("<id>","asyncoperationid").handler(async i=>(await e()).cancel(i))}var N={};h(N,{add:()=>qe,addToSolutionGroup:()=>M});var ne=["major","minor","build","revision"];function qe(o){let e=()=>import("./lifecycle-OJRM7K2I.js"),n=p(o,"publisher","solution publishers"),a=t(n,"list","R","publishers with their prefixes").option("--name <pattern>","unique name; * is a wildcard");r(a),a.handler(async i=>(await e()).publisherList(i)),t(n,"create","W","create a publisher").argument("<prefix>","customization prefix: 2-8 lower-case letters or digits, starting with a letter").requiredOption("--name <uniquename>").option("--display-name <text>","default: the unique name").addOption(new l("--option-prefix <10000-99999>","choice value prefix; default derived from the prefix").argParser(f)).handler(async i=>(await e()).publisherCreate(i))}function M(o){let e=()=>import("./lifecycle-OJRM7K2I.js");t(o,"create","W","create an unmanaged solution").argument("<uniquename>").requiredOption("--publisher <prefix|uniquename>").option("--version <x.y.z.w>","default 1.0.0.0","1.0.0.0").option("--display-name <text>","default: the unique name").option("--description <text>").handler(async n=>(await e()).create(n)),t(o,"update","W","change a solution's version, display name or description",{description:`change a solution's version, display name or description
85
85
 
86
86
  --bump increases one part of the version and sets the parts after it to 0.`}).argument("<uniquename>").option("--version <x.y.z.w>").addOption(c("--bump <"+ne.join("|")+">",void 0,ne)).option("--display-name <text>").option("--description <text>").handler(async n=>(await e()).update(n)),t(o,"patch","W","create a patch of an unmanaged solution (CloneAsPatch)",{description:`create a patch of an unmanaged solution (CloneAsPatch)
87
87
 
@@ -100,18 +100,18 @@ Adding a table that's already in the solution changes how it's included, except
100
100
  all its subcomponents: remove that one first.`}).argument("<uniquename>","solution unique name").argument("<type>").argument("<component>","id or name").option("--shell","tables only: include as shell only (behavior 2)").option("--no-subcomponents","tables only: include the table's metadata but no subcomponents (behavior 1)").option("--with-required","also add the components it requires").handler(async n=>(await e()).addComponent(n)),t(o,"remove-component","W","remove a component from a solution (the component itself stays)").argument("<uniquename>","solution unique name").argument("<type>").argument("<component>","id or name").handler(async n=>(await e()).removeComponent(n)),t(o,"promote","D","apply a staged upgrade: replace a solution with its _Upgrade holding solution",{description:`apply a staged upgrade: replace a solution with its _Upgrade holding solution
101
101
 
102
102
  The second step after dv solution import --holding (DeleteAndPromoteAsync). Components
103
- no longer in the new version are deleted, with their data, so it needs a full group.`}).argument("<uniquename>","the base solution (not the _Upgrade one)").option("--async","poll the job until it finishes").handler(async n=>(await e()).promote(n))}var U={};h(U,{COLUMN_TYPES:()=>oe,add:()=>Ce});function Re(o){return r(o),o}var oe=["string","memo","int","decimal","money","bool","datetime","choice","lookup"];function Ce(o){let e=p(o,"metadata","tables, columns and choices"),n=()=>import("./metadata-74WGGOV5.js");Re(t(e,"list","R","list tables").option("--custom-only","only custom tables").option("--search <text>","logical name or display name contains")).handler(async a=>(await n()).list(a)),t(e,"get","R","a table's definition (compact by default)").argument("<entity>","logical name, e.g. account").option("--attributes","include columns").option("--relationships","include relationships").option("--keys","include alternate keys").option("--raw","the full EntityDefinitions document").handler(async a=>(await n()).get(a)),t(e,"attribute","R","one column's definition, with choice options").argument("<entity>").argument("<attribute>").option("--raw").handler(async a=>(await n()).attribute(a)),t(e,"optionset","R","a global choice and its options").argument("<name>").option("--raw").handler(async a=>(await n()).optionset(a)),Te(e)}function Te(o){let e=p(o,"create","create tables, columns, global choices and alternate keys"),n=()=>import("./metadataCreate-W3NDI5FB.js"),a=i=>i.option("--solution <name>","add it to this unmanaged solution");a(t(e,"table","W","create a table with its primary name column",{description:`create a table with its primary name column
103
+ no longer in the new version are deleted, with their data, so it needs a full group.`}).argument("<uniquename>","the base solution (not the _Upgrade one)").option("--async","poll the job until it finishes").handler(async n=>(await e()).promote(n))}var U={};h(U,{COLUMN_TYPES:()=>oe,add:()=>Ce});function Re(o){return r(o),o}var oe=["string","memo","int","decimal","money","bool","datetime","choice","lookup"];function Ce(o){let e=p(o,"metadata","tables, columns and choices"),n=()=>import("./metadata-WYVJ7NP7.js");Re(t(e,"list","R","list tables").option("--custom-only","only custom tables").option("--search <text>","logical name or display name contains")).handler(async a=>(await n()).list(a)),t(e,"get","R","a table's definition (compact by default)").argument("<entity>","logical name, e.g. account").option("--attributes","include columns").option("--relationships","include relationships").option("--keys","include alternate keys").option("--raw","the full EntityDefinitions document").handler(async a=>(await n()).get(a)),t(e,"attribute","R","one column's definition, with choice options").argument("<entity>").argument("<attribute>").option("--raw").handler(async a=>(await n()).attribute(a)),t(e,"optionset","R","a global choice and its options").argument("<name>").option("--raw").handler(async a=>(await n()).optionset(a)),Te(e)}function Te(o){let e=p(o,"create","create tables, columns, global choices and alternate keys"),n=()=>import("./metadataCreate-PBA3KH3A.js"),a=i=>i.option("--solution <name>","add it to this unmanaged solution");a(t(e,"table","W","create a table with its primary name column",{description:`create a table with its primary name column
104
104
 
105
105
  <name> is the schema name with the publisher prefix, e.g. new_Project. The primary name column
106
106
  is <prefix>_name unless --primary-name. Creating a table can take a minute.`}).argument("<name>").requiredOption("--display-name <display_name>").option("--plural <text>","plural display name (default: display name + s)").option("--description <description>").addOption(c("--ownership <user|organization>",void 0,["user","organization"])).option("--primary-name <schema name>")).handler(async i=>(await n()).table(i)),a(t(e,"column","W","create a column",{description:`create a column
107
107
 
108
108
  --type string|memo|int|decimal|money|bool|datetime|choice|lookup. A choice column uses a global
109
- choice (--choice) or its own options (--options a,b,c); a lookup needs --target <table>.`}).argument("<table>","table logical name").argument("<name>","schema name with the publisher prefix, e.g. new_Code").addOption(c("--type <type>",void 0,oe).makeOptionMandatory()).requiredOption("--display-name <display_name>").option("--description <description>").option("--required","business required").addOption(new l("--max-length <n>","string (default 100) and memo (default 2000)").argParser(f)).addOption(new l("--precision <n>","decimal and money (default 2)").argParser(f)).option("--date-only","datetime: date only").option("--choice <global choice>","choice: use this global choice").option("--options <a,b,c>","choice: its own options").option("--target <table>","lookup: the table it points to")).handler(async i=>(await n()).column(i)),a(t(e,"choice","W","create a global choice").argument("<name>","name with the publisher prefix, e.g. new_priority").requiredOption("--options <a,b,c>").option("--display-name <display_name>","default: the name").option("--description <description>")).handler(async i=>(await n()).choice(i)),a(t(e,"key","W","create an alternate key (its index builds in the background)").argument("<table>","table logical name").argument("<name>","schema name with the publisher prefix, e.g. new_CodeKey").requiredOption("--columns <a,b>","column logical names").option("--display-name <display_name>","default: the name").option("--wait","wait until the index is Active")).handler(async i=>(await n()).key(i))}var $={};h($,{add:()=>Ae});var Le=["off","exception","all"];function Ae(o){let e=()=>import("./plugins-EUDJ7QIS.js"),n=p(o,"plugin","plugins: assemblies, steps, trace logs, trace setting, run statistics"),a=p(n,"assembly","plugin assemblies"),i=t(a,"list","R","plugin assemblies with their versions").option("--solution <name>[,<name>...]","only assemblies in these solutions").option("--name <pattern>","assembly name; * is a wildcard").option("--hidden","include hidden (system) assemblies");r(i),i.handler(async u=>(await e()).assemblyList(u)),t(a,"get","R","one assembly's version, size and SHA-256; save it or compare it with a DLL",{description:`one assembly's version, size and SHA-256; save it or compare it with a DLL
109
+ choice (--choice) or its own options (--options a,b,c); a lookup needs --target <table>.`}).argument("<table>","table logical name").argument("<name>","schema name with the publisher prefix, e.g. new_Code").addOption(c("--type <type>",void 0,oe).makeOptionMandatory()).requiredOption("--display-name <display_name>").option("--description <description>").option("--required","business required").addOption(new l("--max-length <n>","string (default 100) and memo (default 2000)").argParser(f)).addOption(new l("--precision <n>","decimal and money (default 2)").argParser(f)).option("--date-only","datetime: date only").option("--choice <global choice>","choice: use this global choice").option("--options <a,b,c>","choice: its own options").option("--target <table>","lookup: the table it points to")).handler(async i=>(await n()).column(i)),a(t(e,"choice","W","create a global choice").argument("<name>","name with the publisher prefix, e.g. new_priority").requiredOption("--options <a,b,c>").option("--display-name <display_name>","default: the name").option("--description <description>")).handler(async i=>(await n()).choice(i)),a(t(e,"key","W","create an alternate key (its index builds in the background)").argument("<table>","table logical name").argument("<name>","schema name with the publisher prefix, e.g. new_CodeKey").requiredOption("--columns <a,b>","column logical names").option("--display-name <display_name>","default: the name").option("--wait","wait until the index is Active")).handler(async i=>(await n()).key(i))}var $={};h($,{add:()=>Ae});var Le=["off","exception","all"];function Ae(o){let e=()=>import("./plugins-SBMDFXVA.js"),n=p(o,"plugin","plugins: assemblies, steps, trace logs, trace setting, run statistics"),a=p(n,"assembly","plugin assemblies"),i=t(a,"list","R","plugin assemblies with their versions").option("--solution <name>[,<name>...]","only assemblies in these solutions").option("--name <pattern>","assembly name; * is a wildcard").option("--hidden","include hidden (system) assemblies");r(i),i.handler(async u=>(await e()).assemblyList(u)),t(a,"get","R","one assembly's version, size and SHA-256; save it or compare it with a DLL",{description:`one assembly's version, size and SHA-256; save it or compare it with a DLL
110
110
 
111
111
  The hash is of the registered DLL's bytes, so --compare tells whether a local build is the
112
112
  one registered. An assembly in a plugin package has no content of its own to compare.`}).argument("<assembly>","assembly name or id").option("--save <file.dll>","write the registered DLL to this file").option("--compare <file.dll>","compare the registered DLL with this file").handler(async u=>(await e()).assemblyGet(u));let s=p(n,"step","plugin steps (SDK message processing steps)"),m=t(s,"list","R","steps with their plugin type, assembly, message, table and state").option("--assembly <name>","assembly name").option("--type <pattern>","plugin type name; matched anywhere unless it has a *").option("--message <name>","SDK message, e.g. Create, Update").option("--table <logical name>","primary table, e.g. account").option("--solution <name>[,<name>...]","only steps in these solutions").addOption(c("--state <state>",void 0,["on","off"])).option("--hidden","include hidden (system) steps");r(m),m.handler(async u=>(await e()).stepList(u));for(let u of["enable","disable"]){let K=u==="enable"?"on":"off";t(s,u,"W",`turn plugin steps ${K}: those named, or every step of an assembly`,{description:`turn plugin steps ${K}: those named, or every step of an assembly
113
113
 
114
- Prints one result per step; exits 1 if any failed.`}).argument("[step...]","step id or name").option("--assembly <name>","every (non-hidden) step of this assembly").handler(async de=>(await e())[u==="enable"?"stepEnable":"stepDisable"](de))}let d=p(n,"trace","plugin trace logs"),v=t(d,"list","R","trace logs, newest first, with the error and trace cut to the useful lines").option("--type <pattern>","plugin type name; matched anywhere unless it has a *").option("--message <name>","SDK message, e.g. Create, Update").option("--table <logical name>","primary table, e.g. account").option("--correlation <id>","correlation id (one request and everything it triggered)").addOption(c("--state <state>","only executions that threw an exception",["failed"])).option("--since <when>","30m, 12h, 7d, 2w or a date");r(v),v.handler(async u=>(await e()).traceList(u)),t(d,"get","R","one trace log in full").argument("<id>","plugintracelogid").handler(async u=>(await e()).traceGet(u));let I=p(n,"tracing","the organization's plugin trace setting");t(I,"get","R","show the plugin trace setting").handler(async u=>(await e()).tracingGet(u)),t(I,"set","W","change the plugin trace setting").addArgument(new Y("<level>","off | exception (traces only when a plugin throws) | all").argParser(Q(Le))).handler(async u=>(await e()).tracingSet(u));let J=t(n,"stats","R","run statistics per plugin type: executions, failures, crashes, time").option("--type <pattern>","plugin type name; matched anywhere unless it has a *");r(J),J.handler(async u=>(await e()).stats(u))}var X={};h(X,{add:()=>ze});var je=["succeeded","failed","cancelled"];function G(o){return o.option("--solution <name>[,<name>...]","only processes in these solutions").option("--category <name>[,<name>...]","flow | workflow | business-rule | action | bpf (comma-separated)")}function ze(o){let e=()=>import("./process-G7LCTGKS.js"),n=p(o,"workflow","cloud flows, classic workflows, business rules, actions and business process flows"),a=G(t(n,"list","R","processes, with whether each is on")).addOption(c("--state <state>",void 0,["on","off"])).option("--name <pattern>","process name; * is a wildcard");r(a),a.handler(async m=>(await e()).list(m));let i=G(t(n,"summary","R","per solution: how many processes are on and off, and which are off",{description:`per solution: how many processes are on and off, and which are off
114
+ Prints one result per step; exits 1 if any failed.`}).argument("[step...]","step id or name").option("--assembly <name>","every (non-hidden) step of this assembly").handler(async de=>(await e())[u==="enable"?"stepEnable":"stepDisable"](de))}let d=p(n,"trace","plugin trace logs"),v=t(d,"list","R","trace logs, newest first, with the error and trace cut to the useful lines").option("--type <pattern>","plugin type name; matched anywhere unless it has a *").option("--message <name>","SDK message, e.g. Create, Update").option("--table <logical name>","primary table, e.g. account").option("--correlation <id>","correlation id (one request and everything it triggered)").addOption(c("--state <state>","only executions that threw an exception",["failed"])).option("--since <when>","30m, 12h, 7d, 2w or a date");r(v),v.handler(async u=>(await e()).traceList(u)),t(d,"get","R","one trace log in full").argument("<id>","plugintracelogid").handler(async u=>(await e()).traceGet(u));let I=p(n,"tracing","the organization's plugin trace setting");t(I,"get","R","show the plugin trace setting").handler(async u=>(await e()).tracingGet(u)),t(I,"set","W","change the plugin trace setting").addArgument(new Y("<level>","off | exception (traces only when a plugin throws) | all").argParser(Q(Le))).handler(async u=>(await e()).tracingSet(u));let J=t(n,"stats","R","run statistics per plugin type: executions, failures, crashes, time").option("--type <pattern>","plugin type name; matched anywhere unless it has a *");r(J),J.handler(async u=>(await e()).stats(u))}var X={};h(X,{add:()=>ze});var je=["succeeded","failed","cancelled"];function G(o){return o.option("--solution <name>[,<name>...]","only processes in these solutions").option("--category <name>[,<name>...]","flow | workflow | business-rule | action | bpf (comma-separated)")}function ze(o){let e=()=>import("./process-WS76WV3T.js"),n=p(o,"workflow","cloud flows, classic workflows, business rules, actions and business process flows"),a=G(t(n,"list","R","processes, with whether each is on")).addOption(c("--state <state>",void 0,["on","off"])).option("--name <pattern>","process name; * is a wildcard");r(a),a.handler(async m=>(await e()).list(m));let i=G(t(n,"summary","R","per solution: how many processes are on and off, and which are off",{description:`per solution: how many processes are on and off, and which are off
115
115
 
116
116
  Without --solution: every solution that contains processes (not Default).`}));r(i),i.handler(async m=>(await e()).summary(m));for(let[m,d]of[["enable","on"],["disable","off"]])G(t(n,m,"W",`turn processes ${d}: those named, or every one in the solutions given`,{description:`turn processes ${d}: those named, or every one in the solutions given
117
117
 
@@ -123,7 +123,7 @@ the flowrun table, which Dataverse fills a few minutes after a run and keeps for
123
123
  by default.`}).argument("<flow>","flow id, name or URL").addOption(c("--state <state>",void 0,je)).option("--since <when>","started in the last 30m, 12h, 7d, 2w, or since a date");r(s),s.handler(async m=>(await e()).runs(m)),t(n,"swap-connref","W","point a cloud flow at another connection reference",{description:`point a cloud flow at another connection reference
124
124
 
125
125
  Rewrites the flow definition on the server, replacing the logical name exactly (other names
126
- that start with it are left alone). Both references must be for the same connector.`}).argument("<flow>","flow id, name or URL").requiredOption("--from <connref>","logical name to replace").requiredOption("--to <connref>","logical name to use instead").handler(async m=>(await e()).swap(m))}var F={};h(F,{add:()=>Pe});function Pe(o){let e=()=>import("./records-TN7ZKUJ7.js"),n=t(o,"query","R","query rows with OData options or FetchXML",{description:`OData options are flags; ppdo-cli builds the $-parameters, so shells never see a '$'.
126
+ that start with it are left alone). Both references must be for the same connector.`}).argument("<flow>","flow id, name or URL").requiredOption("--from <connref>","logical name to replace").requiredOption("--to <connref>","logical name to use instead").handler(async m=>(await e()).swap(m))}var F={};h(F,{add:()=>Pe});function Pe(o){let e=()=>import("./records-7IQET422.js"),n=t(o,"query","R","query rows with OData options or FetchXML",{description:`OData options are flags; ppdo-cli builds the $-parameters, so shells never see a '$'.
127
127
  Examples:
128
128
  ppdo-cli dv query accounts --select name,accountnumber --filter "statecode eq 0" --top 10
129
129
  ppdo-cli dv query contacts --filter "lastname eq 'O''Brien'" --formatted
@@ -132,7 +132,7 @@ use name:=123 for a number).`}).argument("<entityset>").argument("<key>").option
132
132
  {"method": "POST", "path": "accounts", "body": {"name": "A"}}
133
133
  {"method": "GET", "path": "accounts?$select=name&$top=1"}
134
134
  Output: one result per request, in order. Exit 1 if any request failed.
135
- --changeset makes consecutive writes atomic (all succeed or none do).`}).requiredOption("--file <file.ndjson|->").option("--changeset","group consecutive writes into atomic changesets").option("--continue-on-error","keep going after a failed request");g(m),m.handler(async d=>(await e()).batch(d))}var H={};h(H,{add:()=>Se});var Ee=["owner","access","aad-group","aad-office"];function Se(o){let e=()=>import("./security-FLEAZ4EA.js"),n=p(o,"team","teams"),a=t(n,"list","R","teams, with the Entra group id for group teams");a.addOption(new l("--type <type>").choices(Ee)),a.option("--name <pattern>","team name; * is a wildcard"),r(a),a.handler(async d=>(await e()).teamList(d)),a=t(n,"get","R","a team, its members and its roles").argument("<team>","team id or name"),r(a),a.handler(async d=>(await e()).teamGet(d)),t(n,"add-role","W","give a team a security role (its business unit's copy)").argument("<team>","team id or name").argument("<role>","role id or name").handler(async d=>(await e()).teamAddRole(d)),t(n,"remove-role","D","take a security role away from a team",{description:`take a security role away from a team
135
+ --changeset makes consecutive writes atomic (all succeed or none do).`}).requiredOption("--file <file.ndjson|->").option("--changeset","group consecutive writes into atomic changesets").option("--continue-on-error","keep going after a failed request");g(m),m.handler(async d=>(await e()).batch(d))}var H={};h(H,{add:()=>Se});var Ee=["owner","access","aad-group","aad-office"];function Se(o){let e=()=>import("./security-RC3EI7CZ.js"),n=p(o,"team","teams"),a=t(n,"list","R","teams, with the Entra group id for group teams");a.addOption(new l("--type <type>").choices(Ee)),a.option("--name <pattern>","team name; * is a wildcard"),r(a),a.handler(async d=>(await e()).teamList(d)),a=t(n,"get","R","a team, its members and its roles").argument("<team>","team id or name"),r(a),a.handler(async d=>(await e()).teamGet(d)),t(n,"add-role","W","give a team a security role (its business unit's copy)").argument("<team>","team id or name").argument("<role>","role id or name").handler(async d=>(await e()).teamAddRole(d)),t(n,"remove-role","D","take a security role away from a team",{description:`take a security role away from a team
136
136
 
137
137
  Unlinking is an HTTP DELETE, so it needs a full group.`}).argument("<team>","team id or name").argument("<role>","role id or name").handler(async d=>(await e()).teamRemoveRole(d));let i=p(o,"role","security roles");a=t(i,"list","R","security roles (the root business unit's copies)"),a.option("--name <pattern>","role name; * is a wildcard"),r(a),a.handler(async d=>(await e()).roleList(d)),a=t(i,"get","R","a role and its privileges",{description:`a role and its privileges
138
138
 
@@ -142,7 +142,7 @@ Append, AppendTo, Assign, Share). Without it the privileges are listed, capped b
142
142
  --table gives the access to one table, verb by verb.`}).argument("<user>","me, a user id, or a sign-in name (UPN)").option("--table <logical name>"),r(a),a.handler(async d=>(await e()).userPrivileges(d));let m=p(o,"access","record access");t(m,"origin","R","why a user or team can (or can't) see a record, and with which rights",{description:`why a user or team can (or can't) see a record, and with which rights
143
143
 
144
144
  origin is Dataverse's own explanation, passed through as it is: it answers even
145
- when there is no access, so read it rather than assuming access.`}).argument("<entityset>").argument("<id>").option("--user <me|id|upn>").option("--team <id|name>").handler(async d=>(await e()).origin(d)),t(m,"shared","R","who a record is shared with, and with which rights").argument("<entityset>").argument("<id>").handler(async d=>(await e()).shared(d))}var ae=["import","uninstall","export","publish","publish-all"];function ie(o){let e=()=>import("./solution-HF57MP27.js"),n=t(o,"list","R","list visible solutions").option("--unmanaged","only unmanaged solutions").option("--managed","only managed solutions").option("--publisher <prefix>","publisher customization prefix");r(n),n.handler(async s=>(await e()).list(s)),t(o,"get","R","one solution's details and version").argument("<uniquename>").handler(async s=>(await e()).get(s));let a=t(o,"components","R","components in a solution").argument("<uniquename>").addOption(new l("--type <componenttype>","e.g. 1 = table, 61 = web resource").argParser(f));r(a),a.handler(async s=>(await e()).components(s)),t(o,"dependencies","R","missing dependencies, or what blocks uninstalling").argument("<uniquename>").option("--for-uninstall","what depends on this solution").handler(async s=>(await e()).dependencies(s)),t(o,"export","R","export a solution to a .zip (async, waits for the file)",{description:`export a solution to a .zip (async, waits for the file)
145
+ when there is no access, so read it rather than assuming access.`}).argument("<entityset>").argument("<id>").option("--user <me|id|upn>").option("--team <id|name>").handler(async d=>(await e()).origin(d)),t(m,"shared","R","who a record is shared with, and with which rights").argument("<entityset>").argument("<id>").handler(async d=>(await e()).shared(d))}var ae=["import","uninstall","export","publish","publish-all"];function ie(o){let e=()=>import("./solution-3WUUDYF3.js"),n=t(o,"list","R","list visible solutions").option("--unmanaged","only unmanaged solutions").option("--managed","only managed solutions").option("--publisher <prefix>","publisher customization prefix");r(n),n.handler(async s=>(await e()).list(s)),t(o,"get","R","one solution's details and version").argument("<uniquename>").handler(async s=>(await e()).get(s));let a=t(o,"components","R","components in a solution").argument("<uniquename>").addOption(new l("--type <componenttype>","e.g. 1 = table, 61 = web resource").argParser(f));r(a),a.handler(async s=>(await e()).components(s)),t(o,"dependencies","R","missing dependencies, or what blocks uninstalling").argument("<uniquename>").option("--for-uninstall","what depends on this solution").handler(async s=>(await e()).dependencies(s)),t(o,"export","R","export a solution to a .zip (async, waits for the file)",{description:`export a solution to a .zip (async, waits for the file)
146
146
 
147
147
  --both exports it unmanaged to <file.zip> and managed to <file>_managed.zip. --unpack unpacks
148
148
  it into a source folder in pac's layout (as dv solution unpack does; no pac needed); without
@@ -165,11 +165,11 @@ Examples:
165
165
  ppdo-cli dv api GET WhoAmI
166
166
  ppdo-cli dv api GET accounts --param '$select=name' --param '$top=5'
167
167
  ppdo-cli dv api GET accounts --paginate --limit 500 -o ndjson
168
- ppdo-cli dv api PATCH 'accounts(<id>)' --body @patch.json`).addArgument(V(B)).argument("<path>").option("--body <@file|-|json>","request body: @file, - for stdin, or inline JSON").option("--header <k:v>","extra header (repeatable)",y).option("--param <k=v>","query parameter (repeatable)",y).option("--annotations",'Prefer: odata.include-annotations="*"').option("--paginate","follow @odata.nextLink; items are the output").addOption(new l("--limit <n>","stop after n items (with --paginate)").argParser(f)).option("--save <file>","write the response body to a file").handler(async a=>(await import("./api-YKKPVMTX.js")).api(a)),se(e);let n=p(e,"solution","solutions: list, inspect, create, change, patch, export, import, upgrade, publish, and source folders (unpack, pack, clone, sync)");re(n),t(n,"unpack","L","unpack a solution .zip into a source folder (no pac needed)").addHelpText("after",`
168
+ ppdo-cli dv api PATCH 'accounts(<id>)' --body @patch.json`).addArgument(V(B)).argument("<path>").option("--body <@file|-|json>","request body: @file, - for stdin, or inline JSON").option("--header <k:v>","extra header (repeatable)",y).option("--param <k=v>","query parameter (repeatable)",y).option("--annotations",'Prefer: odata.include-annotations="*"').option("--paginate","follow @odata.nextLink; items are the output").addOption(new l("--limit <n>","stop after n items (with --paginate)").argParser(f)).option("--save <file>","write the response body to a file").handler(async a=>(await import("./api-KN24TLH6.js")).api(a)),se(e);let n=p(e,"solution","solutions: list, inspect, create, change, patch, export, import, upgrade, publish, and source folders (unpack, pack, clone, sync)");re(n),t(n,"unpack","L","unpack a solution .zip into a source folder (no pac needed)").addHelpText("after",`
169
169
  The layout and the bytes match \`pac solution unpack\`. Only files whose content changed are
170
170
  written. Files of components no longer in the solution are listed as stale; --allow-delete
171
171
  removes them. --package-type both unpacks <file.zip> and <file>_managed.zip into one folder;
172
- by default the type is read from the zip. --check writes nothing and reports the difference.`).argument("<file.zip>").requiredOption("--folder <folder>","the source folder to write").addOption(new l("--package-type <type>","default: what the zip is").choices(O)).option("--managed-zip <file.zip>","with both: the managed zip (default <file>_managed.zip)").option("--allow-delete","delete files no longer in the solution").option("--check","write nothing; exit 6 if the folder differs").option("--map <map.xml>","a mapping file: files it maps are not written (the build owns them)").handler(async a=>(await import("./solutionfiles-P223QW2J.js")).unpack(a)),De(n),pe(e)}function De(o){let e="a mapping file: files it maps are not written (the build owns them)";t(o,"pack","L","pack a source folder into a solution .zip (no pac needed)").addHelpText("after",`
172
+ by default the type is read from the zip. --check writes nothing and reports the difference.`).argument("<file.zip>").requiredOption("--folder <folder>","the source folder to write").addOption(new l("--package-type <type>","default: what the zip is").choices(O)).option("--managed-zip <file.zip>","with both: the managed zip (default <file>_managed.zip)").option("--allow-delete","delete files no longer in the solution").option("--check","write nothing; exit 6 if the folder differs").option("--map <map.xml>","a mapping file: files it maps are not written (the build owns them)").handler(async a=>(await import("./solutionfiles-VWZHFZZ6.js")).unpack(a)),De(n),pe(e)}function De(o){let e="a mapping file: files it maps are not written (the build owns them)";t(o,"pack","L","pack a source folder into a solution .zip (no pac needed)").addHelpText("after",`
173
173
  The zip holds what \`pac solution pack\` puts in it, with fixed timestamps, so packing the same
174
174
  folder twice gives the same bytes. A folder unpacked as both packs as unmanaged by default;
175
175
  --package-type both writes <file.zip> and <file>_managed.zip.
@@ -181,12 +181,12 @@ managed for --configuration Release), and its SolutionPackageMapFilePath is the
181
181
 
182
182
  --map takes files from where a SolutionPackager mapping file points. --remap-plugins gives the
183
183
  plug-in assembly, its types, steps and workflow references the name and version of the .dll
184
- being packed (pac's --disablePluginRemap, which pac wires backwards).`).argument("<folder>").requiredOption("--save <file.zip>","the zip to write").addOption(new l("--package-type <type>","default: the folder's type (unmanaged for both)").choices(O)).option("--map <map.xml>","a mapping file: pack these files from where it points").option("--remap-plugins","name plug-in records after the version and key of the .dll packed").option("--configuration <name>","with a .cdsproj: the build configuration (default Debug)","Debug").option("--no-build","with a .cdsproj: don't build the references, use their last output").handler(async n=>(await import("./solutionfiles-P223QW2J.js")).pack(n)),t(o,"clone","R","export a solution into a new source project (like pac solution clone)").addHelpText("after",`
184
+ being packed (pac's --disablePluginRemap, which pac wires backwards).`).argument("<folder>").requiredOption("--save <file.zip>","the zip to write").addOption(new l("--package-type <type>","default: the folder's type (unmanaged for both)").choices(O)).option("--map <map.xml>","a mapping file: pack these files from where it points").option("--remap-plugins","name plug-in records after the version and key of the .dll packed").option("--configuration <name>","with a .cdsproj: the build configuration (default Debug)","Debug").option("--no-build","with a .cdsproj: don't build the references, use their last output").handler(async n=>(await import("./solutionfiles-VWZHFZZ6.js")).pack(n)),t(o,"clone","R","export a solution into a new source project (like pac solution clone)").addHelpText("after",`
185
185
  Writes <folder>/<uniquename>.cdsproj, .gitignore and the unpacked solution in
186
186
  <folder>/src. --no-project writes only the unpacked solution, straight into <folder>.
187
- The default package type is both: the unmanaged and managed exports run together.`).argument("<uniquename>").option("--folder <folder>","default ./<uniquename>; must be empty or new").addOption(new l("--package-type <type>","default both").choices(O).default("both")).option("--no-project","no .cdsproj; unpack into the folder itself").option("--async","export with async jobs (for very large solutions)").addOption(new l("--max-wait <minutes>","how long to wait for an async export (default 60)").argParser(q).default(60)).option("--map <map.xml>",e).handler(async n=>(await import("./solutionfiles-P223QW2J.js")).clone(n)),t(o,"sync","R","re-export a solution into its source folder (like pac solution sync)").addHelpText("after",`
187
+ The default package type is both: the unmanaged and managed exports run together.`).argument("<uniquename>").option("--folder <folder>","default ./<uniquename>; must be empty or new").addOption(new l("--package-type <type>","default both").choices(O).default("both")).option("--no-project","no .cdsproj; unpack into the folder itself").option("--async","export with async jobs (for very large solutions)").addOption(new l("--max-wait <minutes>","how long to wait for an async export (default 60)").argParser(q).default(60)).option("--map <map.xml>",e).handler(async n=>(await import("./solutionfiles-VWZHFZZ6.js")).clone(n)),t(o,"sync","R","re-export a solution into its source folder (like pac solution sync)").addHelpText("after",`
188
188
  <folder> (default .) is an unpacked solution or a .cdsproj project; the solution is the
189
189
  one in its Other/Solution.xml. The package type defaults to both, as in pac. Only
190
190
  changed files are written; files of removed components are deleted (--keep-stale keeps
191
191
  them). Components built by the project's PCF and plug-in references are left out.
192
- --check exports and compares but writes nothing: exit 6 if the folder is out of date.`).argument("[folder]","default .",".").addOption(new l("--package-type <type>","default both").choices(O).default("both")).option("--keep-stale","don't delete files of removed components").option("--check","write nothing; exit 6 if the folder differs").option("--async","export with async jobs (for very large solutions)").addOption(new l("--max-wait <minutes>","how long to wait for an async export (default 60)").argParser(q).default(60)).option("--map <map.xml>",e).handler(async n=>(await import("./solutionfiles-P223QW2J.js")).sync(n))}export{zt as register};
192
+ --check exports and compares but writes nothing: exit 6 if the folder is out of date.`).argument("[folder]","default .",".").addOption(new l("--package-type <type>","default both").choices(O).default("both")).option("--keep-stale","don't delete files of removed components").option("--check","write nothing; exit 6 if the folder differs").option("--async","export with async jobs (for very large solutions)").addOption(new l("--max-wait <minutes>","how long to wait for an async export (default 60)").argParser(q).default(60)).option("--map <map.xml>",e).handler(async n=>(await import("./solutionfiles-VWZHFZZ6.js")).sync(n))}export{zt as register};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{e as i,o as m,r as n}from"./chunk-BALEFXOL.js";import{f as s,i as r}from"./chunk-OP6EXLWQ.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function p(o){return o.option("--dataverse <url>","Dataverse environment URL").option("--devops-org <org>","Azure DevOps organization").option("--devops-project <project>","Azure DevOps project")}function c(o){let a=m(o,"env","manage environments (a Dataverse URL or a DevOps project, in a group)"),t=()=>import("./run-HBQCSGYY.js");p(n(a,"add","L","add an environment to a group").argument("<name>").requiredOption("--in <group>","the group it belongs to")).handler(async e=>(await t()).add(e)),p(n(a,"update","L","change an environment's URL or DevOps project").argument("<name>")).handler(async e=>(await t()).update(e)),n(a,"rename","L","rename an environment",{description:`rename an environment
2
+ import{e as i,o as m,r as n}from"./chunk-BALEFXOL.js";import{f as s,i as r}from"./chunk-STWQDANK.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function p(o){return o.option("--dataverse <url>","Dataverse environment URL").option("--devops-org <org>","Azure DevOps organization").option("--devops-project <project>","Azure DevOps project")}function c(o){let a=m(o,"env","manage environments (a Dataverse URL or a DevOps project, in a group)"),t=()=>import("./run-KP2SNX2A.js");p(n(a,"add","L","add an environment to a group").argument("<name>").requiredOption("--in <group>","the group it belongs to")).handler(async e=>(await t()).add(e)),p(n(a,"update","L","change an environment's URL or DevOps project").argument("<name>")).handler(async e=>(await t()).update(e)),n(a,"rename","L","rename an environment",{description:`rename an environment
3
3
 
4
4
  Keeps its URL or project, group and default. A ${r} pin that names it isn't changed:
5
5
  ppdo-cli warns when the pin above the current folder still names it.`}).argument("<name>").argument("<new-name>").handler(async e=>(await t()).rename(e)),n(a,"move","L","move an environment to another group").argument("<name>").requiredOption("--to <group>").handler(async e=>(await t()).move(e)),n(a,"list","L","list environments with their group, mode and account").addOption(new i("--service <service>").choices(Object.keys(s))).handler(async e=>(await t()).list(e)),n(a,"show","L","show one environment").argument("<name>").handler(async e=>(await t()).show(e)),n(a,"use","L","make an environment the default for its service").argument("<name>").handler(async e=>(await t()).use(e)),n(a,"current","L","print the environment each service resolves to, and why").handler(async e=>(await t()).current(e)),n(a,"pin","L",`write ${r} at the git root so every agent in the repo uses these environments`).argument("<name...>","one Dataverse and/or one DevOps environment").argKey("name","names").option("--path <repo>","repo folder (default: git root above the current folder)").handler(async e=>(await t()).pin(e)),n(a,"unpin","L",`remove ${r}`).option("--path <repo>").handler(async e=>(await t()).unpin(e)),n(a,"remove","L","remove an environment").argument("<name>").handler(async e=>(await t()).remove(e))}export{c as register};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{C as w,D as u,E as c,I as L,P as R,e as b,f as N,h as G,i as M,m as A,o as n,p as f,q as p,r as y,w as I}from"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{b as S}from"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import{d as q}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var k=new Map([[0,"number"],[1,"string"],[2,"boolean"]]),x=new Map([[0,"app and organization"],[1,"organization"],[2,"app"]]),F="uniquename,displayname,description,datatype,defaultvalue,overridablelevel,settingdefinitionid";function v(e,a){return typeof a=="number"&&e.has(a)?e.get(a):a===void 0?null:a}async function X(e){let a=await w(e),i=await u(e,a,"GET","RetrieveCurrentOrganization(AccessType=Microsoft.Dynamics.CRM.EndpointAccessType'Default')"),t=f(c(i).Detail),o=f(t.Endpoints),d=p(o.Keys),r=p(o.Values),l={};for(let s=0;s<Math.min(d.length,r.length);s++)l[String(d[s])]=r[s];await e.emit(y({version:n(t,"OrganizationVersion"),friendly_name:n(t,"FriendlyName"),url_name:n(t,"UrlName"),unique_name:n(t,"UniqueName"),type:n(t,"OrganizationType"),state:n(t,"State"),geo:n(t,"Geo"),organization_id:n(t,"OrganizationId"),environment_id:n(t,"EnvironmentId"),tenant_id:n(t,"TenantId"),endpoints:A(l)?l:null}))}var j=/^\s*[+-]?\d+(_\d+)*\s*$/,K=/^\s*[+-]?(\d+(_\d+)*(\.(\d+(_\d+)*)?)?|\.\d+(_\d+)*)([eE][+-]?\d+(_\d+)*)?\s*$/;function m(e,a){if(e==null)return null;if(a===2){let i=N(e).toLowerCase();return i==="true"?!0:i==="false"?!1:e}return a===0?j.test(e)?parseInt(e.replace(/_/g,""),10):K.test(e)?parseFloat(e.replace(/_/g,"")):e:e}function Y(e){return y({name:n(e,"uniquename"),display_name:n(e,"displayname"),type:v(k,n(e,"datatype")),default:m(n(e,"defaultvalue"),n(e,"datatype")),overridable:v(x,n(e,"overridablelevel"))})}async function Z(e){let a=e.args,i=await w(e);S(e,i,"GET","settingdefinitions",null);let t=[["$select",F],["$orderby","uniquename"]],o=R(a.name);o&&t.push(["$filter",M("uniquename",o)]);let[d]=await L(e,i,"settingdefinitions",t,null,I(a),"settings");await e.emit(d.map(Y))}async function ee(e){let a=e.args,i=String(a.name),t=R(a.app),o=await w(e),d=p(c(await u(e,o,"GET","settingdefinitions",{params:[["$select",F],["$filter",`uniquename eq ${b(i)}`]]})).value);if(!d.length)throw new q(`no setting named '${i}'`,{service:"dataverse",hint:"run: ppdo-cli dv setting list --name '*<part of the name>*'"});let r=d[0],l=r.uniquename,s=n(r,"datatype"),V=r.settingdefinitionid,_=null;if(t){let g=p(c(await u(e,o,"GET","appmodules",{params:[["$select","appmoduleid"],["$filter",`uniquename eq ${b(t)}`]]})).value);if(!g.length)throw new q(`no app named '${t}'`,{service:"dataverse",hint:"run: ppdo-cli dv query appmodules --select uniquename,name"});_=g[0].appmoduleid}let $=[["SettingName",l]];t&&$.push(["AppUniqueName",t]);let[C,D]=G("RetrieveSetting",$,new Set(["SettingName","AppUniqueName"])),O=f(c(await u(e,o,"GET",C,{params:D})).SettingDetail),h=async(g,U="")=>{let z=p(c(await u(e,o,"GET",g,{params:[["$select","value"],["$filter",`_settingdefinitionid_value eq ${V}${U}`]]})).value);return z.length?n(z[0],"value"):null},E=await h("organizationsettings"),T=_?await h("appsettings",` and _parentappmoduleid_value eq ${_}`):null,P=T!==null?"app":E!==null?"organization":"default";await e.emit(y({name:l,value:m(n(O,"Value"),s),source:P,type:v(k,s),default:m(n(r,"defaultvalue"),s),organization_value:m(E,s),app_value:m(T,s),app:t,overridable:v(x,n(r,"overridablelevel")),display_name:n(r,"displayname")}))}export{x as LEVELS,k as TYPES,ee as get,Z as list,X as orgGet,m as typed};
2
+ import{C as w,D as u,E as c,I as L,P as R,e as b,f as N,h as G,i as M,m as A,o as n,p as f,q as p,r as y,w as I}from"./chunk-TXVNEV3M.js";import"./chunk-UCTMKA2J.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{b as S}from"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import{d as q}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var k=new Map([[0,"number"],[1,"string"],[2,"boolean"]]),x=new Map([[0,"app and organization"],[1,"organization"],[2,"app"]]),F="uniquename,displayname,description,datatype,defaultvalue,overridablelevel,settingdefinitionid";function v(e,a){return typeof a=="number"&&e.has(a)?e.get(a):a===void 0?null:a}async function X(e){let a=await w(e),i=await u(e,a,"GET","RetrieveCurrentOrganization(AccessType=Microsoft.Dynamics.CRM.EndpointAccessType'Default')"),t=f(c(i).Detail),o=f(t.Endpoints),d=p(o.Keys),r=p(o.Values),l={};for(let s=0;s<Math.min(d.length,r.length);s++)l[String(d[s])]=r[s];await e.emit(y({version:n(t,"OrganizationVersion"),friendly_name:n(t,"FriendlyName"),url_name:n(t,"UrlName"),unique_name:n(t,"UniqueName"),type:n(t,"OrganizationType"),state:n(t,"State"),geo:n(t,"Geo"),organization_id:n(t,"OrganizationId"),environment_id:n(t,"EnvironmentId"),tenant_id:n(t,"TenantId"),endpoints:A(l)?l:null}))}var j=/^\s*[+-]?\d+(_\d+)*\s*$/,K=/^\s*[+-]?(\d+(_\d+)*(\.(\d+(_\d+)*)?)?|\.\d+(_\d+)*)([eE][+-]?\d+(_\d+)*)?\s*$/;function m(e,a){if(e==null)return null;if(a===2){let i=N(e).toLowerCase();return i==="true"?!0:i==="false"?!1:e}return a===0?j.test(e)?parseInt(e.replace(/_/g,""),10):K.test(e)?parseFloat(e.replace(/_/g,"")):e:e}function Y(e){return y({name:n(e,"uniquename"),display_name:n(e,"displayname"),type:v(k,n(e,"datatype")),default:m(n(e,"defaultvalue"),n(e,"datatype")),overridable:v(x,n(e,"overridablelevel"))})}async function Z(e){let a=e.args,i=await w(e);S(e,i,"GET","settingdefinitions",null);let t=[["$select",F],["$orderby","uniquename"]],o=R(a.name);o&&t.push(["$filter",M("uniquename",o)]);let[d]=await L(e,i,"settingdefinitions",t,null,I(a),"settings");await e.emit(d.map(Y))}async function ee(e){let a=e.args,i=String(a.name),t=R(a.app),o=await w(e),d=p(c(await u(e,o,"GET","settingdefinitions",{params:[["$select",F],["$filter",`uniquename eq ${b(i)}`]]})).value);if(!d.length)throw new q(`no setting named '${i}'`,{service:"dataverse",hint:"run: ppdo-cli dv setting list --name '*<part of the name>*'"});let r=d[0],l=r.uniquename,s=n(r,"datatype"),V=r.settingdefinitionid,_=null;if(t){let g=p(c(await u(e,o,"GET","appmodules",{params:[["$select","appmoduleid"],["$filter",`uniquename eq ${b(t)}`]]})).value);if(!g.length)throw new q(`no app named '${t}'`,{service:"dataverse",hint:"run: ppdo-cli dv query appmodules --select uniquename,name"});_=g[0].appmoduleid}let $=[["SettingName",l]];t&&$.push(["AppUniqueName",t]);let[C,D]=G("RetrieveSetting",$,new Set(["SettingName","AppUniqueName"])),O=f(c(await u(e,o,"GET",C,{params:D})).SettingDetail),h=async(g,U="")=>{let z=p(c(await u(e,o,"GET",g,{params:[["$select","value"],["$filter",`_settingdefinitionid_value eq ${V}${U}`]]})).value);return z.length?n(z[0],"value"):null},E=await h("organizationsettings"),T=_?await h("appsettings",` and _parentappmoduleid_value eq ${_}`):null,P=T!==null?"app":E!==null?"organization":"default";await e.emit(y({name:l,value:m(n(O,"Value"),s),source:P,type:v(k,s),default:m(n(r,"defaultvalue"),s),organization_value:m(E,s),app_value:m(T,s),app:t,overridable:v(x,n(r,"overridablelevel")),display_name:n(r,"displayname")}))}export{x as LEVELS,k as TYPES,ee as get,Z as list,X as orgGet,m as typed};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{A as w,B as $,C as h,D as C,F as R,I as z,J as j,d,e as p,f as r,g as l,h as g,i as x,j as P,k as m,l as L,m as O,s as A,u as y,z as f}from"./chunk-5KZDCOFA.js";import{d as B,e as T}from"./chunk-BWZ6HZXM.js";import"./chunk-MTF66YXU.js";import"./chunk-BALEFXOL.js";import"./chunk-4S5ETLH4.js";import"./chunk-J4R6QXW7.js";import{b as J}from"./chunk-5SBBTR3Y.js";import"./chunk-UYDBLVAM.js";import"./chunk-RHQP7X6H.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import{a as S,d as _,f as E}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var b="7.1-preview.1";function k(n){return P({id:r(n,"id"),name:r(n,"name"),description:p(n.description??null,null),created:r(n,"createdOn"),created_by:j(n.createdBy),modified:r(n,"lastModifiedOn")})}async function N(n,t,e){let o=`${f(t)}/_apis/distributedtask/environments`,s;if(L(e)){let i=await $(n,t,`${o}/${e}`);s=d(i)?i:null}else s=R(await $(n,t,o,[["name",e]])).find(i=>(x(p(i.name??null,""))??"").toLowerCase()===e.toLowerCase())??null;if(!s)throw new _(`no pipeline environment '${e}'`,{service:"devops",hint:"run: ppdo-cli ado environment list"});return s}async function V(n){let t=n.args,e=await y(n),o=`${f(e)}/_apis/distributedtask/environments`;J(n,e,"GET",o,null);let s=typeof t.name=="string"&&t.name?t.name:null,i=[];for await(let c of e.paginate(o,{params:s?[["name",s]]:null,nextLink:B,items:T}))i.push(k(l(c)));await n.emit(A(O(i,c=>(x(p(c.name??null,""))??"").toLowerCase()),t,"environments"))}async function W(n){let t=n.args,e=await y(n),o={name:t.name,description:p(t.description??null,"")},s;try{s=h(await w(n,e,"POST",`${f(e)}/_apis/distributedtask/environments`,{body:C(o)}))}catch(i){throw i instanceof S&&i.exitCode!==0&&(i.message??"").toLowerCase().includes("already exists")?new E(`a pipeline environment named '${String(t.name)}' already exists`,{service:"devops"}):i}await n.emit(k(s))}async function I(n,t,e){let o=l(e.settings),s=r(l(e.type),"name"),i={id:r(e,"id"),type:s,timeout_minutes:r(e,"timeout")};if(s==="Approval"){let c=g(o.approvers),u=await M(n,t,c.filter(a=>!j(a)&&d(a.id)).map(a=>m(a.id)));i.approvers=c.map(a=>p(j(a),u.get(m(r(a,"id")))??null,r(a,"id"))),i.minimum_approvers=r(o,"minRequiredApprovers"),i.instructions=p(o.instructions??null,null)}else s==="ExclusiveLock"?i.exclusive=!0:(i.name=p(o.displayName??null,r(l(o.definitionRef),"name")),i.inputs=p(o.inputs??null,null));return P(i,[[]])}async function M(n,t,e){let o=new Map;if(!e.length)return o;let s;try{s=await z(n,t,[["identityIds",e.join(",")]])}catch{return o}for(let i of s){let c=r(l(r(l(i.properties),"Account")),"$value");o.set(m(r(i,"id")),p(c,i.providerDisplayName??null))}return o}async function K(n){let t=await y(n),e=await N(n,t,String(n.args.environment)),o=f(t),s=R((await w(n,t,"GET",`${o}/_apis/pipelines/checks/configurations`,{params:[["resourceType","environment"],["resourceId",m(e.id)],["$expand","settings"],["api-version",b]]})).json()),i=h(await w(n,t,"GET",`${o}/_apis/pipelines/pipelinePermissions/environment/${m(e.id)}`,{params:[["api-version",b]]})),c=r(l(i.allPipelines),"authorized"),u=[];for(let a of s)u.push(await I(n,t,a));await n.emit({...k(e),checks:u,all_pipelines:d(c),pipelines:g(i.pipelines).filter(a=>d(a.authorized)).map(a=>r(a,"id"))})}async function Q(n){let t=n.args,e=await y(n),{resolvePipeline:o}=await import("./pipelines-O3OYNCHT.js"),s=f(e);J(n,e,"PATCH","_apis/pipelines/pipelinePermissions",Buffer.from("{}"));let[i,c]=await e.lookups(async()=>{let v=await N(n,e,String(t.environment)),G=await o(n,e,String(t.pipeline));return[v,G]}),u={pipelines:[{id:c.id,authorized:!0}]},a=h(await w(n,e,"PATCH",`${s}/_apis/pipelines/pipelinePermissions/environment/${m(i.id)}`,{params:[["api-version",b]],body:C(u)}));await n.emit({environment:i.name??null,pipeline:r(c,"name"),permitted:!0,pipelines:g(a.pipelines).filter(v=>d(v.authorized)).map(v=>r(v,"id"))})}export{b as PREVIEW,K as checks,W as create,N as findEnvironment,V as list,Q as permit};
2
+ import{A as w,B as $,C as h,D as C,F as R,I as z,J as j,d,e as p,f as r,g as l,h as g,i as x,j as P,k as m,l as L,m as O,s as A,u as y,z as f}from"./chunk-MGZDEW3X.js";import"./chunk-BALEFXOL.js";import{d as B,e as T}from"./chunk-B4FPKDMH.js";import"./chunk-MTF66YXU.js";import"./chunk-4KP27OCL.js";import"./chunk-J4R6QXW7.js";import{b as J}from"./chunk-5SBBTR3Y.js";import"./chunk-WMDKJRDC.js";import"./chunk-H4OY4EFC.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import{a as S,d as _,f as E}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var b="7.1-preview.1";function k(n){return P({id:r(n,"id"),name:r(n,"name"),description:p(n.description??null,null),created:r(n,"createdOn"),created_by:j(n.createdBy),modified:r(n,"lastModifiedOn")})}async function N(n,t,e){let o=`${f(t)}/_apis/distributedtask/environments`,s;if(L(e)){let i=await $(n,t,`${o}/${e}`);s=d(i)?i:null}else s=R(await $(n,t,o,[["name",e]])).find(i=>(x(p(i.name??null,""))??"").toLowerCase()===e.toLowerCase())??null;if(!s)throw new _(`no pipeline environment '${e}'`,{service:"devops",hint:"run: ppdo-cli ado environment list"});return s}async function V(n){let t=n.args,e=await y(n),o=`${f(e)}/_apis/distributedtask/environments`;J(n,e,"GET",o,null);let s=typeof t.name=="string"&&t.name?t.name:null,i=[];for await(let c of e.paginate(o,{params:s?[["name",s]]:null,nextLink:B,items:T}))i.push(k(l(c)));await n.emit(A(O(i,c=>(x(p(c.name??null,""))??"").toLowerCase()),t,"environments"))}async function W(n){let t=n.args,e=await y(n),o={name:t.name,description:p(t.description??null,"")},s;try{s=h(await w(n,e,"POST",`${f(e)}/_apis/distributedtask/environments`,{body:C(o)}))}catch(i){throw i instanceof S&&i.exitCode!==0&&(i.message??"").toLowerCase().includes("already exists")?new E(`a pipeline environment named '${String(t.name)}' already exists`,{service:"devops"}):i}await n.emit(k(s))}async function I(n,t,e){let o=l(e.settings),s=r(l(e.type),"name"),i={id:r(e,"id"),type:s,timeout_minutes:r(e,"timeout")};if(s==="Approval"){let c=g(o.approvers),u=await M(n,t,c.filter(a=>!j(a)&&d(a.id)).map(a=>m(a.id)));i.approvers=c.map(a=>p(j(a),u.get(m(r(a,"id")))??null,r(a,"id"))),i.minimum_approvers=r(o,"minRequiredApprovers"),i.instructions=p(o.instructions??null,null)}else s==="ExclusiveLock"?i.exclusive=!0:(i.name=p(o.displayName??null,r(l(o.definitionRef),"name")),i.inputs=p(o.inputs??null,null));return P(i,[[]])}async function M(n,t,e){let o=new Map;if(!e.length)return o;let s;try{s=await z(n,t,[["identityIds",e.join(",")]])}catch{return o}for(let i of s){let c=r(l(r(l(i.properties),"Account")),"$value");o.set(m(r(i,"id")),p(c,i.providerDisplayName??null))}return o}async function K(n){let t=await y(n),e=await N(n,t,String(n.args.environment)),o=f(t),s=R((await w(n,t,"GET",`${o}/_apis/pipelines/checks/configurations`,{params:[["resourceType","environment"],["resourceId",m(e.id)],["$expand","settings"],["api-version",b]]})).json()),i=h(await w(n,t,"GET",`${o}/_apis/pipelines/pipelinePermissions/environment/${m(e.id)}`,{params:[["api-version",b]]})),c=r(l(i.allPipelines),"authorized"),u=[];for(let a of s)u.push(await I(n,t,a));await n.emit({...k(e),checks:u,all_pipelines:d(c),pipelines:g(i.pipelines).filter(a=>d(a.authorized)).map(a=>r(a,"id"))})}async function Q(n){let t=n.args,e=await y(n),{resolvePipeline:o}=await import("./pipelines-62CVDRXV.js"),s=f(e);J(n,e,"PATCH","_apis/pipelines/pipelinePermissions",Buffer.from("{}"));let[i,c]=await e.lookups(async()=>{let v=await N(n,e,String(t.environment)),G=await o(n,e,String(t.pipeline));return[v,G]}),u={pipelines:[{id:c.id,authorized:!0}]},a=h(await w(n,e,"PATCH",`${s}/_apis/pipelines/pipelinePermissions/environment/${m(i.id)}`,{params:[["api-version",b]],body:C(u)}));await n.emit({environment:i.name??null,pipeline:r(c,"name"),permitted:!0,pipelines:g(a.pipelines).filter(v=>d(v.authorized)).map(v=>r(v,"id"))})}export{b as PREVIEW,K as checks,W as create,N as findEnvironment,V as list,Q as permit};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{d as B,f as C}from"./chunk-JGLUQBCK.js";import"./chunk-QE4DELWW.js";import"./chunk-ZUXLC5VX.js";import{C as m,D as u,E as j,F as p,J as _,P as b,b as R,d as E,e as P,f as S,i as T,o,q as d,w as O}from"./chunk-UKKSN4F7.js";import{a as x}from"./chunk-UCTMKA2J.js";import{y as $}from"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{b as f}from"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import{b as l,d as h}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var k=380,y="environmentvariabledefinition_environmentvariablevalue",A="schemaname,displayname,type,defaultvalue,ismanaged,description,modifiedon",L=`${y}($select=value,modifiedon)`,I=new Map([[1e8,"string"],[100000001,"number"],[100000002,"boolean"],[100000003,"json"],[100000004,"data-source"],[100000005,"secret"]]),N={yes:"yes",true:"yes",no:"no",false:"no"};function g(e,i=!1){let n=d(o(e,y)),t=n.length?n[0]:null,a={name:o(e,"schemaname"),display_name:o(e,"displayname"),type:I.get(o(e,"type"))??o(e,"type"),value:t?o(t,"value"):o(e,"defaultvalue"),default:o(e,"defaultvalue"),current:t?o(t,"value"):null,managed:o(e,"ismanaged"),id:o(e,"environmentvariabledefinitionid")};if(i){Object.assign(a,{description:o(e,"description"),modified:o(e,"modifiedon"),value_id:t?o(t,"environmentvariablevalueid"):null,value_modified:t?o(t,"modifiedon"):null});let r={};for(let[s,c]of Object.entries(a))(c!==null||s==="current")&&(r[s]=c);a=r}return a}async function w(e,i,n){let t=R(n),a=t?"environmentvariabledefinitionid":"schemaname",r=t?E(n):P(n),s=await u(e,i,"GET","environmentvariabledefinitions",{params:[["$select",A],["$expand",L],["$filter",`${a} eq ${r}`]]}),c=d(j(s).value);if(!c.length)throw new h(`no environment variable '${n}'`,{service:"dataverse",hint:"run: ppdo-cli dv envvar list --name '*<part of the name>*'"});return c[0]}async function X(e){let i=e.args,n=await m(e);f(e,n,"GET","environmentvariabledefinitions",null);let t=b(i.solution),a=t?await C(e,n,B(t),k):null,r=[["$select",A],["$expand",L],["$orderby","schemaname"]],s=b(i.name);s&&r.push(["$filter",T("schemaname",s)]);let c=await _(e,n,"environmentvariabledefinitions","environmentvariabledefinitionid",a,r,null,O(i),"environment variables",v=>String(o(v,"schemaname")||"").toLowerCase());await e.emit(c.map(v=>g(v)))}async function z(e){let i=await m(e);await e.emit(g(await w(e,i,String(e.args.name)),!0))}var M=/^[ \t\n\r\x0b\x0c]*[+-]?(?:(?:\d(?:_?\d)*(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|inf(?:inity)?|nan)[ \t\n\r\x0b\x0c]*$/i;function q(e,i){if(e==="boolean"){let n=S(i).toLowerCase();if(!(n in N))throw new l(`'${i}' is not a boolean`,{hint:"use yes or no"});return N[n]}if(e==="number"&&!M.test(i))throw new l(`'${i}' is not a number`);if(e==="json")try{x(i)}catch(n){throw new l(`the value is not valid JSON: ${n.message}`)}return i}async function K(e){let i=e.args,n=await m(e);f(e,n,"POST","environmentvariablevalues",Buffer.from("{}"));let t=await n.lookups(()=>w(e,n,String(i.name))),a=$(String(i.value)),r=q(I.get(o(t,"type"))??"",a.toString("utf8")),s=d(o(t,y))[0]??null;if(s)await u(e,n,"PATCH",`environmentvariablevalues(${s.environmentvariablevalueid})`,{body:p({value:r}),headers:{"If-Match":"*"}});else{let c=`/environmentvariabledefinitions(${t.environmentvariabledefinitionid})`;await u(e,n,"POST","environmentvariablevalues",{body:p({value:r,"EnvironmentVariableDefinitionId@odata.bind":c})})}await e.emit(g(await w(e,n,t.environmentvariabledefinitionid),!0))}export{k as COMPONENT_TYPE,y as NAV,I as TYPES,q as checkValue,w as find,z as get,X as list,K as set,g as shape};
2
+ import{d as B,f as C}from"./chunk-OXZG44O5.js";import"./chunk-RC5VPVGC.js";import"./chunk-ZUXLC5VX.js";import{C as m,D as u,E as j,F as p,J as _,P as b,b as R,d as E,e as P,f as S,i as T,o,q as d,w as O}from"./chunk-TXVNEV3M.js";import{a as x}from"./chunk-UCTMKA2J.js";import{y as $}from"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{b as f}from"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import{b as l,d as h}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var k=380,y="environmentvariabledefinition_environmentvariablevalue",A="schemaname,displayname,type,defaultvalue,ismanaged,description,modifiedon",L=`${y}($select=value,modifiedon)`,I=new Map([[1e8,"string"],[100000001,"number"],[100000002,"boolean"],[100000003,"json"],[100000004,"data-source"],[100000005,"secret"]]),N={yes:"yes",true:"yes",no:"no",false:"no"};function g(e,i=!1){let n=d(o(e,y)),t=n.length?n[0]:null,a={name:o(e,"schemaname"),display_name:o(e,"displayname"),type:I.get(o(e,"type"))??o(e,"type"),value:t?o(t,"value"):o(e,"defaultvalue"),default:o(e,"defaultvalue"),current:t?o(t,"value"):null,managed:o(e,"ismanaged"),id:o(e,"environmentvariabledefinitionid")};if(i){Object.assign(a,{description:o(e,"description"),modified:o(e,"modifiedon"),value_id:t?o(t,"environmentvariablevalueid"):null,value_modified:t?o(t,"modifiedon"):null});let r={};for(let[s,c]of Object.entries(a))(c!==null||s==="current")&&(r[s]=c);a=r}return a}async function w(e,i,n){let t=R(n),a=t?"environmentvariabledefinitionid":"schemaname",r=t?E(n):P(n),s=await u(e,i,"GET","environmentvariabledefinitions",{params:[["$select",A],["$expand",L],["$filter",`${a} eq ${r}`]]}),c=d(j(s).value);if(!c.length)throw new h(`no environment variable '${n}'`,{service:"dataverse",hint:"run: ppdo-cli dv envvar list --name '*<part of the name>*'"});return c[0]}async function X(e){let i=e.args,n=await m(e);f(e,n,"GET","environmentvariabledefinitions",null);let t=b(i.solution),a=t?await C(e,n,B(t),k):null,r=[["$select",A],["$expand",L],["$orderby","schemaname"]],s=b(i.name);s&&r.push(["$filter",T("schemaname",s)]);let c=await _(e,n,"environmentvariabledefinitions","environmentvariabledefinitionid",a,r,null,O(i),"environment variables",v=>String(o(v,"schemaname")||"").toLowerCase());await e.emit(c.map(v=>g(v)))}async function z(e){let i=await m(e);await e.emit(g(await w(e,i,String(e.args.name)),!0))}var M=/^[ \t\n\r\x0b\x0c]*[+-]?(?:(?:\d(?:_?\d)*(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|inf(?:inity)?|nan)[ \t\n\r\x0b\x0c]*$/i;function q(e,i){if(e==="boolean"){let n=S(i).toLowerCase();if(!(n in N))throw new l(`'${i}' is not a boolean`,{hint:"use yes or no"});return N[n]}if(e==="number"&&!M.test(i))throw new l(`'${i}' is not a number`);if(e==="json")try{x(i)}catch(n){throw new l(`the value is not valid JSON: ${n.message}`)}return i}async function K(e){let i=e.args,n=await m(e);f(e,n,"POST","environmentvariablevalues",Buffer.from("{}"));let t=await n.lookups(()=>w(e,n,String(i.name))),a=$(String(i.value)),r=q(I.get(o(t,"type"))??"",a.toString("utf8")),s=d(o(t,y))[0]??null;if(s)await u(e,n,"PATCH",`environmentvariablevalues(${s.environmentvariablevalueid})`,{body:p({value:r}),headers:{"If-Match":"*"}});else{let c=`/environmentvariabledefinitions(${t.environmentvariabledefinitionid})`;await u(e,n,"POST","environmentvariablevalues",{body:p({value:r,"EnvironmentVariableDefinitionId@odata.bind":c})})}await e.emit(g(await w(e,n,t.environmentvariabledefinitionid),!0))}export{k as COMPONENT_TYPE,y as NAV,I as TYPES,q as checkValue,w as find,z as get,X as list,K as set,g as shape};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{a as P}from"./chunk-XL7E7LX5.js";import{s as d,t as L}from"./chunk-BALEFXOL.js";import{g as h,q as j}from"./chunk-OP6EXLWQ.js";import"./chunk-TQLZ3TRU.js";import{a as C,b as m,d as x,e as R}from"./chunk-S4KF5Z3S.js";import{a as A,b as u}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";import{AsyncLocalStorage as O}from"node:async_hooks";var _=["GET","HEAD"],F=[["whoami"]],D=4;function M(n){let i=n.path;if(n.cls==="R"||F.some(r=>r.join(" ")===i.join(" ")))return null;let t=n.args.method;return n.cls==="M"&&i[i.length-1]==="api"&&_.includes(String(t??"").toUpperCase())?null:"several environments only run read commands; writes go to one environment at a time (--env <name>)"}function U(n,i){let t=d[n.path[0]??""]??null,r=n.args.env,e=n.args.group;if(r&&e)throw new u("use --env or --group, not both");if(typeof e=="string"&&e){i.group(e);let s=i.members(e).filter(a=>!t||a.service===t).map(a=>a.name);if(!s.length){let a=t?`${h[t]} `:"";throw new u(`group '${e}' has no ${a}environments`)}return s}let o=[...new Set(String(r??"").split(",").map(s=>s.trim()).filter(s=>s))];if(!o.length)throw new u("--env needs at least one environment name");for(let s of o){let a=i.environment(s);if(t&&a.service!==t)throw new u(`'${s}' is a ${h[a.service]} environment, not ${h[t]}`)}return o}var k=new O;function N(){let n=process.stdout,i=n.write,t=function(r,...e){let o=k.getStore();if(!o)return i.apply(n,[r,...e]);o.text.push(typeof r=="string"?r:Buffer.from(r).toString("utf8"));let s=e.find(a=>typeof a=="function");return s&&queueMicrotask(s),!0};return n.write=t,x(()=>k.getStore()?.prefix??""),()=>{n.write=i,x(()=>"")}}async function T(n,i,t){let r={...n.args,env:i,group:void 0},e=[],o={prefix:`[${i}] `,text:[]};try{if(!n.handler)throw new Error("no handler");let c=n.handler;await k.run(o,async()=>c(new P(r,e)))}catch(c){if(c instanceof A)return c.exitCode===0?{env:i,group:t,ok:!0,result:e.length?e[e.length-1]:null}:{env:i,group:t,ok:!1,exit_code:c.exitCode,error:c.envelope()};let f=c instanceof Error?c.name:"Error",y=c instanceof Error?c.message:String(c);return{env:i,group:t,ok:!1,exit_code:1,error:{error:`unexpected error: ${f}: ${y}`}}}let s=o.text.join(""),a=e.length===1?e[0]:e.length?e:s||null;return{env:i,group:t,ok:!0,result:a}}function v(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function q(n){let i=Object.values(d).filter(r=>r),t=[];for(let r of n){if(!r.ok){t.push({env:r.env,error:r.error?.error??null});continue}let e=r.result;if(v(e)&&Array.isArray(e.value)&&(e=e.value),v(e)){let o=Object.keys(e);o.length===1&&i.includes(o[0])&&(e=e[o[0]])}if(Array.isArray(e)){for(let o of e)t.push({env:r.env,...v(o)?o:{value:o}});e.length||t.push({env:r.env})}else if(v(e)){let o={env:r.env};for(let[s,a]of Object.entries(e))s.startsWith("@odata.")||(o[s]=a);t.push(o)}else t.push({env:r.env,value:e})}return t}async function W(n,i=D){let t=M(n);if(t)throw new u(t);let r=await j.load(),e=U(n,r),o=n.args.output,s=C(typeof o=="string"?o:null,r.output),a=new Array(e.length),c=0,f=0,y=N();try{let p=async()=>{for(;c<e.length;){let S=c++,b=e[S];for(a[S]=await T(n,b,r.environment(b).group);f<e.length&&a[f];){let I=a[f++];s==="ndjson"&&await m(I,"ndjson")}}};await Promise.all(Array.from({length:Math.max(1,Math.min(i,e.length))},p))}finally{y()}let l=a;s==="table"||s==="tsv"?await m(q(l),s):s==="json"&&await m(l,"json");let g=l.filter(p=>!p.ok);if(!g.length)return 0;R(`${l.length-g.length} of ${l.length} environments succeeded`);let E=new Set(g.map(p=>p.exit_code??1));return g.length===l.length&&E.size===1?[...E][0]??1:1}export{D as CONCURRENCY,_ as READ_METHODS,d as SERVICE_OF,M as allowed,q as flatten,W as run,U as targets,L as wanted};
2
+ import{a as P}from"./chunk-TM3M633T.js";import{s as d,t as L}from"./chunk-BALEFXOL.js";import{g as h,s as j}from"./chunk-STWQDANK.js";import"./chunk-TQLZ3TRU.js";import{a as C,b as m,d as x,e as R}from"./chunk-S4KF5Z3S.js";import{a as A,b as u}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";import{AsyncLocalStorage as O}from"node:async_hooks";var _=["GET","HEAD"],F=[["whoami"]],D=4;function M(n){let i=n.path;if(n.cls==="R"||F.some(r=>r.join(" ")===i.join(" ")))return null;let t=n.args.method;return n.cls==="M"&&i[i.length-1]==="api"&&_.includes(String(t??"").toUpperCase())?null:"several environments only run read commands; writes go to one environment at a time (--env <name>)"}function U(n,i){let t=d[n.path[0]??""]??null,r=n.args.env,e=n.args.group;if(r&&e)throw new u("use --env or --group, not both");if(typeof e=="string"&&e){i.group(e);let s=i.members(e).filter(a=>!t||a.service===t).map(a=>a.name);if(!s.length){let a=t?`${h[t]} `:"";throw new u(`group '${e}' has no ${a}environments`)}return s}let o=[...new Set(String(r??"").split(",").map(s=>s.trim()).filter(s=>s))];if(!o.length)throw new u("--env needs at least one environment name");for(let s of o){let a=i.environment(s);if(t&&a.service!==t)throw new u(`'${s}' is a ${h[a.service]} environment, not ${h[t]}`)}return o}var k=new O;function N(){let n=process.stdout,i=n.write,t=function(r,...e){let o=k.getStore();if(!o)return i.apply(n,[r,...e]);o.text.push(typeof r=="string"?r:Buffer.from(r).toString("utf8"));let s=e.find(a=>typeof a=="function");return s&&queueMicrotask(s),!0};return n.write=t,x(()=>k.getStore()?.prefix??""),()=>{n.write=i,x(()=>"")}}async function T(n,i,t){let r={...n.args,env:i,group:void 0},e=[],o={prefix:`[${i}] `,text:[]};try{if(!n.handler)throw new Error("no handler");let c=n.handler;await k.run(o,async()=>c(new P(r,e)))}catch(c){if(c instanceof A)return c.exitCode===0?{env:i,group:t,ok:!0,result:e.length?e[e.length-1]:null}:{env:i,group:t,ok:!1,exit_code:c.exitCode,error:c.envelope()};let f=c instanceof Error?c.name:"Error",y=c instanceof Error?c.message:String(c);return{env:i,group:t,ok:!1,exit_code:1,error:{error:`unexpected error: ${f}: ${y}`}}}let s=o.text.join(""),a=e.length===1?e[0]:e.length?e:s||null;return{env:i,group:t,ok:!0,result:a}}function v(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function q(n){let i=Object.values(d).filter(r=>r),t=[];for(let r of n){if(!r.ok){t.push({env:r.env,error:r.error?.error??null});continue}let e=r.result;if(v(e)&&Array.isArray(e.value)&&(e=e.value),v(e)){let o=Object.keys(e);o.length===1&&i.includes(o[0])&&(e=e[o[0]])}if(Array.isArray(e)){for(let o of e)t.push({env:r.env,...v(o)?o:{value:o}});e.length||t.push({env:r.env})}else if(v(e)){let o={env:r.env};for(let[s,a]of Object.entries(e))s.startsWith("@odata.")||(o[s]=a);t.push(o)}else t.push({env:r.env,value:e})}return t}async function W(n,i=D){let t=M(n);if(t)throw new u(t);let r=await j.load(),e=U(n,r),o=n.args.output,s=C(typeof o=="string"?o:null,r.output),a=new Array(e.length),c=0,f=0,y=N();try{let p=async()=>{for(;c<e.length;){let S=c++,b=e[S];for(a[S]=await T(n,b,r.environment(b).group);f<e.length&&a[f];){let I=a[f++];s==="ndjson"&&await m(I,"ndjson")}}};await Promise.all(Array.from({length:Math.max(1,Math.min(i,e.length))},p))}finally{y()}let l=a;s==="table"||s==="tsv"?await m(q(l),s):s==="json"&&await m(l,"json");let g=l.filter(p=>!p.ok);if(!g.length)return 0;R(`${l.length-g.length} of ${l.length} environments succeeded`);let E=new Set(g.map(p=>p.exit_code??1));return g.length===l.length&&E.size===1?[...E][0]??1:1}export{D as CONCURRENCY,_ as READ_METHODS,d as SERVICE_OF,M as allowed,q as flatten,W as run,U as targets,L as wanted};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{E as L,O as j,k as X,m as v,o as S,q as B}from"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import{y as _}from"./chunk-BALEFXOL.js";import{a as I,b as O}from"./chunk-J4R6QXW7.js";import{b as F}from"./chunk-5SBBTR3Y.js";import{e as D}from"./chunk-S4KF5Z3S.js";import{a as C,b as $}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var K="@Microsoft.Dynamics.CRM.fetchxmlpagingcookie",U="@Microsoft.Dynamics.CRM.morerecords",T=1e4,M=class extends Error{};function E(s,e){let n=s.attrs.find(([t])=>t===e);return n?n[1]:null}function y(s,e,n){let t=s.attrs.find(([A])=>A===e);t?t[1]=n:s.attrs.push([e,n])}var z={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"},G="\xC0-\uFFFF",V=new RegExp("[A-Za-z_:"+G+"]"),J=new RegExp("[A-Za-z0-9_:.\xB7"+G+"-]");function Z(s){let e=s.replace(/\r\n?/g,`
2
+ import{E as L,O as j,k as X,m as v,o as S,q as B}from"./chunk-TXVNEV3M.js";import"./chunk-UCTMKA2J.js";import{y as _}from"./chunk-BALEFXOL.js";import{a as I,b as O}from"./chunk-J4R6QXW7.js";import{b as F}from"./chunk-5SBBTR3Y.js";import{e as D}from"./chunk-S4KF5Z3S.js";import{a as C,b as $}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var K="@Microsoft.Dynamics.CRM.fetchxmlpagingcookie",U="@Microsoft.Dynamics.CRM.morerecords",T=1e4,M=class extends Error{};function E(s,e){let n=s.attrs.find(([t])=>t===e);return n?n[1]:null}function y(s,e,n){let t=s.attrs.find(([A])=>A===e);t?t[1]=n:s.attrs.push([e,n])}var z={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"},G="\xC0-\uFFFF",V=new RegExp("[A-Za-z_:"+G+"]"),J=new RegExp("[A-Za-z0-9_:.\xB7"+G+"-]");function Z(s){let e=s.replace(/\r\n?/g,`
3
3
  `),n=e.length,t=0,A=i=>{let c=e.slice(0,i),l=c.split(`
4
4
  `).length,a=i-(c.lastIndexOf(`
5
5
  `)+1);return`line ${l}, column ${a}`},o=(i,c)=>{throw new M(`${i}: ${A(c)}`)},f=i=>i===" "||i===" "||i===`
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{C as r,D as c,N as l,a as u,g as p,h as g}from"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import{w as d}from"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{a as f}from"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import{b as m}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function y(t){if(typeof t!="string"||!t)return"";let n=t.indexOf("/");if(n<0)throw new m("--bound expects <entityset>/<key>",{hint:"e.g. --bound accounts/<guid>"});return p(t.slice(0,n),t.slice(n+1))+"/Microsoft.Dynamics.CRM."}async function b(t){let n=t.args,[o,e]=g(String(n.name),d(n.param,"--param"),new Set(n.string??[])),i=await r(t),a=await c(t,i,"GET",y(n.bound)+o,{params:e});await t.emit(a.body.length?a.json():{status:a.status})}async function S(t){let n=t.args;u(String(n.name),"action name",!0);let o=y(n.bound)+String(n.name),e=await l(n.body)??Buffer.from("{}"),i=await r(t),a=f("dataverse",o)?"R":"W",s=await c(t,i,"POST",o,{body:e,cls:a});await t.emit(s.body.length?s.json():{status:s.status})}export{S as action,y as boundPrefix,b as fn};
2
+ import{C as r,D as c,N as l,a as u,g as p,h as g}from"./chunk-TXVNEV3M.js";import"./chunk-UCTMKA2J.js";import{w as d}from"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{a as f}from"./chunk-5SBBTR3Y.js";import"./chunk-S4KF5Z3S.js";import{b as m}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function y(t){if(typeof t!="string"||!t)return"";let n=t.indexOf("/");if(n<0)throw new m("--bound expects <entityset>/<key>",{hint:"e.g. --bound accounts/<guid>"});return p(t.slice(0,n),t.slice(n+1))+"/Microsoft.Dynamics.CRM."}async function b(t){let n=t.args,[o,e]=g(String(n.name),d(n.param,"--param"),new Set(n.string??[])),i=await r(t),a=await c(t,i,"GET",y(n.bound)+o,{params:e});await t.emit(a.body.length?a.json():{status:a.status})}async function S(t){let n=t.args;u(String(n.name),"action name",!0);let o=y(n.bound)+String(n.name),e=await l(n.body)??Buffer.from("{}"),i=await r(t),a=f("dataverse",o)?"R":"W",s=await c(t,i,"POST",o,{body:e,cls:a});await t.emit(s.body.length?s.json():{status:s.status})}export{S as action,y as boundPrefix,b as fn};
@@ -2,4 +2,4 @@ import { createRequire as __cr } from 'node:module'; const require = __cr(import
2
2
  import{e as r,i as t,o,r as n}from"./chunk-BALEFXOL.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function u(i){let s=o(i,"graph","Microsoft Graph, read-only: Entra group lookups"),a=o(s,"group","Entra groups");n(a,"get","R","an Entra group, its member count, and optionally its members",{description:`an Entra group, its member count, and optionally its members
3
3
 
4
4
  <group> is the object id (as a Dataverse group team's entra_group) or the exact display name.
5
- The account is --identity, or the one the environment (--env, or the current one) uses.`}).argument("<group>","object id or display name").argKey("group","groupRef").option("--members","list members (users, groups, service principals)").addOption(new r("--limit <n>","members to list (default 100)").argParser(t)).option("--all","list every member").handler(async e=>(await import("./run-BXFENCN6.js")).get(e)),n(a,"search","R","Entra groups whose display name contains words").argument("<text>").addOption(new r("--limit <n>","at most n groups (default 25)").argParser(t)).handler(async e=>(await import("./run-BXFENCN6.js")).search(e))}export{u as register};
5
+ The account is --identity, or the one the environment (--env, or the current one) uses.`}).argument("<group>","object id or display name").argKey("group","groupRef").option("--members","list members (users, groups, service principals)").addOption(new r("--limit <n>","members to list (default 100)").argParser(t)).option("--all","list every member").handler(async e=>(await import("./run-LNEOCXZA.js")).get(e)),n(a,"search","R","Entra groups whose display name contains words").argument("<text>").addOption(new r("--limit <n>","at most n groups (default 25)").argParser(t)).handler(async e=>(await import("./run-LNEOCXZA.js")).search(e))}export{u as register};
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{e as t,o,r as a}from"./chunk-BALEFXOL.js";import{c as r}from"./chunk-OP6EXLWQ.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function p(i){let n=o(i,"group","manage groups (the account and mode for a set of environments)");a(n,"add","L","add a group",{description:"add a group; --identity <name> (required) is the account its environments use"}).argument("<name>").addOption(new t("--mode <mode>","read-only (default) | read-write | full (read, write and delete)").choices(r)).handler(async e=>(await import("./run-F6H4QCWR.js")).add(e)),a(n,"update","L","change a group's identity or mode").argument("<name>").addOption(new t("--mode <mode>").choices(r)).handler(async e=>(await import("./run-F6H4QCWR.js")).update(e)),a(n,"list","L","list groups with their mode, identity and environments").handler(async e=>(await import("./run-F6H4QCWR.js")).list(e)),a(n,"show","L","show a group and its environments").argument("<name>").handler(async e=>(await import("./run-F6H4QCWR.js")).show(e)),a(n,"remove","L","remove an empty group").argument("<name>").handler(async e=>(await import("./run-F6H4QCWR.js")).remove(e)),a(n,"discover","R","list every Dataverse environment the group's account can reach",{description:`list every Dataverse environment the group's account can reach
2
+ import{e as t,o,r as a}from"./chunk-BALEFXOL.js";import{c as r}from"./chunk-STWQDANK.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function p(i){let n=o(i,"group","manage groups (the account and mode for a set of environments)");a(n,"add","L","add a group",{description:"add a group; --identity <name> (required) is the account its environments use"}).argument("<name>").addOption(new t("--mode <mode>","read-only (default) | read-write | full (read, write and delete)").choices(r)).handler(async e=>(await import("./run-APD3TRCW.js")).add(e)),a(n,"update","L","change a group's identity or mode").argument("<name>").addOption(new t("--mode <mode>").choices(r)).handler(async e=>(await import("./run-APD3TRCW.js")).update(e)),a(n,"list","L","list groups with their mode, identity and environments").handler(async e=>(await import("./run-APD3TRCW.js")).list(e)),a(n,"show","L","show a group and its environments").argument("<name>").handler(async e=>(await import("./run-APD3TRCW.js")).show(e)),a(n,"remove","L","remove an empty group").argument("<name>").handler(async e=>(await import("./run-APD3TRCW.js")).remove(e)),a(n,"discover","R","list every Dataverse environment the group's account can reach",{description:`list every Dataverse environment the group's account can reach
3
3
 
4
4
  Uses the Global Discovery Service with the group's identity. 'added' names the ppdo-cli
5
5
  environment that already points at it. --add puts the named ones (their url name, or
6
- 'all') in the group; for a group agents can write to, you confirm at a terminal.`}).argument("<name>","group").option("--add <url name>[,<url name>...]|all").handler(async e=>(await import("./run-F6H4QCWR.js")).discover(e))}export{p as register};
6
+ 'all') in the group; for a group agents can write to, you confirm at a terminal.`}).argument("<name>","group").option("--add <url name>[,<url name>...]|all").handler(async e=>(await import("./run-APD3TRCW.js")).discover(e))}export{p as register};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{C as q,D as y,E as $,G as V,P as v,a as N,b as O,c as x,d as G,e as j,h as k,l as b,m as w,n as I,o as r,p as d,q as R,r as S,w as T}from"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import{x as D}from"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import{e as _}from"./chunk-S4KF5Z3S.js";import{b as E,j as L}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var W="00000000-0000-0000-0000-000000000000";function C(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function z(t){if(!C(t)||"@odata.type"in t||Object.keys(t).some(n=>n!=="AuditRecord"))return!1;let e=t.AuditRecord;if(!C(e))return!1;let o=w(e._objectid_value)?String(e._objectid_value):"";return x(o,"{}").toLowerCase()===W}function B(t){return t.startsWith("_")&&t.endsWith("_value")?t.slice(1,-6):t}function M(t){let e=new Map,o=d(t);for(let[n,a]of Object.entries(o))n.startsWith("@")||n.includes("@")||e.set(B(n),[a,r(o,`${n}${b}`)]);return e}function H(t){let e=d(t.AuditRecord),o={when:r(e,"createdon"),operation:I(r(e,`operation${b}`),r(e,"operation")),user:r(e,`_userid_value${b}`),user_id:r(e,"_userid_value"),audit_id:r(e,"auditid")},n=r(e,`action${b}`);w(n)&&n!==o.operation&&(o.action=n);let a=w(t["@odata.type"])?String(t["@odata.type"]):"",f=a.slice(a.lastIndexOf(".")+1);if(f==="AttributeAuditDetail"){let i=M(t.OldValue),s=M(t.NewValue),m=[];for(let g of new Set([...i.keys(),...s.keys()])){let c=i.get(g)??[null,null],h=s.get(g)??[null,null],p={column:g,old:c[1]!==null?c[1]:c[0],new:h[1]!==null?h[1]:h[0]};c[1]!==null&&(p.old_value=c[0]),h[1]!==null&&(p.new_value=h[0]),m.push(p)}o.changes=m}else o.type=f||"AuditDetail",o.detail=Object.fromEntries(Object.entries(t).filter(([i])=>i!=="AuditRecord"&&i!=="@odata.type"));return S(o)}async function P(t,e,o,n){let a=$(await y(t,e,"GET","organizations",{params:[["$select","isauditenabled"]]}));if(d((w(a.value)?a.value:[{}])[0]).isauditenabled===!1)return"auditing is off for the organization";let i=R($(await y(t,e,"GET","EntityDefinitions",{params:[["$select","LogicalName,IsAuditEnabled"],["$filter",`EntitySetName eq ${j(o)}`]]})).value);if(!i.length)return`no table has the entity set name '${o}'`;let s=d(i[0]),m=r(s,"LogicalName");if(d(s.IsAuditEnabled).Value===!1)return`auditing is off for the ${m} table`;if(n){let g=R($(await y(t,e,"GET",`EntityDefinitions(LogicalName='${s.LogicalName}')/Attributes`,{params:[["$select","IsAuditEnabled"],["$filter",`LogicalName eq ${j(n)}`]]})).value);if(!g.length)return`the ${m} table has no column '${n}'`;if(d(d(g[0]).IsAuditEnabled).Value===!1)return`auditing is off for the ${n} column`}return null}async function Y(t){let e=t.args,o=N(v(e.entityset),"entity set name"),n=String(e.id);if(!O(n))throw new E(`'${n}' is not a row id`,{hint:"history needs the row's GUID"});let a=L({"@odata.id":`${o}(${G(n)})`}),f=v(e.column),i,s;f?(N(f,"column name"),[i,s]=k("RetrieveAttributeChangeHistory",[["Target",a],["AttributeLogicalName",f]],new Set(["AttributeLogicalName"]))):[i,s]=k("RetrieveRecordChangeHistory",[["Target",a]]);let m=await q(t),c=$(await y(t,m,"GET",i,{params:s,headers:V('odata.include-annotations="*"')})).AuditDetailCollection;if(!C(c))throw new E("unexpected response: no AuditDetailCollection",{hint:"re-run with --verbose"});let h=R(c.AuditDetails),p=D(v(e.since)),l=h.filter(u=>!z(u)).map(u=>H(d(u)));p&&(l=l.filter(u=>(w(u.when)?String(u.when):"")>=p));let A=T(e);if(A!==null&&(l.length>A||c.MoreRecords===!0)&&(l.length>A&&(l=l.slice(0,A)),_(`showing the first ${l.length} changes; pass --limit n or --all for more`)),!l.length&&!p){let u=await P(t,m,o,f);_(u?`no changes found: ${u}`:"no changes found (auditing is on)")}await t.emit(l)}export{Y as history,z as isConfigRow,H as shape};
2
+ import{C as q,D as y,E as $,G as V,P as v,a as N,b as O,c as x,d as G,e as j,h as k,l as b,m as w,n as I,o as r,p as d,q as R,r as S,w as T}from"./chunk-TXVNEV3M.js";import"./chunk-UCTMKA2J.js";import{x as D}from"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import{e as _}from"./chunk-S4KF5Z3S.js";import{b as E,j as L}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var W="00000000-0000-0000-0000-000000000000";function C(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function z(t){if(!C(t)||"@odata.type"in t||Object.keys(t).some(n=>n!=="AuditRecord"))return!1;let e=t.AuditRecord;if(!C(e))return!1;let o=w(e._objectid_value)?String(e._objectid_value):"";return x(o,"{}").toLowerCase()===W}function B(t){return t.startsWith("_")&&t.endsWith("_value")?t.slice(1,-6):t}function M(t){let e=new Map,o=d(t);for(let[n,a]of Object.entries(o))n.startsWith("@")||n.includes("@")||e.set(B(n),[a,r(o,`${n}${b}`)]);return e}function H(t){let e=d(t.AuditRecord),o={when:r(e,"createdon"),operation:I(r(e,`operation${b}`),r(e,"operation")),user:r(e,`_userid_value${b}`),user_id:r(e,"_userid_value"),audit_id:r(e,"auditid")},n=r(e,`action${b}`);w(n)&&n!==o.operation&&(o.action=n);let a=w(t["@odata.type"])?String(t["@odata.type"]):"",f=a.slice(a.lastIndexOf(".")+1);if(f==="AttributeAuditDetail"){let i=M(t.OldValue),s=M(t.NewValue),m=[];for(let g of new Set([...i.keys(),...s.keys()])){let c=i.get(g)??[null,null],h=s.get(g)??[null,null],p={column:g,old:c[1]!==null?c[1]:c[0],new:h[1]!==null?h[1]:h[0]};c[1]!==null&&(p.old_value=c[0]),h[1]!==null&&(p.new_value=h[0]),m.push(p)}o.changes=m}else o.type=f||"AuditDetail",o.detail=Object.fromEntries(Object.entries(t).filter(([i])=>i!=="AuditRecord"&&i!=="@odata.type"));return S(o)}async function P(t,e,o,n){let a=$(await y(t,e,"GET","organizations",{params:[["$select","isauditenabled"]]}));if(d((w(a.value)?a.value:[{}])[0]).isauditenabled===!1)return"auditing is off for the organization";let i=R($(await y(t,e,"GET","EntityDefinitions",{params:[["$select","LogicalName,IsAuditEnabled"],["$filter",`EntitySetName eq ${j(o)}`]]})).value);if(!i.length)return`no table has the entity set name '${o}'`;let s=d(i[0]),m=r(s,"LogicalName");if(d(s.IsAuditEnabled).Value===!1)return`auditing is off for the ${m} table`;if(n){let g=R($(await y(t,e,"GET",`EntityDefinitions(LogicalName='${s.LogicalName}')/Attributes`,{params:[["$select","IsAuditEnabled"],["$filter",`LogicalName eq ${j(n)}`]]})).value);if(!g.length)return`the ${m} table has no column '${n}'`;if(d(d(g[0]).IsAuditEnabled).Value===!1)return`auditing is off for the ${n} column`}return null}async function Y(t){let e=t.args,o=N(v(e.entityset),"entity set name"),n=String(e.id);if(!O(n))throw new E(`'${n}' is not a row id`,{hint:"history needs the row's GUID"});let a=L({"@odata.id":`${o}(${G(n)})`}),f=v(e.column),i,s;f?(N(f,"column name"),[i,s]=k("RetrieveAttributeChangeHistory",[["Target",a],["AttributeLogicalName",f]],new Set(["AttributeLogicalName"]))):[i,s]=k("RetrieveRecordChangeHistory",[["Target",a]]);let m=await q(t),c=$(await y(t,m,"GET",i,{params:s,headers:V('odata.include-annotations="*"')})).AuditDetailCollection;if(!C(c))throw new E("unexpected response: no AuditDetailCollection",{hint:"re-run with --verbose"});let h=R(c.AuditDetails),p=D(v(e.since)),l=h.filter(u=>!z(u)).map(u=>H(d(u)));p&&(l=l.filter(u=>(w(u.when)?String(u.when):"")>=p));let A=T(e);if(A!==null&&(l.length>A||c.MoreRecords===!0)&&(l.length>A&&(l=l.slice(0,A)),_(`showing the first ${l.length} changes; pass --limit n or --all for more`)),!l.length&&!p){let u=await P(t,m,o,f);_(u?`no changes found: ${u}`:"no changes found (auditing is on)")}await t.emit(l)}export{Y as history,z as isConfigRow,H as shape};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
+ import{e as a,o as d,r as n}from"./chunk-BALEFXOL.js";import{b as p}from"./chunk-STWQDANK.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function h(i){let t=d(i,"identity","manage identities (one account in one tenant)"),o=n(t,"add","L","add an identity").argument("<name>");s(o,!0),o.handler(async e=>(await import("./run-SB4QN5Q4.js")).add(e));let r=n(t,"update","L","change fields of an identity").argument("<name>");s(r,!1),r.handler(async e=>(await import("./run-SB4QN5Q4.js")).update(e)),n(t,"list","L","list identities").handler(async e=>(await import("./run-SB4QN5Q4.js")).list(e)),n(t,"show","L","show one identity and its cache files").argument("<name>").handler(async e=>(await import("./run-SB4QN5Q4.js")).show(e)),n(t,"remove","L","remove an identity and delete its token caches").argument("<name>").option("--force","remove even if a group uses it").handler(async e=>(await import("./run-SB4QN5Q4.js")).remove(e))}function s(i,t){let o=new a("--tenant <id|domain>",t?"Entra tenant ID or domain (required, except for pat)":"Entra tenant ID or domain");i.addOption(o).option("--username <upn>","account to sign in as (required for broker, browser, device_code)").addOption(new a("--method <method>","how to sign in (default: browser)").choices(p)).option("--client-id <id>","app (client) ID; default: the Azure CLI's public client").option("--config-dir <path>","az_cli only: AZURE_CONFIG_DIR for this identity").option("--secret-env <VAR>","spn only: env var holding the client secret").option("--certificate <path>","spn only: certificate (PEM) path").option("--organization <org>","pat only: the one Azure DevOps organization the PAT is for").option("--pat-env <VAR>","pat only: env var holding the PAT (for pipelines); otherwise auth login stores it encrypted")}export{h as register};
@@ -1,2 +1,2 @@
1
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}from"./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{e as CANCELED,b as DONE,d as FAILED,a as SELECT,f as STATES,c as SUCCEEDED,n as cancel,g as fetch,k as get,m as list,j as raiseIfFailed,h as summarise,i as wait,l as waitCmd};
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-RC5VPVGC.js";import"./chunk-ZUXLC5VX.js";import"./chunk-TXVNEV3M.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{e as CANCELED,b as DONE,d as FAILED,a as SELECT,f as STATES,c as SUCCEEDED,n as cancel,g as fetch,k as get,m as list,j as raiseIfFailed,h as summarise,i as wait,l as waitCmd};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
- import{b as _,c as R,e as H}from"./chunk-JGLUQBCK.js";import{i as F,j as Y}from"./chunk-QE4DELWW.js";import"./chunk-ZUXLC5VX.js";import{B as O,C as y,D as l,E as p,F as q,I as V,P as C,b as I,d as k,e as T,f as A,i as z,m as j,n as P,o as r,q as x,s as L,t as G,u as D,w as U}from"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{b as $}from"./chunk-5SBBTR3Y.js";import{e as M}from"./chunk-S4KF5Z3S.js";import{b as c,d as B}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";import{crc32 as on}from"node:zlib";var tn=/^\d+(\.\d+){1,3}\n?$/,sn=["major","minor","build","revision"],N=Buffer.from("{}"),Z=new Map([["table",1],["entity",1],["column",2],["attribute",2],["choice",9],["optionset",9],["relationship",10],["role",20],["view",26],["savedquery",26],["process",29],["workflow",29],["flow",29],["email-template",36],["form",60],["systemform",60],["webresource",61],["sitemap",62],["app",80],["appmodule",80],["assembly",91],["pluginassembly",91],["step",92],["sdkmessageprocessingstep",92],["canvas-app",300],["envvar",380],["environmentvariabledefinition",380],["connref","connectionreference"],["connectionreference","connectionreference"]]),an=new Map([[20,["roles","name","roleid",null]],[29,["workflows","name","workflowid","type eq 1"]],[61,["webresourceset","name","webresourceid",null]],[62,["sitemaps","sitemapnameunique","sitemapid",null]],[80,["appmodules","uniquename","appmoduleid",null]],[91,["pluginassemblies","name","pluginassemblyid",null]],[92,["sdkmessageprocessingsteps","name","sdkmessageprocessingstepid",null]],[300,["canvasapps","name","canvasappid",null]],[380,["environmentvariabledefinitions","schemaname","environmentvariabledefinitionid",null]]]);function S(n){return n==null?"None":n===!0?"True":n===!1?"False":String(n)}function rn(n,e){if(!(e in n))throw new Error(`KeyError: '${e}'`);return n[e]}var K=/^[A-Za-z_][A-Za-z0-9_]*$/;function f(n){if(!tn.test(n||""))throw new c(`'${n??"None"}' is not a version`,{hint:"use major.minor[.build[.revision]], e.g. 1.2.0.0"});let e=n.trim().split(".").map(o=>parseInt(o,10));for(;e.length<4;)e.push(0);return e}function un(n,e){let o=f(n),t=sn.indexOf(e);return o=[...o.slice(0,t),o[t]+1,...Array(3-t).fill(0)],o.join(".")}function W(n,e){return n[0]===e[0]&&n[1]===e[1]}function cn(n,e){let[o,t,i]=f(n),a=[i,...e.filter(s=>W(f(s),[o,t])).map(s=>f(s)[2])];return`${o}.${t}.${Math.max(...a)+1}.0`}function ln(n,e){for(let o=0;o<Math.min(n.length,e.length);o++)if(n[o]!==e[o])return n[o]-e[o];return n.length-e.length}var J="uniquename,friendlyname,customizationprefix,customizationoptionvalueprefix,description,publisherid";function Q(n){return L({name:r(n,"uniquename"),display_name:r(n,"friendlyname"),prefix:r(n,"customizationprefix"),option_prefix:r(n,"customizationoptionvalueprefix"),description:r(n,"description"),id:r(n,"publisherid")})}async function X(n,e,o){let t=T(o),i=x(r(p(await l(n,e,"GET","publishers",{params:[["$select",J],["$filter",`uniquename eq ${t} or customizationprefix eq ${t}`]]})),"value"));if(!i.length)throw new B(`no publisher '${o}'`,{service:"dataverse",hint:"run: ppdo-cli dv publisher list"});return i[0]}async function qn(n){let e=n.args,o=await y(n);$(n,o,"GET","publishers",null);let t=[["$select",J],["$orderby","uniquename"]];e.name&&t.push(["$filter",z("uniquename",String(e.name))]);let[i]=await V(n,o,"publishers",t,null,U(e),"publishers");await n.emit(i.map(Q))}async function Sn(n){let e=n.args,o=A(String(e.prefix)),t=String(e.name);if(!/^[a-z][a-z0-9]{1,7}$/.test(o)||o.startsWith("mscrm"))throw new c(`'${o}' is not a valid prefix`,{hint:"2-8 lower-case letters or digits, starting with a letter, not 'mscrm'"});if(!K.test(t))throw new c(`'${t}' is not a valid unique name`,{hint:"letters, digits and underscores"});let i=typeof e.optionPrefix=="number"?e.optionPrefix:1e4+on(Buffer.from(o,"utf8"))%9e4;if(!(i>=1e4&&i<=99999))throw new c("--option-prefix must be between 10000 and 99999");let a={uniquename:t,friendlyname:P(C(e.displayName),t),customizationprefix:o,customizationoptionvalueprefix:i},s=await y(n);await l(n,s,"POST","publishers",{body:q(a)}),await n.emit(Q(await X(n,s,t)))}async function Pn(n){let e=n.args,o=String(e.uniquename);if(!K.test(o))throw new c(`'${o}' is not a valid unique name`,{hint:"letters, digits and underscores"});let t=f(String(e.version)).join("."),i=await y(n);$(n,i,"POST","solutions",N);let a=await i.lookups(()=>X(n,i,String(e.publisher))),s={uniquename:o,friendlyname:P(C(e.displayName),o),version:t,"publisherid@odata.bind":`/publishers(${S(a.publisherid)})`};e.description&&(s.description=e.description),await l(n,i,"POST","solutions",{body:q(s)}),await n.emit(_(await R(n,i,o)))}async function xn(n){let e=n.args;O(e,{version:"--version",bump:"--bump"},!1,"dv solution update");let o=String(e.uniquename),t=C(e.description);if(!(e.version||e.bump||e.displayName||t!==null))throw new c("nothing to update",{hint:"pass --version, --bump, --display-name or --description"});let i=await y(n);$(n,i,"PATCH","solutions",N);let a=await i.lookups(()=>R(n,i,o));if(j(r(a,"ismanaged")))throw new c(`${o} is managed; only unmanaged solutions can be changed`);let s={};e.version?s.version=f(String(e.version)).join("."):e.bump&&(s.version=un(String(P(r(a,"version"),"1.0.0.0")),String(e.bump))),e.displayName&&(s.friendlyname=e.displayName),t!==null&&(s.description=t),await l(n,i,"PATCH",`solutions(${S(a.solutionid)})`,{body:q(s),headers:{"If-Match":"*"}});let u=_(await R(n,i,o));"version"in s&&(u.previous_version=r(a,"version")),await n.emit(u)}async function Rn(n){let e=n.args,o=String(e.parent),t=await y(n);$(n,t,"POST","CloneAsPatch",N);let[i,a]=await t.lookups(async()=>{let m=await R(n,t,o);if(j(r(m,"ismanaged")))throw new c(`${o} is managed; patch the unmanaged solution in the development environment`);let v=x(r(p(await l(n,t,"GET","solutions",{params:[["$select","version"],["$filter",`_parentsolutionid_value eq ${S(m.solutionid)}`]]})),"value"));return[m,v]}),s=String(P(r(i,"version"),"1.0.0.0")),u;if(e.version){if(u=f(String(e.version)).join("."),!W(f(u),f(s))||ln(f(u),f(s))<=0)throw new c(`a patch of ${s} needs the same major.minor and a higher version`)}else u=cn(s,a.filter(m=>j(r(m,"version"))).map(m=>m.version));let b={ParentSolutionUniqueName:i.uniquename,VersionNumber:u,DisplayName:P(C(e.displayName),`${S(P(r(i,"friendlyname"),i.uniquename))} patch`)},d=p(await l(n,t,"POST","CloneAsPatch",{body:q(b)})),h=x(r(p(await l(n,t,"GET","solutions",{params:[["$select","uniquename"],["$filter",`solutionid eq ${S(r(d,"SolutionId"))}`]]})),"value"));await n.emit(h.length?{..._(await R(n,t,h[0].uniquename)),parent:i.uniquename}:{solution_id:r(d,"SolutionId"),parent:i.uniquename,version:u})}async function nn(n,e,o){let t=A(o).toLowerCase();if(/^\d+$/.test(t))return parseInt(t,10);let i=Z.get(t);if(i===void 0){let a=G(D([...Z.keys()].filter(s=>s.includes("-")||s.length<12)),s=>s);throw new c(`unknown component type '${o}'`,{hint:"use "+a.join(", ")+", or a number"})}return typeof i=="string"?H(n,e,i):i}async function mn(n,e,o,t,i){if(I(t))return k(t);let a=T(t),s=async g=>rn(p(await l(n,e,"GET",g,{params:[["$select","MetadataId"]]})),"MetadataId");if(o===1)return s(`EntityDefinitions(LogicalName=${a})`);if(o===2){let g=t.indexOf(".");if(g<0)throw new c("a column is <table>.<column>, e.g. account.name");return s(`EntityDefinitions(LogicalName=${T(t.slice(0,g))})/Attributes(LogicalName=${T(t.slice(g+1))})`)}if(o===9)return s(`GlobalOptionSetDefinitions(Name=${a})`);let u=an.get(o);if(u===void 0&&o>=1e4&&o===await nn(n,e,"connref")&&(u=["connectionreferences","connectionreferencelogicalname","connectionreferenceid",null]),u===void 0)throw new c(`give a ${i} by id`,{hint:"names are not unique for this type"});let[b,d,h,m]=u,v=`${d} eq ${a}`+(m?` and ${m}`:""),E=h+(o===20?",_parentrootroleid_value":""),w=x(r(p(await l(n,e,"GET",b,{params:[["$select",E],["$filter",v]]})),"value"));if(o===20&&(w=w.filter(g=>r(g,"_parentrootroleid_value")===r(g,"roleid"))),!w.length)throw new B(`no ${i} named '${t}'`,{service:"dataverse"});if(w.length>1)throw new c(`${w.length} components named '${t}'; use an id`,{hint:w.map(g=>S(g[h])).join(", ")});return w[0][h]}async function en(n,e){let o=n.args,t=String(o.uniquename),i=await R(n,e,t);if(j(r(i,"ismanaged")))throw new c(`${t} is managed; components are added to unmanaged solutions`);let a=await nn(n,e,String(o.type));return[i,a,await mn(n,e,a,String(o.component),String(o.type))]}async function dn(n,e,o,t){let i=x(p(await l(n,e,"GET","solutioncomponents",{params:[["$select","rootcomponentbehavior"],["$filter",`_solutionid_value eq ${o} and componenttype eq 1 and objectid eq ${t}`]]})).value);return i.length?r(i[0],"rootcomponentbehavior"):null}async function Tn(n){let e=n.args,o=!!e.shell,t=e.subcomponents===!1;O({shell:o,noSub:t},{shell:"--shell",noSub:"--no-subcomponents"},!1,"dv solution add-component");let i=await y(n);$(n,i,"POST","AddSolutionComponent",N);let a=o?"--shell":t?"--no-subcomponents":null,s=String(e.component),[u,b,d]=await i.lookups(async()=>{let[v,E,w]=await en(n,i);if(a&&E!==1)throw new c(`${a} is for tables`);if(a&&await dn(n,i,v.solutionid,w)===0)throw new c(`${s} is already in ${v.uniquename} with all its subcomponents, and Dataverse won't narrow that in place`,{hint:`remove it first: ppdo-cli dv solution remove-component ${v.uniquename} table ${s}, then add it again with ${a}`});return[v,E,w]}),h={ComponentId:d,ComponentType:b,SolutionUniqueName:u.uniquename,AddRequiredComponents:!!e.withRequired,DoNotIncludeSubcomponents:o||t};o&&(h.IncludedComponentSettingsValues=[]);let m=p(await l(n,i,"POST","AddSolutionComponent",{body:q(h)}));await n.emit({solution:u.uniquename,type:b,component:d,added:!0,solution_component_id:r(m,"id")})}async function Nn(n){let e=await y(n);$(n,e,"POST","RemoveSolutionComponent",N);let[o,t,i]=await e.lookups(()=>en(n,e)),a={SolutionComponent:{"@odata.type":"Microsoft.Dynamics.CRM.solutioncomponent",solutioncomponentid:i},ComponentType:t,SolutionUniqueName:o.uniquename};await l(n,e,"POST","RemoveSolutionComponent",{body:q(a)}),await n.emit({solution:o.uniquename,type:t,component:i,removed:!0})}async function jn(n){let e=n.args,o=String(e.uniquename),t=await y(n);$(n,t,"POST","DeleteAndPromoteAsync",N);let i=o+"_Upgrade",a=await t.lookups(async()=>x(r(p(await l(n,t,"GET","solutions",{params:[["$select","version"],["$filter",`uniquename eq ${T(i)}`]]})),"value")));if(!a.length)throw new B(`there is no ${i} holding solution to promote`,{service:"dataverse",hint:"stage one first: ppdo-cli dv solution import <file.zip> --holding"});let s=p(await l(n,t,"POST","DeleteAndPromoteAsync",{body:q({UniqueName:o})})),u=r(s,"AsyncOperationId"),b={solution:o,version:r(a[0],"version"),job_id:u};if(!e.async){await n.emit({...b,status:"started",hint:`ppdo-cli dv job wait ${S(u)}`});return}M(`promoting ${i}, job ${S(u)}`);let d=await F(n,t,u);await n.emit({...b,status:r(d,"status"),message:r(d,"message")}),Y(d)}export{Z as COMPONENT_TYPES,sn as PARTS,Tn as addComponent,un as bump,mn as componentId,nn as componentType,Pn as create,X as findPublisher,cn as nextPatchVersion,f as parseVersion,Rn as patch,jn as promote,Sn as publisherCreate,qn as publisherList,Nn as removeComponent,xn as update};
2
+ import{b as _,c as R,e as H}from"./chunk-OXZG44O5.js";import{i as F,j as Y}from"./chunk-RC5VPVGC.js";import"./chunk-ZUXLC5VX.js";import{B as O,C as y,D as l,E as p,F as q,I as V,P as C,b as I,d as k,e as T,f as A,i as z,m as j,n as P,o as r,q as x,s as L,t as G,u as D,w as U}from"./chunk-TXVNEV3M.js";import"./chunk-UCTMKA2J.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{b as $}from"./chunk-5SBBTR3Y.js";import{e as M}from"./chunk-S4KF5Z3S.js";import{b as c,d as B}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";import{crc32 as on}from"node:zlib";var tn=/^\d+(\.\d+){1,3}\n?$/,sn=["major","minor","build","revision"],N=Buffer.from("{}"),Z=new Map([["table",1],["entity",1],["column",2],["attribute",2],["choice",9],["optionset",9],["relationship",10],["role",20],["view",26],["savedquery",26],["process",29],["workflow",29],["flow",29],["email-template",36],["form",60],["systemform",60],["webresource",61],["sitemap",62],["app",80],["appmodule",80],["assembly",91],["pluginassembly",91],["step",92],["sdkmessageprocessingstep",92],["canvas-app",300],["envvar",380],["environmentvariabledefinition",380],["connref","connectionreference"],["connectionreference","connectionreference"]]),an=new Map([[20,["roles","name","roleid",null]],[29,["workflows","name","workflowid","type eq 1"]],[61,["webresourceset","name","webresourceid",null]],[62,["sitemaps","sitemapnameunique","sitemapid",null]],[80,["appmodules","uniquename","appmoduleid",null]],[91,["pluginassemblies","name","pluginassemblyid",null]],[92,["sdkmessageprocessingsteps","name","sdkmessageprocessingstepid",null]],[300,["canvasapps","name","canvasappid",null]],[380,["environmentvariabledefinitions","schemaname","environmentvariabledefinitionid",null]]]);function S(n){return n==null?"None":n===!0?"True":n===!1?"False":String(n)}function rn(n,e){if(!(e in n))throw new Error(`KeyError: '${e}'`);return n[e]}var K=/^[A-Za-z_][A-Za-z0-9_]*$/;function f(n){if(!tn.test(n||""))throw new c(`'${n??"None"}' is not a version`,{hint:"use major.minor[.build[.revision]], e.g. 1.2.0.0"});let e=n.trim().split(".").map(o=>parseInt(o,10));for(;e.length<4;)e.push(0);return e}function un(n,e){let o=f(n),t=sn.indexOf(e);return o=[...o.slice(0,t),o[t]+1,...Array(3-t).fill(0)],o.join(".")}function W(n,e){return n[0]===e[0]&&n[1]===e[1]}function cn(n,e){let[o,t,i]=f(n),a=[i,...e.filter(s=>W(f(s),[o,t])).map(s=>f(s)[2])];return`${o}.${t}.${Math.max(...a)+1}.0`}function ln(n,e){for(let o=0;o<Math.min(n.length,e.length);o++)if(n[o]!==e[o])return n[o]-e[o];return n.length-e.length}var J="uniquename,friendlyname,customizationprefix,customizationoptionvalueprefix,description,publisherid";function Q(n){return L({name:r(n,"uniquename"),display_name:r(n,"friendlyname"),prefix:r(n,"customizationprefix"),option_prefix:r(n,"customizationoptionvalueprefix"),description:r(n,"description"),id:r(n,"publisherid")})}async function X(n,e,o){let t=T(o),i=x(r(p(await l(n,e,"GET","publishers",{params:[["$select",J],["$filter",`uniquename eq ${t} or customizationprefix eq ${t}`]]})),"value"));if(!i.length)throw new B(`no publisher '${o}'`,{service:"dataverse",hint:"run: ppdo-cli dv publisher list"});return i[0]}async function qn(n){let e=n.args,o=await y(n);$(n,o,"GET","publishers",null);let t=[["$select",J],["$orderby","uniquename"]];e.name&&t.push(["$filter",z("uniquename",String(e.name))]);let[i]=await V(n,o,"publishers",t,null,U(e),"publishers");await n.emit(i.map(Q))}async function Sn(n){let e=n.args,o=A(String(e.prefix)),t=String(e.name);if(!/^[a-z][a-z0-9]{1,7}$/.test(o)||o.startsWith("mscrm"))throw new c(`'${o}' is not a valid prefix`,{hint:"2-8 lower-case letters or digits, starting with a letter, not 'mscrm'"});if(!K.test(t))throw new c(`'${t}' is not a valid unique name`,{hint:"letters, digits and underscores"});let i=typeof e.optionPrefix=="number"?e.optionPrefix:1e4+on(Buffer.from(o,"utf8"))%9e4;if(!(i>=1e4&&i<=99999))throw new c("--option-prefix must be between 10000 and 99999");let a={uniquename:t,friendlyname:P(C(e.displayName),t),customizationprefix:o,customizationoptionvalueprefix:i},s=await y(n);await l(n,s,"POST","publishers",{body:q(a)}),await n.emit(Q(await X(n,s,t)))}async function Pn(n){let e=n.args,o=String(e.uniquename);if(!K.test(o))throw new c(`'${o}' is not a valid unique name`,{hint:"letters, digits and underscores"});let t=f(String(e.version)).join("."),i=await y(n);$(n,i,"POST","solutions",N);let a=await i.lookups(()=>X(n,i,String(e.publisher))),s={uniquename:o,friendlyname:P(C(e.displayName),o),version:t,"publisherid@odata.bind":`/publishers(${S(a.publisherid)})`};e.description&&(s.description=e.description),await l(n,i,"POST","solutions",{body:q(s)}),await n.emit(_(await R(n,i,o)))}async function xn(n){let e=n.args;O(e,{version:"--version",bump:"--bump"},!1,"dv solution update");let o=String(e.uniquename),t=C(e.description);if(!(e.version||e.bump||e.displayName||t!==null))throw new c("nothing to update",{hint:"pass --version, --bump, --display-name or --description"});let i=await y(n);$(n,i,"PATCH","solutions",N);let a=await i.lookups(()=>R(n,i,o));if(j(r(a,"ismanaged")))throw new c(`${o} is managed; only unmanaged solutions can be changed`);let s={};e.version?s.version=f(String(e.version)).join("."):e.bump&&(s.version=un(String(P(r(a,"version"),"1.0.0.0")),String(e.bump))),e.displayName&&(s.friendlyname=e.displayName),t!==null&&(s.description=t),await l(n,i,"PATCH",`solutions(${S(a.solutionid)})`,{body:q(s),headers:{"If-Match":"*"}});let u=_(await R(n,i,o));"version"in s&&(u.previous_version=r(a,"version")),await n.emit(u)}async function Rn(n){let e=n.args,o=String(e.parent),t=await y(n);$(n,t,"POST","CloneAsPatch",N);let[i,a]=await t.lookups(async()=>{let m=await R(n,t,o);if(j(r(m,"ismanaged")))throw new c(`${o} is managed; patch the unmanaged solution in the development environment`);let v=x(r(p(await l(n,t,"GET","solutions",{params:[["$select","version"],["$filter",`_parentsolutionid_value eq ${S(m.solutionid)}`]]})),"value"));return[m,v]}),s=String(P(r(i,"version"),"1.0.0.0")),u;if(e.version){if(u=f(String(e.version)).join("."),!W(f(u),f(s))||ln(f(u),f(s))<=0)throw new c(`a patch of ${s} needs the same major.minor and a higher version`)}else u=cn(s,a.filter(m=>j(r(m,"version"))).map(m=>m.version));let b={ParentSolutionUniqueName:i.uniquename,VersionNumber:u,DisplayName:P(C(e.displayName),`${S(P(r(i,"friendlyname"),i.uniquename))} patch`)},d=p(await l(n,t,"POST","CloneAsPatch",{body:q(b)})),h=x(r(p(await l(n,t,"GET","solutions",{params:[["$select","uniquename"],["$filter",`solutionid eq ${S(r(d,"SolutionId"))}`]]})),"value"));await n.emit(h.length?{..._(await R(n,t,h[0].uniquename)),parent:i.uniquename}:{solution_id:r(d,"SolutionId"),parent:i.uniquename,version:u})}async function nn(n,e,o){let t=A(o).toLowerCase();if(/^\d+$/.test(t))return parseInt(t,10);let i=Z.get(t);if(i===void 0){let a=G(D([...Z.keys()].filter(s=>s.includes("-")||s.length<12)),s=>s);throw new c(`unknown component type '${o}'`,{hint:"use "+a.join(", ")+", or a number"})}return typeof i=="string"?H(n,e,i):i}async function mn(n,e,o,t,i){if(I(t))return k(t);let a=T(t),s=async g=>rn(p(await l(n,e,"GET",g,{params:[["$select","MetadataId"]]})),"MetadataId");if(o===1)return s(`EntityDefinitions(LogicalName=${a})`);if(o===2){let g=t.indexOf(".");if(g<0)throw new c("a column is <table>.<column>, e.g. account.name");return s(`EntityDefinitions(LogicalName=${T(t.slice(0,g))})/Attributes(LogicalName=${T(t.slice(g+1))})`)}if(o===9)return s(`GlobalOptionSetDefinitions(Name=${a})`);let u=an.get(o);if(u===void 0&&o>=1e4&&o===await nn(n,e,"connref")&&(u=["connectionreferences","connectionreferencelogicalname","connectionreferenceid",null]),u===void 0)throw new c(`give a ${i} by id`,{hint:"names are not unique for this type"});let[b,d,h,m]=u,v=`${d} eq ${a}`+(m?` and ${m}`:""),E=h+(o===20?",_parentrootroleid_value":""),w=x(r(p(await l(n,e,"GET",b,{params:[["$select",E],["$filter",v]]})),"value"));if(o===20&&(w=w.filter(g=>r(g,"_parentrootroleid_value")===r(g,"roleid"))),!w.length)throw new B(`no ${i} named '${t}'`,{service:"dataverse"});if(w.length>1)throw new c(`${w.length} components named '${t}'; use an id`,{hint:w.map(g=>S(g[h])).join(", ")});return w[0][h]}async function en(n,e){let o=n.args,t=String(o.uniquename),i=await R(n,e,t);if(j(r(i,"ismanaged")))throw new c(`${t} is managed; components are added to unmanaged solutions`);let a=await nn(n,e,String(o.type));return[i,a,await mn(n,e,a,String(o.component),String(o.type))]}async function dn(n,e,o,t){let i=x(p(await l(n,e,"GET","solutioncomponents",{params:[["$select","rootcomponentbehavior"],["$filter",`_solutionid_value eq ${o} and componenttype eq 1 and objectid eq ${t}`]]})).value);return i.length?r(i[0],"rootcomponentbehavior"):null}async function Tn(n){let e=n.args,o=!!e.shell,t=e.subcomponents===!1;O({shell:o,noSub:t},{shell:"--shell",noSub:"--no-subcomponents"},!1,"dv solution add-component");let i=await y(n);$(n,i,"POST","AddSolutionComponent",N);let a=o?"--shell":t?"--no-subcomponents":null,s=String(e.component),[u,b,d]=await i.lookups(async()=>{let[v,E,w]=await en(n,i);if(a&&E!==1)throw new c(`${a} is for tables`);if(a&&await dn(n,i,v.solutionid,w)===0)throw new c(`${s} is already in ${v.uniquename} with all its subcomponents, and Dataverse won't narrow that in place`,{hint:`remove it first: ppdo-cli dv solution remove-component ${v.uniquename} table ${s}, then add it again with ${a}`});return[v,E,w]}),h={ComponentId:d,ComponentType:b,SolutionUniqueName:u.uniquename,AddRequiredComponents:!!e.withRequired,DoNotIncludeSubcomponents:o||t};o&&(h.IncludedComponentSettingsValues=[]);let m=p(await l(n,i,"POST","AddSolutionComponent",{body:q(h)}));await n.emit({solution:u.uniquename,type:b,component:d,added:!0,solution_component_id:r(m,"id")})}async function Nn(n){let e=await y(n);$(n,e,"POST","RemoveSolutionComponent",N);let[o,t,i]=await e.lookups(()=>en(n,e)),a={SolutionComponent:{"@odata.type":"Microsoft.Dynamics.CRM.solutioncomponent",solutioncomponentid:i},ComponentType:t,SolutionUniqueName:o.uniquename};await l(n,e,"POST","RemoveSolutionComponent",{body:q(a)}),await n.emit({solution:o.uniquename,type:t,component:i,removed:!0})}async function jn(n){let e=n.args,o=String(e.uniquename),t=await y(n);$(n,t,"POST","DeleteAndPromoteAsync",N);let i=o+"_Upgrade",a=await t.lookups(async()=>x(r(p(await l(n,t,"GET","solutions",{params:[["$select","version"],["$filter",`uniquename eq ${T(i)}`]]})),"value")));if(!a.length)throw new B(`there is no ${i} holding solution to promote`,{service:"dataverse",hint:"stage one first: ppdo-cli dv solution import <file.zip> --holding"});let s=p(await l(n,t,"POST","DeleteAndPromoteAsync",{body:q({UniqueName:o})})),u=r(s,"AsyncOperationId"),b={solution:o,version:r(a[0],"version"),job_id:u};if(!e.async){await n.emit({...b,status:"started",hint:`ppdo-cli dv job wait ${S(u)}`});return}M(`promoting ${i}, job ${S(u)}`);let d=await F(n,t,u);await n.emit({...b,status:r(d,"status"),message:r(d,"message")}),Y(d)}export{Z as COMPONENT_TYPES,sn as PARTS,Tn as addComponent,un as bump,mn as componentId,nn as componentType,Pn as create,X as findPublisher,cn as nextPatchVersion,f as parseVersion,Rn as patch,jn as promote,Sn as publisherCreate,qn as publisherList,Nn as removeComponent,xn as update};