@jsfsi-core/ts-crossplatform 1.1.32 → 1.1.34

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,14 @@
1
+ import { z } from 'zod';
2
+ import { Failure } from '../failures/failure';
3
+ import { Result } from '../result/result';
4
+ import { NetworkConflictFailure } from './failures/NetworkConflictFailure';
5
+ import { NetworkFailure } from './failures/NetworkFailure';
6
+ import { NotFoundFailure } from './failures/NotFoundFailure';
7
+ export declare abstract class HttpSafeClient {
8
+ private readonly baseUrl;
9
+ constructor(baseUrl: string);
10
+ protected abstract getHeaders(): Promise<Set<[string, string]>>;
11
+ fetch<T, F extends Failure>(path: string, responseSchema: z.ZodType<T>, failure: new (error: unknown, metadata?: unknown) => F, options?: RequestInit): Promise<Result<T, NetworkFailure | NetworkConflictFailure | NotFoundFailure | F>>;
12
+ fetchBlob<F extends Failure>(path: string, failure: new (error: unknown, metadata?: unknown) => F, options?: RequestInit): Promise<Result<Blob, NetworkFailure | NotFoundFailure | F>>;
13
+ private mergeHeaders;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Failure } from '../../failures/failure';
2
+ export declare class NetworkConflictFailure extends Failure {
3
+ readonly error: unknown;
4
+ constructor(error: unknown);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { Failure } from '../../failures/failure';
2
+ export declare class NetworkFailure extends Failure {
3
+ readonly error: unknown;
4
+ constructor(error: unknown);
5
+ }
@@ -0,0 +1,4 @@
1
+ import { Failure } from '../../failures/failure';
2
+ export declare class NotFoundFailure extends Failure {
3
+ constructor();
4
+ }
@@ -0,0 +1,3 @@
1
+ export * from './NetworkConflictFailure';
2
+ export * from './NetworkFailure';
3
+ export * from './NotFoundFailure';
@@ -0,0 +1,3 @@
1
+ export * from './HttpSafeClient';
2
+ export * from './failures';
3
+ export * from './models/EmptyResponse';
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const EmptyResponse: z.ZodVoid;
@@ -6,3 +6,4 @@ export * from './configuration/configuration';
6
6
  export * from './datetime/datetime';
7
7
  export * from './guid/Guid';
8
8
  export * from './paging';
9
+ export * from './http';
@@ -15,3 +15,4 @@ export type Page<T> = {
15
15
  pageSize: number;
16
16
  elements: T[];
17
17
  };
18
+ export declare function EmptyPage<T>(): Page<T>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsfsi-core/ts-crossplatform",
3
- "version": "1.1.32",
3
+ "version": "1.1.34",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@vitest/coverage-v8": "4.0.18",
42
+ "nock": "14.0.11",
42
43
  "vite": "7.3.1",
43
44
  "vite-plugin-dts": "4.5.4",
44
45
  "vitest": "4.0.18"