@routr/pgdata 2.0.8-alpha.19 → 2.0.8-alpha.20

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.
@@ -70,14 +70,16 @@ class ACLManager extends manager_1.EntityManager {
70
70
  }
71
71
  this.acl.deny.forEach((cidr) => {
72
72
  // 4 => IPv4
73
- if (!Validator.default.isIPRange(cidr, 4)) {
74
- throw new common_1.CommonErrors.BadRequestError(`${cidr} is not a valid cidr`);
73
+ if (!Validator.default.isIPRange(cidr, 4) &&
74
+ !Validator.default.isIP(cidr, 4)) {
75
+ throw new common_1.CommonErrors.BadRequestError(`${cidr} is not a valid cidr or ip`);
75
76
  }
76
77
  });
77
78
  this.acl.allow.forEach((cidr) => {
78
79
  // 4 => IPv4
79
- if (!Validator.default.isIPRange(cidr, 4)) {
80
- throw new common_1.CommonErrors.BadRequestError(`${cidr} is not a valid cidr`);
80
+ if (!Validator.default.isIPRange(cidr, 4) &&
81
+ !Validator.default.isIP(cidr, 4)) {
82
+ throw new common_1.CommonErrors.BadRequestError(`${cidr} is not a valid cidr or ip`);
81
83
  }
82
84
  });
83
85
  }
@@ -100,14 +102,16 @@ class ACLManager extends manager_1.EntityManager {
100
102
  }
101
103
  this.acl.deny.forEach((cidr) => {
102
104
  // 4 => IPv4
103
- if (!Validator.default.isIPRange(cidr, 4)) {
104
- throw new common_1.CommonErrors.BadRequestError(`${cidr} is not a valid cidr`);
105
+ if (!Validator.default.isIPRange(cidr, 4) &&
106
+ !Validator.default.isIP(cidr, 4)) {
107
+ throw new common_1.CommonErrors.BadRequestError(`${cidr} is not a valid cidr or ip`);
105
108
  }
106
109
  });
107
110
  this.acl.allow.forEach((cidr) => {
108
111
  // 4 => IPv4
109
- if (!Validator.default.isIPRange(cidr, 4)) {
110
- throw new common_1.CommonErrors.BadRequestError(`${cidr} is not a valid cidr`);
112
+ if (!Validator.default.isIPRange(cidr, 4) &&
113
+ !Validator.default.isIP(cidr, 4)) {
114
+ throw new common_1.CommonErrors.BadRequestError(`${cidr} is not a valid cidr or ip`);
111
115
  }
112
116
  });
113
117
  }
package/dist/service.js CHANGED
@@ -74,7 +74,7 @@ function pgDataService(config) {
74
74
  kinds.forEach((kind) => {
75
75
  const k = kind.toLowerCase();
76
76
  const delegate = prisma[kind];
77
- server.addService(common_1.CommonConnect.createService(k), {
77
+ server.addService(common_1.CommonConnect.createConnectService(k), {
78
78
  create: (0, create_1.create)(delegate.create, k),
79
79
  get: (0, get_1.get)(delegate.findUnique, k),
80
80
  findBy: (0, find_1.findBy)(delegate.findMany, k),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/pgdata",
3
- "version": "2.0.8-alpha.19",
3
+ "version": "2.0.8-alpha.20",
4
4
  "description": "Postgres API Server for Routr Connect",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@fonoster/logger": "0.3.18",
23
- "@grpc/grpc-js": "^1.5.9",
23
+ "@grpc/grpc-js": "^1.8.4",
24
24
  "@opentelemetry/api": "^1.0.4",
25
25
  "@opentelemetry/exporter-jaeger": "^1.0.4",
26
26
  "@opentelemetry/instrumentation": "^0.27.0",
@@ -30,8 +30,8 @@
30
30
  "@opentelemetry/sdk-trace-node": "^1.0.4",
31
31
  "@opentelemetry/semantic-conventions": "^1.0.4",
32
32
  "@prisma/client": "^4.8.0",
33
- "@routr/common": "^2.0.8-alpha.19",
34
- "@routr/processor": "^2.0.8-alpha.19",
33
+ "@routr/common": "^2.0.8-alpha.20",
34
+ "@routr/processor": "^2.0.8-alpha.20",
35
35
  "google-protobuf": "^3.9.2",
36
36
  "pb-util": "^1.0.3",
37
37
  "validator": "^13.7.0"
@@ -54,5 +54,5 @@
54
54
  "@types/validator": "^13.7.10",
55
55
  "prisma": "^4.8.0"
56
56
  },
57
- "gitHead": "ff62abb0ff7704a79f98a8e0b10c0036b949cc11"
57
+ "gitHead": "a22ee8342d03f5dfe46fddba89ffe3e6d0d5deb6"
58
58
  }