@rvoh/dream 0.32.4 → 0.34.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.
- package/dist/cjs/src/Dream.js +1 -1
- package/dist/cjs/src/bin/helpers/sync.js +2 -2
- package/dist/cjs/src/dream-application/helpers/DreamImporter.js +0 -5
- package/dist/cjs/src/dream-application/helpers/lookupClassByGlobalName.js +0 -2
- package/dist/cjs/src/dream-application/index.js +4 -10
- package/dist/cjs/src/helpers/DreamGlam/howyadoins/whaaaaaaaaaaok.js +2 -2
- package/dist/cjs/src/helpers/cli/SchemaBuilder.js +2 -2
- package/dist/cjs/src/helpers/cli/autoGeneratedFileDisclaimer.js +33 -0
- package/dist/cjs/src/helpers/loadRepl.js +3 -5
- package/dist/cjs/src/helpers/path/dreamPath.js +0 -2
- package/dist/cjs/src/index.js +3 -4
- package/dist/esm/src/Dream.js +1 -1
- package/dist/esm/src/bin/helpers/sync.js +1 -1
- package/dist/esm/src/dream-application/helpers/DreamImporter.js +0 -5
- package/dist/esm/src/dream-application/helpers/lookupClassByGlobalName.js +0 -2
- package/dist/esm/src/dream-application/index.js +4 -10
- package/dist/esm/src/helpers/DreamGlam/howyadoins/whaaaaaaaaaaok.js +2 -2
- package/dist/esm/src/helpers/cli/SchemaBuilder.js +1 -1
- package/dist/esm/src/helpers/cli/autoGeneratedFileDisclaimer.js +30 -0
- package/dist/esm/src/helpers/loadRepl.js +3 -5
- package/dist/esm/src/helpers/path/dreamPath.js +0 -2
- package/dist/esm/src/index.js +2 -2
- package/dist/types/src/Dream.d.ts +1 -1
- package/dist/types/src/dream-application/helpers/DreamImporter.d.ts +0 -1
- package/dist/types/src/dream-application/index.d.ts +5 -5
- package/dist/types/src/helpers/loadRepl.d.ts +1 -1
- package/dist/types/src/index.d.ts +3 -2
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +66 -21
- package/docs/classes/Benchmark.html +2 -2
- package/docs/classes/CalendarDate.html +2 -2
- package/docs/classes/CreateOrFindByFailedToCreateAndFind.html +6 -5
- package/docs/classes/Decorators.html +19 -19
- package/docs/classes/Dream.html +131 -131
- package/docs/classes/DreamApplication.html +4 -5
- package/docs/classes/DreamBin.html +2 -2
- package/docs/classes/DreamCLI.html +4 -4
- package/docs/classes/DreamGlam.html +2 -2
- package/docs/classes/DreamImporter.html +2 -3
- package/docs/classes/DreamMigrationHelpers.html +7 -7
- package/docs/classes/DreamSerializer.html +2 -2
- package/docs/classes/DreamTransaction.html +2 -2
- package/docs/classes/Encrypt.html +2 -2
- package/docs/classes/Env.html +2 -2
- package/docs/classes/GlobalNameNotSet.html +6 -5
- package/docs/classes/NonLoadedAssociation.html +6 -5
- package/docs/classes/Query.html +51 -51
- package/docs/classes/Range.html +2 -2
- package/docs/classes/RecordNotFound.html +6 -5
- package/docs/classes/ValidationError.html +6 -5
- package/docs/functions/Attribute.html +1 -1
- package/docs/functions/RendersMany.html +1 -1
- package/docs/functions/RendersOne.html +1 -1
- package/docs/functions/ReplicaSafe.html +1 -1
- package/docs/functions/STI.html +1 -1
- package/docs/functions/SoftDelete.html +1 -1
- package/docs/functions/camelize.html +1 -1
- package/docs/functions/capitalize.html +1 -1
- package/docs/functions/closeAllDbConnections.html +1 -1
- package/docs/functions/compact.html +1 -1
- package/docs/functions/debug.html +1 -1
- package/docs/functions/dreamDbConnections.html +1 -1
- package/docs/functions/dreamPath.html +1 -1
- package/docs/functions/generateDream.html +1 -1
- package/docs/functions/globalClassNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/hyphenize.html +1 -1
- package/docs/functions/inferSerializerFromDreamClassOrViewModelClass.html +1 -1
- package/docs/functions/inferSerializerFromDreamOrViewModel.html +1 -1
- package/docs/functions/isEmpty.html +1 -1
- package/docs/functions/loadRepl.html +1 -1
- package/docs/functions/lookupClassByGlobalName.html +1 -1
- package/docs/functions/pascalize.html +1 -1
- package/docs/functions/pgErrorType.html +1 -1
- package/docs/functions/range-1.html +1 -1
- package/docs/functions/relativeDreamPath.html +1 -1
- package/docs/functions/round.html +1 -1
- package/docs/functions/serializerNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/sharedPathPrefix.html +1 -1
- package/docs/functions/snakeify.html +1 -1
- package/docs/functions/sort.html +1 -1
- package/docs/functions/sortBy.html +1 -1
- package/docs/functions/standardizeFullyQualifiedModelName.html +1 -1
- package/docs/functions/uncapitalize.html +1 -1
- package/docs/functions/uniq.html +1 -1
- package/docs/functions/untypedDb.html +1 -0
- package/docs/functions/validateColumn.html +1 -1
- package/docs/functions/validateTable.html +1 -1
- package/docs/index.html +7 -7
- package/docs/interfaces/AttributeStatement.html +2 -2
- package/docs/interfaces/DecoratorContext.html +2 -2
- package/docs/interfaces/DreamApplicationInitOptions.html +2 -2
- package/docs/interfaces/DreamApplicationOpts.html +2 -2
- package/docs/interfaces/DreamSerializerAssociationStatement.html +2 -2
- package/docs/interfaces/EncryptOptions.html +2 -2
- package/docs/interfaces/OpenapiSchemaProperties.html +1 -1
- package/docs/interfaces/OpenapiSchemaPropertiesShorthand.html +1 -1
- package/docs/interfaces/OpenapiTypeFieldObject.html +1 -1
- package/docs/modules.html +10 -10
- package/docs/types/Camelized.html +1 -1
- package/docs/types/CommonOpenapiSchemaObjectFields.html +1 -1
- package/docs/types/DateTime.html +1 -1
- package/docs/types/DbConnectionType.html +1 -0
- package/docs/types/DreamAssociationMetadata.html +1 -1
- package/docs/types/DreamAttributes.html +1 -1
- package/docs/types/DreamClassColumn.html +1 -1
- package/docs/types/DreamColumn.html +1 -1
- package/docs/types/DreamColumnNames.html +1 -1
- package/docs/types/DreamLogLevel.html +1 -1
- package/docs/types/DreamLogger.html +1 -1
- package/docs/types/DreamOrViewModelSerializerKey.html +1 -1
- package/docs/types/DreamParamSafeAttributes.html +1 -1
- package/docs/types/DreamParamSafeColumnNames.html +1 -1
- package/docs/types/DreamSerializerKey.html +1 -1
- package/docs/types/DreamSerializers.html +1 -1
- package/docs/types/DreamTableSchema.html +1 -1
- package/docs/types/DreamVirtualColumns.html +1 -1
- package/docs/types/EncryptAlgorithm.html +1 -1
- package/docs/types/Hyphenized.html +1 -1
- package/docs/types/IdType.html +1 -1
- package/docs/types/OpenapiAllTypes.html +1 -1
- package/docs/types/OpenapiFormats.html +1 -1
- package/docs/types/OpenapiNumberFormats.html +1 -1
- package/docs/types/OpenapiPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiSchemaArray.html +1 -1
- package/docs/types/OpenapiSchemaArrayShorthand.html +1 -1
- package/docs/types/OpenapiSchemaBase.html +1 -1
- package/docs/types/OpenapiSchemaBody.html +1 -1
- package/docs/types/OpenapiSchemaBodyShorthand.html +1 -1
- package/docs/types/OpenapiSchemaCommonFields.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRef.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
- package/docs/types/OpenapiSchemaInteger.html +1 -1
- package/docs/types/OpenapiSchemaNull.html +1 -1
- package/docs/types/OpenapiSchemaNumber.html +1 -1
- package/docs/types/OpenapiSchemaObject.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectBase.html +1 -1
- package/docs/types/OpenapiSchemaObjectBaseShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectShorthand.html +1 -1
- package/docs/types/OpenapiSchemaPartialSegment.html +1 -1
- package/docs/types/OpenapiSchemaPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaString.html +1 -1
- package/docs/types/OpenapiShorthandAllTypes.html +1 -1
- package/docs/types/OpenapiShorthandPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiTypeField.html +1 -1
- package/docs/types/Pascalized.html +1 -1
- package/docs/types/PrimaryKeyType.html +1 -1
- package/docs/types/RoundingPrecision.html +1 -1
- package/docs/types/SerializableClassOrSerializerCallback.html +1 -1
- package/docs/types/SerializableDreamClassOrViewModelClass.html +1 -1
- package/docs/types/SerializableDreamOrViewModel.html +1 -1
- package/docs/types/SerializableTypes.html +1 -1
- package/docs/types/Snakeified.html +1 -1
- package/docs/types/Timestamp.html +1 -1
- package/docs/types/UpdateableAssociationProperties.html +1 -1
- package/docs/types/UpdateableProperties.html +1 -1
- package/docs/types/ValidationType.html +1 -1
- package/docs/types/ViewModelSerializerKey.html +1 -1
- package/docs/types/WhereStatementForDream.html +1 -1
- package/docs/types/WhereStatementForDreamClass.html +1 -1
- package/docs/variables/DateTime-1.html +1 -1
- package/docs/variables/DreamConst.html +1 -1
- package/docs/variables/TRIGRAM_OPERATORS.html +1 -1
- package/docs/variables/openapiPrimitiveTypes-1.html +1 -1
- package/docs/variables/openapiShorthandPrimitiveTypes-1.html +1 -1
- package/docs/variables/ops.html +1 -1
- package/docs/variables/primaryKeyTypes.html +1 -1
- package/package.json +4 -7
- package/boilerplate/app/models/ApplicationModel.ts +0 -14
- package/boilerplate/app/serializers/.gitkeep +0 -0
- package/boilerplate/bin/esm.js +0 -19
- package/boilerplate/cli/helpers/initializeDreamApplication.ts +0 -6
- package/boilerplate/cli/index.ts +0 -22
- package/boilerplate/conf/inflections.ts +0 -5
- package/boilerplate/conf/loadEnv.ts +0 -4
- package/boilerplate/conf/repl.ts +0 -11
- package/boilerplate/eslint.config.js +0 -21
- package/boilerplate/package.json +0 -39
- package/boilerplate/tsconfig.build.json +0 -41
- package/boilerplate/tsconfig.json +0 -12
- package/boilerplate/types/db.ts +0 -5
- package/boilerplate/types/dream.ts +0 -3
- package/dist/cjs/boilerplate/package.json +0 -39
- package/dist/cjs/src/dream-application/helpers/globalServiceKeyFromPath.js +0 -11
- package/dist/cjs/src/dream-application/helpers/importers/importServices.js +0 -43
- package/dist/cjs/src/global-cli/dream.js +0 -46
- package/dist/cjs/src/global-cli/file-builders/DreamtsBuilder.js +0 -69
- package/dist/cjs/src/global-cli/file-builders/EnvBuilder.js +0 -27
- package/dist/cjs/src/global-cli/file-builders/EslintConfBuilder.js +0 -29
- package/dist/cjs/src/global-cli/file-builders/PackagejsonBuilder.js +0 -9
- package/dist/cjs/src/global-cli/helpers/argAndValue.js +0 -15
- package/dist/cjs/src/global-cli/helpers/autogeneratedFileMessage.js +0 -71
- package/dist/cjs/src/global-cli/helpers/buildNewDreamApp.js +0 -63
- package/dist/cjs/src/global-cli/helpers/copyRecursive.js +0 -20
- package/dist/cjs/src/global-cli/helpers/filterObjectByKey.js +0 -23
- package/dist/cjs/src/global-cli/helpers/generateEncryptionKey.js +0 -26
- package/dist/cjs/src/global-cli/helpers/globalCliSnakeify.js +0 -1
- package/dist/cjs/src/global-cli/helpers/initDreamAppIntoExistingProject.js +0 -85
- package/dist/cjs/src/global-cli/helpers/log.js +0 -28
- package/dist/cjs/src/global-cli/helpers/logo.js +0 -81
- package/dist/cjs/src/global-cli/helpers/primaryKeyTypes.js +0 -13
- package/dist/cjs/src/global-cli/helpers/prompt.js +0 -33
- package/dist/cjs/src/global-cli/helpers/select.js +0 -113
- package/dist/cjs/src/global-cli/helpers/sleep.js +0 -10
- package/dist/cjs/src/global-cli/helpers/sspawn.js +0 -21
- package/dist/cjs/src/global-cli/helpers/welcomeMessage.js +0 -41
- package/dist/cjs/src/global-cli/init.js +0 -56
- package/dist/cjs/src/global-cli/new.js +0 -10
- package/dist/esm/boilerplate/package.json +0 -39
- package/dist/esm/src/dream-application/helpers/globalServiceKeyFromPath.js +0 -8
- package/dist/esm/src/dream-application/helpers/importers/importServices.js +0 -37
- package/dist/esm/src/global-cli/dream.js +0 -44
- package/dist/esm/src/global-cli/file-builders/DreamtsBuilder.js +0 -66
- package/dist/esm/src/global-cli/file-builders/EnvBuilder.js +0 -24
- package/dist/esm/src/global-cli/file-builders/EslintConfBuilder.js +0 -26
- package/dist/esm/src/global-cli/file-builders/PackagejsonBuilder.js +0 -6
- package/dist/esm/src/global-cli/helpers/argAndValue.js +0 -12
- package/dist/esm/src/global-cli/helpers/autogeneratedFileMessage.js +0 -68
- package/dist/esm/src/global-cli/helpers/buildNewDreamApp.js +0 -60
- package/dist/esm/src/global-cli/helpers/copyRecursive.js +0 -17
- package/dist/esm/src/global-cli/helpers/filterObjectByKey.js +0 -20
- package/dist/esm/src/global-cli/helpers/generateEncryptionKey.js +0 -23
- package/dist/esm/src/global-cli/helpers/globalCliSnakeify.js +0 -1
- package/dist/esm/src/global-cli/helpers/initDreamAppIntoExistingProject.js +0 -82
- package/dist/esm/src/global-cli/helpers/log.js +0 -24
- package/dist/esm/src/global-cli/helpers/logo.js +0 -77
- package/dist/esm/src/global-cli/helpers/primaryKeyTypes.js +0 -10
- package/dist/esm/src/global-cli/helpers/prompt.js +0 -30
- package/dist/esm/src/global-cli/helpers/select.js +0 -110
- package/dist/esm/src/global-cli/helpers/sleep.js +0 -7
- package/dist/esm/src/global-cli/helpers/sspawn.js +0 -17
- package/dist/esm/src/global-cli/helpers/welcomeMessage.js +0 -38
- package/dist/esm/src/global-cli/init.js +0 -53
- package/dist/esm/src/global-cli/new.js +0 -7
- package/dist/types/src/dream-application/helpers/globalServiceKeyFromPath.d.ts +0 -1
- package/dist/types/src/dream-application/helpers/importers/importServices.d.ts +0 -4
- package/dist/types/src/global-cli/dream.d.ts +0 -2
- package/dist/types/src/global-cli/file-builders/DreamtsBuilder.d.ts +0 -4
- package/dist/types/src/global-cli/file-builders/EnvBuilder.d.ts +0 -6
- package/dist/types/src/global-cli/file-builders/EslintConfBuilder.d.ts +0 -3
- package/dist/types/src/global-cli/file-builders/PackagejsonBuilder.d.ts +0 -3
- package/dist/types/src/global-cli/helpers/argAndValue.d.ts +0 -1
- package/dist/types/src/global-cli/helpers/buildNewDreamApp.d.ts +0 -2
- package/dist/types/src/global-cli/helpers/copyRecursive.d.ts +0 -1
- package/dist/types/src/global-cli/helpers/filterObjectByKey.d.ts +0 -1
- package/dist/types/src/global-cli/helpers/generateEncryptionKey.d.ts +0 -1
- package/dist/types/src/global-cli/helpers/globalCliSnakeify.d.ts +0 -1
- package/dist/types/src/global-cli/helpers/initDreamAppIntoExistingProject.d.ts +0 -2
- package/dist/types/src/global-cli/helpers/log.d.ts +0 -10
- package/dist/types/src/global-cli/helpers/logo.d.ts +0 -2
- package/dist/types/src/global-cli/helpers/primaryKeyTypes.d.ts +0 -22
- package/dist/types/src/global-cli/helpers/prompt.d.ts +0 -8
- package/dist/types/src/global-cli/helpers/select.d.ts +0 -17
- package/dist/types/src/global-cli/helpers/sleep.d.ts +0 -1
- package/dist/types/src/global-cli/helpers/sspawn.d.ts +0 -2
- package/dist/types/src/global-cli/helpers/welcomeMessage.d.ts +0 -1
- package/dist/types/src/global-cli/init.d.ts +0 -2
- package/dist/types/src/global-cli/new.d.ts +0 -2
- package/docs/classes/DreamDbConnection.html +0 -4
- package/docs/functions/db.html +0 -1
- /package/dist/types/src/{global-cli/helpers/autogeneratedFileMessage.d.ts → helpers/cli/autoGeneratedFileDisclaimer.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>primaryKeyTypes | @rvoh/dream</title><meta name="description" content="Documentation for @rvoh/dream"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@rvoh/dream</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@rvoh/dream</a></li><li><a href="primaryKeyTypes.html">primaryKeyTypes</a></li></ul><h1>Variable primaryKeyTypes<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">primary<wbr/>Key<wbr/>Types</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"bigserial"</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"bigint"</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"uuid"</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"integer"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>primaryKeyTypes | @rvoh/dream</title><meta name="description" content="Documentation for @rvoh/dream"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@rvoh/dream</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">@rvoh/dream</a></li><li><a href="primaryKeyTypes.html">primaryKeyTypes</a></li></ul><h1>Variable primaryKeyTypes<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">primary<wbr/>Key<wbr/>Types</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"bigserial"</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"bigint"</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"uuid"</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">"integer"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/9f66a01bcaaa3b58282e4cc862399eddef8e799b/src/dream/constants.ts#L1">src/dream/constants.ts:1</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@rvoh/dream</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@rvoh/dream",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.34.0",
|
|
5
5
|
"description": "dream orm",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -20,20 +20,17 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
|
-
"boilerplate/**/*",
|
|
24
23
|
"dist/**/*",
|
|
25
24
|
"docs/**/*"
|
|
26
25
|
],
|
|
27
|
-
"bin": "dist/esm/src/global-cli/dream.js",
|
|
28
26
|
"scripts": {
|
|
29
27
|
"dream": "DREAM_CORE_DEVELOPMENT=1 yarn dreamts",
|
|
30
28
|
"dreamjs": "node --experimental-modules dist/test-app/cli/index.js",
|
|
31
29
|
"dreamts": "NODE_ENV=${NODE_ENV:-test} tsx ./test-app/cli/index.ts",
|
|
32
|
-
"gdream": "DREAM_CORE_DEVELOPMENT=1 tsx ./src/global-cli/dream.ts",
|
|
33
30
|
"build": "echo \"building cjs...\" && rm -rf dist && npx tsc -p ./tsconfig.cjs.build.json && echo \"building esm...\" && npx tsc -p ./tsconfig.esm.build.json && cp -r src/types/ dist/types/src/types/",
|
|
34
31
|
"build:test-app": "rm -rf dist && echo \"building test app to esm...\" && npx tsc -p ./tsconfig.esm.build.test-app.json && echo \"building test app to cjs...\" && npx tsc -p ./tsconfig.cjs.build.test-app.json",
|
|
35
32
|
"spec": "DREAM_CORE_DEVELOPMENT=1 DREAM_CORE_SPEC_RUN=1 vitest",
|
|
36
|
-
"console": "DREAM_CORE_DEVELOPMENT=1 tsx ./test-app/app/conf/repl.ts",
|
|
33
|
+
"console": "NODE_ENV=${NODE_ENV:-test} DREAM_CORE_DEVELOPMENT=1 tsx ./test-app/app/conf/repl.ts",
|
|
37
34
|
"types:cjs:trace": "rm -rf dist && npx tsc -p ./tsconfig.cjs.build.json --generateTrace ./typetrace --diagnostics && yarn analyze-trace ./typetrace --skipMillis 100 --forceMillis 300",
|
|
38
35
|
"types:esm:trace": "rm -rf dist && npx tsc -p ./tsconfig.esm.build.json --generateTrace ./typetrace --diagnostics && yarn analyze-trace ./typetrace --skipMillis 100 --forceMillis 300",
|
|
39
36
|
"types:cjs:trace-test-app": "rm -rf dist && npx tsc -p ./tsconfig.cjs.trace.json --generateTrace ./typetrace --diagnostics && yarn analyze-trace ./typetrace --skipMillis 100 --forceMillis 300",
|
|
@@ -77,8 +74,8 @@
|
|
|
77
74
|
"typedoc": "^0.26.6",
|
|
78
75
|
"typescript": "^5.8.2",
|
|
79
76
|
"typescript-eslint": "=7.18.0",
|
|
80
|
-
"vitest": "^3.
|
|
77
|
+
"vitest": "^3.1.1",
|
|
81
78
|
"winston": "^3.14.2"
|
|
82
79
|
},
|
|
83
80
|
"packageManager": "yarn@4.4.1"
|
|
84
|
-
}
|
|
81
|
+
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Dream } from '@rvoh/dream'
|
|
2
|
-
import { globalSchema, schema } from '../../db/schema.js'
|
|
3
|
-
import { DBClass } from '../../db/sync.js'
|
|
4
|
-
|
|
5
|
-
export default class ApplicationModel extends Dream {
|
|
6
|
-
public DB: DBClass
|
|
7
|
-
public get schema() {
|
|
8
|
-
return schema
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
public get globalSchema() {
|
|
12
|
-
return globalSchema
|
|
13
|
-
}
|
|
14
|
-
}
|
|
File without changes
|
package/boilerplate/bin/esm.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* A note about this file:
|
|
3
|
-
*
|
|
4
|
-
* previously, when using the node command to load typescript, you could
|
|
5
|
-
* specify the --loader=ts-node/esm option to use ts-node to load your project.
|
|
6
|
-
*
|
|
7
|
-
* This still works, but it raises a warning in node now, indicating that the
|
|
8
|
-
* --loader argument is experimental, and could be replaced in future versions.
|
|
9
|
-
*
|
|
10
|
-
* To get around this, you can manually add a file to your project to accomplish the
|
|
11
|
-
* same thing, and then import it in your node command, which is what we are now doing
|
|
12
|
-
* in our package.json file:
|
|
13
|
-
*
|
|
14
|
-
* node --experimental-specifier-resolution=node --import=./bin/esm.js ./test-app/cli/index.ts
|
|
15
|
-
* */
|
|
16
|
-
import { register } from 'node:module'
|
|
17
|
-
import { pathToFileURL } from 'node:url'
|
|
18
|
-
|
|
19
|
-
register('ts-node/esm', pathToFileURL('./'))
|
package/boilerplate/cli/index.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// nice reference for shell commands:
|
|
4
|
-
// https://www.freecodecamp.org/news/node-js-child-processes-everything-you-need-to-know-e69498fe970a/
|
|
5
|
-
// commanderjs docs:
|
|
6
|
-
// https://github.com/tj/commander.js#quick-start
|
|
7
|
-
|
|
8
|
-
import '../conf/loadEnv.js'
|
|
9
|
-
|
|
10
|
-
import { DreamCLI } from '@rvoh/dream'
|
|
11
|
-
import { Command } from 'commander'
|
|
12
|
-
import seedDb from '../db/seed.js'
|
|
13
|
-
import initializeDreamApplication from './helpers/initializeDreamApplication.js'
|
|
14
|
-
|
|
15
|
-
const program = new Command()
|
|
16
|
-
|
|
17
|
-
DreamCLI.provide(program, {
|
|
18
|
-
initializeDreamApplication,
|
|
19
|
-
seedDb,
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
program.parse(process.argv)
|
package/boilerplate/conf/repl.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import './loadEnv.js'
|
|
2
|
-
|
|
3
|
-
import { loadRepl } from '@rvoh/dream'
|
|
4
|
-
import * as repl from 'node:repl'
|
|
5
|
-
import initializePsychicApplication from '../cli/helpers/initializePsychicApplication.js'
|
|
6
|
-
|
|
7
|
-
const replServer = repl.start('> ')
|
|
8
|
-
export default (async function () {
|
|
9
|
-
await initializePsychicApplication()
|
|
10
|
-
loadRepl(replServer.context)
|
|
11
|
-
})()
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
import eslint from '@eslint/js'
|
|
4
|
-
import typescriptEslint from 'typescript-eslint'
|
|
5
|
-
import typescriptParser from '@typescript-eslint/parser'
|
|
6
|
-
|
|
7
|
-
const config = typescriptEslint.config(
|
|
8
|
-
eslint.configs.recommended,
|
|
9
|
-
...typescriptEslint.configs.recommendedTypeChecked,
|
|
10
|
-
{
|
|
11
|
-
ignores: ['src/types/dream.ts', 'src/types/db.ts'],
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
files: ['**/*.ts'],
|
|
15
|
-
languageOptions: {
|
|
16
|
-
parser: typescriptParser,
|
|
17
|
-
parserOptions: { project: './tsconfig.json' },
|
|
18
|
-
},
|
|
19
|
-
}
|
|
20
|
-
)
|
|
21
|
-
export default config
|
package/boilerplate/package.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "module",
|
|
3
|
-
"name": "tbd",
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"main": "src/index.ts",
|
|
6
|
-
"author": "tbd",
|
|
7
|
-
"private": true,
|
|
8
|
-
"scripts": {
|
|
9
|
-
"dream": "yarn dreamts",
|
|
10
|
-
"dreamjs": "node --experimental-modules dist/test-app/cli/index.js",
|
|
11
|
-
"dreamts": "node --experimental-specifier-resolution=node --import=./bin/esm.js ./src/cli/index.ts",
|
|
12
|
-
"console": "node --experimental-specifier-resolution=node --import=./bin/esm.js ./src/conf/repl.ts",
|
|
13
|
-
"lint": "yarn run eslint --no-warn-ignored \"src/**/*.ts\" \"spec/**/*.ts\""
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@rvoh/dream": "1.0.0",
|
|
17
|
-
"@types/node": "^20.11.17",
|
|
18
|
-
"@types/pg": "^8.11.3",
|
|
19
|
-
"kysely-codegen": "^0.11.0",
|
|
20
|
-
"kysely": "^0.27.2",
|
|
21
|
-
"pg": "^8.11.3",
|
|
22
|
-
"winston": "^3.13.0"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@eslint/js": "=9.0.0",
|
|
26
|
-
"@rvoh/dream-spec-helpers": "1.0.0",
|
|
27
|
-
"@types/jest": "^29.5.12",
|
|
28
|
-
"@types/node": "^20.11.17",
|
|
29
|
-
"@types/pg": "^8.11.3",
|
|
30
|
-
"eslint": "=9.0.0",
|
|
31
|
-
"jest": "^29.7.0",
|
|
32
|
-
"luxon-jest-matchers": "^0.1.14",
|
|
33
|
-
"prettier": "^3.2.5",
|
|
34
|
-
"ts-jest": "^29.1.4",
|
|
35
|
-
"ts-node": "^10.9.2",
|
|
36
|
-
"typescript-eslint": "=7.18.0",
|
|
37
|
-
"typescript": "^5.4.5"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"forceConsistentCasingInFileNames": true,
|
|
4
|
-
"lib": ["ES2022"],
|
|
5
|
-
"module": "Node16",
|
|
6
|
-
"moduleResolution": "node16",
|
|
7
|
-
"noImplicitAny": true,
|
|
8
|
-
"outDir": "./dist",
|
|
9
|
-
"rootDir": "./",
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"sourceMap": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"strictBindCallApply": true,
|
|
14
|
-
"strictNullChecks": true,
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Dream properties are initialized when a Dream model is
|
|
18
|
-
* loaded from the database, and custom setters and getters
|
|
19
|
-
* are applied during the initialization. The setters are
|
|
20
|
-
* intentionally disabled before the constructor of
|
|
21
|
-
* classes that extend Dream is run to prevent the ESNext
|
|
22
|
-
* behavior of setting properties to undefined (or even explicit
|
|
23
|
-
* setting in the constructor) from overriding data loaded from
|
|
24
|
-
* the database.
|
|
25
|
-
*/
|
|
26
|
-
"strictPropertyInitialization": false,
|
|
27
|
-
|
|
28
|
-
"target": "ES2022",
|
|
29
|
-
"useUnknownInCatchVariables": true,
|
|
30
|
-
},
|
|
31
|
-
"include": ["src", "noop"],
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* this ts-node block is necessary to get node commands to leverage the ts-node esm loader
|
|
35
|
-
* removing this block will lead to ambiguous crashing in node with no stack traces.
|
|
36
|
-
*/
|
|
37
|
-
"ts-node": {
|
|
38
|
-
"transpileOnly": true,
|
|
39
|
-
"esm": true
|
|
40
|
-
}
|
|
41
|
-
}
|
package/boilerplate/types/db.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "module",
|
|
3
|
-
"name": "tbd",
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"main": "src/index.ts",
|
|
6
|
-
"author": "tbd",
|
|
7
|
-
"private": true,
|
|
8
|
-
"scripts": {
|
|
9
|
-
"dream": "yarn dreamts",
|
|
10
|
-
"dreamjs": "node --experimental-modules dist/test-app/cli/index.js",
|
|
11
|
-
"dreamts": "node --experimental-specifier-resolution=node --import=./bin/esm.js ./src/cli/index.ts",
|
|
12
|
-
"console": "node --experimental-specifier-resolution=node --import=./bin/esm.js ./src/conf/repl.ts",
|
|
13
|
-
"lint": "yarn run eslint --no-warn-ignored \"src/**/*.ts\" \"spec/**/*.ts\""
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@rvoh/dream": "1.0.0",
|
|
17
|
-
"@types/node": "^20.11.17",
|
|
18
|
-
"@types/pg": "^8.11.3",
|
|
19
|
-
"kysely-codegen": "^0.11.0",
|
|
20
|
-
"kysely": "^0.27.2",
|
|
21
|
-
"pg": "^8.11.3",
|
|
22
|
-
"winston": "^3.13.0"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@eslint/js": "=9.0.0",
|
|
26
|
-
"@rvoh/dream-spec-helpers": "1.0.0",
|
|
27
|
-
"@types/jest": "^29.5.12",
|
|
28
|
-
"@types/node": "^20.11.17",
|
|
29
|
-
"@types/pg": "^8.11.3",
|
|
30
|
-
"eslint": "=9.0.0",
|
|
31
|
-
"jest": "^29.7.0",
|
|
32
|
-
"luxon-jest-matchers": "^0.1.14",
|
|
33
|
-
"prettier": "^3.2.5",
|
|
34
|
-
"ts-jest": "^29.1.4",
|
|
35
|
-
"ts-node": "^10.9.2",
|
|
36
|
-
"typescript-eslint": "=7.18.0",
|
|
37
|
-
"typescript": "^5.4.5"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
function default_1(filepath, dirPath) {
|
|
5
|
-
const prefixPath = dirPath;
|
|
6
|
-
return ('services/' +
|
|
7
|
-
filepath
|
|
8
|
-
.replace(prefixPath, '')
|
|
9
|
-
.replace(/\.[jt]s$/, '')
|
|
10
|
-
.replace(/^\//, ''));
|
|
11
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = importServices;
|
|
4
|
-
exports.setCachedServices = setCachedServices;
|
|
5
|
-
exports.getServicesOrFail = getServicesOrFail;
|
|
6
|
-
exports.getServicesOrBlank = getServicesOrBlank;
|
|
7
|
-
const DreamImporter_js_1 = require("../DreamImporter.js");
|
|
8
|
-
const globalServiceKeyFromPath_js_1 = require("../globalServiceKeyFromPath.js");
|
|
9
|
-
let _services;
|
|
10
|
-
async function importServices(servicesPath, serviceImportCb) {
|
|
11
|
-
if (_services)
|
|
12
|
-
return _services;
|
|
13
|
-
_services = {};
|
|
14
|
-
const serviceClasses = await DreamImporter_js_1.default.importServices(servicesPath, serviceImportCb);
|
|
15
|
-
for (const [servicePath, serviceClass] of serviceClasses) {
|
|
16
|
-
// we only want to register services within our app
|
|
17
|
-
// that are backgroundable, since the only purpose
|
|
18
|
-
// for keeping these indices is to be able to summon
|
|
19
|
-
// a service for backgrounding.
|
|
20
|
-
if (typeof serviceClass?.background === 'function' || typeof serviceClass?.schedule === 'function') {
|
|
21
|
-
const serviceKey = (0, globalServiceKeyFromPath_js_1.default)(servicePath, servicesPath);
|
|
22
|
-
if (typeof serviceClass['setGlobalName'] === 'function') {
|
|
23
|
-
serviceClass['setGlobalName'](serviceKey);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
serviceClass.globalName = serviceKey;
|
|
27
|
-
}
|
|
28
|
-
_services[serviceKey] = serviceClass;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return _services;
|
|
32
|
-
}
|
|
33
|
-
function setCachedServices(services) {
|
|
34
|
-
_services = services;
|
|
35
|
-
}
|
|
36
|
-
function getServicesOrFail() {
|
|
37
|
-
if (!_services)
|
|
38
|
-
throw new Error('Must call loadServices before calling getServicesOrFail');
|
|
39
|
-
return _services;
|
|
40
|
-
}
|
|
41
|
-
function getServicesOrBlank() {
|
|
42
|
-
return _services || {};
|
|
43
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
// nice reference for shell commands:
|
|
4
|
-
// https://www.freecodecamp.org/news/node-js-child-processes-everything-you-need-to-know-e69498fe970a/
|
|
5
|
-
// commanderjs docs:
|
|
6
|
-
// https://github.com/tj/commander.js#quick-start
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
const commander_1 = require("commander");
|
|
9
|
-
const primaryKeyTypes_js_1 = require("./helpers/primaryKeyTypes.js");
|
|
10
|
-
const init_js_1 = require("./init.js");
|
|
11
|
-
const new_js_1 = require("./new.js");
|
|
12
|
-
const program = new commander_1.Command();
|
|
13
|
-
program
|
|
14
|
-
.command('new')
|
|
15
|
-
.description('creates a new dream app using the name provided')
|
|
16
|
-
.argument('<name>', 'name of the app you want to create')
|
|
17
|
-
.option('--primary-key-type <KEY_TYPE>', `One of: ${primaryKeyTypes_js_1.cliPrimaryKeyTypes.join(', ')}. The type of primary key to use by default when generating Dream models (can be changed on a model-by-model basis as needed in each migration file)`)
|
|
18
|
-
.option('--project-path <PATH>', 'the root of the project', primaryKeyTypes_js_1.cliDefaultProjectPath)
|
|
19
|
-
.option('--config-path <PATH>', 'the path from your project root to the config directory', primaryKeyTypes_js_1.cliDefaultConfigPath)
|
|
20
|
-
.option('--db-path <PATH>', 'the path from your project root to the db directory', primaryKeyTypes_js_1.cliDefaultDbPath)
|
|
21
|
-
.option('--types-path <PATH>', 'the path from your project root to the types directory', primaryKeyTypes_js_1.cliDefaultTypesPath)
|
|
22
|
-
.option('--models-path <PATH>', 'the path from your project root to the models directory', primaryKeyTypes_js_1.cliDefaultModelsPath)
|
|
23
|
-
.option('--serializers-path <PATH>', 'the path from your project root to the serializers directory', primaryKeyTypes_js_1.cliDefaultSerializersPath)
|
|
24
|
-
.option('--services-path <PATH>', 'the path from your project root to the services directory', primaryKeyTypes_js_1.cliDefaultServicesPath)
|
|
25
|
-
.option('--model-specs-path <PATH>', 'the path from your project root to the model specs directory', primaryKeyTypes_js_1.cliDefaultModelSpecsPath)
|
|
26
|
-
.option('--factories-path <PATH>', 'the path from your project root to the spec factories directory', primaryKeyTypes_js_1.cliDefaultFactoriesPath)
|
|
27
|
-
.action(async (name, options) => {
|
|
28
|
-
await (0, new_js_1.default)(name, options);
|
|
29
|
-
});
|
|
30
|
-
program
|
|
31
|
-
.command('init')
|
|
32
|
-
.description('initialize a new dream app into your existing application')
|
|
33
|
-
.option('--primary-key-type <KEY_TYPE>', `One of: ${primaryKeyTypes_js_1.cliPrimaryKeyTypes.join(', ')}. The type of primary key to use by default when generating Dream models (can be changed on a model-by-model basis as needed in each migration file)`)
|
|
34
|
-
.option('--project-path <PATH>', 'the root of the project')
|
|
35
|
-
.option('--config-path <PATH>', 'the path from your project root to the config directory')
|
|
36
|
-
.option('--db-path <PATH>', 'the path from your project root to the db directory')
|
|
37
|
-
.option('--types-path <PATH>', 'the path from your project root to the types directory')
|
|
38
|
-
.option('--models-path <PATH>', 'the path from your project root to the models directory')
|
|
39
|
-
.option('--serializers-path <PATH>', 'the path from your project root to the serializers directory')
|
|
40
|
-
.option('--services-path <PATH>', 'the path from your project root to the services directory')
|
|
41
|
-
.option('--model-specs-path <PATH>', 'the path from your project root to the model specs directory')
|
|
42
|
-
.option('--factories-path <PATH>', 'the path from your project root to the spec factories directory')
|
|
43
|
-
.action(async (options) => {
|
|
44
|
-
await (0, init_js_1.default)(options);
|
|
45
|
-
});
|
|
46
|
-
program.parse();
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class DreamtsBuilder {
|
|
4
|
-
static build(options) {
|
|
5
|
-
const { configPath, dbPath, typesPath, factoriesPath, modelsPath, serializersPath, servicesPath, modelSpecsPath, primaryKeyType, } = options;
|
|
6
|
-
return `\
|
|
7
|
-
import * as path from 'path'
|
|
8
|
-
import { DreamApplication } from '@rvoh/dream'
|
|
9
|
-
import inflections from './inflections.js'
|
|
10
|
-
|
|
11
|
-
export default async function (app: DreamApplication) {
|
|
12
|
-
await app.load('models', path.join(__dirname, '..', 'models'))
|
|
13
|
-
await app.load('serializers', path.join(__dirname, '..', 'serializers'))
|
|
14
|
-
await app.load('services', path.join(__dirname, '..', 'services'))
|
|
15
|
-
|
|
16
|
-
app.set('projectRoot', path.join(__dirname, '..', '..', '..'))
|
|
17
|
-
app.set('primaryKeyType', '${primaryKeyType}')
|
|
18
|
-
app.set('inflections', inflections)
|
|
19
|
-
|
|
20
|
-
// app.set(
|
|
21
|
-
// 'logger',
|
|
22
|
-
// winston.createLogger({
|
|
23
|
-
// level: 'info',
|
|
24
|
-
// format: winston.format.json(),
|
|
25
|
-
// defaultMeta: { service: 'user-service' },
|
|
26
|
-
// transports: [
|
|
27
|
-
// new winston.transports.File({ filename: 'error.log', level: 'error' }),
|
|
28
|
-
// new winston.transports.File({ filename: 'combined.log' }),
|
|
29
|
-
// ],
|
|
30
|
-
// })
|
|
31
|
-
// )
|
|
32
|
-
|
|
33
|
-
// provides a list of path overrides for your app. This is optional, and will default
|
|
34
|
-
// to the paths expected for a typical psychic application.
|
|
35
|
-
app.set('paths', {
|
|
36
|
-
conf: '${configPath}',
|
|
37
|
-
db: '${dbPath}',
|
|
38
|
-
types: '${typesPath}',
|
|
39
|
-
factories: '${factoriesPath}',
|
|
40
|
-
models: '${modelsPath}',
|
|
41
|
-
serializers: '${serializersPath}',
|
|
42
|
-
services: '${servicesPath}',
|
|
43
|
-
modelSpecs: '${modelSpecsPath}',
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
// provides db credentials and configuration for your app.
|
|
47
|
-
app.set('db', {
|
|
48
|
-
primary: {
|
|
49
|
-
user: process.env.DB_USER!,
|
|
50
|
-
password: process.env.DB_PASSWORD!,
|
|
51
|
-
host: process.env.DB_HOST!,
|
|
52
|
-
name: process.env.DB_NAME!,
|
|
53
|
-
port: parseInt(process.env.DB_PORT!),
|
|
54
|
-
useSsl: process.env.DB_USE_SSL === '1',
|
|
55
|
-
},
|
|
56
|
-
replica: {
|
|
57
|
-
user: process.env.DB_USER!,
|
|
58
|
-
password: process.env.DB_PASSWORD!,
|
|
59
|
-
host: process.env.REPLICA_DB_HOST!,
|
|
60
|
-
name: process.env.REPLICA_DB_NAME!,
|
|
61
|
-
port: parseInt(process.env.DB_PORT!),
|
|
62
|
-
useSsl: process.env.DB_USE_SSL === '1',
|
|
63
|
-
},
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.default = DreamtsBuilder;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const generateEncryptionKey_js_1 = require("../helpers/generateEncryptionKey.js");
|
|
4
|
-
class EnvBuilder {
|
|
5
|
-
static build({ env, appName }) {
|
|
6
|
-
return `\
|
|
7
|
-
DB_USER=
|
|
8
|
-
DB_NAME=${snakeify(appName)}_${env}
|
|
9
|
-
DB_PORT=5432
|
|
10
|
-
DB_HOST=localhost
|
|
11
|
-
APP_ENCRYPTION_KEY='${(0, generateEncryptionKey_js_1.default)()}'
|
|
12
|
-
TZ=UTC
|
|
13
|
-
`;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.default = EnvBuilder;
|
|
17
|
-
// TODO: import from shared space. The version within dream contains the most robust variant of snakeify,
|
|
18
|
-
// though we don't really use it for anything other than string transformations, so this version has been simplified.
|
|
19
|
-
function snakeify(str) {
|
|
20
|
-
return str
|
|
21
|
-
.replace(/[ _-]+/g, '_')
|
|
22
|
-
.replace(/(?:^|\.?)([A-Z])/g, (_, y) => '_' + y.toLowerCase())
|
|
23
|
-
.replace(/^_/, '')
|
|
24
|
-
.replace(/\//g, '_')
|
|
25
|
-
.replace(/-/g, '_')
|
|
26
|
-
.toLowerCase();
|
|
27
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class ESLintConfBuilder {
|
|
4
|
-
static buildForViteReact() {
|
|
5
|
-
return `\
|
|
6
|
-
export default {
|
|
7
|
-
root: true,
|
|
8
|
-
env: { browser: true, es2020: true },
|
|
9
|
-
extends: [
|
|
10
|
-
'eslint:recommended',
|
|
11
|
-
'plugin:@typescript-eslint/recommended',
|
|
12
|
-
'plugin:react-hooks/recommended',
|
|
13
|
-
],
|
|
14
|
-
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
|
15
|
-
parser: '@typescript-eslint/parser',
|
|
16
|
-
plugins: ['react-refresh'],
|
|
17
|
-
rules: {
|
|
18
|
-
'react-refresh/only-export-components': [
|
|
19
|
-
'warn',
|
|
20
|
-
{ allowConstantExport: true },
|
|
21
|
-
],
|
|
22
|
-
'@typescript-eslint/no-explicit-any': [
|
|
23
|
-
'off',
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
}`;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = ESLintConfBuilder;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class PackagejsonBuilder {
|
|
4
|
-
static async buildAPI() {
|
|
5
|
-
const packagejson = await Promise.resolve().then(() => require('../../../boilerplate/package.json'));
|
|
6
|
-
return JSON.stringify(packagejson, null, 2);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.default = PackagejsonBuilder;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = argAndValue;
|
|
4
|
-
function argAndValue(arg, args) {
|
|
5
|
-
const argIndex = args.findIndex(a => a === arg);
|
|
6
|
-
const foundArg = argIndex === -1 ? null : args[argIndex];
|
|
7
|
-
const foundValue = argIndex === -1 ? null : valueOrNull(argIndex, args);
|
|
8
|
-
return [foundArg ?? null, foundValue];
|
|
9
|
-
}
|
|
10
|
-
function valueOrNull(argIndex, args) {
|
|
11
|
-
const value = args[argIndex + 1];
|
|
12
|
-
if (value === undefined || /--/.test(value))
|
|
13
|
-
return null;
|
|
14
|
-
return value;
|
|
15
|
-
}
|