@sprucelabs/data-stores 28.3.256 → 28.3.258

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.
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const error_1 = __importDefault(require("@sprucelabs/error"));
7
7
  class SpruceError extends error_1.default {
8
8
  friendlyMessage() {
9
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
9
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
10
10
  const { options } = this;
11
11
  let message;
12
12
  switch (options === null || options === void 0 ? void 0 : options.code) {
@@ -71,7 +71,8 @@ class SpruceError extends error_1.default {
71
71
  message = `Something went wrong with the database, the message is:\n\n"${options.databaseErrorMessage}"`;
72
72
  break;
73
73
  case 'UNABLE_TO_CONNECT_TO_DB':
74
- message = `I could not connect to a dabatase. Installing mongo is a great first step to solving this!
74
+ message =
75
+ (_h = (_f = (_e = options.originalError) === null || _e === void 0 ? void 0 : _e.stack) !== null && _f !== void 0 ? _f : (_g = options.originalError) === null || _g === void 0 ? void 0 : _g.message) !== null && _h !== void 0 ? _h : `I could not connect to a dabatase. Installing mongo is a great first step to solving this!
75
76
 
76
77
  https://www.mongodb.com/try/download/community
77
78
 
@@ -98,7 +99,7 @@ If you are on a mac, using brew is recommended: https://brew.sh`;
98
99
  message = 'Unknown error!';
99
100
  break;
100
101
  case 'DUPLICATE_KEY':
101
- message = `An index was trying to be created that exists. Original error is:\n\n${(_g = (_e = options.friendlyMessage) !== null && _e !== void 0 ? _e : (_f = options.originalError) === null || _f === void 0 ? void 0 : _f.stack) !== null && _g !== void 0 ? _g : (_h = options.originalError) === null || _h === void 0 ? void 0 : _h.message}`;
102
+ message = `An index was trying to be created that exists. Original error is:\n\n${(_l = (_j = options.friendlyMessage) !== null && _j !== void 0 ? _j : (_k = options.originalError) === null || _k === void 0 ? void 0 : _k.stack) !== null && _l !== void 0 ? _l : (_m = options.originalError) === null || _m === void 0 ? void 0 : _m.message}`;
102
103
  break;
103
104
  case 'INVALID_CONNECTION_STRING_SCHEME':
104
105
  message = `There is no database adapter setup for: ${options.connectionString.split('://')[0]}. You may need to install a plugin to support this database using env.DB_ADAPTER and 'yarn add ...'`;
@@ -115,7 +116,7 @@ If you are on a mac, using brew is recommended: https://brew.sh`;
115
116
  default:
116
117
  message = super.friendlyMessage();
117
118
  }
118
- const fullMessage = (_j = options.friendlyMessage) !== null && _j !== void 0 ? _j : message;
119
+ const fullMessage = (_o = options.friendlyMessage) !== null && _o !== void 0 ? _o : message;
119
120
  return fullMessage;
120
121
  }
121
122
  }
@@ -1,7 +1,7 @@
1
1
  import AbstractSpruceError from '@sprucelabs/error';
2
2
  export default class SpruceError extends AbstractSpruceError {
3
3
  friendlyMessage() {
4
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
4
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
5
5
  const { options } = this;
6
6
  let message;
7
7
  switch (options === null || options === void 0 ? void 0 : options.code) {
@@ -66,7 +66,8 @@ export default class SpruceError extends AbstractSpruceError {
66
66
  message = `Something went wrong with the database, the message is:\n\n"${options.databaseErrorMessage}"`;
67
67
  break;
68
68
  case 'UNABLE_TO_CONNECT_TO_DB':
69
- message = `I could not connect to a dabatase. Installing mongo is a great first step to solving this!
69
+ message =
70
+ (_h = (_f = (_e = options.originalError) === null || _e === void 0 ? void 0 : _e.stack) !== null && _f !== void 0 ? _f : (_g = options.originalError) === null || _g === void 0 ? void 0 : _g.message) !== null && _h !== void 0 ? _h : `I could not connect to a dabatase. Installing mongo is a great first step to solving this!
70
71
 
71
72
  https://www.mongodb.com/try/download/community
72
73
 
@@ -93,7 +94,7 @@ If you are on a mac, using brew is recommended: https://brew.sh`;
93
94
  message = 'Unknown error!';
94
95
  break;
95
96
  case 'DUPLICATE_KEY':
96
- message = `An index was trying to be created that exists. Original error is:\n\n${(_g = (_e = options.friendlyMessage) !== null && _e !== void 0 ? _e : (_f = options.originalError) === null || _f === void 0 ? void 0 : _f.stack) !== null && _g !== void 0 ? _g : (_h = options.originalError) === null || _h === void 0 ? void 0 : _h.message}`;
97
+ message = `An index was trying to be created that exists. Original error is:\n\n${(_l = (_j = options.friendlyMessage) !== null && _j !== void 0 ? _j : (_k = options.originalError) === null || _k === void 0 ? void 0 : _k.stack) !== null && _l !== void 0 ? _l : (_m = options.originalError) === null || _m === void 0 ? void 0 : _m.message}`;
97
98
  break;
98
99
  case 'INVALID_CONNECTION_STRING_SCHEME':
99
100
  message = `There is no database adapter setup for: ${options.connectionString.split('://')[0]}. You may need to install a plugin to support this database using env.DB_ADAPTER and 'yarn add ...'`;
@@ -110,7 +111,7 @@ If you are on a mac, using brew is recommended: https://brew.sh`;
110
111
  default:
111
112
  message = super.friendlyMessage();
112
113
  }
113
- const fullMessage = (_j = options.friendlyMessage) !== null && _j !== void 0 ? _j : message;
114
+ const fullMessage = (_o = options.friendlyMessage) !== null && _o !== void 0 ? _o : message;
114
115
  return fullMessage;
115
116
  }
116
117
  }
@@ -1152,9 +1152,9 @@ const databaseAssertUtil = {
1152
1152
  },
1153
1153
  assertThrowsWithBadDatabaseName(connect) {
1154
1154
  return __awaiter(this, void 0, void 0, function* () {
1155
- const { db, connectionStringWithRandomBadDatabaseName: connectionStringWithRandomBadDatabaseeName, badDatabaseName, } = yield connect();
1155
+ const { db, connectionStringWithRandomBadDatabaseName: connectionStringWithRandomBadDatabaseName, badDatabaseName, } = yield connect();
1156
1156
  yield this.shutdown(db);
1157
- const err = yield assert.doesThrowAsync(() => connect(connectionStringWithRandomBadDatabaseeName));
1157
+ const err = yield assert.doesThrowAsync(() => connect(connectionStringWithRandomBadDatabaseName));
1158
1158
  errorAssert.assertError(err, 'INVALID_DATABASE_NAME', {
1159
1159
  suppliedName: badDatabaseName,
1160
1160
  });
@@ -1055,9 +1055,9 @@ const databaseAssertUtil = {
1055
1055
  await this.shutdown(db);
1056
1056
  },
1057
1057
  async assertThrowsWithBadDatabaseName(connect) {
1058
- const { db, connectionStringWithRandomBadDatabaseName: connectionStringWithRandomBadDatabaseeName, badDatabaseName, } = await connect();
1058
+ const { db, connectionStringWithRandomBadDatabaseName: connectionStringWithRandomBadDatabaseName, badDatabaseName, } = await connect();
1059
1059
  await this.shutdown(db);
1060
- const err = await test_utils_1.assert.doesThrowAsync(() => connect(connectionStringWithRandomBadDatabaseeName));
1060
+ const err = await test_utils_1.assert.doesThrowAsync(() => connect(connectionStringWithRandomBadDatabaseName));
1061
1061
  test_utils_2.errorAssert.assertError(err, 'INVALID_DATABASE_NAME', {
1062
1062
  suppliedName: badDatabaseName,
1063
1063
  });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "28.3.256",
6
+ "version": "28.3.258",
7
7
  "files": [
8
8
  "build/**/*",
9
9
  "!build/__tests__",