@rvoh/dream 0.29.2 → 0.29.4
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 +59 -2
- package/dist/cjs/src/decorators/Decorators.js +34 -26
- package/dist/cjs/src/decorators/STI.js +1 -1
- package/dist/cjs/src/decorators/associations/shared.js +3 -3
- package/dist/cjs/src/decorators/hooks/AfterCreate.js +1 -1
- package/dist/cjs/src/decorators/hooks/AfterCreateCommit.js +1 -1
- package/dist/cjs/src/decorators/hooks/AfterDestroy.js +1 -1
- package/dist/cjs/src/decorators/hooks/AfterDestroyCommit.js +1 -1
- package/dist/cjs/src/decorators/hooks/AfterSave.js +1 -1
- package/dist/cjs/src/decorators/hooks/AfterSaveCommit.js +1 -1
- package/dist/cjs/src/decorators/hooks/AfterUpdate.js +1 -1
- package/dist/cjs/src/decorators/hooks/AfterUpdateCommit.js +1 -1
- package/dist/cjs/src/decorators/hooks/BeforeCreate.js +1 -1
- package/dist/cjs/src/decorators/hooks/BeforeDestroy.js +1 -1
- package/dist/cjs/src/decorators/hooks/BeforeSave.js +1 -1
- package/dist/cjs/src/decorators/hooks/BeforeUpdate.js +1 -1
- package/dist/cjs/src/decorators/sortable/Sortable.js +8 -19
- package/dist/cjs/src/dream/Query.js +8 -8
- package/dist/cjs/src/dream/internal/associations/createAssociation.js +1 -1
- package/dist/cjs/src/dream/internal/runHooksFor.js +1 -1
- package/dist/cjs/src/dream/internal/saveDream.js +1 -1
- package/dist/cjs/src/dream/internal/sqlResultToDreamInstance.js +1 -1
- package/dist/cjs/src/errors/CannotCallUndestroyOnANonSoftDeleteModel.js +1 -1
- package/dist/cjs/src/errors/CannotDefineAssociationWithBothDependentAndPassthrough.js +1 -1
- package/dist/cjs/src/errors/CannotDefineAssociationWithBothDependentAndRequiredOnClause.js +1 -1
- package/dist/cjs/src/errors/CannotPassUndefinedAsAValueToAWhereClause.js +1 -1
- package/dist/cjs/src/errors/CannotReloadUnsavedDream.js +1 -1
- package/dist/cjs/src/errors/CreateOrFindByFailedToCreateAndFind.js +1 -1
- package/dist/cjs/src/errors/DoNotSetEncryptedFieldsDirectly.js +1 -1
- package/dist/cjs/src/errors/MissingDeletedAtFieldForSoftDelete.js +1 -1
- package/dist/cjs/src/errors/MissingSerializersDefinition.js +5 -5
- package/dist/cjs/src/errors/MissingTable.js +4 -4
- package/dist/cjs/src/errors/NonBelongsToAssociationProvidedAsSortableDecoratorScope.js +2 -2
- package/dist/cjs/src/errors/NonExistentScopeProvidedToResort.js +2 -2
- package/dist/cjs/src/errors/SortableDecoratorRequiresColumnOrBelongsToAssociation.js +3 -3
- package/dist/cjs/src/errors/associations/CanOnlyPassBelongsToModelParam.js +1 -1
- package/dist/cjs/src/errors/associations/CannotAssociateThroughPolymorphic.js +1 -1
- package/dist/cjs/src/errors/associations/CannotCreateAssociationWithThroughContext.js +1 -1
- package/dist/cjs/src/errors/associations/CannotJoinPolymorphicBelongsToError.js +1 -1
- package/dist/cjs/src/errors/associations/CannotPassNullOrUndefinedToRequiredBelongsTo.js +1 -1
- package/dist/cjs/src/errors/associations/InvalidComputedForeignKey.js +2 -2
- package/dist/cjs/src/errors/associations/JoinAttemptedOnMissingAssociation.js +4 -4
- package/dist/cjs/src/errors/associations/MissingThroughAssociation.js +4 -4
- package/dist/cjs/src/errors/associations/MissingThroughAssociationSource.js +10 -10
- package/dist/cjs/src/errors/associations/NonLoadedAssociation.js +1 -1
- package/dist/cjs/src/errors/ops/AnyRequiresArrayColumn.js +1 -1
- package/dist/cjs/src/errors/schema-builder/FailedToIdentifyAssociation.js +4 -4
- package/dist/cjs/src/errors/sti/STIChildMissing.js +1 -1
- package/dist/cjs/src/errors/sti/StiChildIncompatibleWithSoftDeleteDecorator.js +1 -1
- package/dist/cjs/src/index.js +2 -28
- package/dist/esm/src/Dream.js +59 -2
- package/dist/esm/src/decorators/Decorators.js +34 -26
- package/dist/esm/src/decorators/STI.js +1 -1
- package/dist/esm/src/decorators/associations/shared.js +3 -3
- package/dist/esm/src/decorators/hooks/AfterCreate.js +1 -1
- package/dist/esm/src/decorators/hooks/AfterCreateCommit.js +1 -1
- package/dist/esm/src/decorators/hooks/AfterDestroy.js +1 -1
- package/dist/esm/src/decorators/hooks/AfterDestroyCommit.js +1 -1
- package/dist/esm/src/decorators/hooks/AfterSave.js +1 -1
- package/dist/esm/src/decorators/hooks/AfterSaveCommit.js +1 -1
- package/dist/esm/src/decorators/hooks/AfterUpdate.js +1 -1
- package/dist/esm/src/decorators/hooks/AfterUpdateCommit.js +1 -1
- package/dist/esm/src/decorators/hooks/BeforeCreate.js +1 -1
- package/dist/esm/src/decorators/hooks/BeforeDestroy.js +1 -1
- package/dist/esm/src/decorators/hooks/BeforeSave.js +1 -1
- package/dist/esm/src/decorators/hooks/BeforeUpdate.js +1 -1
- package/dist/esm/src/decorators/sortable/Sortable.js +8 -19
- package/dist/esm/src/dream/Query.js +8 -8
- package/dist/esm/src/dream/internal/associations/createAssociation.js +1 -1
- package/dist/esm/src/dream/internal/runHooksFor.js +1 -1
- package/dist/esm/src/dream/internal/saveDream.js +1 -1
- package/dist/esm/src/dream/internal/sqlResultToDreamInstance.js +1 -1
- package/dist/esm/src/errors/CannotCallUndestroyOnANonSoftDeleteModel.js +1 -1
- package/dist/esm/src/errors/CannotDefineAssociationWithBothDependentAndPassthrough.js +1 -1
- package/dist/esm/src/errors/CannotDefineAssociationWithBothDependentAndRequiredOnClause.js +1 -1
- package/dist/esm/src/errors/CannotPassUndefinedAsAValueToAWhereClause.js +1 -1
- package/dist/esm/src/errors/CannotReloadUnsavedDream.js +1 -1
- package/dist/esm/src/errors/CreateOrFindByFailedToCreateAndFind.js +1 -1
- package/dist/esm/src/errors/DoNotSetEncryptedFieldsDirectly.js +1 -1
- package/dist/esm/src/errors/MissingDeletedAtFieldForSoftDelete.js +1 -1
- package/dist/esm/src/errors/MissingSerializersDefinition.js +5 -5
- package/dist/esm/src/errors/MissingTable.js +4 -4
- package/dist/esm/src/errors/NonBelongsToAssociationProvidedAsSortableDecoratorScope.js +2 -2
- package/dist/esm/src/errors/NonExistentScopeProvidedToResort.js +2 -2
- package/dist/esm/src/errors/SortableDecoratorRequiresColumnOrBelongsToAssociation.js +3 -3
- package/dist/esm/src/errors/associations/CanOnlyPassBelongsToModelParam.js +1 -1
- package/dist/esm/src/errors/associations/CannotAssociateThroughPolymorphic.js +1 -1
- package/dist/esm/src/errors/associations/CannotCreateAssociationWithThroughContext.js +1 -1
- package/dist/esm/src/errors/associations/CannotJoinPolymorphicBelongsToError.js +1 -1
- package/dist/esm/src/errors/associations/CannotPassNullOrUndefinedToRequiredBelongsTo.js +1 -1
- package/dist/esm/src/errors/associations/InvalidComputedForeignKey.js +2 -2
- package/dist/esm/src/errors/associations/JoinAttemptedOnMissingAssociation.js +4 -4
- package/dist/esm/src/errors/associations/MissingThroughAssociation.js +4 -4
- package/dist/esm/src/errors/associations/MissingThroughAssociationSource.js +10 -10
- package/dist/esm/src/errors/associations/NonLoadedAssociation.js +1 -1
- package/dist/esm/src/errors/ops/AnyRequiresArrayColumn.js +1 -1
- package/dist/esm/src/errors/schema-builder/FailedToIdentifyAssociation.js +4 -4
- package/dist/esm/src/errors/sti/STIChildMissing.js +1 -1
- package/dist/esm/src/errors/sti/StiChildIncompatibleWithSoftDeleteDecorator.js +1 -1
- package/dist/esm/src/index.js +0 -13
- package/dist/types/src/Dream.d.ts +50 -1
- package/dist/types/src/decorators/Decorators.d.ts +34 -26
- package/dist/types/src/index.d.ts +0 -13
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Benchmark.html +2 -2
- package/docs/classes/CalendarDate.html +2 -2
- package/docs/classes/CreateOrFindByFailedToCreateAndFind.html +3 -3
- package/docs/classes/Decorators.html +31 -28
- package/docs/classes/Dream.html +147 -123
- package/docs/classes/DreamApplication.html +4 -4
- package/docs/classes/DreamBin.html +2 -2
- package/docs/classes/DreamCLI.html +3 -3
- package/docs/classes/DreamImporter.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 +3 -3
- package/docs/classes/NonLoadedAssociation.html +3 -3
- package/docs/classes/Query.html +50 -50
- package/docs/classes/Range.html +2 -2
- package/docs/classes/RecordNotFound.html +3 -3
- package/docs/classes/ValidationError.html +3 -3
- 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/Scope.html +1 -1
- package/docs/functions/SoftDelete.html +1 -1
- package/docs/functions/Validate.html +1 -1
- package/docs/functions/Validates.html +1 -1
- package/docs/functions/Virtual.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/db.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/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/validateColumn.html +1 -1
- package/docs/functions/validateTable.html +1 -1
- 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 +1 -14
- package/docs/types/Camelized.html +1 -1
- package/docs/types/CommonOpenapiSchemaObjectFields.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/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 +1 -1
- package/dist/cjs/src/errors/sortable/CannotCallSortableOnSTIChild.js +0 -18
- package/dist/esm/src/errors/sortable/CannotCallSortableOnSTIChild.js +0 -15
- package/dist/types/src/errors/sortable/CannotCallSortableOnSTIChild.d.ts +0 -6
- package/docs/functions/AfterCreate.html +0 -1
- package/docs/functions/AfterCreateCommit.html +0 -13
- package/docs/functions/AfterDestroy.html +0 -1
- package/docs/functions/AfterDestroyCommit.html +0 -13
- package/docs/functions/AfterSave.html +0 -1
- package/docs/functions/AfterSaveCommit.html +0 -13
- package/docs/functions/AfterUpdate.html +0 -1
- package/docs/functions/AfterUpdateCommit.html +0 -13
- package/docs/functions/BeforeCreate.html +0 -1
- package/docs/functions/BeforeDestroy.html +0 -1
- package/docs/functions/BeforeSave.html +0 -1
- package/docs/functions/BeforeUpdate.html +0 -1
- package/docs/functions/Sortable.html +0 -1
|
@@ -9,14 +9,14 @@ export default class MissingTable extends Error {
|
|
|
9
9
|
get message() {
|
|
10
10
|
return `
|
|
11
11
|
Missing table definition on the following dream class:
|
|
12
|
-
Dream class: ${this.dreamClass.
|
|
12
|
+
Dream class: ${this.dreamClass.sanitizedName}
|
|
13
13
|
|
|
14
|
-
Try something like this in your ${this.dreamClass.
|
|
14
|
+
Try something like this in your ${this.dreamClass.sanitizedName}'s table getter:
|
|
15
15
|
|
|
16
|
-
class ${this.dreamClass.
|
|
16
|
+
class ${this.dreamClass.sanitizedName} {
|
|
17
17
|
...
|
|
18
18
|
public get table() {
|
|
19
|
-
return '${pluralize(snakeify(this.dreamClass.
|
|
19
|
+
return '${pluralize(snakeify(this.dreamClass.sanitizedName))}'
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
@@ -10,10 +10,10 @@ export default class NonBelongsToAssociationProvidedAsSortableDecoratorScope ext
|
|
|
10
10
|
return `
|
|
11
11
|
Only BelongsTo associations are supported as scopes for the @Sortable decorator.
|
|
12
12
|
received:
|
|
13
|
-
dream model class: ${this.dreamClass.
|
|
13
|
+
dream model class: ${this.dreamClass.sanitizedName}
|
|
14
14
|
scope: ${this.scope}
|
|
15
15
|
|
|
16
|
-
BelongsTo scopes on ${this.dreamClass.
|
|
16
|
+
BelongsTo scopes on ${this.dreamClass.sanitizedName} are:
|
|
17
17
|
${this.dreamClass['associationMetadataByType'].belongsTo.map(assoc => assoc.as).join('\n ')}
|
|
18
18
|
`;
|
|
19
19
|
}
|
|
@@ -10,10 +10,10 @@ export default class NonExistentScopeProvidedToResort extends Error {
|
|
|
10
10
|
return `
|
|
11
11
|
Only BelongsTo scopes are supported by the #resort method
|
|
12
12
|
received:
|
|
13
|
-
dream model class: ${this.dreamClass.
|
|
13
|
+
dream model class: ${this.dreamClass.sanitizedName}
|
|
14
14
|
scope: ${this.scopes.join(', ')}
|
|
15
15
|
|
|
16
|
-
BelongsTo scopes on ${this.dreamClass.
|
|
16
|
+
BelongsTo scopes on ${this.dreamClass.sanitizedName} are:
|
|
17
17
|
${this.dreamClass['sortableFields'].map(conf => conf.positionField).join('\n ')}
|
|
18
18
|
`;
|
|
19
19
|
}
|
|
@@ -10,13 +10,13 @@ export default class SortableDecoratorRequiresColumnOrBelongsToAssociation exten
|
|
|
10
10
|
return `
|
|
11
11
|
Only Column or BelongsTo scopes are supported by the @Sortable decorator.
|
|
12
12
|
received:
|
|
13
|
-
dream model class: ${this.dreamClass.
|
|
13
|
+
dream model class: ${this.dreamClass.sanitizedName}
|
|
14
14
|
scope: ${this.attributeOrScope}
|
|
15
15
|
|
|
16
|
-
Columns on ${this.dreamClass.
|
|
16
|
+
Columns on ${this.dreamClass.sanitizedName} are:
|
|
17
17
|
${[...this.dreamClass.columns()].join('\n ')}
|
|
18
18
|
|
|
19
|
-
BelongsTo scopes on ${this.dreamClass.
|
|
19
|
+
BelongsTo scopes on ${this.dreamClass.sanitizedName} are:
|
|
20
20
|
${this.dreamClass['associationMetadataByType'].belongsTo.map(assoc => assoc.as).join('\n ')}
|
|
21
21
|
`;
|
|
22
22
|
}
|
|
@@ -9,7 +9,7 @@ export default class CanOnlyPassBelongsToModelParam extends Error {
|
|
|
9
9
|
get message() {
|
|
10
10
|
return `
|
|
11
11
|
Can only pass BelongsTo associated models as params
|
|
12
|
-
Dream class: ${this.dreamClass.
|
|
12
|
+
Dream class: ${this.dreamClass.sanitizedName}
|
|
13
13
|
Association: ${this.association.as}
|
|
14
14
|
Association type: ${this.association.type}
|
|
15
15
|
`;
|
|
@@ -9,7 +9,7 @@ export default class CannotAssociateThroughPolymorphic extends Error {
|
|
|
9
9
|
get message() {
|
|
10
10
|
return `
|
|
11
11
|
Cannot join through a polymorphic association
|
|
12
|
-
Dream class: ${this.dreamClass.
|
|
12
|
+
Dream class: ${this.dreamClass.sanitizedName}
|
|
13
13
|
Association: ${this.association.as}
|
|
14
14
|
`;
|
|
15
15
|
}
|
|
@@ -9,7 +9,7 @@ export default class CannotCreateAssociationWithThroughContext extends Error {
|
|
|
9
9
|
get message() {
|
|
10
10
|
return `
|
|
11
11
|
'createAssociation' is not supported for through associations.
|
|
12
|
-
Dream class: ${this.dreamClass.
|
|
12
|
+
Dream class: ${this.dreamClass.sanitizedName}
|
|
13
13
|
Association: ${this.association.as}
|
|
14
14
|
`;
|
|
15
15
|
}
|
|
@@ -13,7 +13,7 @@ export default class CannotJoinPolymorphicBelongsToError extends Error {
|
|
|
13
13
|
get message() {
|
|
14
14
|
return `
|
|
15
15
|
Cannot join on a polymorphic BelongsTo
|
|
16
|
-
Dream class: ${this.dreamClass.
|
|
16
|
+
Dream class: ${this.dreamClass.sanitizedName}
|
|
17
17
|
Association: ${this.association.as}
|
|
18
18
|
Inner Join statements:
|
|
19
19
|
${JSON.stringify(this.innerJoinStatements, null, 2)}
|
|
@@ -9,7 +9,7 @@ export default class CannotPassNullOrUndefinedToRequiredBelongsTo extends Error
|
|
|
9
9
|
get message() {
|
|
10
10
|
return `
|
|
11
11
|
Cannot pass null or undefined as a value to a required association.
|
|
12
|
-
Dream class: ${this.dreamClass.
|
|
12
|
+
Dream class: ${this.dreamClass.sanitizedName}
|
|
13
13
|
Association: ${this.association.as}
|
|
14
14
|
`;
|
|
15
15
|
}
|
|
@@ -14,7 +14,7 @@ export class InvalidComputedForeignKey extends Error {
|
|
|
14
14
|
get message() {
|
|
15
15
|
return `
|
|
16
16
|
Add an explicit foreignKey declaration to this association declaration:
|
|
17
|
-
Dream class: ${this.dreamClass.
|
|
17
|
+
Dream class: ${this.dreamClass.sanitizedName}
|
|
18
18
|
Association: ${this.partialAssociation.as}
|
|
19
19
|
Dream tried ${this.computedForeignKey} automatically, but it isn't a column in table ${this.table}.
|
|
20
20
|
`;
|
|
@@ -36,7 +36,7 @@ export class ExplicitForeignKeyRequired extends Error {
|
|
|
36
36
|
return `
|
|
37
37
|
${this.explicitForeignKey} is not a valid column on table ${this.table}.
|
|
38
38
|
Fix the foreignKey declaration on:
|
|
39
|
-
Dream class: ${this.dreamClass.
|
|
39
|
+
Dream class: ${this.dreamClass.sanitizedName}
|
|
40
40
|
Association: ${this.partialAssociation.as}
|
|
41
41
|
`;
|
|
42
42
|
}
|
|
@@ -8,15 +8,15 @@ export default class JoinAttemptedOnMissingAssociation extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
get message() {
|
|
10
10
|
return `
|
|
11
|
-
A joins call has been attempted on \`${this.dreamClass.
|
|
12
|
-
but \`${this.dreamClass.
|
|
11
|
+
A joins call has been attempted on \`${this.dreamClass.sanitizedName}\` association \`${this.associationName}\`,
|
|
12
|
+
but \`${this.dreamClass.sanitizedName}\` does not define association \`${this.associationName}\`.
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
Either \`${this.associationName}\` is a typo in the joins statement, or association \`${this.associationName}\` needs to be defined on \`${this.dreamClass.name}\`, for example:
|
|
16
16
|
|
|
17
|
-
class ${this.dreamClass.
|
|
17
|
+
class ${this.dreamClass.sanitizedName} {
|
|
18
18
|
...
|
|
19
|
-
@${this.dreamClass.
|
|
19
|
+
@${this.dreamClass.sanitizedName}.HasMany('SomeModelClass')
|
|
20
20
|
public ${this.associationName}: SomeModelClass[]
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
@@ -8,15 +8,15 @@ export default class MissingThroughAssociation extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
get message() {
|
|
10
10
|
return `
|
|
11
|
-
\`${this.dreamClass.
|
|
11
|
+
\`${this.dreamClass.sanitizedName}\` defines through association \`${this.association.through}\`, but \`${this.dreamClass.name}\` does not define association \`${this.association.through}\`.
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
To fix, define association \`${this.association.through}\` on \`${this.dreamClass.
|
|
14
|
+
To fix, define association \`${this.association.through}\` on \`${this.dreamClass.sanitizedName}\`.
|
|
15
15
|
For example:
|
|
16
16
|
|
|
17
|
-
class ${this.dreamClass.
|
|
17
|
+
class ${this.dreamClass.sanitizedName} {
|
|
18
18
|
...
|
|
19
|
-
@${this.dreamClass.
|
|
19
|
+
@${this.dreamClass.sanitizedName}.HasMany('TheJoinModelClass')
|
|
20
20
|
public ${this.association.through}: TheJoinModelClass[]
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
@@ -10,29 +10,29 @@ export default class MissingThroughAssociationSource extends Error {
|
|
|
10
10
|
}
|
|
11
11
|
get message() {
|
|
12
12
|
return `
|
|
13
|
-
\`${this.dreamClass.
|
|
13
|
+
\`${this.dreamClass.sanitizedName}\` defines association \`${this.association.as}\` through \`${this.dreamClass.sanitizedName}\` association \`${this.association.through}\`.
|
|
14
14
|
|
|
15
|
-
\`${this.dreamClass.
|
|
15
|
+
\`${this.dreamClass.sanitizedName}\` association \`${this.association.through}\` points to \`${this.throughClass.sanitizedName}\`.
|
|
16
16
|
|
|
17
|
-
Dream expects association \`${this.association.source}\` to be defiend on \`${this.throughClass.
|
|
17
|
+
Dream expects association \`${this.association.source}\` to be defiend on \`${this.throughClass.sanitizedName}\`, but \`${this.throughClass.sanitizedName}\` does not define association \`${this.association.source}\`.
|
|
18
18
|
|
|
19
19
|
There are two possible fixes:
|
|
20
20
|
|
|
21
21
|
1. Provide an explicit \`source\` in addition to \`through\`.
|
|
22
22
|
|
|
23
|
-
class ${this.dreamClass.
|
|
23
|
+
class ${this.dreamClass.sanitizedName} {
|
|
24
24
|
...
|
|
25
|
-
@${this.dreamClass.name}.HasMany(() => ${this.throughClass.
|
|
26
|
-
public ${this.association.as}: ${this.throughClass.
|
|
25
|
+
@${this.dreamClass.name}.HasMany(() => ${this.throughClass.sanitizedName}, { through: '${this.association.through}', source: '<a valid association on ${this.throughClass.sanitizedName}>'})
|
|
26
|
+
public ${this.association.as}: ${this.throughClass.sanitizedName}[]
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
2. Define association \`${this.association.source}\` on \`${this.throughClass.
|
|
29
|
+
2. Define association \`${this.association.source}\` on \`${this.throughClass.sanitizedName}\`.
|
|
30
30
|
For example:
|
|
31
31
|
|
|
32
|
-
class ${this.throughClass.
|
|
32
|
+
class ${this.throughClass.sanitizedName} {
|
|
33
33
|
...
|
|
34
|
-
@${this.throughClass.
|
|
35
|
-
public ${this.association.source}: ${this.association.modelCB().
|
|
34
|
+
@${this.throughClass.sanitizedName}.HasMany(() => ${this.association.modelCB().name})
|
|
35
|
+
public ${this.association.source}: ${this.association.modelCB().sanitizedName}[]
|
|
36
36
|
}
|
|
37
37
|
`;
|
|
38
38
|
}
|
|
@@ -8,7 +8,7 @@ export default class NonLoadedAssociation extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
get message() {
|
|
10
10
|
return `
|
|
11
|
-
Attempting to access \`${this.associationName}\` on an instance of \`${this.dreamClass.
|
|
11
|
+
Attempting to access \`${this.associationName}\` on an instance of \`${this.dreamClass.sanitizedName}\`,
|
|
12
12
|
but \`${this.associationName}\` has not been preloaded or loaded.
|
|
13
13
|
`;
|
|
14
14
|
}
|
|
@@ -9,7 +9,7 @@ export default class AnyRequiresArrayColumn extends Error {
|
|
|
9
9
|
get message() {
|
|
10
10
|
return `
|
|
11
11
|
Attempting to call where({ ${this.column}: ops.any(<some value>)} ),
|
|
12
|
-
but ${this.dreamClass.
|
|
12
|
+
but ${this.dreamClass.sanitizedName}#${this.column} is not an array in the database.
|
|
13
13
|
`;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -22,7 +22,7 @@ An unexpected error occurred while looking up an association that you have defin
|
|
|
22
22
|
|
|
23
23
|
While building the schema for your app, we failed to find a match for
|
|
24
24
|
the ${this.associationType} association "${this.associationName}" on the
|
|
25
|
-
${this.modelClass.
|
|
25
|
+
${this.modelClass.sanitizedName} model.
|
|
26
26
|
|
|
27
27
|
This method requires either a string or string array as the first argument,
|
|
28
28
|
to the ${this.associationType} decorator. However, we received the following:
|
|
@@ -34,7 +34,7 @@ to the ${this.associationType} decorator. However, we received the following:
|
|
|
34
34
|
"${typeof attemptedName}"
|
|
35
35
|
|
|
36
36
|
Details:
|
|
37
|
-
dream: ${this.modelClass.
|
|
37
|
+
dream: ${this.modelClass.sanitizedName} (${this.modelClass.globalName})
|
|
38
38
|
association type: ${this.associationType}
|
|
39
39
|
association name: ${this.associationName}
|
|
40
40
|
".
|
|
@@ -51,7 +51,7 @@ An unexpected error occurred while looking up an association that you have defin
|
|
|
51
51
|
|
|
52
52
|
While building the schema for your app, we failed to find a match for
|
|
53
53
|
the ${this.associationType} association "${this.associationName}"
|
|
54
|
-
on ${this.modelClass.
|
|
54
|
+
on ${this.modelClass.sanitizedName}, using the global model name "${attemptedName}".
|
|
55
55
|
|
|
56
56
|
Usually, this is because the global name for
|
|
57
57
|
the model is not what you anticipated, which often happens when you are
|
|
@@ -63,7 +63,7 @@ first argument to an association, since it can help to catch these
|
|
|
63
63
|
familiar gotchas.
|
|
64
64
|
|
|
65
65
|
Details:
|
|
66
|
-
dream: ${this.modelClass.
|
|
66
|
+
dream: ${this.modelClass.sanitizedName} (${this.modelClass.globalName})
|
|
67
67
|
association type: ${this.associationType}
|
|
68
68
|
association name: ${this.associationName}
|
|
69
69
|
attempted model name: ${attemptedName}
|
|
@@ -11,7 +11,7 @@ export default class STIChildMissing extends Error {
|
|
|
11
11
|
get message() {
|
|
12
12
|
return `
|
|
13
13
|
Missing STI child class
|
|
14
|
-
Base Dream class: ${this.baseDreamClass.
|
|
14
|
+
Base Dream class: ${this.baseDreamClass.sanitizedName}
|
|
15
15
|
Type specified in DB record: ${this.extendingDreamClassName}
|
|
16
16
|
Table: ${this.baseDreamClass.table}
|
|
17
17
|
Primary key value: ${this.primaryKeyValue}
|
|
@@ -8,7 +8,7 @@ export default class StiChildIncompatibleWithSoftDeleteDecorator extends Error {
|
|
|
8
8
|
return `
|
|
9
9
|
@SoftDelete decorator cannot be applied to STI children.
|
|
10
10
|
Apply @SoftDelete to the base STI class instead.
|
|
11
|
-
STI child class: ${this.childStiDreamClass.
|
|
11
|
+
STI child class: ${this.childStiDreamClass.sanitizedName}
|
|
12
12
|
`;
|
|
13
13
|
}
|
|
14
14
|
}
|
package/dist/esm/src/index.js
CHANGED
|
@@ -7,22 +7,9 @@ export { default as DreamMigrationHelpers } from './db/migration-helpers/DreamMi
|
|
|
7
7
|
export { default as validateColumn } from './db/validators/validateColumn.js';
|
|
8
8
|
export { default as validateTable } from './db/validators/validateTable.js';
|
|
9
9
|
export { default as Decorators } from './decorators/Decorators.js';
|
|
10
|
-
export { default as AfterCreate } from './decorators/hooks/AfterCreate.js';
|
|
11
|
-
export { default as AfterCreateCommit } from './decorators/hooks/AfterCreateCommit.js';
|
|
12
|
-
export { default as AfterDestroy } from './decorators/hooks/AfterDestroy.js';
|
|
13
|
-
export { default as AfterDestroyCommit } from './decorators/hooks/AfterDestroyCommit.js';
|
|
14
|
-
export { default as AfterSave } from './decorators/hooks/AfterSave.js';
|
|
15
|
-
export { default as AfterSaveCommit } from './decorators/hooks/AfterSaveCommit.js';
|
|
16
|
-
export { default as AfterUpdate } from './decorators/hooks/AfterUpdate.js';
|
|
17
|
-
export { default as AfterUpdateCommit } from './decorators/hooks/AfterUpdateCommit.js';
|
|
18
|
-
export { default as BeforeCreate } from './decorators/hooks/BeforeCreate.js';
|
|
19
|
-
export { default as BeforeDestroy } from './decorators/hooks/BeforeDestroy.js';
|
|
20
|
-
export { default as BeforeSave } from './decorators/hooks/BeforeSave.js';
|
|
21
|
-
export { default as BeforeUpdate } from './decorators/hooks/BeforeUpdate.js';
|
|
22
10
|
export { default as ReplicaSafe } from './decorators/ReplicaSafe.js';
|
|
23
11
|
export { default as Scope } from './decorators/Scope.js';
|
|
24
12
|
export { default as SoftDelete } from './decorators/SoftDelete.js';
|
|
25
|
-
export { default as Sortable } from './decorators/sortable/Sortable.js';
|
|
26
13
|
export { default as STI } from './decorators/STI.js';
|
|
27
14
|
export { default as Validate } from './decorators/validations/Validate.js';
|
|
28
15
|
export { default as Validates } from './decorators/validations/Validates.js';
|
|
@@ -247,6 +247,39 @@ export default class Dream {
|
|
|
247
247
|
* @returns A dream class
|
|
248
248
|
*/
|
|
249
249
|
protected static get stiBaseClassOrOwnClass(): typeof Dream;
|
|
250
|
+
/**
|
|
251
|
+
* @internal
|
|
252
|
+
*
|
|
253
|
+
* Returns either the base STI class name, or else this class name
|
|
254
|
+
*
|
|
255
|
+
* NOTE: This is necessary due to changes in esbuild strategy WRT esm,
|
|
256
|
+
* compiled class names can contain a prefixing underscore if they contain
|
|
257
|
+
* private fields.
|
|
258
|
+
*
|
|
259
|
+
* This can create confusion when the class name is used as an attribute,
|
|
260
|
+
* as is done in the case of polymorphic associations, which use the class
|
|
261
|
+
* name as the "type" value for the polymorphic association.
|
|
262
|
+
*
|
|
263
|
+
* As such, any time the class name is being used as a value, it should be
|
|
264
|
+
* done using this value, rather than going to the class name directly.
|
|
265
|
+
*
|
|
266
|
+
* see https://github.com/evanw/esbuild/issues/1260 for more information
|
|
267
|
+
*
|
|
268
|
+
* @returns string
|
|
269
|
+
*/
|
|
270
|
+
protected static get stiBaseClassOrOwnClassName(): string;
|
|
271
|
+
/**
|
|
272
|
+
* @internal
|
|
273
|
+
*
|
|
274
|
+
* Returns the class name, replacing prefixed underscores, since esbuild
|
|
275
|
+
* will translate some class names to have underscore prefixes, which can
|
|
276
|
+
* cause unexpected behavior.
|
|
277
|
+
*
|
|
278
|
+
* see https://github.com/evanw/esbuild/issues/1260 for more information
|
|
279
|
+
*
|
|
280
|
+
* @returns string
|
|
281
|
+
*/
|
|
282
|
+
static get sanitizedName(): string;
|
|
250
283
|
/**
|
|
251
284
|
* @internal
|
|
252
285
|
*
|
|
@@ -255,6 +288,22 @@ export default class Dream {
|
|
|
255
288
|
* @returns A dream class
|
|
256
289
|
*/
|
|
257
290
|
protected get stiBaseClassOrOwnClass(): typeof Dream;
|
|
291
|
+
/**
|
|
292
|
+
* @internal
|
|
293
|
+
*
|
|
294
|
+
* Shadows .stiBaseClassOrOwnClassName. Returns a string
|
|
295
|
+
*
|
|
296
|
+
* @returns A string
|
|
297
|
+
*/
|
|
298
|
+
protected get stiBaseClassOrOwnClassName(): string;
|
|
299
|
+
/**
|
|
300
|
+
* @internal
|
|
301
|
+
*
|
|
302
|
+
* Shadows .sanitizedName. Returns a string
|
|
303
|
+
*
|
|
304
|
+
* @returns A string
|
|
305
|
+
*/
|
|
306
|
+
protected get sanitizedConstructorName(): string;
|
|
258
307
|
/**
|
|
259
308
|
* @internal
|
|
260
309
|
*
|
|
@@ -880,7 +929,7 @@ export default class Dream {
|
|
|
880
929
|
*
|
|
881
930
|
* ```ts
|
|
882
931
|
* class Post extends ApplicationModel {
|
|
883
|
-
* @Sortable({ scope: ['user']})
|
|
932
|
+
* @Deco.Sortable({ scope: ['user']})
|
|
884
933
|
* public position: DreamColumn<User, 'position'>
|
|
885
934
|
* }
|
|
886
935
|
*
|
|
@@ -14,19 +14,27 @@ export default class Decorators<T extends Dream> {
|
|
|
14
14
|
HasOne<const AssociationGlobalName extends keyof GlobalModelNameTableMap<T>>(this: Decorators<T>, globalAssociationNameOrNames: AssociationGlobalName, options?: HasOneThroughOptions<T, AssociationGlobalName>): any;
|
|
15
15
|
HasOne<const AssociationGlobalName extends keyof GlobalModelNameTableMap<T>>(this: Decorators<T>, globalAssociationNameOrNames: AssociationGlobalName, options?: PolymorphicHasOneOptions<T, AssociationGlobalName>): any;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Sortable decorator.
|
|
18
|
+
*
|
|
19
|
+
* NOTE: the Sortable decorator may not be used in STI child models (it may be used in the STI base class)
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* class Balloon {
|
|
23
|
+
* @Deco.Sortable()
|
|
24
|
+
* public position: DreamColumn<Balloon, 'position'>
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
19
27
|
*
|
|
20
28
|
* @param scope - The column, association, or combination there-of which you would like to restrict the incrementing logic to
|
|
21
29
|
* @returns A Sortable decorator
|
|
22
30
|
*/
|
|
23
31
|
Sortable(this: Decorators<T>, opts?: SortableOptions<T>): any;
|
|
24
32
|
/**
|
|
25
|
-
*
|
|
33
|
+
* BeforeCreate decorator
|
|
26
34
|
*
|
|
27
35
|
* ```ts
|
|
28
36
|
* class User {
|
|
29
|
-
*
|
|
37
|
+
* @Deco.BeforeCreate()
|
|
30
38
|
* public doSomething() {
|
|
31
39
|
* console.log('hi!')
|
|
32
40
|
* }
|
|
@@ -38,11 +46,11 @@ export default class Decorators<T extends Dream> {
|
|
|
38
46
|
*/
|
|
39
47
|
BeforeCreate(this: Decorators<T>, opts?: BeforeHookOpts<T>): any;
|
|
40
48
|
/**
|
|
41
|
-
*
|
|
49
|
+
* BeforeSave decorator
|
|
42
50
|
*
|
|
43
51
|
* ```ts
|
|
44
52
|
* class User {
|
|
45
|
-
*
|
|
53
|
+
* @Deco.BeforeSave()
|
|
46
54
|
* public doSomething() {
|
|
47
55
|
* console.log('hi!')
|
|
48
56
|
* }
|
|
@@ -54,11 +62,11 @@ export default class Decorators<T extends Dream> {
|
|
|
54
62
|
*/
|
|
55
63
|
BeforeSave(this: Decorators<T>, opts?: BeforeHookOpts<T>): any;
|
|
56
64
|
/**
|
|
57
|
-
*
|
|
65
|
+
* BeforeUpdate decorator
|
|
58
66
|
*
|
|
59
67
|
* ```ts
|
|
60
68
|
* class User {
|
|
61
|
-
*
|
|
69
|
+
* @Deco.BeforeUpdate()
|
|
62
70
|
* public doSomething() {
|
|
63
71
|
* console.log('hi!')
|
|
64
72
|
* }
|
|
@@ -70,11 +78,11 @@ export default class Decorators<T extends Dream> {
|
|
|
70
78
|
*/
|
|
71
79
|
BeforeUpdate(this: Decorators<T>, opts?: BeforeHookOpts<T>): any;
|
|
72
80
|
/**
|
|
73
|
-
*
|
|
81
|
+
* BeforeDestroy decorator
|
|
74
82
|
*
|
|
75
83
|
* ```ts
|
|
76
84
|
* class User {
|
|
77
|
-
*
|
|
85
|
+
* @Deco.BeforeDestroy()
|
|
78
86
|
* public doSomething() {
|
|
79
87
|
* console.log('hi!')
|
|
80
88
|
* }
|
|
@@ -85,11 +93,11 @@ export default class Decorators<T extends Dream> {
|
|
|
85
93
|
*/
|
|
86
94
|
BeforeDestroy(this: Decorators<T>): any;
|
|
87
95
|
/**
|
|
88
|
-
*
|
|
96
|
+
* AfterCreate decorator
|
|
89
97
|
*
|
|
90
98
|
* ```ts
|
|
91
99
|
* class User {
|
|
92
|
-
*
|
|
100
|
+
* @Deco.AfterCreate()
|
|
93
101
|
* public doSomething() {
|
|
94
102
|
* console.log('hi!')
|
|
95
103
|
* }
|
|
@@ -101,11 +109,11 @@ export default class Decorators<T extends Dream> {
|
|
|
101
109
|
*/
|
|
102
110
|
AfterCreate(this: Decorators<T>, opts?: AfterHookOpts<T>): any;
|
|
103
111
|
/**
|
|
104
|
-
*
|
|
112
|
+
* AfterCreateCommit decorator
|
|
105
113
|
*
|
|
106
114
|
* ```ts
|
|
107
115
|
* class User {
|
|
108
|
-
*
|
|
116
|
+
* @Deco.AfterCreateCommit()
|
|
109
117
|
* public doSomething() {
|
|
110
118
|
* console.log('hi!')
|
|
111
119
|
* }
|
|
@@ -116,11 +124,11 @@ export default class Decorators<T extends Dream> {
|
|
|
116
124
|
*/
|
|
117
125
|
AfterCreateCommit(this: Decorators<T>, opts?: AfterHookOpts<T>): any;
|
|
118
126
|
/**
|
|
119
|
-
*
|
|
127
|
+
* AfterSave decorator
|
|
120
128
|
*
|
|
121
129
|
* ```ts
|
|
122
130
|
* class User {
|
|
123
|
-
*
|
|
131
|
+
* @Deco.AfterSave()
|
|
124
132
|
* public doSomething() {
|
|
125
133
|
* console.log('hi!')
|
|
126
134
|
* }
|
|
@@ -132,11 +140,11 @@ export default class Decorators<T extends Dream> {
|
|
|
132
140
|
*/
|
|
133
141
|
AfterSave(this: Decorators<T>, opts?: AfterHookOpts<T>): any;
|
|
134
142
|
/**
|
|
135
|
-
*
|
|
143
|
+
* AfterSaveCommit decorator
|
|
136
144
|
*
|
|
137
145
|
* ```ts
|
|
138
146
|
* class User {
|
|
139
|
-
*
|
|
147
|
+
* @Deco.AfterSaveCommit()
|
|
140
148
|
* public doSomething() {
|
|
141
149
|
* console.log('hi!')
|
|
142
150
|
* }
|
|
@@ -148,11 +156,11 @@ export default class Decorators<T extends Dream> {
|
|
|
148
156
|
*/
|
|
149
157
|
AfterSaveCommit(this: Decorators<T>, opts?: AfterHookOpts<T>): any;
|
|
150
158
|
/**
|
|
151
|
-
*
|
|
159
|
+
* AfterUpdate decorator
|
|
152
160
|
*
|
|
153
161
|
* ```ts
|
|
154
162
|
* class User {
|
|
155
|
-
*
|
|
163
|
+
* @Deco.AfterUpdate()
|
|
156
164
|
* public doSomething() {
|
|
157
165
|
* console.log('hi!')
|
|
158
166
|
* }
|
|
@@ -164,11 +172,11 @@ export default class Decorators<T extends Dream> {
|
|
|
164
172
|
*/
|
|
165
173
|
AfterUpdate(this: Decorators<T>, opts?: AfterHookOpts<T>): any;
|
|
166
174
|
/**
|
|
167
|
-
*
|
|
175
|
+
* AfterUpdateCommit decorator
|
|
168
176
|
*
|
|
169
177
|
* ```ts
|
|
170
178
|
* class User {
|
|
171
|
-
*
|
|
179
|
+
* @Deco.AfterUpdateCommit()
|
|
172
180
|
* public doSomething() {
|
|
173
181
|
* console.log('hi!')
|
|
174
182
|
* }
|
|
@@ -180,11 +188,11 @@ export default class Decorators<T extends Dream> {
|
|
|
180
188
|
*/
|
|
181
189
|
AfterUpdateCommit(this: Decorators<T>, opts?: AfterHookOpts<T>): any;
|
|
182
190
|
/**
|
|
183
|
-
*
|
|
191
|
+
* AfterDestroy decorator
|
|
184
192
|
*
|
|
185
193
|
* ```ts
|
|
186
194
|
* class User {
|
|
187
|
-
*
|
|
195
|
+
* @Deco.AfterDestroy()
|
|
188
196
|
* public doSomething() {
|
|
189
197
|
* console.log('hi!')
|
|
190
198
|
* }
|
|
@@ -196,11 +204,11 @@ export default class Decorators<T extends Dream> {
|
|
|
196
204
|
*/
|
|
197
205
|
AfterDestroy(this: Decorators<T>): any;
|
|
198
206
|
/**
|
|
199
|
-
*
|
|
207
|
+
* AfterDestroyCommit decorator
|
|
200
208
|
*
|
|
201
209
|
* ```ts
|
|
202
210
|
* class User {
|
|
203
|
-
*
|
|
211
|
+
* @Deco.AfterDestroyCommit()
|
|
204
212
|
* public doSomething() {
|
|
205
213
|
* console.log('hi!')
|
|
206
214
|
* }
|
|
@@ -9,22 +9,9 @@ export { default as validateTable } from './db/validators/validateTable.js';
|
|
|
9
9
|
export { type WhereStatementForDream, type WhereStatementForDreamClass, } from './decorators/associations/shared.js';
|
|
10
10
|
export { type DecoratorContext } from './decorators/DecoratorContextType.js';
|
|
11
11
|
export { default as Decorators } from './decorators/Decorators.js';
|
|
12
|
-
export { default as AfterCreate } from './decorators/hooks/AfterCreate.js';
|
|
13
|
-
export { default as AfterCreateCommit } from './decorators/hooks/AfterCreateCommit.js';
|
|
14
|
-
export { default as AfterDestroy } from './decorators/hooks/AfterDestroy.js';
|
|
15
|
-
export { default as AfterDestroyCommit } from './decorators/hooks/AfterDestroyCommit.js';
|
|
16
|
-
export { default as AfterSave } from './decorators/hooks/AfterSave.js';
|
|
17
|
-
export { default as AfterSaveCommit } from './decorators/hooks/AfterSaveCommit.js';
|
|
18
|
-
export { default as AfterUpdate } from './decorators/hooks/AfterUpdate.js';
|
|
19
|
-
export { default as AfterUpdateCommit } from './decorators/hooks/AfterUpdateCommit.js';
|
|
20
|
-
export { default as BeforeCreate } from './decorators/hooks/BeforeCreate.js';
|
|
21
|
-
export { default as BeforeDestroy } from './decorators/hooks/BeforeDestroy.js';
|
|
22
|
-
export { default as BeforeSave } from './decorators/hooks/BeforeSave.js';
|
|
23
|
-
export { default as BeforeUpdate } from './decorators/hooks/BeforeUpdate.js';
|
|
24
12
|
export { default as ReplicaSafe } from './decorators/ReplicaSafe.js';
|
|
25
13
|
export { default as Scope } from './decorators/Scope.js';
|
|
26
14
|
export { default as SoftDelete } from './decorators/SoftDelete.js';
|
|
27
|
-
export { default as Sortable } from './decorators/sortable/Sortable.js';
|
|
28
15
|
export { default as STI } from './decorators/STI.js';
|
|
29
16
|
export { type ValidationType } from './decorators/validations/shared.js';
|
|
30
17
|
export { default as Validate } from './decorators/validations/Validate.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.navigationData = "data:application/octet-stream;base64,
|
|
1
|
+
window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE62aW5ebNhSF/8s8p5ekTdrmzXNx4pWZsWNP04euri4Zjm11ABEhT+J29b9XAttIcDiSmL7NcPb+tsCSEIjf/7lQ8FVdvL24hCLZ5Uw+Xry4KJna6UNJxqoKqu/OpW93Ks90/ZEX6cXbl69+/vfF2X/FMihSJq+Zgj7CrpIUCVoxl1NduzxMGc8gfRDN0UmRmsMI3G+iMq8hEZIpIas+uq2RBB2VI2Zz2OublGXGE6a4KAYQlsJLu+RDFF3xuq9uZwNuXfG6Z3kppAI5gDiVvZw7vpX12b6HrAT0Z8FkXu4KJGcZ/3uwha3Ay3qQrKhYQvxqloKi3RSJPJSqDzkWaO8T5nuiPO8ysWbZPcvhXqgVIMFdBUW7F8WtYCmkk6oSCR/oxZiKon7cgzz0MfVhyrdkxRaZfOrDpM+M8lSf7VTssQnGrVOkT7r7pPX53UgpkH7WEVCsiVKSr/cKVkpPZDkU1m/FCz2QNizRxL7Mhb56/Qab7K5EUR/CkF0RCezMULOCq3lp/qpw9rA+JkZbwvhG6AW3A9/qofRlD/BRscfRTV0pV0LB5iUUrOSrZAc5W0ihZ0PFAacOaEfgVzs9ne+YPWD8OWdTQODDoYQphyydr/+CBP8ZcCkFv9ITm/nJrGYr7TZrlGOh4/7+l59evn5lE0Sem45lnWATW7eg6nFpuS+t6dBt97oDxfQMwroxQ7ow/mkS6bW+Uw6iXZnJ7kpk+7xAcVY9jEegYinmvoafpFUP4t2K7S08QYbCTsVQ0tZelLicbXc5MkCZy08cvtyJFLJ2XvoAB5Q7JA5KWjCp5z62AU+3QXRxfN9PhgmDEvwXKP6qtA68sVY9iPfA1hk08wXKs+pBvE9cqj3LmkuFN9GV+KjHG9Qk2wrJ1S7vIrt1H+/9odxBgU3NbcXHmKXmVtD1N0d93uMUPckyo+5doU45kDYVMmdqCHasBrLu9/kaJE10NIHcheQ5V/wJqPN2RYHkpntOpGS9UdZXxDORJcgQfGjhQadcsqrXmXqCOKJI6UthBNHEsAvhKKMymjUMvr4ZFEYl3HwtJVSVXrjoATbfkCEd7dic4hCeY7Qjc+YFBOfU2pE5SwhN0crxGc2hsA5HGaNaMNMrfmSJhGmiuPf7rLd+6wkiiWb+9TCNJIrafQJCqOiTTwjVP94s3Vh+WH/BDGMSvSPb0o3lR52RYxiR6L0PtbKR9JjTcfQj8vwzoqUby485IdcwIjEmbFyOftRR+vFhBVv3lRQS40rjUk6LvHdQ6MeVhM7piKOSzlch5sY/ZHp2snfCGDI9N9k/FIZMz00+PY6ap0jf0sFv/79aA/IZbanN41oS1fEHXXHZSvJiSwfVklDqqVWeB9ieLpYf9Lg4oA7MOr/PHaCf6z7eglUJQ1/3thUvQ58Bk4cPcMDeLbhVH2tpdpD0b7qQkPDK2S1rcD2Bj2gPxPrF6ly24+GKZdmaJY/dlCBTTHL7Xtd6s1j/T0UPu6KzLYA30dLG5KDdvSfwEgv2CHzD+z2yrfgYDzyHSrG87CLOBR/h1zJlCkyjrS0DbOuo4Xrk4WkhEeHcdjcVG5lu1csKenk+7q35bzuQ7f7sVMjOFyMNG1eNY6NDj5AG7qAUlbX0fGL6Eujf67x/oqsu5wen0y5n75aTuz/ni5vl5GG+XGGknogACvrtZQtFhd+89KO9t7xexoDDEzZArAhT6dx2UEBHQsDO+zMtZrMv6m9XrA8MXMCbH50vKIoUZHXHigOGsMp+iF7dEgxdJRH1xr/ZEsIZ5zIBWT3MMLM+TJkSUaKZdYEyio26hgzwi99WCcRxokMBp1qAvaL8FQVoto1Qe1MizMlx2x1zn2qkveSKDQNOVQqRiQr0Yvh6raewApLOJxkWDRNSYJGXzH5tZ6GaEmFO15gvXVMWWO+3qMsUKKOZv72n31f5kAuDGCKZIgHYmkcq3fE6t8oW4ggoUP09W32XMxvEUyny6T7LDh91v6xXW/X93JTQlGA30YTdaf8SSzgXCQAvNmCt0E0rQlbcbUgUYERD0OW3P35wJe6GVjd5qdA7y7FEmDPBUjPvY+5TjbSLx31ZX5bLQ/tpJE5DpQS8PD2DYrhzkQJs688I3dWvhWjLBES6n0229rrQXbq4VsiYWeRcU6O9J6KA7heYFqT/6aVjrM6da8QgDzZTDdgxCak5Pf3ovuFf0ZyOhsI1D4Nopz/VKLtehl7i5rpCWRUzn+qn+nLEXEKvi4jUFPI2btdJDP+M2/lnwvZ0XOJ0PzNrAa4iAFV/m0ORakEP9Md/KwulhJAxAAA="
|