x-error-lib 0.3.2 → 0.3.5

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.
@@ -2,7 +2,7 @@ const e = {
2
2
  "network error": "{code} {message}",
3
3
  "request timeout": "request timeout",
4
4
  "user not found": "user not found"
5
- }, r = {}, a = {
5
+ }, r = e, a = {}, o = a, l = {
6
6
  formatName: "{verb} {resource}",
7
7
  resource: {
8
8
  app: "app",
@@ -19,11 +19,11 @@ const e = {
19
19
  db_space: "db space",
20
20
  dir: "dir",
21
21
  func: "func",
22
- "func group": "func group",
23
- "func release": "func release",
22
+ func_group: "func group",
23
+ func_release: "func release",
24
24
  flow: "flow",
25
- "flow group": "flow group",
26
- "flow release": "flow release",
25
+ flow_group: "flow group",
26
+ flow_release: "flow release",
27
27
  graph: "graph",
28
28
  model: "model",
29
29
  model_data: "model data",
@@ -49,11 +49,13 @@ const e = {
49
49
  remove: "remove",
50
50
  update: "update"
51
51
  }
52
- }, o = {
53
- error: e,
54
- object: r,
55
- permission: a
52
+ }, t = l, p = {
53
+ "x-error-lib": {
54
+ err: r,
55
+ obj: o,
56
+ perm: t
57
+ }
56
58
  };
57
59
  export {
58
- o as default
60
+ p as default
59
61
  };
@@ -0,0 +1,2 @@
1
+ export declare function loadLocaleMessageError(locale: string): Promise<object>;
2
+ export declare function getErrorMessage(error: any): string;
@@ -0,0 +1,6 @@
1
+ declare const err: {
2
+ 'network error': string;
3
+ 'request timeout': string;
4
+ 'user not found': string;
5
+ };
6
+ export default err;
@@ -0,0 +1,59 @@
1
+ declare const _default: {
2
+ 'x-error-lib': {
3
+ err: {
4
+ 'network error': string;
5
+ 'request timeout': string;
6
+ 'user not found': string;
7
+ };
8
+ obj: {};
9
+ perm: {
10
+ formatName: string;
11
+ resource: {
12
+ app: string;
13
+ app_group: string;
14
+ app_layer: string;
15
+ app_release: string;
16
+ asset: string;
17
+ asset_layer: string;
18
+ asset_space: string;
19
+ calc_layer: string;
20
+ calc_space: string;
21
+ change: string;
22
+ data_layer: string;
23
+ db_space: string;
24
+ dir: string;
25
+ func: string;
26
+ func_group: string;
27
+ func_release: string;
28
+ flow: string;
29
+ flow_group: string;
30
+ flow_release: string;
31
+ graph: string;
32
+ model: string;
33
+ model_data: string;
34
+ model_group: string;
35
+ org_member: string;
36
+ org_role: string;
37
+ org_structure: string;
38
+ task: string;
39
+ };
40
+ verb: {
41
+ apply: string;
42
+ arrange: string;
43
+ call: string;
44
+ create: string;
45
+ debug: string;
46
+ delete: string;
47
+ deploy: string;
48
+ filter: string;
49
+ get: string;
50
+ list: string;
51
+ move: string;
52
+ open: string;
53
+ remove: string;
54
+ update: string;
55
+ };
56
+ };
57
+ };
58
+ };
59
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const obj: {};
2
+ export default obj;
@@ -0,0 +1,49 @@
1
+ declare const perm: {
2
+ formatName: string;
3
+ resource: {
4
+ app: string;
5
+ app_group: string;
6
+ app_layer: string;
7
+ app_release: string;
8
+ asset: string;
9
+ asset_layer: string;
10
+ asset_space: string;
11
+ calc_layer: string;
12
+ calc_space: string;
13
+ change: string;
14
+ data_layer: string;
15
+ db_space: string;
16
+ dir: string;
17
+ func: string;
18
+ func_group: string;
19
+ func_release: string;
20
+ flow: string;
21
+ flow_group: string;
22
+ flow_release: string;
23
+ graph: string;
24
+ model: string;
25
+ model_data: string;
26
+ model_group: string;
27
+ org_member: string;
28
+ org_role: string;
29
+ org_structure: string;
30
+ task: string;
31
+ };
32
+ verb: {
33
+ apply: string;
34
+ arrange: string;
35
+ call: string;
36
+ create: string;
37
+ debug: string;
38
+ delete: string;
39
+ deploy: string;
40
+ filter: string;
41
+ get: string;
42
+ list: string;
43
+ move: string;
44
+ open: string;
45
+ remove: string;
46
+ update: string;
47
+ };
48
+ };
49
+ export default perm;
@@ -0,0 +1,6 @@
1
+ declare const err: {
2
+ 'network error': string;
3
+ 'request timeout': string;
4
+ 'user not found': string;
5
+ };
6
+ export default err;
@@ -0,0 +1,59 @@
1
+ declare const _default: {
2
+ 'x-error-lib': {
3
+ err: {
4
+ 'network error': string;
5
+ 'request timeout': string;
6
+ 'user not found': string;
7
+ };
8
+ obj: {};
9
+ perm: {
10
+ formatName: string;
11
+ resource: {
12
+ app: string;
13
+ app_group: string;
14
+ app_layer: string;
15
+ app_release: string;
16
+ asset: string;
17
+ asset_layer: string;
18
+ asset_space: string;
19
+ calc_layer: string;
20
+ calc_space: string;
21
+ change: string;
22
+ data_layer: string;
23
+ db_space: string;
24
+ dir: string;
25
+ func: string;
26
+ func_group: string;
27
+ func_release: string;
28
+ flow: string;
29
+ flow_group: string;
30
+ flow_release: string;
31
+ graph: string;
32
+ model: string;
33
+ model_data: string;
34
+ model_group: string;
35
+ org_member: string;
36
+ org_role: string;
37
+ org_structure: string;
38
+ task: string;
39
+ };
40
+ verb: {
41
+ apply: string;
42
+ arrange: string;
43
+ call: string;
44
+ create: string;
45
+ debug: string;
46
+ delete: string;
47
+ deploy: string;
48
+ filter: string;
49
+ get: string;
50
+ list: string;
51
+ move: string;
52
+ open: string;
53
+ remove: string;
54
+ update: string;
55
+ };
56
+ };
57
+ };
58
+ };
59
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const obj: {};
2
+ export default obj;
@@ -0,0 +1,49 @@
1
+ declare const perm: {
2
+ formatName: string;
3
+ resource: {
4
+ app: string;
5
+ app_group: string;
6
+ app_layer: string;
7
+ app_release: string;
8
+ asset: string;
9
+ asset_layer: string;
10
+ asset_space: string;
11
+ calc_layer: string;
12
+ calc_space: string;
13
+ change: string;
14
+ data_layer: string;
15
+ db_space: string;
16
+ dir: string;
17
+ func: string;
18
+ func_group: string;
19
+ func_release: string;
20
+ flow: string;
21
+ flow_group: string;
22
+ flow_release: string;
23
+ graph: string;
24
+ model: string;
25
+ model_data: string;
26
+ model_group: string;
27
+ org_member: string;
28
+ org_role: string;
29
+ org_structure: string;
30
+ task: string;
31
+ };
32
+ verb: {
33
+ apply: string;
34
+ arrange: string;
35
+ call: string;
36
+ create: string;
37
+ debug: string;
38
+ delete: string;
39
+ deploy: string;
40
+ filter: string;
41
+ get: string;
42
+ list: string;
43
+ move: string;
44
+ open: string;
45
+ remove: string;
46
+ update: string;
47
+ };
48
+ };
49
+ export default perm;
@@ -0,0 +1,2 @@
1
+ export declare function loadLocaleMessageError(locale: string): Promise<object>;
2
+ export declare function getErrorMessage(error: any): string;
@@ -0,0 +1,6 @@
1
+ declare const err: {
2
+ 'network error': string;
3
+ 'request timeout': string;
4
+ 'user not found': string;
5
+ };
6
+ export default err;
@@ -0,0 +1,59 @@
1
+ declare const _default: {
2
+ 'x-error-lib': {
3
+ err: {
4
+ 'network error': string;
5
+ 'request timeout': string;
6
+ 'user not found': string;
7
+ };
8
+ obj: {};
9
+ perm: {
10
+ formatName: string;
11
+ resource: {
12
+ app: string;
13
+ app_group: string;
14
+ app_layer: string;
15
+ app_release: string;
16
+ asset: string;
17
+ asset_layer: string;
18
+ asset_space: string;
19
+ calc_layer: string;
20
+ calc_space: string;
21
+ change: string;
22
+ data_layer: string;
23
+ db_space: string;
24
+ dir: string;
25
+ func: string;
26
+ func_group: string;
27
+ func_release: string;
28
+ flow: string;
29
+ flow_group: string;
30
+ flow_release: string;
31
+ graph: string;
32
+ model: string;
33
+ model_data: string;
34
+ model_group: string;
35
+ org_member: string;
36
+ org_role: string;
37
+ org_structure: string;
38
+ task: string;
39
+ };
40
+ verb: {
41
+ apply: string;
42
+ arrange: string;
43
+ call: string;
44
+ create: string;
45
+ debug: string;
46
+ delete: string;
47
+ deploy: string;
48
+ filter: string;
49
+ get: string;
50
+ list: string;
51
+ move: string;
52
+ open: string;
53
+ remove: string;
54
+ update: string;
55
+ };
56
+ };
57
+ };
58
+ };
59
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const obj: {};
2
+ export default obj;
@@ -0,0 +1,49 @@
1
+ declare const perm: {
2
+ formatName: string;
3
+ resource: {
4
+ app: string;
5
+ app_group: string;
6
+ app_layer: string;
7
+ app_release: string;
8
+ asset: string;
9
+ asset_layer: string;
10
+ asset_space: string;
11
+ calc_layer: string;
12
+ calc_space: string;
13
+ change: string;
14
+ data_layer: string;
15
+ db_space: string;
16
+ dir: string;
17
+ func: string;
18
+ func_group: string;
19
+ func_release: string;
20
+ flow: string;
21
+ flow_group: string;
22
+ flow_release: string;
23
+ graph: string;
24
+ model: string;
25
+ model_data: string;
26
+ model_group: string;
27
+ org_member: string;
28
+ org_role: string;
29
+ org_structure: string;
30
+ task: string;
31
+ };
32
+ verb: {
33
+ apply: string;
34
+ arrange: string;
35
+ call: string;
36
+ create: string;
37
+ debug: string;
38
+ delete: string;
39
+ deploy: string;
40
+ filter: string;
41
+ get: string;
42
+ list: string;
43
+ move: string;
44
+ open: string;
45
+ remove: string;
46
+ update: string;
47
+ };
48
+ };
49
+ export default perm;
@@ -0,0 +1,6 @@
1
+ declare const err: {
2
+ 'network error': string;
3
+ 'request timeout': string;
4
+ 'user not found': string;
5
+ };
6
+ export default err;
@@ -0,0 +1,59 @@
1
+ declare const _default: {
2
+ 'x-error-lib': {
3
+ err: {
4
+ 'network error': string;
5
+ 'request timeout': string;
6
+ 'user not found': string;
7
+ };
8
+ obj: {};
9
+ perm: {
10
+ formatName: string;
11
+ resource: {
12
+ app: string;
13
+ app_group: string;
14
+ app_layer: string;
15
+ app_release: string;
16
+ asset: string;
17
+ asset_layer: string;
18
+ asset_space: string;
19
+ calc_layer: string;
20
+ calc_space: string;
21
+ change: string;
22
+ data_layer: string;
23
+ db_space: string;
24
+ dir: string;
25
+ func: string;
26
+ func_group: string;
27
+ func_release: string;
28
+ flow: string;
29
+ flow_group: string;
30
+ flow_release: string;
31
+ graph: string;
32
+ model: string;
33
+ model_data: string;
34
+ model_group: string;
35
+ org_member: string;
36
+ org_role: string;
37
+ org_structure: string;
38
+ task: string;
39
+ };
40
+ verb: {
41
+ apply: string;
42
+ arrange: string;
43
+ call: string;
44
+ create: string;
45
+ debug: string;
46
+ delete: string;
47
+ deploy: string;
48
+ filter: string;
49
+ get: string;
50
+ list: string;
51
+ move: string;
52
+ open: string;
53
+ remove: string;
54
+ update: string;
55
+ };
56
+ };
57
+ };
58
+ };
59
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const obj: {};
2
+ export default obj;
@@ -0,0 +1,49 @@
1
+ declare const perm: {
2
+ formatName: string;
3
+ resource: {
4
+ app: string;
5
+ app_group: string;
6
+ app_layer: string;
7
+ app_release: string;
8
+ asset: string;
9
+ asset_layer: string;
10
+ asset_space: string;
11
+ calc_layer: string;
12
+ calc_space: string;
13
+ change: string;
14
+ data_layer: string;
15
+ db_space: string;
16
+ dir: string;
17
+ func: string;
18
+ func_group: string;
19
+ func_release: string;
20
+ flow: string;
21
+ flow_group: string;
22
+ flow_release: string;
23
+ graph: string;
24
+ model: string;
25
+ model_data: string;
26
+ model_group: string;
27
+ org_member: string;
28
+ org_role: string;
29
+ org_structure: string;
30
+ task: string;
31
+ };
32
+ verb: {
33
+ apply: string;
34
+ arrange: string;
35
+ call: string;
36
+ create: string;
37
+ debug: string;
38
+ delete: string;
39
+ deploy: string;
40
+ filter: string;
41
+ get: string;
42
+ list: string;
43
+ move: string;
44
+ open: string;
45
+ remove: string;
46
+ update: string;
47
+ };
48
+ };
49
+ export default perm;
package/dist/index.js CHANGED
@@ -1,34 +1,34 @@
1
- import { nextTick as i } from "vue";
2
- const l = (r, t) => {
3
- const e = r[t];
4
- return e ? typeof e == "function" ? e() : Promise.resolve(e) : new Promise((n, o) => {
5
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, new Error("Unknown variable dynamic import: " + t)));
1
+ import { useI18n as l } from "vue-i18n";
2
+ const c = (t, r) => {
3
+ const e = t[r];
4
+ return e ? typeof e == "function" ? e() : Promise.resolve(e) : new Promise((o, n) => {
5
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(n.bind(null, new Error("Unknown variable dynamic import: " + r)));
6
6
  });
7
7
  };
8
- async function f(r, t) {
9
- const e = await l(/* @__PURE__ */ Object.assign({ "./locales/en.ts": () => import("./en-CZ-X6wzC.js"), "./locales/zhHans.ts": () => import("./zhHans-Cn6omP_e.js") }), `./locales/${t}.ts`);
10
- return r.global.setLocaleMessage(t, e.default), i();
8
+ async function f(t) {
9
+ return (await c(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./en-ez3lsybf.js"), "./locales/zhHans/index.ts": () => import("./zhHans-571g87j7.js") }), `./locales/${t}/index.ts`)).default;
11
10
  }
12
- function m(r, t) {
11
+ function u(t) {
12
+ const r = { main: "", extras: {} };
13
+ let e = t.split(";");
14
+ return console.assert(e.length > 0), r.main = e[0], e = ((e == null ? void 0 : e[1]) ?? "").split(","), e.forEach((n) => {
15
+ const s = n.split("=");
16
+ s.length >= 2 && (r.extras[s[0]] = s[1]);
17
+ }), r;
18
+ }
19
+ function x(t) {
20
+ const { t: r } = l();
13
21
  if (typeof t != "string")
14
- return r.global.t("error.network error", t);
15
- const e = c(t);
16
- let n = r.global.t("error." + e.main), o = "";
22
+ return r("x-error-lib.err.network error", t);
23
+ const e = u(t);
24
+ let o = r(`x-error-lib.err.${e.main}`), n = "";
17
25
  for (const s in e.extras) {
18
- let a = r.global.t("object." + s);
19
- a += "=", a += e.extras[s], o !== "" && (o += ", "), o += a;
26
+ const i = e.extras[s], a = r(`x-error-lib.obj.${s}=${i}`);
27
+ n !== "" && (n += ", "), n += a;
20
28
  }
21
- return o !== "" && (n += "; ", n += o), n;
22
- }
23
- function c(r) {
24
- const t = { main: "", extras: {} };
25
- let e = r.split(";");
26
- return console.assert(e.length > 0), t.main = e[0], e = ((e == null ? void 0 : e[1]) ?? "").split(","), e.forEach((o) => {
27
- const s = o.split("=");
28
- s.length >= 2 && (t.extras[s[0]] = s[1]);
29
- }), t;
29
+ return n !== "" && (o += "; ", o += n), o;
30
30
  }
31
31
  export {
32
- m as getErrorMessage,
33
- f as loadLocaleMessage
32
+ x as getErrorMessage,
33
+ f as loadLocaleMessageError
34
34
  };
@@ -2,7 +2,7 @@ const e = {
2
2
  "network error": "{code} {message}",
3
3
  "request timeout": "请求超时",
4
4
  "user not found": "用户未找到"
5
- }, r = {}, a = {
5
+ }, r = e, o = {}, a = o, s = {
6
6
  formatName: "{verb}{resource}",
7
7
  resource: {
8
8
  app: "应用",
@@ -19,11 +19,11 @@ const e = {
19
19
  db_space: "数据库空间",
20
20
  dir: "目录",
21
21
  func: "函数",
22
- "func group": "函数分组",
23
- "func release": "函数发布",
22
+ func_group: "函数分组",
23
+ func_release: "函数发布",
24
24
  flow: "流程",
25
- "flow group": "流程分组",
26
- "flow release": "流程发布",
25
+ flow_group: "流程分组",
26
+ flow_release: "流程发布",
27
27
  graph: "图",
28
28
  model: "模型",
29
29
  model_data: "模型数据",
@@ -49,11 +49,13 @@ const e = {
49
49
  remove: "移除",
50
50
  update: "更新"
51
51
  }
52
- }, o = {
53
- error: e,
54
- object: r,
55
- permission: a
52
+ }, t = s, l = {
53
+ "x-error-lib": {
54
+ err: r,
55
+ obj: a,
56
+ perm: t
57
+ }
56
58
  };
57
59
  export {
58
- o as default
60
+ l as default
59
61
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-error-lib",
3
3
  "private": false,
4
- "version": "0.3.2",
4
+ "version": "0.3.5",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -22,9 +22,9 @@
22
22
  "*": "prettier --write ."
23
23
  },
24
24
  "peerDependencies": {
25
- "vue": "^3.4.27",
25
+ "vue": "^3.4.30",
26
26
  "vue-i18n": "^9.13.1",
27
- "vuetify": "^3.6.8"
27
+ "vuetify": "^3.6.10"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@rushstack/eslint-patch": "^1.8.0",
@@ -37,7 +37,6 @@
37
37
  "husky": "^9.0.11",
38
38
  "lint-staged": "^15.2.2",
39
39
  "prettier": "3.2.5",
40
- "rollup-plugin-copy": "^3.5.0",
41
40
  "sass": "^1.74.1",
42
41
  "typescript": "^5.2.2",
43
42
  "vite": "^5.2.0",
package/dist/i18n.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function loadLocaleMessage(i18n: any, locale: string): Promise<void>;
2
- export declare function getErrorMessage(i18n: any, error: any): string;