mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor: open api (#6334)
This commit is contained in:
parent
a1523a9af0
commit
2439c5ab57
83 changed files with 404 additions and 19672 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { BaseCommand } from '../../cli/base-command';
|
||||
|
||||
export default class LoginKey extends BaseCommand {
|
||||
export class LoginKey extends BaseCommand {
|
||||
public async run(instanceUrl: string, apiKey: string): Promise<void> {
|
||||
console.log('Executing API key auth flow...');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { BaseCommand } from '../cli/base-command';
|
||||
|
||||
export default class Logout extends BaseCommand {
|
||||
export class Logout extends BaseCommand {
|
||||
public static readonly description = 'Logout and remove persisted credentials';
|
||||
|
||||
public async run(): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { BaseCommand } from '../cli/base-command';
|
||||
|
||||
export default class ServerInfo extends BaseCommand {
|
||||
export class ServerInfo extends BaseCommand {
|
||||
public async run() {
|
||||
await this.connect();
|
||||
const { data: versionInfo } = await this.immichApi.serverInfoApi.getServerVersion();
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ import fs from 'node:fs';
|
|||
import cliProgress from 'cli-progress';
|
||||
import byteSize from 'byte-size';
|
||||
import { BaseCommand } from '../cli/base-command';
|
||||
import axios, { AxiosRequestConfig } from 'axios';
|
||||
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import FormData from 'form-data';
|
||||
|
||||
export default class Upload extends BaseCommand {
|
||||
export class Upload extends BaseCommand {
|
||||
uploadLength!: number;
|
||||
|
||||
public async run(paths: string[], options: UploadOptionsDto): Promise<void> {
|
||||
|
|
@ -172,7 +172,7 @@ export default class Upload extends BaseCommand {
|
|||
}
|
||||
}
|
||||
|
||||
private async uploadAsset(data: FormData): Promise<axios.AxiosResponse> {
|
||||
private async uploadAsset(data: FormData): Promise<AxiosResponse> {
|
||||
const url = this.immichApi.apiConfiguration.instanceUrl + '/asset/upload';
|
||||
|
||||
const config: AxiosRequestConfig = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue