basyx-typescript-sdk 0.9.0 → 1.0.0
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/README.md +16 -11
- package/bundle/index.js +980 -3079
- package/bundle/index.js.map +1 -1
- package/dist/clients/AasDiscoveryClient.d.ts +5 -4
- package/dist/clients/AasRegistryClient.d.ts +11 -10
- package/dist/clients/AasRepositoryClient.d.ts +51 -50
- package/dist/clients/AasxFileClient.d.ts +6 -5
- package/dist/clients/ConceptDescriptionRepositoryClient.d.ts +6 -5
- package/dist/clients/SubmodelRegistryClient.d.ts +6 -5
- package/dist/clients/SubmodelRepositoryClient.d.ts +21 -20
- package/dist/generated/AasDiscoveryService/apis/AssetAdministrationShellBasicDiscoveryAPIApi.d.ts +1 -1
- package/dist/generated/AasDiscoveryService/apis/AssetAdministrationShellBasicDiscoveryAPIApi.js +1 -1
- package/dist/generated/AasDiscoveryService/apis/DescriptionAPIApi.d.ts +1 -1
- package/dist/generated/AasDiscoveryService/apis/DescriptionAPIApi.js +1 -1
- package/dist/generated/AasDiscoveryService/index.d.ts +0 -1
- package/dist/generated/AasDiscoveryService/index.js +0 -1
- package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.d.ts +1 -1
- package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.js +1 -1
- package/dist/generated/AasRegistryService/apis/DescriptionAPIApi.d.ts +1 -1
- package/dist/generated/AasRegistryService/apis/DescriptionAPIApi.js +1 -1
- package/dist/generated/AasRegistryService/index.d.ts +0 -1
- package/dist/generated/AasRegistryService/index.js +0 -1
- package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.d.ts +1 -1
- package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.js +1 -1
- package/dist/generated/AasRepositoryService/apis/DescriptionAPIApi.d.ts +1 -1
- package/dist/generated/AasRepositoryService/apis/DescriptionAPIApi.js +1 -1
- package/dist/generated/AasRepositoryService/apis/SerializationAPIApi.d.ts +1 -1
- package/dist/generated/AasRepositoryService/apis/SerializationAPIApi.js +1 -1
- package/dist/generated/AasRepositoryService/index.d.ts +0 -1
- package/dist/generated/AasRepositoryService/index.js +0 -1
- package/dist/generated/AasxFileService/apis/AASXFileServerAPIApi.d.ts +1 -1
- package/dist/generated/AasxFileService/apis/AASXFileServerAPIApi.js +1 -1
- package/dist/generated/AasxFileService/index.d.ts +0 -1
- package/dist/generated/AasxFileService/index.js +0 -1
- package/dist/generated/ConceptDescriptionRepositoryService/apis/ConceptDescriptionRepositoryAPIApi.d.ts +1 -1
- package/dist/generated/ConceptDescriptionRepositoryService/apis/ConceptDescriptionRepositoryAPIApi.js +1 -1
- package/dist/generated/ConceptDescriptionRepositoryService/apis/DescriptionAPIApi.d.ts +1 -1
- package/dist/generated/ConceptDescriptionRepositoryService/apis/DescriptionAPIApi.js +1 -1
- package/dist/generated/ConceptDescriptionRepositoryService/apis/SerializationAPIApi.d.ts +1 -1
- package/dist/generated/ConceptDescriptionRepositoryService/apis/SerializationAPIApi.js +1 -1
- package/dist/generated/ConceptDescriptionRepositoryService/index.d.ts +0 -1
- package/dist/generated/ConceptDescriptionRepositoryService/index.js +0 -2
- package/dist/generated/SubmodelRegistryService/apis/DescriptionAPIApi.d.ts +1 -1
- package/dist/generated/SubmodelRegistryService/apis/DescriptionAPIApi.js +1 -1
- package/dist/generated/SubmodelRegistryService/apis/SubmodelRegistryAPIApi.d.ts +1 -1
- package/dist/generated/SubmodelRegistryService/apis/SubmodelRegistryAPIApi.js +1 -1
- package/dist/generated/SubmodelRegistryService/index.d.ts +0 -1
- package/dist/generated/SubmodelRegistryService/index.js +0 -1
- package/dist/generated/SubmodelRepositoryService/apis/DescriptionAPIApi.d.ts +1 -1
- package/dist/generated/SubmodelRepositoryService/apis/DescriptionAPIApi.js +1 -1
- package/dist/generated/SubmodelRepositoryService/apis/SerializationAPIApi.d.ts +1 -1
- package/dist/generated/SubmodelRepositoryService/apis/SerializationAPIApi.js +1 -1
- package/dist/generated/SubmodelRepositoryService/apis/SubmodelRepositoryAPIApi.d.ts +1 -1
- package/dist/generated/SubmodelRepositoryService/apis/SubmodelRepositoryAPIApi.js +1 -1
- package/dist/generated/SubmodelRepositoryService/index.d.ts +0 -1
- package/dist/generated/SubmodelRepositoryService/index.js +0 -1
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.js +1 -0
- package/dist/generated/{SubmodelRepositoryService/runtime.d.ts → runtime.d.ts} +2 -2
- package/dist/generated/{SubmodelRepositoryService/runtime.js → runtime.js} +2 -2
- package/dist/lib/apiConfig.d.ts +2 -2
- package/dist/lib/apiConfig.js +3 -21
- package/dist/lib/errorHandler.js +4 -23
- package/package.json +1 -1
- package/dist/generated/AasDiscoveryService/runtime.d.ts +0 -181
- package/dist/generated/AasDiscoveryService/runtime.js +0 -326
- package/dist/generated/AasRegistryService/runtime.d.ts +0 -181
- package/dist/generated/AasRegistryService/runtime.js +0 -326
- package/dist/generated/AasRepositoryService/runtime.d.ts +0 -181
- package/dist/generated/AasRepositoryService/runtime.js +0 -326
- package/dist/generated/AasxFileService/runtime.d.ts +0 -181
- package/dist/generated/AasxFileService/runtime.js +0 -326
- package/dist/generated/ConceptDescriptionRepositoryService/runtime.d.ts +0 -181
- package/dist/generated/ConceptDescriptionRepositoryService/runtime.js +0 -326
- package/dist/generated/SubmodelRegistryService/runtime.d.ts +0 -181
- package/dist/generated/SubmodelRegistryService/runtime.js +0 -326
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import * as runtime from '
|
|
12
|
+
import * as runtime from '../../runtime';
|
|
13
13
|
export interface GenerateSerializationByIdsRequest {
|
|
14
14
|
aasIds?: Array<string>;
|
|
15
15
|
submodelIds?: Array<string>;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import * as runtime from '
|
|
12
|
+
import * as runtime from '../../runtime';
|
|
13
13
|
import type { BaseOperationResult, GetPathItemsResult, GetReferencesResult, GetSubmodelElementsMetadataResult, GetSubmodelElementsResult, GetSubmodelElementsValueResult, GetSubmodelsMetadataResult, GetSubmodelsResult, GetSubmodelsValueResult, OperationRequest, OperationRequestValueOnly, OperationResult, OperationResultValueOnly, Reference, Submodel, SubmodelElement, SubmodelElementMetadata, SubmodelElementValue, SubmodelMetadata } from '../models/index';
|
|
14
14
|
export interface DeleteFileByPathSubmodelRepoRequest {
|
|
15
15
|
submodelIdentifier: string;
|
|
@@ -5,4 +5,5 @@ import * as AasRegistryService from './AasRegistryService';
|
|
|
5
5
|
import * as SubmodelRegistryService from './SubmodelRegistryService';
|
|
6
6
|
import * as AasDiscoveryService from './AasDiscoveryService';
|
|
7
7
|
import * as AasxFileService from './AasxFileService';
|
|
8
|
+
export * from './runtime';
|
|
8
9
|
export { AasRepositoryService, SubmodelRepositoryService, ConceptDescriptionRepositoryService, AasRegistryService, SubmodelRegistryService, AasDiscoveryService, AasxFileService };
|
package/dist/generated/index.js
CHANGED
|
@@ -5,4 +5,5 @@ import * as AasRegistryService from './AasRegistryService';
|
|
|
5
5
|
import * as SubmodelRegistryService from './SubmodelRegistryService';
|
|
6
6
|
import * as AasDiscoveryService from './AasDiscoveryService';
|
|
7
7
|
import * as AasxFileService from './AasxFileService';
|
|
8
|
+
export * from './runtime';
|
|
8
9
|
export { AasRepositoryService, SubmodelRepositoryService, ConceptDescriptionRepositoryService, AasRegistryService, SubmodelRegistryService, AasDiscoveryService, AasxFileService };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* DotAAS Part 2 | HTTP/REST |
|
|
3
|
-
* The entire
|
|
2
|
+
* DotAAS Part 2 | HTTP/REST | Runtime Configuration
|
|
3
|
+
* The entire Full Profile of the Runtime Configuration as part of the [Specification of the Asset Administration Shell - Part 2: API](https://industrialdigitaltwin.org/en/content-hub/aasspecifications). Copyright: Industrial Digital Twin Association (IDTA) 2025
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: V3.1.0_SSP-001
|
|
6
6
|
* Contact: info@idtwin.org
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* DotAAS Part 2 | HTTP/REST |
|
|
5
|
-
* The entire
|
|
4
|
+
* DotAAS Part 2 | HTTP/REST | Runtime Configuration
|
|
5
|
+
* The entire Full Profile of the Runtime Configuration as part of the [Specification of the Asset Administration Shell - Part 2: API](https://industrialdigitaltwin.org/en/content-hub/aasspecifications). Copyright: Industrial Digital Twin Association (IDTA) 2025
|
|
6
6
|
*
|
|
7
7
|
* The version of the OpenAPI document: V3.1.0_SSP-001
|
|
8
8
|
* Contact: info@idtwin.org
|
package/dist/lib/apiConfig.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function applyDefaults
|
|
1
|
+
import { Configuration } from '../generated/runtime';
|
|
2
|
+
export declare function applyDefaults(configuration: Configuration): Configuration;
|
package/dist/lib/apiConfig.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//import { Configuration } from '../generated';
|
|
2
|
-
import {
|
|
3
|
-
//export function applyDefaults(configuration: AAS.Configuration): AAS.Configuration {
|
|
2
|
+
import { Configuration } from '../generated/runtime';
|
|
4
3
|
export function applyDefaults(configuration) {
|
|
5
4
|
// Extract configuration properties
|
|
6
5
|
const options = {
|
|
@@ -15,25 +14,8 @@ export function applyDefaults(configuration) {
|
|
|
15
14
|
headers: configuration.headers || undefined,
|
|
16
15
|
credentials: configuration.credentials || undefined,
|
|
17
16
|
};
|
|
18
|
-
// Create
|
|
19
|
-
|
|
20
|
-
case AasRepositoryService.Configuration:
|
|
21
|
-
return new AasRepositoryService.Configuration(options);
|
|
22
|
-
case SubmodelRepositoryService.Configuration:
|
|
23
|
-
return new SubmodelRepositoryService.Configuration(options);
|
|
24
|
-
case ConceptDescriptionRepositoryService.Configuration:
|
|
25
|
-
return new ConceptDescriptionRepositoryService.Configuration(options);
|
|
26
|
-
case AasRegistryService.Configuration:
|
|
27
|
-
return new AasRegistryService.Configuration(options);
|
|
28
|
-
case SubmodelRegistryService.Configuration:
|
|
29
|
-
return new SubmodelRegistryService.Configuration(options);
|
|
30
|
-
case AasDiscoveryService.Configuration:
|
|
31
|
-
return new AasDiscoveryService.Configuration(options);
|
|
32
|
-
case AasxFileService.Configuration:
|
|
33
|
-
return new AasxFileService.Configuration(options);
|
|
34
|
-
default:
|
|
35
|
-
throw new Error('None of the configuration types match');
|
|
36
|
-
}
|
|
17
|
+
// Create a new configuration instance with defaults applied
|
|
18
|
+
return new Configuration(options);
|
|
37
19
|
}
|
|
38
20
|
function getDefaultFetchApi() {
|
|
39
21
|
// In Node (>=18) or browser, global fetch is available.
|
package/dist/lib/errorHandler.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { AasDiscoveryService, AasRegistryService, AasRepositoryService, AasxFileService, ConceptDescriptionRepositoryService, SubmodelRegistryService, SubmodelRepositoryService, } from '../generated';
|
|
1
|
+
import { FetchError, RequiredError, ResponseError } from '../generated/runtime';
|
|
3
2
|
/**
|
|
4
3
|
* Processes errors from API calls and standardizes them to a Result object
|
|
5
4
|
* with a consistent messages array following the API spec guidelines.
|
|
@@ -23,13 +22,7 @@ export async function handleApiError(err) {
|
|
|
23
22
|
text: 'Unknown error',
|
|
24
23
|
};
|
|
25
24
|
// Handle different error types
|
|
26
|
-
if (err instanceof
|
|
27
|
-
err instanceof SubmodelRepositoryService.RequiredError ||
|
|
28
|
-
err instanceof ConceptDescriptionRepositoryService.RequiredError ||
|
|
29
|
-
err instanceof AasRegistryService.RequiredError ||
|
|
30
|
-
err instanceof SubmodelRegistryService.RequiredError ||
|
|
31
|
-
err instanceof AasDiscoveryService.RequiredError ||
|
|
32
|
-
err instanceof AasxFileService.RequiredError) {
|
|
25
|
+
if (err instanceof RequiredError) {
|
|
33
26
|
message = {
|
|
34
27
|
code: '400',
|
|
35
28
|
messageType: 'Exception',
|
|
@@ -37,13 +30,7 @@ export async function handleApiError(err) {
|
|
|
37
30
|
timestamp: timestamp,
|
|
38
31
|
};
|
|
39
32
|
}
|
|
40
|
-
else if (err instanceof
|
|
41
|
-
err instanceof SubmodelRepositoryService.ResponseError ||
|
|
42
|
-
err instanceof ConceptDescriptionRepositoryService.ResponseError ||
|
|
43
|
-
err instanceof AasRegistryService.ResponseError ||
|
|
44
|
-
err instanceof SubmodelRegistryService.ResponseError ||
|
|
45
|
-
err instanceof AasDiscoveryService.ResponseError ||
|
|
46
|
-
err instanceof AasxFileService.ResponseError) {
|
|
33
|
+
else if (err instanceof ResponseError) {
|
|
47
34
|
// Try to parse response body for messages
|
|
48
35
|
const responseBody = err.response;
|
|
49
36
|
try {
|
|
@@ -70,13 +57,7 @@ export async function handleApiError(err) {
|
|
|
70
57
|
};
|
|
71
58
|
}
|
|
72
59
|
}
|
|
73
|
-
else if (err instanceof
|
|
74
|
-
err instanceof SubmodelRepositoryService.FetchError ||
|
|
75
|
-
err instanceof ConceptDescriptionRepositoryService.FetchError ||
|
|
76
|
-
err instanceof AasRegistryService.FetchError ||
|
|
77
|
-
err instanceof SubmodelRegistryService.FetchError ||
|
|
78
|
-
err instanceof AasDiscoveryService.FetchError ||
|
|
79
|
-
err instanceof AasxFileService.FetchError) {
|
|
60
|
+
else if (err instanceof FetchError) {
|
|
80
61
|
message = {
|
|
81
62
|
code: '0',
|
|
82
63
|
messageType: 'Exception',
|
package/package.json
CHANGED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DotAAS Part 2 | HTTP/REST | Discovery Service Specification
|
|
3
|
-
* The entire Full Profile of the Discovery Service Specification as part of the [Specification of the Asset Administration Shell - Part 2: API](https://industrialdigitaltwin.org/en/content-hub/aasspecifications). Copyright: Industrial Digital Twin Association (IDTA) 2025
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: V3.1.0_SSP-001
|
|
6
|
-
* Contact: info@idtwin.org
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
|
-
export declare const BASE_PATH: string;
|
|
13
|
-
export interface ConfigurationParameters {
|
|
14
|
-
basePath?: string;
|
|
15
|
-
fetchApi?: FetchAPI;
|
|
16
|
-
middleware?: Middleware[];
|
|
17
|
-
queryParamsStringify?: (params: HTTPQuery) => string;
|
|
18
|
-
username?: string;
|
|
19
|
-
password?: string;
|
|
20
|
-
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>);
|
|
21
|
-
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
|
|
22
|
-
headers?: HTTPHeaders;
|
|
23
|
-
credentials?: RequestCredentials;
|
|
24
|
-
}
|
|
25
|
-
export declare class Configuration {
|
|
26
|
-
private configuration;
|
|
27
|
-
constructor(configuration?: ConfigurationParameters);
|
|
28
|
-
set config(configuration: Configuration);
|
|
29
|
-
get basePath(): string;
|
|
30
|
-
get fetchApi(): FetchAPI | undefined;
|
|
31
|
-
get middleware(): Middleware[];
|
|
32
|
-
get queryParamsStringify(): (params: HTTPQuery) => string;
|
|
33
|
-
get username(): string | undefined;
|
|
34
|
-
get password(): string | undefined;
|
|
35
|
-
get apiKey(): ((name: string) => string | Promise<string>) | undefined;
|
|
36
|
-
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
|
|
37
|
-
get headers(): HTTPHeaders | undefined;
|
|
38
|
-
get credentials(): RequestCredentials | undefined;
|
|
39
|
-
}
|
|
40
|
-
export declare const DefaultConfig: Configuration;
|
|
41
|
-
/**
|
|
42
|
-
* This is the base class for all generated API classes.
|
|
43
|
-
*/
|
|
44
|
-
export declare class BaseAPI {
|
|
45
|
-
protected configuration: Configuration;
|
|
46
|
-
private static readonly jsonRegex;
|
|
47
|
-
private middleware;
|
|
48
|
-
constructor(configuration?: Configuration);
|
|
49
|
-
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
|
|
50
|
-
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
|
|
51
|
-
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
|
|
52
|
-
/**
|
|
53
|
-
* Check if the given MIME is a JSON MIME.
|
|
54
|
-
* JSON MIME examples:
|
|
55
|
-
* application/json
|
|
56
|
-
* application/json; charset=UTF8
|
|
57
|
-
* APPLICATION/JSON
|
|
58
|
-
* application/vnd.company+json
|
|
59
|
-
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
60
|
-
* @return True if the given MIME is JSON, false otherwise.
|
|
61
|
-
*/
|
|
62
|
-
protected isJsonMime(mime: string | null | undefined): boolean;
|
|
63
|
-
protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
|
|
64
|
-
private createFetchParams;
|
|
65
|
-
private fetchApi;
|
|
66
|
-
/**
|
|
67
|
-
* Create a shallow clone of `this` by constructing a new instance
|
|
68
|
-
* and then shallow cloning data members.
|
|
69
|
-
*/
|
|
70
|
-
private clone;
|
|
71
|
-
}
|
|
72
|
-
export declare class ResponseError extends Error {
|
|
73
|
-
response: Response;
|
|
74
|
-
name: "ResponseError";
|
|
75
|
-
constructor(response: Response, msg?: string);
|
|
76
|
-
}
|
|
77
|
-
export declare class FetchError extends Error {
|
|
78
|
-
cause: Error;
|
|
79
|
-
name: "FetchError";
|
|
80
|
-
constructor(cause: Error, msg?: string);
|
|
81
|
-
}
|
|
82
|
-
export declare class RequiredError extends Error {
|
|
83
|
-
field: string;
|
|
84
|
-
name: "RequiredError";
|
|
85
|
-
constructor(field: string, msg?: string);
|
|
86
|
-
}
|
|
87
|
-
export declare const COLLECTION_FORMATS: {
|
|
88
|
-
csv: string;
|
|
89
|
-
ssv: string;
|
|
90
|
-
tsv: string;
|
|
91
|
-
pipes: string;
|
|
92
|
-
};
|
|
93
|
-
export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
|
|
94
|
-
export type Json = any;
|
|
95
|
-
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
96
|
-
export type HTTPHeaders = {
|
|
97
|
-
[key: string]: string;
|
|
98
|
-
};
|
|
99
|
-
export type HTTPQuery = {
|
|
100
|
-
[key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
|
|
101
|
-
};
|
|
102
|
-
export type HTTPBody = Json | FormData | URLSearchParams;
|
|
103
|
-
export type HTTPRequestInit = {
|
|
104
|
-
headers?: HTTPHeaders;
|
|
105
|
-
method: HTTPMethod;
|
|
106
|
-
credentials?: RequestCredentials;
|
|
107
|
-
body?: HTTPBody;
|
|
108
|
-
};
|
|
109
|
-
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
|
110
|
-
export type InitOverrideFunction = (requestContext: {
|
|
111
|
-
init: HTTPRequestInit;
|
|
112
|
-
context: RequestOpts;
|
|
113
|
-
}) => Promise<RequestInit>;
|
|
114
|
-
export interface FetchParams {
|
|
115
|
-
url: string;
|
|
116
|
-
init: RequestInit;
|
|
117
|
-
}
|
|
118
|
-
export interface RequestOpts {
|
|
119
|
-
path: string;
|
|
120
|
-
method: HTTPMethod;
|
|
121
|
-
headers: HTTPHeaders;
|
|
122
|
-
query?: HTTPQuery;
|
|
123
|
-
body?: HTTPBody;
|
|
124
|
-
}
|
|
125
|
-
export declare function querystring(params: HTTPQuery, prefix?: string): string;
|
|
126
|
-
export declare function exists(json: any, key: string): boolean;
|
|
127
|
-
export declare function canConsumeForm(consumes: Consume[]): boolean;
|
|
128
|
-
export interface Consume {
|
|
129
|
-
contentType: string;
|
|
130
|
-
}
|
|
131
|
-
export interface RequestContext {
|
|
132
|
-
fetch: FetchAPI;
|
|
133
|
-
url: string;
|
|
134
|
-
init: RequestInit;
|
|
135
|
-
}
|
|
136
|
-
export interface ResponseContext {
|
|
137
|
-
fetch: FetchAPI;
|
|
138
|
-
url: string;
|
|
139
|
-
init: RequestInit;
|
|
140
|
-
response: Response;
|
|
141
|
-
}
|
|
142
|
-
export interface ErrorContext {
|
|
143
|
-
fetch: FetchAPI;
|
|
144
|
-
url: string;
|
|
145
|
-
init: RequestInit;
|
|
146
|
-
error: unknown;
|
|
147
|
-
response?: Response;
|
|
148
|
-
}
|
|
149
|
-
export interface Middleware {
|
|
150
|
-
pre?(context: RequestContext): Promise<FetchParams | void>;
|
|
151
|
-
post?(context: ResponseContext): Promise<Response | void>;
|
|
152
|
-
onError?(context: ErrorContext): Promise<Response | void>;
|
|
153
|
-
}
|
|
154
|
-
export interface ApiResponse<T> {
|
|
155
|
-
raw: Response;
|
|
156
|
-
value(): Promise<T>;
|
|
157
|
-
}
|
|
158
|
-
export interface ResponseTransformer<T> {
|
|
159
|
-
(json: any): T;
|
|
160
|
-
}
|
|
161
|
-
export declare class JSONApiResponse<T> {
|
|
162
|
-
raw: Response;
|
|
163
|
-
private transformer;
|
|
164
|
-
constructor(raw: Response, transformer?: ResponseTransformer<T>);
|
|
165
|
-
value(): Promise<T>;
|
|
166
|
-
}
|
|
167
|
-
export declare class VoidApiResponse {
|
|
168
|
-
raw: Response;
|
|
169
|
-
constructor(raw: Response);
|
|
170
|
-
value(): Promise<void>;
|
|
171
|
-
}
|
|
172
|
-
export declare class BlobApiResponse {
|
|
173
|
-
raw: Response;
|
|
174
|
-
constructor(raw: Response);
|
|
175
|
-
value(): Promise<Blob>;
|
|
176
|
-
}
|
|
177
|
-
export declare class TextApiResponse {
|
|
178
|
-
raw: Response;
|
|
179
|
-
constructor(raw: Response);
|
|
180
|
-
value(): Promise<string>;
|
|
181
|
-
}
|