feat(dw-data-access): Dw.Api.psm1 shared connection module - #92
Open
Justinvolved wants to merge 1 commit into
Open
feat(dw-data-access): Dw.Api.psm1 shared connection module#92Justinvolved wants to merge 1 commit into
Justinvolved wants to merge 1 commit into
Conversation
Justinvolved
force-pushed
the
feat/dw-data-access-module
branch
from
September 1, 2026 09:20
89de108 to
c647b87
Compare
Justinvolved
force-pushed
the
feat/dw-data-access-module
branch
from
September 1, 2026 09:35
c647b87 to
c0d83e4
Compare
This was referenced Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 3 of the default-scripts sequence, stacked on #91 (retarget after #91 merges, before its branch is deleted). Ships the shared-module half of the settled "shared vs self-contained" decision: one implementation of the Admin API / MCP / SQL-read plumbing the demo-build survey found re-implemented ~20 times. Version 4.24.0.
Scope decision (owner call): no scheduled-task SQL path. SQL is local-only — a hosted install exposes no SQL surface, and arbitrary SQL on a cloud install has no remediation short of a backup restore. The module therefore ships direct SQL readers for local installs and deliberately no RunSql scheduled-task runner or any other remote SQL path;
management-api-and-sql.mdstates the rule.Contents
skills/dw-data-access/scripts/Dw.Api.psm1—Connect-Dw/Assert-DwConnection(discovery order parameter >$env:DW_*>launchSettings.json> fail with the fix; load sentinel for the AMSI-blocked-import trap),Invoke-DwApi(UTF-8 byte bodies, depth-50, TLS bypass gated to localhost or explicit-AllowSelfSignedCertificate),Remove-DwDisplayOnlyMember(modelIdentifier/*Iconstrip),Invoke-DwMcp/Get-DwMcpTools(handshake,mcp-session-id, SSE unwrap, cursor pagination),Get-DwSqlRows/Get-DwSqlScalar(rawSqlDataReader→pscustomobject; one-row results stay arrays; JSON-safe; LOCAL installs only),Clear-DwServiceCache,Set-DwDbConnectionTrust. Tokens masked everywhere.dw-data-accessSKILL.md:compatibility:frontmatter,## Scripts (scripts/)table, canonical import + assert form.management-api-and-sql.md(wrapper section + the strip / unrolling / AMSI traps, plus the SQL-is-local-only rule) anddw-demo-basemcp-setup.md(JSON-RPC fallback) now name the module as the enforced form; the rules and the why stay in prose.marketplace.json:dw-data-accessadded todynamicweb-commerce(bundle closure for the upcomingdw-search-indexingscript); README bundle table updated.Verification
[Parser]::ParseFile;Get-Helprenders for all 10 exports; chore(validator): enforce the script contract #91's negative test confirms a cross-skill import from a bundle that does not shipdw-data-accesserrors.Connect-Dw -SolutionPath <solution>discovered the port fromlaunchSettings.json; TLS bypass auto-gated on for localhost.(Invoke-DwApi 'GetPageById?Id=1').modelreturned the model.Get-DwMcpToolsreturned 393 tools (the documented 10.27.x count; > 200 gate).Invoke-DwMcp 'get_shops'returned structuredContent.Get-DwSqlRowson a one-row query returnedObject[]of length 1 withPSCustomObjectrows that serialize to JSON instantly;Get-DwSqlScalarreturned the count.Clear-DwServiceCache -CacheTypeName Dynamicweb.Ecommerce.Shops.ShopServicesucceeded.Assert-DwConnection/Invoke-DwApiwith nothing resolvable fail loudly with the fix one-liner.Set-DwDbConnectionTrustwas not exercised live (it rewrites the host's DB settings); it is a faithful lift of the proven demo-build script.