@sfxcode/nuxt-mongocamp-server 1.0.2 → 1.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.
- package/dist/module.d.ts +2 -9
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -553
- package/dist/types.d.ts +8 -2
- package/package.json +8 -8
- package/dist/runtime/api/apis/AdminApi.d.ts +0 -181
- package/dist/runtime/api/apis/AdminApi.mjs +0 -509
- package/dist/runtime/api/apis/ApplicationApi.d.ts +0 -65
- package/dist/runtime/api/apis/ApplicationApi.mjs +0 -164
- package/dist/runtime/api/apis/AuthApi.d.ts +0 -104
- package/dist/runtime/api/apis/AuthApi.mjs +0 -296
- package/dist/runtime/api/apis/BucketApi.d.ts +0 -67
- package/dist/runtime/api/apis/BucketApi.mjs +0 -160
- package/dist/runtime/api/apis/CollectionApi.d.ts +0 -161
- package/dist/runtime/api/apis/CollectionApi.mjs +0 -435
- package/dist/runtime/api/apis/DatabaseApi.d.ts +0 -77
- package/dist/runtime/api/apis/DatabaseApi.mjs +0 -196
- package/dist/runtime/api/apis/DocumentApi.d.ts +0 -188
- package/dist/runtime/api/apis/DocumentApi.mjs +0 -465
- package/dist/runtime/api/apis/FileApi.d.ts +0 -125
- package/dist/runtime/api/apis/FileApi.mjs +0 -355
- package/dist/runtime/api/apis/IndexApi.d.ts +0 -137
- package/dist/runtime/api/apis/IndexApi.mjs +0 -367
- package/dist/runtime/api/apis/InformationApi.d.ts +0 -28
- package/dist/runtime/api/apis/InformationApi.mjs +0 -29
- package/dist/runtime/api/apis/JobsApi.d.ts +0 -94
- package/dist/runtime/api/apis/JobsApi.mjs +0 -252
- package/dist/runtime/api/apis/index.d.ts +0 -11
- package/dist/runtime/api/apis/index.mjs +0 -11
- package/dist/runtime/api/index.d.ts +0 -3
- package/dist/runtime/api/index.mjs +0 -3
- package/dist/runtime/api/models/BucketInformation.d.ts +0 -49
- package/dist/runtime/api/models/BucketInformation.mjs +0 -36
- package/dist/runtime/api/models/CollectionStatus.d.ts +0 -107
- package/dist/runtime/api/models/CollectionStatus.mjs +0 -63
- package/dist/runtime/api/models/DatabaseInfo.d.ts +0 -57
- package/dist/runtime/api/models/DatabaseInfo.mjs +0 -39
- package/dist/runtime/api/models/DeleteResponse.d.ts +0 -37
- package/dist/runtime/api/models/DeleteResponse.mjs +0 -30
- package/dist/runtime/api/models/ErrorDescription.d.ts +0 -43
- package/dist/runtime/api/models/ErrorDescription.mjs +0 -33
- package/dist/runtime/api/models/FileInformation.d.ts +0 -63
- package/dist/runtime/api/models/FileInformation.mjs +0 -42
- package/dist/runtime/api/models/Grant.d.ts +0 -55
- package/dist/runtime/api/models/Grant.mjs +0 -39
- package/dist/runtime/api/models/IndexCreateRequest.d.ts +0 -40
- package/dist/runtime/api/models/IndexCreateRequest.mjs +0 -34
- package/dist/runtime/api/models/IndexCreateResponse.d.ts +0 -31
- package/dist/runtime/api/models/IndexCreateResponse.mjs +0 -27
- package/dist/runtime/api/models/IndexDropResponse.d.ts +0 -31
- package/dist/runtime/api/models/IndexDropResponse.mjs +0 -27
- package/dist/runtime/api/models/IndexOptionsRequest.d.ts +0 -73
- package/dist/runtime/api/models/IndexOptionsRequest.mjs +0 -41
- package/dist/runtime/api/models/InsertResponse.d.ts +0 -37
- package/dist/runtime/api/models/InsertResponse.mjs +0 -30
- package/dist/runtime/api/models/JobConfig.d.ts +0 -61
- package/dist/runtime/api/models/JobConfig.mjs +0 -42
- package/dist/runtime/api/models/JobInformation.d.ts +0 -79
- package/dist/runtime/api/models/JobInformation.mjs +0 -49
- package/dist/runtime/api/models/JsonResultBoolean.d.ts +0 -27
- package/dist/runtime/api/models/JsonResultBoolean.mjs +0 -22
- package/dist/runtime/api/models/JsonResultString.d.ts +0 -27
- package/dist/runtime/api/models/JsonResultString.mjs +0 -22
- package/dist/runtime/api/models/JsonSchema.d.ts +0 -46
- package/dist/runtime/api/models/JsonSchema.mjs +0 -38
- package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +0 -59
- package/dist/runtime/api/models/JsonSchemaDefinition.mjs +0 -39
- package/dist/runtime/api/models/JsonValueAny.d.ts +0 -31
- package/dist/runtime/api/models/JsonValueAny.mjs +0 -27
- package/dist/runtime/api/models/JsonValueBoolean.d.ts +0 -31
- package/dist/runtime/api/models/JsonValueBoolean.mjs +0 -27
- package/dist/runtime/api/models/JsonValueString.d.ts +0 -31
- package/dist/runtime/api/models/JsonValueString.mjs +0 -27
- package/dist/runtime/api/models/Login.d.ts +0 -37
- package/dist/runtime/api/models/Login.mjs +0 -30
- package/dist/runtime/api/models/LoginResult.d.ts +0 -44
- package/dist/runtime/api/models/LoginResult.mjs +0 -37
- package/dist/runtime/api/models/Measurement.d.ts +0 -33
- package/dist/runtime/api/models/Measurement.mjs +0 -24
- package/dist/runtime/api/models/Metric.d.ts +0 -52
- package/dist/runtime/api/models/Metric.mjs +0 -35
- package/dist/runtime/api/models/MongoAggregateRequest.d.ts +0 -38
- package/dist/runtime/api/models/MongoAggregateRequest.mjs +0 -34
- package/dist/runtime/api/models/MongoCampConfiguration.d.ts +0 -55
- package/dist/runtime/api/models/MongoCampConfiguration.mjs +0 -39
- package/dist/runtime/api/models/MongoFindRequest.d.ts +0 -49
- package/dist/runtime/api/models/MongoFindRequest.mjs +0 -33
- package/dist/runtime/api/models/MongoIndex.d.ts +0 -103
- package/dist/runtime/api/models/MongoIndex.mjs +0 -60
- package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +0 -31
- package/dist/runtime/api/models/PasswordUpdateRequest.mjs +0 -27
- package/dist/runtime/api/models/PipelineStage.d.ts +0 -37
- package/dist/runtime/api/models/PipelineStage.mjs +0 -30
- package/dist/runtime/api/models/Role.d.ts +0 -44
- package/dist/runtime/api/models/Role.mjs +0 -37
- package/dist/runtime/api/models/SchemaAnalysis.d.ts +0 -50
- package/dist/runtime/api/models/SchemaAnalysis.mjs +0 -40
- package/dist/runtime/api/models/SchemaAnalysisField.d.ts +0 -62
- package/dist/runtime/api/models/SchemaAnalysisField.mjs +0 -45
- package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +0 -43
- package/dist/runtime/api/models/SchemaAnalysisFieldType.mjs +0 -33
- package/dist/runtime/api/models/SettingsResponse.d.ts +0 -51
- package/dist/runtime/api/models/SettingsResponse.mjs +0 -34
- package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +0 -39
- package/dist/runtime/api/models/UpdateFileInformationRequest.mjs +0 -29
- package/dist/runtime/api/models/UpdateRequest.d.ts +0 -41
- package/dist/runtime/api/models/UpdateRequest.mjs +0 -30
- package/dist/runtime/api/models/UpdateResponse.d.ts +0 -49
- package/dist/runtime/api/models/UpdateResponse.mjs +0 -36
- package/dist/runtime/api/models/UpdateRoleRequest.d.ts +0 -38
- package/dist/runtime/api/models/UpdateRoleRequest.mjs +0 -34
- package/dist/runtime/api/models/UserInformation.d.ts +0 -49
- package/dist/runtime/api/models/UserInformation.mjs +0 -35
- package/dist/runtime/api/models/UserProfile.d.ts +0 -56
- package/dist/runtime/api/models/UserProfile.mjs +0 -41
- package/dist/runtime/api/models/Version.d.ts +0 -43
- package/dist/runtime/api/models/Version.mjs +0 -33
- package/dist/runtime/api/models/index.d.ts +0 -39
- package/dist/runtime/api/models/index.mjs +0 -39
- package/dist/runtime/api/runtime.d.ts +0 -182
- package/dist/runtime/api/runtime.mjs +0 -281
- package/dist/runtime/composables/mongocampApi.d.ts +0 -14
- package/dist/runtime/composables/mongocampApi.mjs +0 -45
- package/dist/runtime/composables/mongocampAuth.d.ts +0 -8
- package/dist/runtime/composables/mongocampAuth.mjs +0 -28
- package/dist/runtime/composables/mongocampSearch.d.ts +0 -11
- package/dist/runtime/composables/mongocampSearch.mjs +0 -20
- package/dist/runtime/composables/mongocampStorage.d.ts +0 -0
- package/dist/runtime/composables/mongocampStorage.mjs +0 -5
- package/dist/runtime/composables/mongocampUrl.d.ts +0 -1
- package/dist/runtime/composables/mongocampUrl.mjs +0 -5
- package/dist/runtime/composables/mongocampUser.d.ts +0 -3
- package/dist/runtime/composables/mongocampUser.mjs +0 -4
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mongocamp-server
|
|
3
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.4.2
|
|
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
|
-
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 | ((name: string) => 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) | 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 exists(json: any, key: string): boolean;
|
|
126
|
-
export declare function querystring(params: HTTPQuery, prefix?: string): string;
|
|
127
|
-
export declare function mapValues(data: any, fn: (item: any) => any): {};
|
|
128
|
-
export declare function canConsumeForm(consumes: Consume[]): boolean;
|
|
129
|
-
export interface Consume {
|
|
130
|
-
contentType: string;
|
|
131
|
-
}
|
|
132
|
-
export interface RequestContext {
|
|
133
|
-
fetch: FetchAPI;
|
|
134
|
-
url: string;
|
|
135
|
-
init: RequestInit;
|
|
136
|
-
}
|
|
137
|
-
export interface ResponseContext {
|
|
138
|
-
fetch: FetchAPI;
|
|
139
|
-
url: string;
|
|
140
|
-
init: RequestInit;
|
|
141
|
-
response: Response;
|
|
142
|
-
}
|
|
143
|
-
export interface ErrorContext {
|
|
144
|
-
fetch: FetchAPI;
|
|
145
|
-
url: string;
|
|
146
|
-
init: RequestInit;
|
|
147
|
-
error: unknown;
|
|
148
|
-
response?: Response;
|
|
149
|
-
}
|
|
150
|
-
export 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
|
-
export interface ApiResponse<T> {
|
|
156
|
-
raw: Response;
|
|
157
|
-
value(): Promise<T>;
|
|
158
|
-
}
|
|
159
|
-
export interface ResponseTransformer<T> {
|
|
160
|
-
(json: any): T;
|
|
161
|
-
}
|
|
162
|
-
export declare class JSONApiResponse<T> {
|
|
163
|
-
raw: Response;
|
|
164
|
-
private transformer;
|
|
165
|
-
constructor(raw: Response, transformer?: ResponseTransformer<T>);
|
|
166
|
-
value(): Promise<T>;
|
|
167
|
-
}
|
|
168
|
-
export declare class VoidApiResponse {
|
|
169
|
-
raw: Response;
|
|
170
|
-
constructor(raw: Response);
|
|
171
|
-
value(): Promise<void>;
|
|
172
|
-
}
|
|
173
|
-
export declare class BlobApiResponse {
|
|
174
|
-
raw: Response;
|
|
175
|
-
constructor(raw: Response);
|
|
176
|
-
value(): Promise<Blob>;
|
|
177
|
-
}
|
|
178
|
-
export declare class TextApiResponse {
|
|
179
|
-
raw: Response;
|
|
180
|
-
constructor(raw: Response);
|
|
181
|
-
value(): Promise<string>;
|
|
182
|
-
}
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
|
2
|
-
export class Configuration {
|
|
3
|
-
constructor(configuration = {}) {
|
|
4
|
-
this.configuration = configuration;
|
|
5
|
-
}
|
|
6
|
-
set config(configuration) {
|
|
7
|
-
this.configuration = configuration;
|
|
8
|
-
}
|
|
9
|
-
get basePath() {
|
|
10
|
-
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
11
|
-
}
|
|
12
|
-
get fetchApi() {
|
|
13
|
-
return this.configuration.fetchApi;
|
|
14
|
-
}
|
|
15
|
-
get middleware() {
|
|
16
|
-
return this.configuration.middleware || [];
|
|
17
|
-
}
|
|
18
|
-
get queryParamsStringify() {
|
|
19
|
-
return this.configuration.queryParamsStringify || querystring;
|
|
20
|
-
}
|
|
21
|
-
get username() {
|
|
22
|
-
return this.configuration.username;
|
|
23
|
-
}
|
|
24
|
-
get password() {
|
|
25
|
-
return this.configuration.password;
|
|
26
|
-
}
|
|
27
|
-
get apiKey() {
|
|
28
|
-
const apiKey = this.configuration.apiKey;
|
|
29
|
-
if (apiKey) {
|
|
30
|
-
return typeof apiKey === "function" ? apiKey : () => apiKey;
|
|
31
|
-
}
|
|
32
|
-
return void 0;
|
|
33
|
-
}
|
|
34
|
-
get accessToken() {
|
|
35
|
-
const accessToken = this.configuration.accessToken;
|
|
36
|
-
if (accessToken) {
|
|
37
|
-
return typeof accessToken === "function" ? accessToken : async () => accessToken;
|
|
38
|
-
}
|
|
39
|
-
return void 0;
|
|
40
|
-
}
|
|
41
|
-
get headers() {
|
|
42
|
-
return this.configuration.headers;
|
|
43
|
-
}
|
|
44
|
-
get credentials() {
|
|
45
|
-
return this.configuration.credentials;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
export const DefaultConfig = new Configuration();
|
|
49
|
-
const _BaseAPI = class {
|
|
50
|
-
constructor(configuration = DefaultConfig) {
|
|
51
|
-
this.configuration = configuration;
|
|
52
|
-
this.fetchApi = async (url, init) => {
|
|
53
|
-
let fetchParams = { url, init };
|
|
54
|
-
for (const middleware of this.middleware) {
|
|
55
|
-
if (middleware.pre) {
|
|
56
|
-
fetchParams = await middleware.pre({
|
|
57
|
-
fetch: this.fetchApi,
|
|
58
|
-
...fetchParams
|
|
59
|
-
}) || fetchParams;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
let response = void 0;
|
|
63
|
-
try {
|
|
64
|
-
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
65
|
-
} catch (e) {
|
|
66
|
-
for (const middleware of this.middleware) {
|
|
67
|
-
if (middleware.onError) {
|
|
68
|
-
response = await middleware.onError({
|
|
69
|
-
fetch: this.fetchApi,
|
|
70
|
-
url: fetchParams.url,
|
|
71
|
-
init: fetchParams.init,
|
|
72
|
-
error: e,
|
|
73
|
-
response: response ? response.clone() : void 0
|
|
74
|
-
}) || response;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (response === void 0) {
|
|
78
|
-
if (e instanceof Error) {
|
|
79
|
-
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
|
|
80
|
-
} else {
|
|
81
|
-
throw e;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
for (const middleware of this.middleware) {
|
|
86
|
-
if (middleware.post) {
|
|
87
|
-
response = await middleware.post({
|
|
88
|
-
fetch: this.fetchApi,
|
|
89
|
-
url: fetchParams.url,
|
|
90
|
-
init: fetchParams.init,
|
|
91
|
-
response: response.clone()
|
|
92
|
-
}) || response;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return response;
|
|
96
|
-
};
|
|
97
|
-
this.middleware = configuration.middleware;
|
|
98
|
-
}
|
|
99
|
-
withMiddleware(...middlewares) {
|
|
100
|
-
const next = this.clone();
|
|
101
|
-
next.middleware = next.middleware.concat(...middlewares);
|
|
102
|
-
return next;
|
|
103
|
-
}
|
|
104
|
-
withPreMiddleware(...preMiddlewares) {
|
|
105
|
-
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
106
|
-
return this.withMiddleware(...middlewares);
|
|
107
|
-
}
|
|
108
|
-
withPostMiddleware(...postMiddlewares) {
|
|
109
|
-
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
110
|
-
return this.withMiddleware(...middlewares);
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Check if the given MIME is a JSON MIME.
|
|
114
|
-
* JSON MIME examples:
|
|
115
|
-
* application/json
|
|
116
|
-
* application/json; charset=UTF8
|
|
117
|
-
* APPLICATION/JSON
|
|
118
|
-
* application/vnd.company+json
|
|
119
|
-
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
120
|
-
* @return True if the given MIME is JSON, false otherwise.
|
|
121
|
-
*/
|
|
122
|
-
isJsonMime(mime) {
|
|
123
|
-
if (!mime) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
return _BaseAPI.jsonRegex.test(mime);
|
|
127
|
-
}
|
|
128
|
-
async request(context, initOverrides) {
|
|
129
|
-
const { url, init } = await this.createFetchParams(context, initOverrides);
|
|
130
|
-
const response = await this.fetchApi(url, init);
|
|
131
|
-
if (response && (response.status >= 200 && response.status < 300)) {
|
|
132
|
-
return response;
|
|
133
|
-
}
|
|
134
|
-
throw new ResponseError(response, "Response returned an error code");
|
|
135
|
-
}
|
|
136
|
-
async createFetchParams(context, initOverrides) {
|
|
137
|
-
let url = this.configuration.basePath + context.path;
|
|
138
|
-
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
|
|
139
|
-
url += "?" + this.configuration.queryParamsStringify(context.query);
|
|
140
|
-
}
|
|
141
|
-
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
142
|
-
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
|
|
143
|
-
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
|
|
144
|
-
const initParams = {
|
|
145
|
-
method: context.method,
|
|
146
|
-
headers,
|
|
147
|
-
body: context.body,
|
|
148
|
-
credentials: this.configuration.credentials
|
|
149
|
-
};
|
|
150
|
-
const overriddenInit = {
|
|
151
|
-
...initParams,
|
|
152
|
-
...await initOverrideFn({
|
|
153
|
-
init: initParams,
|
|
154
|
-
context
|
|
155
|
-
})
|
|
156
|
-
};
|
|
157
|
-
const init = {
|
|
158
|
-
...overriddenInit,
|
|
159
|
-
body: isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body) ? overriddenInit.body : JSON.stringify(overriddenInit.body)
|
|
160
|
-
};
|
|
161
|
-
return { url, init };
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Create a shallow clone of `this` by constructing a new instance
|
|
165
|
-
* and then shallow cloning data members.
|
|
166
|
-
*/
|
|
167
|
-
clone() {
|
|
168
|
-
const constructor = this.constructor;
|
|
169
|
-
const next = new constructor(this.configuration);
|
|
170
|
-
next.middleware = this.middleware.slice();
|
|
171
|
-
return next;
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
export let BaseAPI = _BaseAPI;
|
|
175
|
-
BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
|
|
176
|
-
;
|
|
177
|
-
function isBlob(value) {
|
|
178
|
-
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
179
|
-
}
|
|
180
|
-
function isFormData(value) {
|
|
181
|
-
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
182
|
-
}
|
|
183
|
-
export class ResponseError extends Error {
|
|
184
|
-
constructor(response, msg) {
|
|
185
|
-
super(msg);
|
|
186
|
-
this.response = response;
|
|
187
|
-
this.name = "ResponseError";
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
export class FetchError extends Error {
|
|
191
|
-
constructor(cause, msg) {
|
|
192
|
-
super(msg);
|
|
193
|
-
this.cause = cause;
|
|
194
|
-
this.name = "FetchError";
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
export class RequiredError extends Error {
|
|
198
|
-
constructor(field, msg) {
|
|
199
|
-
super(msg);
|
|
200
|
-
this.field = field;
|
|
201
|
-
this.name = "RequiredError";
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
export const COLLECTION_FORMATS = {
|
|
205
|
-
csv: ",",
|
|
206
|
-
ssv: " ",
|
|
207
|
-
tsv: " ",
|
|
208
|
-
pipes: "|"
|
|
209
|
-
};
|
|
210
|
-
export function exists(json, key) {
|
|
211
|
-
const value = json[key];
|
|
212
|
-
return value !== null && value !== void 0;
|
|
213
|
-
}
|
|
214
|
-
export function querystring(params, prefix = "") {
|
|
215
|
-
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
|
|
216
|
-
}
|
|
217
|
-
function querystringSingleKey(key, value, keyPrefix = "") {
|
|
218
|
-
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
219
|
-
if (value instanceof Array) {
|
|
220
|
-
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
|
|
221
|
-
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
222
|
-
}
|
|
223
|
-
if (value instanceof Set) {
|
|
224
|
-
const valueAsArray = Array.from(value);
|
|
225
|
-
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
226
|
-
}
|
|
227
|
-
if (value instanceof Date) {
|
|
228
|
-
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
229
|
-
}
|
|
230
|
-
if (value instanceof Object) {
|
|
231
|
-
return querystring(value, fullKey);
|
|
232
|
-
}
|
|
233
|
-
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
234
|
-
}
|
|
235
|
-
export function mapValues(data, fn) {
|
|
236
|
-
return Object.keys(data).reduce(
|
|
237
|
-
(acc, key) => ({ ...acc, [key]: fn(data[key]) }),
|
|
238
|
-
{}
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
export function canConsumeForm(consumes) {
|
|
242
|
-
for (const consume of consumes) {
|
|
243
|
-
if ("multipart/form-data" === consume.contentType) {
|
|
244
|
-
return true;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
export class JSONApiResponse {
|
|
250
|
-
constructor(raw, transformer = (jsonValue) => jsonValue) {
|
|
251
|
-
this.raw = raw;
|
|
252
|
-
this.transformer = transformer;
|
|
253
|
-
}
|
|
254
|
-
async value() {
|
|
255
|
-
return this.transformer(await this.raw.json());
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
export class VoidApiResponse {
|
|
259
|
-
constructor(raw) {
|
|
260
|
-
this.raw = raw;
|
|
261
|
-
}
|
|
262
|
-
async value() {
|
|
263
|
-
return void 0;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
export class BlobApiResponse {
|
|
267
|
-
constructor(raw) {
|
|
268
|
-
this.raw = raw;
|
|
269
|
-
}
|
|
270
|
-
async value() {
|
|
271
|
-
return await this.raw.blob();
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
export class TextApiResponse {
|
|
275
|
-
constructor(raw) {
|
|
276
|
-
this.raw = raw;
|
|
277
|
-
}
|
|
278
|
-
async value() {
|
|
279
|
-
return await this.raw.text();
|
|
280
|
-
}
|
|
281
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AdminApi, ApplicationApi, AuthApi, BucketApi, CollectionApi, DatabaseApi, DocumentApi, FileApi, IndexApi, InformationApi, JobsApi } from '../api';
|
|
2
|
-
export declare function useMongocampApi(): {
|
|
3
|
-
adminApi: AdminApi;
|
|
4
|
-
applicationApi: ApplicationApi;
|
|
5
|
-
authApi: AuthApi;
|
|
6
|
-
bucketApi: BucketApi;
|
|
7
|
-
collectionApi: CollectionApi;
|
|
8
|
-
databaseApi: DatabaseApi;
|
|
9
|
-
documentApi: DocumentApi;
|
|
10
|
-
fileApi: FileApi;
|
|
11
|
-
indexApi: IndexApi;
|
|
12
|
-
informationApi: InformationApi;
|
|
13
|
-
jobApi: JobsApi;
|
|
14
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AdminApi,
|
|
3
|
-
ApplicationApi,
|
|
4
|
-
AuthApi,
|
|
5
|
-
BucketApi,
|
|
6
|
-
CollectionApi,
|
|
7
|
-
Configuration,
|
|
8
|
-
DatabaseApi,
|
|
9
|
-
DocumentApi,
|
|
10
|
-
FileApi,
|
|
11
|
-
IndexApi,
|
|
12
|
-
InformationApi,
|
|
13
|
-
JobsApi
|
|
14
|
-
} from "../api/index.mjs";
|
|
15
|
-
import { useMongocampUrl } from "./mongocampUrl.mjs";
|
|
16
|
-
import { useMongocampStorage } from "./mongocampStorage.mjs";
|
|
17
|
-
export function useMongocampApi() {
|
|
18
|
-
const url = useMongocampUrl();
|
|
19
|
-
const token = useMongocampStorage();
|
|
20
|
-
const configuration = new Configuration({ basePath: url, accessToken: token.value.token });
|
|
21
|
-
const adminApi = new AdminApi(configuration);
|
|
22
|
-
const applicationApi = new ApplicationApi(configuration);
|
|
23
|
-
const authApi = new AuthApi(configuration);
|
|
24
|
-
const bucketApi = new BucketApi(configuration);
|
|
25
|
-
const collectionApi = new CollectionApi(configuration);
|
|
26
|
-
const databaseApi = new DatabaseApi(configuration);
|
|
27
|
-
const documentApi = new DocumentApi(configuration);
|
|
28
|
-
const fileApi = new FileApi(configuration);
|
|
29
|
-
const indexApi = new IndexApi(configuration);
|
|
30
|
-
const informationApi = new InformationApi(configuration);
|
|
31
|
-
const jobApi = new JobsApi(configuration);
|
|
32
|
-
return {
|
|
33
|
-
adminApi,
|
|
34
|
-
applicationApi,
|
|
35
|
-
authApi,
|
|
36
|
-
bucketApi,
|
|
37
|
-
collectionApi,
|
|
38
|
-
databaseApi,
|
|
39
|
-
documentApi,
|
|
40
|
-
fileApi,
|
|
41
|
-
indexApi,
|
|
42
|
-
informationApi,
|
|
43
|
-
jobApi
|
|
44
|
-
};
|
|
45
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { UserProfile } from '../api';
|
|
2
|
-
export declare function useMongocampAuth(): {
|
|
3
|
-
login: (loginId: string, loginPassword: string) => Promise<UserProfile>;
|
|
4
|
-
logout: () => void;
|
|
5
|
-
isLoggedIn: import("vue").ComputedRef<boolean>;
|
|
6
|
-
userRoles: import("vue").ComputedRef<string[]>;
|
|
7
|
-
userGrants: import("vue").ComputedRef<import("../api").Grant[]>;
|
|
8
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
|
-
import { useMongocampApi } from "./mongocampApi.mjs";
|
|
3
|
-
import { useMongocampStorage } from "./mongocampStorage.mjs";
|
|
4
|
-
import { useMongocampUser } from "./mongocampUser.mjs";
|
|
5
|
-
export function useMongocampAuth() {
|
|
6
|
-
const state = useMongocampStorage();
|
|
7
|
-
const { authApi } = useMongocampApi();
|
|
8
|
-
const user = useMongocampUser();
|
|
9
|
-
const login = async (loginId, loginPassword) => {
|
|
10
|
-
logout();
|
|
11
|
-
const login2 = { userId: loginId, password: loginPassword };
|
|
12
|
-
const result = await authApi.login({ login: login2 });
|
|
13
|
-
state.value.token = result.authToken;
|
|
14
|
-
state.value.profile = result.userProfile;
|
|
15
|
-
user.value = result.userProfile;
|
|
16
|
-
return result.userProfile;
|
|
17
|
-
};
|
|
18
|
-
const logout = () => {
|
|
19
|
-
state.value.token = "";
|
|
20
|
-
const profile = { user: "", isAdmin: false };
|
|
21
|
-
state.value.profile = profile;
|
|
22
|
-
user.value = profile;
|
|
23
|
-
};
|
|
24
|
-
const isLoggedIn = computed(() => state.value?.token?.length > 0);
|
|
25
|
-
const userRoles = computed(() => state.value.profile.roles ?? []);
|
|
26
|
-
const userGrants = computed(() => state.value.profile.grants ?? []);
|
|
27
|
-
return { login, logout, isLoggedIn, userRoles, userGrants };
|
|
28
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { FindRequest, MongoFindRequest } from '../api';
|
|
2
|
-
export declare function useMongocampSearch(): {
|
|
3
|
-
mongoFindRequest: (filter?: object, sort?: object, projection?: object) => MongoFindRequest;
|
|
4
|
-
findRequest: (collection: string, searchParameter?: MongoFindRequest, rows?: number, actualPage?: number) => FindRequest;
|
|
5
|
-
findAll: (collectionName: string, page?: number, sort?: string[] | undefined, projection?: string[] | undefined, rowsPerPage?: number) => Promise<{
|
|
6
|
-
[key: string]: string;
|
|
7
|
-
}[]>;
|
|
8
|
-
findByField: (collectionName: string, field: string, value: string, page?: number, sort?: string[] | undefined, projection?: string[] | undefined, rowsPerPage?: number) => Promise<{
|
|
9
|
-
[key: string]: string;
|
|
10
|
-
}[]>;
|
|
11
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useRuntimeConfig } from "#app";
|
|
2
|
-
import { useMongocampApi } from "./mongocampApi.mjs";
|
|
3
|
-
export function useMongocampSearch() {
|
|
4
|
-
const { documentApi } = useMongocampApi();
|
|
5
|
-
const config = useRuntimeConfig();
|
|
6
|
-
const mongoFindRequest = (filter = {}, sort = {}, projection = {}) => {
|
|
7
|
-
return { filter, sort, projection };
|
|
8
|
-
};
|
|
9
|
-
const findRequest = (collection, searchParameter = mongoFindRequest(), rows = config.public.mongocamp?.paginationSize, actualPage = 1) => {
|
|
10
|
-
return { collectionName: collection, mongoFindRequest: searchParameter, rowsPerPage: rows, page: actualPage };
|
|
11
|
-
};
|
|
12
|
-
function findAll(collectionName, page = 1, sort = void 0, projection = void 0, rowsPerPage = config.public.mongocamp?.paginationSize) {
|
|
13
|
-
return documentApi.listDocuments({ collectionName, sort, projection, page, rowsPerPage });
|
|
14
|
-
}
|
|
15
|
-
function findByField(collectionName, field, value, page = 1, sort = void 0, projection = void 0, rowsPerPage = config.public.mongocamp?.paginationSize) {
|
|
16
|
-
const expression = `${field}: ${value}`;
|
|
17
|
-
return documentApi.listDocuments({ collectionName, filter: expression, sort, projection, page, rowsPerPage });
|
|
18
|
-
}
|
|
19
|
-
return { mongoFindRequest, findRequest, findAll, findByField };
|
|
20
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useMongocampUrl(): string;
|