@rvoh/dream 2.40.2 → 2.42.0

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 (269) hide show
  1. package/dist/cjs/src/Dream.js +156 -13
  2. package/dist/cjs/src/cli/index.js +39 -5
  3. package/dist/cjs/src/db/DreamDbConnection.js +19 -1
  4. package/dist/cjs/src/dream/DreamClassTransactionBuilder.js +34 -2
  5. package/dist/cjs/src/dream/Query.js +178 -14
  6. package/dist/cjs/src/dream/QueryDriver/Base.js +80 -0
  7. package/dist/cjs/src/dream/QueryDriver/Kysely.js +35 -29
  8. package/dist/cjs/src/dream/QueryDriver/Postgres.js +83 -1
  9. package/dist/cjs/src/dream/internal/findOrCreateBy.js +5 -1
  10. package/dist/cjs/src/dream/internal/findOrCreateLookupStatement.js +19 -0
  11. package/dist/cjs/src/dream/internal/updateOrCreateBy.js +5 -1
  12. package/dist/cjs/src/encrypt/algorithms/aes-gcm/decryptAESGCM.js +24 -10
  13. package/dist/cjs/src/errors/CreateOrFindByFailedToCreateAndFind.js +63 -6
  14. package/dist/cjs/src/errors/CreateOrUpdateByFailedToCreateAndUpdate.js +41 -6
  15. package/dist/cjs/src/errors/GeneratedFilesAlreadyExist.js +38 -0
  16. package/dist/cjs/src/errors/schema-builder/ColumnNamesDoNotRoundTrip.js +28 -0
  17. package/dist/cjs/src/helpers/cli/ASTConnectionBuilder.js +62 -10
  18. package/dist/cjs/src/helpers/cli/generateDream.js +109 -18
  19. package/dist/cjs/src/helpers/cli/generateMigration.js +12 -8
  20. package/dist/cjs/src/helpers/cli/writeGeneratedFile.js +3 -3
  21. package/dist/cjs/src/helpers/db/normalizeDataForDb.js +33 -4
  22. package/dist/cjs/src/ops/index.js +7 -3
  23. package/dist/esm/src/Dream.js +156 -13
  24. package/dist/esm/src/cli/index.js +39 -5
  25. package/dist/esm/src/db/DreamDbConnection.js +19 -1
  26. package/dist/esm/src/dream/DreamClassTransactionBuilder.js +34 -2
  27. package/dist/esm/src/dream/Query.js +178 -14
  28. package/dist/esm/src/dream/QueryDriver/Base.js +80 -0
  29. package/dist/esm/src/dream/QueryDriver/Kysely.js +35 -29
  30. package/dist/esm/src/dream/QueryDriver/Postgres.js +83 -1
  31. package/dist/esm/src/dream/internal/findOrCreateBy.js +5 -1
  32. package/dist/esm/src/dream/internal/findOrCreateLookupStatement.js +19 -0
  33. package/dist/esm/src/dream/internal/updateOrCreateBy.js +5 -1
  34. package/dist/esm/src/encrypt/algorithms/aes-gcm/decryptAESGCM.js +24 -10
  35. package/dist/esm/src/errors/CreateOrFindByFailedToCreateAndFind.js +63 -6
  36. package/dist/esm/src/errors/CreateOrUpdateByFailedToCreateAndUpdate.js +41 -6
  37. package/dist/esm/src/errors/GeneratedFilesAlreadyExist.js +38 -0
  38. package/dist/esm/src/errors/schema-builder/ColumnNamesDoNotRoundTrip.js +28 -0
  39. package/dist/esm/src/helpers/cli/ASTConnectionBuilder.js +62 -10
  40. package/dist/esm/src/helpers/cli/generateDream.js +109 -18
  41. package/dist/esm/src/helpers/cli/generateMigration.js +12 -8
  42. package/dist/esm/src/helpers/cli/writeGeneratedFile.js +3 -3
  43. package/dist/esm/src/helpers/db/normalizeDataForDb.js +33 -4
  44. package/dist/esm/src/ops/index.js +7 -3
  45. package/dist/types/src/Dream.d.ts +109 -6
  46. package/dist/types/src/bin/index.d.ts +11 -0
  47. package/dist/types/src/cli/index.d.ts +27 -0
  48. package/dist/types/src/db/DreamDbConnection.d.ts +15 -1
  49. package/dist/types/src/dream/DreamClassTransactionBuilder.d.ts +34 -2
  50. package/dist/types/src/dream/Query.d.ts +101 -6
  51. package/dist/types/src/dream/QueryDriver/Base.d.ts +59 -0
  52. package/dist/types/src/dream/QueryDriver/Kysely.d.ts +9 -0
  53. package/dist/types/src/dream/QueryDriver/Postgres.d.ts +29 -1
  54. package/dist/types/src/dream/internal/executeDatabaseQuery.d.ts +2 -1
  55. package/dist/types/src/dream/internal/findOrCreateLookupStatement.d.ts +14 -0
  56. package/dist/types/src/errors/CreateOrFindByFailedToCreateAndFind.d.ts +40 -1
  57. package/dist/types/src/errors/CreateOrUpdateByFailedToCreateAndUpdate.d.ts +8 -1
  58. package/dist/types/src/errors/GeneratedFilesAlreadyExist.d.ts +18 -0
  59. package/dist/types/src/errors/schema-builder/ColumnNamesDoNotRoundTrip.d.ts +12 -0
  60. package/dist/types/src/helpers/cli/ASTConnectionBuilder.d.ts +23 -1
  61. package/dist/types/src/helpers/cli/generateDream.d.ts +25 -0
  62. package/dist/types/src/helpers/cli/generateMigration.d.ts +20 -2
  63. package/dist/types/src/helpers/cli/syncWithFailureContext.d.ts +7 -2
  64. package/dist/types/src/helpers/cli/writeGeneratedFile.d.ts +6 -1
  65. package/dist/types/src/helpers/db/normalizeDataForDb.d.ts +7 -0
  66. package/dist/types/src/ops/index.d.ts +7 -3
  67. package/dist/types/src/types/associations/shared.d.ts +7 -5
  68. package/dist/types/src/types/types/associations/shared.ts +27 -5
  69. package/docs/assets/hierarchy.js +1 -1
  70. package/docs/assets/search.js +1 -1
  71. package/docs/classes/db.DreamMigrationHelpers.html +11 -11
  72. package/docs/classes/db.KyselyQueryDriver.html +87 -50
  73. package/docs/classes/db.PostgresQueryDriver.html +76 -50
  74. package/docs/classes/db.QueryDriverBase.html +87 -50
  75. package/docs/classes/errors.CannotSaveMissingDream.html +2 -2
  76. package/docs/classes/errors.CheckConstraintViolation.html +3 -3
  77. package/docs/classes/errors.ColumnOverflow.html +3 -3
  78. package/docs/classes/errors.CreateOrFindByFailedToCreateAndFind.html +6 -3
  79. package/docs/classes/errors.DataIncompatibleWithDatabaseField.html +3 -3
  80. package/docs/classes/errors.DataTypeColumnTypeMismatch.html +3 -3
  81. package/docs/classes/errors.DecryptionError.html +2 -2
  82. package/docs/classes/errors.DecryptionParseError.html +2 -2
  83. package/docs/classes/errors.DecryptionRotationError.html +3 -3
  84. package/docs/classes/errors.GlobalNameNotSet.html +3 -3
  85. package/docs/classes/errors.InvalidCalendarDate.html +2 -2
  86. package/docs/classes/errors.InvalidClockTime.html +2 -2
  87. package/docs/classes/errors.InvalidClockTimeTz.html +2 -2
  88. package/docs/classes/errors.InvalidDateTime.html +2 -2
  89. package/docs/classes/errors.MissingSerializersDefinition.html +3 -3
  90. package/docs/classes/errors.NonLoadedAssociation.html +3 -3
  91. package/docs/classes/errors.NotNullViolation.html +3 -3
  92. package/docs/classes/errors.RecordNotFound.html +3 -3
  93. package/docs/classes/errors.SortableScopeDidNotStabilize.html +3 -3
  94. package/docs/classes/errors.SortableScopeLockWaitTimedOut.html +3 -3
  95. package/docs/classes/errors.ValidationError.html +3 -3
  96. package/docs/classes/index.CalendarDate.html +33 -33
  97. package/docs/classes/index.ClockTime.html +32 -32
  98. package/docs/classes/index.ClockTimeTz.html +35 -35
  99. package/docs/classes/index.DateTime.html +86 -86
  100. package/docs/classes/index.Decorators.html +19 -19
  101. package/docs/classes/index.Dream.html +204 -134
  102. package/docs/classes/index.DreamApp.html +13 -13
  103. package/docs/classes/index.DreamTransaction.html +3 -3
  104. package/docs/classes/index.Env.html +5 -5
  105. package/docs/classes/index.Query.html +147 -100
  106. package/docs/classes/system.CliFileWriter.html +4 -4
  107. package/docs/classes/system.DreamBin.html +7 -3
  108. package/docs/classes/system.DreamCLI.html +7 -7
  109. package/docs/classes/system.DreamImporter.html +2 -2
  110. package/docs/classes/system.DreamLogos.html +2 -2
  111. package/docs/classes/system.DreamSerializerBuilder.html +11 -11
  112. package/docs/classes/system.ObjectSerializerBuilder.html +8 -8
  113. package/docs/classes/system.PathHelpers.html +3 -3
  114. package/docs/classes/utils.Encrypt.html +4 -4
  115. package/docs/classes/utils.Range.html +2 -2
  116. package/docs/functions/db.closeAllDbConnections.html +1 -1
  117. package/docs/functions/db.dreamDbConnections.html +1 -1
  118. package/docs/functions/db.untypedDb.html +1 -1
  119. package/docs/functions/db.validateColumn.html +1 -1
  120. package/docs/functions/db.validateTable.html +1 -1
  121. package/docs/functions/errors.pgErrorType.html +1 -1
  122. package/docs/functions/index.DreamSerializer.html +1 -1
  123. package/docs/functions/index.ObjectSerializer.html +1 -1
  124. package/docs/functions/index.ReplicaSafe.html +1 -1
  125. package/docs/functions/index.STI.html +1 -1
  126. package/docs/functions/index.SoftDelete.html +1 -1
  127. package/docs/functions/utils.camelize.html +1 -1
  128. package/docs/functions/utils.capitalize.html +1 -1
  129. package/docs/functions/utils.cloneDeepSafe.html +1 -1
  130. package/docs/functions/utils.compact.html +1 -1
  131. package/docs/functions/utils.groupBy.html +1 -1
  132. package/docs/functions/utils.hyphenize.html +1 -1
  133. package/docs/functions/utils.intersection.html +1 -1
  134. package/docs/functions/utils.isEmpty.html +3 -3
  135. package/docs/functions/utils.normalizeUnicode.html +1 -1
  136. package/docs/functions/utils.pascalize.html +1 -1
  137. package/docs/functions/utils.percent.html +1 -1
  138. package/docs/functions/utils.range.html +1 -1
  139. package/docs/functions/utils.round.html +1 -1
  140. package/docs/functions/utils.sanitizeString.html +1 -1
  141. package/docs/functions/utils.snakeify.html +1 -1
  142. package/docs/functions/utils.sort.html +1 -1
  143. package/docs/functions/utils.sortBy.html +1 -1
  144. package/docs/functions/utils.sortObjectByKey.html +1 -1
  145. package/docs/functions/utils.sortObjectByValue.html +1 -1
  146. package/docs/functions/utils.uncapitalize.html +1 -1
  147. package/docs/functions/utils.uniq.html +1 -1
  148. package/docs/hierarchy.html +1 -1
  149. package/docs/interfaces/openapi.OpenapiDescription.html +2 -2
  150. package/docs/interfaces/openapi.OpenapiSchemaProperties.html +1 -1
  151. package/docs/interfaces/openapi.OpenapiSchemaPropertiesShorthand.html +1 -1
  152. package/docs/interfaces/openapi.OpenapiTypeFieldObject.html +1 -1
  153. package/docs/interfaces/types.BelongsToStatement.html +2 -2
  154. package/docs/interfaces/types.DecoratorContext.html +2 -2
  155. package/docs/interfaces/types.DecryptCallbacks.html +2 -2
  156. package/docs/interfaces/types.DreamAppInitOptions.html +2 -2
  157. package/docs/interfaces/types.DreamAppOpts.html +2 -2
  158. package/docs/interfaces/types.DreamDbConfig.html +6 -6
  159. package/docs/interfaces/types.DurationObject.html +2 -2
  160. package/docs/interfaces/types.EncryptOptions.html +2 -2
  161. package/docs/interfaces/types.EncryptionLegacyKeyUsedEvent.html +4 -4
  162. package/docs/interfaces/types.InternalAnyTypedSerializerRendersMany.html +2 -2
  163. package/docs/interfaces/types.InternalAnyTypedSerializerRendersOne.html +2 -2
  164. package/docs/interfaces/types.IntrospectedColumn.html +7 -7
  165. package/docs/interfaces/types.IntrospectedDatabase.html +2 -2
  166. package/docs/interfaces/types.IntrospectedEnum.html +2 -2
  167. package/docs/interfaces/types.IntrospectedTable.html +5 -5
  168. package/docs/interfaces/types.SerializerRendererOpts.html +2 -2
  169. package/docs/types/openapi.CommonOpenapiSchemaObjectFields.html +1 -1
  170. package/docs/types/openapi.OpenapiAllTypes.html +1 -1
  171. package/docs/types/openapi.OpenapiFormats.html +1 -1
  172. package/docs/types/openapi.OpenapiNumberFormats.html +1 -1
  173. package/docs/types/openapi.OpenapiPrimitiveBaseTypes.html +1 -1
  174. package/docs/types/openapi.OpenapiPrimitiveTypes.html +1 -1
  175. package/docs/types/openapi.OpenapiSchemaArray.html +1 -1
  176. package/docs/types/openapi.OpenapiSchemaArrayShorthand.html +1 -1
  177. package/docs/types/openapi.OpenapiSchemaBase.html +1 -1
  178. package/docs/types/openapi.OpenapiSchemaBody.html +1 -1
  179. package/docs/types/openapi.OpenapiSchemaBodyShorthand.html +1 -1
  180. package/docs/types/openapi.OpenapiSchemaCombinatorFields.html +1 -1
  181. package/docs/types/openapi.OpenapiSchemaCommonFields.html +1 -1
  182. package/docs/types/openapi.OpenapiSchemaExpressionAllOf.html +1 -1
  183. package/docs/types/openapi.OpenapiSchemaExpressionAnyOf.html +1 -1
  184. package/docs/types/openapi.OpenapiSchemaExpressionOneOf.html +1 -1
  185. package/docs/types/openapi.OpenapiSchemaExpressionRef.html +2 -2
  186. package/docs/types/openapi.OpenapiSchemaExpressionRefSchemaShorthand.html +2 -2
  187. package/docs/types/openapi.OpenapiSchemaInteger.html +1 -1
  188. package/docs/types/openapi.OpenapiSchemaNull.html +2 -2
  189. package/docs/types/openapi.OpenapiSchemaNumber.html +1 -1
  190. package/docs/types/openapi.OpenapiSchemaObject.html +1 -1
  191. package/docs/types/openapi.OpenapiSchemaObjectAllOf.html +1 -1
  192. package/docs/types/openapi.OpenapiSchemaObjectAllOfShorthand.html +1 -1
  193. package/docs/types/openapi.OpenapiSchemaObjectBase.html +1 -1
  194. package/docs/types/openapi.OpenapiSchemaObjectBaseShorthand.html +1 -1
  195. package/docs/types/openapi.OpenapiSchemaObjectShorthand.html +1 -1
  196. package/docs/types/openapi.OpenapiSchemaPrimitiveGeneric.html +1 -1
  197. package/docs/types/openapi.OpenapiSchemaShorthandExpressionAllOf.html +1 -1
  198. package/docs/types/openapi.OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
  199. package/docs/types/openapi.OpenapiSchemaShorthandExpressionOneOf.html +1 -1
  200. package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializableRef.html +2 -2
  201. package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializerRef.html +2 -2
  202. package/docs/types/openapi.OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
  203. package/docs/types/openapi.OpenapiSchemaString.html +1 -1
  204. package/docs/types/openapi.OpenapiShorthandAllTypes.html +1 -1
  205. package/docs/types/openapi.OpenapiShorthandPrimitiveBaseTypes.html +1 -1
  206. package/docs/types/openapi.OpenapiShorthandPrimitiveTypes.html +1 -1
  207. package/docs/types/openapi.OpenapiTypeField.html +1 -1
  208. package/docs/types/system.DreamAppAllowedPackageManagersEnum.html +1 -1
  209. package/docs/types/types.CalendarDateDurationUnit.html +1 -1
  210. package/docs/types/types.CalendarDateObject.html +1 -1
  211. package/docs/types/types.Camelized.html +1 -1
  212. package/docs/types/types.ClockTimeObject.html +1 -1
  213. package/docs/types/types.DbConnectionType.html +1 -1
  214. package/docs/types/types.DbTypes.html +1 -1
  215. package/docs/types/types.DreamAssociationMetadata.html +1 -1
  216. package/docs/types/types.DreamAttributes.html +1 -1
  217. package/docs/types/types.DreamClassAssociationAndStatement.html +1 -1
  218. package/docs/types/types.DreamClassColumn.html +1 -1
  219. package/docs/types/types.DreamColumn.html +1 -1
  220. package/docs/types/types.DreamColumnNames.html +1 -1
  221. package/docs/types/types.DreamLogLevel.html +1 -1
  222. package/docs/types/types.DreamLogger.html +2 -2
  223. package/docs/types/types.DreamModelSerializerType.html +1 -1
  224. package/docs/types/types.DreamOrViewModelClassSerializerKey.html +1 -1
  225. package/docs/types/types.DreamOrViewModelSerializerKey.html +1 -1
  226. package/docs/types/types.DreamParamSafeAttributes.html +1 -1
  227. package/docs/types/types.DreamParamSafeColumnNames.html +1 -1
  228. package/docs/types/types.DreamSerializable.html +1 -1
  229. package/docs/types/types.DreamSerializableArray.html +1 -1
  230. package/docs/types/types.DreamSerializerKey.html +1 -1
  231. package/docs/types/types.DreamSerializers.html +1 -1
  232. package/docs/types/types.DreamVirtualColumns.html +1 -1
  233. package/docs/types/types.DurationUnit.html +1 -1
  234. package/docs/types/types.EncryptAlgorithm.html +1 -1
  235. package/docs/types/types.HasManyStatement.html +1 -1
  236. package/docs/types/types.HasOneStatement.html +1 -1
  237. package/docs/types/types.Hyphenized.html +1 -1
  238. package/docs/types/types.IntrospectedValueType.html +1 -1
  239. package/docs/types/types.Pascalized.html +1 -1
  240. package/docs/types/types.PrimaryKeyType.html +1 -1
  241. package/docs/types/types.RoundingPrecision.html +1 -1
  242. package/docs/types/types.SerializerCasing.html +1 -1
  243. package/docs/types/types.SimpleObjectSerializerType.html +1 -1
  244. package/docs/types/types.Snakeified.html +1 -1
  245. package/docs/types/types.StrictInterface.html +1 -1
  246. package/docs/types/types.UpdateableAssociationProperties.html +1 -1
  247. package/docs/types/types.UpdateableProperties.html +1 -1
  248. package/docs/types/types.ValidationType.html +1 -1
  249. package/docs/types/types.ViewModel.html +2 -2
  250. package/docs/types/types.ViewModelClass.html +1 -1
  251. package/docs/types/types.WeekdayName.html +1 -1
  252. package/docs/types/types.WhereStatementForDream.html +1 -1
  253. package/docs/types/types.WhereStatementForDreamClass.html +1 -1
  254. package/docs/variables/index.DreamConst.html +1 -1
  255. package/docs/variables/index.ops.html +8 -4
  256. package/docs/variables/openapi.openapiPrimitiveTypes.html +1 -1
  257. package/docs/variables/openapi.openapiShorthandPrimitiveTypes.html +1 -1
  258. package/docs/variables/system.DreamAppAllowedPackageManagersEnumValues.html +1 -1
  259. package/docs/variables/system.primaryKeyTypes.html +1 -1
  260. package/package.json +1 -1
  261. package/dist/cjs/src/helpers/cli/generateFactory.js +0 -10
  262. package/dist/cjs/src/helpers/cli/generateSerializer.js +0 -18
  263. package/dist/cjs/src/helpers/cli/generateUnitSpec.js +0 -10
  264. package/dist/esm/src/helpers/cli/generateFactory.js +0 -10
  265. package/dist/esm/src/helpers/cli/generateSerializer.js +0 -18
  266. package/dist/esm/src/helpers/cli/generateUnitSpec.js +0 -10
  267. package/dist/types/src/helpers/cli/generateFactory.d.ts +0 -5
  268. package/dist/types/src/helpers/cli/generateSerializer.d.ts +0 -9
  269. package/dist/types/src/helpers/cli/generateUnitSpec.d.ts +0 -3

There are too many changes on this page to be displayed.


The amount of changes on this page would crash your brower.

You can still verify the content by downloading the package file manually.