@sprucelabs/data-stores 26.4.88 → 27.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/build/.spruce/errors/dataStores/databaseNotConnected.schema.js +5 -5
- package/build/.spruce/errors/dataStores/duplicateKey.schema.js +1 -1
- package/build/.spruce/errors/dataStores/duplicateRecord.schema.js +9 -9
- package/build/.spruce/errors/dataStores/failedToLoadStore.schema.js +3 -3
- package/build/.spruce/errors/dataStores/failedToLoadStores.schema.js +5 -3
- package/build/.spruce/errors/dataStores/indexExists.schema.js +5 -5
- package/build/.spruce/errors/dataStores/indexNotFound.schema.js +5 -5
- package/build/.spruce/errors/dataStores/invalidConnectionStringScheme.schema.js +3 -3
- package/build/.spruce/errors/dataStores/invalidDatabaseName.schema.js +3 -3
- package/build/.spruce/errors/dataStores/invalidDbConnectionString.schema.js +1 -1
- package/build/.spruce/errors/dataStores/invalidFakeQueryResponse.schema.js +5 -5
- package/build/.spruce/errors/dataStores/invalidStore.schema copy.js +5 -5
- package/build/.spruce/errors/dataStores/invalidStore.schema.js +1 -1
- package/build/.spruce/errors/dataStores/invalidStoreName.schema.js +5 -5
- package/build/.spruce/errors/dataStores/mongoIdMappingError.schema.js +1 -1
- package/build/.spruce/errors/dataStores/notImplemented.schema.js +1 -1
- package/build/.spruce/errors/dataStores/queryNotFaked.schema.js +5 -5
- package/build/.spruce/errors/dataStores/record-not-found-query.schema.js +1 -1
- package/build/.spruce/errors/dataStores/recordNotFound.schema.js +5 -5
- package/build/.spruce/errors/dataStores/scrambleNotConfigured.schema.js +1 -1
- package/build/.spruce/errors/dataStores/unableToConnectToDb.schema.js +1 -1
- package/build/.spruce/errors/dataStores/unknownDatabaseError.schema.js +3 -3
- package/build/.spruce/errors/dataStores/unknownError.schema.js +1 -1
- package/build/.spruce/errors/dataStores/unknownStoreError.schema.js +5 -5
- package/build/.spruce/errors/errors.types.d.ts +53 -56
- package/build/.spruce/errors/errors.types.js +0 -2
- package/build/.spruce/errors/options.types.d.ts +2 -2
- package/build/.spruce/schemas/fields/fields.types.d.ts +1 -1
- package/build/cursors/BatchArrayCursor.d.ts +2 -2
- package/build/databases/MongoDatabase.js +3 -1
- package/build/databases/NeDbDatabase.js +9 -3
- package/build/databases/mongo.types.d.ts +89 -135
- package/build/databases/mongo.types.js +0 -1
- package/build/errors/SpruceError.d.ts +1 -1
- package/build/errors/SpruceError.js +6 -2
- package/build/errors/failedToLoadStores.builder.js +1 -1
- package/build/errors/mongoIdMappingError.builder.js +0 -2
- package/build/errors/scrambleNotConfigured.builder.js +0 -2
- package/build/esm/.spruce/errors/errors.types.d.ts +53 -56
- package/build/esm/.spruce/errors/errors.types.js +0 -2
- package/build/esm/.spruce/errors/options.types.d.ts +2 -2
- package/build/esm/cursors/BatchArrayCursor.d.ts +2 -2
- package/build/esm/databases/MongoDatabase.js +3 -1
- package/build/esm/databases/NeDbDatabase.js +9 -3
- package/build/esm/databases/mongo.types.d.ts +89 -135
- package/build/esm/databases/mongo.types.js +0 -1
- package/build/esm/errors/SpruceError.d.ts +1 -1
- package/build/esm/errors/SpruceError.js +6 -2
- package/build/esm/errors/failedToLoadStores.builder.js +1 -1
- package/build/esm/errors/mongoIdMappingError.builder.js +0 -2
- package/build/esm/errors/scrambleNotConfigured.builder.js +0 -2
- package/build/esm/loaders/StoreLoader.d.ts +1 -1
- package/build/esm/plugins/DatabaseFieldMapperPlugin.js +3 -1
- package/build/esm/stores/AbstractStore.js +4 -2
- package/build/esm/tests/AbstractDatabaseTest.js +3 -1
- package/build/esm/tests/databaseAssertUtil.js +66 -20
- package/build/esm/types/query.types.d.ts +4 -4
- package/build/esm/types/query.types.js +0 -1
- package/build/loaders/StoreLoader.d.ts +1 -1
- package/build/plugins/DatabaseFieldMapperPlugin.js +3 -1
- package/build/stores/AbstractStore.js +4 -2
- package/build/tests/AbstractDatabaseTest.js +3 -1
- package/build/tests/databaseAssertUtil.js +66 -20
- package/build/types/query.types.d.ts +4 -4
- package/build/types/query.types.js +0 -1
- package/package.json +17 -29
@@ -7,17 +7,17 @@ const databaseNotConnectedSchema = {
|
|
7
7
|
name: 'Database not connected',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
operationAttempted: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
|
-
options: undefined
|
13
|
+
options: undefined,
|
14
14
|
},
|
15
15
|
/** . */
|
16
|
-
|
16
|
+
collectionName: {
|
17
17
|
type: 'text',
|
18
|
-
options: undefined
|
18
|
+
options: undefined,
|
19
19
|
},
|
20
|
-
}
|
20
|
+
},
|
21
21
|
};
|
22
22
|
schema_1.SchemaRegistry.getInstance().trackSchema(databaseNotConnectedSchema);
|
23
23
|
exports.default = databaseNotConnectedSchema;
|
@@ -7,34 +7,34 @@ const duplicateRecordSchema = {
|
|
7
7
|
name: 'Duplicate record',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
duplicateFields: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
13
|
isArray: true,
|
14
|
-
options: undefined
|
14
|
+
options: undefined,
|
15
15
|
},
|
16
16
|
/** . */
|
17
|
-
|
17
|
+
duplicateValues: {
|
18
18
|
type: 'text',
|
19
19
|
isRequired: true,
|
20
20
|
isArray: true,
|
21
|
-
options: undefined
|
21
|
+
options: undefined,
|
22
22
|
},
|
23
23
|
/** . */
|
24
|
-
|
24
|
+
collectionName: {
|
25
25
|
type: 'text',
|
26
26
|
isRequired: true,
|
27
|
-
options: undefined
|
27
|
+
options: undefined,
|
28
28
|
},
|
29
29
|
/** Action. e.g. create, update, etc. */
|
30
|
-
|
30
|
+
action: {
|
31
31
|
label: 'Action',
|
32
32
|
type: 'text',
|
33
33
|
isRequired: true,
|
34
34
|
hint: 'e.g. create, update, etc.',
|
35
|
-
options: undefined
|
35
|
+
options: undefined,
|
36
36
|
},
|
37
|
-
}
|
37
|
+
},
|
38
38
|
};
|
39
39
|
schema_1.SchemaRegistry.getInstance().trackSchema(duplicateRecordSchema);
|
40
40
|
exports.default = duplicateRecordSchema;
|
@@ -7,12 +7,12 @@ const failedToLoadStoreSchema = {
|
|
7
7
|
name: 'Failed to load store',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
name: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
|
-
options: undefined
|
13
|
+
options: undefined,
|
14
14
|
},
|
15
|
-
}
|
15
|
+
},
|
16
16
|
};
|
17
17
|
schema_1.SchemaRegistry.getInstance().trackSchema(failedToLoadStoreSchema);
|
18
18
|
exports.default = failedToLoadStoreSchema;
|
@@ -7,13 +7,15 @@ const failedToLoadStoresSchema = {
|
|
7
7
|
name: 'failed to load stores',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
errors: {
|
11
11
|
type: 'raw',
|
12
12
|
isRequired: true,
|
13
13
|
isArray: true,
|
14
|
-
options: {
|
14
|
+
options: {
|
15
|
+
valueType: `AbstractSpruceError<FailedToLoadStoreErrorOptions>`,
|
16
|
+
},
|
15
17
|
},
|
16
|
-
}
|
18
|
+
},
|
17
19
|
};
|
18
20
|
schema_1.SchemaRegistry.getInstance().trackSchema(failedToLoadStoresSchema);
|
19
21
|
exports.default = failedToLoadStoresSchema;
|
@@ -7,20 +7,20 @@ const indexExistsSchema = {
|
|
7
7
|
name: 'Index Exists',
|
8
8
|
fields: {
|
9
9
|
/** Index Exists. */
|
10
|
-
|
10
|
+
index: {
|
11
11
|
label: 'Index Exists',
|
12
12
|
type: 'text',
|
13
13
|
isRequired: true,
|
14
14
|
isArray: true,
|
15
|
-
options: undefined
|
15
|
+
options: undefined,
|
16
16
|
},
|
17
17
|
/** . */
|
18
|
-
|
18
|
+
collectionName: {
|
19
19
|
type: 'text',
|
20
20
|
isRequired: true,
|
21
|
-
options: undefined
|
21
|
+
options: undefined,
|
22
22
|
},
|
23
|
-
}
|
23
|
+
},
|
24
24
|
};
|
25
25
|
schema_1.SchemaRegistry.getInstance().trackSchema(indexExistsSchema);
|
26
26
|
exports.default = indexExistsSchema;
|
@@ -7,20 +7,20 @@ const indexNotFoundSchema = {
|
|
7
7
|
name: 'Index not found',
|
8
8
|
fields: {
|
9
9
|
/** Missing Index. */
|
10
|
-
|
10
|
+
missingIndex: {
|
11
11
|
label: 'Missing Index',
|
12
12
|
type: 'text',
|
13
13
|
isRequired: true,
|
14
14
|
isArray: true,
|
15
|
-
options: undefined
|
15
|
+
options: undefined,
|
16
16
|
},
|
17
17
|
/** . */
|
18
|
-
|
18
|
+
collectionName: {
|
19
19
|
type: 'text',
|
20
20
|
isRequired: true,
|
21
|
-
options: undefined
|
21
|
+
options: undefined,
|
22
22
|
},
|
23
|
-
}
|
23
|
+
},
|
24
24
|
};
|
25
25
|
schema_1.SchemaRegistry.getInstance().trackSchema(indexNotFoundSchema);
|
26
26
|
exports.default = indexNotFoundSchema;
|
@@ -7,12 +7,12 @@ const invalidConnectionStringSchemeSchema = {
|
|
7
7
|
name: 'Invalid connection string scheme',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
connectionString: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
|
-
options: undefined
|
13
|
+
options: undefined,
|
14
14
|
},
|
15
|
-
}
|
15
|
+
},
|
16
16
|
};
|
17
17
|
schema_1.SchemaRegistry.getInstance().trackSchema(invalidConnectionStringSchemeSchema);
|
18
18
|
exports.default = invalidConnectionStringSchemeSchema;
|
@@ -7,12 +7,12 @@ const invalidDatabaseNameSchema = {
|
|
7
7
|
name: 'Invalid database name',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
suppliedName: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
|
-
options: undefined
|
13
|
+
options: undefined,
|
14
14
|
},
|
15
|
-
}
|
15
|
+
},
|
16
16
|
};
|
17
17
|
schema_1.SchemaRegistry.getInstance().trackSchema(invalidDatabaseNameSchema);
|
18
18
|
exports.default = invalidDatabaseNameSchema;
|
@@ -5,7 +5,7 @@ const invalidDbConnectionStringSchema = {
|
|
5
5
|
id: 'invalidDbConnectionString',
|
6
6
|
namespace: 'DataStores',
|
7
7
|
name: 'Invalid db connection string',
|
8
|
-
fields: {}
|
8
|
+
fields: {},
|
9
9
|
};
|
10
10
|
schema_1.SchemaRegistry.getInstance().trackSchema(invalidDbConnectionStringSchema);
|
11
11
|
exports.default = invalidDbConnectionStringSchema;
|
@@ -7,18 +7,18 @@ const invalidFakeQueryResponseSchema = {
|
|
7
7
|
name: 'Invalid fake query response',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
query: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
|
-
options: undefined
|
13
|
+
options: undefined,
|
14
14
|
},
|
15
15
|
/** . */
|
16
|
-
|
16
|
+
response: {
|
17
17
|
type: 'raw',
|
18
18
|
isRequired: true,
|
19
|
-
options: { valueType: `any
|
19
|
+
options: { valueType: `any` },
|
20
20
|
},
|
21
|
-
}
|
21
|
+
},
|
22
22
|
};
|
23
23
|
schema_1.SchemaRegistry.getInstance().trackSchema(invalidFakeQueryResponseSchema);
|
24
24
|
exports.default = invalidFakeQueryResponseSchema;
|
@@ -7,19 +7,19 @@ const invalidStoreSchema = {
|
|
7
7
|
name: 'Invalid store',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
suppliedName: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
|
-
options: undefined
|
13
|
+
options: undefined,
|
14
14
|
},
|
15
15
|
/** . */
|
16
|
-
|
16
|
+
validNames: {
|
17
17
|
type: 'text',
|
18
18
|
isRequired: true,
|
19
19
|
isArray: true,
|
20
|
-
options: undefined
|
20
|
+
options: undefined,
|
21
21
|
},
|
22
|
-
}
|
22
|
+
},
|
23
23
|
};
|
24
24
|
schema_1.SchemaRegistry.getInstance().trackSchema(invalidStoreSchema);
|
25
25
|
exports.default = invalidStoreSchema;
|
@@ -7,19 +7,19 @@ const invalidStoreNameSchema = {
|
|
7
7
|
name: 'Invalid store',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
suppliedName: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
|
-
options: undefined
|
13
|
+
options: undefined,
|
14
14
|
},
|
15
15
|
/** . */
|
16
|
-
|
16
|
+
validNames: {
|
17
17
|
type: 'text',
|
18
18
|
isRequired: true,
|
19
19
|
isArray: true,
|
20
|
-
options: undefined
|
20
|
+
options: undefined,
|
21
21
|
},
|
22
|
-
}
|
22
|
+
},
|
23
23
|
};
|
24
24
|
schema_1.SchemaRegistry.getInstance().trackSchema(invalidStoreNameSchema);
|
25
25
|
exports.default = invalidStoreNameSchema;
|
@@ -5,7 +5,7 @@ const mongoIdMappingErrorSchema = {
|
|
5
5
|
id: 'mongoIdMappingError',
|
6
6
|
namespace: 'DataStores',
|
7
7
|
name: 'Mongo id mapping error',
|
8
|
-
fields: {}
|
8
|
+
fields: {},
|
9
9
|
};
|
10
10
|
schema_1.SchemaRegistry.getInstance().trackSchema(mongoIdMappingErrorSchema);
|
11
11
|
exports.default = mongoIdMappingErrorSchema;
|
@@ -7,17 +7,17 @@ const queryNotFakedSchema = {
|
|
7
7
|
name: 'Query not faked',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
query: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
|
-
options: undefined
|
13
|
+
options: undefined,
|
14
14
|
},
|
15
15
|
/** . */
|
16
|
-
|
16
|
+
params: {
|
17
17
|
type: 'raw',
|
18
|
-
options: { valueType: `Record<string, any
|
18
|
+
options: { valueType: `Record<string, any>` },
|
19
19
|
},
|
20
|
-
}
|
20
|
+
},
|
21
21
|
};
|
22
22
|
schema_1.SchemaRegistry.getInstance().trackSchema(queryNotFakedSchema);
|
23
23
|
exports.default = queryNotFakedSchema;
|
@@ -11,20 +11,20 @@ const recordNotFoundSchema = {
|
|
11
11
|
name: 'Record not found',
|
12
12
|
fields: {
|
13
13
|
/** Store name. */
|
14
|
-
|
14
|
+
storeName: {
|
15
15
|
label: 'Store name',
|
16
16
|
type: 'text',
|
17
17
|
isRequired: true,
|
18
|
-
options: undefined
|
18
|
+
options: undefined,
|
19
19
|
},
|
20
20
|
/** Query. */
|
21
|
-
|
21
|
+
query: {
|
22
22
|
label: 'Query',
|
23
23
|
type: 'schema',
|
24
24
|
isRequired: true,
|
25
|
-
options: { schema: record_not_found_query_schema_1.default
|
25
|
+
options: { schema: record_not_found_query_schema_1.default },
|
26
26
|
},
|
27
|
-
}
|
27
|
+
},
|
28
28
|
};
|
29
29
|
schema_1.SchemaRegistry.getInstance().trackSchema(recordNotFoundSchema);
|
30
30
|
exports.default = recordNotFoundSchema;
|
@@ -5,7 +5,7 @@ const scrambleNotConfiguredSchema = {
|
|
5
5
|
id: 'scrambleNotConfigured',
|
6
6
|
namespace: 'DataStores',
|
7
7
|
name: 'Scramble not configured',
|
8
|
-
fields: {}
|
8
|
+
fields: {},
|
9
9
|
};
|
10
10
|
schema_1.SchemaRegistry.getInstance().trackSchema(scrambleNotConfiguredSchema);
|
11
11
|
exports.default = scrambleNotConfiguredSchema;
|
@@ -5,7 +5,7 @@ const unableToConnectToDbSchema = {
|
|
5
5
|
id: 'unableToConnectToDb',
|
6
6
|
namespace: 'DataStores',
|
7
7
|
name: 'Unable to connect to db',
|
8
|
-
fields: {}
|
8
|
+
fields: {},
|
9
9
|
};
|
10
10
|
schema_1.SchemaRegistry.getInstance().trackSchema(unableToConnectToDbSchema);
|
11
11
|
exports.default = unableToConnectToDbSchema;
|
@@ -7,12 +7,12 @@ const unknownDatabaseErrorSchema = {
|
|
7
7
|
name: 'unknown database error',
|
8
8
|
fields: {
|
9
9
|
/** . */
|
10
|
-
|
10
|
+
databaseErrorMessage: {
|
11
11
|
type: 'text',
|
12
12
|
isRequired: true,
|
13
|
-
options: undefined
|
13
|
+
options: undefined,
|
14
14
|
},
|
15
|
-
}
|
15
|
+
},
|
16
16
|
};
|
17
17
|
schema_1.SchemaRegistry.getInstance().trackSchema(unknownDatabaseErrorSchema);
|
18
18
|
exports.default = unknownDatabaseErrorSchema;
|
@@ -7,21 +7,21 @@ const unknownStoreErrorSchema = {
|
|
7
7
|
name: 'Unknown store error',
|
8
8
|
fields: {
|
9
9
|
/** Action. e.g. createPerson, updateLocation, etc */
|
10
|
-
|
10
|
+
action: {
|
11
11
|
label: 'Action',
|
12
12
|
type: 'text',
|
13
13
|
isRequired: true,
|
14
14
|
hint: 'e.g. createPerson, updateLocation, etc',
|
15
|
-
options: undefined
|
15
|
+
options: undefined,
|
16
16
|
},
|
17
17
|
/** Store name. */
|
18
|
-
|
18
|
+
storeName: {
|
19
19
|
label: 'Store name',
|
20
20
|
type: 'text',
|
21
21
|
isRequired: true,
|
22
|
-
options: undefined
|
22
|
+
options: undefined,
|
23
23
|
},
|
24
|
-
}
|
24
|
+
},
|
25
25
|
};
|
26
26
|
schema_1.SchemaRegistry.getInstance().trackSchema(unknownStoreErrorSchema);
|
27
27
|
exports.default = unknownStoreErrorSchema;
|