configuration.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * Immich
  5. * Immich API
  6. *
  7. * The version of the OpenAPI document: 1.73.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. export interface ConfigurationParameters {
  15. apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
  16. username?: string;
  17. password?: string;
  18. accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
  19. basePath?: string;
  20. baseOptions?: any;
  21. formDataCtor?: new () => any;
  22. }
  23. export class Configuration {
  24. /**
  25. * parameter for apiKey security
  26. * @param name security name
  27. * @memberof Configuration
  28. */
  29. apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
  30. /**
  31. * parameter for basic security
  32. *
  33. * @type {string}
  34. * @memberof Configuration
  35. */
  36. username?: string;
  37. /**
  38. * parameter for basic security
  39. *
  40. * @type {string}
  41. * @memberof Configuration
  42. */
  43. password?: string;
  44. /**
  45. * parameter for oauth2 security
  46. * @param name security name
  47. * @param scopes oauth2 scope
  48. * @memberof Configuration
  49. */
  50. accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
  51. /**
  52. * override base path
  53. *
  54. * @type {string}
  55. * @memberof Configuration
  56. */
  57. basePath?: string;
  58. /**
  59. * base options for axios calls
  60. *
  61. * @type {any}
  62. * @memberof Configuration
  63. */
  64. baseOptions?: any;
  65. /**
  66. * The FormData constructor that will be used to create multipart form data
  67. * requests. You can inject this here so that execution environments that
  68. * do not support the FormData class can still run the generated client.
  69. *
  70. * @type {new () => FormData}
  71. */
  72. formDataCtor?: new () => any;
  73. constructor(param: ConfigurationParameters = {}) {
  74. this.apiKey = param.apiKey;
  75. this.username = param.username;
  76. this.password = param.password;
  77. this.accessToken = param.accessToken;
  78. this.basePath = param.basePath;
  79. this.baseOptions = param.baseOptions;
  80. this.formDataCtor = param.formDataCtor;
  81. }
  82. /**
  83. * Check if the given MIME is a JSON MIME.
  84. * JSON MIME examples:
  85. * application/json
  86. * application/json; charset=UTF8
  87. * APPLICATION/JSON
  88. * application/vnd.company+json
  89. * @param mime - MIME (Multipurpose Internet Mail Extensions)
  90. * @return True if the given MIME is JSON, false otherwise.
  91. */
  92. public isJsonMime(mime: string): boolean {
  93. const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
  94. return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
  95. }
  96. }