@sfxcode/nuxt-mongocamp-server 1.9.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -5
- package/dist/module.d.mts +31 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +41 -4
- package/dist/runtime/api/apis/AdminApi.d.ts +5 -5
- package/dist/runtime/api/apis/AdminApi.js +4 -4
- package/dist/runtime/api/apis/ApplicationApi.d.ts +1 -1
- package/dist/runtime/api/apis/AuthApi.d.ts +3 -3
- package/dist/runtime/api/apis/AuthApi.js +2 -2
- package/dist/runtime/api/apis/BucketApi.d.ts +1 -1
- package/dist/runtime/api/apis/CollectionApi.d.ts +1 -1
- package/dist/runtime/api/apis/DatabaseApi.d.ts +1 -1
- package/dist/runtime/api/apis/DocumentApi.d.ts +1 -1
- package/dist/runtime/api/apis/FileApi.d.ts +1 -1
- package/dist/runtime/api/apis/IndexApi.d.ts +1 -1
- package/dist/runtime/api/apis/JobsApi.d.ts +1 -1
- package/dist/runtime/api/apis/SystemApi.d.ts +1 -1
- package/dist/runtime/api/docs/AdminApi.md +2 -2
- package/dist/runtime/api/docs/AuthApi.md +1 -1
- package/dist/runtime/api/docs/DocumentApi.md +1 -1
- package/dist/runtime/api/models/BucketInformation.d.ts +1 -1
- package/dist/runtime/api/models/Capabilities.d.ts +1 -1
- package/dist/runtime/api/models/CapabilityLimits.d.ts +1 -1
- package/dist/runtime/api/models/ClusterInformation.d.ts +1 -1
- package/dist/runtime/api/models/ClusterMemberInformation.d.ts +1 -1
- package/dist/runtime/api/models/CollectionCollation.d.ts +1 -1
- package/dist/runtime/api/models/CollectionOptions.d.ts +1 -1
- package/dist/runtime/api/models/CollectionPermission.d.ts +1 -1
- package/dist/runtime/api/models/CollectionStatus.d.ts +1 -1
- package/dist/runtime/api/models/CollectionSummary.d.ts +1 -1
- package/dist/runtime/api/models/ConnectionStats.d.ts +1 -1
- package/dist/runtime/api/models/CopyRequest.d.ts +1 -1
- package/dist/runtime/api/models/CopyResponse.d.ts +1 -1
- package/dist/runtime/api/models/CountResponse.d.ts +1 -1
- package/dist/runtime/api/models/CreateCollectionResponse.d.ts +1 -1
- package/dist/runtime/api/models/DatabaseInfo.d.ts +1 -1
- package/dist/runtime/api/models/DeleteResponse.d.ts +1 -1
- package/dist/runtime/api/models/ErrorDescription.d.ts +1 -1
- package/dist/runtime/api/models/FieldInfo.d.ts +1 -1
- package/dist/runtime/api/models/FieldTypeCount.d.ts +1 -1
- package/dist/runtime/api/models/FileInformation.d.ts +1 -1
- package/dist/runtime/api/models/Grant.d.ts +1 -1
- package/dist/runtime/api/models/ImportResponse.d.ts +1 -1
- package/dist/runtime/api/models/IndexCreateRequest.d.ts +1 -1
- package/dist/runtime/api/models/IndexCreateResponse.d.ts +1 -1
- package/dist/runtime/api/models/IndexDropResponse.d.ts +1 -1
- package/dist/runtime/api/models/IndexInfo.d.ts +1 -1
- package/dist/runtime/api/models/IndexKey.d.ts +1 -1
- package/dist/runtime/api/models/IndexOptionsRequest.d.ts +1 -1
- package/dist/runtime/api/models/IndexUsage.d.ts +1 -1
- package/dist/runtime/api/models/InsertError.d.ts +1 -1
- package/dist/runtime/api/models/InsertResponse.d.ts +1 -1
- package/dist/runtime/api/models/JobConfig.d.ts +1 -1
- package/dist/runtime/api/models/JobInformation.d.ts +1 -1
- package/dist/runtime/api/models/JsonSchema.d.ts +1 -1
- package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +1 -1
- package/dist/runtime/api/models/JsonValueAny.d.ts +1 -1
- package/dist/runtime/api/models/JsonValueBoolean.d.ts +1 -1
- package/dist/runtime/api/models/JsonValueString.d.ts +1 -1
- package/dist/runtime/api/models/Login.d.ts +1 -1
- package/dist/runtime/api/models/LoginResult.d.ts +1 -1
- package/dist/runtime/api/models/MongoAggregateRequest.d.ts +1 -1
- package/dist/runtime/api/models/MongoCampConfiguration.d.ts +1 -1
- package/dist/runtime/api/models/MongoFindRequest.d.ts +1 -1
- package/dist/runtime/api/models/MongoIndex.d.ts +1 -1
- package/dist/runtime/api/models/OpCounters.d.ts +1 -1
- package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +1 -1
- package/dist/runtime/api/models/PipelineStage.d.ts +1 -1
- package/dist/runtime/api/models/RenameRequest.d.ts +1 -1
- package/dist/runtime/api/models/RenameResponse.d.ts +1 -1
- package/dist/runtime/api/models/ReplicaSetState.d.ts +1 -1
- package/dist/runtime/api/models/Role.d.ts +1 -1
- package/dist/runtime/api/models/SchemaAnalysis.d.ts +1 -1
- package/dist/runtime/api/models/SchemaAnalysisField.d.ts +1 -1
- package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +1 -1
- package/dist/runtime/api/models/SearchRequest.d.ts +1 -1
- package/dist/runtime/api/models/SettingsResponse.d.ts +1 -1
- package/dist/runtime/api/models/SystemInfo.d.ts +1 -1
- package/dist/runtime/api/models/SystemStats.d.ts +1 -1
- package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +1 -1
- package/dist/runtime/api/models/UpdateRequest.d.ts +1 -1
- package/dist/runtime/api/models/UpdateResponse.d.ts +1 -1
- package/dist/runtime/api/models/UpdateRoleRequest.d.ts +1 -1
- package/dist/runtime/api/models/UserInformation.d.ts +1 -1
- package/dist/runtime/api/models/UserProfile.d.ts +1 -1
- package/dist/runtime/api/models/Version.d.ts +1 -1
- package/dist/runtime/api/runtime.d.ts +1 -1
- package/dist/runtime/composables/mongocampApi.js +7 -0
- package/dist/runtime/server/composables/mongocampApi.d.ts +2 -1
- package/dist/runtime/server/composables/mongocampApi.js +11 -5
- package/dist/runtime/server/composables/mongocampServerApi.d.ts +2 -1
- package/dist/runtime/server/composables/mongocampServerApi.js +3 -7
- package/dist/runtime/server/mongocamp/core.d.ts +22 -0
- package/dist/runtime/server/mongocamp/core.js +32 -0
- package/dist/runtime/server/mongocamp/handler.d.ts +3 -0
- package/dist/runtime/server/mongocamp/handler.js +8 -0
- package/dist/runtime/server/mongocamp/plugin.d.ts +3 -0
- package/dist/runtime/server/mongocamp/plugin.js +7 -0
- package/dist/types.d.mts +1 -1
- package/package.json +38 -27
package/README.md
CHANGED
|
@@ -4,7 +4,18 @@ Nuxt module wrapping a generated OpenAPI client for [MongoCamp](https://mongocam
|
|
|
4
4
|
|
|
5
5
|
## MongoCamp Server
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The module works in two modes:
|
|
8
|
+
|
|
9
|
+
- **Embedded server** (`server.enabled`): the MongoCamp API runs inside the Nitro of your application (`@sfxcode/mongocamp-server-core`, a TypeScript replacement of the Scala server with the same OpenAPI contract). No second application is needed.
|
|
10
|
+
- **External server**: the module is a client for a running server at `url`.
|
|
11
|
+
|
|
12
|
+
The module runs on **Nitro 3 / h3 2**. Nuxt 4.7 builds with Nitro 3 (`@nuxt/nitro-v3-server`) when the application declares `nitro`:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @sfxcode/nuxt-mongocamp-server nitro
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
In external mode, this module is a client for [MongoCamp Server](https://github.com/MongoCamp/mongocamp-server), a REST API server for MongoDB that provides authentication, user/role management, and collection, document and index APIs. The OpenAPI client in this module is generated from the server's OpenAPI spec, so the module version should match a compatible server version. See the [server repository](https://github.com/MongoCamp/mongocamp-server) for installation, configuration and API documentation.
|
|
8
19
|
|
|
9
20
|
## Nuxt UI MongoCamp
|
|
10
21
|
|
|
@@ -12,10 +23,69 @@ This module is a client for [MongoCamp Server](https://github.com/MongoCamp/mong
|
|
|
12
23
|
|
|
13
24
|
## Setup
|
|
14
25
|
|
|
26
|
+
### Embedded server
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
// nuxt.config.ts
|
|
30
|
+
export default defineNuxtConfig({
|
|
31
|
+
modules: ['@sfxcode/nuxt-mongocamp-server'],
|
|
32
|
+
mongocamp: {
|
|
33
|
+
server: {
|
|
34
|
+
enabled: true,
|
|
35
|
+
// prefix: '/api/mongocamp-server', the url of the clients defaults to it
|
|
36
|
+
config: { CONNECTION_DATABASE: 'mongocamp' },
|
|
37
|
+
},
|
|
38
|
+
refreshToken: true,
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The connection and every other setting use the env variables of the Scala server, so existing deployments keep their environment:
|
|
44
|
+
|
|
45
|
+
| Env | Default | Description |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| `CONNECTION_HOST`, `CONNECTION_PORT` | `localhost`, `27017` | MongoDB server (or `NUXT_MONGOCAMP_SERVER_CONNECTION_URI` for a full connection string) |
|
|
48
|
+
| `CONNECTION_DATABASE` | `mongocamp` | default database |
|
|
49
|
+
| `CONNECTION_USERNAME`, `CONNECTION_PASSWORD`, `CONNECTION_AUTHDB` | —, —, `admin` | credentials of the database user |
|
|
50
|
+
| `AUTH_HANDLER` | `mongo` | users and roles in `mc_users` / `mc_roles` (`static`: `AUTH_USERS`, `AUTH_ROLES`) |
|
|
51
|
+
| `AUTH_SECRET` | random, stored | secret of the tokens (stored in `mc_configuration`, shared by all instances) |
|
|
52
|
+
| `AUTH_EXPIRING_DURATION` | `6h` | lifetime of a token |
|
|
53
|
+
| `REQUESTLOGGING_ENABLED`, `METRICS_ENABLED` | `false` | request log and metrics (the former plugins) |
|
|
54
|
+
|
|
55
|
+
At the first start the user `admin` is created with a random password that is printed to the log (like the Scala server). Further settings
|
|
56
|
+
and the extension points (events, job handlers) are described in [`packages/server-core/README.md`](packages/server-core/README.md). In
|
|
57
|
+
server code `useMongocampCore()` gives the embedded server, e.g. to listen to its events:
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
// server/plugins/audit.ts
|
|
61
|
+
import { definePlugin } from 'nitro'
|
|
62
|
+
|
|
63
|
+
export default definePlugin(async () => {
|
|
64
|
+
const core = await useMongocampCore()
|
|
65
|
+
core.events.on('document:delete', event => console.info(event.user.userId, event.collectionName, event.oldValues))
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Migration from the Scala server** (details and all differences: [`docs/migration-from-scala.md`](docs/migration-from-scala.md)): point the embedded server at the same database (the same `CONNECTION_*` and `AUTH_PREFIX`); users,
|
|
70
|
+
roles, tokens, the token secret and the stored configurations keep working. Jobs are read from `mc_jobs` with cron expressions in the
|
|
71
|
+
syntax of [croner](https://croner.56k.guru) (`*/5` instead of `0/5`); the Quartz tables `mc_jobs_*` are not read.
|
|
72
|
+
|
|
73
|
+
### Standalone server
|
|
74
|
+
|
|
75
|
+
`apps/server` is the same server without Nuxt (Nitro 3), configured only by env and listening on `SERVER_INTERFACE:SERVER_PORT`
|
|
76
|
+
(default `0.0.0.0:8080`) like the Scala image:
|
|
77
|
+
|
|
15
78
|
```bash
|
|
16
|
-
|
|
79
|
+
docker build -f apps/server/Dockerfile -t mongocamp-nitro-server .
|
|
80
|
+
docker run -p 8080:8080 -e CONNECTION_HOST=host.docker.internal mongocamp-nitro-server
|
|
17
81
|
```
|
|
18
82
|
|
|
83
|
+
The image (distroless Node 24, about 214 MB, the server itself 2.8 MB) stops cleanly on `docker stop` (SIGTERM) and on `DELETE /system`.
|
|
84
|
+
|
|
85
|
+
The spec is served at `/docs/docs.yaml` (`DOCS_OPENAPI`, default on) and an API reference UI at `/docs` (`DOCS_SWAGGER`).
|
|
86
|
+
|
|
87
|
+
### External server
|
|
88
|
+
|
|
19
89
|
```ts
|
|
20
90
|
// nuxt.config.ts
|
|
21
91
|
export default defineNuxtConfig({
|
|
@@ -33,7 +103,12 @@ export default defineNuxtConfig({
|
|
|
33
103
|
|
|
34
104
|
| Option | Type | Default | Description |
|
|
35
105
|
| ------------------------| --------- | ------- | ----------------------------------------------------------------------------------------------|
|
|
36
|
-
| `url` | `string` | — |
|
|
106
|
+
| `url` | `string` | — | Base URL of the MongoCamp server. Required without the embedded server, which it defaults to. |
|
|
107
|
+
| `server.enabled` | `boolean` | `false` | Runs the MongoCamp API inside this application. |
|
|
108
|
+
| `server.prefix` | `string` | `/api/mongocamp-server` | Path of the embedded API. |
|
|
109
|
+
| `server.connectionUri` | `string` | — | MongoDB connection string; better by env `NUXT_MONGOCAMP_SERVER_CONNECTION_URI`. |
|
|
110
|
+
| `server.config` | `object` | `{}` | Settings by key (`CONNECTION_DATABASE`, ...); the env variables win. |
|
|
111
|
+
| `server.jobs` | `boolean` | `true` | Runs the jobs (token cleanup, ...) on their schedule in this instance. |
|
|
37
112
|
| `apiKey` | `string` | — | Optional. Stored server-side only; picked up automatically by `useMongocampApi(event)`. |
|
|
38
113
|
| `paginationSize` | `number` | `500` | Default rows per page for search/list composables. Values below 10 fall back to the default. |
|
|
39
114
|
| `refreshToken` | `boolean` | `false` | Whether the client auto-refreshes the session token on an interval after login. |
|
|
@@ -63,12 +138,15 @@ A missing `url` throws during `nuxi dev`/`nuxi build`/`nuxi generate` (not durin
|
|
|
63
138
|
|
|
64
139
|
| Composable | Purpose |
|
|
65
140
|
| -----------------------------------------------| -----------------------------------------------------------------------------------|
|
|
66
|
-
| `useMongocampApi(event, token?)` | Builds authenticated API clients using the module's `apiKey`, or the given `token` as a fallback. |
|
|
141
|
+
| `useMongocampApi(event, token?)` | Builds authenticated API clients using the module's `apiKey`, or the given `token` as a fallback. With the embedded server the calls are answered in-process. |
|
|
142
|
+
| `useMongocampCore()` | The embedded server (`server.enabled` only): events, configuration, direct access. |
|
|
67
143
|
| `useMongocampServerApi(url, key?, token?)` | Lower-level factory when you need to authenticate against a different URL/credential explicitly. |
|
|
68
144
|
|
|
69
145
|
```ts
|
|
70
146
|
// server/api/mongocamp/users.ts
|
|
71
|
-
|
|
147
|
+
import { defineHandler } from 'nitro'
|
|
148
|
+
|
|
149
|
+
export default defineHandler((event) => {
|
|
72
150
|
const { adminApi } = useMongocampApi(event)
|
|
73
151
|
return adminApi.listUsers()
|
|
74
152
|
})
|
package/dist/module.d.mts
CHANGED
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
export * from '../dist/runtime/api/index.js';
|
|
3
3
|
|
|
4
|
+
/** The option `server` of the module: the MongoCamp server embedded in the Nitro of the application. */
|
|
5
|
+
interface ServerOptions {
|
|
6
|
+
/** Serves the MongoCamp API from this application (default false: an external server at `url`). */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
/** The path of the API (default `/api/mongocamp-server`). */
|
|
9
|
+
prefix?: string;
|
|
10
|
+
/** A MongoDB connection string; without it the `CONNECTION_*` configurations (env) are used. Better set by env (`NUXT_MONGOCAMP_SERVER_CONNECTION_URI`). */
|
|
11
|
+
connectionUri?: string;
|
|
12
|
+
/** Configuration values by key (`CONNECTION_DATABASE`, `AUTH_SECRET`, ...); the env variables of the Scala server win. */
|
|
13
|
+
config?: Record<string, unknown>;
|
|
14
|
+
/** Runs the jobs (token cleanup, ...) on their schedule in this instance (default true). */
|
|
15
|
+
jobs?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface ResolvedServerOptions {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
prefix: string;
|
|
20
|
+
connectionUri: string;
|
|
21
|
+
config: Record<string, unknown>;
|
|
22
|
+
jobs: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
4
25
|
interface ModuleOptions {
|
|
26
|
+
/** The url of the MongoCamp API; with `server.enabled` it defaults to the prefix of the embedded server. */
|
|
5
27
|
url: string;
|
|
6
28
|
apiKey?: string;
|
|
7
29
|
paginationSize?: number;
|
|
8
30
|
refreshToken?: boolean;
|
|
9
31
|
tokenRefreshInterval: number;
|
|
10
32
|
sessionMaxAge?: number;
|
|
33
|
+
/** The MongoCamp server embedded in the Nitro of this application. */
|
|
34
|
+
server?: ServerOptions;
|
|
11
35
|
}
|
|
12
36
|
declare module '@nuxt/schema' {
|
|
13
37
|
interface PublicRuntimeConfig {
|
|
@@ -21,9 +45,15 @@ declare module '@nuxt/schema' {
|
|
|
21
45
|
}
|
|
22
46
|
interface RuntimeConfig {
|
|
23
47
|
mongocampApiKey: string;
|
|
48
|
+
mongocampServer: ResolvedServerOptions & {
|
|
49
|
+
version: {
|
|
50
|
+
name: string;
|
|
51
|
+
version: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
24
54
|
}
|
|
25
55
|
}
|
|
26
56
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
27
57
|
|
|
28
58
|
export { _default as default };
|
|
29
|
-
export type { ModuleOptions };
|
|
59
|
+
export type { ModuleOptions, ServerOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addImportsDir, addServerImportsDir } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, addImportsDir, addServerImportsDir, addServerHandler, addServerPlugin, addServerImports } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
import { consola } from 'consola';
|
|
4
4
|
export * from '../dist/runtime/api/index.js';
|
|
5
5
|
|
|
6
6
|
const name = "@sfxcode/nuxt-mongocamp-server";
|
|
7
|
-
const version = "1.
|
|
7
|
+
const version = "1.10.0";
|
|
8
|
+
|
|
9
|
+
const DefaultServerPrefix = "/api/mongocamp-server";
|
|
10
|
+
function normalizePrefix(prefix) {
|
|
11
|
+
const trimmed = (prefix ?? DefaultServerPrefix).trim().replace(/\/+$/, "");
|
|
12
|
+
const path = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
13
|
+
if (path === "/" || path === "") {
|
|
14
|
+
throw new Error('[mongocamp] "server.prefix" must not be the root path');
|
|
15
|
+
}
|
|
16
|
+
return path;
|
|
17
|
+
}
|
|
18
|
+
function resolveServerOptions(options) {
|
|
19
|
+
return {
|
|
20
|
+
enabled: options?.enabled ?? false,
|
|
21
|
+
prefix: normalizePrefix(options?.prefix),
|
|
22
|
+
connectionUri: options?.connectionUri ?? "",
|
|
23
|
+
config: options?.config ?? {},
|
|
24
|
+
jobs: options?.jobs ?? true
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function resolveClientUrl(url, server) {
|
|
28
|
+
if (url && url.length > 0) {
|
|
29
|
+
return url;
|
|
30
|
+
}
|
|
31
|
+
return server.enabled ? server.prefix : void 0;
|
|
32
|
+
}
|
|
8
33
|
|
|
9
34
|
const module$1 = defineNuxtModule({
|
|
10
35
|
meta: {
|
|
@@ -12,15 +37,20 @@ const module$1 = defineNuxtModule({
|
|
|
12
37
|
version,
|
|
13
38
|
configKey: "mongocamp",
|
|
14
39
|
compatibility: {
|
|
15
|
-
nuxt: ">=
|
|
40
|
+
nuxt: ">=4.7.0"
|
|
16
41
|
}
|
|
17
42
|
},
|
|
18
43
|
setup(options, nuxt) {
|
|
44
|
+
if (nuxt.options._nitroMajor !== 3) {
|
|
45
|
+
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)');
|
|
46
|
+
}
|
|
47
|
+
const server = resolveServerOptions(options.server);
|
|
48
|
+
options.url = resolveClientUrl(options.url, server) ?? options.url;
|
|
19
49
|
nuxt.hook("ready", () => {
|
|
20
50
|
if (nuxt.options._prepare)
|
|
21
51
|
return;
|
|
22
52
|
if (!options.url || options.url.length === 0)
|
|
23
|
-
throw new Error('[mongocamp] Missing required "url" module option.');
|
|
53
|
+
throw new Error('[mongocamp] Missing required "url" module option (or enable the embedded server with "server.enabled").');
|
|
24
54
|
});
|
|
25
55
|
if (options.paginationSize !== void 0 && options.paginationSize < 10)
|
|
26
56
|
consola.warn(`[mongocamp] paginationSize of ${options.paginationSize} is below the minimum of 10, falling back to 500`);
|
|
@@ -51,6 +81,13 @@ const module$1 = defineNuxtModule({
|
|
|
51
81
|
const runtimeDir = resolve("./runtime");
|
|
52
82
|
addImportsDir(resolve(runtimeDir, "composables"));
|
|
53
83
|
addServerImportsDir(resolve(runtimeDir, "server/composables"));
|
|
84
|
+
nuxt.options.runtimeConfig.mongocampServer = defu(nuxt.options.runtimeConfig.mongocampServer, { ...server, version: { name: "mongocamp-nitro-server", version } });
|
|
85
|
+
if (server.enabled) {
|
|
86
|
+
addServerHandler({ route: `${server.prefix}/**`, handler: resolve(runtimeDir, "server/mongocamp/handler") });
|
|
87
|
+
addServerPlugin(resolve(runtimeDir, "server/mongocamp/plugin"));
|
|
88
|
+
addServerImports([{ name: "useMongocampCore", from: resolve(runtimeDir, "server/mongocamp/core") }]);
|
|
89
|
+
consola.info(`[mongocamp] embedded server at ${server.prefix}`);
|
|
90
|
+
}
|
|
54
91
|
consola.success("mongocamp-nuxt available");
|
|
55
92
|
}
|
|
56
93
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -168,12 +168,12 @@ export declare class AdminApi extends runtime.BaseAPI {
|
|
|
168
168
|
*/
|
|
169
169
|
deleteUserRequestOpts(requestParameters: DeleteUserRequest): Promise<runtime.RequestOpts>;
|
|
170
170
|
/**
|
|
171
|
-
* Delete User
|
|
171
|
+
* Delete User. All tokens of the user are revoked.
|
|
172
172
|
* Delete User
|
|
173
173
|
*/
|
|
174
174
|
deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueBoolean>>;
|
|
175
175
|
/**
|
|
176
|
-
* Delete User
|
|
176
|
+
* Delete User. All tokens of the user are revoked.
|
|
177
177
|
* Delete User
|
|
178
178
|
*/
|
|
179
179
|
deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueBoolean>;
|
|
@@ -252,12 +252,12 @@ export declare class AdminApi extends runtime.BaseAPI {
|
|
|
252
252
|
*/
|
|
253
253
|
updatePasswordForUserRequestOpts(requestParameters: UpdatePasswordForUserRequest): Promise<runtime.RequestOpts>;
|
|
254
254
|
/**
|
|
255
|
-
* Change Password of User
|
|
255
|
+
* Change Password of User. All tokens of the user are revoked.
|
|
256
256
|
* Update Password
|
|
257
257
|
*/
|
|
258
258
|
updatePasswordForUserRaw(requestParameters: UpdatePasswordForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueBoolean>>;
|
|
259
259
|
/**
|
|
260
|
-
* Change Password of User
|
|
260
|
+
* Change Password of User. All tokens of the user are revoked.
|
|
261
261
|
* Update Password
|
|
262
262
|
*/
|
|
263
263
|
updatePasswordForUser(requestParameters: UpdatePasswordForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueBoolean>;
|
|
@@ -212,7 +212,7 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
214
|
/**
|
|
215
|
-
* Delete User
|
|
215
|
+
* Delete User. All tokens of the user are revoked.
|
|
216
216
|
* Delete User
|
|
217
217
|
*/
|
|
218
218
|
async deleteUserRaw(requestParameters, initOverrides) {
|
|
@@ -221,7 +221,7 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
221
221
|
return new runtime.JSONApiResponse(response, (jsonValue) => JsonValueBooleanFromJSON(jsonValue));
|
|
222
222
|
}
|
|
223
223
|
/**
|
|
224
|
-
* Delete User
|
|
224
|
+
* Delete User. All tokens of the user are revoked.
|
|
225
225
|
* Delete User
|
|
226
226
|
*/
|
|
227
227
|
async deleteUser(requestParameters, initOverrides) {
|
|
@@ -530,7 +530,7 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
532
|
/**
|
|
533
|
-
* Change Password of User
|
|
533
|
+
* Change Password of User. All tokens of the user are revoked.
|
|
534
534
|
* Update Password
|
|
535
535
|
*/
|
|
536
536
|
async updatePasswordForUserRaw(requestParameters, initOverrides) {
|
|
@@ -539,7 +539,7 @@ export class AdminApi extends runtime.BaseAPI {
|
|
|
539
539
|
return new runtime.JSONApiResponse(response, (jsonValue) => JsonValueBooleanFromJSON(jsonValue));
|
|
540
540
|
}
|
|
541
541
|
/**
|
|
542
|
-
* Change Password of User
|
|
542
|
+
* Change Password of User. All tokens of the user are revoked.
|
|
543
543
|
* Update Password
|
|
544
544
|
*/
|
|
545
545
|
async updatePasswordForUser(requestParameters, initOverrides) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -128,12 +128,12 @@ export declare class AuthApi extends runtime.BaseAPI {
|
|
|
128
128
|
*/
|
|
129
129
|
updatePasswordRequestOpts(requestParameters: UpdatePasswordRequest): Promise<runtime.RequestOpts>;
|
|
130
130
|
/**
|
|
131
|
-
* Change Password of logged in User
|
|
131
|
+
* Change Password of logged in User. The other tokens of the user are revoked, the bearer token that was used for the call stays valid.
|
|
132
132
|
* Update Password
|
|
133
133
|
*/
|
|
134
134
|
updatePasswordRaw(requestParameters: UpdatePasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueBoolean>>;
|
|
135
135
|
/**
|
|
136
|
-
* Change Password of logged in User
|
|
136
|
+
* Change Password of logged in User. The other tokens of the user are revoked, the bearer token that was used for the call stays valid.
|
|
137
137
|
* Update Password
|
|
138
138
|
*/
|
|
139
139
|
updatePassword(requestParameters: UpdatePasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueBoolean>;
|
|
@@ -316,7 +316,7 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
318
|
/**
|
|
319
|
-
* Change Password of logged in User
|
|
319
|
+
* Change Password of logged in User. The other tokens of the user are revoked, the bearer token that was used for the call stays valid.
|
|
320
320
|
* Update Password
|
|
321
321
|
*/
|
|
322
322
|
async updatePasswordRaw(requestParameters, initOverrides) {
|
|
@@ -325,7 +325,7 @@ export class AuthApi extends runtime.BaseAPI {
|
|
|
325
325
|
return new runtime.JSONApiResponse(response, (jsonValue) => JsonValueBooleanFromJSON(jsonValue));
|
|
326
326
|
}
|
|
327
327
|
/**
|
|
328
|
-
* Change Password of logged in User
|
|
328
|
+
* Change Password of logged in User. The other tokens of the user are revoked, the bearer token that was used for the call stays valid.
|
|
329
329
|
* Update Password
|
|
330
330
|
*/
|
|
331
331
|
async updatePassword(requestParameters, initOverrides) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -258,7 +258,7 @@ example().catch(console.error);
|
|
|
258
258
|
|
|
259
259
|
Delete User
|
|
260
260
|
|
|
261
|
-
Delete User
|
|
261
|
+
Delete User. All tokens of the user are revoked.
|
|
262
262
|
|
|
263
263
|
### Example
|
|
264
264
|
|
|
@@ -734,7 +734,7 @@ example().catch(console.error);
|
|
|
734
734
|
|
|
735
735
|
Update Password
|
|
736
736
|
|
|
737
|
-
Change Password of User
|
|
737
|
+
Change Password of User. All tokens of the user are revoked.
|
|
738
738
|
|
|
739
739
|
### Example
|
|
740
740
|
|
|
@@ -436,7 +436,7 @@ This endpoint does not need any parameter.
|
|
|
436
436
|
|
|
437
437
|
Update Password
|
|
438
438
|
|
|
439
|
-
Change Password of logged in User
|
|
439
|
+
Change Password of logged in User. The other tokens of the user are revoked, the bearer token that was used for the call stays valid.
|
|
440
440
|
|
|
441
441
|
### Example
|
|
442
442
|
|
|
@@ -652,7 +652,7 @@ async function example() {
|
|
|
652
652
|
// string | The name of your MongoDb Collection
|
|
653
653
|
collectionName: collectionName_example,
|
|
654
654
|
// { [key: string]: any | null; } | JSON Representation for your Document.
|
|
655
|
-
requestBody: {"key1":"value","key2":true,"key3":{"creationDate":"2026-11-
|
|
655
|
+
requestBody: {"key1":"value","key2":true,"key3":{"creationDate":"2026-11-15T20:14:28.832Z"}},
|
|
656
656
|
} satisfies InsertRequest;
|
|
657
657
|
|
|
658
658
|
try {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.9.
|
|
5
|
+
* The version of the OpenAPI document: 1.9.1
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|