@mohsinonxrm/pptb-dataverse-request-studio 1.5.0-beta.1 → 1.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +380 -0
- package/README.md +44 -18
- package/dist/assets/ActionParamForm-DvTh6hUs.js +1 -0
- package/dist/assets/AllOrNothingOption-C7wGq_-r.js +1 -0
- package/dist/assets/AssociateMode-Dj-iEObO.js +1 -0
- package/dist/assets/BatchMode-Dsa1JVpd.js +10 -0
- package/dist/assets/BinaryColumnPickers-NAaoPcPt.js +1 -0
- package/dist/assets/BinaryPipelineCard-CSklRaME.js +1 -0
- package/dist/assets/BulkDeleteMode-Cqpb47QI.js +1 -0
- package/dist/assets/BulkWriteMode-CRkiw89Q.js +6 -0
- package/dist/assets/CodeView-C65Y5vXN.js +874 -0
- package/dist/assets/CreateMode-CwGffdDR.js +1 -0
- package/dist/assets/DeleteMode-CaWEZkJ1.js +1 -0
- package/dist/assets/DisassociateMode-Ddk9Jm3g.js +2 -0
- package/dist/assets/ExecuteActionMode-BbN_9350.js +1 -0
- package/dist/assets/ExecuteFunctionMode-G3PFBDpl.js +1 -0
- package/dist/assets/ExecuteWorkflowMode-D2MxIt5s.js +1 -0
- package/dist/assets/FieldSetEditor-Dg6WsDgG.js +3 -0
- package/dist/assets/ImportCurlDialog-BiURYtjH.js +7 -0
- package/dist/assets/ManageAttachmentMode-D14EZog8.js +1 -0
- package/dist/assets/ManageFileMode-DMLRV2xg.js +1 -0
- package/dist/assets/ManageImageMode-CoSAt9yh.js +1 -0
- package/dist/assets/MergeMode-PfbLAjOh.js +1 -0
- package/dist/assets/OptionGroup-DYAAm_pt.js +1 -0
- package/dist/assets/PredefinedQueryMode-CdT1I6jB.js +1 -0
- package/dist/assets/RetrieveNextLinkMode-BK9KD3q6.js +1 -0
- package/dist/assets/RetrieveSingleMode-_y2Z1G7C.js +1 -0
- package/dist/assets/UpdateMode-Dvd6cr4i.js +1 -0
- package/dist/assets/UpsertMode-BuyV7FEg.js +1 -0
- package/dist/assets/WriteResultCard-N_Ewu4dP.js +1 -0
- package/dist/assets/bypassAdvisories-BhBeq_oI.js +1 -0
- package/dist/assets/decodeForDisplay-D55DM53E.js +1 -0
- package/dist/assets/index-NW0Z4UWR.js +42 -0
- package/dist/assets/javascript-Dti3Ss-T.js +1 -0
- package/dist/assets/{jsonMode-DOHFeg2H.js → jsonMode-YuJX0ZcQ.js} +1 -1
- package/dist/assets/jsonWorkerInPage-CTjyykdK.js +33 -0
- package/dist/assets/{monacoSetup-CEhMjQNN.js → monacoSetup-Bxl8fgYX.js} +176 -176
- package/dist/assets/multipart-Bd_eOd8a.js +4 -0
- package/dist/assets/{python-DDgBOsRh.js → python-CZnGM3Qv.js} +1 -1
- package/dist/assets/writeResultName-Dw705_0B.js +1 -0
- package/dist/assets/writeState-DgYICTBE.js +1 -0
- package/dist/assets/{xml-BXhJpCm5.js → xml-gySD1GMR.js} +1 -1
- package/dist/icons/icon.svg +9 -6
- package/dist/index.html +7 -1
- package/index.html +6 -0
- package/package.json +2 -1
- package/dist/assets/AssociateMode-mu2ai0TV.js +0 -1
- package/dist/assets/AssociateTargetsEditor-BoH9Qxe8.js +0 -1
- package/dist/assets/BatchMode-BVAfFgPy.js +0 -11
- package/dist/assets/BinaryColumnPickers-DYpKoRIO.js +0 -1
- package/dist/assets/BulkDeleteMode-Df-XirlR.js +0 -1
- package/dist/assets/BulkWriteMode-UXREEvbe.js +0 -6
- package/dist/assets/DisassociateMode-CKBL5nUo.js +0 -2
- package/dist/assets/ExecuteWorkflowMode-4EWco-ze.js +0 -1
- package/dist/assets/ManageFileMode-BFNwxuEY.js +0 -1
- package/dist/assets/ManageImageMode-DX0AdPN1.js +0 -1
- package/dist/assets/MergeMode-BzyXLu1b.js +0 -1
- package/dist/assets/PredefinedQueryMode-BT-HdZHF.js +0 -1
- package/dist/assets/RetrieveNextLinkMode-QBuIwdgS.js +0 -1
- package/dist/assets/abap-CRCWOmpq.js +0 -1
- package/dist/assets/apex-DnsZk_dE.js +0 -1
- package/dist/assets/azcli-1IWB1ccx.js +0 -1
- package/dist/assets/bat-DPkNLes8.js +0 -1
- package/dist/assets/bicep-Corcdgou.js +0 -2
- package/dist/assets/cameligo-CGrWLZr3.js +0 -1
- package/dist/assets/clojure-D9WOWImG.js +0 -1
- package/dist/assets/coffee-B7EJu28W.js +0 -1
- package/dist/assets/cpp-SEyurbux.js +0 -1
- package/dist/assets/csp-C46ZqvIl.js +0 -1
- package/dist/assets/css-DQU6DXDx.js +0 -3
- package/dist/assets/css.worker-CwQehIRV.js +0 -93
- package/dist/assets/cssMode-DRNC4UuD.js +0 -4
- package/dist/assets/cypher-D84EuPTj.js +0 -1
- package/dist/assets/dart-D8lhlL1r.js +0 -1
- package/dist/assets/dockerfile-DLk6rpji.js +0 -1
- package/dist/assets/ecl-BO6FnfXk.js +0 -1
- package/dist/assets/elixir-BRjLKONM.js +0 -1
- package/dist/assets/flow9-Cac8vKd7.js +0 -1
- package/dist/assets/freemarker2-BITb8GyO.js +0 -3
- package/dist/assets/fsharp-fd1GTHhf.js +0 -1
- package/dist/assets/go-O9LJTZXk.js +0 -1
- package/dist/assets/graphql-LQdxqEYJ.js +0 -1
- package/dist/assets/handlebars-BbDVduNH.js +0 -1
- package/dist/assets/hcl-DxDQ3s82.js +0 -1
- package/dist/assets/html-Ru2Cy2VS.js +0 -1
- package/dist/assets/html.worker-4xVL0wjo.js +0 -470
- package/dist/assets/htmlMode-DeMh8vPt.js +0 -4
- package/dist/assets/index-XmEQbXiX.js +0 -703
- package/dist/assets/ini-BvajGCUy.js +0 -1
- package/dist/assets/java-SYsfObOQ.js +0 -1
- package/dist/assets/javascript-DLj2yjBO.js +0 -1
- package/dist/assets/julia-DQXNmw_w.js +0 -1
- package/dist/assets/kotlin-qQ0MG-9I.js +0 -1
- package/dist/assets/less-GGFNNJHn.js +0 -2
- package/dist/assets/lexon-Canl7DCW.js +0 -1
- package/dist/assets/liquid-udbJGOUP.js +0 -1
- package/dist/assets/lua-D28Ae8-K.js +0 -1
- package/dist/assets/m3-DPitgjJI.js +0 -1
- package/dist/assets/markdown-B811l8j2.js +0 -1
- package/dist/assets/mdx-B6ABiFDH.js +0 -1
- package/dist/assets/mips-CdjsipkG.js +0 -1
- package/dist/assets/msdax-CYqgjx_P.js +0 -1
- package/dist/assets/mysql-BHd6q0vd.js +0 -1
- package/dist/assets/objective-c-B1aVtJYH.js +0 -1
- package/dist/assets/pascal-BhNW15KB.js +0 -1
- package/dist/assets/pascaligo-5jv8CcQD.js +0 -1
- package/dist/assets/perl-DlYyT36c.js +0 -1
- package/dist/assets/pgsql-Dy0bjov7.js +0 -1
- package/dist/assets/php-120yhfDK.js +0 -1
- package/dist/assets/pla-CjnFlu4u.js +0 -1
- package/dist/assets/postiats-CQpG440k.js +0 -1
- package/dist/assets/powerquery-DdJtto1Z.js +0 -1
- package/dist/assets/protobuf-IBS6jZEB.js +0 -2
- package/dist/assets/pug-kFxLfcjb.js +0 -1
- package/dist/assets/qsharp-q7JyzKFN.js +0 -1
- package/dist/assets/r-BIFz-_sK.js +0 -1
- package/dist/assets/razor-DGf0KCTP.js +0 -1
- package/dist/assets/redis-CHOsPHWR.js +0 -1
- package/dist/assets/redshift-CBifECDb.js +0 -1
- package/dist/assets/restructuredtext-CghPJEOS.js +0 -1
- package/dist/assets/ruby-CYWGW-b1.js +0 -1
- package/dist/assets/rust-DMDD0SHb.js +0 -1
- package/dist/assets/sb-BYAiYHFx.js +0 -1
- package/dist/assets/scala-Bqvq8jcR.js +0 -1
- package/dist/assets/scheme-Dhb-2j9p.js +0 -1
- package/dist/assets/scss-CTwUZ5N7.js +0 -3
- package/dist/assets/solidity-CME5AdoB.js +0 -1
- package/dist/assets/sophia-RYC1BQQz.js +0 -1
- package/dist/assets/sparql-KEyrF7De.js +0 -1
- package/dist/assets/sql-BdTr02Mf.js +0 -1
- package/dist/assets/st-C7iG7M4S.js +0 -1
- package/dist/assets/swift-D7IUmUK8.js +0 -1
- package/dist/assets/systemverilog-DgMryOEJ.js +0 -1
- package/dist/assets/tcl-PloMZuKG.js +0 -1
- package/dist/assets/ts.worker-B8Ae6930.js +0 -51330
- package/dist/assets/tsMode-D4ZDTisA.js +0 -11
- package/dist/assets/twig-BfRIq3la.js +0 -1
- package/dist/assets/typescript-CJFgy1iR.js +0 -1
- package/dist/assets/typespec-CzxlYoT_.js +0 -1
- package/dist/assets/vb-BwAE3J76.js +0 -1
- package/dist/assets/wgsl-Dksx_ONF.js +0 -298
- package/dist/assets/yaml-B7iGwJkY.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,386 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.6.0-beta.1] - 2026-11-07
|
|
11
|
+
|
|
12
|
+
The first 1.6.0 beta. Recent runs survive a reload or restart ([#226]),
|
|
13
|
+
throttled requests are explained ([#269]), Retrieve Multiple can count only
|
|
14
|
+
([#272]), the Code tab writes Python ([#270]) and a cURL command can be
|
|
15
|
+
imported ([#271]). The JSON body editor and hand-typed URLs get suggestions
|
|
16
|
+
from the table's metadata ([#268]), results suggest the next step ([#291]) and
|
|
17
|
+
every mode lists what blocks Execute ([#294]). The package is about half the
|
|
18
|
+
size and loads less at startup ([#236]).
|
|
19
|
+
|
|
20
|
+
Still a **prerelease** on the npm `beta` tag, with the gold Insider icon.
|
|
21
|
+
Power Platform ToolBox **1.2.7 or later** is recommended.
|
|
22
|
+
|
|
23
|
+
### ✨ Added
|
|
24
|
+
|
|
25
|
+
- **The JSON body editor knows the table** ([#268]). In a field set's JSON view
|
|
26
|
+
(Create, Update, Upsert, Bulk Write rows and entity parameters):
|
|
27
|
+
- **Keys:** typing `"` lists the columns the form can set. Lookups are
|
|
28
|
+
listed as their `@odata.bind` keys, one per target for Customer and other
|
|
29
|
+
polymorphic lookups.
|
|
30
|
+
- **Values:**
|
|
31
|
+
- Choice, Status and State columns list their values with labels, for
|
|
32
|
+
example `Accounting · 1`; typing a number narrows the list. Multi-select
|
|
33
|
+
choices list theirs as strings.
|
|
34
|
+
- A lookup key inserts `"/<entityset>(<guid>)"`, with the GUID selected.
|
|
35
|
+
- **Hover:** a key shows its column's display name, type and whether it's
|
|
36
|
+
required.
|
|
37
|
+
- **Type check:** a value of the wrong JSON type is underlined, for example
|
|
38
|
+
text in a Currency column. The check follows the same rules as switching
|
|
39
|
+
back to the Form view, with one difference: a multi-select value given as
|
|
40
|
+
an array is underlined too, because a JSON body is sent as typed and
|
|
41
|
+
Dataverse wants `"1,2"`.
|
|
42
|
+
|
|
43
|
+
With *Advanced Find only* on, columns Advanced Find hides aren't listed, but
|
|
44
|
+
they still get hover text and type checks. Unknown keys and annotations
|
|
45
|
+
aren't underlined, because the pane already lists them. The table's option
|
|
46
|
+
values, lookup targets and date behaviour load when the JSON view opens, in
|
|
47
|
+
one request per column type.
|
|
48
|
+
|
|
49
|
+
- **Hand-typed URLs get suggestions** ([#268]). The Batch custom request URL and
|
|
50
|
+
Retrieve query options, the Paste OData URL dialog and Retrieve Next Link list
|
|
51
|
+
what fits where the caret is:
|
|
52
|
+
- **Path:** tables and unbound functions and actions, then a row's navigation
|
|
53
|
+
properties and bound operations, or a table's `$count`.
|
|
54
|
+
- **Query options:** option names, columns in `$select` and `$orderby`
|
|
55
|
+
(lookups as `_<column>_value`), `asc` / `desc`, navigation properties in
|
|
56
|
+
`$expand` and the options inside `$expand(…)`, for the nav's own table.
|
|
57
|
+
- **`$filter`:** columns, `nav/column` paths, `contains` / `startswith` /
|
|
58
|
+
`endswith`, then operators and `and` / `or`.
|
|
59
|
+
|
|
60
|
+
The list opens as you type, not when you paste a URL. ↑ / ↓ move through it,
|
|
61
|
+
Enter or Tab inserts, Esc closes it, and Ctrl+Space opens it again. *Advanced
|
|
62
|
+
Find only* narrows it like the pickers. Lambdas (`any` / `all`) aren't
|
|
63
|
+
suggested yet.
|
|
64
|
+
|
|
65
|
+
- **Results suggest the next step** ([#291]):
|
|
66
|
+
- **0 rows:** **Edit $filter** opens the $filter, **Run without $filter**
|
|
67
|
+
removes it from the builder and runs again (with **Restore $filter**
|
|
68
|
+
afterwards), and **Copy request URL**.
|
|
69
|
+
- **403:** the card names the missing privilege when Dataverse's message has
|
|
70
|
+
one, for example `prvReadAccount` (Read access on account).
|
|
71
|
+
- **401:** the card says to sign in to the connection again in ToolBox's
|
|
72
|
+
Connection Manager.
|
|
73
|
+
- **Unknown entity set** ("Resource not found for the segment …"): the card
|
|
74
|
+
suggests the closest table in your entity scope. In Retrieve NextLink,
|
|
75
|
+
**Use** fixes the URL.
|
|
76
|
+
- **Every error**, including failed writes: **Copy error report** copies the
|
|
77
|
+
method, URL, status, error code and message. It never includes request
|
|
78
|
+
headers, so no credentials or impersonation ids.
|
|
79
|
+
- **Every mode lists what blocks Execute in Advisories** ([#294]). Create,
|
|
80
|
+
Associate, Disassociate, Execute Action / Function / Workflow, Manage File /
|
|
81
|
+
Image / Attachment, Predefined Query, `$batch`, Bulk Write and Bulk Delete
|
|
82
|
+
used to explain a disabled Execute only in its tooltip. Now the blocker is
|
|
83
|
+
in the Advisories drawer, like the read modes, and **Open** goes to the
|
|
84
|
+
sidebar node that fixes it, for example the first unset required parameter
|
|
85
|
+
or the first Bulk Write row with a problem. What blocks Execute is
|
|
86
|
+
unchanged.
|
|
87
|
+
- **Open on any advisory shows the Builder and focuses the field** ([#294]),
|
|
88
|
+
from any tab, in every mode.
|
|
89
|
+
- **Recent runs survive a reload or restart** ([#226]). Each mode keeps its
|
|
90
|
+
runs against each environment: the last 200 runs, with the request, status,
|
|
91
|
+
row count, duration and time. Response bodies are never kept, and neither
|
|
92
|
+
are credential or impersonation headers.
|
|
93
|
+
- Under Recent runs, **Show all** (or **Search runs**) opens the mode's
|
|
94
|
+
history: search by URL, status or method, and click a run to restore it.
|
|
95
|
+
- Settings → **Request history** turns it off (which also clears it) or
|
|
96
|
+
clears it.
|
|
97
|
+
- **Throttling is explained** ([#269]). When Dataverse's service protection
|
|
98
|
+
limits refuse a request (429: `0x80072322` requests, `0x80072321` execution
|
|
99
|
+
time, `0x80072326` concurrent requests), the result names the limit and says
|
|
100
|
+
what to do. Read results offer **Try again**; a failed write says it didn't
|
|
101
|
+
run.
|
|
102
|
+
- **Retrieve all** pauses instead of failing. The rows so far are kept, and
|
|
103
|
+
**Continue** asks for the refused page again.
|
|
104
|
+
- Waiting the exact `Retry-After` time needs response headers, which
|
|
105
|
+
ToolBox doesn't pass through yet.
|
|
106
|
+
- **Count only in Retrieve Multiple** ([#272]). Under $count, **Count only**
|
|
107
|
+
shows just the number of rows matching your $filter, with **Copy count**.
|
|
108
|
+
It asks for one row with `$count=true` and reads `@odata.count`, because
|
|
109
|
+
Dataverse rejects $filter on `<set>/$count` and ToolBox can't read that
|
|
110
|
+
plain-text answer. Dataverse counts up to 5,000 rows (500 for elastic
|
|
111
|
+
tables); past that, the result says more rows match. Pasting a `/$count` URL
|
|
112
|
+
turns Count only on.
|
|
113
|
+
- **Python code** ([#270]). The Code tab has a **Python** format that sends
|
|
114
|
+
the request with `requests`: the URL, your headers, and the body as a
|
|
115
|
+
Python dict (or the file's bytes for an upload). Multi-request modes send
|
|
116
|
+
each request in order on one session. In `$batch` and ExecuteMultiple,
|
|
117
|
+
**Python (requests)** posts the multipart body. Put your token in
|
|
118
|
+
`ACCESS_TOKEN`.
|
|
119
|
+
- **Import a cURL command** ([#271]). More actions (**…**) → **Import cURL
|
|
120
|
+
command…** reads a pasted `curl` command, for example from your
|
|
121
|
+
browser's Copy as cURL (bash or cmd) or DRS's own cURL code, and opens it
|
|
122
|
+
in the mode that sends it, filled in but not run:
|
|
123
|
+
- GET a table → Retrieve Multiple (the query is checked like Paste OData
|
|
124
|
+
URL), GET a row → Retrieve Single.
|
|
125
|
+
- POST to a table → Create, PATCH → Update with `If-Match` or Upsert
|
|
126
|
+
without it, DELETE → Delete (a row or one column). The body opens in the
|
|
127
|
+
field set's JSON view; Prefer, `If-Match` and the bypass headers fill
|
|
128
|
+
their panes.
|
|
129
|
+
- POST to an action → Execute Action, Custom API or Custom Action, with
|
|
130
|
+
the body read into its parameters (row references and new rows
|
|
131
|
+
included). A parameter it can't read is refused, not sent as null.
|
|
132
|
+
- POST `$batch` → `$batch`, with change sets kept.
|
|
133
|
+
- `Authorization`, cookies and browser headers are left out, and the
|
|
134
|
+
dialog lists what was left out or changed. Functions, associations,
|
|
135
|
+
alternate keys and file uploads aren't imported yet.
|
|
136
|
+
- **All or nothing for Associate and Disassociate** ([#224]). With two or
|
|
137
|
+
more targets on a one-to-many or many-to-many relationship, turn on **All
|
|
138
|
+
or nothing** under the target records to send their requests as one
|
|
139
|
+
`$batch` change set. If any target fails, Dataverse rolls back the rest, so
|
|
140
|
+
nothing is linked or unlinked; the results list the failed target and mark
|
|
141
|
+
the others **Not applied**. A change set holds at most 1,000 requests. It's off by default: each target
|
|
142
|
+
is still sent on its own, and a failure leaves the targets before it
|
|
143
|
+
changed. The Code tab follows the choice: with it on, fetch, Python, C#,
|
|
144
|
+
PowerShell and cURL post one `$batch`, and `Xrm.WebApi.executeMultiple`
|
|
145
|
+
nests the requests in a change set. Needs Power Platform ToolBox 1.2.7 or
|
|
146
|
+
later; on an older ToolBox the option is unavailable and the requests go
|
|
147
|
+
one at a time.
|
|
148
|
+
|
|
149
|
+
### 🐛 Fixed
|
|
150
|
+
|
|
151
|
+
- **Screen readers and speech input get the right names; status and URL
|
|
152
|
+
colours are readable** ([#387]):
|
|
153
|
+
- Each results row's checkbox is named after the record (or its row
|
|
154
|
+
number), like the header's **Select all rows**.
|
|
155
|
+
- Recent runs, and the rows in run history, are named by what they show
|
|
156
|
+
("GET just now · 200 · 3 rows") and then their URL, so speech users can
|
|
157
|
+
say what they see. So are the buttons whose tooltip used to rename them
|
|
158
|
+
(**Saved**, **Refresh**, **Copy URL**, **Copy ID**, **Open**, **Copy**,
|
|
159
|
+
**Save** in the Code tab, **Paste** and **Clear** in Retrieve NextLink,
|
|
160
|
+
and a binary file's **Change**): the tooltip now describes the button.
|
|
161
|
+
In the $filter editor, **NOT** is named by its text and the query
|
|
162
|
+
function picker has a name.
|
|
163
|
+
- The status pill ("200 OK · 82 ms") is a Fluent filled badge, as the
|
|
164
|
+
design specifies, with a check on success, and its time is no longer
|
|
165
|
+
faded.
|
|
166
|
+
- The purple of the URL bar's `$select`, `$filter`, … names and the
|
|
167
|
+
$filter editor's function labels follows the theme as the design pairs
|
|
168
|
+
it: a shade deeper in light, the lighter "relate" purple in dark (it
|
|
169
|
+
stayed the light-theme purple before). The ƒ badge is dark violet in
|
|
170
|
+
dark.
|
|
171
|
+
- The selected **AND** / **OR** is a Fluent primary button: brand blue
|
|
172
|
+
with white text in Retrieve modes, the mode's colour elsewhere. In dark it
|
|
173
|
+
was white on a light tint.
|
|
174
|
+
- All of these meet 4.5:1 contrast in light and dark.
|
|
175
|
+
- **Execute Function no longer lists query functions** ([#384]). `Last7Days`,
|
|
176
|
+
`Contains`, `Between` and the other `$filter` query functions only work
|
|
177
|
+
inside a `$filter`, and the picker was meant to hide them. It missed them
|
|
178
|
+
because Dataverse declares them unbound.
|
|
179
|
+
- **JSON bodies are checked in the PPTB VS Code extension** ([#255]). The
|
|
180
|
+
extension serves DRS's files from another origin than the page, so
|
|
181
|
+
Monaco's workers couldn't start. The JSON editors then showed no error
|
|
182
|
+
squiggles and offered no formatting or folding, and threw an error on
|
|
183
|
+
every edit. Where a worker can't start, the same code now runs on the
|
|
184
|
+
page. That includes a worker that fails after it was created, for
|
|
185
|
+
example one a host's CSP forbids, or one whose file is gone after DRS
|
|
186
|
+
updated while open. ToolBox desktop still uses real workers.
|
|
187
|
+
- **Update and Upsert results show what came back** ([#224]). A 204 used
|
|
188
|
+
to show a made-up `{"@odata.context": "update"}` body in the JSON tab;
|
|
189
|
+
now it shows none. ToolBox's update passes no row back, even with
|
|
190
|
+
`Prefer: return=representation` (Upsert's default), so the result says so
|
|
191
|
+
and points to **Retrieve this record**.
|
|
192
|
+
- **Retrieve NextLink names the right table** ([#224]). The table came from
|
|
193
|
+
trimming the entity set's plural (`mailboxes` became `mailboxe`); now it's
|
|
194
|
+
looked up in the environment's entity list, and left blank when unknown.
|
|
195
|
+
- **Manage Image's preview has a sidebar entry** ([#224]). The pane with the
|
|
196
|
+
operation banner, the 144×144 preview tile and the pipeline had no sidebar
|
|
197
|
+
item: once you left it, only loading a request (or **Open** on _Image
|
|
198
|
+
operations run externally_) brought it back, so the picked record's
|
|
199
|
+
initials on the tile went unseen. A **Preview** section now heads the
|
|
200
|
+
sidebar, named after the picked record and badged with its initials, and
|
|
201
|
+
**Open** highlights it.
|
|
202
|
+
|
|
203
|
+
### 🔄 Changed
|
|
204
|
+
|
|
205
|
+
- **A smaller, faster-loading package** ([#236]). The npm package is about
|
|
206
|
+
1.8 MB (6.7 MB unpacked), down from 3.6 MB (14.5 MB), and DRS loads less
|
|
207
|
+
at startup:
|
|
208
|
+
- The editors load only the languages DRS shows (JSON, FetchXML and the
|
|
209
|
+
Code tab's formats) instead of all of Monaco's: its TypeScript, CSS and
|
|
210
|
+
HTML language services (~7.6 MB of workers) and ~80 language files are
|
|
211
|
+
gone.
|
|
212
|
+
- Every mode except Retrieve Multiple, the one DRS opens on, loads the
|
|
213
|
+
first time you pick it, as do the Code tab, the cURL import and the
|
|
214
|
+
write-result card. The startup bundle is ~1.7 MB, down from ~2 MB.
|
|
215
|
+
- The editors still highlight every Code tab format, and JSON is still
|
|
216
|
+
checked, formatted and folded. The JavaScript in the Code tab's Editor
|
|
217
|
+
playground loses what TypeScript's language service gave it: error
|
|
218
|
+
squiggles, completions, hover and formatting.
|
|
219
|
+
- CI fails the build if the package, or its startup bundle, grows past
|
|
220
|
+
its budget, or if an unused Monaco worker comes back.
|
|
221
|
+
|
|
222
|
+
### 🔧 Internal
|
|
223
|
+
|
|
224
|
+
- Executor clean-ups ([#224]): one `API_VERSION` constant, matching the
|
|
225
|
+
`v9.2` ToolBox calls; unused exports and `void` import keepers removed;
|
|
226
|
+
the executor's module header describes what it does today. Manage
|
|
227
|
+
Image's preview tile takes its initials from the picked record instead of
|
|
228
|
+
a fixed `?`.
|
|
229
|
+
- `src/mock/` is renamed for what it holds ([#224]): the table registry and
|
|
230
|
+
CSDL action types are in `src/metadata/`, the environment in `src/env/`.
|
|
231
|
+
No behaviour change.
|
|
232
|
+
- One header composition ([#244]): Create, Update, Upsert, Delete, Merge
|
|
233
|
+
and Bulk Write, the collection exports and `$batch` all build the
|
|
234
|
+
precondition, duplicate-detection and bypass headers in
|
|
235
|
+
`engine/requestHeaders.ts`, so Execute, the Code tab and exports can't
|
|
236
|
+
drift apart. A test checks they match.
|
|
237
|
+
- One Recent-runs push ([#244]): every mode adds its run with `addRun`,
|
|
238
|
+
which stamps the id and time and keeps the list at `RECENT_SHOWN`.
|
|
239
|
+
|
|
240
|
+
[#224]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/224
|
|
241
|
+
[#244]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/244
|
|
242
|
+
[#236]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/236
|
|
243
|
+
[#255]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/255
|
|
244
|
+
[#268]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/268
|
|
245
|
+
[#291]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/291
|
|
246
|
+
[#294]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/294
|
|
247
|
+
[#226]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/226
|
|
248
|
+
[#269]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/269
|
|
249
|
+
[#272]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/272
|
|
250
|
+
[#270]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/270
|
|
251
|
+
[#271]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/271
|
|
252
|
+
[#384]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/384
|
|
253
|
+
[#387]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/387
|
|
254
|
+
|
|
255
|
+
## [1.5.0] - 2026-11-07
|
|
256
|
+
|
|
257
|
+
Writes ask before they're sent, naming the environment, and Production gets a
|
|
258
|
+
safe mode that's on by default ([#241]). Read and execute requests send their
|
|
259
|
+
headers, and impersonation is never dropped silently ([#109]). The entity scope
|
|
260
|
+
moves from Settings to a button in the header ([#42]). Ids, names and filter
|
|
261
|
+
values are checked and typed before they go into a URL ([#221]). The sidebar
|
|
262
|
+
works with a screen reader and the keyboard ([#243]).
|
|
263
|
+
|
|
264
|
+
It was iterated through `1.5.0-beta.1` (detailed below). Since that beta, the
|
|
265
|
+
Insider icon, the README badges and the release workflow changed (listed here).
|
|
266
|
+
|
|
267
|
+
Request headers need **Power Platform ToolBox 1.2.7 or later**. On older hosts
|
|
268
|
+
a request with an impersonation header isn't sent, and DRS explains why.
|
|
269
|
+
|
|
270
|
+
### ✨ Added
|
|
271
|
+
|
|
272
|
+
- **Writes ask before they're sent**, naming the environment and its type, and
|
|
273
|
+
**Production safe mode** is on by default ([#241]).
|
|
274
|
+
- **The entity scope is a button in the header** ([#42]).
|
|
275
|
+
- **Read, Execute Function, Associate / Disassociate and Bulk Delete Job send
|
|
276
|
+
their headers**, and impersonation is never dropped silently ([#109]).
|
|
277
|
+
- **Execute Custom API and Custom Action list your own operations first**.
|
|
278
|
+
|
|
279
|
+
### 🛡️ Security and data safety
|
|
280
|
+
|
|
281
|
+
- **Ids, names, filter values and function parameters are checked and typed**
|
|
282
|
+
before they go into a URL, and imported saved requests are checked deeply
|
|
283
|
+
([#221]).
|
|
284
|
+
|
|
285
|
+
### 🐛 Fixed since 1.4.0
|
|
286
|
+
|
|
287
|
+
Listed under the beta below. Among them: the sidebar with a screen reader and
|
|
288
|
+
the keyboard ([#243]), expired metadata that was served as fresh ([#334]), and
|
|
289
|
+
choosing a file no longer reads it into memory ([#222]).
|
|
290
|
+
|
|
291
|
+
### 🔄 Changed
|
|
292
|
+
|
|
293
|
+
- **The Insider icon's gold corner is bigger, deeper gold and flush with the
|
|
294
|
+
corner** ([#363]). The old stamp's right point sat inside the hexagon's edge,
|
|
295
|
+
leaving a thin blue gap, and the light gold faded at small sizes. The stamp
|
|
296
|
+
now fills the corner, about 1.5 times larger, in two tones of gold
|
|
297
|
+
(`#CC8A00` and `#F2A100`) split on the same diagonal as the blue.
|
|
298
|
+
Prerelease builds only; the release icon is unchanged. Same change as
|
|
299
|
+
FetchXML Studio.
|
|
300
|
+
- **The README's badges show in the ToolBox** ([#373]). Power Platform ToolBox
|
|
301
|
+
shows a tool's README in a window that only loads images from GitHub, so the
|
|
302
|
+
`img.shields.io` badges didn't appear there. They're now SVG files in
|
|
303
|
+
`assets/badges/`, linked from `raw.githubusercontent.com` as in Command Bar
|
|
304
|
+
Studio and FetchXML Studio, and generated from `package.json` by
|
|
305
|
+
`npm run badges`: version, Power Platform ToolBox ≥ 1.2.0, `@pptb/types`,
|
|
306
|
+
React, TypeScript, Fluent UI and license. The version badge links to npm, in
|
|
307
|
+
place of the npm `latest` and `beta` badges. The links point at `main`, so
|
|
308
|
+
the ToolBox shows them from the 1.5.0 release on.
|
|
309
|
+
|
|
310
|
+
### 🔧 Internal
|
|
311
|
+
|
|
312
|
+
- **Releases check what they must update** ([#372]). A new `check-release.mjs`
|
|
313
|
+
runs in CI (every PR, and pushes to the long-lived branches) and in the
|
|
314
|
+
release build. It fails when any of these don't match `package.json`'s
|
|
315
|
+
version:
|
|
316
|
+
- the version's shape (`X.Y.Z`, `X.Y.Z-beta.N` or `X.Y.Z-rc.N`);
|
|
317
|
+
- `package-lock.json`;
|
|
318
|
+
- the CHANGELOG (a dated `[X.Y.Z]` section with entries, under a single
|
|
319
|
+
`[Unreleased]`);
|
|
320
|
+
- after the build, the bundled icon (the Insider icon for pre-releases).
|
|
321
|
+
|
|
322
|
+
The GitHub Release notes are built by the same script: the PPTB requirement,
|
|
323
|
+
the CHANGELOG section and a link to the full CHANGELOG, then GitHub's PR
|
|
324
|
+
list. A release no longer falls back to a PR list alone when the section is
|
|
325
|
+
missing, because the check fails first. RELEASING.md gains a table of what
|
|
326
|
+
every release changes and an *After every release* checklist, and forward
|
|
327
|
+
merges now keep the higher version. Ported from FetchXML Studio's check.
|
|
328
|
+
- **The release check covers the README badges** ([#373]): the files in
|
|
329
|
+
`assets/badges/` match `package.json`, the README shows them, and no README
|
|
330
|
+
image comes from `img.shields.io`.
|
|
331
|
+
- **The release workflow is hardened** ([#376]), as FetchXML Studio's was.
|
|
332
|
+
- **Separate jobs:** `release.yml` is split into `build`, `publish` and
|
|
333
|
+
`github-release`. The job that installs and runs the dependencies
|
|
334
|
+
(`npm ci --ignore-scripts`, no cache, tests, build) only reads the
|
|
335
|
+
repository. Only `publish` can get the npm OIDC token, only for a tag push,
|
|
336
|
+
and it installs no project dependencies: it publishes the tarball `build`
|
|
337
|
+
packed. Only `github-release` can write to the repository.
|
|
338
|
+
- **More checks before publishing:** the release build now also runs the
|
|
339
|
+
runtime audit, lint and the root-absolute asset check, so a tag on a commit
|
|
340
|
+
that skipped CI can't publish. The package-contents check now runs on the
|
|
341
|
+
tarball that gets published, not a dry-run pack.
|
|
342
|
+
- **Pinned versions:** npm is pinned to 11.21.1 instead of `npm@latest`, and
|
|
343
|
+
Node to 24.22.0. Actions are pinned by commit SHA (checkout v7.0.1,
|
|
344
|
+
setup-node v7.1.0, upload-artifact v7.0.2, download-artifact v8.0.2), each
|
|
345
|
+
at least 14 days old.
|
|
346
|
+
- **Rehearsal:** running the workflow by hand runs every check and
|
|
347
|
+
`npm publish --dry-run`, with no npm token and no GitHub Release. A stable
|
|
348
|
+
version that isn't on `main` yet rehearses as `latest`, with a warning.
|
|
349
|
+
- **`latest` can't move back:** a stable tag gets `latest` only for main's own
|
|
350
|
+
version line, and a `support/X.Y` commit is checked first. Support branches
|
|
351
|
+
merge forward into `main`, so before this, a support release first published
|
|
352
|
+
(or retried after a failed publish) once its commit had reached `main` would
|
|
353
|
+
have gone to `latest`.
|
|
354
|
+
- **CI** uses the same Node and action pins and `npm ci --ignore-scripts`,
|
|
355
|
+
doesn't keep the checkout's token, and runs the runtime audit.
|
|
356
|
+
- **RELEASING.md** covers the jobs, the pins, re-runs and rehearsals; how to
|
|
357
|
+
bring a `support/X.Y` cut from an older tag onto this workflow before its
|
|
358
|
+
first tag; and the recommended `publish` environment and `v*` tag ruleset.
|
|
359
|
+
|
|
360
|
+
### ⚠️ Known issues
|
|
361
|
+
|
|
362
|
+
- **`$batch` continue-on-error:** ToolBox's `$batch` response parser fails when
|
|
363
|
+
a failed request is followed by more requests. DRS explains it and suggests
|
|
364
|
+
putting requests that might fail last ([#198]).
|
|
365
|
+
- **Execute modes on very large environments:** ToolBox can't load a
|
|
366
|
+
`$metadata` document over 16 MB until a ToolBox release includes
|
|
367
|
+
[PowerPlatformToolBox/desktop-app#737](https://github.com/PowerPlatformToolBox/desktop-app/pull/737);
|
|
368
|
+
DRS explains the limit ([#79]).
|
|
369
|
+
- **ToolBox VS Code extension:** Monaco's workers may run on the main thread,
|
|
370
|
+
so JSON IntelliSense may not work there ([#255]).
|
|
371
|
+
- **Binary modes** (file / image / attachment) compose the request and its
|
|
372
|
+
code, but Execute returns 501 because ToolBox doesn't expose those
|
|
373
|
+
operations.
|
|
374
|
+
|
|
375
|
+
[#42]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/42
|
|
376
|
+
[#79]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/79
|
|
377
|
+
[#109]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/109
|
|
378
|
+
[#198]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/198
|
|
379
|
+
[#221]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/221
|
|
380
|
+
[#222]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/222
|
|
381
|
+
[#241]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/241
|
|
382
|
+
[#243]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/243
|
|
383
|
+
[#255]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/255
|
|
384
|
+
[#334]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/334
|
|
385
|
+
[#363]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/363
|
|
386
|
+
[#372]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/372
|
|
387
|
+
[#373]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/373
|
|
388
|
+
[#376]: https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/issues/376
|
|
389
|
+
|
|
10
390
|
## [1.5.0-beta.1] - 2026-10-30
|
|
11
391
|
|
|
12
392
|
The first 1.5.0 beta. Writes now ask before they're sent, naming the
|
package/README.md
CHANGED
|
@@ -9,13 +9,13 @@ file / image / attachment operations.
|
|
|
9
9
|
Built for [Power Platform ToolBox](https://www.powerplatformtoolbox.com/) with
|
|
10
10
|
React 18, Fluent UI v9, TypeScript, and live Dataverse metadata integration.
|
|
11
11
|
|
|
12
|
-
[](https://www.npmjs.com/package/@mohsinonxrm/pptb-dataverse-request-studio)
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -23,10 +23,11 @@ React 18, Fluent UI v9, TypeScript, and live Dataverse metadata integration.
|
|
|
23
23
|
|
|
24
24
|
DRS ships with **23 request modes** in 7 groups. Every mode is
|
|
25
25
|
metadata-driven and generates the correct OData / Web API shape. The
|
|
26
|
-
single-request modes emit ready-to-copy code in
|
|
27
|
-
`Xrm.WebApi.executeMultiple`, `XMLHttpRequest`, Power Automate,
|
|
28
|
-
cURL, JSON, and an OpenAPI 3 document
|
|
29
|
-
|
|
26
|
+
single-request modes emit ready-to-copy code in eleven formats: `fetch`,
|
|
27
|
+
`Xrm.WebApi`, `Xrm.WebApi.executeMultiple`, `XMLHttpRequest`, Power Automate,
|
|
28
|
+
C#, Python (`requests`), PowerShell, cURL, JSON, and an OpenAPI 3 document.
|
|
29
|
+
`$batch` has its own HTTP / fetch / Python / PPTB outputs, and ExecuteMultiple
|
|
30
|
+
has C# / HTTP / Python / PPTB.
|
|
30
31
|
|
|
31
32
|
### 📖 Read group
|
|
32
33
|
|
|
@@ -161,6 +162,11 @@ modes have their own HTTP / fetch / C# / PPTB outputs.
|
|
|
161
162
|
precondition, bypass or impersonation header are blocked with an
|
|
162
163
|
explanation. `Authorization` / `Cookie` headers are never sent, saved or
|
|
163
164
|
exported.
|
|
165
|
+
- **Import a cURL command** — More actions → **Import cURL command…** opens a
|
|
166
|
+
pasted `curl` command (a browser's Copy as cURL, or DRS's own cURL code) in
|
|
167
|
+
the mode that sends it: Retrieve Multiple / Single, Create, Update, Upsert,
|
|
168
|
+
Delete, Execute Action / Custom API / Custom Action, or `$batch`. It's
|
|
169
|
+
filled in, not run, and credentials and browser headers are left out.
|
|
164
170
|
- **Antipattern advisories** — Surfaces real-time guidance per the
|
|
165
171
|
[Microsoft query-antipatterns doc](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/query-antipatterns):
|
|
166
172
|
`FilteringOnCalculatedColumns`, `LargeAmountOfLogicalAttributes`, large-text
|
|
@@ -180,8 +186,11 @@ modes have their own HTTP / fetch / C# / PPTB outputs.
|
|
|
180
186
|
dirty-state detection. Export / import as JSON, export as a Postman /
|
|
181
187
|
Insomnia / Bruno collection, and copy or move requests from other
|
|
182
188
|
connections. A library that can't be read is never overwritten.
|
|
183
|
-
- **Recent runs** — click a run to restore it into its mode.
|
|
184
|
-
|
|
189
|
+
- **Recent runs** — click a run to restore it into its mode. Runs are kept
|
|
190
|
+
across restarts, per environment (the last 200, without response bodies or
|
|
191
|
+
credential / impersonation headers), and **Show all** searches them. Turn
|
|
192
|
+
the history off or clear it in Settings. Each mode keeps its unsaved request
|
|
193
|
+
when you switch modes.
|
|
185
194
|
- **Results** — CSV export (formulas neutralised for spreadsheets), JSON
|
|
186
195
|
export, Copy as TSV, and response-size hints.
|
|
187
196
|
- **Accessibility** — labelled inputs, readable badges and live-region
|
|
@@ -240,7 +249,7 @@ modes have their own HTTP / fetch / C# / PPTB outputs.
|
|
|
240
249
|
Dataverse Request Studio is available as a tool in Power Platform ToolBox.
|
|
241
250
|
Install it from the tool gallery or load it as a custom tool. Stable releases
|
|
242
251
|
are published to npm under the `latest` tag. Prereleases of the next version
|
|
243
|
-
are published under the `beta` tag (for example `1.
|
|
252
|
+
are published under the `beta` tag (for example `1.6.0-beta.1`) and use the
|
|
244
253
|
gold Insider icon.
|
|
245
254
|
|
|
246
255
|
### Choose the entity scope
|
|
@@ -342,8 +351,16 @@ npm run validate
|
|
|
342
351
|
|
|
343
352
|
# Lint (ESLint, no warnings allowed)
|
|
344
353
|
npm run lint
|
|
354
|
+
|
|
355
|
+
# Regenerate the README badges in assets/badges/ from package.json
|
|
356
|
+
npm run badges
|
|
345
357
|
```
|
|
346
358
|
|
|
359
|
+
The badges at the top of this README are SVG files in `assets/badges/`, linked from
|
|
360
|
+
`raw.githubusercontent.com`: Power Platform ToolBox shows the README in a window that only
|
|
361
|
+
loads images from GitHub, so `img.shields.io` badges don't appear there
|
|
362
|
+
([RELEASING.md](https://github.com/mohsinonxrm/pptb-mxrm-dataverse-request-studio/blob/dev/RELEASING.md#readme-images)).
|
|
363
|
+
|
|
347
364
|
### Standalone vs PPTB-embedded
|
|
348
365
|
|
|
349
366
|
DRS runs in two modes:
|
|
@@ -415,7 +432,7 @@ src/
|
|
|
415
432
|
executeBuilders.ts — action / function / workflow body builders
|
|
416
433
|
binaryBuilders.ts — file / image / attachment pipelines
|
|
417
434
|
codeGenerators.ts — fetch, Xrm.WebApi (+ executeMultiple), XHR,
|
|
418
|
-
Power Automate, C#, PowerShell, cURL, JSON
|
|
435
|
+
Power Automate, C#, Python, PowerShell, cURL, JSON
|
|
419
436
|
openApiGenerator.ts — OpenAPI 3 document for the current request
|
|
420
437
|
collectionFormats.ts, savedToCollection.ts
|
|
421
438
|
— Postman / Insomnia / Bruno collection export
|
|
@@ -435,6 +452,15 @@ src/
|
|
|
435
452
|
cache.ts — per-org metadata caches (TTL + in-flight dedup)
|
|
436
453
|
useLiveMetadata.ts, useColumnDetail.ts, useScopedEntities.ts, …
|
|
437
454
|
|
|
455
|
+
metadata/ — Dataverse metadata model
|
|
456
|
+
metadata.ts — table / column types + live table registry
|
|
457
|
+
(findTable, findTableBySet)
|
|
458
|
+
actionsCsdl.ts — CSDL action / function types
|
|
459
|
+
|
|
460
|
+
env/ — target environment
|
|
461
|
+
environment.ts — connected environment (getEnv, ENV) +
|
|
462
|
+
API_VERSION / API_BASE
|
|
463
|
+
|
|
438
464
|
primitives/ — small reusable UI bits
|
|
439
465
|
ClauseTreeItem.tsx, SectionHeader.tsx, ModeCard.tsx, RequestTypePicker.tsx
|
|
440
466
|
StatusPill.tsx, MethodPill.tsx, AdvisoryDrawer.tsx, advisories.ts
|
|
@@ -526,9 +552,9 @@ Ideas under consideration include:
|
|
|
526
552
|
- FetchXML and Dataverse Search API modes
|
|
527
553
|
- A metadata browser mode
|
|
528
554
|
- Comparing responses across runs or environments
|
|
529
|
-
- Importing Postman / Insomnia collections
|
|
530
|
-
- More code-generation targets (C# ServiceClient / IOrganizationService,
|
|
531
|
-
|
|
555
|
+
- Importing Postman / Insomnia collections
|
|
556
|
+
- More code-generation targets (C# ServiceClient / IOrganizationService, the
|
|
557
|
+
PowerShell Dataverse module)
|
|
532
558
|
|
|
533
559
|
---
|
|
534
560
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bg as be,j as e,c0 as Se,t as n,B as x,C as f,bv as Ne,dP as Be,r as y,w as ze,z as _,ay as Z,aL as Fe,S as ke,dQ as Oe,M as A,m as W,o as De,dR as X,dS as Le,au as ee,bt as H,bd as I,ca as $e,a$ as ue,br as ve,bs as V,aK as te,cr as _e,dT as Ae,dU as We,dV as qe,dW as Ue,aq as Ge,av as P,an as Je,aB as pe,cq as me,R as ne,bS as He,s as Ve,be as we,dX as ye,dY as Ke,b$ as Ye,u as Qe,dZ as Te,d_ as Ze,d$ as Xe}from"./index-NW0Z4UWR.js";import{O as he}from"./OptionGroup-DYAAm_pt.js";import{M as et}from"./CodeView-C65Y5vXN.js";import{F as tt}from"./FieldSetEditor-Dg6WsDgG.js";const nt={WhoAmIResponse:[{name:"UserId",type:"Edm.Guid",notes:"GUID of the calling user."},{name:"BusinessUnitId",type:"Edm.Guid",notes:"User's business unit."},{name:"OrganizationId",type:"Edm.Guid",notes:"Current org (tenant)."}],RetrieveTotalRecordCountResponse:[{name:"EntityRecordCountCollection",type:"EntityRecordCountCollection",notes:"Count keyed by entity logical name."}],GetTimeZoneCodeByLocalizedNameResponse:[{name:"TimeZoneCode",type:"Edm.Int32",notes:"Resolved timezone code."}],AddToQueueResponse:[{name:"QueueItemId",type:"Edm.Guid",notes:"GUID of the new queueitem row."}],RetrieveUserPrivilegesResponse:[{name:"RolePrivileges",type:"Collection(RolePrivilege)",notes:"Privileges granted by the user's security roles."}],RetrievePrincipalAccessResponse:[{name:"AccessRights",type:"AccessRights (bitmask)",notes:"Effective access rights as a comma-separated string."}],ExportTranslationResponse:[{name:"ExportTranslationFile",type:"Edm.Binary",notes:"Base64-encoded translation .zip."}],sample_SendNotificationResponse:[{name:"NotificationId",type:"Edm.Guid",notes:"GUID of the notification row created."},{name:"DeliveredAt",type:"Edm.DateTimeOffset",notes:"Server time the notification was queued."}]};function Ce(t){const r=/^Collection\((.+)\)$/.exec(t.trim());return r?r[1].trim():null}function re(t,r){if(t==="collection"){const i=Ce(r);return i?re("complex",i):[]}if(t!=="complex"&&t!=="entity")return[];const l=new Map,s=new Set,a=i=>{const o=Be(i.includes(".")?i:`mscrm.${i}`);if(!(!o||s.has(o.name))){s.add(o.name),o.baseType&&a(o.baseType);for(const c of o.properties)l.set(c.name,{name:c.name,type:c.type})}};return a(r),[...l.values()]}function Ee(t){return t.kind==="entity"&&re("entity",t.typeName).length>0?"complex":t.kind}function jt({action:t,pillText:r}){const l=be(),s=t.returnType,a=nt[s.typeName]??re(s.kind,s.typeName),i=r??(t.source==="custom-api"?"from Custom API def":"from $metadata"),o=s.kind==="collection"?Ce(s.typeName):null,c=e.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:11},children:[e.jsx("thead",{children:e.jsxs(G,{header:!0,children:[e.jsx(L,{children:"Name"}),e.jsx(L,{children:"Type"}),e.jsx(L,{children:"Notes"})]})}),e.jsx("tbody",{children:a.map(u=>e.jsxs(G,{children:[e.jsx($,{mono:!0,children:u.name}),e.jsx($,{children:u.type}),e.jsx($,{children:u.notes??""})]},u.name))})]});return e.jsxs("div",{className:Ne(l.inlineCard),style:{padding:12,maxWidth:980},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[e.jsx(Se,{style:{width:16,height:16,color:n.colorBrandForeground1}}),e.jsx("strong",{style:{fontSize:12},children:"Response properties"}),e.jsx(x,{appearance:"ghost",children:i}),e.jsx(x,{appearance:"tint",color:"brand",style:{marginLeft:4},children:Ee(s)}),e.jsx("span",{style:{flexGrow:1}}),e.jsx(f,{style:{color:n.colorNeutralForeground3,fontFamily:n.fontFamilyMonospace,fontSize:10},children:s.typeName})]}),s.kind==="void"?e.jsxs(f,{style:{color:n.colorNeutralForeground3,fontStyle:"italic",display:"block",padding:"6px 4px"},children:["No response body — Dataverse returns ",e.jsx("code",{children:"204 No Content"}),"."]}):s.kind==="primitive"?e.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:11},children:[e.jsx("thead",{children:e.jsxs(G,{header:!0,children:[e.jsx(L,{children:"Name"}),e.jsx(L,{children:"Type"}),e.jsx(L,{children:"Notes"})]})}),e.jsx("tbody",{children:e.jsxs(G,{children:[e.jsx($,{mono:!0,children:"value"}),e.jsx($,{children:s.typeName}),e.jsxs($,{children:["Single primitive value — server wraps it as ",e.jsx("code",{children:"{ value: ... }"}),"."]})]})})]}):s.kind==="collection"?e.jsxs(e.Fragment,{children:[e.jsxs(f,{style:{color:n.colorNeutralForeground3,display:"block",padding:"6px 4px"},children:["Returns a collection — body envelope is"," ",e.jsx("code",{children:'{ "@odata.context": "…", "value": [...] }'}),". Composable functions accept"," ",e.jsx("code",{children:"$select"})," / ",e.jsx("code",{children:"$filter"})," on the URL to scope columns.",a.length>0&&o&&e.jsxs(e.Fragment,{children:[" ","Each item is a"," ",e.jsx("code",{children:o.replace(/^(mscrm|Microsoft\.Dynamics\.CRM)\./,"")}),":"]})]}),a.length>0&&c]}):s.kind==="entity"&&a.length===0?e.jsxs(f,{style:{color:n.colorNeutralForeground3,display:"block",padding:"6px 4px"},children:["Returns an entity instance of type"," ",e.jsx("code",{style:{fontFamily:n.fontFamilyMonospace},children:s.typeName}),". Standard entity envelope with ",e.jsx("code",{children:"@odata.etag"}),"."]}):a.length>0?c:e.jsxs(f,{style:{color:n.colorNeutralForeground3,display:"block",padding:"6px 4px",fontStyle:"italic"},children:["Returns ",e.jsx("code",{style:{fontFamily:n.fontFamilyMonospace},children:s.typeName}),". Its properties aren't described in the loaded ",e.jsx("code",{children:"$metadata"}),"."]})]})}function G({children:t,header:r}){return e.jsx("tr",{style:{background:r?n.colorNeutralBackground3:"transparent"},children:t})}function L({children:t}){return e.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:10,fontWeight:600,color:n.colorNeutralForeground2,borderBottom:`1px solid ${n.colorNeutralStroke2}`},children:t})}function $({children:t,mono:r}){return e.jsx("td",{style:{padding:"6px 8px",borderBottom:`1px solid ${n.colorNeutralStroke3}`,fontFamily:r?n.fontFamilyMonospace:n.fontFamilyBase,verticalAlign:"top"},children:t})}const M="__unbound__",v="";function bt({filter:t,value:r,title:l,sub:s,onChange:a,group:i="execute"}){const[o,c]=y.useState(v),[u,p]=y.useState(""),[j,C]=y.useState(""),[F,B]=y.useState(null),[k,b]=y.useState(null);y.useEffect(()=>{let d=!1;return ze.loadAll().then(m=>{d||B(m)}).catch(m=>{d||b(m instanceof Error?m.message:String(m))}),()=>{d=!0}},[]);const g=F===null&&!k,N=y.useMemo(()=>(F??[]).filter(t),[F,t]),h=y.useMemo(()=>{let d=0,m=0;const S=new Map;for(const T of N){const D=Q(T)?1:0;if(T.binding.kind==="unbound")d++,m+=D;else{const ce=T.binding.entityType,de=S.get(ce)??{count:0,yours:0};S.set(ce,{count:de.count+1,yours:de.yours+D})}}const U=Array.from(S.entries()).sort((T,D)=>T[0].localeCompare(D[0])).map(([T,D])=>({logicalName:T,...D}));return{unboundCount:d,unboundYours:m,entities:U}},[N]),w=u.trim().toLowerCase(),oe=o===v?"":o===M?"Unbound":o,K=w.length>0&&w!==oe.toLowerCase(),se=y.useMemo(()=>{if(!K)return h.entities;const d=w;return h.entities.filter(m=>{if(m.logicalName.toLowerCase().includes(d))return!0;const S=_(m.logicalName);return S?S.displayName.toLowerCase().includes(d):!1})},[h.entities,K,w]),ie=h.unboundCount>0&&(!K||"unbound".includes(w)),z=y.useMemo(()=>o===v?[]:o===M?N.filter(d=>d.binding.kind==="unbound"):N.filter(d=>d.binding.kind!=="unbound"&&d.binding.entityType===o),[N,o]),E=r?N.find(d=>d.name===r):void 0,le=E?.displayName??E?.name??"",ae=j.trim().length>0&&j.trim()!==le,O=y.useMemo(()=>{if(!ae)return z;const d=j.toLowerCase();return z.filter(m=>m.name.toLowerCase().includes(d)||(m.displayName?.toLowerCase().includes(d)??!1)||(m.description?.toLowerCase().includes(d)??!1)||(m.publisher?.name.toLowerCase().includes(d)??!1))},[z,j,ae]),R=y.useMemo(()=>O.some(d=>d.publisher)?{yours:O.filter(Q),microsoft:O.filter(d=>!Q(d))}:null,[O]),Y=d=>e.jsx(I,{value:d.name,text:d.displayName??d.name,children:e.jsx(rt,{action:d})},d.name);return y.useEffect(()=>{C(le)},[r,F]),y.useEffect(()=>{p(oe)},[o]),y.useEffect(()=>{if(!r||o!==v||!F)return;const d=F.find(S=>S.name===r);if(!d)return;const m=d.binding.kind==="unbound"?M:d.binding.entityType;c(m)},[r,F,o]),y.useEffect(()=>{if(!E)return;if(o===v){a(null),C("");return}o===M&&E.binding.kind==="unbound"||o!==M&&E.binding.kind!=="unbound"&&E.binding.entityType===o||(a(null),C(""))},[o]),e.jsxs("div",{children:[e.jsx(Z,{icon:Fe,title:l,sub:s??"Browse the CSDL — pick an operation to populate its typed parameter form.",group:i,children:g?e.jsx(x,{appearance:"ghost",icon:e.jsx(ke,{size:"extra-tiny"}),children:"loading CSDL…"}):e.jsxs(x,{appearance:"ghost",children:[N.length," available"]})}),k&&Oe(k)?e.jsx(A,{intent:"error",layout:"multiline",style:{marginBottom:12,maxWidth:760},children:e.jsxs(W,{children:[e.jsx(De,{children:"This environment's metadata is too large for this version of Power Platform ToolBox"}),"This version of Power Platform ToolBox can't load a ",e.jsx("code",{children:"$metadata"})," document larger than 16 MB, so actions and functions can't be listed here. It will work once a ToolBox release includes the upstream fix (",e.jsx(X,{href:Le,target:"_blank",rel:"noopener noreferrer",children:"desktop-app#736"}),","," ",e.jsx(X,{href:"https://github.com/PowerPlatformToolBox/desktop-app/pull/737",target:"_blank",rel:"noopener noreferrer",children:"#737"}),"). Other request types aren't affected.",e.jsxs("div",{style:{marginTop:6,fontSize:12,opacity:.8},children:["Host error: ",k]})]})}):k&&e.jsx(A,{intent:"error",layout:"multiline",style:{marginBottom:12,maxWidth:760},children:e.jsxs(W,{children:["Couldn't load CSDL metadata: ",k]})}),e.jsxs("div",{style:{maxWidth:760,display:"flex",flexDirection:"column",gap:14},children:[e.jsx(ee,{label:"Scope",hint:"Pick Unbound or a binding entity. Required before choosing an operation.",children:e.jsxs(H,{freeform:!0,clearable:!0,value:u,selectedOptions:o===v?[]:[o],onChange:d=>{const m=d.target.value;p(m),m===""&&o!==v&&c(v)},onOptionSelect:(d,m)=>{const S=m.optionValue??v;c(S),p(S===v?"":S===M?"Unbound":S)},placeholder:g?"Loading…":N.length===0?"No operations available":`Pick scope · ${h.unboundCount} unbound, ${h.entities.length} entit${h.entities.length===1?"y":"ies"}`,disabled:g||N.length===0,listbox:{style:{maxHeight:360}},style:{width:"100%"},children:[ie&&e.jsx(I,{value:M,text:"Unbound",children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(x,{appearance:"ghost",size:"small",children:"Unbound"}),e.jsxs(f,{style:{color:n.colorNeutralForeground3},children:[h.unboundCount," op",h.unboundCount===1?"":"s",xe(h.unboundYours)," · invoked without a source record"]})]})}),se.map(d=>{const m=_(d.logicalName);return e.jsx(I,{value:d.logicalName,text:d.logicalName,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,minWidth:0},children:[e.jsx("span",{style:{fontFamily:n.fontFamilyMonospace,fontWeight:600},children:d.logicalName}),m&&e.jsx(f,{style:{color:n.colorNeutralForeground3},children:m.displayName}),e.jsx("span",{style:{flexGrow:1}}),e.jsxs(f,{style:{color:n.colorNeutralForeground3},children:[d.count," op",d.count===1?"":"s",xe(d.yours)]})]})},d.logicalName)}),se.length===0&&!ie&&e.jsx(I,{value:"__noscope",text:"",disabled:!0,children:e.jsxs(f,{style:{color:n.colorNeutralForeground3},children:['No scopes match "',w,'"']})})]})}),e.jsx(ee,{label:"Operation",children:e.jsxs(H,{freeform:!0,clearable:!0,value:j,selectedOptions:r?[r]:[],onChange:d=>{const m=d.target.value;C(m),m===""&&r&&a(null)},onOptionSelect:(d,m)=>{const S=m.optionValue??null;if(a(S),S){const U=N.find(T=>T.name===S);C(U?.displayName??U?.name??"")}else C("")},disabled:g||o===v,placeholder:g?"Loading actions from $metadata…":k?"CSDL load failed — see error above":o===v?"Pick a scope above first":z.length===0?`No ${N[0]?.kind?.toLowerCase()??"operation"}s in this scope`:`Search ${z.length} ${N[0]?.kind??"item"}${z.length===1?"":"s"}…`,listbox:{style:{maxHeight:420}},style:{width:"100%"},children:[R?e.jsxs(e.Fragment,{children:[R.yours.length>0&&e.jsx(he,{label:`Your org & ISVs (${R.yours.length})`,children:R.yours.map(Y)}),R.microsoft.length>0&&e.jsx(he,{label:`Microsoft (${R.microsoft.length})`,children:R.microsoft.map(Y)})]}):O.map(Y),O.length===0&&e.jsx(I,{value:"__none",text:"",disabled:!0,children:e.jsx("span",{style:{color:n.colorNeutralForeground3,fontSize:12},children:"No matches"})})]})}),E&&e.jsx("div",{style:{marginTop:16},children:e.jsx(ot,{action:E})})]})]})}function rt({action:t}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontFamily:n.fontFamilyMonospace,fontWeight:600},children:t.name}),e.jsx(x,{appearance:"ghost",size:"small",children:t.kind}),t.isComposable&&e.jsx(x,{appearance:"ghost",size:"small",children:"composable"}),t.publisher&&e.jsx(Re,{publisher:t.publisher}),e.jsx(x,{appearance:"tint",color:"brand",size:"small",style:{marginLeft:"auto"},children:t.kind==="Action"?"POST":"GET"})]}),e.jsxs(f,{style:{color:n.colorNeutralForeground3},children:[Me(t),t.description&&e.jsxs(e.Fragment,{children:[" ","· ",t.description.slice(0,110),t.description.length>110?"…":""]})]})]})}function ot({action:t}){const r=t.binding.kind!=="unbound"?_(t.binding.entityType):void 0;return e.jsxs("div",{style:{border:`1px solid ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium,padding:12,background:n.colorNeutralBackground1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[t.kind==="Function"?e.jsx(Se,{style:{color:n.colorBrandForeground1}}):e.jsx(Fe,{style:{color:n.colorBrandForeground1}}),e.jsx("strong",{style:{fontFamily:n.fontFamilyMonospace,fontSize:13},children:t.name}),e.jsx(x,{appearance:"tint",color:"brand",children:t.kind}),t.isComposable&&e.jsx(x,{appearance:"ghost",icon:e.jsx($e,{style:{width:10,height:10}}),children:"composable"}),e.jsx("span",{style:{flexGrow:1}}),e.jsx(x,{appearance:"filled",color:t.kind==="Action"?"success":"brand",style:{fontWeight:700},children:t.kind==="Action"?"POST":"GET"})]}),t.description&&e.jsx(f,{style:{color:n.colorNeutralForeground2,display:"block",marginBottom:8},children:t.description}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",rowGap:4,fontSize:11},children:[e.jsx("span",{style:{color:n.colorNeutralForeground3},children:"Namespace"}),e.jsx("span",{style:{fontFamily:n.fontFamilyMonospace},children:t.namespace}),e.jsx("span",{style:{color:n.colorNeutralForeground3},children:"Binding"}),e.jsxs("span",{children:[Me(t),r&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("span",{style:{fontFamily:n.fontFamilyMonospace,color:n.colorNeutralForeground3},children:r.entitySetName})]})]}),e.jsx("span",{style:{color:n.colorNeutralForeground3},children:"Parameters"}),e.jsx("span",{children:t.parameters.length===0?e.jsx("em",{style:{color:n.colorNeutralForeground3},children:"(none)"}):t.parameters.map(l=>e.jsxs(x,{appearance:"ghost",size:"small",style:{marginRight:4,fontFamily:n.fontFamilyMonospace},children:[l.name,": ",l.type,l.required?" *":""]},l.name))}),e.jsx("span",{style:{color:n.colorNeutralForeground3},children:"Return type"}),e.jsxs("span",{style:{fontFamily:n.fontFamilyMonospace},children:[t.returnType.typeName,e.jsxs(f,{style:{marginLeft:6,color:n.colorNeutralForeground3,fontFamily:n.fontFamilyBase},children:["(",Ee(t.returnType),")"]})]}),e.jsx("span",{style:{color:n.colorNeutralForeground3},children:"Source"}),e.jsx("span",{children:e.jsx(x,{appearance:"ghost",children:t.source})}),t.publisher&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:n.colorNeutralForeground3},children:"Publisher"}),e.jsx("span",{children:e.jsx(Re,{publisher:t.publisher})})]})]})]})}function Q(t){return!!t.publisher&&!t.publisher.microsoft}function xe(t){return t>0?`, ${t} yours`:""}function Re({publisher:t}){return e.jsx(x,{appearance:"outline",color:t.microsoft?"informative":"brand",size:"small",title:`Publisher: ${t.name}`,children:e.jsx("span",{style:{maxWidth:200,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name})})}function Me(t){switch(t.binding.kind){case"unbound":return"Unbound";case"entity":return`Bound to ${t.binding.entityType}`;case"collection":return`Bound to ${t.binding.entityType} collection`}}function st(t){return`https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/reference/${t.kind==="Action"?"actions":"functions"}?view=dataverse-latest`}function St({action:t,values:r,setValue:l,setValues:s,group:a="execute",themeMode:i="light"}){const o=be(),[c,u]=y.useState("form"),[p,j]=y.useState(""),[C,F]=y.useState(null);y.useEffect(()=>{if(c!=="json"){try{j(JSON.stringify(r,null,2))}catch{}return}try{j(JSON.stringify(r,null,2)),F(null)}catch(b){F(b instanceof Error?b.message:String(b))}},[c,r]);const B=st(t);if(t.parameters.length===0)return e.jsxs("div",{children:[e.jsx(Z,{icon:ue,title:"Parameters",sub:"No parameters — this operation can be invoked as-is.",group:a,children:B&&e.jsx(fe,{href:B})}),e.jsx(A,{layout:"multiline",intent:"info",style:{maxWidth:720},children:e.jsxs(W,{children:[e.jsx("code",{children:t.name})," takes no parameters. Click ",e.jsx("strong",{children:"Execute"})," to run it."]})})]});const k=t.parameters.filter(b=>b.required).filter(b=>J(r[b.name]));return e.jsxs("div",{children:[e.jsxs(Z,{icon:ue,title:"Parameters",sub:e.jsxs(e.Fragment,{children:["Required parameters first (marked"," ",e.jsx(x,{appearance:"tint",color:"danger",size:"small",children:"req"}),"). Optional parameters live in the accordion below.",k.length>0&&e.jsxs(e.Fragment,{children:[" · ",k.length," required unset."]})]}),group:a,children:[e.jsxs(x,{appearance:"ghost",children:[t.parameters.filter(b=>!J(r[b.name])).length," of"," ",t.parameters.length," set"]}),k.length>0&&e.jsxs(x,{appearance:"tint",color:"danger",children:[k.length," required unset"]}),B&&e.jsx(fe,{href:B}),s&&e.jsxs(ve,{ariaLabel:"Parameter editor mode",children:[e.jsx(V,{checked:c==="form",icon:e.jsx(te,{}),onClick:()=>u("form"),children:"Form"}),e.jsx(V,{checked:c==="json",icon:e.jsx(_e,{}),onClick:()=>u("json"),children:"JSON"})]})]}),c==="form"?(()=>{const b=t.parameters.filter(h=>h.required),g=t.parameters.filter(h=>!h.required),N=g.filter(h=>!J(r[h.name])).length;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,maxWidth:880},children:[b.map(h=>e.jsx(ge,{action:t,param:h,value:r[h.name],onChange:w=>l(h.name,w),styles:o},h.name)),b.length===0&&g.length>0&&e.jsx(f,{style:{color:n.colorNeutralForeground3,fontStyle:"italic",padding:"4px 2px"},children:"This operation has no required parameters — all inputs below are optional."}),g.length>0&&e.jsx(Ae,{collapsible:!0,multiple:!0,defaultOpenItems:N>0?["optional"]:[],children:e.jsxs(We,{value:"optional",children:[e.jsx(qe,{children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontWeight:600},children:"Optional parameters"}),e.jsxs(x,{appearance:"ghost",size:"small",children:[N," of ",g.length," set"]})]})}),e.jsx(Ue,{children:e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,paddingTop:6},children:g.map(h=>e.jsx(ge,{action:t,param:h,value:r[h.name],onChange:w=>l(h.name,w),styles:o},h.name))})})]})})]})})():e.jsx(it,{text:p,error:C,themeMode:i,onChange:b=>{j(b);try{const g=JSON.parse(b||"{}");g&&typeof g=="object"&&!Array.isArray(g)?(F(null),s?.(g)):F("Top-level must be a JSON object.")}catch(g){F(g instanceof Error?g.message:String(g))}}})]})}function fe({href:t}){return e.jsx(X,{href:t,target:"_blank",rel:"noopener noreferrer",style:{fontSize:11},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:["MS Learn ",e.jsx(Ge,{style:{width:12,height:12}})]})})}function it({text:t,error:r,themeMode:l,onChange:s}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,maxWidth:880},children:[e.jsx(A,{layout:"multiline",intent:"info",children:e.jsxs(W,{children:["Hand-craft the request body as JSON. Useful when the metadata-driven form can't express the shape — e.g. Int32 params whose values map to documented enums, EntitySpecific params that should be ",e.jsx("code",{children:'{ "@odata.id": "<set>(<id>)" }'})," references instead of inline instances, or Custom API params with domain-specific shapes. Refer to the MS Learn page for the canonical body."]})}),e.jsx("div",{style:{border:`1px solid ${r?n.colorPaletteRedBorder2:n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium,overflow:"hidden",height:360},children:e.jsx(et,{height:"100%",language:"json",value:t,onChange:a=>s(a??""),theme:l==="dark"?"vs-dark":"light",options:{lineNumbers:"on",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontFamily:"Cascadia Mono, Consolas, monospace",fontSize:13,tabSize:2,wordWrap:"on",automaticLayout:!0,padding:{top:12,bottom:12},bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0},smoothScrolling:!0,formatOnPaste:!0}})}),r&&e.jsxs(f,{style:{color:n.colorPaletteRedForeground1},children:["Parse error: ",r]})]})}function ge({action:t,param:r,value:l,onChange:s,styles:a}){const i=r.required&&J(l);return e.jsxs("div",{"data-focus-node":`param:${r.name}`,className:Ne(a.inlineCard),style:{padding:12,display:"grid",gridTemplateColumns:"220px 1fr",gap:14,alignItems:"start",borderColor:i?n.colorPaletteRedBorder2:void 0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2,paddingTop:4},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontFamily:n.fontFamilyMonospace,fontWeight:600},children:r.name}),r.required&&e.jsx(x,{appearance:"tint",color:"danger",size:"small",children:"req"})]}),e.jsxs(f,{style:{color:n.colorNeutralForeground3,fontSize:10},children:[e.jsx("span",{style:{color:n.colorBrandForeground2,fontFamily:n.fontFamilyMonospace},children:r.type}),r.entityType&&e.jsxs(e.Fragment,{children:[" · ",r.entityType]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,minWidth:0},children:[e.jsx(Ie,{action:t,param:r,value:l,onChange:s}),r.description&&e.jsx(f,{style:{color:n.colorNeutralForeground3},children:r.description})]})]})}const q=y.createContext("Parameter value");function Ie(t){return e.jsx(q.Provider,{value:t.param.name,children:e.jsx(lt,{...t})})}function lt({action:t,param:r,value:l,onChange:s}){switch(r.type){case"Edm.String":return e.jsx(P,{"aria-label":r.name,size:"small",value:l??"",onChange:(a,i)=>s(i.value),placeholder:"value"});case"Edm.Guid":return e.jsx(P,{"aria-label":r.name,size:"small",value:l??"",onChange:(a,i)=>s(i.value),placeholder:"00000000-0000-0000-0000-000000000000",style:{fontFamily:n.fontFamilyMonospace}});case"Edm.Int32":case"Edm.Int64":return e.jsx(pe,{"aria-label":r.name,size:"small",value:Number.isFinite(l)?l:0,step:1,precision:0,onChange:(a,i)=>{const o=i.value!=null?i.value:i.displayValue!=null?Number(i.displayValue):NaN;Number.isFinite(o)&&s(Math.trunc(o))}});case"Edm.Decimal":case"Edm.Double":return e.jsx(pe,{"aria-label":r.name,size:"small",value:Number(l??0),step:.01,onChange:(a,i)=>s(i.value??Number(i.displayValue??0))});case"Edm.Boolean":return e.jsx(Je,{checked:l===!0,onChange:(a,i)=>s(i.checked),label:l===!0?"true":"false"});case"Edm.DateTimeOffset":return e.jsx(at,{value:l??"",onChange:s});case"OptionSetValue":return e.jsx(ct,{param:r,value:l,onChange:s});case"Collection(Edm.String)":return e.jsx(je,{value:l??[],onChange:s});case"Collection(Edm.Int32)":return e.jsx(dt,{value:l??[],onChange:s});case"Collection(Edm.Guid)":return e.jsx(je,{value:l??[],onChange:s,mono:!0});case"EntityReference":return e.jsx(Pe,{value:l,onChange:s,param:r,polymorphic:!0});case"EntitySpecific":return e.jsx(pt,{param:r,value:l,onChange:s});case"EntityCollection":return e.jsx(ut,{value:l??[],onChange:s,param:r});case"ComplexType":return e.jsx(yt,{param:r,value:l,onChange:s});case"Edm.Binary":return e.jsx(P,{"aria-label":r.name,size:"small",value:l??"",onChange:(a,i)=>s(i.value),placeholder:"base64-encoded bytes",style:{fontFamily:n.fontFamilyMonospace}})}}function at({value:t,onChange:r}){const l=y.useContext(q),s=t?new Date(t):null,a=s&&!Number.isNaN(s.getTime())?s:null,i=c=>{if(!c){r("");return}const u=new Date(c);a&&u.setHours(a.getHours(),a.getMinutes(),0,0),r(u.toISOString())},o=c=>{if(!c||!a)return;const u=new Date(a);u.setHours(c.getHours(),c.getMinutes(),0,0),r(u.toISOString())};return e.jsxs("span",{style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[e.jsx(Ze,{"aria-label":`${l} (date)`,size:"small",value:a,onSelectDate:i,placeholder:"Date…",formatDate:c=>c?c.toLocaleDateString():"",allowTextInput:!0,style:{minWidth:130}}),e.jsx(Xe,{"aria-label":`${l} (time)`,size:"small",freeform:!0,selectedTime:a,onTimeChange:(c,u)=>o(u.selectedTime),placeholder:"Time…",style:{minWidth:100},hourCycle:"h23"})]})}function ct({param:t,value:r,onChange:l}){const s=t.optionSet??[],a=s.find(i=>i.value===r);return e.jsx(H,{"aria-label":t.name,size:"small",value:a?.label??(r!=null?String(r):""),selectedOptions:r!=null?[String(r)]:[],onOptionSelect:(i,o)=>o.optionValue&&l(Number(o.optionValue)),placeholder:"Pick a value…",children:s.map(i=>e.jsxs(I,{value:String(i.value),text:i.label,children:[i.label,e.jsxs("span",{style:{color:n.colorNeutralForeground3,fontFamily:n.fontFamilyMonospace,fontSize:10,marginLeft:6},children:["· ",i.value]})]},i.value))})}function je({value:t,onChange:r,mono:l}){const s=y.useContext(q),[a,i]=y.useState("");return e.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.map((o,c)=>e.jsx(Te,{shape:"rounded",dismissible:!0,onClick:()=>r(t.filter((u,p)=>p!==c)),style:{fontFamily:l?n.fontFamilyMonospace:n.fontFamilyBase},children:o},c)),e.jsx(P,{"aria-label":`${s} item to add`,size:"small",placeholder:"add… (Enter)",style:{width:160,fontFamily:l?n.fontFamilyMonospace:n.fontFamilyBase},value:a,onChange:(o,c)=>i(c.value),onKeyDown:o=>{if(o.key==="Enter"){const c=a.trim();c&&(r([...t,c]),i("")),o.preventDefault()}}})]})}function dt({value:t,onChange:r}){const l=y.useContext(q),[s,a]=y.useState("");return e.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.map((i,o)=>e.jsx(Te,{shape:"rounded",dismissible:!0,onClick:()=>r(t.filter((c,u)=>u!==o)),children:String(i)},o)),e.jsx(P,{"aria-label":`${l} item to add`,size:"small",type:"number",placeholder:"add… (Enter)",style:{width:120},value:s,onChange:(i,o)=>a(o.value),onKeyDown:i=>{if(i.key==="Enter"){const o=s.trim(),c=Number(o);o!==""&&Number.isFinite(c)&&(r([...t,c]),a("")),i.preventDefault()}}})]})}function Pe({value:t,onChange:r,param:l,polymorphic:s}){const a=y.useContext(q),{entities:i}=Qe(),o=t?.entityType??l.entityType??"";ne(o||null);const c=_(o);return e.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[s&&e.jsx(H,{"aria-label":`${a} (table)`,size:"small",value:c?.displayName??o,selectedOptions:[o],onOptionSelect:(u,p)=>{p.optionValue&&r({id:"",entityType:p.optionValue})},placeholder:"Pick target entity…",children:i.map(u=>e.jsx(I,{value:u.logicalName,text:u.displayName,children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx("span",{children:u.displayName}),e.jsx(f,{style:{color:n.colorNeutralForeground3,fontFamily:n.fontFamilyMonospace},children:u.logicalName})]})},u.logicalName))}),!s&&e.jsxs(x,{appearance:"ghost",style:{fontFamily:n.fontFamilyMonospace,alignSelf:"flex-start"},children:["→ ",c?.entitySetName??o]}),o&&e.jsx(we,{table:o,selectedId:t?.id||null,onPick:u=>r(u?{id:u.id,entityType:o}:null),placeholder:`Search ${c?.displayName??o} records…`}),o&&e.jsxs(f,{style:{color:n.colorNeutralForeground3,fontSize:10},children:["Emitted as"," ",e.jsxs("code",{style:{fontFamily:n.fontFamilyMonospace},children:["@odata.type=Microsoft.Dynamics.CRM.",o]})]})]})}function ut({value:t,onChange:r,param:l}){const s=l.entityType??"";ne(s||null);const a=_(s),[i,o]=y.useState(0),c=p=>{p&&(t.some(j=>j.id===p)||(r([...t,{id:p,entityType:s}]),o(j=>j+1)))},u=p=>r(t.filter(j=>j.id!==p));return s?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[e.jsxs(x,{appearance:"ghost",style:{fontFamily:n.fontFamilyMonospace,alignSelf:"flex-start"},children:["→ Collection(",s,")"]}),t.length>0&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:6,border:`1px solid ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium},children:t.map(p=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(He,{size:"extra-small",name:p.id,avatar:{color:"colorful"}}),e.jsxs("code",{style:{flex:1,minWidth:0,fontFamily:n.fontFamilyMonospace,fontSize:11,color:n.colorNeutralForeground3},children:["/",a?.entitySetName??s,"(",p.id,")"]}),e.jsx(Ve,{size:"small",appearance:"subtle",onClick:()=>u(p.id),children:"Remove"})]},p.id))}),e.jsx(we,{table:s,selectedId:null,onPick:p=>c(p?.id??null),placeholder:`Add ${a?.displayName??s} record…`},i)]}):e.jsx(A,{layout:"multiline",intent:"warning",children:e.jsx(W,{children:"This collection parameter has no entity type declared in CSDL."})})}function pt({param:t,value:r,onChange:l}){const[s,a]=y.useState(null),i=ye(r)?"reference":r!=null&&typeof r=="object"&&Object.keys(r).length>0?"instance":s??Ke(t),o=p=>{p!==i&&(a(p),l(void 0))},c=t.entityType??"",u=ye(r)?r["@ref"]:"";return e.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[e.jsxs(ve,{ariaLabel:`${t.name}: existing record or new instance`,children:[e.jsx(V,{size:"small",checked:i==="reference",icon:e.jsx(Ye,{}),onClick:()=>o("reference"),children:"Existing record"}),e.jsx(V,{size:"small",checked:i==="instance",icon:e.jsx(te,{}),onClick:()=>o("instance"),children:"New instance"})]}),i==="reference"?e.jsx(Pe,{value:c?{id:u,entityType:c}:void 0,onChange:p=>l(p?.id?{"@ref":p.id}:void 0),param:t,polymorphic:!1}):e.jsx(mt,{param:t,value:r,onChange:l})]})}function mt({param:t,value:r,onChange:l}){const s=y.useContext(q),a=t.entityType??"",{loading:i}=ne(a||null),o=_(a),c=r??{};return o?e.jsxs("div",{style:{padding:10,background:n.colorNeutralBackground2,border:`1px dashed ${n.colorBrandStroke2}`,borderRadius:n.borderRadiusMedium},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:10},children:[e.jsx(te,{style:{width:14,height:14,color:n.colorBrandForeground1}}),e.jsx("strong",{style:{fontSize:11},children:o.displayName}),e.jsx(f,{style:{color:n.colorNeutralForeground3},children:"new entity instance · @odata.type discriminator added automatically"})]}),e.jsx(tt,{table:a,values:c,setValues:u=>l(u),group:"execute"})]}):i?e.jsxs("div",{style:{padding:10,background:n.colorNeutralBackground2,border:`1px dashed ${n.colorBrandStroke2}`,borderRadius:n.borderRadiusMedium,display:"flex",alignItems:"center",gap:8},children:[e.jsx(ke,{size:"extra-tiny"}),e.jsxs(f,{style:{color:n.colorNeutralForeground3},children:["Loading ",e.jsx("code",{children:a})," metadata from Dataverse — typed form will appear shortly…"]})]}):e.jsxs(A,{layout:"multiline",intent:"warning",children:[e.jsxs(W,{children:["No metadata for entity type ",e.jsx("code",{children:a})," — the entity isn't available in this environment. For now, edit the JSON inline:"]}),e.jsx(P,{"aria-label":`${s} (JSON)`,size:"small",value:JSON.stringify(c),onChange:(u,p)=>{try{const j=JSON.parse(p.value||"{}");j&&typeof j=="object"&&l(j)}catch{}},style:{fontFamily:n.fontFamilyMonospace,fontSize:11,marginTop:6}})]})}function yt({param:t,value:r,onChange:l}){const s=t.complexType?.fields??[],a=r??{};return s.length===0?e.jsxs("div",{style:{padding:10,background:n.colorNeutralBackground2,border:`1px dashed ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[e.jsx(me,{style:{width:14,height:14,color:n.colorNeutralForeground3}}),e.jsx("strong",{style:{fontSize:11},children:t.complexType?.name??t.name}),e.jsx(f,{style:{color:n.colorNeutralForeground3},children:"complex type · no field schema in mock — edit JSON"})]}),e.jsx(P,{"aria-label":`${t.name} (JSON)`,size:"small",value:JSON.stringify(a),onChange:(i,o)=>{try{const c=JSON.parse(o.value||"{}");c&&typeof c=="object"&&!Array.isArray(c)&&l(c)}catch{}},style:{fontFamily:n.fontFamilyMonospace,fontSize:11,width:"100%"}})]}):e.jsxs("div",{style:{padding:10,background:n.colorNeutralBackground2,border:`1px dashed ${n.colorNeutralStroke2}`,borderRadius:n.borderRadiusMedium,display:"flex",flexDirection:"column",gap:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(me,{style:{width:14,height:14,color:n.colorNeutralForeground3}}),e.jsx("strong",{style:{fontSize:11},children:t.complexType?.name??t.name}),e.jsx(f,{style:{color:n.colorNeutralForeground3},children:"nested complex type"})]}),s.map(i=>e.jsx(ee,{label:e.jsxs("span",{style:{fontFamily:n.fontFamilyMonospace,fontSize:11},children:[i.name," ",e.jsxs("span",{style:{color:n.colorNeutralForeground3},children:["· ",i.type]}),i.required&&e.jsx(x,{appearance:"tint",color:"danger",size:"small",style:{marginLeft:6},children:"req"})]}),hint:i.description,children:e.jsx(Ie,{param:i,value:a[i.name],onChange:o=>l({...a,[i.name]:o})})},i.name))]})}function J(t){return t==null||typeof t=="string"&&t===""||Array.isArray(t)&&t.length===0?!0:typeof t=="object"&&t!==null&&"id"in t?!t.id:!1}export{St as A,jt as R,bt as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as j,bb as U,bf as _,R as V,j as e,ay as P,b_ as N,au as B,bt as J,bd as Q,t as a,B as y,C as f,r as E,bg as X,M as O,m as C,aW as M,ca as Y,bS as Z,s as ee,b4 as te,bv as ne,be as ae,aU as re,o as se,an as oe,aG as le,cb as ie}from"./index-NW0Z4UWR.js";function pe({table:t,value:s,onChange:n,group:o="relate",forOperation:l,footer:d}){const u=j(t)?.navigationProperties??[],g=u.find(i=>i.name===s),F=U(),m=u.filter(i=>_(i,F)||i.name===s);return V(g?.targetEntity??null),e.jsxs("div",{children:[e.jsx(P,{icon:N,title:"Navigation property",sub:"Cardinality is detected from metadata — the URL bar verb + shape adapt automatically.",group:o}),e.jsxs("div",{style:{maxWidth:720},children:[e.jsx(B,{label:"Navigation property",children:e.jsx(J,{value:g?.name??"",selectedOptions:g?[g.name]:[],onOptionSelect:(i,k)=>n(k.optionValue??null),placeholder:"Pick a navigation property…",children:m.map(i=>e.jsx(Q,{value:i.name,text:i.name,children:e.jsx(ce,{nav:i,forOperation:l})},i.name))})}),g&&e.jsx("div",{style:{marginTop:16},children:e.jsx(de,{nav:g,forOperation:l})}),d&&e.jsx("div",{style:{marginTop:14},children:d})]})]})}function ce({nav:t,forOperation:s}){const n=j(t.targetEntity),o=W(t,s);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontFamily:a.fontFamilyMonospace,fontWeight:600},children:t.name}),e.jsx(y,{appearance:"ghost",size:"small",children:R(t.cardinality)}),e.jsx(y,{appearance:"tint",color:"brand",size:"small",style:{marginLeft:"auto"},children:o})]}),e.jsxs(f,{style:{color:a.colorNeutralForeground3},children:["→ ",n?.displayName??t.targetEntity," · ",he(t.cardinality)]})]})}function de({nav:t,forOperation:s}){const n=j(t.targetEntity),o=W(t,s),l=t.cardinality==="ManyToOne"?"single-valued":"collection-valued",d=o==="POST"?a.colorPaletteGreenForeground1:o==="PATCH"?a.colorPaletteDarkOrangeForeground1:a.colorPaletteRedForeground1;return e.jsxs("div",{style:{border:`1px solid ${a.colorNeutralStroke2}`,borderRadius:a.borderRadiusMedium,padding:12,background:a.colorNeutralBackground1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx(N,{style:{width:18,height:18,color:a.colorBrandForeground1}}),e.jsx("strong",{style:{fontFamily:a.fontFamilyMonospace,fontSize:13},children:t.name}),e.jsx(y,{appearance:"tint",color:"brand",children:R(t.cardinality)}),e.jsx("span",{style:{flexGrow:1}}),e.jsx(y,{appearance:"filled",style:{background:d,color:a.colorNeutralForegroundOnBrand,fontWeight:700},children:o})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",rowGap:4,fontSize:11},children:[e.jsx("span",{style:{color:a.colorNeutralForeground3},children:"Target entity"}),e.jsxs("span",{style:{fontFamily:a.fontFamilyMonospace},children:[n?.entitySetName??t.targetEntity," ",e.jsxs(f,{style:{color:a.colorNeutralForeground3},children:["· ",n?.displayName??t.targetEntity]})]}),e.jsx("span",{style:{color:a.colorNeutralForeground3},children:"Cardinality"}),e.jsxs("span",{children:[l," (",t.cardinality,")"]}),e.jsx("span",{style:{color:a.colorNeutralForeground3},children:"Relationship"}),e.jsx("span",{style:{fontFamily:a.fontFamilyMonospace,fontSize:10},children:t.relationshipName})]})]})}function R(t){switch(t){case"OneToMany":return"1:N";case"ManyToOne":return"N:1";case"ManyToMany":return"N:N"}}function he(t){return t==="ManyToOne"?"single-valued lookup":"collection-valued"}function W(t,s){return t.cardinality==="ManyToOne"?"PATCH":s==="disassociate"?"DELETE":"POST"}function w(t,s){return t||s===1?"Target record":"Target records"}function ye({table:t,navProperty:s,targets:n,setTargets:o,targetNames:l,setTargetNames:d,group:b="relate",resolvedMethod:u,sub:g,verb:F="POST",changeSet:m=!1,footer:i}){const[k,$]=E.useState({}),v=l??k,A=d??$,q=X(),z=j(t),p=s?z?.navigationProperties.find(r=>r.name===s):void 0,x=p?j(p.targetEntity):void 0,c=p?.cardinality==="ManyToOne",D=c?1:1/0,[I,H]=E.useState(0);if(!p)return e.jsxs("div",{children:[e.jsx(P,{icon:N,title:w(!1,n.length),sub:"Pick a navigation property first.",group:b}),e.jsx(O,{layout:"multiline",intent:"info",style:{maxWidth:720},children:e.jsxs(C,{children:["Switch to the ",e.jsx("strong",{children:"Navigation property"})," pane and pick one — the target entity comes from there."]})})]});const S=n.length>=D,L=(r,h)=>{if(!r||n.includes(r)||S)return;const T=c?[r]:[...n,r];o(T),h&&A({...v,[r]:h}),H(K=>K+1)},G=r=>{if(o(n.filter(h=>h!==r)),v[r]!=null){const h={...v};delete h[r],A(h)}};return e.jsxs("div",{children:[e.jsxs(P,{icon:N,title:w(c,n.length),sub:e.jsx("span",{children:g??(c?e.jsxs(e.Fragment,{children:["One target is allowed for ",e.jsx("code",{children:p.cardinality})," nav props — a PATCH with"," ",e.jsxs("code",{children:[p.name,"@odata.bind"]})," sets the lookup."]}):e.jsxs(e.Fragment,{children:["One or more targets —"," ",m?e.jsxs(e.Fragment,{children:["sent together as one ",e.jsx("code",{children:"$batch"})," change set (All or nothing)."]}):e.jsxs(e.Fragment,{children:["each fires a separate POST request. For many targets, Dataverse recommends a"," ",e.jsx("code",{children:"$batch"})," request."]})]}))}),group:b,children:[e.jsxs(y,{appearance:"tint",color:n.length>0?"brand":"subtle",children:[n.length," target",n.length===1?"":"s"]}),u&&e.jsx(y,{appearance:"filled",color:u==="POST"?"success":"informative",style:{fontWeight:700},children:u}),!c&&n.length>1&&e.jsx(M,{content:m?"Sent together as one $batch change set: all succeed or none do.":"Will fire one request per target. Turn on All or nothing to send them as one $batch change set.",relationship:"description",children:e.jsxs(y,{appearance:"ghost",icon:e.jsx(Y,{style:{width:12,height:12}}),children:[n.length," requests ",m?"· 1 change set":"queued"]})})]}),e.jsx("div",{className:ne(q.inlineCard),style:{padding:12,marginBottom:14,maxWidth:880},children:n.length===0?e.jsxs(f,{style:{padding:"12px 4px",color:a.colorNeutralForeground3,fontStyle:"italic",display:"block",textAlign:"center"},children:["No targets selected — use the picker below to choose"," ",c?"one":"one or more"," ",e.jsx("strong",{children:x?.displayName??p.targetEntity})," record",c?"":"s","."]}):e.jsx("div",{style:{display:"flex",flexDirection:"column"},children:n.map((r,h)=>{const T=v[r];return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 4px",borderBottom:h<n.length-1?`1px solid ${a.colorNeutralStroke3}`:"none"},children:[e.jsx(Z,{size:"small",name:T??"?",avatar:{color:"colorful"}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600},children:T??e.jsx("span",{style:{fontStyle:"italic",color:a.colorNeutralForeground3},children:"(name not resolved)"})}),e.jsxs("div",{style:{fontFamily:a.fontFamilyMonospace,fontSize:10,color:a.colorNeutralForeground3},children:["/",x?.entitySetName??"?","(",r,")"]})]}),e.jsx(M,{content:"Remove target",relationship:"label",children:e.jsx(ee,{size:"small",appearance:"subtle",icon:e.jsx(te,{}),onClick:()=>G(r),"aria-label":"Remove target"})})]},r)})})}),!S&&e.jsxs("div",{style:{maxWidth:560},children:[e.jsx(B,{label:c?"Pick target":"Add target",hint:c?`Pick a single ${x?.displayName??"record"} — the PATCH sets this as the lookup value.`:`Each pick queues ${m?"one more request in the change set":`a separate ${F}`}. Currently ${n.length} target${n.length===1?"":"s"} queued.`,children:e.jsx(ae,{table:x?.logicalName??p.targetEntity,selectedId:null,onPick:r=>L(r?.id??null,r?.primary),placeholder:`Search ${x?.displayName??"record"}s…`},I)}),!c&&e.jsxs(f,{style:{display:"block",marginTop:6,color:a.colorNeutralForeground3},children:[e.jsx(re,{style:{width:12,height:12,verticalAlign:"middle"}})," picking a record adds it to the queue and resets the picker for the next pick."]})]}),S&&c&&e.jsx(O,{layout:"multiline",intent:"info",style:{maxWidth:720,marginTop:12},children:e.jsxs(C,{children:[e.jsx(se,{children:"Single-valued nav property — one target only."}),"To change the target, remove the current one first. The PATCH replaces the previous lookup value."]})}),i]})}const ue=()=>le()&&!ie();function me({checked:t,onChange:s,targets:n,verb:o}){const l=ue(),d=o==="POST"?"linked":"unlinked";return e.jsxs("div",{style:{maxWidth:720,marginTop:18},children:[e.jsx(oe,{checked:t&&!l,disabled:l,onChange:(b,u)=>s(!!u.checked),label:"All or nothing"}),e.jsxs(f,{style:{display:"block",marginTop:2,marginLeft:44,color:a.colorNeutralForeground3},children:[t&&!l?e.jsxs(e.Fragment,{children:["The ",o," requests go together as one ",e.jsx("code",{children:"$batch"})," change set: if any target fails, Dataverse rolls back the rest, so nothing is ",d,"."]}):e.jsxs(e.Fragment,{children:["Off: one ",o," per target, in order. A failure part-way leaves the targets before it"," ",d,". Turn on to send them as one ",e.jsx("code",{children:"$batch"})," change set instead."]}),t&&!l&&n<2&&" Takes effect with two or more targets."]}),l&&e.jsx(O,{layout:"multiline",intent:"info",style:{marginTop:8},children:e.jsx(C,{children:"Sending a change set requires Power Platform ToolBox 1.2.7 or later, so the requests go one at a time."})})]})}export{ye as A,pe as N,me as a,w as t};
|