@vanillabp/bc-official-gui-client 0.0.3
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 +1 -0
- package/dist/apis/OfficialTasklistApi.d.ts +307 -0
- package/dist/apis/OfficialTasklistApi.js +340 -0
- package/dist/apis/OfficialWorkflowlistApi.d.ts +180 -0
- package/dist/apis/OfficialWorkflowlistApi.js +197 -0
- package/dist/apis/index.d.ts +23 -0
- package/dist/apis/index.js +2 -0
- package/dist/chunk-4TPCCB4K.js +45 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +3 -0
- package/dist/models/KwicRequest.d.ts +36 -0
- package/dist/models/KwicRequest.js +38 -0
- package/dist/models/KwicResult.d.ts +39 -0
- package/dist/models/KwicResult.js +37 -0
- package/dist/models/KwicResults.d.ts +36 -0
- package/dist/models/KwicResults.js +38 -0
- package/dist/models/Page.d.ts +51 -0
- package/dist/models/Page.js +43 -0
- package/dist/models/SearchQuery.d.ts +39 -0
- package/dist/models/SearchQuery.js +37 -0
- package/dist/models/Sex.d.ts +26 -0
- package/dist/models/Sex.js +21 -0
- package/dist/models/UiUriType.d.ts +25 -0
- package/dist/models/UiUriType.js +20 -0
- package/dist/models/User.d.ts +79 -0
- package/dist/models/User.js +56 -0
- package/dist/models/UserSearchResult.d.ts +38 -0
- package/dist/models/UserSearchResult.js +38 -0
- package/dist/models/UserStatus.d.ts +25 -0
- package/dist/models/UserStatus.js +20 -0
- package/dist/models/UserTask.d.ts +206 -0
- package/dist/models/UserTask.js +102 -0
- package/dist/models/UserTaskEvent.d.ts +45 -0
- package/dist/models/UserTaskEvent.js +40 -0
- package/dist/models/UserTaskIds.d.ts +33 -0
- package/dist/models/UserTaskIds.js +34 -0
- package/dist/models/UserTaskRetrieveMode.d.ts +28 -0
- package/dist/models/UserTaskRetrieveMode.js +23 -0
- package/dist/models/UserTasks.d.ts +50 -0
- package/dist/models/UserTasks.js +48 -0
- package/dist/models/UserTasksRequest.d.ts +66 -0
- package/dist/models/UserTasksRequest.js +48 -0
- package/dist/models/UserTasksUpdateRequest.d.ts +51 -0
- package/dist/models/UserTasksUpdateRequest.js +41 -0
- package/dist/models/Workflow.d.ts +148 -0
- package/dist/models/Workflow.js +83 -0
- package/dist/models/WorkflowEvent.d.ts +45 -0
- package/dist/models/WorkflowEvent.js +40 -0
- package/dist/models/Workflows.d.ts +56 -0
- package/dist/models/Workflows.js +51 -0
- package/dist/models/WorkflowsRequest.d.ts +60 -0
- package/dist/models/WorkflowsRequest.js +46 -0
- package/dist/models/WorkflowsUpdateRequest.d.ts +60 -0
- package/dist/models/WorkflowsUpdateRequest.js +48 -0
- package/dist/models/index.d.ts +22 -0
- package/dist/models/index.js +22 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +315 -0
- package/package.json +32 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { SearchQuery } from './SearchQuery.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* gui
|
|
5
|
+
* Official GUI API
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
* @interface WorkflowsUpdateRequest
|
|
19
|
+
*/
|
|
20
|
+
interface WorkflowsUpdateRequest {
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @type {number}
|
|
24
|
+
* @memberof WorkflowsUpdateRequest
|
|
25
|
+
*/
|
|
26
|
+
size: number;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @type {Array<string>}
|
|
30
|
+
* @memberof WorkflowsUpdateRequest
|
|
31
|
+
*/
|
|
32
|
+
knownWorkflowsIds: Array<string>;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {Array<SearchQuery>}
|
|
36
|
+
* @memberof WorkflowsUpdateRequest
|
|
37
|
+
*/
|
|
38
|
+
searchQueries?: Array<SearchQuery>;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @type {string}
|
|
42
|
+
* @memberof WorkflowsUpdateRequest
|
|
43
|
+
*/
|
|
44
|
+
sort?: string;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @type {boolean}
|
|
48
|
+
* @memberof WorkflowsUpdateRequest
|
|
49
|
+
*/
|
|
50
|
+
sortAscending?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Check if a given object implements the WorkflowsUpdateRequest interface.
|
|
54
|
+
*/
|
|
55
|
+
declare function instanceOfWorkflowsUpdateRequest(value: object): boolean;
|
|
56
|
+
declare function WorkflowsUpdateRequestFromJSON(json: any): WorkflowsUpdateRequest;
|
|
57
|
+
declare function WorkflowsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): WorkflowsUpdateRequest;
|
|
58
|
+
declare function WorkflowsUpdateRequestToJSON(value?: WorkflowsUpdateRequest | null): any;
|
|
59
|
+
|
|
60
|
+
export { WorkflowsUpdateRequest, WorkflowsUpdateRequestFromJSON, WorkflowsUpdateRequestFromJSONTyped, WorkflowsUpdateRequestToJSON, instanceOfWorkflowsUpdateRequest };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import "../chunk-4TPCCB4K.js";
|
|
2
|
+
import { exists } from "../runtime.js";
|
|
3
|
+
import {
|
|
4
|
+
SearchQueryFromJSON,
|
|
5
|
+
SearchQueryToJSON
|
|
6
|
+
} from "./SearchQuery.js";
|
|
7
|
+
function instanceOfWorkflowsUpdateRequest(value) {
|
|
8
|
+
let isInstance = true;
|
|
9
|
+
isInstance = isInstance && "size" in value;
|
|
10
|
+
isInstance = isInstance && "knownWorkflowsIds" in value;
|
|
11
|
+
return isInstance;
|
|
12
|
+
}
|
|
13
|
+
function WorkflowsUpdateRequestFromJSON(json) {
|
|
14
|
+
return WorkflowsUpdateRequestFromJSONTyped(json, false);
|
|
15
|
+
}
|
|
16
|
+
function WorkflowsUpdateRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
17
|
+
if (json === void 0 || json === null) {
|
|
18
|
+
return json;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
"size": json["size"],
|
|
22
|
+
"knownWorkflowsIds": json["knownWorkflowsIds"],
|
|
23
|
+
"searchQueries": !exists(json, "searchQueries") ? void 0 : json["searchQueries"].map(SearchQueryFromJSON),
|
|
24
|
+
"sort": !exists(json, "sort") ? void 0 : json["sort"],
|
|
25
|
+
"sortAscending": !exists(json, "sortAscending") ? void 0 : json["sortAscending"]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function WorkflowsUpdateRequestToJSON(value) {
|
|
29
|
+
if (value === void 0) {
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
if (value === null) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
"size": value.size,
|
|
37
|
+
"knownWorkflowsIds": value.knownWorkflowsIds,
|
|
38
|
+
"searchQueries": value.searchQueries === void 0 ? void 0 : value.searchQueries.map(SearchQueryToJSON),
|
|
39
|
+
"sort": value.sort,
|
|
40
|
+
"sortAscending": value.sortAscending
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
WorkflowsUpdateRequestFromJSON,
|
|
45
|
+
WorkflowsUpdateRequestFromJSONTyped,
|
|
46
|
+
WorkflowsUpdateRequestToJSON,
|
|
47
|
+
instanceOfWorkflowsUpdateRequest
|
|
48
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { KwicRequest, KwicRequestFromJSON, KwicRequestFromJSONTyped, KwicRequestToJSON, instanceOfKwicRequest } from './KwicRequest.js';
|
|
2
|
+
export { KwicResult, KwicResultFromJSON, KwicResultFromJSONTyped, KwicResultToJSON, instanceOfKwicResult } from './KwicResult.js';
|
|
3
|
+
export { KwicResults, KwicResultsFromJSON, KwicResultsFromJSONTyped, KwicResultsToJSON, instanceOfKwicResults } from './KwicResults.js';
|
|
4
|
+
export { Page, PageFromJSON, PageFromJSONTyped, PageToJSON, instanceOfPage } from './Page.js';
|
|
5
|
+
export { SearchQuery, SearchQueryFromJSON, SearchQueryFromJSONTyped, SearchQueryToJSON, instanceOfSearchQuery } from './SearchQuery.js';
|
|
6
|
+
export { Sex, SexFromJSON, SexFromJSONTyped, SexToJSON } from './Sex.js';
|
|
7
|
+
export { UiUriType, UiUriTypeFromJSON, UiUriTypeFromJSONTyped, UiUriTypeToJSON } from './UiUriType.js';
|
|
8
|
+
export { User, UserFromJSON, UserFromJSONTyped, UserToJSON, instanceOfUser } from './User.js';
|
|
9
|
+
export { UserSearchResult, UserSearchResultFromJSON, UserSearchResultFromJSONTyped, UserSearchResultToJSON, instanceOfUserSearchResult } from './UserSearchResult.js';
|
|
10
|
+
export { UserStatus, UserStatusFromJSON, UserStatusFromJSONTyped, UserStatusToJSON } from './UserStatus.js';
|
|
11
|
+
export { UserTask, UserTaskFromJSON, UserTaskFromJSONTyped, UserTaskToJSON, instanceOfUserTask } from './UserTask.js';
|
|
12
|
+
export { UserTaskEvent, UserTaskEventFromJSON, UserTaskEventFromJSONTyped, UserTaskEventToJSON, instanceOfUserTaskEvent } from './UserTaskEvent.js';
|
|
13
|
+
export { UserTaskIds, UserTaskIdsFromJSON, UserTaskIdsFromJSONTyped, UserTaskIdsToJSON, instanceOfUserTaskIds } from './UserTaskIds.js';
|
|
14
|
+
export { UserTaskRetrieveMode, UserTaskRetrieveModeFromJSON, UserTaskRetrieveModeFromJSONTyped, UserTaskRetrieveModeToJSON } from './UserTaskRetrieveMode.js';
|
|
15
|
+
export { UserTasks, UserTasksFromJSON, UserTasksFromJSONTyped, UserTasksToJSON, instanceOfUserTasks } from './UserTasks.js';
|
|
16
|
+
export { UserTasksRequest, UserTasksRequestFromJSON, UserTasksRequestFromJSONTyped, UserTasksRequestToJSON, instanceOfUserTasksRequest } from './UserTasksRequest.js';
|
|
17
|
+
export { UserTasksUpdateRequest, UserTasksUpdateRequestFromJSON, UserTasksUpdateRequestFromJSONTyped, UserTasksUpdateRequestToJSON, instanceOfUserTasksUpdateRequest } from './UserTasksUpdateRequest.js';
|
|
18
|
+
export { Workflow, WorkflowFromJSON, WorkflowFromJSONTyped, WorkflowToJSON, instanceOfWorkflow } from './Workflow.js';
|
|
19
|
+
export { WorkflowEvent, WorkflowEventFromJSON, WorkflowEventFromJSONTyped, WorkflowEventToJSON, instanceOfWorkflowEvent } from './WorkflowEvent.js';
|
|
20
|
+
export { Workflows, WorkflowsFromJSON, WorkflowsFromJSONTyped, WorkflowsToJSON, instanceOfWorkflows } from './Workflows.js';
|
|
21
|
+
export { WorkflowsRequest, WorkflowsRequestFromJSON, WorkflowsRequestFromJSONTyped, WorkflowsRequestToJSON, instanceOfWorkflowsRequest } from './WorkflowsRequest.js';
|
|
22
|
+
export { WorkflowsUpdateRequest, WorkflowsUpdateRequestFromJSON, WorkflowsUpdateRequestFromJSONTyped, WorkflowsUpdateRequestToJSON, instanceOfWorkflowsUpdateRequest } from './WorkflowsUpdateRequest.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./KwicRequest.js";
|
|
2
|
+
export * from "./KwicResult.js";
|
|
3
|
+
export * from "./KwicResults.js";
|
|
4
|
+
export * from "./Page.js";
|
|
5
|
+
export * from "./SearchQuery.js";
|
|
6
|
+
export * from "./Sex.js";
|
|
7
|
+
export * from "./UiUriType.js";
|
|
8
|
+
export * from "./User.js";
|
|
9
|
+
export * from "./UserSearchResult.js";
|
|
10
|
+
export * from "./UserStatus.js";
|
|
11
|
+
export * from "./UserTask.js";
|
|
12
|
+
export * from "./UserTaskEvent.js";
|
|
13
|
+
export * from "./UserTaskIds.js";
|
|
14
|
+
export * from "./UserTaskRetrieveMode.js";
|
|
15
|
+
export * from "./UserTasks.js";
|
|
16
|
+
export * from "./UserTasksRequest.js";
|
|
17
|
+
export * from "./UserTasksUpdateRequest.js";
|
|
18
|
+
export * from "./Workflow.js";
|
|
19
|
+
export * from "./WorkflowEvent.js";
|
|
20
|
+
export * from "./Workflows.js";
|
|
21
|
+
export * from "./WorkflowsRequest.js";
|
|
22
|
+
export * from "./WorkflowsUpdateRequest.js";
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gui
|
|
3
|
+
* Official GUI API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
*
|
|
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
|
+
declare const BASE_PATH: string;
|
|
13
|
+
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 | ((name: string) => string);
|
|
21
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
|
|
22
|
+
headers?: HTTPHeaders;
|
|
23
|
+
credentials?: RequestCredentials;
|
|
24
|
+
}
|
|
25
|
+
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) | undefined;
|
|
36
|
+
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
|
|
37
|
+
get headers(): HTTPHeaders | undefined;
|
|
38
|
+
get credentials(): RequestCredentials | undefined;
|
|
39
|
+
}
|
|
40
|
+
declare const DefaultConfig: Configuration;
|
|
41
|
+
/**
|
|
42
|
+
* This is the base class for all generated API classes.
|
|
43
|
+
*/
|
|
44
|
+
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
|
+
declare class ResponseError extends Error {
|
|
73
|
+
response: Response;
|
|
74
|
+
name: "ResponseError";
|
|
75
|
+
constructor(response: Response, msg?: string);
|
|
76
|
+
}
|
|
77
|
+
declare class FetchError extends Error {
|
|
78
|
+
cause: Error;
|
|
79
|
+
name: "FetchError";
|
|
80
|
+
constructor(cause: Error, msg?: string);
|
|
81
|
+
}
|
|
82
|
+
declare class RequiredError extends Error {
|
|
83
|
+
field: string;
|
|
84
|
+
name: "RequiredError";
|
|
85
|
+
constructor(field: string, msg?: string);
|
|
86
|
+
}
|
|
87
|
+
declare const COLLECTION_FORMATS: {
|
|
88
|
+
csv: string;
|
|
89
|
+
ssv: string;
|
|
90
|
+
tsv: string;
|
|
91
|
+
pipes: string;
|
|
92
|
+
};
|
|
93
|
+
declare type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
|
|
94
|
+
declare type Json = any;
|
|
95
|
+
declare type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
96
|
+
declare type HTTPHeaders = {
|
|
97
|
+
[key: string]: string;
|
|
98
|
+
};
|
|
99
|
+
declare type HTTPQuery = {
|
|
100
|
+
[key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
|
|
101
|
+
};
|
|
102
|
+
declare type HTTPBody = Json | FormData | URLSearchParams;
|
|
103
|
+
declare type HTTPRequestInit = {
|
|
104
|
+
headers?: HTTPHeaders;
|
|
105
|
+
method: HTTPMethod;
|
|
106
|
+
credentials?: RequestCredentials;
|
|
107
|
+
body?: HTTPBody;
|
|
108
|
+
};
|
|
109
|
+
declare type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
|
110
|
+
declare type InitOverrideFunction = (requestContext: {
|
|
111
|
+
init: HTTPRequestInit;
|
|
112
|
+
context: RequestOpts;
|
|
113
|
+
}) => Promise<RequestInit>;
|
|
114
|
+
interface FetchParams {
|
|
115
|
+
url: string;
|
|
116
|
+
init: RequestInit;
|
|
117
|
+
}
|
|
118
|
+
interface RequestOpts {
|
|
119
|
+
path: string;
|
|
120
|
+
method: HTTPMethod;
|
|
121
|
+
headers: HTTPHeaders;
|
|
122
|
+
query?: HTTPQuery;
|
|
123
|
+
body?: HTTPBody;
|
|
124
|
+
}
|
|
125
|
+
declare function exists(json: any, key: string): boolean;
|
|
126
|
+
declare function querystring(params: HTTPQuery, prefix?: string): string;
|
|
127
|
+
declare function mapValues(data: any, fn: (item: any) => any): {};
|
|
128
|
+
declare function canConsumeForm(consumes: Consume[]): boolean;
|
|
129
|
+
interface Consume {
|
|
130
|
+
contentType: string;
|
|
131
|
+
}
|
|
132
|
+
interface RequestContext {
|
|
133
|
+
fetch: FetchAPI;
|
|
134
|
+
url: string;
|
|
135
|
+
init: RequestInit;
|
|
136
|
+
}
|
|
137
|
+
interface ResponseContext {
|
|
138
|
+
fetch: FetchAPI;
|
|
139
|
+
url: string;
|
|
140
|
+
init: RequestInit;
|
|
141
|
+
response: Response;
|
|
142
|
+
}
|
|
143
|
+
interface ErrorContext {
|
|
144
|
+
fetch: FetchAPI;
|
|
145
|
+
url: string;
|
|
146
|
+
init: RequestInit;
|
|
147
|
+
error: unknown;
|
|
148
|
+
response?: Response;
|
|
149
|
+
}
|
|
150
|
+
interface Middleware {
|
|
151
|
+
pre?(context: RequestContext): Promise<FetchParams | void>;
|
|
152
|
+
post?(context: ResponseContext): Promise<Response | void>;
|
|
153
|
+
onError?(context: ErrorContext): Promise<Response | void>;
|
|
154
|
+
}
|
|
155
|
+
interface ApiResponse<T> {
|
|
156
|
+
raw: Response;
|
|
157
|
+
value(): Promise<T>;
|
|
158
|
+
}
|
|
159
|
+
interface ResponseTransformer<T> {
|
|
160
|
+
(json: any): T;
|
|
161
|
+
}
|
|
162
|
+
declare class JSONApiResponse<T> {
|
|
163
|
+
raw: Response;
|
|
164
|
+
private transformer;
|
|
165
|
+
constructor(raw: Response, transformer?: ResponseTransformer<T>);
|
|
166
|
+
value(): Promise<T>;
|
|
167
|
+
}
|
|
168
|
+
declare class VoidApiResponse {
|
|
169
|
+
raw: Response;
|
|
170
|
+
constructor(raw: Response);
|
|
171
|
+
value(): Promise<void>;
|
|
172
|
+
}
|
|
173
|
+
declare class BlobApiResponse {
|
|
174
|
+
raw: Response;
|
|
175
|
+
constructor(raw: Response);
|
|
176
|
+
value(): Promise<Blob>;
|
|
177
|
+
}
|
|
178
|
+
declare class TextApiResponse {
|
|
179
|
+
raw: Response;
|
|
180
|
+
constructor(raw: Response);
|
|
181
|
+
value(): Promise<string>;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export { ApiResponse, BASE_PATH, BaseAPI, BlobApiResponse, COLLECTION_FORMATS, Configuration, ConfigurationParameters, Consume, DefaultConfig, ErrorContext, FetchAPI, FetchError, FetchParams, HTTPBody, HTTPHeaders, HTTPMethod, HTTPQuery, HTTPRequestInit, InitOverrideFunction, JSONApiResponse, Json, Middleware, ModelPropertyNaming, RequestContext, RequestOpts, RequiredError, ResponseContext, ResponseError, ResponseTransformer, TextApiResponse, VoidApiResponse, canConsumeForm, exists, mapValues, querystring };
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "./chunk-4TPCCB4K.js";
|
|
6
|
+
const BASE_PATH = "/gui/api/v1".replace(/\/+$/, "");
|
|
7
|
+
class Configuration {
|
|
8
|
+
constructor(configuration = {}) {
|
|
9
|
+
this.configuration = configuration;
|
|
10
|
+
}
|
|
11
|
+
set config(configuration) {
|
|
12
|
+
this.configuration = configuration;
|
|
13
|
+
}
|
|
14
|
+
get basePath() {
|
|
15
|
+
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
16
|
+
}
|
|
17
|
+
get fetchApi() {
|
|
18
|
+
return this.configuration.fetchApi;
|
|
19
|
+
}
|
|
20
|
+
get middleware() {
|
|
21
|
+
return this.configuration.middleware || [];
|
|
22
|
+
}
|
|
23
|
+
get queryParamsStringify() {
|
|
24
|
+
return this.configuration.queryParamsStringify || querystring;
|
|
25
|
+
}
|
|
26
|
+
get username() {
|
|
27
|
+
return this.configuration.username;
|
|
28
|
+
}
|
|
29
|
+
get password() {
|
|
30
|
+
return this.configuration.password;
|
|
31
|
+
}
|
|
32
|
+
get apiKey() {
|
|
33
|
+
const apiKey = this.configuration.apiKey;
|
|
34
|
+
if (apiKey) {
|
|
35
|
+
return typeof apiKey === "function" ? apiKey : () => apiKey;
|
|
36
|
+
}
|
|
37
|
+
return void 0;
|
|
38
|
+
}
|
|
39
|
+
get accessToken() {
|
|
40
|
+
const accessToken = this.configuration.accessToken;
|
|
41
|
+
if (accessToken) {
|
|
42
|
+
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
|
|
43
|
+
return accessToken;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
get headers() {
|
|
49
|
+
return this.configuration.headers;
|
|
50
|
+
}
|
|
51
|
+
get credentials() {
|
|
52
|
+
return this.configuration.credentials;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const DefaultConfig = new Configuration();
|
|
56
|
+
const _BaseAPI = class {
|
|
57
|
+
constructor(configuration = DefaultConfig) {
|
|
58
|
+
this.configuration = configuration;
|
|
59
|
+
this.fetchApi = (url, init) => __async(this, null, function* () {
|
|
60
|
+
let fetchParams = { url, init };
|
|
61
|
+
for (const middleware of this.middleware) {
|
|
62
|
+
if (middleware.pre) {
|
|
63
|
+
fetchParams = (yield middleware.pre(__spreadValues({
|
|
64
|
+
fetch: this.fetchApi
|
|
65
|
+
}, fetchParams))) || fetchParams;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
let response = void 0;
|
|
69
|
+
try {
|
|
70
|
+
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
71
|
+
} catch (e) {
|
|
72
|
+
for (const middleware of this.middleware) {
|
|
73
|
+
if (middleware.onError) {
|
|
74
|
+
response = (yield middleware.onError({
|
|
75
|
+
fetch: this.fetchApi,
|
|
76
|
+
url: fetchParams.url,
|
|
77
|
+
init: fetchParams.init,
|
|
78
|
+
error: e,
|
|
79
|
+
response: response ? response.clone() : void 0
|
|
80
|
+
})) || response;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (response === void 0) {
|
|
84
|
+
if (e instanceof Error) {
|
|
85
|
+
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
|
|
86
|
+
} else {
|
|
87
|
+
throw e;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
for (const middleware of this.middleware) {
|
|
92
|
+
if (middleware.post) {
|
|
93
|
+
response = (yield middleware.post({
|
|
94
|
+
fetch: this.fetchApi,
|
|
95
|
+
url: fetchParams.url,
|
|
96
|
+
init: fetchParams.init,
|
|
97
|
+
response: response.clone()
|
|
98
|
+
})) || response;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return response;
|
|
102
|
+
});
|
|
103
|
+
this.middleware = configuration.middleware;
|
|
104
|
+
}
|
|
105
|
+
withMiddleware(...middlewares) {
|
|
106
|
+
const next = this.clone();
|
|
107
|
+
next.middleware = next.middleware.concat(...middlewares);
|
|
108
|
+
return next;
|
|
109
|
+
}
|
|
110
|
+
withPreMiddleware(...preMiddlewares) {
|
|
111
|
+
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
112
|
+
return this.withMiddleware(...middlewares);
|
|
113
|
+
}
|
|
114
|
+
withPostMiddleware(...postMiddlewares) {
|
|
115
|
+
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
116
|
+
return this.withMiddleware(...middlewares);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Check if the given MIME is a JSON MIME.
|
|
120
|
+
* JSON MIME examples:
|
|
121
|
+
* application/json
|
|
122
|
+
* application/json; charset=UTF8
|
|
123
|
+
* APPLICATION/JSON
|
|
124
|
+
* application/vnd.company+json
|
|
125
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
126
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
127
|
+
*/
|
|
128
|
+
isJsonMime(mime) {
|
|
129
|
+
if (!mime) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
return _BaseAPI.jsonRegex.test(mime);
|
|
133
|
+
}
|
|
134
|
+
request(context, initOverrides) {
|
|
135
|
+
return __async(this, null, function* () {
|
|
136
|
+
const { url, init } = yield this.createFetchParams(context, initOverrides);
|
|
137
|
+
const response = yield this.fetchApi(url, init);
|
|
138
|
+
if (response && (response.status >= 200 && response.status < 300)) {
|
|
139
|
+
return response;
|
|
140
|
+
}
|
|
141
|
+
throw new ResponseError(response, "Response returned an error code");
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
createFetchParams(context, initOverrides) {
|
|
145
|
+
return __async(this, null, function* () {
|
|
146
|
+
let url = this.configuration.basePath + context.path;
|
|
147
|
+
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
|
|
148
|
+
url += "?" + this.configuration.queryParamsStringify(context.query);
|
|
149
|
+
}
|
|
150
|
+
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
151
|
+
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
|
|
152
|
+
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
|
|
153
|
+
return initOverrides;
|
|
154
|
+
});
|
|
155
|
+
const initParams = {
|
|
156
|
+
method: context.method,
|
|
157
|
+
headers,
|
|
158
|
+
body: context.body,
|
|
159
|
+
credentials: this.configuration.credentials
|
|
160
|
+
};
|
|
161
|
+
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
|
|
162
|
+
init: initParams,
|
|
163
|
+
context
|
|
164
|
+
}));
|
|
165
|
+
const init = __spreadProps(__spreadValues({}, overriddenInit), {
|
|
166
|
+
body: isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body) ? overriddenInit.body : JSON.stringify(overriddenInit.body)
|
|
167
|
+
});
|
|
168
|
+
return { url, init };
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
173
|
+
* and then shallow cloning data members.
|
|
174
|
+
*/
|
|
175
|
+
clone() {
|
|
176
|
+
const constructor = this.constructor;
|
|
177
|
+
const next = new constructor(this.configuration);
|
|
178
|
+
next.middleware = this.middleware.slice();
|
|
179
|
+
return next;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
let BaseAPI = _BaseAPI;
|
|
183
|
+
BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
|
|
184
|
+
;
|
|
185
|
+
function isBlob(value) {
|
|
186
|
+
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
187
|
+
}
|
|
188
|
+
function isFormData(value) {
|
|
189
|
+
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
190
|
+
}
|
|
191
|
+
class ResponseError extends Error {
|
|
192
|
+
constructor(response, msg) {
|
|
193
|
+
super(msg);
|
|
194
|
+
this.response = response;
|
|
195
|
+
this.name = "ResponseError";
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
class FetchError extends Error {
|
|
199
|
+
constructor(cause, msg) {
|
|
200
|
+
super(msg);
|
|
201
|
+
this.cause = cause;
|
|
202
|
+
this.name = "FetchError";
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
class RequiredError extends Error {
|
|
206
|
+
constructor(field, msg) {
|
|
207
|
+
super(msg);
|
|
208
|
+
this.field = field;
|
|
209
|
+
this.name = "RequiredError";
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const COLLECTION_FORMATS = {
|
|
213
|
+
csv: ",",
|
|
214
|
+
ssv: " ",
|
|
215
|
+
tsv: " ",
|
|
216
|
+
pipes: "|"
|
|
217
|
+
};
|
|
218
|
+
function exists(json, key) {
|
|
219
|
+
const value = json[key];
|
|
220
|
+
return value !== null && value !== void 0;
|
|
221
|
+
}
|
|
222
|
+
function querystring(params, prefix = "") {
|
|
223
|
+
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
|
|
224
|
+
}
|
|
225
|
+
function querystringSingleKey(key, value, keyPrefix = "") {
|
|
226
|
+
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
227
|
+
if (value instanceof Array) {
|
|
228
|
+
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
|
|
229
|
+
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
230
|
+
}
|
|
231
|
+
if (value instanceof Set) {
|
|
232
|
+
const valueAsArray = Array.from(value);
|
|
233
|
+
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
234
|
+
}
|
|
235
|
+
if (value instanceof Date) {
|
|
236
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
237
|
+
}
|
|
238
|
+
if (value instanceof Object) {
|
|
239
|
+
return querystring(value, fullKey);
|
|
240
|
+
}
|
|
241
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
242
|
+
}
|
|
243
|
+
function mapValues(data, fn) {
|
|
244
|
+
return Object.keys(data).reduce(
|
|
245
|
+
(acc, key) => __spreadProps(__spreadValues({}, acc), { [key]: fn(data[key]) }),
|
|
246
|
+
{}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
function canConsumeForm(consumes) {
|
|
250
|
+
for (const consume of consumes) {
|
|
251
|
+
if ("multipart/form-data" === consume.contentType) {
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
class JSONApiResponse {
|
|
258
|
+
constructor(raw, transformer = (jsonValue) => jsonValue) {
|
|
259
|
+
this.raw = raw;
|
|
260
|
+
this.transformer = transformer;
|
|
261
|
+
}
|
|
262
|
+
value() {
|
|
263
|
+
return __async(this, null, function* () {
|
|
264
|
+
return this.transformer(yield this.raw.json());
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
class VoidApiResponse {
|
|
269
|
+
constructor(raw) {
|
|
270
|
+
this.raw = raw;
|
|
271
|
+
}
|
|
272
|
+
value() {
|
|
273
|
+
return __async(this, null, function* () {
|
|
274
|
+
return void 0;
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
class BlobApiResponse {
|
|
279
|
+
constructor(raw) {
|
|
280
|
+
this.raw = raw;
|
|
281
|
+
}
|
|
282
|
+
value() {
|
|
283
|
+
return __async(this, null, function* () {
|
|
284
|
+
return yield this.raw.blob();
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
class TextApiResponse {
|
|
289
|
+
constructor(raw) {
|
|
290
|
+
this.raw = raw;
|
|
291
|
+
}
|
|
292
|
+
value() {
|
|
293
|
+
return __async(this, null, function* () {
|
|
294
|
+
return yield this.raw.text();
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
export {
|
|
299
|
+
BASE_PATH,
|
|
300
|
+
BaseAPI,
|
|
301
|
+
BlobApiResponse,
|
|
302
|
+
COLLECTION_FORMATS,
|
|
303
|
+
Configuration,
|
|
304
|
+
DefaultConfig,
|
|
305
|
+
FetchError,
|
|
306
|
+
JSONApiResponse,
|
|
307
|
+
RequiredError,
|
|
308
|
+
ResponseError,
|
|
309
|
+
TextApiResponse,
|
|
310
|
+
VoidApiResponse,
|
|
311
|
+
canConsumeForm,
|
|
312
|
+
exists,
|
|
313
|
+
mapValues,
|
|
314
|
+
querystring
|
|
315
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vanillabp/bc-official-gui-client",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/vanillabp/business-cockpit.git"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/vanillabp/business-cockpit",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"package.json"
|
|
15
|
+
],
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "16.18.23",
|
|
18
|
+
"@types/web": "0.0.61",
|
|
19
|
+
"cross-env": "7.0.3",
|
|
20
|
+
"tsup": "6.7.0",
|
|
21
|
+
"typescript": "4.8.4",
|
|
22
|
+
"semver": "^7.6.0"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"start": "tsup --watch",
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"unpublish:snapshot": "npm unpublish --force",
|
|
28
|
+
"publish:snapshot": "npm publish --tag snapshot",
|
|
29
|
+
"version:snapshot": "npm version ${npm_config_newversion} --no-git-tag-version",
|
|
30
|
+
"publish:release": "npm publish --access public"
|
|
31
|
+
}
|
|
32
|
+
}
|