{"_id":"@abunchofnothing/thoughtindustries-rest-sdk","_rev":"4-1d3e8cbffb54fcb7b3a2ecd1f6b21d5e","name":"@abunchofnothing/thoughtindustries-rest-sdk","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.20260827":{"name":"@abunchofnothing/thoughtindustries-rest-sdk","version":"2.0.20260827","keywords":["thought-industries","lms","sdk"],"author":{"name":"CJ Thompson","email":"cjthomp@gmail.com"},"license":"MIT-0","_id":"@abunchofnothing/thoughtindustries-rest-sdk@2.0.20260827","maintainers":[{"name":"cjthomp","email":"cjthomp@gmail.com"}],"homepage":"https://github.com/abunchofnothing/thoughtindustries-rest-sdk#readme","bugs":{"url":"https://github.com/abunchofnothing/thoughtindustries-rest-sdk/issues"},"dist":{"shasum":"f02102c3278313c71127f3f6f1ef949d6d18e3c2","tarball":"https://registry.npmjs.org/@abunchofnothing/thoughtindustries-rest-sdk/-/thoughtindustries-rest-sdk-2.0.20260827.tgz","fileCount":163,"integrity":"sha512-4Z1d0LlP+JcpKnFC7b6/bxd3T9nyybd2Bkvlh3BITg6Yvi3/UVsBj15Kk8ZP+2Anymo+gLO59EvxYL0JuH6xPg==","signatures":[{"sig":"MEUCIQD6Zp7EKDlVnRmprhXAMNPwNTuE82pOmCWU4QOSDUDQOwIgK2Lrjedp3dCWKB+xQYvDOiDroP7umHsoKaHgiu8eU70=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":403308},"main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"c763bc7ae139a8e635d126685a4114fae8791d88","scripts":{"test":"vitest run","build":"tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"cjthomp","email":"cjthomp@gmail.com"},"deprecated":"Broken release, please upgrade","repository":{"url":"git+https://github.com/abunchofnothing/thoughtindustries-rest-sdk.git","type":"git"},"_npmVersion":"11.5.1","description":"Typescript / Javascript SDK for interacting with the Thought Industries SDK","directories":{},"sideEffects":false,"_nodeVersion":"24.6.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/thoughtindustries-rest-sdk_2.0.20260827_1787888066735_0.6155012075107267","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@abunchofnothing/thoughtindustries-rest-sdk","version":"2.0.1","keywords":["thought-industries","lms","sdk"],"author":{"name":"CJ Thompson","email":"cjthomp@gmail.com"},"license":"MIT-0","_id":"@abunchofnothing/thoughtindustries-rest-sdk@2.0.1","maintainers":[{"name":"cjthomp","email":"cjthomp@gmail.com"}],"homepage":"https://github.com/abunchofnothing/thoughtindustries-rest-sdk#readme","bugs":{"url":"https://github.com/abunchofnothing/thoughtindustries-rest-sdk/issues"},"dist":{"shasum":"42f5cc1ff7e78bdd1b542504d80e3813f3f711af","tarball":"https://registry.npmjs.org/@abunchofnothing/thoughtindustries-rest-sdk/-/thoughtindustries-rest-sdk-2.0.1.tgz","fileCount":163,"integrity":"sha512-EP4JRYhFW3jIQenmyOTqZj0r5Y8gZIUzgNV6jWpOvVPLCA7Escr+cItR/ozxYgQQPvivviIZyoHJWYdYcmOLow==","signatures":[{"sig":"MEUCIBfp6y1QNiIZTsICevWtvKOydtwyUP8i2Q4GCaRCCtbFAiEAshHPs0mSUJnl+nh6sJAUmo2juFooIBVf8qWiwOCGKow=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":403337},"main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"c763bc7ae139a8e635d126685a4114fae8791d88","scripts":{"test":"vitest run","build":"tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"cjthomp","email":"cjthomp@gmail.com"},"repository":{"url":"git+https://github.com/abunchofnothing/thoughtindustries-rest-sdk.git","type":"git"},"_npmVersion":"11.5.1","description":"Typescript / Javascript SDK for interacting with the Thought Industries SDK. Current as of Aug 27, 2026","directories":{},"sideEffects":false,"_nodeVersion":"24.6.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/thoughtindustries-rest-sdk_2.0.1_1787888869078_0.45812817648243676","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@abunchofnothing/thoughtindustries-rest-sdk","version":"2.0.2","description":"Typescript / Javascript SDK for interacting with the Thought Industries SDK. Current as of Aug 27, 2026","license":"MIT-0","keywords":["thought-industries","lms","sdk"],"author":{"name":"CJ Thompson","email":"cjthomp@gmail.com"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/abunchofnothing/thoughtindustries-rest-sdk.git"},"bugs":{"url":"https://github.com/abunchofnothing/thoughtindustries-rest-sdk/issues"},"homepage":"https://github.com/abunchofnothing/thoughtindustries-rest-sdk#readme","engines":{"node":">=18"},"sideEffects":false,"main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/cjs/index.d.ts","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"scripts":{"build":"tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run build && npm test"},"devDependencies":{"typescript":"^5.8.3","vitest":"^3.2.4"},"_id":"@abunchofnothing/thoughtindustries-rest-sdk@2.0.2","gitHead":"784b6837f53bc1fc1934ff84f5c708ab7f4a065d","_nodeVersion":"24.6.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-SgF6qS1+c+3mJzB3iglVfZxRkbdAnlZUCTExn4aqrKIZdwIETC1070xKev3BWPmWscNJu+CN0TPvvfTa9nQsEA==","shasum":"4000fb4631eb44d3cbe9c440a276187474356939","tarball":"https://registry.npmjs.org/@abunchofnothing/thoughtindustries-rest-sdk/-/thoughtindustries-rest-sdk-2.0.2.tgz","fileCount":163,"unpackedSize":407272,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD5On8eYYkw9m6LuUsWHFO8aIVZxxHgKHJbEsKlK17pnQIgcEEIsvjpg1WWWnL0P0PF+Ivq9RYSr77DlZOqyNSP+R4="}]},"_npmUser":{"name":"cjthomp","email":"cjthomp@gmail.com"},"directories":{},"maintainers":[{"name":"cjthomp","email":"cjthomp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/thoughtindustries-rest-sdk_2.0.2_1787925818115_0.8602483712387219"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-28T03:34:26.504Z","modified":"2026-08-28T14:03:38.438Z","2.0.20260827":"2026-08-28T03:34:27.018Z","2.0.1":"2026-08-28T03:47:49.220Z","2.0.2":"2026-08-28T14:03:38.264Z"},"bugs":{"url":"https://github.com/abunchofnothing/thoughtindustries-rest-sdk/issues"},"author":{"name":"CJ Thompson","email":"cjthomp@gmail.com"},"license":"MIT-0","homepage":"https://github.com/abunchofnothing/thoughtindustries-rest-sdk#readme","keywords":["thought-industries","lms","sdk"],"repository":{"type":"git","url":"git+https://github.com/abunchofnothing/thoughtindustries-rest-sdk.git"},"description":"Typescript / Javascript SDK for interacting with the Thought Industries SDK. Current as of Aug 27, 2026","maintainers":[{"name":"cjthomp","email":"cjthomp@gmail.com"}],"readme":"# thoughtindustries-rest-sdk\n\nA TypeScript SDK for the [Thought Industries](https://www.thoughtindustries.com/) REST API.\n\n## Installation\n\n```bash\nnpm install @abunchofnothing/thoughtindustries-rest-sdk\n```\n\nRequires Node.js 18 or later (uses the built-in `fetch` API).\n\n## Quick start\n\n```ts\nimport { createThoughtIndustriesClient } from '@abunchofnothing/thoughtindustries-rest-sdk'\n\nconst client = createThoughtIndustriesClient({\n  baseUrl: 'https://your-instance.thoughtindustries.com/incoming/v2',\n  apiKey: process.env.TI_API_KEY!,\n})\n\nconst { users } = await client.listUsers({ role: 'learner' })\n```\n\n## Configuration\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `baseUrl` | `string` | — | Base URL of your Thought Industries REST API |\n| `apiKey` | `string` | — | API key sent as `Authorization: Bearer <key>` |\n| `maxRetries` | `number` | `3` | Max retry attempts for 429 and 5xx responses |\n| `retryDelay` | `number` | `500` | Base delay (ms) for exponential backoff when no `Retry-After` header is present |\n| `maxRetryDelay` | `number` | `25000` | If the computed retry delay exceeds this value (ms), the error is thrown immediately instead of waiting |\n\n## Error handling\n\nAll API errors throw a `TIApiError`:\n\n```ts\nimport { TIApiError } from '@abunchofnothing/thoughtindustries-rest-sdk'\n\ntry {\n  await client.getUser('unknown-id')\n} catch (err) {\n  if (err instanceof TIApiError) {\n    console.error(err.status)        // HTTP status code\n    console.error(err.errors)        // string[] from the response body\n    console.error(err.rateLimit)     // { limit, remaining, resetAt }\n    console.error(err.retryAfterMs)  // ms to wait, if Retry-After header was present\n\n    // convenience getters\n    err.isRateLimit   // true if status === 429\n    err.isClientError // true if 400–499\n    err.isServerError // true if 500+\n    err.isRetryable   // true if 429 or 5xx (retried automatically up to maxRetries)\n  }\n}\n```\n\n## Pagination\n\nPaginated endpoints return a `pageInfo` object alongside the results:\n\n```ts\nlet cursor: string | undefined\n\ndo {\n  const { pageInfo, users } = await client.listUsers({ cursor })\n  // process users...\n  cursor = pageInfo.hasMore ? pageInfo.cursor ?? undefined : undefined\n} while (cursor)\n```\n\n## API reference\n\n### System\n\n```ts\nclient.ping() // { valid: boolean }\n```\n\n### Jobs\n\n```ts\nclient.getJob(id)\n```\n\n### Users\n\n```ts\nclient.listUsers(params?)\nclient.getUser(userId)\nclient.createUser(params)\nclient.updateUser(userId, params)\nclient.anonymizeUser(userId)\nclient.bulkImportUsers(params)\nclient.bulkContentAssignment(params)\nclient.bulkContentRemoveAccess(params)\nclient.bulkClientLicenseAssignment(params)\nclient.bulkUpdateMeetingAttendance(params)\nclient.updateMeetingAttendance(userId, params)\nclient.addUserExpirations(userId, params)\nclient.deleteUserExpirations(userId, params)\nclient.certifyUser(userId, params)\nclient.bulkCertifyUsers(params)\nclient.recertifyUser(userId, params)\nclient.makeDualRole(userId, params)\nclient.bulkRemoveDualRoleManager(params)\nclient.rescheduleUser(userId, params)\nclient.updateUserStatus(userId, params)\nclient.resetUserProgress(userId, params)\nclient.resetUserLearningPathProgress(userId, params)\n```\n\n### Events\n\nAll event methods accept an optional `BaseEventParams` (`startDate`, `endDate`, `cursor`, `userId`, `notifiableId`) and return `{ pageInfo: EventPageInfo, events: T[] }`.\n\n```ts\nclient.getCourseActions(params?)\nclient.getCourseEnrollments(params?)\nclient.getCourseCompletions(params?)\nclient.getCourseCertificates(params?)\nclient.getCoursePurchases(params?)\nclient.getCourseViews(params?)\nclient.getCourseComments(params?)\nclient.getCourseInstructorMessages(params?)\nclient.getLearningPathActions(params?)\nclient.getLogins(params?)\nclient.getVisits(params?)\nclient.getRegistrations(params?)\nclient.getAssignmentSubmissionEvents(params?)\nclient.getSubscriptionCancellations(params?)\nclient.getEmailCaptures(params?)\nclient.getNewsletterSignups(params?)\nclient.getBundlePurchases(params?)\nclient.getProductPurchases(params?)\nclient.getDiscountGroupPurchases(params?)\nclient.getPickableGroupPurchases(params?)\nclient.getQuizAttempts(params?)\nclient.getScormAttempts(params?)\nclient.getAwards(params?)\nclient.getRedemptionCodeRedeems(params?)\nclient.getOnboardingSurveyResponses(params?)\nclient.getUserLastActive7(params?)\nclient.getUserLastActive14(params?)\nclient.getUserLastActive31(params?)\n```\n\n### Content\n\n```ts\nclient.listContent(params?)\nclient.releaseContent(contentId, params)\nclient.getArticleVideoBody(courseId)\nclient.getFullContent(type, id)\nclient.exportXliff(type, id)           // returns XML string\nclient.importXliff(type, id, xliff)\nclient.getLearningPathMilestones(params?)\nclient.listCourseGroups(params?)\nclient.getCourseGroup(id)\nclient.getCourseGroupBySlug(slug)\nclient.getCourseGroupCourses(id, params?)\nclient.getCourseGroupDisplayCourse(id)\nclient.getCourseStructure(courseId)\nclient.getCourseSections(courseId, params?)\nclient.getCourseLessons(courseId, params?)\nclient.getCourseCompletionCriteria(courseId)\nclient.getSection(id)\nclient.getSectionLessons(sectionId, params?)\nclient.getLesson(id)\nclient.getTopic(id)\nclient.getCourseTopics(courseId, params?)\nclient.getLessonTopics(lessonId, params?)\nclient.createCourse(courseAttributes)\nclient.updateCourse(params)\nclient.bulkUpdatePrices(params)\nclient.bulkCreateCompletionCriteria(criteria)\nclient.bulkUpdateCompletionCriteria(criteria)\n```\n\n### Assessments\n\n```ts\nclient.listAssessmentAttempts(params?)\nclient.updateAssessmentAttemptGrade(id, params)\nclient.forgiveAssessmentAttempt(id)\n```\n\n### Assignments\n\n```ts\nclient.listAssignmentSubmissions(params?)\nclient.createAssignmentExternalActivity(params)\n```\n\n### Meetings & Locations\n\n```ts\nclient.listLocations(params?)\nclient.listMeetings(params?)\nclient.getMeeting(id)\n```\n\n### Coupons\n\n```ts\nclient.listCoupons(params?)\nclient.listCourseCoupons(params?)\nclient.bulkImportCoupons(params)\n```\n\n### External Activity\n\n```ts\nclient.createCourseExternalActivity(params)\nclient.createLearningPathExternalActivity(params)\n```\n\n### Tags\n\n```ts\nclient.listTags(params?)\nclient.listTagContent(tagIds)\n```\n\n### Ecommerce\n\n```ts\nclient.listNonRecurringPurchases(params?)\n```\n\n### Bulk Import (ILT / VILT)\n\n```ts\nclient.bulkImportViltCourseGroups(params)\nclient.bulkImportIltCourseGroups(params)\nclient.bulkImportViltSessions(params)\nclient.bulkImportIltSessions(params)\n```\n\n### Certificate Templates\n\n```ts\nclient.bulkCreateCertificateTemplates(templates)\nclient.bulkUpdateCertificateTemplates(templates)\n```\n\n## License\n\n[MIT-0](LICENSE) — no attribution required.\n","readmeFilename":"README.md"}