{"_id":"@callowayisweird/gmodstore-sdk","name":"@callowayisweird/gmodstore-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@callowayisweird/gmodstore-sdk","version":"0.1.0","description":"TypeScript SDK for the GModStore (Pivity) API v3","license":"MIT","author":{"name":"CallowayIsWeird"},"repository":{"type":"git","url":"git+https://github.com/CallowayIsWeird/gmodstore-sdk.git"},"keywords":["gmodstore","pivity","garrys-mod","gmod","api","sdk","typescript"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"generate":"openapi-typescript openapi.json -o src/generated/openapi.ts","build":"npm run generate && tsup","lint":"tsc --noEmit","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run build"},"devDependencies":{"openapi-typescript":"^7.6.1","tsup":"^8.4.0","typescript":"~5.9.3","vitest":"^3.0.0"},"gitHead":"4e49d0a5d18babd06a4b5de5433746a013e69592","bugs":{"url":"https://github.com/CallowayIsWeird/gmodstore-sdk/issues"},"homepage":"https://github.com/CallowayIsWeird/gmodstore-sdk#readme","_id":"@callowayisweird/gmodstore-sdk@0.1.0","_nodeVersion":"22.19.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-JytDLUId1ftknctFIs/RiQ9gKglEsiRgz7qEhy8IrQ4iznh/vqeIeC9fEaaCm08iiNUW7vVGMPgxkXjA4kkloA==","shasum":"0812d98ab368ade8e92ebf84aa463f564b350f42","tarball":"https://registry.npmjs.org/@callowayisweird/gmodstore-sdk/-/gmodstore-sdk-0.1.0.tgz","fileCount":10,"unpackedSize":412095,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCpVACdJroYbRbNRsgw8s44cp/YM6+sZc/KNAYoN1UOdAIgM6nhqUbCwyoYSFgXfWo8RZzmrljUnQDJuhEqitf9CLk="}]},"_npmUser":{"name":"callowayisweird","email":"henrythegamerguy62@gmail.com"},"directories":{},"maintainers":[{"name":"callowayisweird","email":"henrythegamerguy62@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gmodstore-sdk_0.1.0_1774638763889_0.47885665110269326"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-27T19:12:43.767Z","0.1.0":"2026-03-27T19:12:44.038Z","modified":"2026-03-27T19:12:44.283Z"},"maintainers":[{"name":"callowayisweird","email":"henrythegamerguy62@gmail.com"}],"description":"TypeScript SDK for the GModStore (Pivity) API v3","homepage":"https://github.com/CallowayIsWeird/gmodstore-sdk#readme","keywords":["gmodstore","pivity","garrys-mod","gmod","api","sdk","typescript"],"repository":{"type":"git","url":"git+https://github.com/CallowayIsWeird/gmodstore-sdk.git"},"author":{"name":"CallowayIsWeird"},"bugs":{"url":"https://github.com/CallowayIsWeird/gmodstore-sdk/issues"},"license":"MIT","readme":"# gmodstore-sdk\n\nTypeScript SDK for the [GModStore (Pivity) API v3](https://docs.gmodstore.com). Zero dependencies, full type safety, auto-pagination.\n\n## Install\n\n```bash\nnpm install @callowayisweird/gmodstore-sdk\n```\n\n## Quick Start\n\n```ts\nimport { GModStoreClient } from \"@callowayisweird/gmodstore-sdk\";\n\nconst client = new GModStoreClient({\n  token: \"your-personal-access-token\",\n  tenant: \"gmodstore.com\",\n});\n\n// Get the authenticated user\nconst me = await client.me.get();\nconsole.log(me.user.name);\n\n// Get a user by ID\nconst user = await client.users.get(\"uuid\");\nconsole.log(user.steamId);\n\n// Find users by Steam ID\nconst page = await client.users.list({\n  filter: { steamId: [76561198000000000] },\n});\nconsole.log(page.data);\n```\n\n## Pagination\n\nList methods return a `Page<T>` that supports async iteration:\n\n```ts\n// Iterate through all pages automatically\nfor await (const purchase of client.products.purchases.list(\"product-id\")) {\n  console.log(purchase.userId);\n}\n\n// Or work with pages manually\nconst page = await client.users.list({ perPage: 10 });\nconsole.log(page.data);\nconsole.log(page.hasNextPage);\n\nif (page.hasNextPage) {\n  const next = await page.getNextPage();\n}\n```\n\n## Error Handling\n\nErrors are structured by HTTP status:\n\n```ts\nimport { NotFoundError, RateLimitError, BadRequestError } from \"@callowayisweird/gmodstore-sdk\";\n\ntry {\n  await client.users.get(\"nonexistent\");\n} catch (e) {\n  if (e instanceof NotFoundError) {\n    console.log(\"User not found\");\n  }\n  if (e instanceof RateLimitError) {\n    console.log(`Retry after ${e.retryAfter} seconds`);\n  }\n  if (e instanceof BadRequestError) {\n    console.log(e.errors); // { field: [\"error message\"] }\n  }\n}\n```\n\n429 and 503 errors are automatically retried with exponential backoff (up to 3 retries).\n\n## Rate Limits\n\nRate limit info is available after any request:\n\n```ts\nconst user = await client.users.get(\"uuid\");\nconsole.log(client.rateLimit);\n// { limit: 300, remaining: 299, reset: 1711548000 }\n```\n\n## Resources\n\n| Resource | Methods |\n|----------|---------|\n| `client.me` | `get()` |\n| `client.me.tokens` | `list()`, `create()`, `get()`, `update()`, `delete()` |\n| `client.users` | `list()`, `batch()`, `get()`, `teams()`, `products()`, `purchases()`, `bans()` |\n| `client.users.badges` | `list()`, `create()`, `delete()` |\n| `client.teams` | `list()`, `batch()`, `create()`, `get()`, `update()`, `delete()`, `users()`, `products()` |\n| `client.teams.webhooks` | `list()`, `create()`, `get()`, `update()`, `delete()`, `test()`, `getSecret()`, `updateSecret()`, `attempts()`, `resend()` |\n| `client.teams.webhookMessages` | `list()`, `get()`, `attempts()` |\n| `client.products` | `list()`, `batch()`, `get()`, `tickets()` |\n| `client.products.coupons` | `list()`, `create()`, `get()`, `update()`, `delete()` |\n| `client.products.purchases` | `list()`, `create()`, `get()`, `update()` |\n| `client.products.reviews` | `list()`, `get()` |\n| `client.products.versions` | `list()`, `create()`, `get()`, `update()`, `delete()`, `download()` |\n| `client.products.media` | `list()`, `create()`, `get()`, `update()`, `delete()`, `uploadBackground()`, `uploadPageHeader()`, `uploadBigHeader()`, `uploadListingHeader()` |\n| `client.tickets` | `batch()`, `get()`, `update()`, `uploadLog()` |\n| `client.tickets.messages` | `list()`, `create()`, `get()`, `update()`, `delete()`, `restore()` |\n| `client.tickets.messages.revisions` | `list()`, `get()` |\n| `client.tickets.attachments` | `list()`, `create()`, `get()`, `delete()` |\n| `client.tickets.tags` | `list()`, `create()`, `delete()` |\n| `client.permissions` | `list()`, `batch()`, `create()`, `get()`, `update()`, `delete()` |\n| `client.twoFactor` | `exchangeTotp()` |\n\n## Configuration\n\n```ts\nconst client = new GModStoreClient({\n  // Required\n  token: \"your-personal-access-token\",\n\n  // Optional\n  tenant: \"gmodstore.com\",        // Scope to a specific marketplace\n  baseUrl: \"https://api.pivity.com\", // Custom base URL\n  maxRetries: 3,                   // Retry attempts for 429/503\n  fetch: customFetch,              // Custom fetch implementation\n});\n```\n\n## Tenant Scoping\n\nBy default, requests are not scoped to a marketplace. Pass `tenant` to filter:\n\n```ts\n// Only GModStore resources\nconst client = new GModStoreClient({ token: \"...\", tenant: \"gmodstore.com\" });\n\n// Only Rust resources\nconst client = new GModStoreClient({ token: \"...\", tenant: \"rust.pivity.com\" });\n```\n\n## File Uploads\n\nEndpoints that accept files use `FormData`:\n\n```ts\n// Upload a product version\nconst form = new FormData();\nform.append(\"name\", \"v1.0.0\");\nform.append(\"changelog\", \"Initial release\");\nform.append(\"releaseType\", \"stable\");\nform.append(\"file\", fileBlob);\n\nconst version = await client.products.versions.create(\"product-id\", form);\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-0ed6c7c711105557db03745dae86d966"}