@sfxcode/nuxt-mongocamp-server 1.4.3 → 1.5.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 +63 -0
- package/dist/module.d.mts +16 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +20 -642
- package/dist/runtime/composables/mongocampApi.d.ts +11 -22
- package/dist/runtime/composables/mongocampApi.js +4 -37
- package/dist/runtime/composables/mongocampApiAdmin.d.ts +15 -0
- package/dist/runtime/composables/mongocampApiAdmin.js +41 -0
- package/dist/runtime/composables/mongocampApiCollection.d.ts +26 -0
- package/dist/runtime/composables/mongocampApiCollection.js +40 -0
- package/dist/runtime/composables/mongocampApiCollections.d.ts +8 -0
- package/dist/runtime/composables/mongocampApiCollections.js +23 -0
- package/dist/runtime/composables/mongocampApiFiles.d.ts +14 -0
- package/dist/runtime/composables/mongocampApiFiles.js +38 -0
- package/dist/runtime/composables/mongocampApiJobs.d.ts +9 -0
- package/dist/runtime/composables/mongocampApiJobs.js +23 -0
- package/dist/runtime/composables/mongocampAuth.js +30 -20
- package/dist/runtime/composables/mongocampSearch.d.ts +23 -1
- package/dist/runtime/composables/mongocampSearch.js +34 -1
- package/dist/runtime/composables/mongocampStorage.d.ts +3 -2
- package/dist/runtime/composables/mongocampStorage.js +4 -3
- package/dist/runtime/composables/mongocampUser.js +1 -1
- package/dist/runtime/server/composables/mongocampApi.d.ts +14 -0
- package/dist/runtime/server/composables/mongocampApi.js +8 -0
- package/dist/runtime/server/composables/mongocampServerApi.d.ts +11 -12
- package/dist/runtime/server/composables/mongocampServerApi.js +4 -39
- package/dist/runtime/utils/buildFieldFilterExpression.d.ts +2 -0
- package/dist/runtime/utils/buildFieldFilterExpression.js +7 -0
- package/dist/runtime/utils/createMongocampApis.d.ts +15 -0
- package/dist/runtime/utils/createMongocampApis.js +28 -0
- package/dist/runtime/utils/toMongocampError.d.ts +7 -0
- package/dist/runtime/utils/toMongocampError.js +19 -0
- package/dist/types.d.mts +1 -1
- package/package.json +10 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AdminApi,
|
|
3
|
+
ApplicationApi,
|
|
4
|
+
AuthApi,
|
|
5
|
+
BucketApi,
|
|
6
|
+
CollectionApi,
|
|
7
|
+
DatabaseApi,
|
|
8
|
+
DocumentApi,
|
|
9
|
+
FileApi,
|
|
10
|
+
IndexApi,
|
|
11
|
+
InformationApi,
|
|
12
|
+
JobsApi
|
|
13
|
+
} from "../api/index.js";
|
|
14
|
+
export function createMongocampApis(configuration) {
|
|
15
|
+
return {
|
|
16
|
+
adminApi: new AdminApi(configuration),
|
|
17
|
+
applicationApi: new ApplicationApi(configuration),
|
|
18
|
+
authApi: new AuthApi(configuration),
|
|
19
|
+
bucketApi: new BucketApi(configuration),
|
|
20
|
+
collectionApi: new CollectionApi(configuration),
|
|
21
|
+
databaseApi: new DatabaseApi(configuration),
|
|
22
|
+
documentApi: new DocumentApi(configuration),
|
|
23
|
+
fileApi: new FileApi(configuration),
|
|
24
|
+
indexApi: new IndexApi(configuration),
|
|
25
|
+
informationApi: new InformationApi(configuration),
|
|
26
|
+
jobApi: new JobsApi(configuration)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResponseError } from "../api/index.js";
|
|
2
|
+
export async function toMongocampError(error) {
|
|
3
|
+
if (error instanceof ResponseError) {
|
|
4
|
+
const status = error.response.status;
|
|
5
|
+
let message = `Request failed with status ${status}`;
|
|
6
|
+
let additionalInfo;
|
|
7
|
+
try {
|
|
8
|
+
const body = await error.response.clone().json();
|
|
9
|
+
if (body?.msg)
|
|
10
|
+
message = body.msg;
|
|
11
|
+
additionalInfo = body?.additionalInfo;
|
|
12
|
+
} catch {
|
|
13
|
+
}
|
|
14
|
+
return { status, message, additionalInfo, cause: error };
|
|
15
|
+
}
|
|
16
|
+
if (error instanceof Error)
|
|
17
|
+
return { message: error.message, cause: error };
|
|
18
|
+
return { message: String(error), cause: error };
|
|
19
|
+
}
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/nuxt-mongocamp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./dist/types.d.mts",
|
|
9
9
|
"import": "./dist/module.mjs"
|
|
10
|
+
},
|
|
11
|
+
"./api": {
|
|
12
|
+
"types": "./dist/runtime/api/index.d.ts",
|
|
13
|
+
"import": "./dist/runtime/api/index.js"
|
|
10
14
|
}
|
|
11
15
|
},
|
|
12
16
|
"main": "./dist/module.mjs",
|
|
@@ -28,7 +32,7 @@
|
|
|
28
32
|
"dev": "nuxi dev playground",
|
|
29
33
|
"dev:build": "nuxi build playground",
|
|
30
34
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
31
|
-
"release": "npm run lint && npm run test && npm run prepack && changelogen --
|
|
35
|
+
"release": "npm run lint && npm run test && npm run prepack && changelogen --minor --release && npm publish --access public && git push --follow-tags",
|
|
32
36
|
"lint": "eslint .",
|
|
33
37
|
"lint:fix": "eslint --fix .",
|
|
34
38
|
"test": "vitest run",
|
|
@@ -40,7 +44,9 @@
|
|
|
40
44
|
},
|
|
41
45
|
"dependencies": {
|
|
42
46
|
"@nuxt/kit": "^4.4.8",
|
|
43
|
-
"@vueuse/nuxt": "^14.3.0"
|
|
47
|
+
"@vueuse/nuxt": "^14.3.0",
|
|
48
|
+
"consola": "^3.4.2",
|
|
49
|
+
"defu": "^6.1.7"
|
|
44
50
|
},
|
|
45
51
|
"devDependencies": {
|
|
46
52
|
"@nuxt/devtools": "4.0.0-alpha.7",
|
|
@@ -48,7 +54,7 @@
|
|
|
48
54
|
"@nuxt/module-builder": "^1.0.2",
|
|
49
55
|
"@nuxt/schema": "^4.4.8",
|
|
50
56
|
"@nuxt/test-utils": "^4.0.3",
|
|
51
|
-
"@openapitools/openapi-generator-cli": "^2.
|
|
57
|
+
"@openapitools/openapi-generator-cli": "^2.39.0",
|
|
52
58
|
"@types/node": "^26.0.0",
|
|
53
59
|
"@unocss/nuxt": "66.7.2",
|
|
54
60
|
"changelogen": "^0.6.2",
|