1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-15 03:30:33 +02:00

chore: publish sdk on release (#7895)

* chore: publish sdk on release

* fix: runtime dep

* chore: sync versions

* chore: update readme

* fix: use Node16 module resolution
This commit is contained in:
Jason Rasmussen
2024-03-12 12:01:12 -04:00
committed by GitHub
parent 779f5d9b3d
commit 17d7d9364f
11 changed files with 90 additions and 40 deletions

View File

@ -0,0 +1,3 @@
package-lock.json
tsconfig.json
src/

View File

@ -0,0 +1,28 @@
# @immich/sdk
A TypeScript SDK for interfacing with the [Immich](https://immich.app/) API.
## Install
```bash
npm i --save @immich/sdk
```
## Usage
For a more detailed example, check out the [`@immich/cli`](https://github.com/immich-app/immich/tree/main/cli).
```typescript
import { defaults, getAllAlbums, getAllAssets, getMyUserInfo } from "@immich/sdk";
const API_KEY = "<API_KEY>"; // process.env.IMMICH_API_KEY
defaults.baseUrl = "https://demo.immich.app/api";
defaults.headers = { "x-api-key": API_KEY };
const user = await getMyUserInfo();
const assets = await getAllAssets({ take: 1000 });
const albums = await getAllAlbums({});
console.log({ user, assets, albums });
```

View File

@ -8,8 +8,10 @@
"name": "@immich/sdk",
"version": "1.98.2",
"license": "GNU Affero General Public License version 3",
"dependencies": {
"@oazapfts/runtime": "^1.0.2"
},
"devDependencies": {
"@oazapfts/runtime": "^1.0.0",
"@types/node": "^20.11.0",
"typescript": "^5.3.3"
}
@ -17,8 +19,7 @@
"node_modules/@oazapfts/runtime": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@oazapfts/runtime/-/runtime-1.0.2.tgz",
"integrity": "sha512-V33FjR6V+AkGRWYQW3XPm5BLn2loGl2ujSeja1TzdjjEn2zjGgl3ve0dcFf/jEwPZEOqQZl6YwIgIB/clXVqWw==",
"dev": true
"integrity": "sha512-V33FjR6V+AkGRWYQW3XPm5BLn2loGl2ujSeja1TzdjjEn2zjGgl3ve0dcFf/jEwPZEOqQZl6YwIgIB/clXVqWw=="
},
"node_modules/@types/node": {
"version": "20.11.25",

View File

@ -1,7 +1,7 @@
{
"name": "@immich/sdk",
"version": "1.98.2",
"description": "",
"description": "Auto-generated TypeScript SDK for the Immich API",
"type": "module",
"main": "./build/index.js",
"types": "./build/index.d.ts",
@ -15,9 +15,16 @@
"build": "tsc"
},
"license": "GNU Affero General Public License version 3",
"dependencies": {
"@oazapfts/runtime": "^1.0.2"
},
"devDependencies": {
"@oazapfts/runtime": "^1.0.0",
"@types/node": "^20.11.0",
"typescript": "^5.3.3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/immich-app/immich.git",
"directory": "open-api/typescript-sdk"
}
}

View File

@ -1,2 +1,2 @@
export * from './fetch-client';
export * from './fetch-errors';
export * from './fetch-client.js';
export * from './fetch-errors.js';

View File

@ -5,8 +5,8 @@
"skipLibCheck": true,
"declaration": true,
"outDir": "build",
"module": "esnext",
"moduleResolution": "Bundler",
"module": "Node16",
"moduleResolution": "Node16",
"lib": ["esnext", "dom"]
},
"include": ["src/**/*.ts"]