@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.
Files changed (272) hide show
  1. package/dist/cjs/src/Dream.js +59 -2
  2. package/dist/cjs/src/decorators/Decorators.js +34 -26
  3. package/dist/cjs/src/decorators/STI.js +1 -1
  4. package/dist/cjs/src/decorators/associations/shared.js +3 -3
  5. package/dist/cjs/src/decorators/hooks/AfterCreate.js +1 -1
  6. package/dist/cjs/src/decorators/hooks/AfterCreateCommit.js +1 -1
  7. package/dist/cjs/src/decorators/hooks/AfterDestroy.js +1 -1
  8. package/dist/cjs/src/decorators/hooks/AfterDestroyCommit.js +1 -1
  9. package/dist/cjs/src/decorators/hooks/AfterSave.js +1 -1
  10. package/dist/cjs/src/decorators/hooks/AfterSaveCommit.js +1 -1
  11. package/dist/cjs/src/decorators/hooks/AfterUpdate.js +1 -1
  12. package/dist/cjs/src/decorators/hooks/AfterUpdateCommit.js +1 -1
  13. package/dist/cjs/src/decorators/hooks/BeforeCreate.js +1 -1
  14. package/dist/cjs/src/decorators/hooks/BeforeDestroy.js +1 -1
  15. package/dist/cjs/src/decorators/hooks/BeforeSave.js +1 -1
  16. package/dist/cjs/src/decorators/hooks/BeforeUpdate.js +1 -1
  17. package/dist/cjs/src/decorators/sortable/Sortable.js +8 -19
  18. package/dist/cjs/src/dream/Query.js +8 -8
  19. package/dist/cjs/src/dream/internal/associations/createAssociation.js +1 -1
  20. package/dist/cjs/src/dream/internal/runHooksFor.js +1 -1
  21. package/dist/cjs/src/dream/internal/saveDream.js +1 -1
  22. package/dist/cjs/src/dream/internal/sqlResultToDreamInstance.js +1 -1
  23. package/dist/cjs/src/errors/CannotCallUndestroyOnANonSoftDeleteModel.js +1 -1
  24. package/dist/cjs/src/errors/CannotDefineAssociationWithBothDependentAndPassthrough.js +1 -1
  25. package/dist/cjs/src/errors/CannotDefineAssociationWithBothDependentAndRequiredOnClause.js +1 -1
  26. package/dist/cjs/src/errors/CannotPassUndefinedAsAValueToAWhereClause.js +1 -1
  27. package/dist/cjs/src/errors/CannotReloadUnsavedDream.js +1 -1
  28. package/dist/cjs/src/errors/CreateOrFindByFailedToCreateAndFind.js +1 -1
  29. package/dist/cjs/src/errors/DoNotSetEncryptedFieldsDirectly.js +1 -1
  30. package/dist/cjs/src/errors/MissingDeletedAtFieldForSoftDelete.js +1 -1
  31. package/dist/cjs/src/errors/MissingSerializersDefinition.js +5 -5
  32. package/dist/cjs/src/errors/MissingTable.js +4 -4
  33. package/dist/cjs/src/errors/NonBelongsToAssociationProvidedAsSortableDecoratorScope.js +2 -2
  34. package/dist/cjs/src/errors/NonExistentScopeProvidedToResort.js +2 -2
  35. package/dist/cjs/src/errors/SortableDecoratorRequiresColumnOrBelongsToAssociation.js +3 -3
  36. package/dist/cjs/src/errors/associations/CanOnlyPassBelongsToModelParam.js +1 -1
  37. package/dist/cjs/src/errors/associations/CannotAssociateThroughPolymorphic.js +1 -1
  38. package/dist/cjs/src/errors/associations/CannotCreateAssociationWithThroughContext.js +1 -1
  39. package/dist/cjs/src/errors/associations/CannotJoinPolymorphicBelongsToError.js +1 -1
  40. package/dist/cjs/src/errors/associations/CannotPassNullOrUndefinedToRequiredBelongsTo.js +1 -1
  41. package/dist/cjs/src/errors/associations/InvalidComputedForeignKey.js +2 -2
  42. package/dist/cjs/src/errors/associations/JoinAttemptedOnMissingAssociation.js +4 -4
  43. package/dist/cjs/src/errors/associations/MissingThroughAssociation.js +4 -4
  44. package/dist/cjs/src/errors/associations/MissingThroughAssociationSource.js +10 -10
  45. package/dist/cjs/src/errors/associations/NonLoadedAssociation.js +1 -1
  46. package/dist/cjs/src/errors/ops/AnyRequiresArrayColumn.js +1 -1
  47. package/dist/cjs/src/errors/schema-builder/FailedToIdentifyAssociation.js +4 -4
  48. package/dist/cjs/src/errors/sti/STIChildMissing.js +1 -1
  49. package/dist/cjs/src/errors/sti/StiChildIncompatibleWithSoftDeleteDecorator.js +1 -1
  50. package/dist/cjs/src/index.js +2 -28
  51. package/dist/esm/src/Dream.js +59 -2
  52. package/dist/esm/src/decorators/Decorators.js +34 -26
  53. package/dist/esm/src/decorators/STI.js +1 -1
  54. package/dist/esm/src/decorators/associations/shared.js +3 -3
  55. package/dist/esm/src/decorators/hooks/AfterCreate.js +1 -1
  56. package/dist/esm/src/decorators/hooks/AfterCreateCommit.js +1 -1
  57. package/dist/esm/src/decorators/hooks/AfterDestroy.js +1 -1
  58. package/dist/esm/src/decorators/hooks/AfterDestroyCommit.js +1 -1
  59. package/dist/esm/src/decorators/hooks/AfterSave.js +1 -1
  60. package/dist/esm/src/decorators/hooks/AfterSaveCommit.js +1 -1
  61. package/dist/esm/src/decorators/hooks/AfterUpdate.js +1 -1
  62. package/dist/esm/src/decorators/hooks/AfterUpdateCommit.js +1 -1
  63. package/dist/esm/src/decorators/hooks/BeforeCreate.js +1 -1
  64. package/dist/esm/src/decorators/hooks/BeforeDestroy.js +1 -1
  65. package/dist/esm/src/decorators/hooks/BeforeSave.js +1 -1
  66. package/dist/esm/src/decorators/hooks/BeforeUpdate.js +1 -1
  67. package/dist/esm/src/decorators/sortable/Sortable.js +8 -19
  68. package/dist/esm/src/dream/Query.js +8 -8
  69. package/dist/esm/src/dream/internal/associations/createAssociation.js +1 -1
  70. package/dist/esm/src/dream/internal/runHooksFor.js +1 -1
  71. package/dist/esm/src/dream/internal/saveDream.js +1 -1
  72. package/dist/esm/src/dream/internal/sqlResultToDreamInstance.js +1 -1
  73. package/dist/esm/src/errors/CannotCallUndestroyOnANonSoftDeleteModel.js +1 -1
  74. package/dist/esm/src/errors/CannotDefineAssociationWithBothDependentAndPassthrough.js +1 -1
  75. package/dist/esm/src/errors/CannotDefineAssociationWithBothDependentAndRequiredOnClause.js +1 -1
  76. package/dist/esm/src/errors/CannotPassUndefinedAsAValueToAWhereClause.js +1 -1
  77. package/dist/esm/src/errors/CannotReloadUnsavedDream.js +1 -1
  78. package/dist/esm/src/errors/CreateOrFindByFailedToCreateAndFind.js +1 -1
  79. package/dist/esm/src/errors/DoNotSetEncryptedFieldsDirectly.js +1 -1
  80. package/dist/esm/src/errors/MissingDeletedAtFieldForSoftDelete.js +1 -1
  81. package/dist/esm/src/errors/MissingSerializersDefinition.js +5 -5
  82. package/dist/esm/src/errors/MissingTable.js +4 -4
  83. package/dist/esm/src/errors/NonBelongsToAssociationProvidedAsSortableDecoratorScope.js +2 -2
  84. package/dist/esm/src/errors/NonExistentScopeProvidedToResort.js +2 -2
  85. package/dist/esm/src/errors/SortableDecoratorRequiresColumnOrBelongsToAssociation.js +3 -3
  86. package/dist/esm/src/errors/associations/CanOnlyPassBelongsToModelParam.js +1 -1
  87. package/dist/esm/src/errors/associations/CannotAssociateThroughPolymorphic.js +1 -1
  88. package/dist/esm/src/errors/associations/CannotCreateAssociationWithThroughContext.js +1 -1
  89. package/dist/esm/src/errors/associations/CannotJoinPolymorphicBelongsToError.js +1 -1
  90. package/dist/esm/src/errors/associations/CannotPassNullOrUndefinedToRequiredBelongsTo.js +1 -1
  91. package/dist/esm/src/errors/associations/InvalidComputedForeignKey.js +2 -2
  92. package/dist/esm/src/errors/associations/JoinAttemptedOnMissingAssociation.js +4 -4
  93. package/dist/esm/src/errors/associations/MissingThroughAssociation.js +4 -4
  94. package/dist/esm/src/errors/associations/MissingThroughAssociationSource.js +10 -10
  95. package/dist/esm/src/errors/associations/NonLoadedAssociation.js +1 -1
  96. package/dist/esm/src/errors/ops/AnyRequiresArrayColumn.js +1 -1
  97. package/dist/esm/src/errors/schema-builder/FailedToIdentifyAssociation.js +4 -4
  98. package/dist/esm/src/errors/sti/STIChildMissing.js +1 -1
  99. package/dist/esm/src/errors/sti/StiChildIncompatibleWithSoftDeleteDecorator.js +1 -1
  100. package/dist/esm/src/index.js +0 -13
  101. package/dist/types/src/Dream.d.ts +50 -1
  102. package/dist/types/src/decorators/Decorators.d.ts +34 -26
  103. package/dist/types/src/index.d.ts +0 -13
  104. package/docs/assets/navigation.js +1 -1
  105. package/docs/assets/search.js +1 -1
  106. package/docs/classes/Benchmark.html +2 -2
  107. package/docs/classes/CalendarDate.html +2 -2
  108. package/docs/classes/CreateOrFindByFailedToCreateAndFind.html +3 -3
  109. package/docs/classes/Decorators.html +31 -28
  110. package/docs/classes/Dream.html +147 -123
  111. package/docs/classes/DreamApplication.html +4 -4
  112. package/docs/classes/DreamBin.html +2 -2
  113. package/docs/classes/DreamCLI.html +3 -3
  114. package/docs/classes/DreamImporter.html +2 -2
  115. package/docs/classes/DreamMigrationHelpers.html +7 -7
  116. package/docs/classes/DreamSerializer.html +2 -2
  117. package/docs/classes/DreamTransaction.html +2 -2
  118. package/docs/classes/Encrypt.html +2 -2
  119. package/docs/classes/Env.html +2 -2
  120. package/docs/classes/GlobalNameNotSet.html +3 -3
  121. package/docs/classes/NonLoadedAssociation.html +3 -3
  122. package/docs/classes/Query.html +50 -50
  123. package/docs/classes/Range.html +2 -2
  124. package/docs/classes/RecordNotFound.html +3 -3
  125. package/docs/classes/ValidationError.html +3 -3
  126. package/docs/functions/Attribute.html +1 -1
  127. package/docs/functions/RendersMany.html +1 -1
  128. package/docs/functions/RendersOne.html +1 -1
  129. package/docs/functions/ReplicaSafe.html +1 -1
  130. package/docs/functions/STI.html +1 -1
  131. package/docs/functions/Scope.html +1 -1
  132. package/docs/functions/SoftDelete.html +1 -1
  133. package/docs/functions/Validate.html +1 -1
  134. package/docs/functions/Validates.html +1 -1
  135. package/docs/functions/Virtual.html +1 -1
  136. package/docs/functions/camelize.html +1 -1
  137. package/docs/functions/capitalize.html +1 -1
  138. package/docs/functions/closeAllDbConnections.html +1 -1
  139. package/docs/functions/compact.html +1 -1
  140. package/docs/functions/db.html +1 -1
  141. package/docs/functions/debug.html +1 -1
  142. package/docs/functions/dreamDbConnections.html +1 -1
  143. package/docs/functions/dreamPath.html +1 -1
  144. package/docs/functions/generateDream.html +1 -1
  145. package/docs/functions/globalClassNameFromFullyQualifiedModelName.html +1 -1
  146. package/docs/functions/hyphenize.html +1 -1
  147. package/docs/functions/inferSerializerFromDreamClassOrViewModelClass.html +1 -1
  148. package/docs/functions/inferSerializerFromDreamOrViewModel.html +1 -1
  149. package/docs/functions/isEmpty.html +1 -1
  150. package/docs/functions/loadRepl.html +1 -1
  151. package/docs/functions/lookupClassByGlobalName.html +1 -1
  152. package/docs/functions/pascalize.html +1 -1
  153. package/docs/functions/pgErrorType.html +1 -1
  154. package/docs/functions/range-1.html +1 -1
  155. package/docs/functions/relativeDreamPath.html +1 -1
  156. package/docs/functions/round.html +1 -1
  157. package/docs/functions/serializerNameFromFullyQualifiedModelName.html +1 -1
  158. package/docs/functions/sharedPathPrefix.html +1 -1
  159. package/docs/functions/snakeify.html +1 -1
  160. package/docs/functions/sortBy.html +1 -1
  161. package/docs/functions/standardizeFullyQualifiedModelName.html +1 -1
  162. package/docs/functions/uncapitalize.html +1 -1
  163. package/docs/functions/uniq.html +1 -1
  164. package/docs/functions/validateColumn.html +1 -1
  165. package/docs/functions/validateTable.html +1 -1
  166. package/docs/interfaces/AttributeStatement.html +2 -2
  167. package/docs/interfaces/DecoratorContext.html +2 -2
  168. package/docs/interfaces/DreamApplicationInitOptions.html +2 -2
  169. package/docs/interfaces/DreamApplicationOpts.html +2 -2
  170. package/docs/interfaces/DreamSerializerAssociationStatement.html +2 -2
  171. package/docs/interfaces/EncryptOptions.html +2 -2
  172. package/docs/interfaces/OpenapiSchemaProperties.html +1 -1
  173. package/docs/interfaces/OpenapiSchemaPropertiesShorthand.html +1 -1
  174. package/docs/interfaces/OpenapiTypeFieldObject.html +1 -1
  175. package/docs/modules.html +1 -14
  176. package/docs/types/Camelized.html +1 -1
  177. package/docs/types/CommonOpenapiSchemaObjectFields.html +1 -1
  178. package/docs/types/DreamAssociationMetadata.html +1 -1
  179. package/docs/types/DreamAttributes.html +1 -1
  180. package/docs/types/DreamClassColumn.html +1 -1
  181. package/docs/types/DreamColumn.html +1 -1
  182. package/docs/types/DreamColumnNames.html +1 -1
  183. package/docs/types/DreamLogLevel.html +1 -1
  184. package/docs/types/DreamLogger.html +1 -1
  185. package/docs/types/DreamOrViewModelSerializerKey.html +1 -1
  186. package/docs/types/DreamParamSafeAttributes.html +1 -1
  187. package/docs/types/DreamParamSafeColumnNames.html +1 -1
  188. package/docs/types/DreamSerializerKey.html +1 -1
  189. package/docs/types/DreamSerializers.html +1 -1
  190. package/docs/types/DreamTableSchema.html +1 -1
  191. package/docs/types/DreamVirtualColumns.html +1 -1
  192. package/docs/types/EncryptAlgorithm.html +1 -1
  193. package/docs/types/Hyphenized.html +1 -1
  194. package/docs/types/IdType.html +1 -1
  195. package/docs/types/OpenapiAllTypes.html +1 -1
  196. package/docs/types/OpenapiFormats.html +1 -1
  197. package/docs/types/OpenapiNumberFormats.html +1 -1
  198. package/docs/types/OpenapiPrimitiveTypes.html +1 -1
  199. package/docs/types/OpenapiSchemaArray.html +1 -1
  200. package/docs/types/OpenapiSchemaArrayShorthand.html +1 -1
  201. package/docs/types/OpenapiSchemaBase.html +1 -1
  202. package/docs/types/OpenapiSchemaBody.html +1 -1
  203. package/docs/types/OpenapiSchemaBodyShorthand.html +1 -1
  204. package/docs/types/OpenapiSchemaCommonFields.html +1 -1
  205. package/docs/types/OpenapiSchemaExpressionAllOf.html +1 -1
  206. package/docs/types/OpenapiSchemaExpressionAnyOf.html +1 -1
  207. package/docs/types/OpenapiSchemaExpressionOneOf.html +1 -1
  208. package/docs/types/OpenapiSchemaExpressionRef.html +1 -1
  209. package/docs/types/OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
  210. package/docs/types/OpenapiSchemaInteger.html +1 -1
  211. package/docs/types/OpenapiSchemaNull.html +1 -1
  212. package/docs/types/OpenapiSchemaNumber.html +1 -1
  213. package/docs/types/OpenapiSchemaObject.html +1 -1
  214. package/docs/types/OpenapiSchemaObjectAllOf.html +1 -1
  215. package/docs/types/OpenapiSchemaObjectAllOfShorthand.html +1 -1
  216. package/docs/types/OpenapiSchemaObjectAnyOf.html +1 -1
  217. package/docs/types/OpenapiSchemaObjectAnyOfShorthand.html +1 -1
  218. package/docs/types/OpenapiSchemaObjectBase.html +1 -1
  219. package/docs/types/OpenapiSchemaObjectBaseShorthand.html +1 -1
  220. package/docs/types/OpenapiSchemaObjectOneOf.html +1 -1
  221. package/docs/types/OpenapiSchemaObjectOneOfShorthand.html +1 -1
  222. package/docs/types/OpenapiSchemaObjectShorthand.html +1 -1
  223. package/docs/types/OpenapiSchemaPartialSegment.html +1 -1
  224. package/docs/types/OpenapiSchemaPrimitiveGeneric.html +1 -1
  225. package/docs/types/OpenapiSchemaShorthandExpressionAllOf.html +1 -1
  226. package/docs/types/OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
  227. package/docs/types/OpenapiSchemaShorthandExpressionOneOf.html +1 -1
  228. package/docs/types/OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
  229. package/docs/types/OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
  230. package/docs/types/OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
  231. package/docs/types/OpenapiSchemaString.html +1 -1
  232. package/docs/types/OpenapiShorthandAllTypes.html +1 -1
  233. package/docs/types/OpenapiShorthandPrimitiveTypes.html +1 -1
  234. package/docs/types/OpenapiTypeField.html +1 -1
  235. package/docs/types/Pascalized.html +1 -1
  236. package/docs/types/PrimaryKeyType.html +1 -1
  237. package/docs/types/RoundingPrecision.html +1 -1
  238. package/docs/types/SerializableClassOrSerializerCallback.html +1 -1
  239. package/docs/types/SerializableDreamClassOrViewModelClass.html +1 -1
  240. package/docs/types/SerializableDreamOrViewModel.html +1 -1
  241. package/docs/types/SerializableTypes.html +1 -1
  242. package/docs/types/Snakeified.html +1 -1
  243. package/docs/types/Timestamp.html +1 -1
  244. package/docs/types/UpdateableAssociationProperties.html +1 -1
  245. package/docs/types/UpdateableProperties.html +1 -1
  246. package/docs/types/ValidationType.html +1 -1
  247. package/docs/types/ViewModelSerializerKey.html +1 -1
  248. package/docs/types/WhereStatementForDream.html +1 -1
  249. package/docs/types/WhereStatementForDreamClass.html +1 -1
  250. package/docs/variables/DreamConst.html +1 -1
  251. package/docs/variables/TRIGRAM_OPERATORS.html +1 -1
  252. package/docs/variables/openapiPrimitiveTypes-1.html +1 -1
  253. package/docs/variables/openapiShorthandPrimitiveTypes-1.html +1 -1
  254. package/docs/variables/ops.html +1 -1
  255. package/docs/variables/primaryKeyTypes.html +1 -1
  256. package/package.json +1 -1
  257. package/dist/cjs/src/errors/sortable/CannotCallSortableOnSTIChild.js +0 -18
  258. package/dist/esm/src/errors/sortable/CannotCallSortableOnSTIChild.js +0 -15
  259. package/dist/types/src/errors/sortable/CannotCallSortableOnSTIChild.d.ts +0 -6
  260. package/docs/functions/AfterCreate.html +0 -1
  261. package/docs/functions/AfterCreateCommit.html +0 -13
  262. package/docs/functions/AfterDestroy.html +0 -1
  263. package/docs/functions/AfterDestroyCommit.html +0 -13
  264. package/docs/functions/AfterSave.html +0 -1
  265. package/docs/functions/AfterSaveCommit.html +0 -13
  266. package/docs/functions/AfterUpdate.html +0 -1
  267. package/docs/functions/AfterUpdateCommit.html +0 -13
  268. package/docs/functions/BeforeCreate.html +0 -1
  269. package/docs/functions/BeforeDestroy.html +0 -1
  270. package/docs/functions/BeforeSave.html +0 -1
  271. package/docs/functions/BeforeUpdate.html +0 -1
  272. package/docs/functions/Sortable.html +0 -1
@@ -12,7 +12,7 @@ class CannotPassUndefinedAsAValueToAWhereClause extends Error {
12
12
  return `
13
13
  Cannot pass undefined as a value to a where clause.
14
14
 
15
- dream class: ${this.dreamClass.name}
15
+ dream class: ${this.dreamClass.sanitizedName}
16
16
  key receiving an undefined value: ${this.key}
17
17
  `;
18
18
  }
@@ -9,7 +9,7 @@ class CannotReloadUnsavedDream extends Error {
9
9
  get message() {
10
10
  return `
11
11
  Cannot reload a Dream that has not yet been persisted
12
- dream: ${this.dream.constructor.name}
12
+ dream: ${this.dream['sanitizedConstructorName']}
13
13
  `;
14
14
  }
15
15
  }
@@ -8,7 +8,7 @@ class CreateOrFindByFailedToCreateAndFind extends Error {
8
8
  }
9
9
  get message() {
10
10
  return `
11
- Failed to create instance of ${this.dreamClass.name} and no matching model exists.
11
+ Failed to create instance of ${this.dreamClass.sanitizedName} and no matching model exists.
12
12
 
13
13
  The likely cause is that one of the \`createWith\` fields violates
14
14
  a uniqueness constraint.
@@ -15,7 +15,7 @@ class DoNotSetEncryptedFieldsDirectly extends Error {
15
15
  Do not set @Encrypted columns directly. Instead, set their accessors, so that
16
16
  those fields can be encrypted by Dream internally.
17
17
 
18
- Dream class: ${this.dreamClass.name}
18
+ Dream class: ${this.dreamClass.sanitizedName}
19
19
  Problematic setter: ${this.encryptedColumnName}
20
20
  Setter to be used instead: ${this.encryptedProperty}`;
21
21
  }
@@ -14,7 +14,7 @@ Whenever the using SoftDelete decorator, you must have either a deletedAt column
14
14
  or else another column defined, along with an ovrriding getter on your model, like so:
15
15
 
16
16
  @SoftDelete()
17
- class ${this.dreamClass.name} extends ApplicationModel {
17
+ class ${this.dreamClass.sanitizedName} extends ApplicationModel {
18
18
  public get deletedAtField() {
19
19
  return 'customDeletedAtField' as const
20
20
  }
@@ -9,14 +9,14 @@ class MissingSerializersDefinition extends Error {
9
9
  get message() {
10
10
  return `
11
11
  Missing serializers definition on the following class
12
- Dream class: ${this.dreamClass.name}
12
+ Dream class: ${this.dreamClass.sanitizedName}
13
13
 
14
- Try something like this in your ${this.dreamClass.name}'s serializer getter:
14
+ Try something like this in your ${this.dreamClass.sanitizedName}'s serializer getter:
15
15
 
16
- class ${this.dreamClass.name} {
17
- public get serializers(): DreamSerializers<${this.dreamClass.name}> {
16
+ class ${this.dreamClass.sanitizedName} {
17
+ public get serializers(): DreamSerializers<${this.dreamClass.sanitizedName}> {
18
18
  return {
19
- default: '${this.dreamClass.name}Serializer'
19
+ default: '${this.dreamClass.sanitizedName}Serializer'
20
20
  }
21
21
  }
22
22
  ...
@@ -11,14 +11,14 @@ class MissingTable extends Error {
11
11
  get message() {
12
12
  return `
13
13
  Missing table definition on the following dream class:
14
- Dream class: ${this.dreamClass.name}
14
+ Dream class: ${this.dreamClass.sanitizedName}
15
15
 
16
- Try something like this in your ${this.dreamClass.name}'s table getter:
16
+ Try something like this in your ${this.dreamClass.sanitizedName}'s table getter:
17
17
 
18
- class ${this.dreamClass.name} {
18
+ class ${this.dreamClass.sanitizedName} {
19
19
  ...
20
20
  public get table() {
21
- return '${(0, pluralize_esm_1.default)((0, snakeify_js_1.default)(this.dreamClass.name))}'
21
+ return '${(0, pluralize_esm_1.default)((0, snakeify_js_1.default)(this.dreamClass.sanitizedName))}'
22
22
  }
23
23
  }
24
24
  `;
@@ -12,10 +12,10 @@ class NonBelongsToAssociationProvidedAsSortableDecoratorScope extends Error {
12
12
  return `
13
13
  Only BelongsTo associations are supported as scopes for the @Sortable decorator.
14
14
  received:
15
- dream model class: ${this.dreamClass.name}
15
+ dream model class: ${this.dreamClass.sanitizedName}
16
16
  scope: ${this.scope}
17
17
 
18
- BelongsTo scopes on ${this.dreamClass.name} are:
18
+ BelongsTo scopes on ${this.dreamClass.sanitizedName} are:
19
19
  ${this.dreamClass['associationMetadataByType'].belongsTo.map(assoc => assoc.as).join('\n ')}
20
20
  `;
21
21
  }
@@ -12,10 +12,10 @@ class NonExistentScopeProvidedToResort extends Error {
12
12
  return `
13
13
  Only BelongsTo scopes are supported by the #resort method
14
14
  received:
15
- dream model class: ${this.dreamClass.name}
15
+ dream model class: ${this.dreamClass.sanitizedName}
16
16
  scope: ${this.scopes.join(', ')}
17
17
 
18
- BelongsTo scopes on ${this.dreamClass.name} are:
18
+ BelongsTo scopes on ${this.dreamClass.sanitizedName} are:
19
19
  ${this.dreamClass['sortableFields'].map(conf => conf.positionField).join('\n ')}
20
20
  `;
21
21
  }
@@ -12,13 +12,13 @@ class SortableDecoratorRequiresColumnOrBelongsToAssociation extends Error {
12
12
  return `
13
13
  Only Column or BelongsTo scopes are supported by the @Sortable decorator.
14
14
  received:
15
- dream model class: ${this.dreamClass.name}
15
+ dream model class: ${this.dreamClass.sanitizedName}
16
16
  scope: ${this.attributeOrScope}
17
17
 
18
- Columns on ${this.dreamClass.name} are:
18
+ Columns on ${this.dreamClass.sanitizedName} are:
19
19
  ${[...this.dreamClass.columns()].join('\n ')}
20
20
 
21
- BelongsTo scopes on ${this.dreamClass.name} are:
21
+ BelongsTo scopes on ${this.dreamClass.sanitizedName} are:
22
22
  ${this.dreamClass['associationMetadataByType'].belongsTo.map(assoc => assoc.as).join('\n ')}
23
23
  `;
24
24
  }
@@ -11,7 +11,7 @@ class CanOnlyPassBelongsToModelParam extends Error {
11
11
  get message() {
12
12
  return `
13
13
  Can only pass BelongsTo associated models as params
14
- Dream class: ${this.dreamClass.name}
14
+ Dream class: ${this.dreamClass.sanitizedName}
15
15
  Association: ${this.association.as}
16
16
  Association type: ${this.association.type}
17
17
  `;
@@ -11,7 +11,7 @@ class CannotAssociateThroughPolymorphic extends Error {
11
11
  get message() {
12
12
  return `
13
13
  Cannot join through a polymorphic association
14
- Dream class: ${this.dreamClass.name}
14
+ Dream class: ${this.dreamClass.sanitizedName}
15
15
  Association: ${this.association.as}
16
16
  `;
17
17
  }
@@ -11,7 +11,7 @@ class CannotCreateAssociationWithThroughContext extends Error {
11
11
  get message() {
12
12
  return `
13
13
  'createAssociation' is not supported for through associations.
14
- Dream class: ${this.dreamClass.name}
14
+ Dream class: ${this.dreamClass.sanitizedName}
15
15
  Association: ${this.association.as}
16
16
  `;
17
17
  }
@@ -15,7 +15,7 @@ class CannotJoinPolymorphicBelongsToError extends Error {
15
15
  get message() {
16
16
  return `
17
17
  Cannot join on a polymorphic BelongsTo
18
- Dream class: ${this.dreamClass.name}
18
+ Dream class: ${this.dreamClass.sanitizedName}
19
19
  Association: ${this.association.as}
20
20
  Inner Join statements:
21
21
  ${JSON.stringify(this.innerJoinStatements, null, 2)}
@@ -11,7 +11,7 @@ class CannotPassNullOrUndefinedToRequiredBelongsTo extends Error {
11
11
  get message() {
12
12
  return `
13
13
  Cannot pass null or undefined as a value to a required association.
14
- Dream class: ${this.dreamClass.name}
14
+ Dream class: ${this.dreamClass.sanitizedName}
15
15
  Association: ${this.association.as}
16
16
  `;
17
17
  }
@@ -18,7 +18,7 @@ class InvalidComputedForeignKey extends Error {
18
18
  get message() {
19
19
  return `
20
20
  Add an explicit foreignKey declaration to this association declaration:
21
- Dream class: ${this.dreamClass.name}
21
+ Dream class: ${this.dreamClass.sanitizedName}
22
22
  Association: ${this.partialAssociation.as}
23
23
  Dream tried ${this.computedForeignKey} automatically, but it isn't a column in table ${this.table}.
24
24
  `;
@@ -41,7 +41,7 @@ class ExplicitForeignKeyRequired extends Error {
41
41
  return `
42
42
  ${this.explicitForeignKey} is not a valid column on table ${this.table}.
43
43
  Fix the foreignKey declaration on:
44
- Dream class: ${this.dreamClass.name}
44
+ Dream class: ${this.dreamClass.sanitizedName}
45
45
  Association: ${this.partialAssociation.as}
46
46
  `;
47
47
  }
@@ -10,15 +10,15 @@ class JoinAttemptedOnMissingAssociation extends Error {
10
10
  }
11
11
  get message() {
12
12
  return `
13
- A joins call has been attempted on \`${this.dreamClass.name}\` association \`${this.associationName}\`,
14
- but \`${this.dreamClass.name}\` does not define association \`${this.associationName}\`.
13
+ A joins call has been attempted on \`${this.dreamClass.sanitizedName}\` association \`${this.associationName}\`,
14
+ but \`${this.dreamClass.sanitizedName}\` does not define association \`${this.associationName}\`.
15
15
 
16
16
 
17
17
  Either \`${this.associationName}\` is a typo in the joins statement, or association \`${this.associationName}\` needs to be defined on \`${this.dreamClass.name}\`, for example:
18
18
 
19
- class ${this.dreamClass.name} {
19
+ class ${this.dreamClass.sanitizedName} {
20
20
  ...
21
- @${this.dreamClass.name}.HasMany('SomeModelClass')
21
+ @${this.dreamClass.sanitizedName}.HasMany('SomeModelClass')
22
22
  public ${this.associationName}: SomeModelClass[]
23
23
  }
24
24
  `;
@@ -10,15 +10,15 @@ class MissingThroughAssociation extends Error {
10
10
  }
11
11
  get message() {
12
12
  return `
13
- \`${this.dreamClass.name}\` defines through association \`${this.association.through}\`, but \`${this.dreamClass.name}\` does not define association \`${this.association.through}\`.
13
+ \`${this.dreamClass.sanitizedName}\` defines through association \`${this.association.through}\`, but \`${this.dreamClass.name}\` does not define association \`${this.association.through}\`.
14
14
 
15
15
 
16
- To fix, define association \`${this.association.through}\` on \`${this.dreamClass.name}\`.
16
+ To fix, define association \`${this.association.through}\` on \`${this.dreamClass.sanitizedName}\`.
17
17
  For example:
18
18
 
19
- class ${this.dreamClass.name} {
19
+ class ${this.dreamClass.sanitizedName} {
20
20
  ...
21
- @${this.dreamClass.name}.HasMany('TheJoinModelClass')
21
+ @${this.dreamClass.sanitizedName}.HasMany('TheJoinModelClass')
22
22
  public ${this.association.through}: TheJoinModelClass[]
23
23
  }
24
24
  `;
@@ -12,29 +12,29 @@ class MissingThroughAssociationSource extends Error {
12
12
  }
13
13
  get message() {
14
14
  return `
15
- \`${this.dreamClass.name}\` defines association \`${this.association.as}\` through \`${this.dreamClass.name}\` association \`${this.association.through}\`.
15
+ \`${this.dreamClass.sanitizedName}\` defines association \`${this.association.as}\` through \`${this.dreamClass.sanitizedName}\` association \`${this.association.through}\`.
16
16
 
17
- \`${this.dreamClass.name}\` association \`${this.association.through}\` points to \`${this.throughClass.name}\`.
17
+ \`${this.dreamClass.sanitizedName}\` association \`${this.association.through}\` points to \`${this.throughClass.sanitizedName}\`.
18
18
 
19
- Dream expects association \`${this.association.source}\` to be defiend on \`${this.throughClass.name}\`, but \`${this.throughClass.name}\` does not define association \`${this.association.source}\`.
19
+ Dream expects association \`${this.association.source}\` to be defiend on \`${this.throughClass.sanitizedName}\`, but \`${this.throughClass.sanitizedName}\` does not define association \`${this.association.source}\`.
20
20
 
21
21
  There are two possible fixes:
22
22
 
23
23
  1. Provide an explicit \`source\` in addition to \`through\`.
24
24
 
25
- class ${this.dreamClass.name} {
25
+ class ${this.dreamClass.sanitizedName} {
26
26
  ...
27
- @${this.dreamClass.name}.HasMany(() => ${this.throughClass.name}, { through: '${this.association.through}', source: '<a valid association on ${this.throughClass.name}>'})
28
- public ${this.association.as}: ${this.throughClass.name}[]
27
+ @${this.dreamClass.name}.HasMany(() => ${this.throughClass.sanitizedName}, { through: '${this.association.through}', source: '<a valid association on ${this.throughClass.sanitizedName}>'})
28
+ public ${this.association.as}: ${this.throughClass.sanitizedName}[]
29
29
  }
30
30
 
31
- 2. Define association \`${this.association.source}\` on \`${this.throughClass.name}\`.
31
+ 2. Define association \`${this.association.source}\` on \`${this.throughClass.sanitizedName}\`.
32
32
  For example:
33
33
 
34
- class ${this.throughClass.name} {
34
+ class ${this.throughClass.sanitizedName} {
35
35
  ...
36
- @${this.throughClass.name}.HasMany(() => ${this.association.modelCB().name})
37
- public ${this.association.source}: ${this.association.modelCB().name}[]
36
+ @${this.throughClass.sanitizedName}.HasMany(() => ${this.association.modelCB().name})
37
+ public ${this.association.source}: ${this.association.modelCB().sanitizedName}[]
38
38
  }
39
39
  `;
40
40
  }
@@ -10,7 +10,7 @@ class NonLoadedAssociation extends Error {
10
10
  }
11
11
  get message() {
12
12
  return `
13
- Attempting to access \`${this.associationName}\` on an instance of \`${this.dreamClass.name}\`,
13
+ Attempting to access \`${this.associationName}\` on an instance of \`${this.dreamClass.sanitizedName}\`,
14
14
  but \`${this.associationName}\` has not been preloaded or loaded.
15
15
  `;
16
16
  }
@@ -11,7 +11,7 @@ class AnyRequiresArrayColumn extends Error {
11
11
  get message() {
12
12
  return `
13
13
  Attempting to call where({ ${this.column}: ops.any(<some value>)} ),
14
- but ${this.dreamClass.name}#${this.column} is not an array in the database.
14
+ but ${this.dreamClass.sanitizedName}#${this.column} is not an array in the database.
15
15
  `;
16
16
  }
17
17
  }
@@ -24,7 +24,7 @@ An unexpected error occurred while looking up an association that you have defin
24
24
 
25
25
  While building the schema for your app, we failed to find a match for
26
26
  the ${this.associationType} association "${this.associationName}" on the
27
- ${this.modelClass.name} model.
27
+ ${this.modelClass.sanitizedName} model.
28
28
 
29
29
  This method requires either a string or string array as the first argument,
30
30
  to the ${this.associationType} decorator. However, we received the following:
@@ -36,7 +36,7 @@ to the ${this.associationType} decorator. However, we received the following:
36
36
  "${typeof attemptedName}"
37
37
 
38
38
  Details:
39
- dream: ${this.modelClass.name} (${this.modelClass.globalName})
39
+ dream: ${this.modelClass.sanitizedName} (${this.modelClass.globalName})
40
40
  association type: ${this.associationType}
41
41
  association name: ${this.associationName}
42
42
  ".
@@ -53,7 +53,7 @@ An unexpected error occurred while looking up an association that you have defin
53
53
 
54
54
  While building the schema for your app, we failed to find a match for
55
55
  the ${this.associationType} association "${this.associationName}"
56
- on ${this.modelClass.name}, using the global model name "${attemptedName}".
56
+ on ${this.modelClass.sanitizedName}, using the global model name "${attemptedName}".
57
57
 
58
58
  Usually, this is because the global name for
59
59
  the model is not what you anticipated, which often happens when you are
@@ -65,7 +65,7 @@ first argument to an association, since it can help to catch these
65
65
  familiar gotchas.
66
66
 
67
67
  Details:
68
- dream: ${this.modelClass.name} (${this.modelClass.globalName})
68
+ dream: ${this.modelClass.sanitizedName} (${this.modelClass.globalName})
69
69
  association type: ${this.associationType}
70
70
  association name: ${this.associationName}
71
71
  attempted model name: ${attemptedName}
@@ -13,7 +13,7 @@ class STIChildMissing extends Error {
13
13
  get message() {
14
14
  return `
15
15
  Missing STI child class
16
- Base Dream class: ${this.baseDreamClass.name}
16
+ Base Dream class: ${this.baseDreamClass.sanitizedName}
17
17
  Type specified in DB record: ${this.extendingDreamClassName}
18
18
  Table: ${this.baseDreamClass.table}
19
19
  Primary key value: ${this.primaryKeyValue}
@@ -10,7 +10,7 @@ class StiChildIncompatibleWithSoftDeleteDecorator extends Error {
10
10
  return `
11
11
  @SoftDelete decorator cannot be applied to STI children.
12
12
  Apply @SoftDelete to the base STI class instead.
13
- STI child class: ${this.childStiDreamClass.name}
13
+ STI child class: ${this.childStiDreamClass.sanitizedName}
14
14
  `;
15
15
  }
16
16
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debug = exports.compact = exports.generateDream = exports.capitalize = exports.camelize = exports.CalendarDate = exports.Benchmark = exports.ValidationError = exports.RecordNotFound = exports.GlobalNameNotSet = exports.CreateOrFindByFailedToCreateAndFind = exports.NonLoadedAssociation = exports.Encrypt = exports.DreamConst = exports.Query = exports.DreamTransaction = exports.Dream = exports.DreamApplication = exports.lookupClassByGlobalName = exports.DreamImporter = exports.Virtual = exports.Validates = exports.Validate = exports.STI = exports.Sortable = exports.SoftDelete = exports.Scope = exports.ReplicaSafe = exports.BeforeUpdate = exports.BeforeSave = exports.BeforeDestroy = exports.BeforeCreate = exports.AfterUpdateCommit = exports.AfterUpdate = exports.AfterSaveCommit = exports.AfterSave = exports.AfterDestroyCommit = exports.AfterDestroy = exports.AfterCreateCommit = exports.AfterCreate = exports.Decorators = exports.validateTable = exports.validateColumn = exports.DreamMigrationHelpers = exports.db = exports.pgErrorType = exports.dreamDbConnections = exports.closeAllDbConnections = exports.DreamCLI = exports.DreamBin = void 0;
4
- exports.DreamSerializer = exports.Attribute = exports.RendersOne = exports.RendersMany = exports.ops = exports.openapiShorthandPrimitiveTypes = exports.openapiPrimitiveTypes = exports.uniq = exports.uncapitalize = exports.standardizeFullyQualifiedModelName = exports.sortBy = exports.snakeify = exports.serializerNameFromFullyQualifiedModelName = exports.round = exports.range = exports.Range = exports.sharedPathPrefix = exports.relativeDreamPath = exports.dreamPath = exports.pascalize = exports.loadRepl = exports.isEmpty = exports.inferSerializerFromDreamOrViewModel = exports.inferSerializerFromDreamClassOrViewModelClass = exports.hyphenize = exports.globalClassNameFromFullyQualifiedModelName = exports.Env = void 0;
3
+ exports.range = exports.Range = exports.sharedPathPrefix = exports.relativeDreamPath = exports.dreamPath = exports.pascalize = exports.loadRepl = exports.isEmpty = exports.inferSerializerFromDreamOrViewModel = exports.inferSerializerFromDreamClassOrViewModelClass = exports.hyphenize = exports.globalClassNameFromFullyQualifiedModelName = exports.Env = exports.debug = exports.compact = exports.generateDream = exports.capitalize = exports.camelize = exports.CalendarDate = exports.Benchmark = exports.ValidationError = exports.RecordNotFound = exports.GlobalNameNotSet = exports.CreateOrFindByFailedToCreateAndFind = exports.NonLoadedAssociation = exports.Encrypt = exports.DreamConst = exports.Query = exports.DreamTransaction = exports.Dream = exports.DreamApplication = exports.lookupClassByGlobalName = exports.DreamImporter = exports.Virtual = exports.Validates = exports.Validate = exports.STI = exports.SoftDelete = exports.Scope = exports.ReplicaSafe = exports.Decorators = exports.validateTable = exports.validateColumn = exports.DreamMigrationHelpers = exports.db = exports.pgErrorType = exports.dreamDbConnections = exports.closeAllDbConnections = exports.DreamCLI = exports.DreamBin = void 0;
4
+ exports.DreamSerializer = exports.Attribute = exports.RendersOne = exports.RendersMany = exports.ops = exports.openapiShorthandPrimitiveTypes = exports.openapiPrimitiveTypes = exports.uniq = exports.uncapitalize = exports.standardizeFullyQualifiedModelName = exports.sortBy = exports.snakeify = exports.serializerNameFromFullyQualifiedModelName = exports.round = void 0;
5
5
  var index_js_1 = require("./bin/index.js");
6
6
  Object.defineProperty(exports, "DreamBin", { enumerable: true, get: function () { return index_js_1.default; } });
7
7
  var index_js_2 = require("./cli/index.js");
@@ -21,38 +21,12 @@ var validateTable_js_1 = require("./db/validators/validateTable.js");
21
21
  Object.defineProperty(exports, "validateTable", { enumerable: true, get: function () { return validateTable_js_1.default; } });
22
22
  var Decorators_js_1 = require("./decorators/Decorators.js");
23
23
  Object.defineProperty(exports, "Decorators", { enumerable: true, get: function () { return Decorators_js_1.default; } });
24
- var AfterCreate_js_1 = require("./decorators/hooks/AfterCreate.js");
25
- Object.defineProperty(exports, "AfterCreate", { enumerable: true, get: function () { return AfterCreate_js_1.default; } });
26
- var AfterCreateCommit_js_1 = require("./decorators/hooks/AfterCreateCommit.js");
27
- Object.defineProperty(exports, "AfterCreateCommit", { enumerable: true, get: function () { return AfterCreateCommit_js_1.default; } });
28
- var AfterDestroy_js_1 = require("./decorators/hooks/AfterDestroy.js");
29
- Object.defineProperty(exports, "AfterDestroy", { enumerable: true, get: function () { return AfterDestroy_js_1.default; } });
30
- var AfterDestroyCommit_js_1 = require("./decorators/hooks/AfterDestroyCommit.js");
31
- Object.defineProperty(exports, "AfterDestroyCommit", { enumerable: true, get: function () { return AfterDestroyCommit_js_1.default; } });
32
- var AfterSave_js_1 = require("./decorators/hooks/AfterSave.js");
33
- Object.defineProperty(exports, "AfterSave", { enumerable: true, get: function () { return AfterSave_js_1.default; } });
34
- var AfterSaveCommit_js_1 = require("./decorators/hooks/AfterSaveCommit.js");
35
- Object.defineProperty(exports, "AfterSaveCommit", { enumerable: true, get: function () { return AfterSaveCommit_js_1.default; } });
36
- var AfterUpdate_js_1 = require("./decorators/hooks/AfterUpdate.js");
37
- Object.defineProperty(exports, "AfterUpdate", { enumerable: true, get: function () { return AfterUpdate_js_1.default; } });
38
- var AfterUpdateCommit_js_1 = require("./decorators/hooks/AfterUpdateCommit.js");
39
- Object.defineProperty(exports, "AfterUpdateCommit", { enumerable: true, get: function () { return AfterUpdateCommit_js_1.default; } });
40
- var BeforeCreate_js_1 = require("./decorators/hooks/BeforeCreate.js");
41
- Object.defineProperty(exports, "BeforeCreate", { enumerable: true, get: function () { return BeforeCreate_js_1.default; } });
42
- var BeforeDestroy_js_1 = require("./decorators/hooks/BeforeDestroy.js");
43
- Object.defineProperty(exports, "BeforeDestroy", { enumerable: true, get: function () { return BeforeDestroy_js_1.default; } });
44
- var BeforeSave_js_1 = require("./decorators/hooks/BeforeSave.js");
45
- Object.defineProperty(exports, "BeforeSave", { enumerable: true, get: function () { return BeforeSave_js_1.default; } });
46
- var BeforeUpdate_js_1 = require("./decorators/hooks/BeforeUpdate.js");
47
- Object.defineProperty(exports, "BeforeUpdate", { enumerable: true, get: function () { return BeforeUpdate_js_1.default; } });
48
24
  var ReplicaSafe_js_1 = require("./decorators/ReplicaSafe.js");
49
25
  Object.defineProperty(exports, "ReplicaSafe", { enumerable: true, get: function () { return ReplicaSafe_js_1.default; } });
50
26
  var Scope_js_1 = require("./decorators/Scope.js");
51
27
  Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return Scope_js_1.default; } });
52
28
  var SoftDelete_js_1 = require("./decorators/SoftDelete.js");
53
29
  Object.defineProperty(exports, "SoftDelete", { enumerable: true, get: function () { return SoftDelete_js_1.default; } });
54
- var Sortable_js_1 = require("./decorators/sortable/Sortable.js");
55
- Object.defineProperty(exports, "Sortable", { enumerable: true, get: function () { return Sortable_js_1.default; } });
56
30
  var STI_js_1 = require("./decorators/STI.js");
57
31
  Object.defineProperty(exports, "STI", { enumerable: true, get: function () { return STI_js_1.default; } });
58
32
  var Validate_js_1 = require("./decorators/validations/Validate.js");
@@ -311,6 +311,43 @@ export default class Dream {
311
311
  static get stiBaseClassOrOwnClass() {
312
312
  return this.sti.baseClass || this;
313
313
  }
314
+ /**
315
+ * @internal
316
+ *
317
+ * Returns either the base STI class name, or else this class name
318
+ *
319
+ * NOTE: This is necessary due to changes in esbuild strategy WRT esm,
320
+ * compiled class names can contain a prefixing underscore if they contain
321
+ * private fields.
322
+ *
323
+ * This can create confusion when the class name is used as an attribute,
324
+ * as is done in the case of polymorphic associations, which use the class
325
+ * name as the "type" value for the polymorphic association.
326
+ *
327
+ * As such, any time the class name is being used as a value, it should be
328
+ * done using this value, rather than going to the class name directly.
329
+ *
330
+ * see https://github.com/evanw/esbuild/issues/1260 for more information
331
+ *
332
+ * @returns string
333
+ */
334
+ static get stiBaseClassOrOwnClassName() {
335
+ return this.stiBaseClassOrOwnClass.sanitizedName;
336
+ }
337
+ /**
338
+ * @internal
339
+ *
340
+ * Returns the class name, replacing prefixed underscores, since esbuild
341
+ * will translate some class names to have underscore prefixes, which can
342
+ * cause unexpected behavior.
343
+ *
344
+ * see https://github.com/evanw/esbuild/issues/1260 for more information
345
+ *
346
+ * @returns string
347
+ */
348
+ static get sanitizedName() {
349
+ return this.name.replace(/^_/, '');
350
+ }
314
351
  /**
315
352
  * @internal
316
353
  *
@@ -321,6 +358,26 @@ export default class Dream {
321
358
  get stiBaseClassOrOwnClass() {
322
359
  return this.constructor.stiBaseClassOrOwnClass;
323
360
  }
361
+ /**
362
+ * @internal
363
+ *
364
+ * Shadows .stiBaseClassOrOwnClassName. Returns a string
365
+ *
366
+ * @returns A string
367
+ */
368
+ get stiBaseClassOrOwnClassName() {
369
+ return this.constructor.stiBaseClassOrOwnClassName;
370
+ }
371
+ /**
372
+ * @internal
373
+ *
374
+ * Shadows .sanitizedName. Returns a string
375
+ *
376
+ * @returns A string
377
+ */
378
+ get sanitizedConstructorName() {
379
+ return this.constructor.sanitizedName;
380
+ }
324
381
  /**
325
382
  * @internal
326
383
  *
@@ -1073,7 +1130,7 @@ export default class Dream {
1073
1130
  *
1074
1131
  * ```ts
1075
1132
  * class Post extends ApplicationModel {
1076
- * @Sortable({ scope: ['user']})
1133
+ * @Deco.Sortable({ scope: ['user']})
1077
1134
  * public position: DreamColumn<User, 'position'>
1078
1135
  * }
1079
1136
  *
@@ -1856,7 +1913,7 @@ export default class Dream {
1856
1913
  }
1857
1914
  if (belongsToAssociationMetaData.polymorphic) {
1858
1915
  const foreignKeyTypeField = belongsToAssociationMetaData.foreignKeyTypeField();
1859
- returnValues[foreignKeyTypeField] = associatedObject?.stiBaseClassOrOwnClass?.name;
1916
+ returnValues[foreignKeyTypeField] = associatedObject?.stiBaseClassOrOwnClassName;
1860
1917
  setAttributeOnDreamInstance(foreignKeyTypeField, returnValues[foreignKeyTypeField]);
1861
1918
  }
1862
1919
  }