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