@xylabs/api
Advanced tools
Comparing version 2.10.0 to 2.10.1
@@ -1,5 +0,36 @@ | ||
export { ApiClient } from './ApiClient.js'; | ||
export { ApiConfig } from './ApiConfig.js'; | ||
export { ApiEndpoint } from './ApiEndpoint.js'; | ||
export { ApiStage } from './ApiStage.js'; | ||
export { getApiStage } from './getApiStage.js'; | ||
declare enum ApiStage { | ||
Beta = "beta", | ||
Local = "local", | ||
Prod = "prod" | ||
} | ||
declare abstract class ApiClient { | ||
protected token?: string | null | undefined; | ||
protected stage?: ApiStage | undefined; | ||
constructor(token?: string | null | undefined, stage?: ApiStage | undefined); | ||
abstract endPoint(): string; | ||
} | ||
interface ApiConfig { | ||
apiDomain: string; | ||
apiKey?: string; | ||
jwtToken?: string; | ||
userid?: string; | ||
} | ||
declare class ApiEndpoint<T> { | ||
private _value?; | ||
private config; | ||
private path; | ||
constructor(config: ApiConfig, path: string); | ||
get value(): T | undefined; | ||
private get headers(); | ||
private get url(); | ||
fetch(): Promise<T>; | ||
get(): Promise<T | NonNullable<T>>; | ||
insert(value: T): Promise<T>; | ||
} | ||
declare const getApiStage: (hostname: string) => ApiStage; | ||
export { ApiClient, ApiConfig, ApiEndpoint, ApiStage, getApiStage }; |
@@ -58,4 +58,3 @@ { | ||
"dependencies": { | ||
"axios": "^1.5.0", | ||
"tslib": "^2.6.2" | ||
"axios": "^1.5.0" | ||
}, | ||
@@ -76,4 +75,4 @@ "devDependencies": { | ||
"sideEffects": false, | ||
"version": "2.10.0", | ||
"version": "2.10.1", | ||
"packageManager": "yarn@3.3.1" | ||
} |
import { ApiStage } from './ApiStage' | ||
abstract class ApiClient { | ||
public constructor(protected token?: string | null, protected stage?: ApiStage) { | ||
public constructor( | ||
protected token?: string | null, | ||
protected stage?: ApiStage, | ||
) { | ||
this.stage = stage ?? ApiStage.Prod | ||
@@ -6,0 +9,0 @@ this.token = token |
@@ -8,8 +8,10 @@ import { defineConfig } from 'tsup' | ||
clean: true, | ||
dts: true, | ||
entry: ['src'], | ||
dts: { | ||
entry: ['src/index.ts'], | ||
}, | ||
entry: ['src/index.ts'], | ||
format: ['cjs', 'esm'], | ||
sourcemap: true, | ||
splitting: false, | ||
tsconfig: 'tsconfig.json', | ||
tsconfig: 'tsconfig.build.json', | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1
0
27943
16
313
- Removedtslib@^2.6.2
- Removedtslib@2.8.1(transitive)