@sprucelabs/data-stores 28.3.255 → 28.3.257

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
  }
@@ -32,4 +32,3 @@ export { default as BatchCursorImpl } from './cursors/BatchCursor';
32
32
  export * from './cursors/BatchCursor';
33
33
  export { default as BatchArrayCursor } from './cursors/BatchArrayCursor';
34
34
  export * from './cursors/BatchArrayCursor';
35
- export { default as DataStoreError } from './errors/SpruceError';
@@ -32,4 +32,3 @@ export { default as BatchCursorImpl } from './cursors/BatchCursor.js';
32
32
  export * from './cursors/BatchCursor.js';
33
33
  export { default as BatchArrayCursor } from './cursors/BatchArrayCursor.js';
34
34
  export * from './cursors/BatchArrayCursor.js';
35
- export { default as DataStoreError } from './errors/SpruceError.js';
package/build/index.d.ts CHANGED
@@ -32,4 +32,3 @@ export { default as BatchCursorImpl } from './cursors/BatchCursor';
32
32
  export * from './cursors/BatchCursor';
33
33
  export { default as BatchArrayCursor } from './cursors/BatchArrayCursor';
34
34
  export * from './cursors/BatchArrayCursor';
35
- export { default as DataStoreError } from './errors/SpruceError';
package/build/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.DataStoreError = exports.BatchArrayCursor = exports.BatchCursorImpl = exports.storePluginAssert = exports.databaseAssert = exports.databaseAssertUtil = exports.DatabaseFieldMapperPlugin = exports.CursorPagerFaker = exports.CursorPager = exports.generateId = exports.DataStoresError = exports.mongoUtil = exports.NeDbDatabase = exports.MongoDatabase = exports.StoreLoader = exports.DatabaseFactory = exports.StoreFactory = exports.AbstractStore = exports.DatabaseFixture = exports.AbstractDatabaseTest = void 0;
20
+ exports.BatchArrayCursor = exports.BatchCursorImpl = exports.storePluginAssert = exports.databaseAssert = exports.databaseAssertUtil = exports.DatabaseFieldMapperPlugin = exports.CursorPagerFaker = exports.CursorPager = exports.generateId = exports.DataStoresError = exports.mongoUtil = exports.NeDbDatabase = exports.MongoDatabase = exports.StoreLoader = exports.DatabaseFactory = exports.StoreFactory = exports.AbstractStore = exports.DatabaseFixture = exports.AbstractDatabaseTest = void 0;
21
21
  var AbstractDatabaseTest_1 = require("./tests/AbstractDatabaseTest");
22
22
  Object.defineProperty(exports, "AbstractDatabaseTest", { enumerable: true, get: function () { return __importDefault(AbstractDatabaseTest_1).default; } });
23
23
  var DatabaseFixture_1 = require("./fixtures/DatabaseFixture");
@@ -71,5 +71,3 @@ __exportStar(require("./cursors/BatchCursor"), exports);
71
71
  var BatchArrayCursor_1 = require("./cursors/BatchArrayCursor");
72
72
  Object.defineProperty(exports, "BatchArrayCursor", { enumerable: true, get: function () { return __importDefault(BatchArrayCursor_1).default; } });
73
73
  __exportStar(require("./cursors/BatchArrayCursor"), exports);
74
- var SpruceError_2 = require("./errors/SpruceError");
75
- Object.defineProperty(exports, "DataStoreError", { enumerable: true, get: function () { return __importDefault(SpruceError_2).default; } });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "28.3.255",
6
+ "version": "28.3.257",
7
7
  "files": [
8
8
  "build/**/*",
9
9
  "!build/__tests__",