@ppdostudio/ppdo-cli 0.0.0-stage → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/LICENSE +114 -0
- package/README.md +330 -2
- package/THIRD-PARTY-NOTICES +25 -0
- package/dist/bin.js +5 -0
- package/dist/chunks/ado-NLCWVIVQ.js +103 -0
- package/dist/chunks/api-T5SWGOFX.js +2 -0
- package/dist/chunks/api-YKKPVMTX.js +2 -0
- package/dist/chunks/auth-IP7AOWSF.js +6 -0
- package/dist/chunks/azCli-T67ZMIC3.js +2 -0
- package/dist/chunks/batch-GCXLGQET.js +4 -0
- package/dist/chunks/build-XDCWMEEL.js +4 -0
- package/dist/chunks/bulk-5QO343HO.js +2 -0
- package/dist/chunks/chunk-3C3GSN3J.js +2 -0
- package/dist/chunks/chunk-4S5ETLH4.js +2 -0
- package/dist/chunks/chunk-5KZDCOFA.js +8 -0
- package/dist/chunks/chunk-5SBBTR3Y.js +2 -0
- package/dist/chunks/chunk-5UOZCXQF.js +5 -0
- package/dist/chunks/chunk-BALEFXOL.js +29 -0
- package/dist/chunks/chunk-BWZ6HZXM.js +2 -0
- package/dist/chunks/chunk-C42MGXRN.js +2 -0
- package/dist/chunks/chunk-GE3XBV3K.js +2 -0
- package/dist/chunks/chunk-GT52BRS2.js +194 -0
- package/dist/chunks/chunk-HLE2WURE.js +2 -0
- package/dist/chunks/chunk-J4R6QXW7.js +2 -0
- package/dist/chunks/chunk-J777TCSE.js +4 -0
- package/dist/chunks/chunk-JAGU2NM5.js +2 -0
- package/dist/chunks/chunk-JEAIFLEN.js +51 -0
- package/dist/chunks/chunk-JGLUQBCK.js +2 -0
- package/dist/chunks/chunk-MME53RWW.js +4 -0
- package/dist/chunks/chunk-MTF66YXU.js +2 -0
- package/dist/chunks/chunk-NNHEYYF5.js +2 -0
- package/dist/chunks/chunk-OP6EXLWQ.js +5 -0
- package/dist/chunks/chunk-PDFXH652.js +2 -0
- package/dist/chunks/chunk-QE4DELWW.js +2 -0
- package/dist/chunks/chunk-QMTPHZLQ.js +2 -0
- package/dist/chunks/chunk-RHQP7X6H.js +3 -0
- package/dist/chunks/chunk-S4KF5Z3S.js +10 -0
- package/dist/chunks/chunk-TQLZ3TRU.js +2 -0
- package/dist/chunks/chunk-TZSB4PR7.js +4 -0
- package/dist/chunks/chunk-UCTMKA2J.js +4 -0
- package/dist/chunks/chunk-UKKSN4F7.js +3 -0
- package/dist/chunks/chunk-UWFDJKOJ.js +2 -0
- package/dist/chunks/chunk-UYDBLVAM.js +2 -0
- package/dist/chunks/chunk-WIA546AL.js +13 -0
- package/dist/chunks/chunk-WXCLWAE2.js +2 -0
- package/dist/chunks/chunk-WXOTXJNG.js +3 -0
- package/dist/chunks/chunk-X7VWUI6N.js +2 -0
- package/dist/chunks/chunk-XL7E7LX5.js +3 -0
- package/dist/chunks/chunk-ZHHVG47C.js +2 -0
- package/dist/chunks/chunk-ZNJ4DRCA.js +2 -0
- package/dist/chunks/chunk-ZUXLC5VX.js +2 -0
- package/dist/chunks/commands-GHYN6GZT.js +2 -0
- package/dist/chunks/component-PAASRIK6.js +2 -0
- package/dist/chunks/components-LRHXR5HR.js +2 -0
- package/dist/chunks/config-JN3I5EII.js +2 -0
- package/dist/chunks/connection-IWFELK5W.js +2 -0
- package/dist/chunks/connref-ZDY7JYK5.js +2 -0
- package/dist/chunks/customizations-IE2KO275.js +7 -0
- package/dist/chunks/dependency-EFDSIKSN.js +3 -0
- package/dist/chunks/discovery-XXVLVHD6.js +2 -0
- package/dist/chunks/dist-ILNYGTM2.js +136 -0
- package/dist/chunks/dv-3OESFBNW.js +192 -0
- package/dist/chunks/env-MZPI3UA2.js +5 -0
- package/dist/chunks/environment-NUQHU74A.js +2 -0
- package/dist/chunks/environments-WMBLSAQF.js +2 -0
- package/dist/chunks/envvar-YN35IDWJ.js +2 -0
- package/dist/chunks/esm-Z4QMBGAD.js +2 -0
- package/dist/chunks/fanout-DUP5CD5X.js +2 -0
- package/dist/chunks/fetchxml-ONTNTA6Z.js +6 -0
- package/dist/chunks/functions-K5TYRB2C.js +2 -0
- package/dist/chunks/graph-JI23YQB5.js +5 -0
- package/dist/chunks/group-DKEPSVRV.js +6 -0
- package/dist/chunks/history-SNSJRV6B.js +2 -0
- package/dist/chunks/identity-OW4WCDOA.js +2 -0
- package/dist/chunks/jobs-PXNJFWWF.js +2 -0
- package/dist/chunks/lifecycle-7RMWV26J.js +2 -0
- package/dist/chunks/main-ZVIKC3VA.js +4 -0
- package/dist/chunks/metadata-74WGGOV5.js +2 -0
- package/dist/chunks/metadataCreate-W3NDI5FB.js +2 -0
- package/dist/chunks/msalUser-JRNX5HPO.js +2 -0
- package/dist/chunks/names-SFYZQY6Q.js +2 -0
- package/dist/chunks/pack-2UDE25IY.js +2 -0
- package/dist/chunks/pipelines-O3OYNCHT.js +4 -0
- package/dist/chunks/plan-ALLKT2QZ.js +2 -0
- package/dist/chunks/plugins-EUDJ7QIS.js +4 -0
- package/dist/chunks/policies-KVPQVUHS.js +2 -0
- package/dist/chunks/pools-7H2L4QJC.js +2 -0
- package/dist/chunks/process-G7LCTGKS.js +2 -0
- package/dist/chunks/project-HSZLY2AY.js +2 -0
- package/dist/chunks/projects-BHG2B4IX.js +4 -0
- package/dist/chunks/protect-WZO3MAHF.js +2 -0
- package/dist/chunks/provider-VXRAQRN2.js +2 -0
- package/dist/chunks/prs-NOXIZ7AT.js +2 -0
- package/dist/chunks/records-TN7ZKUJ7.js +2 -0
- package/dist/chunks/run-BXFENCN6.js +2 -0
- package/dist/chunks/run-F6H4QCWR.js +2 -0
- package/dist/chunks/run-HBQCSGYY.js +3 -0
- package/dist/chunks/run-JYU5BTWN.js +2 -0
- package/dist/chunks/run-MGLIIM7Z.js +3 -0
- package/dist/chunks/run-MHM3GTGH.js +2 -0
- package/dist/chunks/run-SRQPP6N3.js +3 -0
- package/dist/chunks/run-ZNDSC7LR.js +2 -0
- package/dist/chunks/runtime-VOF7XYXW.js +2 -0
- package/dist/chunks/security-FLEAZ4EA.js +2 -0
- package/dist/chunks/service-4PIAYFYF.js +2 -0
- package/dist/chunks/service-V2TQEEID.js +2 -0
- package/dist/chunks/services-B6V4VVX5.js +2 -0
- package/dist/chunks/skills-GD6Z6P3R.js +2 -0
- package/dist/chunks/solution-HF57MP27.js +2 -0
- package/dist/chunks/solutionExport-TLGHMUM5.js +2 -0
- package/dist/chunks/solutionfiles-P223QW2J.js +2 -0
- package/dist/chunks/spn-AIUWML5R.js +2 -0
- package/dist/chunks/tokenCache-3LMJRUTI.js +2 -0
- package/dist/chunks/unpack-XZLTBUGC.js +2 -0
- package/dist/chunks/users-KFAPPGF4.js +2 -0
- package/dist/chunks/vargroups-33EZAHGZ.js +2 -0
- package/dist/chunks/whoami-ULK5UMZV.js +2 -0
- package/dist/chunks/workitems-YGES6KKN.js +2 -0
- package/dist/chunks/xmldoc-B2HUNTVK.js +2 -0
- package/package.json +55 -4
- package/schema/ppdo-cli.schema.json +120 -0
- package/skills/README.md +12 -0
- package/skills/ppdo-cli/SKILL.md +84 -0
- package/skills/ppdo-cli-dataverse/SKILL.md +302 -0
- package/skills/ppdo-cli-devops/SKILL.md +150 -0
|
@@ -0,0 +1,192 @@
|
|
|
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
|
|
3
|
+
|
|
4
|
+
--body is one JSON object per line (or a JSON array). With --key the rows are matched on
|
|
5
|
+
those columns (an alternate key on the table); without it each row needs the table's
|
|
6
|
+
id column. Rows go in $batch requests of up to 1000. Exits 1 if any row failed.`}).argument("<entityset>").requiredOption("--body <@rows.ndjson|->").option("--key <a,b>","alternate key columns").option("--continue-on-error","keep going after a failed row");g(n),n.handler(async a=>(await e()).upsert(a)),t(o,"associate","W","link two records",{description:`link two records
|
|
7
|
+
|
|
8
|
+
<navigation> is the navigation property on <entityset> (a lookup's or a
|
|
9
|
+
relationship's); <target> is a record reference such as contacts(<id>) or contacts(key=value).`}).argument("<entityset>").argument("<id>","id or alternate key (name=value)").argument("<navigation>").argument("<target>","e.g. contacts(<id>)").handler(async a=>(await e()).associate(a)),t(o,"disassociate","D","unlink two records",{description:`unlink two records
|
|
10
|
+
|
|
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
|
+
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
|
|
14
|
+
|
|
15
|
+
`+x+`
|
|
16
|
+
|
|
17
|
+
The top layer wins. 'Active' is the unmanaged layer; --values adds what each layer sets.`})).option("--values","include the value each layer sets for each property").handler(async i=>(await n()).layers(i));let a=b(t(e,"dependencies","R","what a component requires, what depends on it, or what blocks deleting it",{description:`what a component requires, what depends on it, or what blocks deleting it
|
|
18
|
+
|
|
19
|
+
`+x})).option("--dependents","what depends on the component").option("--blocking-delete","what stops the component being deleted");r(a),a.handler(async i=>(await n()).dependencies(i)),b(t(e,"customizable","R","whether a component can be customised",{description:`whether a component can be customised
|
|
20
|
+
|
|
21
|
+
`+x})).handler(async i=>(await n()).customizable(i)),b(t(e,"unpublished","R","whether a component has unpublished changes, and which properties",{description:`whether a component has unpublished changes, and which properties
|
|
22
|
+
|
|
23
|
+
For forms, views, web resources and apps. --show includes the draft values.`})).option("--show","include the unpublished values of the changed properties").handler(async i=>(await n()).unpublished(i)),t(e,"names","R","names for many components, with the material for their keys",{description:`names for many components, with the material for their keys
|
|
24
|
+
|
|
25
|
+
<type> <component> names one; --file names every component in an NDJSON file (or - for
|
|
26
|
+
stdin): lines of {"type", "id", "parent_id"}, solutioncomponents rows, or dv dependency
|
|
27
|
+
list rows (both sides). .gz files are read as gzip.
|
|
28
|
+
Each component gets name_status resolved, not-found or type-unsupported, its name,
|
|
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
|
|
31
|
+
|
|
32
|
+
RemoveActiveCustomization. Unmanaged changes to the component are lost.
|
|
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
|
+
|
|
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
|
|
37
|
+
|
|
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
|
|
40
|
+
|
|
41
|
+
Empty shows the table's primary name column. --copy takes another view's XML; the
|
|
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
|
|
43
|
+
|
|
44
|
+
The XML is checked first: well-formed, layout columns that are in the query,
|
|
45
|
+
and a query that runs.`}),"view").option("--name <name>").option("--description <description>").option("--fetchxml <@file>").option("--layoutxml <@file>").option("--no-publish","leave the change unpublished").handler(async s=>(await e()).viewUpdate(s));let a=p(o,"form","forms, edited as form XML files");A(t(a,"list","R","a table's forms").argument("<table>","table logical name").addOption(c("--type <type>",void 0,fe))).handler(async s=>(await e()).formList(s)),k(t(a,"get","R","a form's tabs, sections and fields; --save writes its form XML to edit"),"form").option("--save <file>").handler(async s=>(await e()).formGet(s)),j(t(a,"create","W","create a form (empty, or a copy), then publish",{description:`create a form (empty, or a copy), then publish
|
|
46
|
+
|
|
47
|
+
Empty is one tab with one section holding the primary name column. --copy copies another
|
|
48
|
+
form's XML (and its type, unless --type).`}).argument("<table>","table logical name").requiredOption("--name <name>").addOption(c("--type <type>","default main, or the copied form's type",ye)).option("--copy <form>","form to copy (id or name)").option("--description <description>")).handler(async s=>(await e()).formCreate(s)),k(t(a,"update","W","change a form's details or state, or replace its form XML, then publish",{description:`change a form's details or state, or replace its form XML, then publish
|
|
49
|
+
|
|
50
|
+
The form XML is checked first: well-formed, a <form> root, unique control ids,
|
|
51
|
+
and bound fields that exist on the table. Only main forms can be made inactive.`}),"form").option("--name <name>").option("--description <description>").addOption(c("--state <state>",void 0,["active","inactive"])).option("--body <@form.xml>").option("--no-publish","leave the change unpublished").handler(async s=>(await e()).formUpdate(s));let i=p(o,"webresource","web resources");A(t(i,"list","R","web resources (hidden system ones only with --hidden)").option("--solution <name>[,<name>...]").option("--name <pattern>","name; * is a wildcard").addOption(c("--type <type>",void 0,Z)).option("--hidden","include hidden (system) web resources")).handler(async s=>(await e()).wrList(s)),t(i,"get","R","a web resource and its content (the draft, if there is one)",{description:`a web resource and its content (the draft, if there is one)
|
|
52
|
+
|
|
53
|
+
Text content is shown inline; --save writes the file (needed for images).`}).argument("<name>","name or id").option("--save <file>").handler(async s=>(await e()).wrGet(s)),j(t(i,"push","W","create or update a web resource from a file, then publish it",{description:`create or update a web resource from a file, then publish it
|
|
54
|
+
|
|
55
|
+
The type comes from the file extension unless --type. An unchanged file is
|
|
56
|
+
skipped. The name needs a publisher prefix, e.g. contoso_/scripts/app.js.`}).argument("<file>").requiredOption("--name <prefix_/path>").option("--display-name <display_name>").option("--description <description>").addOption(c("--type <type>",void 0,Z))).handler(async s=>(await e()).wrPush(s))}var P={};h(P,{add:()=>we});function ee(o,e){let n=new l(`${o} <values...>`,e);return Object.assign(n,{flags:`${o} <type> <component>`}),n}function we(o){let e=p(o,"dependency","the dependencies table: what requires what"),n=t(e,"list","R","dependency rows for solutions or one component, read from the dependencies table",{description:`dependency rows for solutions or one component, read from the dependencies table
|
|
57
|
+
|
|
58
|
+
--solution: rows where either side is a component of the solutions. A table included
|
|
59
|
+
with all its subcomponents counts with its columns, keys, relationships, local choices,
|
|
60
|
+
forms and views. A managed solution also brings the rows whose base solution it is.
|
|
61
|
+
Each row's found_by says how it was found: membership, base-solution or component.
|
|
62
|
+
--required <type> <component>: rows where it is the required component (what depends on it).
|
|
63
|
+
--dependent <type> <component>: rows where it is the dependent component (what it requires).
|
|
64
|
+
<type> and <component> as for dv solution add-component.
|
|
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
|
|
67
|
+
|
|
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
|
+
|
|
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)
|
|
72
|
+
|
|
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.
|
|
75
|
+
Use --string NAME to force a value to be text.
|
|
76
|
+
Examples:
|
|
77
|
+
ppdo-cli dv fn RetrieveTotalRecordCount --param 'EntityNames=["account"]'
|
|
78
|
+
ppdo-cli dv fn RetrieveMissingDependencies --param SolutionUniqueName=MySolution
|
|
79
|
+
ppdo-cli dv fn RetrievePrincipalAccess --bound systemusers/<id> --param 'Target={"@odata.id":"accounts(<id>)"}'`}).argument("<name>","function name, e.g. WhoAmI or RetrieveVersion").option("--bound <<entityset>/<key>>","call bound to a row").option("--param <k=v>","parameter (repeatable)",y).option("--string <NAME>","treat this parameter as text",y).handler(async a=>(await e()).fn(a));let n=t(o,"action","W","call an action (POST)",{description:`Examples:
|
|
80
|
+
ppdo-cli dv action PublishAllXml
|
|
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
|
+
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
|
|
85
|
+
|
|
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
|
+
|
|
88
|
+
The version must keep the parent's major.minor and be higher; by default the next build
|
|
89
|
+
number after the parent and its existing patches (1.2.3.0 -> 1.2.4.0).`}).argument("<parent>","parent solution unique name").option("--version <x.y.z.w>").option("--display-name <text>","default: '<parent display name> patch'").handler(async n=>(await e()).patch(n)),t(o,"add-component","W","add a component to an unmanaged solution",{description:`add a component to an unmanaged solution
|
|
90
|
+
|
|
91
|
+
<type>: table, column (<table>.<column>), choice, relationship, role, view, form, process,
|
|
92
|
+
webresource, sitemap, app, assembly, step, canvas-app, envvar, connref, email-template, or a
|
|
93
|
+
component type number. <component> is an id, or a name for every type except view, form,
|
|
94
|
+
relationship and email-template.
|
|
95
|
+
|
|
96
|
+
A table goes in with all its subcomponents unless one of these is given:
|
|
97
|
+
--shell include as shell only: no table metadata, no columns, forms or views
|
|
98
|
+
--no-subcomponents the table's metadata without its columns, forms and views
|
|
99
|
+
Adding a table that's already in the solution changes how it's included, except a table with
|
|
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
|
+
|
|
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
|
|
104
|
+
|
|
105
|
+
<name> is the schema name with the publisher prefix, e.g. new_Project. The primary name column
|
|
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
|
+
|
|
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
|
|
110
|
+
|
|
111
|
+
The hash is of the registered DLL's bytes, so --compare tells whether a local build is the
|
|
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
|
+
|
|
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
|
|
115
|
+
|
|
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
|
+
|
|
118
|
+
Each process is tried once more after the others (a parent flow needs its child flows
|
|
119
|
+
on first). Prints one result per process; exits 1 if any failed.`}).argument("[process...]","process id or name")).handler(async v=>(await e())[m](v));let s=t(n,"runs","R","recent runs of a cloud flow, newest first, with the error for failures",{description:`recent runs of a cloud flow, newest first, with the error for failures
|
|
120
|
+
|
|
121
|
+
<flow> is an id, a name, or a pasted make.powerautomate.com flow URL. Runs come from
|
|
122
|
+
the flowrun table, which Dataverse fills a few minutes after a run and keeps for 28 days
|
|
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
|
+
|
|
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 '$'.
|
|
127
|
+
Examples:
|
|
128
|
+
ppdo-cli dv query accounts --select name,accountnumber --filter "statecode eq 0" --top 10
|
|
129
|
+
ppdo-cli dv query contacts --filter "lastname eq 'O''Brien'" --formatted
|
|
130
|
+
ppdo-cli dv query accounts --fetchxml @query.xml --all -o ndjson`}).argument("<entityset>","entity set name (plural), e.g. accounts").option("--select <a,b>","columns").option("--filter <expr>","OData $filter expression").option("--expand <expr>","OData $expand expression").option("--orderby <expr>","OData $orderby expression").addOption(new l("--top <n>","server-side $top").argParser(f)).option("--apply <expr>","OData $apply (aggregation)").option("--count","include the total count ($count=true)").option("--fetchxml <@file|->","FetchXML query instead of OData options").option("--formatted","include formatted values (labels, currency)");r(n),n.handler(async d=>(await e()).query(d)),t(o,"get","R","get one row by ID or alternate key",{description:`Key: a GUID, or name=value[,name2=value2] for alternate keys (text is quoted for you;
|
|
131
|
+
use name:=123 for a number).`}).argument("<entityset>").argument("<key>").option("--select <a,b>").option("--expand <expr>").option("--formatted").handler(async d=>(await e()).get(d));let a=t(o,"create","W","create a row").argument("<entityset>");w(a,!0),a.option("--return","return the created row").option("--select <a,b>","columns to return with --return"),g(a),a.handler(async d=>(await e()).create(d));let i=t(o,"update","W","update a row (fails if it doesn't exist, unless --upsert)").argument("<entityset>").argument("<key>");w(i,!0),i.option("--if-match <etag>","only update if the row's ETag matches").option("--upsert","create the row if it doesn't exist").option("--return","return the updated row"),g(i),i.handler(async d=>(await e()).update(d));let s=t(o,"delete","D","delete a row").argument("<entityset>").argument("<key>").option("--if-match <etag>","only delete if the row's ETag matches");g(s),s.handler(async d=>(await e()).remove(d));let m=t(o,"batch","M","send many requests as $batch (chunks of up to 1000)",{description:`Input: one JSON request per line (NDJSON), from --file or stdin:
|
|
132
|
+
{"method": "POST", "path": "accounts", "body": {"name": "A"}}
|
|
133
|
+
{"method": "GET", "path": "accounts?$select=name&$top=1"}
|
|
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
|
|
136
|
+
|
|
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
|
+
|
|
139
|
+
--table gives the role's access to one table, verb by verb (Create, Read, Write, Delete,
|
|
140
|
+
Append, AppendTo, Assign, Share). Without it the privileges are listed, capped by --limit.`}).argument("<role>","role id or name").option("--table <logical name>"),r(a),a.handler(async d=>(await e()).roleGet(d));let s=p(o,"user","users");t(s,"get","R","a user's business unit, teams and roles (direct and through teams)").argument("<user>","me, a user id, or a sign-in name (UPN)").handler(async d=>(await e()).userGet(d)),a=t(s,"privileges","R","every privilege a user has through their roles and teams",{description:`every privilege a user has through their roles and teams
|
|
141
|
+
|
|
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
|
+
|
|
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)
|
|
146
|
+
|
|
147
|
+
--both exports it unmanaged to <file.zip> and managed to <file>_managed.zip. --unpack unpacks
|
|
148
|
+
it into a source folder in pac's layout (as dv solution unpack does; no pac needed); without
|
|
149
|
+
--save the zips are temporary. For a folder made before, dv solution sync is shorter.`}).argument("<uniquename>").option("--managed","export as managed").option("--both","export unmanaged and managed").option("--save <file.zip>","where to write the zip (required without --unpack)").option("--unpack <folder>","unpack into this source folder").option("--allow-delete","with --unpack: delete files for components no longer in the solution").handler(async s=>(await e()).exportCmd(s)),t(o,"import","W","import a solution .zip (async)",{description:`Stages the file first and stops on missing dependencies, then starts the import and prints
|
|
150
|
+
the job id. --async polls the job until it finishes. --settings applies a
|
|
151
|
+
deployment-settings JSON (EnvironmentVariables, ConnectionReferences, Workflows) to the staged
|
|
152
|
+
components. With no file, a folder holding one .cdsproj imports its newest .zip.
|
|
153
|
+
|
|
154
|
+
Without --holding or --upgrade an import of a newer managed version is an update: components
|
|
155
|
+
it no longer has stay. --upgrade (StageAndUpgradeAsync) deletes them, with their data;
|
|
156
|
+
--holding stages the upgrade for dv solution promote.
|
|
157
|
+
|
|
158
|
+
On a new install workflows and flows arrive on or off as the file has them, and plug-in steps
|
|
159
|
+
arrive off; on an update or upgrade all of them stay as they were. Each --activate option turns
|
|
160
|
+
on one kind after the import and leaves the others alone.`}).argument("[file.zip]").argKey("file.zip","file").option("--path <file.zip>","the file, as an option").option("--settings <@settings.json>","deployment settings to apply").option("--overwrite-unmanaged","overwrite unmanaged customizations").option("--activate-plugins","after the import, turn on its plug-in steps").option("--activate-workflows","after the import, turn on its workflows, business rules, actions and process flows").option("--activate-flows","after the import, turn on its cloud flows; Workflows in --settings names who for each").option("--publish-changes","publish all customizations after the import").option("--skip-dependency-check","don't enforce dependencies flagged as product updates, and don't stop at staging").option("--skip-lower-version","do nothing if the same or a newer version is installed").option("--holding","import as a holding solution (stage for upgrade)").option("--upgrade","upgrade in one step, deleting components the new version no longer has").option("--async","poll the job until it finishes").handler(async s=>(await e()).importCmd(s)),t(o,"import-results","R","why an import failed: the per-component results of an import job",{description:`<target> is an import job id (import_job_id from dv solution import) or a solution
|
|
161
|
+
unique name, which picks that solution's latest import. Returns the failed components
|
|
162
|
+
with their error text; --components adds every component that was processed.`}).argument("<importjob|solution>").argKey("importjob|solution","target").option("--components","include every component, not just failures").handler(async s=>(await e()).importResults(s));let i=t(o,"history","R","past imports, upgrades, exports and uninstalls, newest first").argument("[uniquename]","only this solution").addOption(c("--state <failed|succeeded>",void 0,["failed","succeeded"])).addOption(c("--operation <"+ae.join("|")+">","only this kind of operation",ae)).option("--since <when>","30m, 12h, 7d, 2w or a date");r(i),i.handler(async s=>(await e()).history(s)),t(o,"publish","W","publish customizations").option("--all","publish all customizations").option("--entity <logical name>","publish one table (repeatable)",y).handler(async s=>(await e()).publish(s))}function se(o){for(let e of[F,R,W,U])e.add(o)}function re(o){ie(o),M(o)}function pe(o){for(let e of[N,C,P,S,L,T,X,_,D,$,E,H,z])e.add(o)}var O=["unmanaged","managed","both"];function zt(o){let e=p(o,"dv","Dataverse",["dataverse"]);t(e,"api","M","any Web API request (auth, retries, paging and errors handled)").addHelpText("after",`
|
|
163
|
+
Paths are relative to <url>/api/data/v9.2/ ('/'-prefixed paths are relative to the host).
|
|
164
|
+
Examples:
|
|
165
|
+
ppdo-cli dv api GET WhoAmI
|
|
166
|
+
ppdo-cli dv api GET accounts --param '$select=name' --param '$top=5'
|
|
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",`
|
|
169
|
+
The layout and the bytes match \`pac solution unpack\`. Only files whose content changed are
|
|
170
|
+
written. Files of components no longer in the solution are listed as stale; --allow-delete
|
|
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",`
|
|
173
|
+
The zip holds what \`pac solution pack\` puts in it, with fixed timestamps, so packing the same
|
|
174
|
+
folder twice gives the same bytes. A folder unpacked as both packs as unmanaged by default;
|
|
175
|
+
--package-type both writes <file.zip> and <file>_managed.zip.
|
|
176
|
+
|
|
177
|
+
A .cdsproj folder packs its source the way \`dotnet build\` does: the referenced PCF and plug-in
|
|
178
|
+
projects are built first (with dotnet; --no-build uses their last build), and their output
|
|
179
|
+
goes into the zip. The package type then follows the project (SolutionPackageType, else
|
|
180
|
+
managed for --configuration Release), and its SolutionPackageMapFilePath is the default --map.
|
|
181
|
+
|
|
182
|
+
--map takes files from where a SolutionPackager mapping file points. --remap-plugins gives the
|
|
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",`
|
|
185
|
+
Writes <folder>/<uniquename>.cdsproj, .gitignore and the unpacked solution in
|
|
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",`
|
|
188
|
+
<folder> (default .) is an unpacked solution or a .cdsproj project; the solution is the
|
|
189
|
+
one in its Other/Solution.xml. The package type defaults to both, as in pac. Only
|
|
190
|
+
changed files are written; files of removed components are deleted (--keep-stale keeps
|
|
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};
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
|
3
|
+
|
|
4
|
+
Keeps its URL or project, group and default. A ${r} pin that names it isn't changed:
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-QMTPHZLQ.js";import"./chunk-ZHHVG47C.js";export{k as AsyncCompress,A as AsyncDecompress,c as AsyncDeflate,o as AsyncGunzip,k as AsyncGzip,g as AsyncInflate,P as AsyncUnzipInflate,w as AsyncUnzlib,J as AsyncZipDeflate,s as AsyncZlib,j as Compress,D as DecodeUTF8,z as Decompress,b as Deflate,E as EncodeUTF8,a as FlateErrorCode,n as Gunzip,j as Gzip,f as Inflate,Q as Unzip,O as UnzipInflate,N as UnzipPassThrough,v as Unzlib,K as Zip,I as ZipDeflate,H as ZipPassThrough,r as Zlib,l as compress,m as compressSync,B as decompress,C as decompressSync,d as deflate,e as deflateSync,p as gunzip,q as gunzipSync,l as gzip,m as gzipSync,h as inflate,i as inflateSync,G as strFromU8,F as strToU8,R as unzip,S as unzipSync,x as unzlib,y as unzlibSync,L as zip,M as zipSync,t as zlib,u as zlibSync};
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1,6 @@
|
|
|
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,`
|
|
3
|
+
`),n=e.length,t=0,A=i=>{let c=e.slice(0,i),l=c.split(`
|
|
4
|
+
`).length,a=i-(c.lastIndexOf(`
|
|
5
|
+
`)+1);return`line ${l}, column ${a}`},o=(i,c)=>{throw new M(`${i}: ${A(c)}`)},f=i=>i===" "||i===" "||i===`
|
|
6
|
+
`,R=(i,c)=>{let l="",a=0;for(;;){let g=i.indexOf("&",a);if(g<0)return l+i.slice(a);l+=i.slice(a,g);let d=i.indexOf(";",g+1);d<0&&o("not well-formed (invalid token)",c+g);let r=i.slice(g+1,d);if(r.startsWith("#")){let h=r[1]==="x",k=h?r.slice(2):r.slice(1),w=h?/^[0-9A-Fa-f]+$/.test(k):/^[0-9]+$/.test(k),m=w?parseInt(k,h?16:10):NaN;(!w||!(m===9||m===10||m===13||m>=32&&m<=1114111))&&o("reference to invalid character number",c+g),l+=String.fromCodePoint(m)}else r in z?l+=z[r]:/^[A-Za-z_][A-Za-z0-9_.:-]*$/.test(r)?o("undefined entity",c+g):o("not well-formed (invalid token)",c+g);a=d+1}},b=()=>{let i=t;for(V.test(e[t]??"")||o(t>=n?"unclosed token":"not well-formed (invalid token)",t),t++;t<n&&J.test(e[t]);)t++;return e.slice(i,t)},u=[],p=null,x=i=>{let c=u[u.length-1];if(!c||!i)return;let l=c.kids[c.kids.length-1];typeof l=="string"?c.kids[c.kids.length-1]=l+i:c.kids.push(i)};for(;t<n;){let i=e.indexOf("<",t),c=i<0?n:i;if(c>t){let r=e.slice(t,c);if(u.length)r.includes("]]>")&&o("not well-formed (invalid token)",t+r.indexOf("]]>")),x(R(r,t));else{let h=r.search(/[^ \t\n]/);h>=0&&o(p?"junk after document element":"syntax error",t+h)}t=c;continue}let l=t;if(e.startsWith("<!--",t)){let r=e.indexOf("-->",t+4);r<0&&o("unclosed token",l),t=r+3;continue}if(e.startsWith("<![CDATA[",t)){u.length||o(p?"junk after document element":"not well-formed (invalid token)",l);let r=e.indexOf("]]>",t+9);r<0&&o("unclosed CDATA section",l),x(e.slice(t+9,r)),t=r+3;continue}if(e.startsWith("<?",t)){let r=e.indexOf("?>",t+2);r<0&&o("unclosed token",l),t=r+2;continue}if(e.startsWith("<!",t)&&o("not well-formed (invalid token)",l),e.startsWith("</",t)){t+=2;let r=t,h=b();for(;f(e[t]);)t++;t>=n&&o("unclosed token",l),e[t]!==">"&&o("not well-formed (invalid token)",t);let k=u[u.length-1];(!k||k.tag!==h)&&o("mismatched tag",r),u.pop(),t++;continue}p&&!u.length&&o("junk after document element",l),t++;let a={tag:b(),attrs:[],kids:[]},g=!1;for(;;){let r=f(e[t]);for(;f(e[t]);)t++;if(t>=n&&o("unclosed token",l),e[t]===">"){t++;break}if(e.startsWith("/>",t)){t+=2,g=!0;break}r||o("not well-formed (invalid token)",t);let h=t,k=b();for(;f(e[t]);)t++;for(e[t]!=="="&&o(t>=n?"unclosed token":"not well-formed (invalid token)",t>=n?l:t),t++;f(e[t]);)t++;let w=e[t];w!=='"'&&w!=="'"&&o(t>=n?"unclosed token":"not well-formed (invalid token)",t>=n?l:t);let m=e.indexOf(w,t+1);m<0&&o("unclosed token",l);let q=e.slice(t+1,m),W=q.indexOf("<");W>=0&&o("not well-formed (invalid token)",t+1+W),a.attrs.some(([P])=>P===k)&&o("duplicate attribute",h),a.attrs.push([k,R(q.replace(/[\t\n]/g," "),t+1)]),t=m+1}let d=u[u.length-1];d?d.kids.push(a):p=a,g||u.push(a)}return(!p||u.length)&&o("no element found",n),p}function Q(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var Y={"&":"&","<":"<",">":">",'"':""","\r":" ","\n":" "," ":"	"};function tt(s){return s.replace(/[&<>"\r\n\t]/g,e=>Y[e])}function H(s){let e="<"+s.tag;for(let[n,t]of s.attrs)e+=` ${n}="${tt(t)}"`;if(!s.kids.length)return e+" />";e+=">";for(let n of s.kids)e+=typeof n=="string"?Q(n):H(n);return e+`</${s.tag}>`}function et(s){let e=j(s.toString("utf8")).trim();if(!e.toLowerCase().startsWith("<fetch"))throw new $("FetchXML must start with <fetch",{hint:"pass the query with --fetchxml @query.xml"});try{return Z(e)}catch(n){throw n instanceof M?new $(`FetchXML is not well-formed: ${n.message}`):n}}function nt(s){let e;try{e=Z(s)}catch{return[null,s]}let n=E(e,"pagingcookie");if(n===null)return[null,s];let t=E(e,"pagenumber");return[t&&/^[0-9]+$/.test(t)?parseInt(t,10):null,O(O(n))]}function N(s){let e=(s??"").trim();if(!/^[+-]?\d+$/.test(e))throw new C(`invalid literal for int() with base 10: '${s??""}'`);return parseInt(e,10)}async function at(s,e,n,t,A,o){let f=et(_(t));F(s,e,"GET",n,null);let b={Prefer:`odata.include-annotations="${"Microsoft.Dynamics.CRM.*"+(A?`,${X}`:"")}"`},u=E(f,"top")===null&&(E(f,"aggregate")??"").toLowerCase()!=="true";if(u){let l=Math.min(5e3,o?o+1:5e3),a=E(f,"count");y(f,"count",String(Math.min(a?N(a):l,l))),y(f,"page",E(f,"page")||"1")}let p=[],x=!1,i=null,c=0;for(;c<T;c++){let l=H(f),a=await e.request("GET",n+"?fetchXml="+I(l,""),{headers:b}),g=L(a);for(let m of B(g.value)){if(o!==null&&p.length>=o){x=!0;break}p.push(m)}if(x||!u)break;let d=S(g,K),r=S(g,U);if(!(r===null?v(d):v(r)))break;if(o!==null&&p.length>=o){x=!0;break}if(!v(d)||d===i)throw new C("FetchXML paging stalled (no new paging cookie); results would be incomplete",{service:"dataverse"});i=d;let[k,w]=nt(String(d));y(f,"page",String(k||N(E(f,"page"))+1)),y(f,"paging-cookie",w)}if(c>=T)throw new C(`FetchXML paging exceeded ${T} pages`,{service:"dataverse"});return x&&D(`showing the first ${o} rows; pass --limit n or --all for more`),p}export{K as COOKIE,T as MAX_PAGES,U as MORE,M as XmlParseError,nt as cookie,E as getAttr,Z as parseXml,at as run,y as setAttr,H as toXml};
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
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
|
+
|
|
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};
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
|
3
|
+
|
|
4
|
+
Uses the Global Discovery Service with the group's identity. 'added' names the ppdo-cli
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -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 r,r as n}from"./chunk-BALEFXOL.js";import{b as s}from"./chunk-OP6EXLWQ.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";function f(o){let t=r(o,"identity","manage identities (one account in one tenant)"),i=n(t,"add","L","add an identity").argument("<name>");c(i,!0),i.handler(async e=>(await import("./run-ZNDSC7LR.js")).add(e));let d=n(t,"update","L","change fields of an identity").argument("<name>");c(d,!1),d.handler(async e=>(await import("./run-ZNDSC7LR.js")).update(e)),n(t,"list","L","list identities").handler(async e=>(await import("./run-ZNDSC7LR.js")).list(e)),n(t,"show","L","show one identity and its cache files").argument("<name>").handler(async e=>(await import("./run-ZNDSC7LR.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-ZNDSC7LR.js")).remove(e))}function c(o,t){let i=new a("--tenant <id|domain>","Entra tenant ID or domain");t&&i.makeOptionMandatory(),o.addOption(i).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(s)).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")}export{f as register};
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
import{a as u,c as m,g as d,m as f,p as g,t as h,u as w,v}from"./chunk-BALEFXOL.js";import{a as c}from"./chunk-UYDBLVAM.js";import{a as i,b as p,k as l}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var E={identity:{load:()=>import("./identity-OW4WCDOA.js"),help:"manage identities (one account in one tenant)",aliases:[]},group:{load:()=>import("./group-DKEPSVRV.js"),help:"manage groups (the account and mode for a set of environments)",aliases:[]},env:{load:()=>import("./env-MZPI3UA2.js"),help:"manage environments (a Dataverse URL or a DevOps project, in a group)",aliases:[]},auth:{load:()=>import("./auth-IP7AOWSF.js"),help:"sign in, sign out, tokens",aliases:[]},whoami:{load:()=>import("./whoami-ULK5UMZV.js"),help:"show the resolved environments, modes and accounts",aliases:[]},commands:{load:()=>import("./commands-GHYN6GZT.js"),help:"list every command with its class",aliases:[]},dv:{load:()=>import("./dv-3OESFBNW.js"),help:"Dataverse",aliases:["dataverse"]},ado:{load:()=>import("./ado-NLCWVIVQ.js"),help:"Azure DevOps",aliases:["devops"]},graph:{load:()=>import("./graph-JI23YQB5.js"),help:"Microsoft Graph, read-only: Entra group lookups",aliases:[]},skills:{load:()=>import("./skills-GD6Z6P3R.js"),help:"install the bundled agent skills (Claude, Copilot)",aliases:[]}},y=new Map;for(let[o,n]of Object.entries(E))for(let e of n.aliases)y.set(e,o);function O(o){let n=!1;for(let e of o){if(n){n=!1;continue}if(e==="--")return null;if(e.startsWith("-")){d.has(e)&&(n=!0);continue}return y.get(e)??e}return null}async function b(o,n=!1){let e=O(o),r=new m("ppdo-cli").description("One CLI for Dataverse and Azure DevOps.");e===null&&r.version(`ppdo-cli ${c}`,"-V, --version"),r.addHelpText("after",`
|
|
3
|
+
Run 'ppdo-cli <command> --help' for details.`).configureHelp({showGlobalOptions:!0}).showHelpAfterError(!1).configureOutput({writeErr:()=>{},outputError:()=>{}}),f(r);for(let[t,s]of Object.entries(E))n||t===e?(await s.load()).register(r):r.command(t).aliases(s.aliases).description(s.help);return w(r),r}async function A(o){return C(o)}async function P(o){let n=await b(o);try{await n.parseAsync(o,{from:"user"})}catch(r){if(r instanceof u){let t=v(r);if(!t)return null;throw t}throw r}let e=g(n);if(!e)throw new p("the following arguments are required: <command>",{hint:"run: ppdo-cli --help"});return e}async function C(o){let n=o.includes("-v")||o.includes("--verbose");try{let e=await P(o);if(!e)return 0;if(e.args.quiet&&(process.env.PPDEVOPS_QUIET="1"),h(e))return await(await import("./fanout-DUP5CD5X.js")).run(e);let{Runtime:r}=await import("./runtime-VOF7XYXW.js"),t=await e.handler(new r(e.args));return typeof t=="number"?t:0}catch(e){if(e instanceof i)return e.exitCode===0?0:l(e);n&&e instanceof Error&&process.stderr.write((e.stack??String(e))+`
|
|
4
|
+
`);let r=e instanceof Error?e.name:"Error",t=e instanceof Error?e.message:String(e);return l(new i(`unexpected error: ${r}: ${t}`,{hint:"re-run with --verbose for a traceback"}))}}export{E as GROUPS,b as buildProgram,A as main,O as selectedGroup};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
import{C as N,D as g,E as A,L as p,P as M,a as h,e as w,m as b,n as S,o as t,p as _,q as d,r as R,t as E,w as L}from"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import{e as T}from"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var $={PicklistType:"PicklistAttributeMetadata",MultiSelectPicklistType:"MultiSelectPicklistAttributeMetadata",StateType:"StateAttributeMetadata",StatusType:"StatusAttributeMetadata",BooleanType:"BooleanAttributeMetadata"};function I(e){return h(e,"table logical name"),`EntityDefinitions(LogicalName=${w(e.toLowerCase())})`}function O(e){if(!b(e))return[];let n=e,m=[...d(n.Options)];for(let s of["TrueOption","FalseOption"])b(t(n,s))&&m.push(n[s]);return m.map(s=>({value:t(s,"Value"),label:p(t(s,"Label"))}))}function f(e){return t(_(e),"Value")}async function v(e){let n=e.args,m=await N(e),s=[["$select","LogicalName,EntitySetName,DisplayName,IsCustomEntity,IsManaged"]];n.customOnly&&s.push(["$filter","IsCustomEntity eq true"]);let r=await g(e,m,"GET","EntityDefinitions",{params:s}),a=[],y=M(n.search);for(let l of d(A(r).value)){let c={logical_name:t(l,"LogicalName"),entity_set:t(l,"EntitySetName"),display_name:p(t(l,"DisplayName")),custom:t(l,"IsCustomEntity"),managed:t(l,"IsManaged")};if(y){let u=y.toLowerCase();if(!(c.logical_name||"").toLowerCase().includes(u)&&!(c.display_name||"").toLowerCase().includes(u))continue}a.push(c)}a=E(a,l=>l.logical_name||"");let i=L(n);i!==null&&a.length>i&&(T(`showing the first ${i} of ${a.length} tables; pass --limit n, --all or --search`),a=a.slice(0,i)),await e.emit(a)}async function j(e){let n=e.args,m=await N(e),s=[];n.attributes&&s.push("Attributes($select=LogicalName,AttributeTypeName,DisplayName,RequiredLevel,IsCustomAttribute,AttributeOf,IsValidForCreate,IsValidForUpdate)"),n.relationships&&s.push("OneToManyRelationships($select=SchemaName,ReferencedEntity,ReferencingEntity,ReferencingAttribute)","ManyToOneRelationships($select=SchemaName,ReferencedEntity,ReferencingEntity,ReferencingAttribute)","ManyToManyRelationships($select=SchemaName,Entity1LogicalName,Entity2LogicalName,IntersectEntityName)"),n.keys&&s.push("Keys($select=LogicalName,KeyAttributes,EntityKeyIndexStatus)");let r=s.length?[["$expand",s.join(",")]]:null,y=(await g(e,m,"GET",I(String(n.entity)),{params:r})).json();if(n.raw){await e.emit(y);return}let i=_(y),l=t(i,"OwnershipType"),c={logical_name:t(i,"LogicalName"),schema_name:t(i,"SchemaName"),entity_set:t(i,"EntitySetName"),display_name:p(t(i,"DisplayName")),display_collection_name:p(t(i,"DisplayCollectionName")),description:p(t(i,"Description")),primary_id:t(i,"PrimaryIdAttribute"),primary_name:t(i,"PrimaryNameAttribute"),ownership:typeof l=="string"?l:f(l),custom:t(i,"IsCustomEntity"),managed:t(i,"IsManaged"),activity:t(i,"IsActivity"),object_type_code:t(i,"ObjectTypeCode"),metadata_id:t(i,"MetadataId")};if(n.attributes){let u=d(i.Attributes).filter(o=>!b(t(o,"AttributeOf")));c.attributes=E(u.map(o=>({name:t(o,"LogicalName"),type:f(t(o,"AttributeTypeName")),display_name:p(t(o,"DisplayName")),required:f(t(o,"RequiredLevel")),custom:t(o,"IsCustomAttribute")})),o=>o.name||"")}if(n.relationships){let u=o=>({schema_name:t(o,"SchemaName"),referenced:t(o,"ReferencedEntity"),referencing:t(o,"ReferencingEntity"),attribute:t(o,"ReferencingAttribute")});c.one_to_many=d(i.OneToManyRelationships).map(u),c.many_to_one=d(i.ManyToOneRelationships).map(u),c.many_to_many=d(i.ManyToManyRelationships).map(o=>({schema_name:t(o,"SchemaName"),entity1:t(o,"Entity1LogicalName"),entity2:t(o,"Entity2LogicalName"),intersect:t(o,"IntersectEntityName")}))}n.keys&&(c.keys=d(i.Keys).map(u=>({name:t(u,"LogicalName"),attributes:t(u,"KeyAttributes"),status:t(u,"EntityKeyIndexStatus")}))),await e.emit(R(c))}async function q(e){let n=e.args,m=String(n.attribute);h(m,"column logical name");let s=await N(e),r=`${I(String(n.entity))}/Attributes(LogicalName=${w(m.toLowerCase())})`,a=(await g(e,s,"GET",r)).json(),y=f(t(a,"AttributeTypeName")),i=y!==null?$[y]:void 0;if(i){let c=["StateType","StatusType","BooleanType"].includes(y)?"OptionSet":"OptionSet,GlobalOptionSet";a=(await g(e,s,"GET",`${r}/Microsoft.Dynamics.CRM.${i}`,{params:[["$expand",c]]})).json()}if(n.raw){await e.emit(a);return}let l={name:t(a,"LogicalName"),schema_name:t(a,"SchemaName"),type:y,display_name:p(t(a,"DisplayName")),description:p(t(a,"Description")),required:f(t(a,"RequiredLevel")),custom:t(a,"IsCustomAttribute"),managed:t(a,"IsManaged"),max_length:t(a,"MaxLength"),format:S(t(a,"Format"),f(t(a,"FormatName"))),targets:t(a,"Targets"),metadata_id:t(a,"MetadataId")};if(i){let c=_(S(t(a,"OptionSet"),t(a,"GlobalOptionSet")));l.global_optionset=b(t(c,"IsGlobal"))?t(c,"Name"):null,l.options=O(c)}await e.emit(R(l))}async function G(e){let n=e.args,m=String(n.name);h(m,"choice name");let s=await N(e),r=(await g(e,s,"GET",`GlobalOptionSetDefinitions(Name=${w(m)})`)).json();if(n.raw){await e.emit(r);return}let a=t(r,"OptionSetType");await e.emit({name:t(r,"Name"),display_name:p(t(r,"DisplayName")),type:typeof a=="string"?a:null,managed:t(r,"IsManaged"),options:O(r)})}export{q as attribute,j as get,v as list,G as optionset};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
import{C as D,D as b,E as N,F as S,P as c,a as T,f as x,m as E,n as $,o as y,p as B,q as v}from"./chunk-UKKSN4F7.js";import"./chunk-UCTMKA2J.js";import"./chunk-BALEFXOL.js";import"./chunk-J4R6QXW7.js";import{b as L}from"./chunk-5SBBTR3Y.js";import{e as k}from"./chunk-S4KF5Z3S.js";import{b as w}from"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";var A=Buffer.from("{}");function f(t,a){return{"@odata.type":"Microsoft.Dynamics.CRM.Label",LocalizedLabels:[{"@odata.type":"Microsoft.Dynamics.CRM.LocalizedLabel",Label:t||"",LanguageCode:a}]}}async function O(t,a){let e=await b(t,a,"GET","organizations",{params:[["$select","languagecode"]]}),n=N(e).value,o=E(n)?v(n)[0]:{};return $(y(o,"languagecode"),1033)}function C(t){if(!t.includes("_")||t.startsWith("_"))throw new w(`'${t}' has no publisher prefix`,{hint:"e.g. new_Project (prefix new)"});return t.split("_",1)[0].toLowerCase()}async function V(t,a,e){let{findPublisher:n}=await import("./lifecycle-7RMWV26J.js"),o;try{o=await n(t,a,e)}catch{throw new w(`no publisher has the prefix '${e}'`,{hint:"run: ppdo-cli dv publisher list"})}return parseInt(String($(y(o,"customizationoptionvalueprefix"),1e4)),10)*1e4}function I(t,a,e){let n=t.split(",").map(o=>x(o)).filter(o=>o);if(!n.length)throw new w("--options needs at least one option");return n.map((o,i)=>({Value:a+i,Label:f(o,e)}))}async function P(t,a,e){let{solutionHeaders:n}=await import("./customizations-IE2KO275.js");return n(t,a,e)}function R(t){return T(t,"table logical name"),`EntityDefinitions(LogicalName='${t.toLowerCase()}')`}async function Y(t){let a=t.args,e=String(a.name),n=C(e),o=c(a.solution),i=await D(t);L(t,i,"POST","EntityDefinitions",A);let[s,m]=await i.lookups(async()=>[await O(t,i),await P(t,i,o)]),p=String(a.displayName),d=c(a.primaryName)||`${n}_name`,u={"@odata.type":"Microsoft.Dynamics.CRM.EntityMetadata",SchemaName:e,DisplayName:f(p,s),DisplayCollectionName:f(c(a.plural)||p+"s",s),Description:f(c(a.description),s),OwnershipType:(c(a.ownership)??"user")==="user"?"UserOwned":"OrganizationOwned",HasActivities:!1,HasNotes:!1,IsActivity:!1,Attributes:[{"@odata.type":"Microsoft.Dynamics.CRM.StringAttributeMetadata",SchemaName:d,IsPrimaryName:!0,RequiredLevel:{Value:"ApplicationRequired"},MaxLength:100,FormatName:{Value:"Text"},DisplayName:f("Name",s)}]};await b(t,i,"POST","EntityDefinitions",{body:S(u),headers:m});let r=N(await b(t,i,"GET",R(e),{params:[["$select","LogicalName,SchemaName,EntitySetName,PrimaryIdAttribute,PrimaryNameAttribute,ObjectTypeCode"]]}));await t.emit({table:y(r,"LogicalName"),entity_set:y(r,"EntitySetName"),primary_id:y(r,"PrimaryIdAttribute"),primary_name:y(r,"PrimaryNameAttribute"),object_type_code:y(r,"ObjectTypeCode"),solution:o})}async function G(t,a,e,n){let o=c(e.type),i=String(e.name),s=String(e.table),m=c(e.choice),p=c(e.options),d=c(e.target),u=typeof e.maxLength=="number"?e.maxLength:null,r=typeof e.precision=="number"?e.precision:null,l={SchemaName:i,DisplayName:f(c(e.displayName),n),Description:f(c(e.description),n),RequiredLevel:{Value:e.required?"ApplicationRequired":"None"}};if(o!=="choice"&&(m||p))throw new w("--choice and --options are for choice columns");if(o!=="lookup"&&d)throw new w("--target is for lookup columns");if(o==="string")return["Attributes",{"@odata.type":"Microsoft.Dynamics.CRM.StringAttributeMetadata",...l,MaxLength:u||100,FormatName:{Value:"Text"}}];if(o==="memo")return["Attributes",{"@odata.type":"Microsoft.Dynamics.CRM.MemoAttributeMetadata",...l,MaxLength:u||2e3,Format:"TextArea"}];if(o==="int")return["Attributes",{"@odata.type":"Microsoft.Dynamics.CRM.IntegerAttributeMetadata",...l,Format:"None",MinValue:-2147483648,MaxValue:2147483647}];if(o==="decimal")return["Attributes",{"@odata.type":"Microsoft.Dynamics.CRM.DecimalAttributeMetadata",...l,Precision:r===null?2:r,MinValue:-1e11,MaxValue:1e11}];if(o==="money")return["Attributes",{"@odata.type":"Microsoft.Dynamics.CRM.MoneyAttributeMetadata",...l,Precision:r===null?2:r,PrecisionSource:0,MinValue:-922337203685477,MaxValue:922337203685477}];if(o==="bool")return["Attributes",{"@odata.type":"Microsoft.Dynamics.CRM.BooleanAttributeMetadata",...l,DefaultValue:!1,OptionSet:{"@odata.type":"Microsoft.Dynamics.CRM.BooleanOptionSetMetadata",TrueOption:{Value:1,Label:f("Yes",n)},FalseOption:{Value:0,Label:f("No",n)}}}];if(o==="datetime"){let M=!!e.dateOnly;return["Attributes",{"@odata.type":"Microsoft.Dynamics.CRM.DateTimeAttributeMetadata",...l,Format:M?"DateOnly":"DateAndTime",DateTimeBehavior:{Value:M?"DateOnly":"UserLocal"}}]}if(o==="choice"){if(!!m==!!p)throw new w("a choice column needs --choice <global choice> or --options a,b,c");let M={"@odata.type":"Microsoft.Dynamics.CRM.PicklistAttributeMetadata",...l};if(m){T(m,"choice name");let _=N(await b(t,a,"GET",`GlobalOptionSetDefinitions(Name='${m}')`,{params:[["$select","MetadataId"]]}));M["GlobalOptionSet@odata.bind"]=`/GlobalOptionSetDefinitions(${_.MetadataId})`}else M.OptionSet={"@odata.type":"Microsoft.Dynamics.CRM.OptionSetMetadata",IsGlobal:!1,OptionSetType:"Picklist",Options:I(p,await V(t,a,C(i)),n)};return["Attributes",M]}if(!d)throw new w("a lookup column needs --target <table>");let h=N(await b(t,a,"GET",R(d),{params:[["$select","LogicalName,PrimaryIdAttribute"]]})),g=i.slice(i.indexOf("_")+1).toLowerCase();return["RelationshipDefinitions",{"@odata.type":"Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata",SchemaName:`${C(i)}_${d.toLowerCase()}_${s.toLowerCase()}_${g}`,ReferencedEntity:h.LogicalName,ReferencedAttribute:h.PrimaryIdAttribute,ReferencingEntity:s.toLowerCase(),AssociatedMenuConfiguration:{Behavior:"UseCollectionName",Group:"Details",Order:1e4},CascadeConfiguration:{Assign:"NoCascade",Delete:"RemoveLink",Merge:"NoCascade",Reparent:"NoCascade",Share:"NoCascade",Unshare:"NoCascade"},Lookup:{"@odata.type":"Microsoft.Dynamics.CRM.LookupAttributeMetadata",...l}}]}async function W(t){let a=t.args,e=String(a.name),n=String(a.table),o=c(a.solution);C(e);let i=await D(t);L(t,i,"POST","EntityDefinitions",A);let[s,m,p]=await i.lookups(async()=>{let l=await O(t,i),[h,g]=await G(t,i,a,l);return[h,g,await P(t,i,o)]}),d=s==="RelationshipDefinitions"?"RelationshipDefinitions":`${R(n)}/Attributes`;await b(t,i,"POST",d,{body:S(m),headers:p});let u=N(await b(t,i,"GET",`${R(n)}/Attributes(LogicalName='${e.toLowerCase()}')`,{params:[["$select","LogicalName,SchemaName,AttributeType"]]})),r={table:n.toLowerCase(),column:y(u,"LogicalName"),type:y(u,"AttributeType")};s==="RelationshipDefinitions"&&(r.relationship=y(m,"SchemaName")),r.solution=o,await t.emit(r)}async function J(t){let a=t.args,e=String(a.name),n=C(e),o=c(a.solution),i=await D(t);L(t,i,"POST","GlobalOptionSetDefinitions",A);let[s,m,p]=await i.lookups(async()=>{let u=await O(t,i),r=I(String(a.options),await V(t,i,n),u);return[u,r,await P(t,i,o)]}),d={"@odata.type":"Microsoft.Dynamics.CRM.OptionSetMetadata",Name:e.toLowerCase(),DisplayName:f(c(a.displayName)||e,s),Description:f(c(a.description),s),IsGlobal:!0,OptionSetType:"Picklist",Options:m};await b(t,i,"POST","GlobalOptionSetDefinitions",{body:S(d),headers:p}),await t.emit({choice:e.toLowerCase(),options:m.map(u=>({value:u.Value,label:u.Label.LocalizedLabels[0].Label})),solution:o})}var j=t=>new Promise(a=>setTimeout(a,t));async function Q(t){let a=t.args,e=String(a.name),n=String(a.table),o=c(a.solution);C(e);let i=String(a.columns).split(",").map(g=>x(g).toLowerCase()).filter(g=>g),s=await D(t);L(t,s,"POST","EntityDefinitions",A);let[m,p]=await s.lookups(async()=>[await O(t,s),await P(t,s,o)]),d={"@odata.type":"Microsoft.Dynamics.CRM.EntityKeyMetadata",SchemaName:e,DisplayName:f(c(a.displayName)||e,m),KeyAttributes:i};await b(t,s,"POST",`${R(n)}/Keys`,{body:S(d),headers:p});let u=`${R(n)}/Keys(LogicalName='${e.toLowerCase()}')`,r=async()=>y(B((await b(t,s,"GET",u,{params:[["$select","EntityKeyIndexStatus"]]})).json()),"EntityKeyIndexStatus"),l=await r(),h=performance.now()+(t.timeout||600)*1e3;for(;a.wait&&(l==="Pending"||l==="InProgress")&&performance.now()<h;)k(`key ${e.toLowerCase()}: ${l}`),await j(1e4),l=await r();await t.emit({table:n.toLowerCase(),key:e.toLowerCase(),columns:i,status:l,solution:o})}export{J as choice,W as column,G as columnBody,Q as key,f as label,C as prefixOf,Y as table};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l}from"./chunk-GT52BRS2.js";import"./chunk-4S5ETLH4.js";import"./chunk-J4R6QXW7.js";import"./chunk-5SBBTR3Y.js";import"./chunk-UYDBLVAM.js";import"./chunk-3C3GSN3J.js";import"./chunk-RHQP7X6H.js";import"./chunk-TQLZ3TRU.js";import"./chunk-S4KF5Z3S.js";import"./chunk-WXOTXJNG.js";import"./chunk-ZHHVG47C.js";export{c as FAILED_PATH,e as LOGIN_TIMEOUT,i as Loopback,a as SIGN_IN_PATH,b as SUCCESS_PATH,f as USER_METHODS,k as acquire,j as login,l as logout,g as msalError,d as newSignInId,h as openUrl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-WXCLWAE2.js";import"./chunk-UWFDJKOJ.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{c as CHUNK,d as RECORDS,a as STATUSES,b as TYPE_NAMES,f as inputs,g as label,l as names,i as outRow,e as pyRepr,k as readLines,h as recordName,j as resolveNames};
|