mirror of
https://github.com/immich-app/immich
synced 2026-08-22 13:13:05 +00:00
chore: remove open-api/typescript-sdk
This commit is contained in:
parent
8de96382be
commit
bd01b5931b
6 changed files with 0 additions and 9024 deletions
5697
open-api/typescript-sdk/build/fetch-client.d.ts
vendored
5697
open-api/typescript-sdk/build/fetch-client.d.ts
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
16
open-api/typescript-sdk/build/fetch-errors.d.ts
vendored
16
open-api/typescript-sdk/build/fetch-errors.d.ts
vendored
|
|
@ -1,16 +0,0 @@
|
|||
import { HttpError } from '@oazapfts/runtime';
|
||||
export interface ApiValidationError {
|
||||
code: string;
|
||||
path: (string | number)[];
|
||||
message: string;
|
||||
}
|
||||
export interface ApiExceptionResponse {
|
||||
message: string;
|
||||
error?: string;
|
||||
statusCode: number;
|
||||
errors?: ApiValidationError[];
|
||||
}
|
||||
export interface ApiHttpError extends HttpError {
|
||||
data: ApiExceptionResponse;
|
||||
}
|
||||
export declare function isHttpError(error: unknown): error is ApiHttpError;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import { HttpError } from '@oazapfts/runtime';
|
||||
export function isHttpError(error) {
|
||||
return error instanceof HttpError;
|
||||
}
|
||||
18
open-api/typescript-sdk/build/index.d.ts
vendored
18
open-api/typescript-sdk/build/index.d.ts
vendored
|
|
@ -1,18 +0,0 @@
|
|||
export * from './fetch-client.js';
|
||||
export * from './fetch-errors.js';
|
||||
export interface InitOptions {
|
||||
baseUrl: string;
|
||||
apiKey: string;
|
||||
headers?: Record<string, string>;
|
||||
}
|
||||
export declare const init: ({ baseUrl, apiKey, headers }: InitOptions) => void;
|
||||
export declare const getBaseUrl: () => string;
|
||||
export declare const setBaseUrl: (baseUrl: string) => void;
|
||||
export declare const setApiKey: (apiKey: string) => void;
|
||||
export declare const setHeader: (key: string, value: string) => void;
|
||||
export declare const setHeaders: (headers: Record<string, string>) => void;
|
||||
export declare const getAssetOriginalPath: (id: string) => string;
|
||||
export declare const getAssetThumbnailPath: (id: string) => string;
|
||||
export declare const getAssetPlaybackPath: (id: string) => string;
|
||||
export declare const getUserProfileImagePath: (userId: string) => string;
|
||||
export declare const getPeopleThumbnailPath: (personId: string) => string;
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
import { defaults } from './fetch-client.js';
|
||||
export * from './fetch-client.js';
|
||||
export * from './fetch-errors.js';
|
||||
export const init = ({ baseUrl, apiKey, headers }) => {
|
||||
setBaseUrl(baseUrl);
|
||||
setApiKey(apiKey);
|
||||
if (headers) {
|
||||
setHeaders(headers);
|
||||
}
|
||||
};
|
||||
export const getBaseUrl = () => defaults.baseUrl;
|
||||
export const setBaseUrl = (baseUrl) => {
|
||||
defaults.baseUrl = baseUrl;
|
||||
};
|
||||
export const setApiKey = (apiKey) => {
|
||||
defaults.headers = defaults.headers || {};
|
||||
defaults.headers['x-api-key'] = apiKey;
|
||||
};
|
||||
export const setHeader = (key, value) => {
|
||||
assertNoApiKey(key);
|
||||
defaults.headers = defaults.headers || {};
|
||||
defaults.headers[key] = value;
|
||||
};
|
||||
export const setHeaders = (headers) => {
|
||||
defaults.headers = defaults.headers || {};
|
||||
for (const [key, value] of Object.entries(headers)) {
|
||||
assertNoApiKey(key);
|
||||
defaults.headers[key] = value;
|
||||
}
|
||||
};
|
||||
const assertNoApiKey = (headerKey) => {
|
||||
if (headerKey.toLowerCase() === 'x-api-key') {
|
||||
throw new Error('The API key header can only be set using setApiKey().');
|
||||
}
|
||||
};
|
||||
export const getAssetOriginalPath = (id) => `/assets/${id}/original`;
|
||||
export const getAssetThumbnailPath = (id) => `/assets/${id}/thumbnail`;
|
||||
export const getAssetPlaybackPath = (id) => `/assets/${id}/video/playback`;
|
||||
export const getUserProfileImagePath = (userId) => `/users/${userId}/profile-image`;
|
||||
export const getPeopleThumbnailPath = (personId) => `/people/${personId}/thumbnail`;
|
||||
Loading…
Add table
Add a link
Reference in a new issue