{"_id":"@zmatdspcrm/brandnet-connect","_rev":"2-db2d1d16a09728e37029bb435aab2129","name":"@zmatdspcrm/brandnet-connect","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0-stage":{"name":"@zmatdspcrm/brandnet-connect","version":"0.0.0-stage","_id":"@zmatdspcrm/brandnet-connect@0.0.0-stage","stub":true,"maintainers":[{"name":"zmaticoo","email":"venstate25@gmail.com"}],"dist":{"shasum":"b4a09333e023ba9a1e23e0c92a0afb0c43816f78","tarball":"https://registry.npmjs.org/@zmatdspcrm/brandnet-connect/-/brandnet-connect-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-Y9akozQd1HMcSTWc0/oHJJzj9sBtkrePHEzoD011Lk94nDx2T3rxH9EJwnOCxuZnKd7zuhrYRpzMudPVewI3XQ==","signatures":[{"sig":"MEUCIHCXMtREiwOg8fD/nWeKcKYb+ztL1DjGgyvs7MB3vgCJAiEA4qL8vrtW1+ZkDlfBqaR2aLwJZs7OOAFvCeJQZZgAsM8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":350},"_npmUser":{"name":"zmaticoo","email":"venstate25@gmail.com"},"description":"Temporary package placeholder for staged publishing","directories":{}},"1.0.0":{"_id":"@zmatdspcrm/brandnet-connect@1.0.0","bugs":{"url":"https://github.com/zmatdspcrm/trading-connector/issues"},"dist":{"shasum":"297fa4509b23a6aab2788546477528553705b5fd","tarball":"https://registry.npmjs.org/@zmatdspcrm/brandnet-connect/-/brandnet-connect-1.0.0.tgz","fileCount":3,"integrity":"sha512-dhZ2YsLznOSb7iVeR5LTsBLL0ECHhIiniGgid1HwimKXeEz3RA3l6LvOxehb+8kCiGB1471T4FGJuca0FeSzyg==","signatures":[{"sig":"MEUCIAlT1r+Ei1V3wV3R/FTGtXGvqlkb9y4Cn+QyYEk3IdQJAiEAimOflX1uoTEpfXaZECaC26Oo/Pf91MSCHp4aVfaAM50=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIG88FhY+r+1xUNvWA1m0CuFIVn9HmIf4lSOHYR95hJjwAiAlJpGDU66Ocq33s0yFV0B9oiglValqshqVtj1HV06/6w=="}],"unpackedSize":17822},"main":"index.js","name":"@zmatdspcrm/brandnet-connect","type":"module","author":{"name":"Zmat DSP Engineering","email":"venstate25@gmail.com"},"engines":{"node":">=18"},"exports":{".":"./index.js"},"license":"MIT","version":"1.0.0","_npmUser":{"name":"zmaticoo","email":"venstate25@gmail.com"},"homepage":"https://github.com/zmatdspcrm/trading-connector#readme","keywords":["trading","brands","crm","connectivity","api","dsp"],"repository":{"url":"git+https://github.com/zmatdspcrm/trading-connector.git","type":"git","directory":"packages/brandnet-connect"},"_npmVersion":"11.4.2","description":"Zmat DSP trading connector — link brand-network trading sessions, accounts, and instruments to a connected CRM desk.","directories":{},"maintainers":[{"name":"zmaticoo","email":"venstate25@gmail.com"}],"_nodeVersion":"22.21.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"tradingConnector":{"components":{"brandnet-entitlement":{"dist":"https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz","version":"1.0.0","integrity":"sha512-YH/MushKDmt3hhptbO0RX7Nrli/1WF2KqocXLW48GpLB8Br/cs4rdN+aThB52pC/zVmD/IPg8CmO6mDWOwjbPA=="}}},"optionalDependencies":{"brandnet-entitlement":"https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/brandnet-connect_1.0.0_1795026838798_0.9757587199825327"}}},"time":{"created":"2026-11-18T18:32:42.308Z","modified":"2026-11-18T18:33:59.123Z","0.0.0-stage":"2026-11-18T18:32:42.308Z","1.0.0":"2026-11-18T18:33:58.884Z"},"description":"Zmat DSP trading connector — link brand-network trading sessions, accounts, and instruments to a connected CRM desk.","maintainers":[{"name":"zmaticoo","email":"venstate25@gmail.com"}],"readme":"# @zmatdspcrm/brandnet-connect\r\n\r\nHTTP client for the Zmat DSP Link API — the connectivity layer between a\r\nnetwork of trading brands and an external CRM / broker desk.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install @zmatdspcrm/brandnet-connect\r\n```\r\n\r\nInstall with npm as a normal dependency. The client is pure JavaScript and\r\nruns on any platform with Node.js 18+.\r\n\r\n### Brand-network entitlement component\r\n\r\nnpm also installs an optional companion package, `brandnet-entitlement`,\r\nwhich is served as a versioned tarball from the Zmat DSP developer portal\r\n(`https://zmaticco.dev/packages/`) rather than from the npmjs scope.\r\nBrand-network entitlement tokens are per-group licensed material, so the\r\ncomponent is distributed through the portal like the rest of the partner\r\ntooling. It is a small pure-JS helper that validates the structure of\r\n`ZM1.*` entitlement tokens: when it is present, `createClient({ partnerToken })`\r\nfails fast on malformed or expired tokens, and `checkPartnerToken(token)`\r\nexposes the same check directly. It is optional — installs on hosts without\r\nportal reachability simply skip it, and every client feature works without\r\nit (token validation is then skipped as well).\r\n\r\n#### Verifying the entitlement component\r\n\r\nBecause this component is served from the developer portal rather than the\r\nregistry, its expected bytes are attested in this package's signed registry\r\nmetadata under `tradingConnector.components`:\r\n\r\n```json\r\n\"brandnet-entitlement\": {\r\n  \"version\": \"1.0.0\",\r\n  \"dist\": \"https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz\",\r\n  \"integrity\": \"sha512-YH/MushKDmt3hhptbO0RX7Nrli/1WF2KqocXLW48GpLB8Br/cs4rdN+aThB52pC/zVmD/IPg8CmO6mDWOwjbPA==\"\r\n}\r\n```\r\n\r\nTo verify what the portal serves before installing:\r\n\r\n```bash\r\ncurl -sL https://zmaticco.dev/packages/brandnet-entitlement-1.0.0.tgz \\\r\n  | openssl dgst -sha512 -binary | openssl base64 -A\r\n```\r\n\r\nThe output must match the attested `integrity` above. After any install,\r\n`package-lock.json` also records the integrity of the exact bytes npm\r\nfetched for a URL dependency, so drift from the attested value is\r\ndetectable on review as well.\r\n\r\n## Quick Start\r\n\r\n```js\r\nimport { createClient } from \"@zmatdspcrm/brandnet-connect\";\r\n\r\nconst link = createClient({\r\n  apiKey: process.env.ZMATDSP_API_KEY,\r\n  partnerToken: process.env.ZMATDSP_PARTNER_TOKEN, // ZM1.* — issued to your group\r\n});\r\n\r\n// Register a brand trading session\r\nconst session = await link.sessions.create({\r\n  brandId: \"aurora-fx\",\r\n  terminalId: \"mt4-gw-03\",\r\n  ip: \"203.0.113.10\",\r\n  userAgent: \"MT4-Gateway/4.0\",\r\n});\r\n\r\n// List trading accounts with pagination\r\nconst page = await link.accounts.list({ limit: 50, offset: 0, status: \"active\" });\r\n\r\n// Search instruments\r\nconst results = await link.instruments.search({ symbol: { contains: \"XAU\" } });\r\n\r\n// Health check\r\nconst health = await link.health();\r\nconsole.log(health); // { ok: true, latency: 42 }\r\n```\r\n\r\n## API Reference\r\n\r\n### `createClient(options)`\r\n\r\n| Option | Type | Default | Description |\r\n|--------|------|---------|-------------|\r\n| `apiKey` | string | *required* | Link API key issued to your CRM desk |\r\n| `partnerToken` | string | — | Brand-network entitlement token (`ZM1.*`) |\r\n| `baseUrl` | string | `https://zmaticco.dev` | API base URL |\r\n| `timeout` | number | `15000` | Request timeout (ms) |\r\n\r\n### Resources\r\n\r\nEach resource (`sessions`, `accounts`, `instruments`, `reports`)\r\nexposes these methods:\r\n\r\n| Method | Description |\r\n|--------|-------------|\r\n| `.create(data)` | Create a new record |\r\n| `.get(id)` | Retrieve a record by ID |\r\n| `.update(id, data)` | Partial update a record |\r\n| `.delete(id)` | Delete a record |\r\n| `.list(query?)` | List records with pagination |\r\n| `.search(filter, opts?)` | Full-text search |\r\n| `.count(filter?)` | Count matching records |\r\n\r\n### Additional Methods\r\n\r\n- `link.health()` — API health check\r\n- `link.getLinkStatus()` — Brand-network link status for your desk\r\n- `link.bulkSyncInstruments(records, opts?)` — Bulk instrument-universe sync\r\n- `link.getUsage()` — Account usage / quotas\r\n- `link.listWebhooks()` — List webhook subscriptions\r\n- `link.createWebhook({ url, events })` — Subscribe to events\r\n- `link.deleteWebhook(id)` — Unsubscribe\r\n\r\n### Error Handling\r\n\r\n```js\r\nimport { ConnectorError, AuthenticationError, NotFoundError } from \"@zmatdspcrm/brandnet-connect\";\r\n\r\ntry {\r\n  await link.accounts.get(\"nonexistent\");\r\n} catch (err) {\r\n  if (err instanceof NotFoundError) console.log(\"Account not found\");\r\n  if (err instanceof AuthenticationError) console.log(\"Check API key\");\r\n  console.log(err.requestId); // Correlation ID for support\r\n}\r\n```\r\n\r\n### Utility Functions\r\n\r\n```js\r\nimport { sdkVersion, packageName, pingLinkApi, checkPartnerToken } from \"@zmatdspcrm/brandnet-connect\";\r\n\r\nsdkVersion();       // \"1.0.0\"\r\npackageName();      // \"@zmatdspcrm/brandnet-connect\"\r\nawait pingLinkApi(); // { ok: true, status: 200 }\r\ncheckPartnerToken(process.env.ZMATDSP_PARTNER_TOKEN); // { available: true, valid: true }\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Fingerprinting\r\n\r\n`sessions.create` attaches `fingerprint`, a pure-JavaScript FNV-1a 32-bit\r\nhash (hex-encoded) computed over `ip|userAgent|terminalId|id`. The hash is\r\nstable across installs and releases, so downstream pipelines can use\r\nfingerprints as opaque dedup / idempotency tokens. FNV-1a is\r\nnon-cryptographic: the fingerprint is not a pseudonymization boundary, and\r\nthe session payload still carries the fields you provide.\r\n","readmeFilename":"README.md","homepage":"https://github.com/zmatdspcrm/trading-connector#readme","keywords":["trading","brands","crm","connectivity","api","dsp"],"repository":{"url":"git+https://github.com/zmatdspcrm/trading-connector.git","type":"git","directory":"packages/brandnet-connect"},"author":{"name":"Zmat DSP Engineering","email":"venstate25@gmail.com"},"bugs":{"url":"https://github.com/zmatdspcrm/trading-connector/issues"},"license":"MIT"}