@hostlink/nuxt-light 0.0.61 → 0.0.63
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 +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.mjs +1 -20
- package/dist/runtime/lib/getObject.mjs +2 -8
- package/dist/runtime/lib/index.d.ts +2 -2
- package/dist/runtime/lib/index.mjs +3 -3
- package/dist/runtime/lib/listData.mjs +3 -18
- package/dist/runtime/lib/loadObject.d.ts +1 -0
- package/dist/runtime/lib/loadObject.mjs +10 -0
- package/dist/runtime/pages/User/_user_id/view.vue +8 -2
- package/package.json +2 -2
- package/dist/runtime/lib/id.d.ts +0 -2
- package/dist/runtime/lib/id.mjs +0 -12
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -42,7 +42,7 @@ const module = defineNuxtModule({
|
|
|
42
42
|
{ name: "getApiUrl", from },
|
|
43
43
|
{ name: "getCurrentUser", from },
|
|
44
44
|
{ name: "getObject", from },
|
|
45
|
-
{ name: "
|
|
45
|
+
{ name: "loadObject", from },
|
|
46
46
|
{ name: "list", from },
|
|
47
47
|
{ name: "listData", from },
|
|
48
48
|
{ name: "m", from },
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ interface Light {
|
|
|
7
7
|
getVersion(): string;
|
|
8
8
|
}
|
|
9
9
|
export declare function useLight(): Light;
|
|
10
|
-
export
|
|
10
|
+
export * from "./lib";
|
package/dist/runtime/index.mjs
CHANGED
|
@@ -29,23 +29,4 @@ export function useLight() {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
export
|
|
33
|
-
notify,
|
|
34
|
-
addObject,
|
|
35
|
-
f,
|
|
36
|
-
getApiUrl,
|
|
37
|
-
getCurrentUser,
|
|
38
|
-
getObject,
|
|
39
|
-
id,
|
|
40
|
-
list,
|
|
41
|
-
listData,
|
|
42
|
-
m,
|
|
43
|
-
q,
|
|
44
|
-
removeObject,
|
|
45
|
-
t,
|
|
46
|
-
updateObject,
|
|
47
|
-
getID,
|
|
48
|
-
deleteObject,
|
|
49
|
-
listObject,
|
|
50
|
-
getApiBase
|
|
51
|
-
} from "./lib/index.mjs";
|
|
32
|
+
export * from "./lib/index.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRoute } from "vue-router";
|
|
2
|
-
import
|
|
2
|
+
import loadObject from "./loadObject.mjs";
|
|
3
3
|
export default async function(fields = []) {
|
|
4
4
|
let route = useRoute();
|
|
5
5
|
if (!route.name) {
|
|
@@ -12,11 +12,5 @@ export default async function(fields = []) {
|
|
|
12
12
|
if (fields instanceof Array && fields.length == 0) {
|
|
13
13
|
fields.push(id_name);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
filters
|
|
17
|
-
}, fields);
|
|
18
|
-
if (data.length > 0) {
|
|
19
|
-
return data[0];
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
15
|
+
return await loadObject(module, filters, fields);
|
|
22
16
|
}
|
|
@@ -3,7 +3,6 @@ import f from "./f";
|
|
|
3
3
|
import getApiUrl from "./getApiUrl";
|
|
4
4
|
import getCurrentUser from "./getCurrentUser";
|
|
5
5
|
import getObject from "./getObject";
|
|
6
|
-
import id from "./id";
|
|
7
6
|
import list from "./list";
|
|
8
7
|
import listData from "./listData";
|
|
9
8
|
import m from "./m";
|
|
@@ -13,8 +12,9 @@ import deleteObject from "./deleteObject";
|
|
|
13
12
|
import t from "./t";
|
|
14
13
|
import updateObject from "./updateObject";
|
|
15
14
|
import listObject from "./listObject";
|
|
15
|
+
import loadObject from "./loadObject";
|
|
16
16
|
import isGranted from "./isGranted";
|
|
17
17
|
declare const notify: (message: string, color?: string) => void;
|
|
18
18
|
import getID from "./getID";
|
|
19
19
|
declare const getApiBase: () => {};
|
|
20
|
-
export { addObject, f, getApiUrl, getCurrentUser, getObject,
|
|
20
|
+
export { addObject, f, getApiUrl, getCurrentUser, getObject, list, listData, m, q, removeObject, t, updateObject, notify, getID, deleteObject, listObject, isGranted, getApiBase, loadObject };
|
|
@@ -5,7 +5,6 @@ import f from "./f.mjs";
|
|
|
5
5
|
import getApiUrl from "./getApiUrl.mjs";
|
|
6
6
|
import getCurrentUser from "./getCurrentUser.mjs";
|
|
7
7
|
import getObject from "./getObject.mjs";
|
|
8
|
-
import id from "./id.mjs";
|
|
9
8
|
import list from "./list.mjs";
|
|
10
9
|
import listData from "./listData.mjs";
|
|
11
10
|
import m from "./m.mjs";
|
|
@@ -15,6 +14,7 @@ import deleteObject from "./deleteObject.mjs";
|
|
|
15
14
|
import t from "./t.mjs";
|
|
16
15
|
import updateObject from "./updateObject.mjs";
|
|
17
16
|
import listObject from "./listObject.mjs";
|
|
17
|
+
import loadObject from "./loadObject.mjs";
|
|
18
18
|
import isGranted from "./isGranted.mjs";
|
|
19
19
|
const notify = function(message, color = "green") {
|
|
20
20
|
Notify.create({
|
|
@@ -34,7 +34,6 @@ export {
|
|
|
34
34
|
getApiUrl,
|
|
35
35
|
getCurrentUser,
|
|
36
36
|
getObject,
|
|
37
|
-
id,
|
|
38
37
|
list,
|
|
39
38
|
listData,
|
|
40
39
|
m,
|
|
@@ -47,5 +46,6 @@ export {
|
|
|
47
46
|
deleteObject,
|
|
48
47
|
listObject,
|
|
49
48
|
isGranted,
|
|
50
|
-
getApiBase
|
|
49
|
+
getApiBase,
|
|
50
|
+
loadObject
|
|
51
51
|
};
|
|
@@ -18,24 +18,9 @@ export default async function listData(name, props = {}, fields = []) {
|
|
|
18
18
|
json.data.__args = json.data.__args || {};
|
|
19
19
|
json.data.__args.limit = props.limit;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Object.entries(field).forEach(([key, value]) => {
|
|
25
|
-
json.data[key] = toQuery(value);
|
|
26
|
-
});
|
|
27
|
-
} else {
|
|
28
|
-
json.data[field] = true;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
} else if (fields instanceof Object) {
|
|
32
|
-
json.data = Object.assign({}, fields);
|
|
33
|
-
if (props.fields) {
|
|
34
|
-
props.fields.forEach((field) => {
|
|
35
|
-
json.data[field] = true;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
21
|
+
Object.entries(toQuery(fields)).forEach(([key, value]) => {
|
|
22
|
+
json.data[key] = value;
|
|
23
|
+
});
|
|
39
24
|
json.meta = {
|
|
40
25
|
total: true,
|
|
41
26
|
key: true,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (module: string, filters: Object, fields?: Array<string | Object>): Promise<any>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { getObject } from '../../../';
|
|
3
|
-
const obj = await getObject(["username", "first_name", "last_name", "email", "phone", "roles"]);
|
|
2
|
+
import { getObject, loadObject } from '../../../';
|
|
3
|
+
const obj = await getObject(["user_id", "username", "first_name", "last_name", "email", "phone", "roles"]);
|
|
4
|
+
|
|
5
|
+
//await getObject(["user_id", { test: ["username"] }])
|
|
6
|
+
/* const test = async () => {
|
|
7
|
+
console.log(await loadObject("User", { user_id: obj.user_id }, ["username"]));
|
|
8
|
+
}
|
|
9
|
+
*/
|
|
4
10
|
|
|
5
11
|
</script>
|
|
6
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostlink/nuxt-light",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.63",
|
|
4
4
|
"description": "HostLink Nuxt Light Framework",
|
|
5
5
|
"repository": "@hostlink/nuxt-light",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"route-gen": "node route-generate.mjs"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@hostlink/light": "^0.0.
|
|
37
|
+
"@hostlink/light": "^0.0.16",
|
|
38
38
|
"@nuxt/kit": "^3.7.0",
|
|
39
39
|
"@quasar/extras": "^1.16.6",
|
|
40
40
|
"axios": "^1.5.0",
|
package/dist/runtime/lib/id.d.ts
DELETED
package/dist/runtime/lib/id.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useRoute } from "vue-router";
|
|
2
|
-
const route = useRoute();
|
|
3
|
-
export default () => {
|
|
4
|
-
let name = route.name?.toString();
|
|
5
|
-
if (name == void 0)
|
|
6
|
-
return 0;
|
|
7
|
-
let parts = name.split("-");
|
|
8
|
-
const module = parts[0];
|
|
9
|
-
const moduleLower = module.charAt(0).toLowerCase() + module.slice(1);
|
|
10
|
-
const keyname = parts[1];
|
|
11
|
-
return parseInt(route.params[keyname]);
|
|
12
|
-
};
|