base.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * Immich
  5. * Immich API
  6. *
  7. * The version of the OpenAPI document: 1.81.0
  8. *
  9. *
  10. * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
  11. * https://openapi-generator.tech
  12. * Do not edit the class manually.
  13. */
  14. import type { Configuration } from './configuration';
  15. // Some imports not used depending on template conditions
  16. // @ts-ignore
  17. import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
  18. import globalAxios from 'axios';
  19. export const BASE_PATH = "/api".replace(/\/+$/, "");
  20. /**
  21. *
  22. * @export
  23. */
  24. export const COLLECTION_FORMATS = {
  25. csv: ",",
  26. ssv: " ",
  27. tsv: "\t",
  28. pipes: "|",
  29. };
  30. /**
  31. *
  32. * @export
  33. * @interface RequestArgs
  34. */
  35. export interface RequestArgs {
  36. url: string;
  37. options: AxiosRequestConfig;
  38. }
  39. /**
  40. *
  41. * @export
  42. * @class BaseAPI
  43. */
  44. export class BaseAPI {
  45. protected configuration: Configuration | undefined;
  46. constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
  47. if (configuration) {
  48. this.configuration = configuration;
  49. this.basePath = configuration.basePath || this.basePath;
  50. }
  51. }
  52. };
  53. /**
  54. *
  55. * @export
  56. * @class RequiredError
  57. * @extends {Error}
  58. */
  59. export class RequiredError extends Error {
  60. constructor(public field: string, msg?: string) {
  61. super(msg);
  62. this.name = "RequiredError"
  63. }
  64. }