@xylabs/api 4.13.4 → 4.13.6

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.
@@ -1,41 +1,40 @@
1
- import { Enum } from '@xylabs/enum';
2
- import type { EnumValue } from '@xylabs/enum';
3
-
4
- export declare abstract class ApiClient {
5
- protected token?: string | null | undefined;
6
- protected stage?: ApiStage | undefined;
7
- constructor(token?: string | null | undefined, stage?: ApiStage | undefined);
8
- abstract endPoint(): string;
9
- }
10
-
11
- export declare interface ApiConfig {
12
- apiDomain: string;
13
- apiKey?: string;
14
- jwtToken?: string;
15
- userid?: string;
16
- }
17
-
18
- export declare class ApiEndpoint<T> {
19
- private _value?;
20
- private config;
21
- private path;
22
- constructor(config: ApiConfig, path: string);
23
- get value(): T | undefined;
24
- private get headers();
25
- private get url();
26
- fetch(): Promise<T>;
27
- get(): Promise<T | NonNullable<T>>;
28
- insert(value: T): Promise<T>;
29
- }
30
-
31
- export declare const ApiStage: Enum<{
32
- Beta: "beta";
33
- Local: "local";
34
- Prod: "prod";
35
- }>;
36
-
37
- export declare type ApiStage = EnumValue<typeof ApiStage>;
38
-
39
- export declare const getApiStage: (hostname: string) => "beta" | "local" | "prod";
40
-
41
- export { }
1
+ import { Enum, EnumValue } from '@xylabs/enum';
2
+
3
+ declare const ApiStage: Enum<{
4
+ Beta: "beta";
5
+ Local: "local";
6
+ Prod: "prod";
7
+ }>;
8
+ type ApiStage = EnumValue<typeof ApiStage>;
9
+
10
+ declare abstract class ApiClient {
11
+ protected token?: string | null | undefined;
12
+ protected stage?: ApiStage | undefined;
13
+ constructor(token?: string | null | undefined, stage?: ApiStage | undefined);
14
+ abstract endPoint(): string;
15
+ }
16
+
17
+ interface ApiConfig {
18
+ apiDomain: string;
19
+ apiKey?: string;
20
+ jwtToken?: string;
21
+ userid?: string;
22
+ }
23
+
24
+ declare class ApiEndpoint<T> {
25
+ private _value?;
26
+ private config;
27
+ private path;
28
+ constructor(config: ApiConfig, path: string);
29
+ get value(): T | undefined;
30
+ private get headers();
31
+ private get url();
32
+ fetch(): Promise<T>;
33
+ get(): Promise<T | NonNullable<T>>;
34
+ insert(value: T): Promise<T>;
35
+ }
36
+
37
+ declare const getApiStage: (hostname: string) => "beta" | "local" | "prod";
38
+
39
+ export { ApiClient, ApiEndpoint, ApiStage, getApiStage };
40
+ export type { ApiConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/api",
3
- "version": "4.13.4",
3
+ "version": "4.13.6",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "xylabs",
@@ -38,13 +38,13 @@
38
38
  "packages/**/*"
39
39
  ],
40
40
  "dependencies": {
41
- "@xylabs/enum": "^4.13.4",
42
- "@xylabs/typeof": "^4.13.4",
41
+ "@xylabs/enum": "^4.13.6",
42
+ "@xylabs/typeof": "^4.13.6",
43
43
  "axios": "^1.10.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.7",
47
- "@xylabs/tsconfig": "^7.0.0-rc.7",
46
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.8",
47
+ "@xylabs/tsconfig": "^7.0.0-rc.8",
48
48
  "typescript": "^5.8.3",
49
49
  "vitest": "^3.2.4"
50
50
  },