{"_id":"@animal-id/partner-nestjs","_rev":"2-c8536149a7a263aa741e8cf952f529f4","name":"@animal-id/partner-nestjs","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@animal-id/partner-nestjs","version":"0.1.0","license":"MIT","_id":"@animal-id/partner-nestjs@0.1.0","maintainers":[{"name":"animal-id","email":"vm@animal-id.net"}],"dist":{"shasum":"17932b1ba6c143f9c7ade90e845f8190c4884e33","tarball":"https://registry.npmjs.org/@animal-id/partner-nestjs/-/partner-nestjs-0.1.0.tgz","fileCount":8,"integrity":"sha512-cl/x8eGN46C7wNBDTtSzVm5GIokAUjM+LMHQ8FSVkGjUFQfSI6cIgCfSdC6QdZAUi+FfBlHupC2K/OooYW89WA==","signatures":[{"sig":"MEYCIQDRK7XhmNat8/LHhDKXtth1d4+ZrgkW7zc3KPlGh96Q7wIhAITWjh+nPuJ3bCa/nHlw1LSjgH/1vBpldneTWot/d+Ds","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30334},"main":"./dist/index.cjs","type":"module","_from":"file:animal-id-partner-nestjs-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"animal-id","email":"vm@animal-id.net"},"_resolved":"/private/var/folders/bd/q0ht6d8n3nn7p95597z0t7p40000gn/T/64c6c66d43c32001c46bdd455932de2b/animal-id-partner-nestjs-0.1.0.tgz","_integrity":"sha512-cl/x8eGN46C7wNBDTtSzVm5GIokAUjM+LMHQ8FSVkGjUFQfSI6cIgCfSdC6QdZAUi+FfBlHupC2K/OooYW89WA==","_npmVersion":"10.9.2","description":"NestJS module for the Animal-ID Partner API (forRoot/forRootAsync + injectable service).","directories":{},"_nodeVersion":"22.16.0","dependencies":{"@animal-id/partner-core":"0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"rxjs":"^7.8.1","tsup":"^8.3.0","typescript":"^5.6.0","@types/node":"^20.14.0","@nestjs/common":"^10.4.0","reflect-metadata":"^0.2.2"},"peerDependencies":{"rxjs":">=7","@nestjs/common":">=9","reflect-metadata":">=0.1.13"},"_npmOperationalInternal":{"tmp":"tmp/partner-nestjs_0.1.0_1781806630895_0.2821699031681313","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@animal-id/partner-nestjs","version":"0.2.0","description":"NestJS module for the Animal-ID Partner API (forRoot/forRootAsync + injectable service).","license":"MIT","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"engines":{"node":">=18"},"dependencies":{"@animal-id/partner-core":"0.2.0"},"peerDependencies":{"@nestjs/common":">=9","reflect-metadata":">=0.1.13","rxjs":">=7"},"devDependencies":{"@nestjs/common":"^10.4.0","@types/node":"^20.14.0","reflect-metadata":"^0.2.2","rxjs":"^7.8.1","tsup":"^8.3.0","typescript":"^5.6.0"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit -p tsconfig.json","clean":"rm -rf dist"},"_id":"@animal-id/partner-nestjs@0.2.0","_integrity":"sha512-PA+2ZepQnFAbDXva0Kc61XEgqd9EQOhr9aEvuPzNC22J8j1cQY73wHWWg27I9xCOfGLyu1gwaOnqEWu3oSOBdg==","_resolved":"/private/var/folders/bd/q0ht6d8n3nn7p95597z0t7p40000gn/T/47384cb1d21d22d8e3464d7706bd3e32/animal-id-partner-nestjs-0.2.0.tgz","_from":"file:animal-id-partner-nestjs-0.2.0.tgz","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-PA+2ZepQnFAbDXva0Kc61XEgqd9EQOhr9aEvuPzNC22J8j1cQY73wHWWg27I9xCOfGLyu1gwaOnqEWu3oSOBdg==","shasum":"82ef9cd1340c2f649041db3de5dec03567f221a7","tarball":"https://registry.npmjs.org/@animal-id/partner-nestjs/-/partner-nestjs-0.2.0.tgz","fileCount":8,"unpackedSize":30334,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDMITyXzDbv5XS/nGQ6Jec3aCcZ3NWjNQlHPV7pCgFq5AiEAwslCX5QDIJnsKkg5ZHLIDaEBlB+xowhj8hyjCI7PzA8="}]},"_npmUser":{"name":"animal-id","email":"vm@animal-id.net"},"directories":{},"maintainers":[{"name":"animal-id","email":"vm@animal-id.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/partner-nestjs_0.2.0_1782836439553_0.3783513729389236"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-18T18:17:10.695Z","modified":"2026-06-30T16:20:39.857Z","0.1.0":"2026-06-18T18:17:11.061Z","0.2.0":"2026-06-30T16:20:39.740Z"},"license":"MIT","description":"NestJS module for the Animal-ID Partner API (forRoot/forRootAsync + injectable service).","maintainers":[{"name":"animal-id","email":"vm@animal-id.net"}],"readme":"# @animal-id/partner-nestjs\n\nNestJS module for the Animal-ID Partner API. Wraps the isomorphic client in an\ninjectable service; runs server-side so it holds your credentials safely.\n\n```bash\npnpm add @animal-id/partner-nestjs @nestjs/common reflect-metadata rxjs\n```\n\n## Register the module\n\n**Sync:**\n\n```ts\nimport { Module } from '@nestjs/common';\nimport { AnimalIdModule } from '@animal-id/partner-nestjs';\n\n@Module({\n  imports: [\n    AnimalIdModule.forRoot({\n      isGlobal: true,\n      credentials: {\n        appId: process.env.AID_APP_ID!,\n        publicKey: process.env.AID_PUBLIC_KEY!,\n        privateKey: process.env.AID_PRIVATE_KEY!,\n      },\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n**Async (from `ConfigService`):**\n\n```ts\nAnimalIdModule.forRootAsync({\n  isGlobal: true,\n  inject: [ConfigService],\n  useFactory: (cfg: ConfigService) => ({\n    baseUrl: cfg.get('AID_BASE_URL'),\n    credentials: {\n      appId: cfg.getOrThrow('AID_APP_ID'),\n      publicKey: cfg.getOrThrow('AID_PUBLIC_KEY'),\n      privateKey: cfg.getOrThrow('AID_PRIVATE_KEY'),\n    },\n  }),\n});\n```\n\n## Use the service\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { AnimalIdService } from '@animal-id/partner-nestjs';\n\n@Injectable()\nexport class PetsService {\n  constructor(private readonly aid: AnimalIdService) {}\n\n  async register(email: string) {\n    const owner = await this.aid.owners.create({ email, consent: { account_creation: true } });\n    return this.aid.animals.create({\n      species: 3,\n      is_microchip: false,\n      nickname: 'Барсік',\n      owners: [{ user_gid: owner.user_gid }],\n    });\n  }\n}\n```\n\nThe service exposes the same resources as the core client\n(`aid.dictionaries`, `aid.owners`, `aid.animals`, `aid.procedures`, `aid.photos`)\nand the full client via `aid.client`. Web Crypto is wired up automatically, so it\nworks on Node 18+ without extra flags. Re-exports `@animal-id/partner-core`.\n","readmeFilename":"README.md"}