@profcomff/api-uilib 2024.7.27-1 → 2024.7.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profcomff/api-uilib",
3
- "version": "2024.07.27-1",
3
+ "version": "2024.07.28",
4
4
  "description": "API wrappers, autogenerated from openapi.json files",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.d.ts",
package/src/index.ts CHANGED
@@ -32,7 +32,7 @@ const authMiddleware: Middleware = {
32
32
  },
33
33
  };
34
34
 
35
- export const createClient = (baseUrl: string) => {
35
+ export const createClient = (baseUrl: string): ReturnType<typeof Client<paths>> => {
36
36
  if (currentClient) {
37
37
  throw new Error("Client already initialized");
38
38
  }
@@ -44,6 +44,10 @@ export const createClient = (baseUrl: string) => {
44
44
  return currentClient;
45
45
  }
46
46
 
47
+ export const createTestClient = (baseUrl: string): ReturnType<typeof Client<paths>> => {
48
+ return Client<paths>({ baseUrl });
49
+ }
50
+
47
51
  export const setupAuth = (newToken: string | null) => {
48
52
  currentToken = newToken;
49
53
  if (currentClient !== undefined) {
package/src/index.d.ts DELETED
@@ -1,22 +0,0 @@
1
- import Client from "openapi-fetch";
2
- import type { paths as achievementPaths } from "./openapi/achievement.ts";
3
- import type { paths as authPaths } from "./openapi/auth.ts";
4
- import type { paths as marketingPaths } from "./openapi/marketing.ts";
5
- import type { paths as printPaths } from "./openapi/print.ts";
6
- import type { paths as servicesPaths } from "./openapi/services.ts";
7
- import type { paths as socialPaths } from "./openapi/social.ts";
8
- import type { paths as timetablePaths } from "./openapi/timetable.ts";
9
- import type { paths as userdataPaths } from "./openapi/userdata.ts";
10
-
11
- export type paths = (
12
- achievementPaths &
13
- authPaths &
14
- marketingPaths &
15
- printPaths &
16
- servicesPaths &
17
- socialPaths &
18
- timetablePaths &
19
- userdataPaths
20
- );
21
- export function createClient(baseUrl: string): ReturnType<typeof Client<paths>>;
22
- export function setupAuth(newToken: string | null): void;