@luminix/core 0.3.0 → 0.3.2

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/core.js CHANGED
@@ -121,7 +121,7 @@ class xe extends A {
121
121
  constructor(e, i, s = {}) {
122
122
  super();
123
123
  p(this, "bag");
124
- this.services = e, this.abstract = i, this.query = s, this.bag = new _(s), this.bag.on("change", () => {
124
+ this.services = e, this.abstract = i, this.bag = new _(s), this.bag.on("change", () => {
125
125
  this.emit("change", {
126
126
  data: this.bag,
127
127
  source: this
@@ -939,7 +939,7 @@ function _e(o, t, e) {
939
939
  get: (l, u) => {
940
940
  if (u === "__isModel")
941
941
  return !0;
942
- if (Reflect.has(l, u))
942
+ if (Reflect.has(l, u) || typeof u != "string")
943
943
  return Reflect.get(l, u);
944
944
  if (Object.keys(l.attributes).includes(u))
945
945
  return l.getAttribute(u);
@@ -1372,19 +1372,21 @@ class Be {
1372
1372
  return d.get(this.routes, t);
1373
1373
  }
1374
1374
  url(t) {
1375
+ return this.appUrl + this.path(t);
1376
+ }
1377
+ path(t) {
1375
1378
  const [e, i] = this.extractGenerator(t), s = this.get(e)[0].replace(/^\/|\/$/g, ""), c = /{([^}]+)}/g;
1376
1379
  if (i === !1) {
1377
1380
  if (typeof this.replaceRouteParams != "function")
1378
1381
  throw new E("RouteFacade");
1379
- return this.appUrl + this.replaceRouteParams(`/${s}`);
1382
+ return this.replaceRouteParams(`/${s}`);
1380
1383
  }
1381
1384
  const y = s.match(c), l = y ? y.map((h) => h.slice(1, -1)) : [], u = Object.keys(i), r = l.filter((h) => !u.includes(h)), n = u.filter((h) => !l.includes(h));
1382
1385
  if (r.length > 0)
1383
1386
  throw new TypeError(`Missing values for parameter(s): ${r.join(", ")}`);
1384
1387
  if (n.length > 0)
1385
1388
  throw new TypeError(`Unexpected parameters: ${n.join(", ")}`);
1386
- const a = l.reduce((h, g) => h.replace(`{${g}}`, `${i[g]}`), s);
1387
- return this.appUrl + `/${a}`;
1389
+ return `/${l.reduce((h, g) => h.replace(`{${g}}`, `${i[g]}`), s)}`;
1388
1390
  }
1389
1391
  methods(t) {
1390
1392
  const [e] = this.extractGenerator(t);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/core",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "> Projeto em desenvolvimento",
5
5
  "module": "dist/core.js",
6
6
  "types": "types/index.d.ts",
@@ -30,6 +30,6 @@
30
30
  "vite-plugin-dts": "^4.0.0-beta.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@luminix/support": "^0.4.0"
33
+ "@luminix/support": "^0.4.3"
34
34
  }
35
35
  }
@@ -13,7 +13,6 @@ declare class Builder extends EventSource<BuilderEventMap> implements BuilderInt
13
13
  route: RouteFacade;
14
14
  };
15
15
  protected abstract: string;
16
- protected query: ModelQuery;
17
16
  private bag;
18
17
  constructor(services: {
19
18
  config: ConfigFacade;
@@ -11,6 +11,7 @@ export declare class RouteService {
11
11
  private extractGenerator;
12
12
  get(name: string): RouteTuple;
13
13
  url(generator: RouteGenerator): string;
14
+ path(generator: RouteGenerator): string;
14
15
  methods(generator: RouteGenerator): HttpMethod[];
15
16
  exists(name: string): boolean;
16
17
  call<TResponse = any>(generator: RouteGenerator, tap?: (client: Client) => Client, errorBag?: string): Promise<Response<TResponse>>;