@rvoh/dream 0.35.1 → 0.35.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.
- package/dist/cjs/src/Dream.js +1 -12
- package/dist/cjs/src/bin/helpers/sync.js +2 -3
- package/dist/cjs/src/bin/index.js +17 -17
- package/dist/cjs/src/db/DreamDbConnection.js +10 -16
- package/dist/cjs/src/dream-application/index.js +22 -0
- package/dist/cjs/src/helpers/db/createDb.js +3 -3
- package/dist/cjs/src/helpers/db/dropDb.js +8 -5
- package/dist/esm/src/Dream.js +1 -12
- package/dist/esm/src/bin/helpers/sync.js +2 -3
- package/dist/esm/src/bin/index.js +17 -17
- package/dist/esm/src/db/DreamDbConnection.js +10 -16
- package/dist/esm/src/dream-application/index.js +22 -0
- package/dist/esm/src/helpers/db/createDb.js +3 -3
- package/dist/esm/src/helpers/db/dropDb.js +8 -5
- package/dist/types/src/Dream.d.ts +2 -2
- package/dist/types/src/db/DreamDbConnection.d.ts +1 -0
- package/dist/types/src/dream/Query.d.ts +2 -2
- package/dist/types/src/dream-application/index.d.ts +5 -0
- package/dist/types/src/types/query.d.ts +38 -0
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +66 -21
- package/docs/classes/Benchmark.html +2 -2
- package/docs/classes/CalendarDate.html +2 -2
- package/docs/classes/CreateOrFindByFailedToCreateAndFind.html +6 -5
- package/docs/classes/Decorators.html +19 -19
- package/docs/classes/Dream.html +132 -132
- package/docs/classes/DreamApplication.html +9 -5
- package/docs/classes/DreamBin.html +2 -2
- package/docs/classes/DreamCLI.html +4 -4
- package/docs/classes/DreamImporter.html +2 -2
- package/docs/classes/DreamLogos.html +2 -2
- package/docs/classes/DreamMigrationHelpers.html +7 -7
- package/docs/classes/DreamSerializer.html +2 -2
- package/docs/classes/DreamTransaction.html +2 -2
- package/docs/classes/Encrypt.html +2 -2
- package/docs/classes/Env.html +2 -2
- package/docs/classes/GlobalNameNotSet.html +6 -5
- package/docs/classes/NonLoadedAssociation.html +6 -5
- package/docs/classes/Query.html +51 -51
- package/docs/classes/Range.html +2 -2
- package/docs/classes/RecordNotFound.html +6 -5
- package/docs/classes/ValidationError.html +6 -5
- package/docs/functions/Attribute.html +1 -1
- package/docs/functions/RendersMany.html +1 -1
- package/docs/functions/RendersOne.html +1 -1
- package/docs/functions/ReplicaSafe.html +1 -1
- package/docs/functions/STI.html +1 -1
- package/docs/functions/SoftDelete.html +1 -1
- package/docs/functions/camelize.html +1 -1
- package/docs/functions/capitalize.html +1 -1
- package/docs/functions/closeAllDbConnections.html +1 -1
- package/docs/functions/compact.html +1 -1
- package/docs/functions/debug.html +1 -1
- package/docs/functions/dreamDbConnections.html +1 -1
- package/docs/functions/dreamPath.html +1 -1
- package/docs/functions/generateDream.html +1 -1
- package/docs/functions/globalClassNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/hyphenize.html +1 -1
- package/docs/functions/inferSerializerFromDreamClassOrViewModelClass.html +1 -1
- package/docs/functions/inferSerializerFromDreamOrViewModel.html +1 -1
- package/docs/functions/isEmpty.html +1 -1
- package/docs/functions/loadRepl.html +1 -1
- package/docs/functions/lookupClassByGlobalName.html +1 -1
- package/docs/functions/pascalize.html +1 -1
- package/docs/functions/pgErrorType.html +1 -1
- package/docs/functions/range-1.html +1 -1
- package/docs/functions/relativeDreamPath.html +1 -1
- package/docs/functions/round.html +1 -1
- package/docs/functions/serializerNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/sharedPathPrefix.html +1 -1
- package/docs/functions/snakeify.html +1 -1
- package/docs/functions/sort.html +1 -1
- package/docs/functions/sortBy.html +1 -1
- package/docs/functions/standardizeFullyQualifiedModelName.html +1 -1
- package/docs/functions/uncapitalize.html +1 -1
- package/docs/functions/uniq.html +1 -1
- package/docs/functions/untypedDb.html +1 -1
- package/docs/functions/validateColumn.html +1 -1
- package/docs/functions/validateTable.html +1 -1
- package/docs/index.html +7 -7
- package/docs/interfaces/AttributeStatement.html +2 -2
- package/docs/interfaces/DecoratorContext.html +2 -2
- package/docs/interfaces/DreamApplicationInitOptions.html +2 -2
- package/docs/interfaces/DreamApplicationOpts.html +2 -2
- package/docs/interfaces/DreamSerializerAssociationStatement.html +2 -2
- package/docs/interfaces/EncryptOptions.html +2 -2
- package/docs/interfaces/OpenapiSchemaProperties.html +1 -1
- package/docs/interfaces/OpenapiSchemaPropertiesShorthand.html +1 -1
- package/docs/interfaces/OpenapiTypeFieldObject.html +1 -1
- package/docs/modules.html +8 -8
- package/docs/types/Camelized.html +1 -1
- package/docs/types/CommonOpenapiSchemaObjectFields.html +1 -1
- package/docs/types/DateTime.html +1 -1
- package/docs/types/DbConnectionType.html +1 -1
- package/docs/types/DreamAssociationMetadata.html +1 -1
- package/docs/types/DreamAttributes.html +1 -1
- package/docs/types/DreamClassColumn.html +1 -1
- package/docs/types/DreamColumn.html +1 -1
- package/docs/types/DreamColumnNames.html +1 -1
- package/docs/types/DreamLogLevel.html +1 -1
- package/docs/types/DreamLogger.html +1 -1
- package/docs/types/DreamOrViewModelSerializerKey.html +1 -1
- package/docs/types/DreamParamSafeAttributes.html +1 -1
- package/docs/types/DreamParamSafeColumnNames.html +1 -1
- package/docs/types/DreamSerializerKey.html +1 -1
- package/docs/types/DreamSerializers.html +1 -1
- package/docs/types/DreamTableSchema.html +1 -1
- package/docs/types/DreamVirtualColumns.html +1 -1
- package/docs/types/EncryptAlgorithm.html +1 -1
- package/docs/types/Hyphenized.html +1 -1
- package/docs/types/IdType.html +1 -1
- package/docs/types/OpenapiAllTypes.html +1 -1
- package/docs/types/OpenapiFormats.html +1 -1
- package/docs/types/OpenapiNumberFormats.html +1 -1
- package/docs/types/OpenapiPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiSchemaArray.html +1 -1
- package/docs/types/OpenapiSchemaArrayShorthand.html +1 -1
- package/docs/types/OpenapiSchemaBase.html +1 -1
- package/docs/types/OpenapiSchemaBody.html +1 -1
- package/docs/types/OpenapiSchemaBodyShorthand.html +1 -1
- package/docs/types/OpenapiSchemaCommonFields.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRef.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
- package/docs/types/OpenapiSchemaInteger.html +1 -1
- package/docs/types/OpenapiSchemaNull.html +1 -1
- package/docs/types/OpenapiSchemaNumber.html +1 -1
- package/docs/types/OpenapiSchemaObject.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectBase.html +1 -1
- package/docs/types/OpenapiSchemaObjectBaseShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectShorthand.html +1 -1
- package/docs/types/OpenapiSchemaPartialSegment.html +1 -1
- package/docs/types/OpenapiSchemaPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaString.html +1 -1
- package/docs/types/OpenapiShorthandAllTypes.html +1 -1
- package/docs/types/OpenapiShorthandPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiTypeField.html +1 -1
- package/docs/types/Pascalized.html +1 -1
- package/docs/types/PrimaryKeyType.html +1 -1
- package/docs/types/RoundingPrecision.html +1 -1
- package/docs/types/SerializableClassOrSerializerCallback.html +1 -1
- package/docs/types/SerializableDreamClassOrViewModelClass.html +1 -1
- package/docs/types/SerializableDreamOrViewModel.html +1 -1
- package/docs/types/SerializableTypes.html +1 -1
- package/docs/types/Snakeified.html +1 -1
- package/docs/types/Timestamp.html +1 -1
- package/docs/types/UpdateableAssociationProperties.html +1 -1
- package/docs/types/UpdateableProperties.html +1 -1
- package/docs/types/ValidationType.html +1 -1
- package/docs/types/ViewModelSerializerKey.html +1 -1
- package/docs/types/WhereStatementForDream.html +1 -1
- package/docs/types/WhereStatementForDreamClass.html +1 -1
- package/docs/variables/DateTime-1.html +1 -1
- package/docs/variables/DreamConst.html +1 -1
- package/docs/variables/TRIGRAM_OPERATORS.html +1 -1
- package/docs/variables/openapiPrimitiveTypes-1.html +1 -1
- package/docs/variables/openapiShorthandPrimitiveTypes-1.html +1 -1
- package/docs/variables/ops.html +1 -1
- package/docs/variables/primaryKeyTypes.html +1 -1
- package/package.json +3 -3
- package/dist/cjs/src/db/ConnectionConfRetriever.js +0 -22
- package/dist/esm/src/db/ConnectionConfRetriever.js +0 -19
- package/dist/types/src/db/ConnectionConfRetriever.d.ts +0 -6
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const index_js_1 = require("../dream-application/index.js");
|
|
4
|
-
const EnvInternal_js_1 = require("../helpers/EnvInternal.js");
|
|
5
|
-
class ConnectionConfRetriever {
|
|
6
|
-
getConnectionConf(connection) {
|
|
7
|
-
const dreamApplication = index_js_1.default.getOrFail();
|
|
8
|
-
const conf = dreamApplication.dbCredentials?.[connection] || dreamApplication.dbCredentials?.primary;
|
|
9
|
-
if (!conf)
|
|
10
|
-
throw new Error(`
|
|
11
|
-
Cannot find a connection config given the following connection and node environment:
|
|
12
|
-
connection: ${connection}
|
|
13
|
-
NODE_ENV: ${EnvInternal_js_1.default.nodeEnv}
|
|
14
|
-
`);
|
|
15
|
-
return conf;
|
|
16
|
-
}
|
|
17
|
-
hasReplicaConfig() {
|
|
18
|
-
const dreamApplication = index_js_1.default.getOrFail();
|
|
19
|
-
return !!dreamApplication.dbCredentials.replica;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.default = ConnectionConfRetriever;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import DreamApplication from '../dream-application/index.js';
|
|
2
|
-
import EnvInternal from '../helpers/EnvInternal.js';
|
|
3
|
-
export default class ConnectionConfRetriever {
|
|
4
|
-
getConnectionConf(connection) {
|
|
5
|
-
const dreamApplication = DreamApplication.getOrFail();
|
|
6
|
-
const conf = dreamApplication.dbCredentials?.[connection] || dreamApplication.dbCredentials?.primary;
|
|
7
|
-
if (!conf)
|
|
8
|
-
throw new Error(`
|
|
9
|
-
Cannot find a connection config given the following connection and node environment:
|
|
10
|
-
connection: ${connection}
|
|
11
|
-
NODE_ENV: ${EnvInternal.nodeEnv}
|
|
12
|
-
`);
|
|
13
|
-
return conf;
|
|
14
|
-
}
|
|
15
|
-
hasReplicaConfig() {
|
|
16
|
-
const dreamApplication = DreamApplication.getOrFail();
|
|
17
|
-
return !!dreamApplication.dbCredentials.replica;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SingleDbCredential } from '../dream-application/index.js';
|
|
2
|
-
import { DbConnectionType } from '../types/db.js';
|
|
3
|
-
export default class ConnectionConfRetriever {
|
|
4
|
-
getConnectionConf(connection: DbConnectionType): SingleDbCredential;
|
|
5
|
-
hasReplicaConfig(): boolean;
|
|
6
|
-
}
|