@sfxcode/nuxt-mongocamp-server 2.4.0 → 2.6.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/dist/module.d.mts +10 -4
- package/dist/module.json +1 -1
- package/dist/module.mjs +36 -20
- package/dist/runtime/api/.openapi-generator/FILES +2 -0
- package/dist/runtime/api/apis/AdminApi.d.ts +28 -20
- package/dist/runtime/api/apis/AdminApi.js +49 -47
- package/dist/runtime/api/apis/ApplicationApi.d.ts +20 -0
- package/dist/runtime/api/apis/ApplicationApi.js +51 -0
- package/dist/runtime/api/apis/FileApi.d.ts +53 -0
- package/dist/runtime/api/apis/FileApi.js +81 -0
- package/dist/runtime/api/docs/AdminApi.md +33 -33
- package/dist/runtime/api/docs/ApplicationApi.md +79 -0
- package/dist/runtime/api/docs/CapabilityLimits.md +8 -0
- package/dist/runtime/api/docs/CollectionDeclaration.md +2 -0
- package/dist/runtime/api/docs/CollectionDeclarationIndexesInner.md +10 -0
- package/dist/runtime/api/docs/CollectionDeclarationReferencedByInner.md +40 -0
- package/dist/runtime/api/docs/FileApi.md +97 -0
- package/dist/runtime/api/models/CapabilityLimits.d.ts +16 -0
- package/dist/runtime/api/models/CapabilityLimits.js +12 -0
- package/dist/runtime/api/models/CollectionDeclaration.d.ts +5 -0
- package/dist/runtime/api/models/CollectionDeclaration.js +7 -0
- package/dist/runtime/api/models/CollectionDeclarationIndexesInner.d.ts +37 -0
- package/dist/runtime/api/models/CollectionDeclarationIndexesInner.js +21 -2
- package/dist/runtime/api/models/CollectionDeclarationReferencedByInner.d.ts +42 -0
- package/dist/runtime/api/models/CollectionDeclarationReferencedByInner.js +35 -0
- package/dist/runtime/api/models/CollectionDeclarationRefsInner.d.ts +2 -2
- package/dist/runtime/api/models/CollectionDeclarationRefsInner.js +2 -1
- package/dist/runtime/api/models/index.d.ts +1 -0
- package/dist/runtime/api/models/index.js +1 -0
- package/dist/runtime/client.d.ts +8 -0
- package/dist/runtime/client.js +3 -0
- package/dist/runtime/composables/mongocampApi.d.ts +4 -0
- package/dist/runtime/composables/mongocampApi.js +10 -2
- package/dist/runtime/composables/mongocampApiAdmin.js +1 -1
- package/dist/runtime/composables/mongocampAuth.js +29 -25
- package/dist/runtime/composables/mongocampCollection.d.ts +2 -1
- package/dist/runtime/composables/mongocampCollection.js +36 -13
- package/dist/runtime/composables/mongocampLive.js +25 -3
- package/dist/runtime/composables/mongocampSearch.js +12 -3
- package/dist/runtime/plugins/bson-payload.d.ts +8 -0
- package/dist/runtime/plugins/bson-payload.js +6 -0
- package/dist/runtime/server/composables/mongocampApi.d.ts +5 -1
- package/dist/runtime/server/composables/mongocampApi.js +1 -9
- package/dist/runtime/server/composables/mongocampServerApi.d.ts +4 -0
- package/dist/runtime/server/composables/mongocampServerApi.js +5 -0
- package/dist/runtime/server/mongocamp/core.d.ts +1 -1
- package/dist/runtime/server/mongocamp/core.js +1 -1
- package/dist/runtime/server/mongocamp/embedded-api.d.ts +18 -0
- package/dist/runtime/server/mongocamp/embedded-api.js +10 -0
- package/dist/runtime/utils/appState.d.ts +21 -0
- package/dist/runtime/utils/appState.js +11 -0
- package/dist/runtime/utils/bsonPayload.d.ts +8 -0
- package/dist/runtime/utils/bsonPayload.js +10 -0
- package/dist/runtime/utils/buildFieldFilterExpression.d.ts +4 -0
- package/dist/runtime/utils/buildFieldFilterExpression.js +5 -3
- package/dist/runtime/utils/createMongocampApis.d.ts +9 -1
- package/dist/runtime/utils/createMongocampApis.js +9 -2
- package/dist/runtime/utils/keepLongs.d.ts +14 -0
- package/dist/runtime/utils/keepLongs.js +45 -0
- package/dist/runtime/utils/sse.js +7 -1
- package/package.json +21 -9
package/dist/module.d.mts
CHANGED
|
@@ -39,12 +39,17 @@ interface ResolvedServerOptions {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
interface ModuleOptions {
|
|
42
|
-
/** The url of the MongoCamp API; with `server.enabled` it defaults to the prefix of the embedded server. */
|
|
43
|
-
url
|
|
42
|
+
/** The url of the MongoCamp API; with `server.enabled` it defaults to the prefix of the embedded server (2.5.0: optional then). */
|
|
43
|
+
url?: string;
|
|
44
|
+
/** An api key for the server code (`useMongocampApi(event)`); private, never sent to the browser. Better set by env. */
|
|
44
45
|
apiKey?: string;
|
|
46
|
+
/** Rows per page of the client composables (default 500, at least 10). */
|
|
45
47
|
paginationSize?: number;
|
|
48
|
+
/** Refreshes the token of the session while the user is active (default false). */
|
|
46
49
|
refreshToken?: boolean;
|
|
47
|
-
|
|
50
|
+
/** Milliseconds between two token refreshes (default 5000, at least 5000). */
|
|
51
|
+
tokenRefreshInterval?: number;
|
|
52
|
+
/** Seconds the session cookie lives (default 30 days). */
|
|
48
53
|
sessionMaxAge?: number;
|
|
49
54
|
/** The MongoCamp server embedded in the Nitro of this application. */
|
|
50
55
|
server?: ServerOptions;
|
|
@@ -61,7 +66,8 @@ declare module '@nuxt/schema' {
|
|
|
61
66
|
}
|
|
62
67
|
interface RuntimeConfig {
|
|
63
68
|
mongocampApiKey: string;
|
|
64
|
-
|
|
69
|
+
/** Only when the embedded server is enabled (2.5.0). */
|
|
70
|
+
mongocampServer?: ResolvedServerOptions & {
|
|
65
71
|
version: {
|
|
66
72
|
name: string;
|
|
67
73
|
version: string;
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { join, relative, basename, extname, isAbsolute, resolve } from 'node:path';
|
|
2
|
-
import { defineNuxtModule, createResolver, addImportsDir, addImports,
|
|
2
|
+
import { defineNuxtModule, useLogger, createResolver, addImportsDir, addPlugin, addImports, addServerImports, addServerHandler, addServerPlugin, addTypeTemplate, addServerTemplate, updateTemplates, resolveFiles } from '@nuxt/kit';
|
|
3
3
|
import { defu } from 'defu';
|
|
4
|
-
import { consola } from 'consola';
|
|
5
4
|
export * from '../dist/runtime/api/index.js';
|
|
6
5
|
|
|
7
6
|
const name = "@sfxcode/nuxt-mongocamp-server";
|
|
8
|
-
const version = "2.
|
|
7
|
+
const version = "2.6.0";
|
|
9
8
|
|
|
10
9
|
const DefaultServerPrefix = "/api/mongocamp-server";
|
|
11
10
|
const DefaultCollectionsDir = "mongocamp";
|
|
@@ -107,7 +106,15 @@ const module$1 = defineNuxtModule({
|
|
|
107
106
|
nuxt: ">=4.7.0"
|
|
108
107
|
}
|
|
109
108
|
},
|
|
109
|
+
defaults: {
|
|
110
|
+
paginationSize: 500,
|
|
111
|
+
refreshToken: false,
|
|
112
|
+
tokenRefreshInterval: 5e3,
|
|
113
|
+
sessionMaxAge: 60 * 60 * 24 * 30
|
|
114
|
+
// 30 days
|
|
115
|
+
},
|
|
110
116
|
setup(options, nuxt) {
|
|
117
|
+
const logger = useLogger("mongocamp");
|
|
111
118
|
if (nuxt.options._nitroMajor !== 3) {
|
|
112
119
|
throw new Error('[mongocamp] the module needs Nitro 3: add "nitro" to the dependencies of the application (Nuxt then builds with @nuxt/nitro-v3-server)');
|
|
113
120
|
}
|
|
@@ -119,24 +126,21 @@ const module$1 = defineNuxtModule({
|
|
|
119
126
|
if (!options.url || options.url.length === 0)
|
|
120
127
|
throw new Error('[mongocamp] Missing required "url" module option (or enable the embedded server with "server.enabled").');
|
|
121
128
|
});
|
|
122
|
-
if (options.paginationSize
|
|
123
|
-
|
|
124
|
-
if (!options.paginationSize || options.paginationSize < 10)
|
|
129
|
+
if (!options.paginationSize || options.paginationSize < 10) {
|
|
130
|
+
logger.warn(`paginationSize of ${options.paginationSize} is below the minimum of 10, falling back to 500`);
|
|
125
131
|
options.paginationSize = 500;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
132
|
+
}
|
|
133
|
+
if (!options.tokenRefreshInterval || options.tokenRefreshInterval < 5e3) {
|
|
134
|
+
logger.warn(`tokenRefreshInterval of ${options.tokenRefreshInterval} is below the minimum of 5000, falling back to 5000`);
|
|
129
135
|
options.tokenRefreshInterval = 5e3;
|
|
130
|
-
if (options.refreshToken === void 0) {
|
|
131
|
-
consola.warn('[mongocamp] "refreshToken" module option is not set, falling back to false (no auto token refresh)');
|
|
132
|
-
options.refreshToken = false;
|
|
133
136
|
}
|
|
134
|
-
if (!options.sessionMaxAge || options.sessionMaxAge <= 0)
|
|
137
|
+
if (!options.sessionMaxAge || options.sessionMaxAge <= 0) {
|
|
135
138
|
options.sessionMaxAge = 60 * 60 * 24 * 30;
|
|
139
|
+
}
|
|
136
140
|
nuxt.options.runtimeConfig.public.mongocamp = defu(
|
|
137
141
|
nuxt.options.runtimeConfig.public.mongocamp,
|
|
138
142
|
{
|
|
139
|
-
url: options.url,
|
|
143
|
+
url: options.url ?? "",
|
|
140
144
|
paginationSize: options.paginationSize,
|
|
141
145
|
refreshToken: options.refreshToken,
|
|
142
146
|
tokenRefreshInterval: options.tokenRefreshInterval,
|
|
@@ -147,13 +151,21 @@ const module$1 = defineNuxtModule({
|
|
|
147
151
|
const { resolve: resolve$1 } = createResolver(import.meta.url);
|
|
148
152
|
const runtimeDir = resolve$1("./runtime");
|
|
149
153
|
addImportsDir(resolve$1(runtimeDir, "composables"));
|
|
154
|
+
addPlugin(resolve$1(runtimeDir, "plugins/bson-payload"));
|
|
150
155
|
addImports(["fromExtendedJson", "toExtendedJson", "documentId"].map((name2) => ({ name: name2, from: resolve$1(runtimeDir, "utils/extendedJson") })));
|
|
151
|
-
|
|
152
|
-
|
|
156
|
+
addServerImports([
|
|
157
|
+
{ name: "useMongocampServerApi", from: resolve$1(runtimeDir, "server/composables/mongocampServerApi") },
|
|
158
|
+
{ name: "useMongocampApi", from: resolve$1(runtimeDir, server.enabled ? "server/mongocamp/embedded-api" : "server/composables/mongocampApi") }
|
|
159
|
+
]);
|
|
153
160
|
if (server.enabled) {
|
|
161
|
+
nuxt.options.runtimeConfig.mongocampServer = defu(nuxt.options.runtimeConfig.mongocampServer, { ...server, version: { name: "mongocamp-nitro-server", version } });
|
|
154
162
|
addServerHandler({ route: `${server.prefix}/**`, handler: resolve$1(runtimeDir, "server/mongocamp/handler") });
|
|
155
163
|
addServerPlugin(resolve$1(runtimeDir, "server/mongocamp/plugin"));
|
|
156
|
-
addServerImports([
|
|
164
|
+
addServerImports([
|
|
165
|
+
{ name: "useMongocampCore", from: resolve$1(runtimeDir, "server/mongocamp/core") },
|
|
166
|
+
// the documents of a collection with the rules of the API, in-process (2.4.0)
|
|
167
|
+
{ name: "useMongocampServerCollection", from: resolve$1(runtimeDir, "server/composables/mongocampServerCollection") }
|
|
168
|
+
]);
|
|
157
169
|
addTypeTemplate({
|
|
158
170
|
filename: "types/mongocamp-hooks.d.ts",
|
|
159
171
|
getContents: () => [
|
|
@@ -164,7 +176,7 @@ const module$1 = defineNuxtModule({
|
|
|
164
176
|
"export {}"
|
|
165
177
|
].join("\n")
|
|
166
178
|
}, { nitro: true, nuxt: true });
|
|
167
|
-
|
|
179
|
+
logger.info(`embedded server at ${server.prefix}`);
|
|
168
180
|
}
|
|
169
181
|
if (server.enabled || options.server?.collectionsDir !== void 0) {
|
|
170
182
|
const dirs = collectionDirs(nuxt.options._layers, server.collectionsDir);
|
|
@@ -180,12 +192,16 @@ const module$1 = defineNuxtModule({
|
|
|
180
192
|
}, { nitro: true, nuxt: true });
|
|
181
193
|
nuxt.hook("builder:watch", async (event, path) => {
|
|
182
194
|
const candidates = isAbsolute(path) ? [path] : [resolve(nuxt.options.srcDir, path), resolve(nuxt.options.rootDir, path)];
|
|
183
|
-
|
|
195
|
+
const inDir = (candidate) => dirs.some((dir) => {
|
|
196
|
+
const rest = relative(dir, candidate);
|
|
197
|
+
return rest !== "" && !rest.startsWith("..") && !isAbsolute(rest);
|
|
198
|
+
});
|
|
199
|
+
if ((event === "add" || event === "unlink") && candidates.some(inDir)) {
|
|
184
200
|
await updateTemplates({ filter: (template) => template.filename === "types/mongocamp-collections.d.ts" });
|
|
185
201
|
}
|
|
186
202
|
});
|
|
187
203
|
}
|
|
188
|
-
|
|
204
|
+
logger.debug("mongocamp-nuxt available");
|
|
189
205
|
}
|
|
190
206
|
});
|
|
191
207
|
|
|
@@ -26,6 +26,7 @@ docs/CollectionDeclaration.md
|
|
|
26
26
|
docs/CollectionDeclarationAudit.md
|
|
27
27
|
docs/CollectionDeclarationIndexesInner.md
|
|
28
28
|
docs/CollectionDeclarationOwner.md
|
|
29
|
+
docs/CollectionDeclarationReferencedByInner.md
|
|
29
30
|
docs/CollectionDeclarationRefsInner.md
|
|
30
31
|
docs/CollectionDeclarationSoftDelete.md
|
|
31
32
|
docs/CollectionDeclarationTimestamps.md
|
|
@@ -112,6 +113,7 @@ models/CollectionDeclaration.ts
|
|
|
112
113
|
models/CollectionDeclarationAudit.ts
|
|
113
114
|
models/CollectionDeclarationIndexesInner.ts
|
|
114
115
|
models/CollectionDeclarationOwner.ts
|
|
116
|
+
models/CollectionDeclarationReferencedByInner.ts
|
|
115
117
|
models/CollectionDeclarationRefsInner.ts
|
|
116
118
|
models/CollectionDeclarationSoftDelete.ts
|
|
117
119
|
models/CollectionDeclarationTimestamps.ts
|
|
@@ -41,6 +41,12 @@ export interface DeleteUserRequest {
|
|
|
41
41
|
*/
|
|
42
42
|
userId: string;
|
|
43
43
|
}
|
|
44
|
+
export interface GenerateNewApiKeyForUserRequest {
|
|
45
|
+
/**
|
|
46
|
+
* UserId to Update
|
|
47
|
+
*/
|
|
48
|
+
userId: string;
|
|
49
|
+
}
|
|
44
50
|
export interface GetRoleRequest {
|
|
45
51
|
/**
|
|
46
52
|
* RoleKey to search
|
|
@@ -53,12 +59,6 @@ export interface GetUserRequest {
|
|
|
53
59
|
*/
|
|
54
60
|
userId: string;
|
|
55
61
|
}
|
|
56
|
-
export interface GnerateNewApiKeyForUserRequest {
|
|
57
|
-
/**
|
|
58
|
-
* UserId to Update
|
|
59
|
-
*/
|
|
60
|
-
userId: string;
|
|
61
|
-
}
|
|
62
62
|
export interface ListRolesRequest {
|
|
63
63
|
/**
|
|
64
64
|
* Filter by a part of the userId
|
|
@@ -177,6 +177,20 @@ export declare class AdminApi extends runtime.BaseAPI {
|
|
|
177
177
|
* Delete User
|
|
178
178
|
*/
|
|
179
179
|
deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueBoolean>;
|
|
180
|
+
/**
|
|
181
|
+
* Creates request options for generateNewApiKeyForUser without sending the request
|
|
182
|
+
*/
|
|
183
|
+
generateNewApiKeyForUserRequestOpts(requestParameters: GenerateNewApiKeyForUserRequest): Promise<runtime.RequestOpts>;
|
|
184
|
+
/**
|
|
185
|
+
* Generate a new API key for the user
|
|
186
|
+
* Update ApiKey
|
|
187
|
+
*/
|
|
188
|
+
generateNewApiKeyForUserRaw(requestParameters: GenerateNewApiKeyForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueString>>;
|
|
189
|
+
/**
|
|
190
|
+
* Generate a new API key for the user
|
|
191
|
+
* Update ApiKey
|
|
192
|
+
*/
|
|
193
|
+
generateNewApiKeyForUser(requestParameters: GenerateNewApiKeyForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueString>;
|
|
180
194
|
/**
|
|
181
195
|
* Creates request options for getRole without sending the request
|
|
182
196
|
*/
|
|
@@ -205,20 +219,6 @@ export declare class AdminApi extends runtime.BaseAPI {
|
|
|
205
219
|
* UserProfile for userId
|
|
206
220
|
*/
|
|
207
221
|
getUser(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserProfile>;
|
|
208
|
-
/**
|
|
209
|
-
* Creates request options for gnerateNewApiKeyForUser without sending the request
|
|
210
|
-
*/
|
|
211
|
-
gnerateNewApiKeyForUserRequestOpts(requestParameters: GnerateNewApiKeyForUserRequest): Promise<runtime.RequestOpts>;
|
|
212
|
-
/**
|
|
213
|
-
* Generate a new API key for the user
|
|
214
|
-
* Update ApiKey
|
|
215
|
-
*/
|
|
216
|
-
gnerateNewApiKeyForUserRaw(requestParameters: GnerateNewApiKeyForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueString>>;
|
|
217
|
-
/**
|
|
218
|
-
* Generate a new API key for the user
|
|
219
|
-
* Update ApiKey
|
|
220
|
-
*/
|
|
221
|
-
gnerateNewApiKeyForUser(requestParameters: GnerateNewApiKeyForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueString>;
|
|
222
222
|
/**
|
|
223
223
|
* Creates request options for listRoles without sending the request
|
|
224
224
|
*/
|
|
@@ -290,3 +290,11 @@ export declare class AdminApi extends runtime.BaseAPI {
|
|
|
290
290
|
*/
|
|
291
291
|
updateRolesForUser(requestParameters: UpdateRolesForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserProfile>;
|
|
292
292
|
}
|
|
293
|
+
/** @deprecated misspelled before 2.6.0, use {@link GenerateNewApiKeyForUserRequest} */
|
|
294
|
+
export type GnerateNewApiKeyForUserRequest = GenerateNewApiKeyForUserRequest;
|
|
295
|
+
export interface AdminApi {
|
|
296
|
+
/** @deprecated misspelled before 2.6.0, use {@link AdminApi.generateNewApiKeyForUser} */
|
|
297
|
+
gnerateNewApiKeyForUser(requestParameters: GenerateNewApiKeyForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueString>;
|
|
298
|
+
/** @deprecated misspelled before 2.6.0, use {@link AdminApi.generateNewApiKeyForUserRaw} */
|
|
299
|
+
gnerateNewApiKeyForUserRaw(requestParameters: GenerateNewApiKeyForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueString>>;
|
|
300
|
+
}
|
|
@@ -229,13 +229,13 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
229
229
|
return await response.value();
|
|
230
230
|
}
|
|
231
231
|
/**
|
|
232
|
-
* Creates request options for
|
|
232
|
+
* Creates request options for generateNewApiKeyForUser without sending the request
|
|
233
233
|
*/
|
|
234
|
-
async
|
|
235
|
-
if (requestParameters["
|
|
234
|
+
async generateNewApiKeyForUserRequestOpts(requestParameters) {
|
|
235
|
+
if (requestParameters["userId"] == null) {
|
|
236
236
|
throw new runtime.RequiredError(
|
|
237
|
-
"
|
|
238
|
-
'Required parameter "
|
|
237
|
+
"userId",
|
|
238
|
+
'Required parameter "userId" was null or undefined when calling generateNewApiKeyForUser().'
|
|
239
239
|
);
|
|
240
240
|
}
|
|
241
241
|
const queryParameters = {};
|
|
@@ -253,40 +253,40 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
253
253
|
if (this.configuration && this.configuration.apiKey) {
|
|
254
254
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
255
255
|
}
|
|
256
|
-
let urlPath = `/admin/
|
|
257
|
-
urlPath = urlPath.replace("{
|
|
256
|
+
let urlPath = `/admin/users/{userId}/apikey`;
|
|
257
|
+
urlPath = urlPath.replace("{userId}", encodeURIComponent(String(requestParameters["userId"])));
|
|
258
258
|
return {
|
|
259
259
|
path: urlPath,
|
|
260
|
-
method: "
|
|
260
|
+
method: "PATCH",
|
|
261
261
|
headers: headerParameters,
|
|
262
262
|
query: queryParameters
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
265
|
/**
|
|
266
|
-
*
|
|
267
|
-
*
|
|
266
|
+
* Generate a new API key for the user
|
|
267
|
+
* Update ApiKey
|
|
268
268
|
*/
|
|
269
|
-
async
|
|
270
|
-
const requestOptions = await this.
|
|
269
|
+
async generateNewApiKeyForUserRaw(requestParameters, initOverrides) {
|
|
270
|
+
const requestOptions = await this.generateNewApiKeyForUserRequestOpts(requestParameters);
|
|
271
271
|
const response = await this.request(requestOptions, initOverrides);
|
|
272
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
272
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JsonValueStringFromJSON(jsonValue));
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
275
|
+
* Generate a new API key for the user
|
|
276
|
+
* Update ApiKey
|
|
277
277
|
*/
|
|
278
|
-
async
|
|
279
|
-
const response = await this.
|
|
278
|
+
async generateNewApiKeyForUser(requestParameters, initOverrides) {
|
|
279
|
+
const response = await this.generateNewApiKeyForUserRaw(requestParameters, initOverrides);
|
|
280
280
|
return await response.value();
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
283
|
-
* Creates request options for
|
|
283
|
+
* Creates request options for getRole without sending the request
|
|
284
284
|
*/
|
|
285
|
-
async
|
|
286
|
-
if (requestParameters["
|
|
285
|
+
async getRoleRequestOpts(requestParameters) {
|
|
286
|
+
if (requestParameters["roleName"] == null) {
|
|
287
287
|
throw new runtime.RequiredError(
|
|
288
|
-
"
|
|
289
|
-
'Required parameter "
|
|
288
|
+
"roleName",
|
|
289
|
+
'Required parameter "roleName" was null or undefined when calling getRole().'
|
|
290
290
|
);
|
|
291
291
|
}
|
|
292
292
|
const queryParameters = {};
|
|
@@ -304,8 +304,8 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
304
304
|
if (this.configuration && this.configuration.apiKey) {
|
|
305
305
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
306
306
|
}
|
|
307
|
-
let urlPath = `/admin/
|
|
308
|
-
urlPath = urlPath.replace("{
|
|
307
|
+
let urlPath = `/admin/roles/{roleName}`;
|
|
308
|
+
urlPath = urlPath.replace("{roleName}", encodeURIComponent(String(requestParameters["roleName"])));
|
|
309
309
|
return {
|
|
310
310
|
path: urlPath,
|
|
311
311
|
method: "GET",
|
|
@@ -314,30 +314,30 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
316
|
/**
|
|
317
|
-
* Get
|
|
318
|
-
*
|
|
317
|
+
* Get Role by RoleKey
|
|
318
|
+
* Get Role
|
|
319
319
|
*/
|
|
320
|
-
async
|
|
321
|
-
const requestOptions = await this.
|
|
320
|
+
async getRoleRaw(requestParameters, initOverrides) {
|
|
321
|
+
const requestOptions = await this.getRoleRequestOpts(requestParameters);
|
|
322
322
|
const response = await this.request(requestOptions, initOverrides);
|
|
323
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
323
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RoleFromJSON(jsonValue));
|
|
324
324
|
}
|
|
325
325
|
/**
|
|
326
|
-
* Get
|
|
327
|
-
*
|
|
326
|
+
* Get Role by RoleKey
|
|
327
|
+
* Get Role
|
|
328
328
|
*/
|
|
329
|
-
async
|
|
330
|
-
const response = await this.
|
|
329
|
+
async getRole(requestParameters, initOverrides) {
|
|
330
|
+
const response = await this.getRoleRaw(requestParameters, initOverrides);
|
|
331
331
|
return await response.value();
|
|
332
332
|
}
|
|
333
333
|
/**
|
|
334
|
-
* Creates request options for
|
|
334
|
+
* Creates request options for getUser without sending the request
|
|
335
335
|
*/
|
|
336
|
-
async
|
|
336
|
+
async getUserRequestOpts(requestParameters) {
|
|
337
337
|
if (requestParameters["userId"] == null) {
|
|
338
338
|
throw new runtime.RequiredError(
|
|
339
339
|
"userId",
|
|
340
|
-
'Required parameter "userId" was null or undefined when calling
|
|
340
|
+
'Required parameter "userId" was null or undefined when calling getUser().'
|
|
341
341
|
);
|
|
342
342
|
}
|
|
343
343
|
const queryParameters = {};
|
|
@@ -355,30 +355,30 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
355
355
|
if (this.configuration && this.configuration.apiKey) {
|
|
356
356
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
357
357
|
}
|
|
358
|
-
let urlPath = `/admin/users/{userId}
|
|
358
|
+
let urlPath = `/admin/users/{userId}`;
|
|
359
359
|
urlPath = urlPath.replace("{userId}", encodeURIComponent(String(requestParameters["userId"])));
|
|
360
360
|
return {
|
|
361
361
|
path: urlPath,
|
|
362
|
-
method: "
|
|
362
|
+
method: "GET",
|
|
363
363
|
headers: headerParameters,
|
|
364
364
|
query: queryParameters
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
367
|
/**
|
|
368
|
-
*
|
|
369
|
-
*
|
|
368
|
+
* Get UserProfile for user
|
|
369
|
+
* UserProfile for userId
|
|
370
370
|
*/
|
|
371
|
-
async
|
|
372
|
-
const requestOptions = await this.
|
|
371
|
+
async getUserRaw(requestParameters, initOverrides) {
|
|
372
|
+
const requestOptions = await this.getUserRequestOpts(requestParameters);
|
|
373
373
|
const response = await this.request(requestOptions, initOverrides);
|
|
374
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
374
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue));
|
|
375
375
|
}
|
|
376
376
|
/**
|
|
377
|
-
*
|
|
378
|
-
*
|
|
377
|
+
* Get UserProfile for user
|
|
378
|
+
* UserProfile for userId
|
|
379
379
|
*/
|
|
380
|
-
async
|
|
381
|
-
const response = await this.
|
|
380
|
+
async getUser(requestParameters, initOverrides) {
|
|
381
|
+
const response = await this.getUserRaw(requestParameters, initOverrides);
|
|
382
382
|
return await response.value();
|
|
383
383
|
}
|
|
384
384
|
/**
|
|
@@ -659,3 +659,5 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
659
659
|
return await response.value();
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
+
AdminApi.prototype.gnerateNewApiKeyForUser = AdminApi.prototype.generateNewApiKeyForUser;
|
|
663
|
+
AdminApi.prototype.gnerateNewApiKeyForUserRaw = AdminApi.prototype.generateNewApiKeyForUserRaw;
|
|
@@ -20,6 +20,12 @@ export interface GetConfigRequest {
|
|
|
20
20
|
*/
|
|
21
21
|
configurationKey: string;
|
|
22
22
|
}
|
|
23
|
+
export interface ResetConfigurationRequest {
|
|
24
|
+
/**
|
|
25
|
+
* configurationKey to reset
|
|
26
|
+
*/
|
|
27
|
+
configurationKey: string;
|
|
28
|
+
}
|
|
23
29
|
export interface ShutdownRequest {
|
|
24
30
|
/**
|
|
25
31
|
* Shutdown Server and don't send reboot event.
|
|
@@ -68,6 +74,20 @@ export declare class ApplicationApi extends runtime.BaseAPI {
|
|
|
68
74
|
* List Configurations
|
|
69
75
|
*/
|
|
70
76
|
listConfigurations(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<MongoCampConfiguration>>;
|
|
77
|
+
/**
|
|
78
|
+
* Creates request options for resetConfiguration without sending the request
|
|
79
|
+
*/
|
|
80
|
+
resetConfigurationRequestOpts(requestParameters: ResetConfigurationRequest): Promise<runtime.RequestOpts>;
|
|
81
|
+
/**
|
|
82
|
+
* Reset the Configuration to its default value (2.6.0), at once for a key that needs no restart. 404 for an unknown key, 400 for a key that is read at the start only, set by the environment or has a generated default (AUTH_SECRET).
|
|
83
|
+
* Reset Configuration
|
|
84
|
+
*/
|
|
85
|
+
resetConfigurationRaw(requestParameters: ResetConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueBoolean>>;
|
|
86
|
+
/**
|
|
87
|
+
* Reset the Configuration to its default value (2.6.0), at once for a key that needs no restart. 404 for an unknown key, 400 for a key that is read at the start only, set by the environment or has a generated default (AUTH_SECRET).
|
|
88
|
+
* Reset Configuration
|
|
89
|
+
*/
|
|
90
|
+
resetConfiguration(requestParameters: ResetConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueBoolean>;
|
|
71
91
|
/**
|
|
72
92
|
* Creates request options for settings without sending the request
|
|
73
93
|
*/
|
|
@@ -107,6 +107,57 @@ export class ApplicationApi extends runtime.BaseAPI {
|
|
|
107
107
|
const response = await this.listConfigurationsRaw(initOverrides);
|
|
108
108
|
return await response.value();
|
|
109
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Creates request options for resetConfiguration without sending the request
|
|
112
|
+
*/
|
|
113
|
+
async resetConfigurationRequestOpts(requestParameters) {
|
|
114
|
+
if (requestParameters["configurationKey"] == null) {
|
|
115
|
+
throw new runtime.RequiredError(
|
|
116
|
+
"configurationKey",
|
|
117
|
+
'Required parameter "configurationKey" was null or undefined when calling resetConfiguration().'
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
const queryParameters = {};
|
|
121
|
+
const headerParameters = {};
|
|
122
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
123
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
124
|
+
}
|
|
125
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
126
|
+
const token = this.configuration.accessToken;
|
|
127
|
+
const tokenString = await token("httpAuth", []);
|
|
128
|
+
if (tokenString) {
|
|
129
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
133
|
+
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
134
|
+
}
|
|
135
|
+
let urlPath = `/system/configurations/{configurationKey}`;
|
|
136
|
+
urlPath = urlPath.replace("{configurationKey}", encodeURIComponent(String(requestParameters["configurationKey"])));
|
|
137
|
+
return {
|
|
138
|
+
path: urlPath,
|
|
139
|
+
method: "DELETE",
|
|
140
|
+
headers: headerParameters,
|
|
141
|
+
query: queryParameters
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Reset the Configuration to its default value (2.6.0), at once for a key that needs no restart. 404 for an unknown key, 400 for a key that is read at the start only, set by the environment or has a generated default (AUTH_SECRET).
|
|
146
|
+
* Reset Configuration
|
|
147
|
+
*/
|
|
148
|
+
async resetConfigurationRaw(requestParameters, initOverrides) {
|
|
149
|
+
const requestOptions = await this.resetConfigurationRequestOpts(requestParameters);
|
|
150
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
151
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JsonValueBooleanFromJSON(jsonValue));
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Reset the Configuration to its default value (2.6.0), at once for a key that needs no restart. 404 for an unknown key, 400 for a key that is read at the start only, set by the environment or has a generated default (AUTH_SECRET).
|
|
155
|
+
* Reset Configuration
|
|
156
|
+
*/
|
|
157
|
+
async resetConfiguration(requestParameters, initOverrides) {
|
|
158
|
+
const response = await this.resetConfigurationRaw(requestParameters, initOverrides);
|
|
159
|
+
return await response.value();
|
|
160
|
+
}
|
|
110
161
|
/**
|
|
111
162
|
* Creates request options for settings without sending the request
|
|
112
163
|
*/
|
|
@@ -14,6 +14,7 @@ import { type DeleteResponse } from '../models/DeleteResponse.js';
|
|
|
14
14
|
import { type FileInformation } from '../models/FileInformation.js';
|
|
15
15
|
import { type InsertResponse } from '../models/InsertResponse.js';
|
|
16
16
|
import { type MongoFindRequest } from '../models/MongoFindRequest.js';
|
|
17
|
+
import { type SearchRequest } from '../models/SearchRequest.js';
|
|
17
18
|
import { type UpdateFileInformationRequest } from '../models/UpdateFileInformationRequest.js';
|
|
18
19
|
import { type UpdateResponse } from '../models/UpdateResponse.js';
|
|
19
20
|
export interface DeleteFileRequest {
|
|
@@ -124,6 +125,36 @@ export interface ListFilesRequest {
|
|
|
124
125
|
*/
|
|
125
126
|
after?: string;
|
|
126
127
|
}
|
|
128
|
+
export interface SearchFilesRequest {
|
|
129
|
+
/**
|
|
130
|
+
* The name of your MongoDb Collection
|
|
131
|
+
*/
|
|
132
|
+
bucketName: string;
|
|
133
|
+
/**
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
searchRequest: SearchRequest;
|
|
137
|
+
/**
|
|
138
|
+
* Count elements per page
|
|
139
|
+
*/
|
|
140
|
+
rowsPerPage?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Requested page of the ResultSets
|
|
143
|
+
*/
|
|
144
|
+
page?: number;
|
|
145
|
+
/**
|
|
146
|
+
* How the result is counted: exact (default) or none (no count headers, no count query)
|
|
147
|
+
*/
|
|
148
|
+
count?: SearchFilesCountEnum;
|
|
149
|
+
/**
|
|
150
|
+
* Cursor paging: the x-pagination-next value of the previous page, empty for the first page. The sort always ends with _id; cannot be combined with page
|
|
151
|
+
*/
|
|
152
|
+
after?: string;
|
|
153
|
+
/**
|
|
154
|
+
* true: wildcards and prefixes of the Lucene filter ignore the case.
|
|
155
|
+
*/
|
|
156
|
+
filterCaseInsensitive?: boolean;
|
|
157
|
+
}
|
|
127
158
|
export interface UpdateFileInformationOperationRequest {
|
|
128
159
|
/**
|
|
129
160
|
* The name of your MongoDb Collection
|
|
@@ -226,6 +257,20 @@ export declare class FileApi extends runtime.BaseAPI {
|
|
|
226
257
|
* Files in Bucket
|
|
227
258
|
*/
|
|
228
259
|
listFiles(requestParameters: ListFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FileInformation>>;
|
|
260
|
+
/**
|
|
261
|
+
* Creates request options for searchFiles without sending the request
|
|
262
|
+
*/
|
|
263
|
+
searchFilesRequestOpts(requestParameters: SearchFilesRequest): Promise<runtime.RequestOpts>;
|
|
264
|
+
/**
|
|
265
|
+
* The files of the bucket with a Lucene filter (2.6.0), like the search of documents: filter, sort and projection in the request body (no URL limit), fields of the files collection (filename, length, uploadDate, metadata.*). The operators of FILTER_OPERATORS_DENIED are refused; PAGING_MAX_ROWS applies.
|
|
266
|
+
* Search Files in Bucket
|
|
267
|
+
*/
|
|
268
|
+
searchFilesRaw(requestParameters: SearchFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<FileInformation>>>;
|
|
269
|
+
/**
|
|
270
|
+
* The files of the bucket with a Lucene filter (2.6.0), like the search of documents: filter, sort and projection in the request body (no URL limit), fields of the files collection (filename, length, uploadDate, metadata.*). The operators of FILTER_OPERATORS_DENIED are refused; PAGING_MAX_ROWS applies.
|
|
271
|
+
* Search Files in Bucket
|
|
272
|
+
*/
|
|
273
|
+
searchFiles(requestParameters: SearchFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FileInformation>>;
|
|
229
274
|
/**
|
|
230
275
|
* Creates request options for updateFileInformation without sending the request
|
|
231
276
|
*/
|
|
@@ -257,3 +302,11 @@ export declare const ListFilesCountEnum: {
|
|
|
257
302
|
readonly None: "none";
|
|
258
303
|
};
|
|
259
304
|
export type ListFilesCountEnum = typeof ListFilesCountEnum[keyof typeof ListFilesCountEnum];
|
|
305
|
+
/**
|
|
306
|
+
* @export
|
|
307
|
+
*/
|
|
308
|
+
export declare const SearchFilesCountEnum: {
|
|
309
|
+
readonly Exact: "exact";
|
|
310
|
+
readonly None: "none";
|
|
311
|
+
};
|
|
312
|
+
export type SearchFilesCountEnum = typeof SearchFilesCountEnum[keyof typeof SearchFilesCountEnum];
|