@hostlink/nuxt-light 1.13.5 → 1.13.6

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.d.mts CHANGED
@@ -2,6 +2,6 @@ import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
4
  }
5
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
5
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
6
 
7
7
  export { type ModuleOptions, _default as default };
package/dist/module.d.ts CHANGED
@@ -2,6 +2,6 @@ import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
4
  }
5
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
5
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
6
 
7
7
  export { type ModuleOptions, _default as default };
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.13.5"
4
+ "version": "1.13.6"
5
5
  }
package/dist/module.mjs CHANGED
@@ -282,7 +282,6 @@ const module = defineNuxtModule({
282
282
  { name: "q", from },
283
283
  { name: "removeObject", from },
284
284
  { name: "t", from },
285
- { name: "updateObject", from },
286
285
  { name: "listObject", from },
287
286
  { name: "useLight", from: index },
288
287
  { name: "isGranted", from },
@@ -1,14 +1,11 @@
1
1
  <script setup>
2
2
  import { provide, ref } from 'vue'
3
3
  import { useLight, watch } from "#imports";
4
- import { useRuntimeConfig } from 'nuxt/app'
5
4
 
6
5
  import { useQuasar } from 'quasar'
7
6
  import { q } from '#imports'
8
7
  import { useRoute } from "vue-router";
9
- /* const config = useRuntimeConfig();
10
- setApiUrl(config?.public?.apiBase ?? '/api/');
11
- */
8
+
12
9
  const route = useRoute();
13
10
  const light = useLight()
14
11
  const quasar = useQuasar()
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { type QBannerProps } from 'quasar'
2
+ import type { QBannerProps } from 'quasar'
3
3
  import { computed, useSlots } from 'vue'
4
4
 
5
- export interface LBannerProps extends QBannerProps {
5
+ export type LBannerProps = QBannerProps & {
6
6
  icon?: string
7
7
  type?: 'primary' | 'secondary' | 'accent' | 'dark' | 'positive' | 'negative' | 'info' | 'warning'
8
8
  }
@@ -31,7 +31,8 @@ const slots = computed(() => useSlots());
31
31
  </script>
32
32
 
33
33
  <template>
34
- <q-banner v-bind="props" :class="classes">
34
+ <q-banner v-bind="$props" :class="classes">
35
+
35
36
  <template v-slot:avatar v-if="localIcon">
36
37
  <q-icon :name="localIcon" />
37
38
  </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@hostlink/light").LightClient;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { createClient } from "@hostlink/light";
2
+ export default createClient("");
@@ -1,5 +1,5 @@
1
1
  import { defineNuxtPlugin } from "#app";
2
- import { api } from "./index.mjs";
2
+ import { default as api } from "./api.mjs";
3
3
  export default (model) => {
4
4
  return defineNuxtPlugin(() => {
5
5
  api.models.create(model.name, model.fields);
@@ -1,2 +1,2 @@
1
- declare const _default: (name: string, fields: string[]) => any;
1
+ declare const _default: (name: string, fields: string[]) => any[];
2
2
  export default _default;
@@ -1,12 +1,4 @@
1
- import GQLFieldBuilder from "./GQLFieldBuilder.mjs";
2
1
  import { api } from "./index.mjs";
3
2
  export default (name, fields) => {
4
- const builder = GQLFieldBuilder();
5
- fields.forEach((field) => {
6
- const modelField = api.model(name).field(field);
7
- if (modelField) {
8
- builder.add(modelField.getGQLField());
9
- }
10
- });
11
- return builder.get();
3
+ return api.model(name).gqlFields(fields);
12
4
  };
@@ -1,4 +1,4 @@
1
- import { getModelField } from "./index.mjs";
1
+ import { default as getModelField } from "./getModelField.mjs";
2
2
  export default (model, names) => {
3
3
  let columns = [];
4
4
  for (let name of names) {
@@ -1,4 +1,4 @@
1
- import { api } from "./index.mjs";
1
+ import { default as api } from "./api.mjs";
2
2
  export default (name, field) => {
3
3
  return api.model(name).field(field);
4
4
  };
@@ -1,4 +1,4 @@
1
- import { getModelField } from "./index.mjs";
1
+ import { default as getModelField } from "./getModelField.mjs";
2
2
  export default (model, names) => {
3
3
  let fields = [];
4
4
  for (let name of names) {
@@ -1,6 +1,6 @@
1
1
  import { useRoute } from "vue-router";
2
2
  import loadObject from "./loadObject.mjs";
3
- import { getModelField } from "./index.mjs";
3
+ import { default as getModelField } from "./getModelField.mjs";
4
4
  export default async function(fields = []) {
5
5
  let route = useRoute();
6
6
  if (!route.name) {
@@ -1,4 +1,4 @@
1
- import type { LightClient } from '@hostlink/light';
1
+ export { default as api } from "./api";
2
2
  export { default as f } from "./f";
3
3
  export { default as getApiUrl } from "./getApiUrl";
4
4
  export { default as getCurrentUser } from "./getCurrentUser";
@@ -7,7 +7,6 @@ export { default as list } from "./list";
7
7
  export { default as m } from "./m";
8
8
  export { default as q } from "./q";
9
9
  export { default as t } from "./t";
10
- export { default as updateObject } from "./updateObject";
11
10
  export { default as listObject } from "./listObject";
12
11
  export { default as loadObject } from "./loadObject";
13
12
  export { default as isGranted } from "./isGranted";
@@ -23,5 +22,4 @@ export declare const notify: (message: string, color?: string) => void;
23
22
  export { default as getID } from "./getID";
24
23
  export { default as id } from "./getID";
25
24
  export declare const getApiBase: () => {};
26
- export declare const api: LightClient;
27
- export declare const getGQLFields: (name: string, fields: string[]) => any[];
25
+ export { default as getGQLFields } from "./getGQLFields";
@@ -1,6 +1,6 @@
1
1
  import { useRuntimeConfig } from "nuxt/app";
2
2
  import { Notify } from "quasar";
3
- import { createClient } from "@hostlink/light";
3
+ export { default as api } from "./api.mjs";
4
4
  export { default as f } from "./f.mjs";
5
5
  export { default as getApiUrl } from "./getApiUrl.mjs";
6
6
  export { default as getCurrentUser } from "./getCurrentUser.mjs";
@@ -9,7 +9,6 @@ export { default as list } from "./list.mjs";
9
9
  export { default as m } from "./m.mjs";
10
10
  export { default as q } from "./q.mjs";
11
11
  export { default as t } from "./t.mjs";
12
- export { default as updateObject } from "./updateObject.mjs";
13
12
  export { default as listObject } from "./listObject.mjs";
14
13
  export { default as loadObject } from "./loadObject.mjs";
15
14
  export { default as isGranted } from "./isGranted.mjs";
@@ -33,7 +32,4 @@ export const getApiBase = () => {
33
32
  const config = useRuntimeConfig();
34
33
  return config?.public?.apiBase ?? "/api/";
35
34
  };
36
- export const api = createClient("");
37
- export const getGQLFields = (name, fields) => {
38
- return api.model(name).gqlFields(fields);
39
- };
35
+ export { default as getGQLFields } from "./getGQLFields.mjs";
@@ -1,5 +1,5 @@
1
1
  import { toQuery } from "@hostlink/light";
2
- import { api } from "./index.mjs";
2
+ import { default as api } from "./api.mjs";
3
3
  export default async function list(name, props = null, fields = []) {
4
4
  let q = {};
5
5
  if (props) {
@@ -1,2 +1,2 @@
1
- import { type Fields } from "@hostlink/light";
1
+ import type { Fields } from "@hostlink/light";
2
2
  export default function listObject(name: string, filters: {} | undefined, sort: string, offset: number, limit: number, fields?: Fields): Promise<any>;
@@ -1,4 +1,4 @@
1
- import { api } from "./index.mjs";
1
+ import { default as api } from "./api.mjs";
2
2
  export default function(operation, args, fields = []) {
3
3
  return api.mutation(operation, args, fields);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { api } from ".";
1
+ import { default as api } from "./api";
2
2
  import type { LTableColumn } from "../components/l-table.vue";
3
3
  interface LModel extends ReturnType<typeof api.model> {
4
4
  columns(fields: string[]): Array<LTableColumn>;
@@ -1,4 +1,4 @@
1
- import { api } from "./index.mjs";
1
+ import { default as api } from "./api.mjs";
2
2
  export default (name) => {
3
3
  const m = api.model(name);
4
4
  return Object.assign(m, {
@@ -1,4 +1,4 @@
1
- import { api } from "./index.mjs";
1
+ import { default as api } from "./api.mjs";
2
2
  export const cache = {};
3
3
  export default (name) => {
4
4
  if (cache[name]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.13.5",
3
+ "version": "1.13.6",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- declare const _default: (name: string, id: number, data: Object) => Promise<any>;
2
- export default _default;
@@ -1,12 +0,0 @@
1
- import m from "./m.mjs";
2
- import { Dialog } from "quasar";
3
- export default async (name, id, data) => {
4
- try {
5
- return await m(`update${name}`, { id, data });
6
- } catch (e) {
7
- Dialog.create({
8
- title: "Error",
9
- message: e.message
10
- });
11
- }
12
- };