Generate code with openapi-generator (#5)

This commit is contained in:
Guilherme Werner
2025-05-27 08:11:22 -03:00
committed by GitHub
parent 1a8ffe89bc
commit be21a2496e
67 changed files with 8992 additions and 3492 deletions

35
src/singletion.ts Normal file
View File

@ -0,0 +1,35 @@
// Copyright (c) Tribufu. All Rights Reserved.
// SPDX-License-Identifier: MIT
import { TribufuApi } from "./";
/**
* **Tribufu API**
*
* Helper class to get a singleton instance of the Tribufu API.
*/
export class TribufuApiSingleton {
private static instance: TribufuApi | null = null;
private constructor() {}
/**
* Get the singleton instance of {@link TribufuApi}.
*
* @return Singleton instance
*/
public static getInstance(): TribufuApi {
if (!this.instance) {
this.instance = TribufuApi.fromEnvOrDefault();
}
return this.instance;
}
/**
* Reset the singleton instance of {@link TribufuApi}.
*/
public static resetInstance() {
this.instance = null;
}
}