{"_id":"@dkodemonkey-llc/ns-sdk","name":"@dkodemonkey-llc/ns-sdk","dist-tags":{"latest":"1.1.0"},"versions":{"1.1.0":{"name":"@dkodemonkey-llc/ns-sdk","version":"1.1.0","description":"NetSuite SuiteScript Development SDK - Libraries for search conversion, error handling, OAuth, and more","keywords":["netsuite","suitescript","suiteql","erp","sdk","search-conversion","oauth"],"repository":{"type":"git","url":"git+https://bitbucket.org/dkodemonkey/ns-sdk.git"},"author":{"name":"DKODEMONKEY LLC"},"license":"MIT","homepage":"https://bitbucket.org/dkodemonkey/ns-sdk/src/main/","engines":{"node":">=14.0.0"},"scripts":{"test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","lint":"eslint src/**/*.js","lint:fix":"eslint src/**/*.js --fix"},"devDependencies":{"@eslint/js":"^9.18.0","@oracle/suitecloud-unit-testing":"^1.7.0","eslint":"^9.18.0","globals":"^16.4.0","jest":"^29.0.0"},"gitHead":"bdd576a34d44cc2dcdc8ff9f36335198756e5db5","_id":"@dkodemonkey-llc/ns-sdk@1.1.0","bugs":{"url":"https://bitbucket.org/dkodemonkey/ns-sdk/issues"},"_nodeVersion":"24.11.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-ckZyKGxm36JheuKMh3Qv1O8ENw04HUPtiCuEYLODtJpFZn4VleMYkcuh4OUheND6lbkkpEJNVELKg87l6Y8PYw==","shasum":"925931754c2931ef80e876d840c1501484115ffa","tarball":"https://registry.npmjs.org/@dkodemonkey-llc/ns-sdk/-/ns-sdk-1.1.0.tgz","fileCount":43,"unpackedSize":552108,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDw/GskwMtSJWYSy6nWzaOe4LA9+6S2zqC6h5E+j7SRtAIgfpc+oyvSVPMRMUY9zGnPusVx54OjIQ8FY5KE5pQal1o="}]},"_npmUser":{"name":"dk-dom","email":"dom.k@dkodemonkey.com"},"directories":{},"maintainers":[{"name":"dk-dom","email":"dom.k@dkodemonkey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ns-sdk_1.1.0_1763105922743_0.9604713124498885"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-14T07:38:42.656Z","1.1.0":"2025-11-14T07:38:42.996Z","modified":"2025-11-14T07:38:43.308Z"},"maintainers":[{"name":"dk-dom","email":"dom.k@dkodemonkey.com"}],"description":"NetSuite SuiteScript Development SDK - Libraries for search conversion, error handling, OAuth, and more","homepage":"https://bitbucket.org/dkodemonkey/ns-sdk/src/main/","keywords":["netsuite","suitescript","suiteql","erp","sdk","search-conversion","oauth"],"repository":{"type":"git","url":"git+https://bitbucket.org/dkodemonkey/ns-sdk.git"},"author":{"name":"DKODEMONKEY LLC"},"bugs":{"url":"https://bitbucket.org/dkodemonkey/ns-sdk/issues"},"license":"MIT","readme":"# NS-SDK\r\n\r\nA comprehensive NetSuite SuiteScript Development SDK providing libraries for search conversion, error handling, OAuth authentication, record operations, and more.\r\n\r\n## Features\r\n\r\n- **SuiteQLHelper** - Convert NetSuite Saved Searches to SuiteQL queries automatically\r\n- **Currency** - Precision currency handling with integer-based arithmetic\r\n- **searchHelper** - Utilities for working with N/search API\r\n- **recordHelper** - Record operation helpers\r\n- **errorHelper** - Standardized error handling and logging\r\n- **oauth1.0** - OAuth 1.0 authentication utilities\r\n- **Third-party libraries** - Moment.js and PapaParse for date/time and CSV handling\r\n\r\n## Installation\r\n\r\n### Prerequisites\r\n\r\n1. Enable SDF for your NetSuite Account\r\n   - [NetSuite SDF Setup Guide](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4724784139.html)\r\n\r\n2. Install SDF CLI locally\r\n   - [SDF CLI Installation Guide](https://system.netsuite.com/app/help/helpcenter.nl?fid=set_1502135000.html)\r\n\r\n### Deployment\r\n\r\n1. Clone this repository\r\n2. Deploy the `src` folder to NetSuite using SDF\r\n3. Add the following to your script headers for shorthand library access:\r\n   ```javascript\r\n   /**\r\n    * @NAmdConfig /SuiteScripts/NS-SDK/ns-sdk-amd.json\r\n    */\r\n   ```\r\n\r\n## Quick Start\r\n\r\n### Using SuiteQLHelper\r\n\r\n```javascript\r\ndefine(['N/query', 'SuiteQLHelper'], function(query, SuiteQLHelper) {\r\n    // Convert a saved search to SuiteQL\r\n    const result = SuiteQLHelper.convertSearchToSuiteQL({ id: 2413 });\r\n    const sqlQuery = result.sql;\r\n\r\n    // Run the query\r\n    const results = query.runSuiteQL({ query: sqlQuery }).asMappedResults();\r\n});\r\n```\r\n\r\n### Using Currency\r\n\r\n```javascript\r\ndefine(['Currency'], function(Currency) {\r\n    const amount = new Currency(100.50);\r\n    const tax = amount.multiply(0.08);\r\n    const total = amount.add(tax);\r\n\r\n    // Works directly with NetSuite fields\r\n    record.setValue('amount', total);  // Sets 108.54\r\n});\r\n```\r\n\r\n### Using searchHelper\r\n\r\n```javascript\r\ndefine(['N/search', 'searchHelper'], function(search, searchHelper) {\r\n    const mySearch = search.create({\r\n        type: search.Type.TRANSACTION,\r\n        filters: [['type', 'anyof', 'SalesOrd']],\r\n        columns: ['tranid', 'trandate', 'amount']\r\n    });\r\n\r\n    // Get all results as JSON\r\n    const results = searchHelper.getAllResults(mySearch, true, true);\r\n});\r\n```\r\n\r\n## Library Documentation\r\n\r\n- [Currency.js](docs/Currency.md) - Precision currency calculations\r\n- [Currency Code Review](docs/Currency_Review.md) - Implementation analysis\r\n- [searchHelper.js](docs/searchHelper.md) - Search utilities\r\n- [errorHelper.js](docs/errorHelper.md) - Error handling\r\n- [SuiteQL Conversion Guide](docs/SuiteQL_Conversion.md) - Detailed conversion documentation\r\n- [Project Guide](.claude/claude.md) - Comprehensive project documentation\r\n\r\n## Development\r\n\r\n### Running Tests\r\n\r\n```bash\r\nnpm test                # Run all tests\r\nnpm run test:watch      # Run tests in watch mode\r\nnpm run test:coverage   # Generate coverage report\r\n```\r\n\r\n### Linting\r\n\r\n```bash\r\nnpm run lint            # Check for linting errors\r\nnpm run lint:fix        # Fix linting errors automatically\r\n```\r\n\r\n## VS Code Snippets\r\n\r\nThis project includes VS Code snippets for NetSuite script boilerplate. The snippets are automatically available when you open this project in VS Code.\r\n\r\nAvailable snippets:\r\n- `ue-before` - User Event Before Submit\r\n- `ue-after` - User Event After Submit\r\n- `mr-getinput` - Map/Reduce Get Input Stage\r\n- `mr-map` - Map/Reduce Map Stage\r\n- `mr-reduce` - Map/Reduce Reduce Stage\r\n- `mr-summarize` - Map/Reduce Summarize Stage\r\n- And more...\r\n\r\n## Project Structure\r\n\r\n```\r\nns-sdk/\r\n├── src/FileCabinet/SuiteScripts/NS-SDK/\r\n│   ├── lib/                          # Core libraries\r\n│   │   ├── SuiteQLHelper.js         # Search to SuiteQL converter\r\n│   │   ├── Currency.js              # Precision currency handling\r\n│   │   ├── searchHelper.js          # Search utilities\r\n│   │   ├── recordHelper.js          # Record operations\r\n│   │   ├── errorHelper.js           # Error handling\r\n│   │   ├── oauth1.0.js              # OAuth utilities\r\n│   │   ├── moment.min.js            # Date/time library\r\n│   │   └── papaparse.min.js         # CSV parsing\r\n│   └── ns-sdk-amd.json              # AMD module config\r\n├── test/                             # Unit tests\r\n├── docs/                             # Documentation\r\n├── .vscode/                          # VS Code snippets\r\n└── .claude/                          # AI assistant documentation\r\n```\r\n\r\n## Contributing\r\n\r\nThis is an internal development SDK for DKODEMONKEY LLC. For issues or questions, please contact the development team.\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Author\r\n\r\nDKODEMONKEY LLC","readmeFilename":"README.md","_rev":"1-7f8df6b7ef6111f5db254681637a53ce"}