@routr/pgdata 2.13.5 → 2.13.7

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.
@@ -80,15 +80,15 @@ function create(operation, kind) {
80
80
  if (e instanceof library_1.PrismaClientInitializationError) {
81
81
  callback({
82
82
  code: grpc.status.UNAVAILABLE,
83
- message: "database is not available"
83
+ message: "Service unavailable"
84
84
  }, null);
85
85
  return;
86
86
  }
87
87
  else if (e.code === "P2002") {
88
- callback(new common_1.CommonErrors.BadRequestError("entity already exist for field: " + e.meta.target[0]), null);
88
+ callback(new common_1.CommonErrors.ResourceAlreadyExistsError("Resource already exist for field: " + e.meta.target[0]), null);
89
89
  }
90
90
  else if (e.code === "P2003") {
91
- callback(new common_1.CommonErrors.BadRequestError("dependent entity doesn't exist for: " + e.meta.field_name), null);
91
+ callback(new common_1.CommonErrors.BadRequestError("Dependent resource doesn't exist for: " + e.meta.field_name), null);
92
92
  }
93
93
  else {
94
94
  callback(e, null);
@@ -71,7 +71,7 @@ function del(operation) {
71
71
  if (e instanceof library_1.PrismaClientInitializationError) {
72
72
  callback({
73
73
  code: grpc.status.UNAVAILABLE,
74
- message: "database is not available"
74
+ message: "Service unavailable"
75
75
  }, null);
76
76
  return;
77
77
  }
package/dist/api/find.js CHANGED
@@ -86,7 +86,7 @@ function findBy(operation, kind) {
86
86
  if (e instanceof library_1.PrismaClientInitializationError) {
87
87
  callback({
88
88
  code: grpc.status.UNAVAILABLE,
89
- message: "database is not available"
89
+ message: "Service unavailable"
90
90
  }, null);
91
91
  return;
92
92
  }
package/dist/api/get.js CHANGED
@@ -60,7 +60,7 @@ const library_1 = require("@prisma/client/runtime/library");
60
60
  function get(operation, kind) {
61
61
  return (call, callback) => __awaiter(this, void 0, void 0, function* () {
62
62
  if (!call.request.ref) {
63
- return callback(new common_1.CommonErrors.BadRequestError("parameter ref is required"), null);
63
+ return callback(new common_1.CommonErrors.BadRequestError("Parameter ref is required"), null);
64
64
  }
65
65
  const Manager = (0, utils_1.getManager)(kind);
66
66
  try {
@@ -81,13 +81,13 @@ function get(operation, kind) {
81
81
  if (e instanceof library_1.PrismaClientInitializationError) {
82
82
  callback({
83
83
  code: grpc.status.UNAVAILABLE,
84
- message: "database is not available"
84
+ message: "Service unavailable"
85
85
  }, null);
86
86
  return;
87
87
  }
88
88
  callback({
89
89
  code: grpc.status.UNKNOWN,
90
- message: "unknown database error"
90
+ message: "Unknown error"
91
91
  }, null);
92
92
  }
93
93
  });
package/dist/api/list.js CHANGED
@@ -88,7 +88,7 @@ function list(operation, kind) {
88
88
  if (e instanceof library_1.PrismaClientInitializationError) {
89
89
  callback({
90
90
  code: grpc.status.UNAVAILABLE,
91
- message: "database is not available"
91
+ message: "Service unavailable"
92
92
  }, null);
93
93
  return;
94
94
  }
@@ -74,7 +74,7 @@ function update(operation, kind) {
74
74
  callback(new common_1.CommonErrors.ResourceNotFoundError(call.request.ref), null);
75
75
  }
76
76
  else if (e.code === "P2003") {
77
- callback(new common_1.CommonErrors.BadRequestError("dependent entity doesn't exist for: " + e.meta.field_name), null);
77
+ callback(new common_1.CommonErrors.BadRequestError("Dependent resource doesn't exist for: " + e.meta.field_name), null);
78
78
  }
79
79
  else {
80
80
  callback(e, null);
@@ -17,7 +17,7 @@ type AgentWithDomainAndCredentials = Prisma.AgentGetPayload<{
17
17
  };
18
18
  }>;
19
19
  export declare class AgentManager extends EntityManager {
20
- private agent;
20
+ private readonly agent;
21
21
  constructor(agent: CC.Agent);
22
22
  static includeFields(): Record<string, unknown>;
23
23
  validOrThrowCreate(): void;
@@ -2,7 +2,7 @@ import { Credentials as CredentialsPrismaModel } from "@prisma/client";
2
2
  import { CommonConnect as CC } from "@routr/common";
3
3
  import { EntityManager } from "./manager";
4
4
  export declare class CredentialsManager extends EntityManager {
5
- private credentials;
5
+ private readonly credentials;
6
6
  constructor(credentials: CC.Credentials);
7
7
  static includeFields(): Record<string, unknown>;
8
8
  validOrThrowCreate(): void;
@@ -12,7 +12,7 @@ type DomainWithACL = Prisma.DomainGetPayload<{
12
12
  };
13
13
  }>;
14
14
  export declare class DomainManager extends EntityManager {
15
- private domain;
15
+ private readonly domain;
16
16
  constructor(domain: CC.Domain);
17
17
  static includeFields(): Record<string, unknown>;
18
18
  validOrThrowCreate(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/pgdata",
3
- "version": "2.13.5",
3
+ "version": "2.13.7",
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",
@@ -31,8 +31,8 @@
31
31
  "@opentelemetry/sdk-trace-node": "^1.0.4",
32
32
  "@opentelemetry/semantic-conventions": "^1.0.4",
33
33
  "@prisma/client": "^5.9.1",
34
- "@routr/common": "^2.13.5",
35
- "@routr/processor": "^2.13.5",
34
+ "@routr/common": "^2.13.7",
35
+ "@routr/processor": "^2.13.7",
36
36
  "google-protobuf": "^3.9.2",
37
37
  "grpc-health-check": "^2.0.2",
38
38
  "pb-util": "^1.0.3",
@@ -58,5 +58,5 @@
58
58
  "@types/validator": "^13.7.10",
59
59
  "prisma": "^5.9.1"
60
60
  },
61
- "gitHead": "4a81cba3bf9152991f11247c8ff2349093fe9919"
61
+ "gitHead": "b408f6724aeaf7d42bb10200bc96cbcff0a2390c"
62
62
  }