@hostlink/nuxt-light 1.54.2 → 1.54.4

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,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.54.2",
4
+ "version": "1.54.4",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -358,7 +358,6 @@ const module$1 = defineNuxtModule({
358
358
  });
359
359
  addImports({ name: "isGranted", from: "@hostlink/light" });
360
360
  addImports({ name: "getGrantedRights", from: "@hostlink/light" });
361
- addImports({ name: "list", from: "@hostlink/light" });
362
361
  addImports({ name: "query", as: "q", from: "@hostlink/light" });
363
362
  addImports({ name: "mutation", from: "@hostlink/light" });
364
363
  addImports({ name: "query", from: "@hostlink/light" });
@@ -382,7 +381,6 @@ const module$1 = defineNuxtModule({
382
381
  export default defineNuxtPlugin({
383
382
  name: 'light-model-plugin',
384
383
  async setup (nuxtApp) {
385
-
386
384
  ${content}
387
385
  }
388
386
  })`
@@ -7,6 +7,7 @@ export type LightModelField = Omit<LTableColumn, "name" | "field"> & Field & {
7
7
  export interface LightModel {
8
8
  name: string;
9
9
  fields: Record<string, LightModelField>;
10
+ dataPath?: string;
10
11
  }
11
12
  declare const _default: (model: LightModel) => () => void;
12
13
  export default _default;
@@ -1,7 +1,9 @@
1
- import { getApiClient } from "@hostlink/light";
2
- const client = getApiClient();
1
+ import { defineModel } from "@hostlink/light";
3
2
  export default (model) => {
4
3
  return () => {
5
- client.models.create(model.name, model.fields);
4
+ const m = defineModel(model.name, model.fields);
5
+ if (model.dataPath) {
6
+ m.setDataPath(model.dataPath);
7
+ }
6
8
  };
7
9
  };
@@ -1,2 +1,2 @@
1
- declare const _default: (name: string, fields: string[]) => Record<string, any>;
1
+ declare const _default: (name: string, fields: string[]) => any;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: (name: string, field: string) => import("@hostlink/light").Field | null;
1
+ declare const _default: (name: string, field: string) => any;
2
2
  export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: (name: string, fields: Record<string, any>) => any;
2
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { getModel } from "@hostlink/light";
2
+ export default (name, fields) => {
3
+ return getModel(name).list(fields);
4
+ };
@@ -1,179 +1,2 @@
1
- import type { LTableColumn } from "../components/l-table.vue.js";
2
- declare const _default: (name: string) => Omit<{
3
- field: (f: string) => import("@hostlink/light").Field | null;
4
- $fields: Record<string, import("@hostlink/light").Field>;
5
- setDataPath(path: string): string;
6
- getDataPath(): string;
7
- gqlFields(fields: (string | object)[]): Record<string, any>;
8
- update(id: number, data: Object): Promise<any>;
9
- delete(id: number): Promise<any>;
10
- add(data: Object): Promise<any>;
11
- fields(fields: string[]): import("@hostlink/light").Field[];
12
- get(filters: any, fields: import("@hostlink/light").Fields): Promise<any>;
13
- list(fields: Record<string, any>): {
14
- fetch(): Promise<any[]>;
15
- fetchFirst(): Promise<any>;
16
- first(): Promise<any>;
17
- all(): Promise<any[]>;
18
- fetchWithMeta(): Promise<any>;
19
- dataPath(dataPath?: string): {
20
- first(): Promise<any>;
21
- all(): Promise<any[]>;
22
- fetchFirst(): Promise<any>;
23
- fetchWithMeta(): Promise<any>;
24
- fetch(): Promise<any[]>;
25
- dataPath(dataPath?: string): any;
26
- sort(sortStr: string): any;
27
- filters(filterObj: Record<string, any>): any;
28
- where(key: string, opOrVal?: any, maybeVal?: any): any;
29
- whereContains(field: string, val: any): any;
30
- whereIn(field: string, vals: any[]): any;
31
- whereBetween(field: string, min: any, max: any): any;
32
- limit(n: number): any;
33
- offset(n: number): any;
34
- toQuery(includeMeta?: boolean): any;
35
- };
36
- sort(sortStr: string): {
37
- first(): Promise<any>;
38
- all(): Promise<any[]>;
39
- fetchFirst(): Promise<any>;
40
- fetchWithMeta(): Promise<any>;
41
- fetch(): Promise<any[]>;
42
- dataPath(dataPath?: string): any;
43
- sort(sortStr: string): any;
44
- filters(filterObj: Record<string, any>): any;
45
- where(key: string, opOrVal?: any, maybeVal?: any): any;
46
- whereContains(field: string, val: any): any;
47
- whereIn(field: string, vals: any[]): any;
48
- whereBetween(field: string, min: any, max: any): any;
49
- limit(n: number): any;
50
- offset(n: number): any;
51
- toQuery(includeMeta?: boolean): any;
52
- };
53
- filters(filterObj: Record<string, any>): {
54
- first(): Promise<any>;
55
- all(): Promise<any[]>;
56
- fetchFirst(): Promise<any>;
57
- fetchWithMeta(): Promise<any>;
58
- fetch(): Promise<any[]>;
59
- dataPath(dataPath?: string): any;
60
- sort(sortStr: string): any;
61
- filters(filterObj: Record<string, any>): any;
62
- where(key: string, opOrVal?: any, maybeVal?: any): any;
63
- whereContains(field: string, val: any): any;
64
- whereIn(field: string, vals: any[]): any;
65
- whereBetween(field: string, min: any, max: any): any;
66
- limit(n: number): any;
67
- offset(n: number): any;
68
- toQuery(includeMeta?: boolean): any;
69
- };
70
- where(key: string, opOrVal?: any, maybeVal?: any): {
71
- first(): Promise<any>;
72
- all(): Promise<any[]>;
73
- fetchFirst(): Promise<any>;
74
- fetchWithMeta(): Promise<any>;
75
- fetch(): Promise<any[]>;
76
- dataPath(dataPath?: string): any;
77
- sort(sortStr: string): any;
78
- filters(filterObj: Record<string, any>): any;
79
- where(key: string, opOrVal?: any, maybeVal?: any): any;
80
- whereContains(field: string, val: any): any;
81
- whereIn(field: string, vals: any[]): any;
82
- whereBetween(field: string, min: any, max: any): any;
83
- limit(n: number): any;
84
- offset(n: number): any;
85
- toQuery(includeMeta?: boolean): any;
86
- };
87
- whereContains(field: string, val: any): {
88
- first(): Promise<any>;
89
- all(): Promise<any[]>;
90
- fetchFirst(): Promise<any>;
91
- fetchWithMeta(): Promise<any>;
92
- fetch(): Promise<any[]>;
93
- dataPath(dataPath?: string): any;
94
- sort(sortStr: string): any;
95
- filters(filterObj: Record<string, any>): any;
96
- where(key: string, opOrVal?: any, maybeVal?: any): any;
97
- whereContains(field: string, val: any): any;
98
- whereIn(field: string, vals: any[]): any;
99
- whereBetween(field: string, min: any, max: any): any;
100
- limit(n: number): any;
101
- offset(n: number): any;
102
- toQuery(includeMeta?: boolean): any;
103
- };
104
- whereIn(field: string, vals: any[]): {
105
- first(): Promise<any>;
106
- all(): Promise<any[]>;
107
- fetchFirst(): Promise<any>;
108
- fetchWithMeta(): Promise<any>;
109
- fetch(): Promise<any[]>;
110
- dataPath(dataPath?: string): any;
111
- sort(sortStr: string): any;
112
- filters(filterObj: Record<string, any>): any;
113
- where(key: string, opOrVal?: any, maybeVal?: any): any;
114
- whereContains(field: string, val: any): any;
115
- whereIn(field: string, vals: any[]): any;
116
- whereBetween(field: string, min: any, max: any): any;
117
- limit(n: number): any;
118
- offset(n: number): any;
119
- toQuery(includeMeta?: boolean): any;
120
- };
121
- whereBetween(field: string, min: any, max: any): {
122
- first(): Promise<any>;
123
- all(): Promise<any[]>;
124
- fetchFirst(): Promise<any>;
125
- fetchWithMeta(): Promise<any>;
126
- fetch(): Promise<any[]>;
127
- dataPath(dataPath?: string): any;
128
- sort(sortStr: string): any;
129
- filters(filterObj: Record<string, any>): any;
130
- where(key: string, opOrVal?: any, maybeVal?: any): any;
131
- whereContains(field: string, val: any): any;
132
- whereIn(field: string, vals: any[]): any;
133
- whereBetween(field: string, min: any, max: any): any;
134
- limit(n: number): any;
135
- offset(n: number): any;
136
- toQuery(includeMeta?: boolean): any;
137
- };
138
- limit(n: number): {
139
- first(): Promise<any>;
140
- all(): Promise<any[]>;
141
- fetchFirst(): Promise<any>;
142
- fetchWithMeta(): Promise<any>;
143
- fetch(): Promise<any[]>;
144
- dataPath(dataPath?: string): any;
145
- sort(sortStr: string): any;
146
- filters(filterObj: Record<string, any>): any;
147
- where(key: string, opOrVal?: any, maybeVal?: any): any;
148
- whereContains(field: string, val: any): any;
149
- whereIn(field: string, vals: any[]): any;
150
- whereBetween(field: string, min: any, max: any): any;
151
- limit(n: number): any;
152
- offset(n: number): any;
153
- toQuery(includeMeta?: boolean): any;
154
- };
155
- offset(n: number): {
156
- first(): Promise<any>;
157
- all(): Promise<any[]>;
158
- fetchFirst(): Promise<any>;
159
- fetchWithMeta(): Promise<any>;
160
- fetch(): Promise<any[]>;
161
- dataPath(dataPath?: string): any;
162
- sort(sortStr: string): any;
163
- filters(filterObj: Record<string, any>): any;
164
- where(key: string, opOrVal?: any, maybeVal?: any): any;
165
- whereContains(field: string, val: any): any;
166
- whereIn(field: string, vals: any[]): any;
167
- whereBetween(field: string, min: any, max: any): any;
168
- limit(n: number): any;
169
- offset(n: number): any;
170
- toQuery(includeMeta?: boolean): any;
171
- };
172
- toQuery(includeMeta?: boolean): any;
173
- };
174
- }, never> & Omit<{
175
- columns(fields: string[] | {
176
- [key: string]: boolean;
177
- }): Array<LTableColumn>;
178
- }, never> & {};
1
+ declare const _default: (name: string) => any;
179
2
  export default _default;
@@ -1,8 +1,7 @@
1
- import { getApiClient } from "@hostlink/light";
1
+ import { getModel } from "@hostlink/light";
2
2
  import defu from "defu";
3
3
  export default (name) => {
4
- const client = getApiClient();
5
- const m = client.model(name);
4
+ const m = getModel(name);
6
5
  return defu(m, {
7
6
  columns(fields) {
8
7
  let columns = [];
@@ -1,6 +1,7 @@
1
1
  import { defineLightModel } from "#imports";
2
2
  export default defineLightModel({
3
3
  name: "EventLog",
4
+ dataPath: "app.listEventLog",
4
5
  fields: {
5
6
  eventlog_id: {
6
7
  label: "EventLog ID",
@@ -1,6 +1,7 @@
1
1
  import { defineLightModel } from "#imports";
2
2
  export default defineLightModel({
3
3
  name: "MailLog",
4
+ dataPath: "app.listMailLog",
4
5
  fields: {
5
6
  maillog_id: {
6
7
  label: "ID",
@@ -1,6 +1,7 @@
1
1
  import { defineLightModel } from "#imports";
2
2
  export default defineLightModel({
3
3
  name: "User",
4
+ dataPath: "app.listUser",
4
5
  fields: {
5
6
  Name: {
6
7
  label: "Name",
@@ -17,16 +18,6 @@ export default defineLightModel({
17
18
  sortable: true,
18
19
  searchable: true,
19
20
  required: true
20
- //cellClass: (row: any) => (row.username == "admin" ? "text-danger" : ""),
21
- /* backgroundColor: (row: any) => {
22
-
23
-
24
- if (row.username == "admin") {
25
- return "red";
26
- } else {
27
- return "white";
28
- }
29
- } */
30
21
  },
31
22
  first_name: {
32
23
  label: "First name",
@@ -67,7 +58,7 @@ export default defineLightModel({
67
58
  { label: "Inactive", value: 1 }
68
59
  ],
69
60
  format: (value) => {
70
- return ["Active", "Inactive"][value];
61
+ return value == 0 ? "Active" : "Inactive";
71
62
  }
72
63
  },
73
64
  has2FA: {
@@ -1,4 +1,4 @@
1
1
  import '@quasar/quasar-ui-qmarkdown/dist/index.css';
2
2
  import "./assets/main.css.js";
3
- declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
3
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
4
4
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import QMarkdownVuePlugin from "@quasar/quasar-ui-qmarkdown";
2
2
  import "@quasar/quasar-ui-qmarkdown/dist/index.css";
3
- import { createClient, setApiClient } from "@hostlink/light";
3
+ import { createClient, setApiClient, defineModel } from "@hostlink/light";
4
4
  import { q } from "#imports";
5
5
  import { createI18n } from "vue-i18n";
6
6
  import createLight from "./composables/createLight.js";
@@ -38,6 +38,9 @@ export default defineNuxtPlugin((nuxtApp) => {
38
38
  }, { global: true });
39
39
  const client = createClient(getApiBase());
40
40
  setApiClient(client);
41
+ defineModel("Permission", {}).setDataPath("app.listPermission");
42
+ defineModel("SystemValue", {}).setDataPath("app.listSystemValue");
43
+ defineModel("Config", {}).setDataPath("app.listConfig");
41
44
  nuxtApp.vueApp.config.errorHandler = (err, instance, info) => {
42
45
  const $route = useRoute();
43
46
  const light = useLight();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.54.2",
3
+ "version": "1.54.4",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@azure/msal-browser": "^4.26.2",
34
34
  "@formkit/drag-and-drop": "^0.5.3",
35
- "@hostlink/light": "^3.0.1",
35
+ "@hostlink/light": "^3.0.5",
36
36
  "@nuxt/module-builder": "^1.0.1",
37
37
  "@quasar/extras": "^1.17.0",
38
38
  "@quasar/quasar-ui-qmarkdown": "^2.0.5",
@@ -54,7 +54,7 @@
54
54
  "@nuxt/schema": "^4.2.1",
55
55
  "@nuxt/test-utils": "^3.17.2",
56
56
  "@types/node": "^24.10.1",
57
- "changelogen": "^0.5.4",
57
+ "changelogen": "^0.5.7",
58
58
  "eslint": "^9.39.1",
59
59
  "nuxt": "^4.2.1",
60
60
  "typescript": "^5.9.2",
@@ -1,2 +0,0 @@
1
- declare const _default: () => void;
2
- export default _default;
@@ -1,14 +0,0 @@
1
- import { defineLightModel } from "#imports";
2
- export default defineLightModel({
3
- name: "SystemValue",
4
- fields: {
5
- name: {
6
- label: "Name",
7
- sortable: true,
8
- searchable: true
9
- },
10
- value: {
11
- label: "Value"
12
- }
13
- }
14
- });