@sfxcode/nuxt-mongocamp-server 1.1.0 → 1.1.2
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.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
|
-
import { useRuntimeConfig } from "#app";
|
|
3
2
|
import { useMongocampApi } from "./mongocampApi.mjs";
|
|
4
3
|
import { useMongocampStorage } from "./mongocampStorage.mjs";
|
|
5
4
|
import { useMongocampUser } from "./mongocampUser.mjs";
|
|
5
|
+
import { useRuntimeConfig } from "#app";
|
|
6
6
|
export function useMongocampAuth() {
|
|
7
7
|
const config = useRuntimeConfig();
|
|
8
8
|
const refreshToken = config.public.mongocamp?.refreshToken;
|
|
@@ -2,6 +2,9 @@ import type { FindRequest, MongoFindRequest } from '../api';
|
|
|
2
2
|
export declare function useMongocampSearch(): {
|
|
3
3
|
mongoFindRequest: (filter?: object, sort?: object, projection?: object) => MongoFindRequest;
|
|
4
4
|
findRequest: (collection: string, searchParameter?: MongoFindRequest, rows?: number, actualPage?: number) => FindRequest;
|
|
5
|
+
find: (collectionName: string, filter: string | undefined, page?: number, sort?: string[] | undefined, projection?: string[] | undefined, rowsPerPage?: number) => Promise<{
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
}[]>;
|
|
5
8
|
findAll: (collectionName: string, page?: number, sort?: string[] | undefined, projection?: string[] | undefined, rowsPerPage?: number) => Promise<{
|
|
6
9
|
[key: string]: string;
|
|
7
10
|
}[]>;
|
|
@@ -9,12 +9,15 @@ export function useMongocampSearch() {
|
|
|
9
9
|
const findRequest = (collection, searchParameter = mongoFindRequest(), rows = config.public.mongocamp?.paginationSize, actualPage = 1) => {
|
|
10
10
|
return { collectionName: collection, mongoFindRequest: searchParameter, rowsPerPage: rows, page: actualPage };
|
|
11
11
|
};
|
|
12
|
+
function find(collectionName, filter, page = 1, sort = void 0, projection = void 0, rowsPerPage = config.public.mongocamp?.paginationSize) {
|
|
13
|
+
return documentApi.listDocuments({ collectionName, filter, sort, projection, page, rowsPerPage });
|
|
14
|
+
}
|
|
12
15
|
function findAll(collectionName, page = 1, sort = void 0, projection = void 0, rowsPerPage = config.public.mongocamp?.paginationSize) {
|
|
13
|
-
return
|
|
16
|
+
return find(collectionName, void 0, page, sort, projection, rowsPerPage);
|
|
14
17
|
}
|
|
15
18
|
function findByField(collectionName, field, value, page = 1, sort = void 0, projection = void 0, rowsPerPage = config.public.mongocamp?.paginationSize) {
|
|
16
19
|
const expression = `${field}: ${value}`;
|
|
17
|
-
return
|
|
20
|
+
return find(collectionName, expression, page, sort, projection, rowsPerPage);
|
|
18
21
|
}
|
|
19
|
-
return { mongoFindRequest, findRequest, findAll, findByField };
|
|
22
|
+
return { mongoFindRequest, findRequest, find, findAll, findByField };
|
|
20
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/nuxt-mongocamp-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
"failOnWarn": false
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@nuxt/kit": "^3.10.
|
|
22
|
-
"@vueuse/nuxt": "^10.
|
|
21
|
+
"@nuxt/kit": "^3.10.3",
|
|
22
|
+
"@vueuse/nuxt": "^10.9.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@iconify-json/mdi": "^1.1.64",
|
|
26
26
|
"@nuxt/module-builder": "^0.5.5",
|
|
27
27
|
"@nuxtjs/eslint-config-typescript": "12.1.0",
|
|
28
28
|
"@openapitools/openapi-generator-cli": "^2.9.0",
|
|
29
|
-
"@types/node": "^20.11.
|
|
29
|
+
"@types/node": "^20.11.24",
|
|
30
30
|
"@unocss/nuxt": "^0.58.5",
|
|
31
31
|
"defu": "^6.1.4",
|
|
32
32
|
"jiti": "^1.21.0",
|
|
33
|
-
"nuxt": "^3.10.
|
|
33
|
+
"nuxt": "^3.10.3"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"dev": "nuxi dev playground",
|