@sprucelabs/data-stores 28.1.0 → 28.1.2

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;
9
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
10
10
  const { options } = this;
11
11
  let message;
12
12
  switch (options === null || options === void 0 ? void 0 : options.code) {
@@ -25,7 +25,7 @@ class SpruceError extends error_1.default {
25
25
  return `One or more ${options.collectionName} already have the ${duplicates.join(' and ')} you provided.`;
26
26
  }
27
27
  case 'UNKNOWN_STORE_ERROR':
28
- message = `An unknown error occurred in the ${options.storeName} store. The original error is: \n\n${(_a = options.originalError) === null || _a === void 0 ? void 0 : _a.stack}`;
28
+ message = `An unknown error occurred in the ${options.storeName} store. The original error is: \n\n${(_b = (_a = options.originalError) === null || _a === void 0 ? void 0 : _a.stack) !== null && _b !== void 0 ? _b : (_c = options.originalError) === null || _c === void 0 ? void 0 : _c.message}`;
29
29
  break;
30
30
  case 'RECORD_NOT_FOUND':
31
31
  message = `I looked through all ${options.storeName} and couldn't find what you're looking for.`;
@@ -38,7 +38,7 @@ class SpruceError extends error_1.default {
38
38
  break;
39
39
  case 'INVALID_STORE':
40
40
  message =
41
- (_b = options.friendlyMessage) !== null && _b !== void 0 ? _b : `The store you passed does not extend AbstractStore!`;
41
+ (_d = options.friendlyMessage) !== null && _d !== void 0 ? _d : `The store you passed does not extend AbstractStore!`;
42
42
  break;
43
43
  case 'INVALID_STORE_NAME':
44
44
  message = `I couldn't find a store named '${options.suppliedName}'. `;
@@ -98,7 +98,7 @@ If you are on a mac, using brew is recommended: https://brew.sh`;
98
98
  message = 'Unknown error!';
99
99
  break;
100
100
  case 'DUPLICATE_KEY':
101
- message = `An index was trying to be created that exists. Original error is:\n\n${(_c = options.friendlyMessage) !== null && _c !== void 0 ? _c : '**missing**'}`;
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
102
  break;
103
103
  case 'INVALID_CONNECTION_STRING_SCHEME':
104
104
  message = `There is no database adapter setup for: ${options.connectionString.split('://')[0]}`;
@@ -115,7 +115,7 @@ If you are on a mac, using brew is recommended: https://brew.sh`;
115
115
  default:
116
116
  message = super.friendlyMessage();
117
117
  }
118
- const fullMessage = (_d = options.friendlyMessage) !== null && _d !== void 0 ? _d : message;
118
+ const fullMessage = (_j = options.friendlyMessage) !== null && _j !== void 0 ? _j : message;
119
119
  return fullMessage;
120
120
  }
121
121
  }
@@ -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;
4
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5
5
  const { options } = this;
6
6
  let message;
7
7
  switch (options === null || options === void 0 ? void 0 : options.code) {
@@ -20,7 +20,7 @@ export default class SpruceError extends AbstractSpruceError {
20
20
  return `One or more ${options.collectionName} already have the ${duplicates.join(' and ')} you provided.`;
21
21
  }
22
22
  case 'UNKNOWN_STORE_ERROR':
23
- message = `An unknown error occurred in the ${options.storeName} store. The original error is: \n\n${(_a = options.originalError) === null || _a === void 0 ? void 0 : _a.stack}`;
23
+ message = `An unknown error occurred in the ${options.storeName} store. The original error is: \n\n${(_b = (_a = options.originalError) === null || _a === void 0 ? void 0 : _a.stack) !== null && _b !== void 0 ? _b : (_c = options.originalError) === null || _c === void 0 ? void 0 : _c.message}`;
24
24
  break;
25
25
  case 'RECORD_NOT_FOUND':
26
26
  message = `I looked through all ${options.storeName} and couldn't find what you're looking for.`;
@@ -33,7 +33,7 @@ export default class SpruceError extends AbstractSpruceError {
33
33
  break;
34
34
  case 'INVALID_STORE':
35
35
  message =
36
- (_b = options.friendlyMessage) !== null && _b !== void 0 ? _b : `The store you passed does not extend AbstractStore!`;
36
+ (_d = options.friendlyMessage) !== null && _d !== void 0 ? _d : `The store you passed does not extend AbstractStore!`;
37
37
  break;
38
38
  case 'INVALID_STORE_NAME':
39
39
  message = `I couldn't find a store named '${options.suppliedName}'. `;
@@ -93,7 +93,7 @@ If you are on a mac, using brew is recommended: https://brew.sh`;
93
93
  message = 'Unknown error!';
94
94
  break;
95
95
  case 'DUPLICATE_KEY':
96
- message = `An index was trying to be created that exists. Original error is:\n\n${(_c = options.friendlyMessage) !== null && _c !== void 0 ? _c : '**missing**'}`;
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
97
  break;
98
98
  case 'INVALID_CONNECTION_STRING_SCHEME':
99
99
  message = `There is no database adapter setup for: ${options.connectionString.split('://')[0]}`;
@@ -110,7 +110,7 @@ If you are on a mac, using brew is recommended: https://brew.sh`;
110
110
  default:
111
111
  message = super.friendlyMessage();
112
112
  }
113
- const fullMessage = (_d = options.friendlyMessage) !== null && _d !== void 0 ? _d : message;
113
+ const fullMessage = (_j = options.friendlyMessage) !== null && _j !== void 0 ? _j : message;
114
114
  return fullMessage;
115
115
  }
116
116
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "28.1.0",
6
+ "version": "28.1.2",
7
7
  "files": [
8
8
  "build/**/*",
9
9
  "!build/__tests__",
@@ -67,22 +67,22 @@
67
67
  "upgrade.packages.test": "yarn upgrade.packages.all && yarn lint && yarn build.dev && yarn test"
68
68
  },
69
69
  "dependencies": {
70
- "@sprucelabs/error": "^6.0.34",
71
- "@sprucelabs/globby": "^2.0.16",
72
- "@sprucelabs/schema": "^30.0.62",
73
- "@sprucelabs/spruce-skill-utils": "^31.0.67",
70
+ "@sprucelabs/error": "^6.0.35",
71
+ "@sprucelabs/globby": "^2.0.17",
72
+ "@sprucelabs/schema": "^30.0.63",
73
+ "@sprucelabs/spruce-skill-utils": "^31.0.68",
74
74
  "just-clone": "^6.2.0",
75
75
  "lodash": "^4.17.21",
76
76
  "mongodb": "^6.7.0",
77
77
  "nedb": "^1.8.0"
78
78
  },
79
79
  "devDependencies": {
80
- "@sprucelabs/esm-postbuild": "^6.0.27",
81
- "@sprucelabs/jest-json-reporter": "^8.0.38",
82
- "@sprucelabs/resolve-path-aliases": "^2.0.28",
80
+ "@sprucelabs/esm-postbuild": "^6.0.28",
81
+ "@sprucelabs/jest-json-reporter": "^8.0.39",
82
+ "@sprucelabs/resolve-path-aliases": "^2.0.29",
83
83
  "@sprucelabs/semantic-release": "^5.0.1",
84
- "@sprucelabs/test": "^9.0.18",
85
- "@sprucelabs/test-utils": "^5.0.51",
84
+ "@sprucelabs/test": "^9.0.19",
85
+ "@sprucelabs/test-utils": "^5.0.52",
86
86
  "@types/lodash": "^4.17.4",
87
87
  "@types/nedb": "^1.8.16",
88
88
  "@types/node": "^20.12.13",
@@ -90,7 +90,7 @@
90
90
  "concurrently": "^8.2.2",
91
91
  "dotenv": "^16.4.5",
92
92
  "eslint": "^9.3.0",
93
- "eslint-config-spruce": "^11.2.19",
93
+ "eslint-config-spruce": "^11.2.20",
94
94
  "jest": "^29.7.0",
95
95
  "jest-circus": "^29.7.0",
96
96
  "prettier": "^3.2.5",