@anteros/core 0.0.11 → 0.0.13

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.
@@ -45,7 +45,7 @@ async function syncCollections() {
45
45
  cfg.collections = collections
46
46
 
47
47
  } catch (err: any) {
48
- console.error(err?.message)
48
+ console.error(cfg.debug ? err : err?.message)
49
49
  }
50
50
  }
51
51
 
package/database/file.ts CHANGED
@@ -63,7 +63,7 @@ async function syncFileCollections() {
63
63
  })
64
64
 
65
65
  } catch (err: any) {
66
- console.error(err?.message)
66
+ console.error(cfg.debug ? err : err?.message)
67
67
  }
68
68
  }
69
69
 
@@ -18,7 +18,7 @@ async function syncTenants() {
18
18
  tenant.database.db = db
19
19
  }
20
20
  } catch (err: any) {
21
- console.error('Error bootstrapping tenants', err?.message)
21
+ console.error('Error bootstrapping tenants', cfg.debug ? err : err?.message)
22
22
  process.exit(1)
23
23
  }
24
24
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@anteros/core",
3
3
  "module": "index.ts",
4
- "version": "0.0.11",
4
+ "version": "0.0.13",
5
5
  "type": "module",
6
6
  "description": "Anteros Core",
7
7
  "private": false,
package/server/boot.ts CHANGED
@@ -91,7 +91,7 @@ async function bootApp(options: BootAppOptions = {} as BootAppOptions) {
91
91
 
92
92
  return server;
93
93
  } catch (err: any) {
94
- console.error('Failed to boot server', err?.message);
94
+ console.error('Failed to boot server', cfg.debug ? err : err?.message);
95
95
  process.exit(1);
96
96
  }
97
97
  }
package/server/routes.ts CHANGED
@@ -9,8 +9,10 @@ import type { HonoVariables } from "./env";
9
9
  function initializeRoutes(app: Hono<{ Variables: HonoVariables }>) {
10
10
  for (let route of cfg.routes ?? []) {
11
11
  if (route._prefix_) {
12
- let method = route.method.toLocaleLowerCase();
13
- let routePath = path.posix.join(route._prefix_, route.path);
12
+ let method = route.method.toLocaleLowerCase();
13
+ let routePath = path.posix.join(route._prefix_, route.path);
14
+
15
+
14
16
 
15
17
  if (route.method == "GET") {
16
18
  app.get(routePath, async (c) => { //
@@ -37,6 +39,19 @@ function initializeRoutes(app: Hono<{ Variables: HonoVariables }>) {
37
39
  });
38
40
  });
39
41
  }
42
+
43
+ if (route.method == "PUT") {
44
+ app.put(routePath, async (c) => { //
45
+ return route.handler({
46
+ c,
47
+ rest: new useRest({
48
+ tenant_id: route._tenant_,
49
+ }),
50
+ jwt: jwt,
51
+ io: io,
52
+ });
53
+ });
54
+ }
40
55
  }
41
56
  }
42
57
 
@@ -45,4 +60,4 @@ function initializeRoutes(app: Hono<{ Variables: HonoVariables }>) {
45
60
 
46
61
  export {
47
62
  initializeRoutes
48
- }
63
+ }
package/types/route.d.ts CHANGED
@@ -11,9 +11,9 @@ type routeContext = {
11
11
  type Route = {
12
12
  enabled?: boolean;
13
13
  path: string;
14
- method: 'GET' | 'POST';
14
+ method: 'GET' | 'POST'|'PUT';
15
15
  handler: (ctx: routeContext) => void;
16
16
  _tenant_?: string;
17
17
  _isRoute_?: boolean;
18
18
  _prefix_?: string;
19
- }
19
+ }