feat: add usage and download intent accounting
This commit is contained in:
1 parent
846904f3db
commit
22fe6bf659
14 files changed
+3008
-2
No files matched your search
@@ -8,6 +8,7 @@ import { ImmichClientError, type ImmichErrorCode } from "./errors";
|
||||
import type {
|
||||
ImmichAlbum,
|
||||
ImmichAlbumSummary,
|
||||
ImmichAsset,
|
||||
ImmichBinary,
|
||||
ImmichClient,
|
||||
ImmichSearchPage,
|
||||
@@ -27,6 +28,10 @@ const assetSchema = z
|
||||
})
|
||||
.passthrough();
|
||||
|
||||
const currentAssetSchema = assetSchema.extend({
|
||||
type: z.enum(["IMAGE", "VIDEO"]),
|
||||
});
|
||||
|
||||
const albumSummarySchema = z
|
||||
.object({
|
||||
id: z.string(),
|
||||
@@ -325,6 +330,14 @@ export function createImmichClient({
|
||||
signal,
|
||||
);
|
||||
},
|
||||
getAsset(assetId, signal) {
|
||||
return requestJson<ImmichAsset>(
|
||||
`/assets/${encodeURIComponent(assetId)}`,
|
||||
{ method: "GET" },
|
||||
currentAssetSchema,
|
||||
signal,
|
||||
);
|
||||
},
|
||||
searchPhotos(input, signal) {
|
||||
return requestJson<ImmichSearchPage>(
|
||||
"/search/metadata",
|
||||
|
||||
Reference in new issue
Block a user