npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

proximo3-audit-restore

v1.8.0

Published

Restore Dataverse records to their field state at a point in time using the audit log. Find affected records by table/user/date window, preview before→after changes, and apply in pages.

Downloads

519

Readme

Audit Restore — Power Platform Toolbox tool

Audit Restore

by Mark Christie

Restore Dataverse records to their field state at a point in time, sourced from the audit log. Find the affected records by table / user / date window, preview the exact before → after changes, then apply them in pages of 100.

What this does

For every record returned by your FetchXML, it rolls back every change made after the date/time you specify, restoring each field to the value it held as of that moment. Anything dated past your cutoff is discarded — it is not restored.

Mechanically: it takes the earliest audit entry on-or-after your date; that entry's "before" snapshot is the state at your date.

Always run Preview first and review before applying. There is no automatic undo.

⚠️ How the restore is written: this tool changes your data by updating each record through the Dataverse Web API — an HTTP PATCH per record (dataverseAPI.update inside Toolbox; an authenticated same-origin PATCH as a web resource). It writes the reconstructed point-in-time field values straight onto the live records, field by field. There is no Dataverse backup or platform "restore" involved — it's ordinary Web API writes, so every change is subject to your plugins, business rules, and security, and each write itself creates a new audit entry.

At a glance

  1. Records & recovery point — pick an audited table + user + date window (or paste FetchXML), and set the recovery date/time.
  2. Run — choose how many records (10 / 100 / 1000 / all), optionally exclude recently-reverted ones, then Preview.
  3. Review the before → after list (paged 100 at a time), then Apply this page or Apply all.

This is the Power Platform Toolbox packaging of the single-file audit-restore.html. The same file runs in three hosts — it auto-detects each and uses the right data API and theme:

| Host | Data | Theme | |------|------|-------| | Power Platform Toolbox | window.dataverseAPI | dark (default) | | XrmToolBox (WebView2 plugin — see xrmtoolbox/) | Web API + injected OAuth token | Windows 95 | | D365 web resource / standalone | same-origin fetch | light |

How it talks to Dataverse

Tools on Power Platform Toolbox never handle tokens. The host injects:

  • window.dataverseAPIqueryData, fetchXmlQuery, update, retrieve, getEntityMetadata, execute.
  • window.toolboxAPIconnections.getActiveConnection(), events.on(...), utils.showNotification(...).

The tool detects window.dataverseAPI and routes all reads/writes through it, so it automatically uses the logged-in connection's token and targets whichever instance is currently selected in Toolbox. On connection:updated it reloads against the new instance. The connected environment name is shown in the header; the org version is read via RetrieveVersion.

| Tool operation | Web resource (fetch) | Toolbox (dataverseAPI) | |---|---|---| | OData query (audits, systemusers, exclude) | GET /api/data/v9.2/... | queryData(path) | | FetchXML (record finder) | ?fetchXml= | fetchXmlQuery(xml) | | Audit detail / metadata / version | GET ... | queryData(...) / execute(...) | | Restore write | PATCH | update(logicalName, id, patch) |

Build

cd pptb-audit-restore
node build.js

This produces dist/ with index.html (the tool), icon.svg, package.json, LICENSE, and README.md — the layout Toolbox expects (main and icon are relative to the dist root). npm publish is run from dist/.

Publish to the public Power Platform Toolbox catalog

The catalog is npm-based: publish to npm, then submit the npm package name to the registry.

1. Public GitHub mirror — the catalog review requires a publicly accessible repo. Create https://github.com/TheMarkChristie/pptb-audit-restore (public) and push this folder:

git init && git add . && git commit -m "Audit Restore PPTB tool"
git branch -M main
git remote add origin https://github.com/TheMarkChristie/pptb-audit-restore.git
git push -u origin main

2. Build + validate

node build.js
npx pptb-validate            # checks package.json against the review rules

3. Publish to npm (npm login first — no org needed for an unscoped name)

cd dist
npm publish

4. Smoke-test the published build — Toolbox → DebugInstall from npmproximo3-audit-restore. Pick an environment connection; the header should show the connected environment + org version.

5. Submit to the catalogTool Submission Form: npm package name proximo3-audit-restore, categories Data, Troubleshooting, Migration. Automated checks run, then manual review (~48–72h).

Canonical source lives in the private Azure DevOps Proximo 3 Core repo; the GitHub repo above is the public mirror required for catalog listing.

Notes / limitations under Toolbox

  • Formatted value labels: if the host's queryData doesn't return odata.include-annotations, the preview shows raw values (e.g. option-set integers, lookup GUIDs) instead of friendly labels. The restore itself is unaffected — lookuplogicalname (needed to rebind lookups) is returned by default.
  • cspExceptions: not required, because the tool calls Dataverse only through the injected dataverseAPI (no direct cross-origin requests). If you later add direct calls, declare the origins under cspExceptions in package.json.
  • Everything else (point-in-time reconstruction, scope, exclude-recently-reverted, pagination, Apply this page / Apply all, record deep-links) works identically to the web-resource build.

See ../audit-restore-guide.md for the full functional guide.