@sfxcode/nuxt-mongocamp-server 0.7.1 → 0.7.3

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
- "name": "nuxt-mongocamp",
2
+ "name": "nuxt-mongocamp-server",
3
3
  "configKey": "mongocamp",
4
- "version": "0.7.1"
4
+ "version": "0.7.3"
5
5
  }
package/dist/module.mjs CHANGED
@@ -6,37 +6,37 @@ import require$$2 from 'fs';
6
6
  import require$$3 from 'os';
7
7
  import require$$4 from 'tty';
8
8
 
9
- function isObject(val) {
10
- return val !== null && typeof val === "object";
9
+ function isObject(value) {
10
+ return value !== null && typeof value === "object";
11
11
  }
12
- function _defu(baseObj, defaults, namespace = ".", merger) {
12
+ function _defu(baseObject, defaults, namespace = ".", merger) {
13
13
  if (!isObject(defaults)) {
14
- return _defu(baseObj, {}, namespace, merger);
14
+ return _defu(baseObject, {}, namespace, merger);
15
15
  }
16
- const obj = Object.assign({}, defaults);
17
- for (const key in baseObj) {
16
+ const object = Object.assign({}, defaults);
17
+ for (const key in baseObject) {
18
18
  if (key === "__proto__" || key === "constructor") {
19
19
  continue;
20
20
  }
21
- const val = baseObj[key];
22
- if (val === null || val === void 0) {
21
+ const value = baseObject[key];
22
+ if (value === null || value === void 0) {
23
23
  continue;
24
24
  }
25
- if (merger && merger(obj, key, val, namespace)) {
25
+ if (merger && merger(object, key, value, namespace)) {
26
26
  continue;
27
27
  }
28
- if (Array.isArray(val) && Array.isArray(obj[key])) {
29
- obj[key] = val.concat(obj[key]);
30
- } else if (isObject(val) && isObject(obj[key])) {
31
- obj[key] = _defu(val, obj[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
28
+ if (Array.isArray(value) && Array.isArray(object[key])) {
29
+ object[key] = [...value, ...object[key]];
30
+ } else if (isObject(value) && isObject(object[key])) {
31
+ object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
32
32
  } else {
33
- obj[key] = val;
33
+ object[key] = value;
34
34
  }
35
35
  }
36
- return obj;
36
+ return object;
37
37
  }
38
38
  function createDefu(merger) {
39
- return (...args) => args.reduce((p, c) => _defu(p, c, "", merger), {});
39
+ return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
40
40
  }
41
41
  const defu = createDefu();
42
42
 
@@ -50,10 +50,10 @@ function u(u){return u&&"object"==typeof u&&"default"in u?u.default:u}var D=u(re
50
50
 
51
51
  const module = defineNuxtModule({
52
52
  meta: {
53
- name: "nuxt-mongocamp",
53
+ name: "nuxt-mongocamp-server",
54
54
  configKey: "mongocamp"
55
55
  },
56
- setup(options, nuxt) {
56
+ async setup(options, nuxt) {
57
57
  if (!options.url || options.url.length === 0)
58
58
  consola.error("Missing Mongocamp Base Url !");
59
59
  if (!options.paginationSize || options.paginationSize < 10)
@@ -69,6 +69,7 @@ const module = defineNuxtModule({
69
69
  nuxt.options.build.transpile.push(runtimeDir);
70
70
  addPlugin(resolve(runtimeDir, "plugin"));
71
71
  addImportsDir(resolve(runtimeDir, "composables"));
72
+ consola.info("mongocamp-nuxt available");
72
73
  }
73
74
  });
74
75
 
@@ -40,7 +40,7 @@ export declare const COLLECTION_FORMATS: {
40
40
  tsv: string;
41
41
  pipes: string;
42
42
  };
43
- export declare type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
43
+ export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
44
44
  export interface ConfigurationParameters {
45
45
  basePath?: string;
46
46
  fetchApi?: FetchAPI;
@@ -67,16 +67,16 @@ export declare class Configuration {
67
67
  get headers(): HTTPHeaders | undefined;
68
68
  get credentials(): RequestCredentials | undefined;
69
69
  }
70
- export declare type Json = any;
71
- export declare type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
72
- export declare type HTTPHeaders = {
70
+ export type Json = any;
71
+ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
72
+ export type HTTPHeaders = {
73
73
  [key: string]: string;
74
74
  };
75
- export declare type HTTPQuery = {
75
+ export type HTTPQuery = {
76
76
  [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | HTTPQuery;
77
77
  };
78
- export declare type HTTPBody = Json | FormData | URLSearchParams;
79
- export declare type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
78
+ export type HTTPBody = Json | FormData | URLSearchParams;
79
+ export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
80
80
  export interface FetchParams {
81
81
  url: string;
82
82
  init: RequestInit;
@@ -151,7 +151,10 @@ export function querystring(params, prefix = "") {
151
151
  }).filter((part) => part.length > 0).join("&");
152
152
  }
153
153
  export function mapValues(data, fn) {
154
- return Object.keys(data).reduce((acc, key) => ({ ...acc, [key]: fn(data[key]) }), {});
154
+ return Object.keys(data).reduce(
155
+ (acc, key) => ({ ...acc, [key]: fn(data[key]) }),
156
+ {}
157
+ );
155
158
  }
156
159
  export function canConsumeForm(consumes) {
157
160
  for (const consume of consumes) {
@@ -4,6 +4,6 @@ export declare const useMongocampAuth: () => {
4
4
  logout: () => void;
5
5
  userProfile: () => Promise<UserProfile>;
6
6
  isLoggedIn: import("vue").ComputedRef<boolean>;
7
- userRoles: import("vue").ComputedRef<string[]>;
8
- userGrants: import("vue").ComputedRef<import("../api").Grant[]>;
7
+ userRoles: import("vue").ComputedRef<string[] | undefined>;
8
+ userGrants: import("vue").ComputedRef<import("../api").Grant[] | undefined>;
9
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfxcode/nuxt-mongocamp-server",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -18,16 +18,16 @@
18
18
  "failOnWarn": false
19
19
  },
20
20
  "devDependencies": {
21
- "@antfu/eslint-config": "^0.27.0",
22
- "@iconify-json/mdi": "^1.1.34",
23
- "@nuxt/kit": "^3.0.0-rc.2",
21
+ "@antfu/eslint-config": "^0.31.0",
22
+ "@iconify-json/mdi": "^1.1.35",
23
+ "@nuxt/kit": "^3.0.0",
24
24
  "@nuxt/module-builder": "latest",
25
25
  "@openapitools/openapi-generator-cli": "^2.5.2",
26
- "@types/node": "^18.11.7",
27
- "@unocss/nuxt": "^0.46.1",
28
- "defu": "^6.1.0",
26
+ "@types/node": "^18.11.9",
27
+ "@unocss/nuxt": "^0.46.5",
28
+ "defu": "^6.1.1",
29
29
  "jiti": "^1.16.0",
30
- "nuxt": "^3.0.0-rc.12"
30
+ "nuxt": "^3.0.0"
31
31
  },
32
32
  "scripts": {
33
33
  "dev": "nuxi dev --port 3333 playground",