@hostlink/nuxt-light 0.0.103 → 0.0.104

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
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "0.0.103"
4
+ "version": "0.0.104"
5
5
  }
package/dist/module.mjs CHANGED
@@ -59,7 +59,8 @@ const module = defineNuxtModule({
59
59
  { name: "getModelColumns", from },
60
60
  { name: "getModelFields", from },
61
61
  { name: "getModelField", from },
62
- { name: "getGQLFields", from }
62
+ { name: "getGQLFields", from },
63
+ { name: "model", from }
63
64
  ]);
64
65
  addPlugin({
65
66
  src: resolver.resolve("./runtime/plugin"),
@@ -18,8 +18,9 @@ import getModelField from './getModelField';
18
18
  import getModelFields from './getModelFields';
19
19
  import getModelColumns from './getModelColumns';
20
20
  import sv from './sv';
21
+ import model from './model';
21
22
  declare const notify: (message: string, color?: string) => void;
22
23
  import getID from "./getID";
23
24
  declare const getApiBase: () => {};
24
25
  import { getGQLFields } from '@hostlink/light';
25
- export { addObject, f, getApiUrl, getCurrentUser, getObject, list, m, q, removeObject, t, updateObject, notify, getID, deleteObject, listObject, isGranted, getApiBase, loadObject, GQLFieldBuilder, getModelField, getModelFields, getModelColumns, getGQLFields, sv };
26
+ export { addObject, f, getApiUrl, getCurrentUser, getObject, list, m, q, removeObject, t, updateObject, notify, getID, deleteObject, listObject, isGranted, getApiBase, loadObject, GQLFieldBuilder, getModelField, getModelFields, getModelColumns, getGQLFields, sv, model };
@@ -20,6 +20,7 @@ import getModelField from "./getModelField.mjs";
20
20
  import getModelFields from "./getModelFields.mjs";
21
21
  import getModelColumns from "./getModelColumns.mjs";
22
22
  import sv from "./sv.mjs";
23
+ import model from "./model.mjs";
23
24
  const notify = function(message, color = "green") {
24
25
  Notify.create({
25
26
  message,
@@ -57,5 +58,6 @@ export {
57
58
  getModelFields,
58
59
  getModelColumns,
59
60
  getGQLFields,
60
- sv
61
+ sv,
62
+ model
61
63
  };
@@ -0,0 +1,5 @@
1
+ declare const _default: (name: string) => {
2
+ get(filters: any, fields: Array<string | object>): Promise<any>;
3
+ list(filters: any, fields: Array<string | object>): Promise<any>;
4
+ };
5
+ export default _default;
@@ -0,0 +1,35 @@
1
+ import { toQuery, query } from "@hostlink/light";
2
+ export default (name) => {
3
+ const _name = name;
4
+ return {
5
+ async get(filters, fields) {
6
+ const resp = await query({
7
+ ["list" + _name]: {
8
+ __args: {
9
+ filters
10
+ },
11
+ data: {
12
+ __args: {
13
+ limit: 1
14
+ },
15
+ ...toQuery(fields)
16
+ }
17
+ }
18
+ });
19
+ return resp["list" + _name]["data"][0];
20
+ },
21
+ async list(filters, fields) {
22
+ const resp = await query({
23
+ ["list" + _name]: {
24
+ __args: {
25
+ filters
26
+ },
27
+ data: {
28
+ ...toQuery(fields)
29
+ }
30
+ }
31
+ });
32
+ return resp["list" + _name]["data"];
33
+ }
34
+ };
35
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "0.0.103",
3
+ "version": "0.0.104",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",