@sprucelabs/spruce-store-plugin 62.3.44 → 62.3.45
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.
|
@@ -8,7 +8,7 @@ class SpruceError extends error_1.default {
|
|
|
8
8
|
friendlyMessage() {
|
|
9
9
|
const { options } = this;
|
|
10
10
|
let message;
|
|
11
|
-
switch (options
|
|
11
|
+
switch (options?.code) {
|
|
12
12
|
case 'FAILED_TO_LOAD_STORE':
|
|
13
13
|
message = `Dang it, I couldn't load your ${options.name} store!`;
|
|
14
14
|
if (options.originalError) {
|
|
@@ -19,7 +19,6 @@ class StoreFeaturePlugin {
|
|
|
19
19
|
this.bootHandler = cb;
|
|
20
20
|
}
|
|
21
21
|
async execute() {
|
|
22
|
-
var _a;
|
|
23
22
|
this.isExecuting = true;
|
|
24
23
|
try {
|
|
25
24
|
const { errors, factory, db } = await this.loadStores();
|
|
@@ -30,7 +29,7 @@ class StoreFeaturePlugin {
|
|
|
30
29
|
this.skill.updateContext('storeFactory', this.storeFactory);
|
|
31
30
|
this.skill.updateContext('stores', this.storeFactory);
|
|
32
31
|
this.skill.updateContext('database', db);
|
|
33
|
-
await
|
|
32
|
+
await this.bootHandler?.();
|
|
34
33
|
}
|
|
35
34
|
finally {
|
|
36
35
|
this.isExecuting = false;
|
|
@@ -42,7 +41,7 @@ class StoreFeaturePlugin {
|
|
|
42
41
|
await this.connectToDatabase();
|
|
43
42
|
isConnected = true;
|
|
44
43
|
}
|
|
45
|
-
catch
|
|
44
|
+
catch { }
|
|
46
45
|
const { stores, errors } = await this.loadStores({
|
|
47
46
|
dbConnectionString: 'memory://',
|
|
48
47
|
});
|
|
@@ -57,10 +56,9 @@ class StoreFeaturePlugin {
|
|
|
57
56
|
return checkItem;
|
|
58
57
|
}
|
|
59
58
|
async connectToDatabase(options) {
|
|
60
|
-
var _a, _b;
|
|
61
59
|
if (!this.db) {
|
|
62
|
-
const dbName =
|
|
63
|
-
const dbConnectionString =
|
|
60
|
+
const dbName = options?.dbName ?? this.dbName;
|
|
61
|
+
const dbConnectionString = options?.dbConnectionString ?? this.dbConnectionString;
|
|
64
62
|
const missing = [];
|
|
65
63
|
if (process.env.DB_ADAPTER) {
|
|
66
64
|
try {
|
|
@@ -11,8 +11,11 @@ class AbstractStorePluginTest extends spruce_test_fixtures_1.AbstractSpruceFixtu
|
|
|
11
11
|
return db;
|
|
12
12
|
}
|
|
13
13
|
static Skill(options) {
|
|
14
|
-
const { plugins = [store_plugin_1.default] } = options
|
|
15
|
-
return super.Skill(
|
|
14
|
+
const { plugins = [store_plugin_1.default] } = options ?? {};
|
|
15
|
+
return super.Skill({
|
|
16
|
+
plugins,
|
|
17
|
+
...options,
|
|
18
|
+
});
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
exports.default = AbstractStorePluginTest;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "62.3.
|
|
6
|
+
"version": "62.3.45",
|
|
7
7
|
"files": [
|
|
8
8
|
"build/**/*",
|
|
9
9
|
"!build/__tests__",
|
|
@@ -62,23 +62,23 @@
|
|
|
62
62
|
"lint.tsc": "tsc -p . --noEmit"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@sprucelabs/data-stores": "^28.3.
|
|
66
|
-
"@sprucelabs/error": "^6.0.
|
|
67
|
-
"@sprucelabs/schema": "^30.0.
|
|
68
|
-
"@sprucelabs/spruce-core-schemas": "^40.1.
|
|
69
|
-
"@sprucelabs/spruce-event-utils": "^40.1.
|
|
70
|
-
"@sprucelabs/spruce-skill-booter": "^62.3.
|
|
71
|
-
"@sprucelabs/spruce-skill-utils": "^31.0.
|
|
72
|
-
"@sprucelabs/spruce-test-fixtures": "^62.3.
|
|
65
|
+
"@sprucelabs/data-stores": "^28.3.141",
|
|
66
|
+
"@sprucelabs/error": "^6.0.479",
|
|
67
|
+
"@sprucelabs/schema": "^30.0.488",
|
|
68
|
+
"@sprucelabs/spruce-core-schemas": "^40.1.473",
|
|
69
|
+
"@sprucelabs/spruce-event-utils": "^40.1.249",
|
|
70
|
+
"@sprucelabs/spruce-skill-booter": "^62.3.45",
|
|
71
|
+
"@sprucelabs/spruce-skill-utils": "^31.0.547",
|
|
72
|
+
"@sprucelabs/spruce-test-fixtures": "^62.3.45",
|
|
73
73
|
"heroku-client": "^3.1.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@sprucelabs/esm-postbuild": "^6.0.
|
|
77
|
-
"@sprucelabs/jest-json-reporter": "^8.0.
|
|
78
|
-
"@sprucelabs/resolve-path-aliases": "^2.0.
|
|
76
|
+
"@sprucelabs/esm-postbuild": "^6.0.462",
|
|
77
|
+
"@sprucelabs/jest-json-reporter": "^8.0.480",
|
|
78
|
+
"@sprucelabs/resolve-path-aliases": "^2.0.457",
|
|
79
79
|
"@sprucelabs/semantic-release": "^5.0.2",
|
|
80
|
-
"@sprucelabs/test": "^9.0.
|
|
81
|
-
"@sprucelabs/test-utils": "^5.1.
|
|
80
|
+
"@sprucelabs/test": "^9.0.51",
|
|
81
|
+
"@sprucelabs/test-utils": "^5.1.432",
|
|
82
82
|
"chokidar-cli": "^3.0.0",
|
|
83
83
|
"eslint": "^9.12.0",
|
|
84
84
|
"eslint-config-spruce": "^11.2.26",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"^#spruce/(.*)$": "<rootDir>/build/.spruce/$1"
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "59b913c0b16c2e83a7506abd5618082abfcd1f65"
|
|
111
111
|
}
|
package/tsconfig.json
CHANGED