{"_id":"@axazure/pcf-proxy-dynamics","_rev":"5-0d38b67f4069d3ec367bc4474cd62197","name":"@axazure/pcf-proxy-dynamics","dist-tags":{"latest":"1.0.22"},"versions":{"1.0.17":{"name":"@axazure/pcf-proxy-dynamics","version":"1.0.17","keywords":["PCF","Dynamics","Proxy"],"author":{"name":"Ricardo Manzanares Camargo y Fernando Jose Cabrera Castillo"},"license":"ISC","_id":"@axazure/pcf-proxy-dynamics@1.0.17","maintainers":[{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},{"name":"fj.cabrera","email":"fj.cabrera@axazure.com"}],"homepage":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics#readme","bugs":{"url":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics/issues"},"dist":{"shasum":"130bc9d3d598556b2d99843beeb8973a4de3c2de","tarball":"https://registry.npmjs.org/@axazure/pcf-proxy-dynamics/-/pcf-proxy-dynamics-1.0.17.tgz","fileCount":9,"integrity":"sha512-L4Z31m6PbSg8ZdBy2Yx3LBNz/J4A6qXOQp6KV0cJGZFGrH6dxx44mt9GiSjVckDEGzsOm7aSubH9S3J9/Z6zDQ==","signatures":[{"sig":"MEUCIQDf+n3AXg+w85Ljkqi70xcJpPYEeSJqqXdigxPP1yk1UAIgTHFYkqHf0LnB80nh4isYzi1498htm3IGKvFZnJWIq0E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60264},"main":"dist/WebApiProxy.js","types":"dist/WebApiProxy.d.ts","exports":{".":{"types":"./dist/WebApiProxy.d.ts","import":"./dist/WebApiProxy.js","require":"./dist/WebApiProxy.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js","require":"./dist/server.js"}},"gitHead":"87dddc564401d2c7670f3bed2f627913dc23328f","scripts":{"dev":"ts-node server.ts","build":"tsc","start":"npm run build && node dist/server.js"},"_npmUser":{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},"repository":{"url":"git+https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics.git","type":"git"},"_npmVersion":"11.9.0","description":"Backend allowing PCF components to access Dynamics 365 data","directories":{},"_nodeVersion":"22.13.0","dependencies":{"cors":"^2.8.5","dotenv":"^16.5.0","express":"^4.18.2","node-fetch":"^2.6.7"},"publishConfig":{"registry":"https://npm.pkg.github.com/"},"_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.1","typescript":"^5.2.2","@types/cors":"^2.8.19","@types/node":"^20.4.2","@types/express":"^4.17.17","@types/node-fetch":"^2.6.2","@types/powerapps-component-framework":"^1.3.18"},"_npmOperationalInternal":{"tmp":"tmp/pcf-proxy-dynamics_1.0.17_1770745551805_0.15160673295373783","host":"s3://npm-registry-packages-npm-production"}},"1.0.19":{"name":"@axazure/pcf-proxy-dynamics","version":"1.0.19","keywords":["PCF","Dynamics","Proxy"],"author":{"name":"Ricardo Manzanares Camargo y Fernando Jose Cabrera Castillo"},"license":"ISC","_id":"@axazure/pcf-proxy-dynamics@1.0.19","maintainers":[{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},{"name":"fj.cabrera","email":"fj.cabrera@axazure.com"}],"homepage":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics#readme","bugs":{"url":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics/issues"},"dist":{"shasum":"ff5d7aad3c0f730c20d3eca18b10af4ca295026f","tarball":"https://registry.npmjs.org/@axazure/pcf-proxy-dynamics/-/pcf-proxy-dynamics-1.0.19.tgz","fileCount":9,"integrity":"sha512-neQOL7+l6dpVlko1l1Iolf76tYDgcNfUU90kutyBguIM3I9uksmPnVHvIjYchJB1zxm4hGl3XVYAm7yYfCO68Q==","signatures":[{"sig":"MEQCICkNCA5HZokiymThG+k2nnaSFbW6qlU68jUuaXVxtYCjAiBsc1iSCBknUTMKUJSzn0rZI9ULn+A4aAxtoME7ozDkIQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60203},"main":"dist/WebApiProxy.js","types":"dist/WebApiProxy.d.ts","exports":{".":{"types":"./dist/WebApiProxy.d.ts","import":"./dist/WebApiProxy.js","require":"./dist/WebApiProxy.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js","require":"./dist/server.js"}},"gitHead":"87dddc564401d2c7670f3bed2f627913dc23328f","scripts":{"dev":"ts-node server.ts","build":"tsc","start":"npm run build && node dist/server.js"},"_npmUser":{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},"repository":{"url":"git+https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics.git","type":"git"},"_npmVersion":"11.9.0","description":"Backend allowing PCF components to access Dynamics 365 data","directories":{},"_nodeVersion":"22.13.0","dependencies":{"cors":"^2.8.5","dotenv":"^16.5.0","express":"^4.18.2","node-fetch":"^2.6.7"},"publishConfig":{"registry":"https://npm.pkg.github.com/"},"_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.1","typescript":"^5.2.2","@types/cors":"^2.8.19","@types/node":"^20.4.2","@types/express":"^4.17.17","@types/node-fetch":"^2.6.2","@types/powerapps-component-framework":"^1.3.18"},"_npmOperationalInternal":{"tmp":"tmp/pcf-proxy-dynamics_1.0.19_1770794345193_0.9727964193935172","host":"s3://npm-registry-packages-npm-production"}},"1.0.20":{"name":"@axazure/pcf-proxy-dynamics","version":"1.0.20","keywords":["PCF","Dynamics","Proxy"],"author":{"name":"Ricardo Manzanares Camargo y Fernando Jose Cabrera Castillo"},"license":"ISC","_id":"@axazure/pcf-proxy-dynamics@1.0.20","maintainers":[{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},{"name":"fj.cabrera","email":"fj.cabrera@axazure.com"}],"homepage":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics#readme","bugs":{"url":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics/issues"},"dist":{"shasum":"1681bae56d7c91711e4fb83e45cb7d0826c8e6f0","tarball":"https://registry.npmjs.org/@axazure/pcf-proxy-dynamics/-/pcf-proxy-dynamics-1.0.20.tgz","fileCount":9,"integrity":"sha512-Yqt4PZd8f8ien7xwLiXy9AjdC9asVfmjHicSpdW5/rV9IHBbb4lGxnNLyTdPDx5NqZBppUnW2YDGMSdNFQfR9g==","signatures":[{"sig":"MEYCIQCIg/pkIAivj2UfKLLBzqeWX5KwHdrDy5TBTRLtzuDgQwIhAPsjsXcnhIW7f8PIDdYmJWx1sDfUBBMV1JZ+E0yn1P9C","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60374},"main":"dist/WebApiProxy.js","types":"dist/WebApiProxy.d.ts","exports":{".":{"types":"./dist/WebApiProxy.d.ts","import":"./dist/WebApiProxy.js","require":"./dist/WebApiProxy.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js","require":"./dist/server.js"}},"gitHead":"6cd409cab2ac102af5c3a7c52c7031fddf5539d5","scripts":{"dev":"ts-node server.ts","build":"tsc","start":"npm run build && node dist/server.js"},"_npmUser":{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},"repository":{"url":"git+https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics.git","type":"git"},"_npmVersion":"11.9.0","description":"Backend allowing PCF components to access Dynamics 365 data","directories":{},"_nodeVersion":"22.13.0","dependencies":{"cors":"^2.8.5","dotenv":"^16.5.0","express":"^4.18.2","node-fetch":"^2.6.7"},"publishConfig":{"registry":"https://npm.pkg.github.com/"},"_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.1","typescript":"^5.2.2","@types/cors":"^2.8.19","@types/node":"^20.4.2","@types/express":"^4.17.17","@types/node-fetch":"^2.6.2","@types/powerapps-component-framework":"^1.3.18"},"_npmOperationalInternal":{"tmp":"tmp/pcf-proxy-dynamics_1.0.20_1773837593253_0.27328552656025007","host":"s3://npm-registry-packages-npm-production"}},"1.0.21":{"name":"@axazure/pcf-proxy-dynamics","version":"1.0.21","keywords":["PCF","Dynamics","Proxy"],"author":{"name":"Ricardo Manzanares Camargo y Fernando Jose Cabrera Castillo"},"license":"ISC","_id":"@axazure/pcf-proxy-dynamics@1.0.21","maintainers":[{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},{"name":"fj.cabrera","email":"fj.cabrera@axazure.com"}],"homepage":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics#readme","bugs":{"url":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics/issues"},"dist":{"shasum":"f7e3f8fb324f59c9081888c513b70a1710603833","tarball":"https://registry.npmjs.org/@axazure/pcf-proxy-dynamics/-/pcf-proxy-dynamics-1.0.21.tgz","fileCount":9,"integrity":"sha512-3OSGahyvO2+ifbPvGv5fY5N2HIwF5gmozHCwQBDgazfJK/vMwaX2D/wwSFmtxOwYzw3KHi3cnvDRADlfvDfW3w==","signatures":[{"sig":"MEQCIEuoWYwnfisjE/TpYzvET/ogKRvoyN/4jeNaa9aOabYrAiAlkrc3bOYeBJBRqIOVNh2KsTLUaObSjgJd3z65PYl/sw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60261},"main":"dist/WebApiProxy.js","types":"dist/WebApiProxy.d.ts","exports":{".":{"types":"./dist/WebApiProxy.d.ts","import":"./dist/WebApiProxy.js","require":"./dist/WebApiProxy.js"},"./server":{"types":"./dist/server.d.ts","import":"./dist/server.js","require":"./dist/server.js"}},"gitHead":"7f2caf1912008597e1c85b30ea187ade42c15d27","scripts":{"dev":"ts-node server.ts","build":"tsc","start":"npm run build && node dist/server.js"},"_npmUser":{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},"repository":{"url":"git+https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics.git","type":"git"},"_npmVersion":"11.9.0","description":"Backend allowing PCF components to access Dynamics 365 data","directories":{},"_nodeVersion":"22.13.0","dependencies":{"cors":"^2.8.5","dotenv":"^16.5.0","express":"^4.18.2","node-fetch":"^2.6.7"},"publishConfig":{"registry":"https://npm.pkg.github.com/"},"_hasShrinkwrap":false,"devDependencies":{"ts-node":"^10.9.1","typescript":"^5.2.2","@types/cors":"^2.8.19","@types/node":"^20.4.2","@types/express":"^4.17.17","@types/node-fetch":"^2.6.2","@types/powerapps-component-framework":"^1.3.18"},"_npmOperationalInternal":{"tmp":"tmp/pcf-proxy-dynamics_1.0.21_1773846103339_0.8986557775240582","host":"s3://npm-registry-packages-npm-production"}},"1.0.22":{"name":"@axazure/pcf-proxy-dynamics","version":"1.0.22","description":"Backend allowing PCF components to access Dynamics 365 data","main":"dist/WebApiProxy.js","types":"dist/WebApiProxy.d.ts","exports":{".":{"import":"./dist/WebApiProxy.js","require":"./dist/WebApiProxy.js","types":"./dist/WebApiProxy.d.ts"},"./server":{"import":"./dist/server.js","require":"./dist/server.js","types":"./dist/server.d.ts"}},"scripts":{"build":"tsc","start":"npm run build && node dist/server.js","dev":"ts-node server.ts"},"dependencies":{"cors":"^2.8.5","dotenv":"^16.5.0","express":"^4.18.2","node-fetch":"^2.6.7"},"devDependencies":{"@types/cors":"^2.8.19","@types/express":"^4.17.17","@types/node":"^20.4.2","@types/node-fetch":"^2.6.2","@types/powerapps-component-framework":"^1.3.18","ts-node":"^10.9.1","typescript":"^5.2.2"},"publishConfig":{"registry":"https://npm.pkg.github.com/"},"repository":{"type":"git","url":"git+https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics.git"},"keywords":["PCF","Dynamics","Proxy"],"author":{"name":"Ricardo Manzanares Camargo y Fernando Jose Cabrera Castillo"},"license":"ISC","bugs":{"url":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics/issues"},"homepage":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics#readme","gitHead":"545c1356aab98b77f433d778e0358b627f09aa10","_id":"@axazure/pcf-proxy-dynamics@1.0.22","_nodeVersion":"22.13.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-0VoCYip7N3AS0sjjs/zQh7w9sjjo5gZ14sS9biu9y5jFayf9X2nAcoKbaptWnfeppdRNmtFiiWf7SeO0U9QaMQ==","shasum":"7cf7496a09f3ed50f59b69aa2c317d2bedcc1d94","tarball":"https://registry.npmjs.org/@axazure/pcf-proxy-dynamics/-/pcf-proxy-dynamics-1.0.22.tgz","fileCount":9,"unpackedSize":60232,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCyJx5+EMMVZjFaCDpSrtPXdus/ctCuxdu6c9pzXW0IUAIhAIIME3jzBKMVuVoF697D/hMUlFWt3E8/MAOCSULe6Tvs"}]},"_npmUser":{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},"directories":{},"maintainers":[{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},{"name":"fj.cabrera","email":"fj.cabrera@axazure.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pcf-proxy-dynamics_1.0.22_1774286142868_0.30462532923577057"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-10T17:45:51.685Z","modified":"2026-03-23T17:15:43.214Z","1.0.17":"2026-02-10T17:45:51.958Z","1.0.19":"2026-02-11T07:19:05.366Z","1.0.20":"2026-03-18T12:39:53.376Z","1.0.21":"2026-03-18T15:01:43.507Z","1.0.22":"2026-03-23T17:15:43.045Z"},"bugs":{"url":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics/issues"},"author":{"name":"Ricardo Manzanares Camargo y Fernando Jose Cabrera Castillo"},"license":"ISC","homepage":"https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics#readme","keywords":["PCF","Dynamics","Proxy"],"repository":{"type":"git","url":"git+https://github.com/Ricardo-Manzanares/pcf-proxy-dynamics.git"},"description":"Backend allowing PCF components to access Dynamics 365 data","maintainers":[{"name":"ricardo-manzanares","email":"vedralagost@gmail.com"},{"name":"fj.cabrera","email":"fj.cabrera@axazure.com"}],"readme":"# pcf-proxy-dynamics #\n\nThis package provides a lightweight Web API proxy that enables local\nReact development for PCF components without requiring a running\nDynamics 365 environment. It lets you build, debug, and test your\ncomponent logic in real time, avoiding the heavy deploy-test cycle.\n\n📑 Table of Contents\n1. [Installation](#1-installation)\n2. [Runtime Switch (Local vs Dataverse)](#2-runtime-switch-local-vs-dataverse)\n3. [Strongly Typed Props Interface](#3-strongly-typed-props-interface)\n4. [Component Usage](#4-component-usage)\n5. [Minimal Pattern](#5-minimal-pattern)\n6. [Recommended Development Flow](#6-recommended-development-flow)\n7. [Notes](#7-notes)\n8. [Troubleshooting](#8-troubleshooting)\n9. [Environment Configuration (.env)](#9-environment-configuration-env)\n10. [Extension Suggestion](#10-extension-suggestion)\n\n\n## 1. Installation\n```js\n    npm i @axazure/pcf-proxy-dynamics\n```\nAdd the backend script if it’s missing:\n```js\n    \"start:backend\": \"node ./node_modules/@axazure/pcf-proxy-dynamics/dist/server.js\"\n```\nStart your local dev environment:\n```{r, engine='bash', count_lines}\n    npm run start:backend\n    npm run start\n```\nProxy base URL: http://localhost:3001\n\n## 2. Runtime Switch (Local vs Dataverse)\n```js\n    var _api : ComponentFramework.WebApi;\n    var _userSettings, _recordId, _entityName;\n\n    if (document.location.host.includes('localhost')) {\n      const { WebApiProxy } = require(\"@axazure/pcf-proxy-dynamics\");\n      _api = new WebApiProxy(\"http://localhost:3001\");\n      _userSettings = {} as ComponentFramework.UserSettings;\n      _userSettings.userId = \"00000000-0000-0000-0000-000000000000\";\n      _recordId = \"00000000-0000-0000-0000-000000000000\";\n      _entityName = \"\";\n    } else {\n      _api = context.webAPI;\n      _userSettings = context.userSettings;\n      _userSettings.userId = (<any>_userSettings).userId;\n      _recordId = (<any>context).page.entityId.replace(\"{\", \"\").replace(\"}\", \"\") ?? \"\";\n      _entityName = (<any>context).page.entityTypeName ?? \"\";\n    }\n```\n## 3. Strongly Typed Props Interface\n```js\n    export interface IGenericComponentProps {\n      webAPI: ComponentFramework.WebApi;\n      recordId: string;\n      entityName: string;\n      userSettings: ComponentFramework.UserSettings;\n    }\n```\n\n## 4. Component Usage\n\n### Root component\n```js\n    import * as React from \"react\";\n    import { IGenericComponentProps } from \"../lib/props\";\n\n    export const GenericComponent: React.FC<IGenericComponentProps> = ({ webAPI, recordId, entityName, userSettings }) => {\n      return (\n        <div>\n          <h3>Generic Component</h3>\n          <div>Record Id: {recordId}</div>\n          <div>Entity: {entityName}</div>\n          <div>User Id: {userSettings.userId}</div>\n        </div>\n      );\n    };\n```\n\n### Integration in index.ts\n```js\n    import { IGenericComponentProps } from \"./lib/props\";\n    import { GenericComponent } from \"./components/generic-component\";\n\n    public updateView(context: ComponentFramework.Context<IInputs>): React.ReactElement {\n        var _api: ComponentFramework.WebApi;\n        var _userSettings, _recordId, _entityName = null;\n\n        if (document.location.host.includes('localhost')) {\n            const { WebApiProxy } = require(\"@axazure/pcf-proxy-dynamics\");\n            _api = new WebApiProxy(\"http://localhost:3001\");\n            _userSettings = {} as ComponentFramework.UserSettings;\n            _userSettings.userId = \"00000000-0000-0000-0000-000000000000\";\n            _recordId = \"00000000-0000-0000-0000-000000000000\";\n            _entityName = \"\";\n        } else {\n            _api = context.webAPI;\n            _userSettings = context.userSettings;\n            _userSettings.userId = (<any>_userSettings).userId;\n            _recordId = (<any>context).page.entityId.replace(\"{\", \"\").replace(\"}\", \"\") ?? \"\";\n            _entityName = (<any>context).page.entityTypeName ?? \"\";\n        }\n\n        const props: IGenericComponentProps = { webAPI: _api, recordId: _recordId, entityName: _entityName, userSettings: _userSettings };\n        return React.createElement(GenericComponent, props);\n    }\n```\n\n## 5. Minimal Pattern\n```js\n    const props: IGenericComponentProps = {\n      webAPI: _api,\n      recordId: _recordId,\n      entityName: _entityName,\n      userSettings: _userSettings\n    };\n\n    return React.createElement(GenericComponent, props);\n```\n\n## 6. Recommended Development Flow\n\n1.  Install dependencies\n2.  Start the proxy\n3.  Start the PCF sandbox\n4.  Develop React logic locally\n5.  Test inside Dataverse\n\n## 7. Notes\n\n-   The proxy is meant for local development only.\n-   Replace mock IDs if your component depends on user or entity\n    context.\n-   Extracting interfaces improves testability.\n\n## 8. Troubleshooting\n\n| Issue  | Suggested Action |\n| ------ | ---------------- |\n| 404 from proxy | Ensure npm run start:backend is running. |\n| webAPI undefined | Check localhost detection. |\n| Empty data | Validate queries and proxy configuration. |\n\n## 9. Environment Configuration (.env)\n\nBefore running the project, make sure to configure a `.env` file at the root of your workspace.  \nThis file stores the connection details required to authenticate against your Dynamics CRM environment.\n\n### Required Variables\n\n```env\nENVIRONMENT_URL=<Your Dynamics CRM environment URL>\nTENANT_ID=<Your Azure AD Tenant ID>\nCLIENT_ID=<Your Azure AD Application (Client) ID with CRM permissions>\nCLIENT_SECRET=<Your Azure AD Application Client Secret>\n```\n\n## 10. Extension Suggestion\n\nCreate service modules (e.g., lib/DataverseQueueService.ts) consuming\nwebAPI and inject abstractions through props for easier mocking and\nbetter testability.\n","readmeFilename":"README.md"}