@dnax/core 0.7.8 → 0.8.1

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/define/index.ts CHANGED
@@ -4,8 +4,10 @@ import type {
4
4
  Endpoint,
5
5
  Service,
6
6
  Socket,
7
+ accessCtx,
7
8
  cronConfig,
8
9
  cronCtx,
10
+ ctxApi,
9
11
  middlewareCtx,
10
12
  permissionSchema,
11
13
  } from "../types";
@@ -45,6 +47,14 @@ function Permission(config: permissionSchema): permissionSchema {
45
47
  return config;
46
48
  }
47
49
 
50
+ function Api(c: ctxApi) {
51
+ return config;
52
+ }
53
+
54
+ function Access(c: accessCtx) {
55
+ return config;
56
+ }
57
+
48
58
  const define = {
49
59
  Service,
50
60
  Config,
@@ -56,6 +66,8 @@ const define = {
56
66
  Task,
57
67
  Cron: Task,
58
68
  Permission,
69
+ Api,
70
+ Access,
59
71
  };
60
72
 
61
73
  export default define;
@@ -1,11 +1,11 @@
1
1
  import type { Tenant } from "../../types";
2
- import { encode, decode, parse, stringify } from "urlencode";
2
+
3
3
  import { MongoClient } from "mongodb";
4
4
  import { consola } from "consola";
5
5
  async function connectToMongo(t: Tenant) {
6
6
  return new Promise(async (resolve, reject) => {
7
7
  let client = new MongoClient(
8
- encode(t?.database?.uri) || "mongodb://localhost:27017",
8
+ t?.database?.uri || "mongodb://localhost:27017",
9
9
  {
10
10
  ...(t?.database?.options || {}),
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.7.8",
3
+ "version": "0.8.1",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {
package/utils/index.ts CHANGED
@@ -9,6 +9,7 @@ import generateUniqueId from "generate-unique-id";
9
9
  import dayjs from "dayjs";
10
10
  import { Otp } from "../lib/opt";
11
11
  import collect from "collect.js";
12
+ import * as urlencode from "urlencode";
12
13
 
13
14
  const JWT_SECRET = process?.env?.JWT_SECRET || "secret-libv";
14
15
  import * as _ from "radash";
@@ -315,4 +316,5 @@ export {
315
316
  omit, // Omit utils
316
317
  collect, // Collect utils
317
318
  Otp, // Otp utils
319
+ urlencode,
318
320
  };