@xylabs/api 4.0.3 → 4.0.4

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.
@@ -0,0 +1,9 @@
1
+ import { ApiStage } from './ApiStage.ts';
2
+ declare abstract class ApiClient {
3
+ protected token?: (string | null) | undefined;
4
+ protected stage?: ApiStage | undefined;
5
+ constructor(token?: (string | null) | undefined, stage?: ApiStage | undefined);
6
+ abstract endPoint(): string;
7
+ }
8
+ export { ApiClient };
9
+ //# sourceMappingURL=ApiClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiClient.d.ts","sourceRoot":"","sources":["../../src/ApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,uBAAe,SAAS;IAEpB,SAAS,CAAC,KAAK,CAAC,GAAE,MAAM,GAAG,IAAI;IAC/B,SAAS,CAAC,KAAK,CAAC,EAAE,QAAQ;gBADhB,KAAK,CAAC,GAAE,MAAM,GAAG,IAAI,aAAA,EACrB,KAAK,CAAC,EAAE,QAAQ,YAAA;IAM5B,QAAQ,CAAC,QAAQ,IAAI,MAAM;CAC5B;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,8 @@
1
+ interface ApiConfig {
2
+ apiDomain: string;
3
+ apiKey?: string;
4
+ jwtToken?: string;
5
+ userid?: string;
6
+ }
7
+ export type { ApiConfig };
8
+ //# sourceMappingURL=ApiConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiConfig.d.ts","sourceRoot":"","sources":["../../src/ApiConfig.ts"],"names":[],"mappings":"AAAA,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,YAAY,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { ApiConfig } from './ApiConfig.ts';
2
+ declare class ApiEndpoint<T> {
3
+ private _value?;
4
+ private config;
5
+ private path;
6
+ constructor(config: ApiConfig, path: string);
7
+ get value(): T | undefined;
8
+ private get headers();
9
+ private get url();
10
+ fetch(): Promise<T>;
11
+ get(): Promise<T | NonNullable<T>>;
12
+ insert(value: T): Promise<T>;
13
+ }
14
+ export { ApiEndpoint };
15
+ //# sourceMappingURL=ApiEndpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiEndpoint.d.ts","sourceRoot":"","sources":["../../src/ApiEndpoint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,cAAM,WAAW,CAAC,CAAC;IACjB,OAAO,CAAC,MAAM,CAAC,CAAG;IAClB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,IAAI,CAAQ;gBAER,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM;IAK3C,IAAI,KAAK,kBAER;IAED,OAAO,KAAK,OAAO,GAElB;IAED,OAAO,KAAK,GAAG,GAEd;IAEK,KAAK;IAUL,GAAG;IAIH,MAAM,CAAC,KAAK,EAAE,CAAC;CAStB;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,7 @@
1
+ declare enum ApiStage {
2
+ Beta = "beta",
3
+ Local = "local",
4
+ Prod = "prod"
5
+ }
6
+ export { ApiStage };
7
+ //# sourceMappingURL=ApiStage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiStage.d.ts","sourceRoot":"","sources":["../../src/ApiStage.ts"],"names":[],"mappings":"AAAA,aAAK,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { ApiStage } from './ApiStage.ts';
2
+ declare const getApiStage: (hostname: string) => ApiStage;
3
+ export { getApiStage };
4
+ //# sourceMappingURL=getApiStage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getApiStage.d.ts","sourceRoot":"","sources":["../../src/getApiStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,QAAA,MAAM,WAAW,aAAc,MAAM,aAQpC,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1,36 +1,6 @@
1
- declare enum ApiStage {
2
- Beta = "beta",
3
- Local = "local",
4
- Prod = "prod"
5
- }
6
-
7
- declare abstract class ApiClient {
8
- protected token?: (string | null) | undefined;
9
- protected stage?: ApiStage | undefined;
10
- constructor(token?: (string | null) | undefined, stage?: ApiStage | undefined);
11
- abstract endPoint(): string;
12
- }
13
-
14
- interface ApiConfig {
15
- apiDomain: string;
16
- apiKey?: string;
17
- jwtToken?: string;
18
- userid?: string;
19
- }
20
-
21
- declare class ApiEndpoint<T> {
22
- private _value?;
23
- private config;
24
- private path;
25
- constructor(config: ApiConfig, path: string);
26
- get value(): T | undefined;
27
- private get headers();
28
- private get url();
29
- fetch(): Promise<T>;
30
- get(): Promise<T | NonNullable<T>>;
31
- insert(value: T): Promise<T>;
32
- }
33
-
34
- declare const getApiStage: (hostname: string) => ApiStage;
35
-
36
- export { ApiClient, type ApiConfig, ApiEndpoint, ApiStage, getApiStage };
1
+ export * from './ApiClient.ts';
2
+ export * from './ApiConfig.ts';
3
+ export * from './ApiEndpoint.ts';
4
+ export * from './ApiStage.ts';
5
+ export * from './getApiStage.ts';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/api",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "xylabs",
@@ -38,11 +38,11 @@
38
38
  "packages/**/*"
39
39
  ],
40
40
  "dependencies": {
41
- "axios": "^1.7.4"
41
+ "axios": "^1.7.5"
42
42
  },
43
43
  "devDependencies": {
44
- "@xylabs/ts-scripts-yarn3": "^4.0.0",
45
- "@xylabs/tsconfig": "^4.0.0",
44
+ "@xylabs/ts-scripts-yarn3": "^4.0.7",
45
+ "@xylabs/tsconfig": "^4.0.7",
46
46
  "typescript": "^5.5.4"
47
47
  },
48
48
  "engines": {