@rvoh/dream 0.29.1 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/boilerplate/app/models/ApplicationModel.ts +1 -1
- package/boilerplate/cli/helpers/initializeDreamApplication.ts +1 -1
- package/boilerplate/cli/index.ts +1 -1
- package/boilerplate/conf/repl.ts +1 -1
- package/boilerplate/package.json +2 -2
- package/dist/cjs/boilerplate/package.json +2 -2
- package/dist/cjs/src/bin/helpers/sync.js +1 -1
- package/dist/cjs/src/global-cli/file-builders/DreamtsBuilder.js +1 -1
- package/dist/cjs/src/helpers/cli/SchemaBuilder.js +1 -1
- package/dist/cjs/src/helpers/cli/generateDreamContent.js +1 -1
- package/dist/cjs/src/helpers/cli/generateFactoryContent.js +1 -1
- package/dist/cjs/src/helpers/cli/generateMigrationContent.js +1 -1
- package/dist/cjs/src/helpers/cli/generateSerializerContent.js +1 -1
- package/dist/esm/boilerplate/package.json +2 -2
- package/dist/esm/src/bin/helpers/sync.js +1 -1
- package/dist/esm/src/global-cli/file-builders/DreamtsBuilder.js +1 -1
- package/dist/esm/src/helpers/cli/SchemaBuilder.js +1 -1
- package/dist/esm/src/helpers/cli/generateDreamContent.js +1 -1
- package/dist/esm/src/helpers/cli/generateFactoryContent.js +1 -1
- package/dist/esm/src/helpers/cli/generateMigrationContent.js +1 -1
- package/dist/esm/src/helpers/cli/generateSerializerContent.js +1 -1
- package/docs/classes/Benchmark.html +2 -2
- package/docs/classes/CalendarDate.html +2 -2
- package/docs/classes/CreateOrFindByFailedToCreateAndFind.html +3 -3
- package/docs/classes/Decorators.html +14 -14
- package/docs/classes/Dream.html +122 -122
- package/docs/classes/DreamApplication.html +4 -4
- package/docs/classes/DreamBin.html +2 -2
- package/docs/classes/DreamCLI.html +3 -3
- package/docs/classes/DreamImporter.html +2 -2
- package/docs/classes/DreamMigrationHelpers.html +7 -7
- package/docs/classes/DreamSerializer.html +2 -2
- package/docs/classes/DreamTransaction.html +2 -2
- package/docs/classes/Encrypt.html +2 -2
- package/docs/classes/Env.html +2 -2
- package/docs/classes/GlobalNameNotSet.html +3 -3
- package/docs/classes/NonLoadedAssociation.html +3 -3
- package/docs/classes/Query.html +50 -50
- package/docs/classes/Range.html +2 -2
- package/docs/classes/RecordNotFound.html +3 -3
- package/docs/classes/ValidationError.html +3 -3
- package/docs/functions/AfterCreate.html +1 -1
- package/docs/functions/AfterCreateCommit.html +1 -1
- package/docs/functions/AfterDestroy.html +1 -1
- package/docs/functions/AfterDestroyCommit.html +1 -1
- package/docs/functions/AfterSave.html +1 -1
- package/docs/functions/AfterSaveCommit.html +1 -1
- package/docs/functions/AfterUpdate.html +1 -1
- package/docs/functions/AfterUpdateCommit.html +1 -1
- package/docs/functions/Attribute.html +1 -1
- package/docs/functions/BeforeCreate.html +1 -1
- package/docs/functions/BeforeDestroy.html +1 -1
- package/docs/functions/BeforeSave.html +1 -1
- package/docs/functions/BeforeUpdate.html +1 -1
- package/docs/functions/RendersMany.html +1 -1
- package/docs/functions/RendersOne.html +1 -1
- package/docs/functions/ReplicaSafe.html +1 -1
- package/docs/functions/STI.html +1 -1
- package/docs/functions/Scope.html +1 -1
- package/docs/functions/SoftDelete.html +1 -1
- package/docs/functions/Sortable.html +1 -1
- package/docs/functions/Validate.html +1 -1
- package/docs/functions/Validates.html +1 -1
- package/docs/functions/Virtual.html +1 -1
- package/docs/functions/camelize.html +1 -1
- package/docs/functions/capitalize.html +1 -1
- package/docs/functions/closeAllDbConnections.html +1 -1
- package/docs/functions/compact.html +1 -1
- package/docs/functions/db.html +1 -1
- package/docs/functions/debug.html +1 -1
- package/docs/functions/dreamDbConnections.html +1 -1
- package/docs/functions/dreamPath.html +1 -1
- package/docs/functions/generateDream.html +1 -1
- package/docs/functions/globalClassNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/hyphenize.html +1 -1
- package/docs/functions/inferSerializerFromDreamClassOrViewModelClass.html +1 -1
- package/docs/functions/inferSerializerFromDreamOrViewModel.html +1 -1
- package/docs/functions/isEmpty.html +1 -1
- package/docs/functions/loadRepl.html +1 -1
- package/docs/functions/lookupClassByGlobalName.html +1 -1
- package/docs/functions/pascalize.html +1 -1
- package/docs/functions/pgErrorType.html +1 -1
- package/docs/functions/range-1.html +1 -1
- package/docs/functions/relativeDreamPath.html +1 -1
- package/docs/functions/round.html +1 -1
- package/docs/functions/serializerNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/sharedPathPrefix.html +1 -1
- package/docs/functions/snakeify.html +1 -1
- package/docs/functions/sortBy.html +1 -1
- package/docs/functions/standardizeFullyQualifiedModelName.html +1 -1
- package/docs/functions/uncapitalize.html +1 -1
- package/docs/functions/uniq.html +1 -1
- package/docs/functions/validateColumn.html +1 -1
- package/docs/functions/validateTable.html +1 -1
- package/docs/index.html +2 -2
- 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/types/Camelized.html +1 -1
- package/docs/types/CommonOpenapiSchemaObjectFields.html +1 -1
- package/docs/types/DreamAssociationMetadata.html +1 -1
- package/docs/types/DreamAttributes.html +1 -1
- package/docs/types/DreamClassColumn.html +1 -1
- package/docs/types/DreamColumn.html +1 -1
- package/docs/types/DreamColumnNames.html +1 -1
- package/docs/types/DreamLogLevel.html +1 -1
- package/docs/types/DreamLogger.html +1 -1
- package/docs/types/DreamOrViewModelSerializerKey.html +1 -1
- package/docs/types/DreamParamSafeAttributes.html +1 -1
- package/docs/types/DreamParamSafeColumnNames.html +1 -1
- package/docs/types/DreamSerializerKey.html +1 -1
- package/docs/types/DreamSerializers.html +1 -1
- package/docs/types/DreamTableSchema.html +1 -1
- package/docs/types/DreamVirtualColumns.html +1 -1
- package/docs/types/EncryptAlgorithm.html +1 -1
- package/docs/types/Hyphenized.html +1 -1
- package/docs/types/IdType.html +1 -1
- package/docs/types/OpenapiAllTypes.html +1 -1
- package/docs/types/OpenapiFormats.html +1 -1
- package/docs/types/OpenapiNumberFormats.html +1 -1
- package/docs/types/OpenapiPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiSchemaArray.html +1 -1
- package/docs/types/OpenapiSchemaArrayShorthand.html +1 -1
- package/docs/types/OpenapiSchemaBase.html +1 -1
- package/docs/types/OpenapiSchemaBody.html +1 -1
- package/docs/types/OpenapiSchemaBodyShorthand.html +1 -1
- package/docs/types/OpenapiSchemaCommonFields.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRef.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
- package/docs/types/OpenapiSchemaInteger.html +1 -1
- package/docs/types/OpenapiSchemaNull.html +1 -1
- package/docs/types/OpenapiSchemaNumber.html +1 -1
- package/docs/types/OpenapiSchemaObject.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectBase.html +1 -1
- package/docs/types/OpenapiSchemaObjectBaseShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectShorthand.html +1 -1
- package/docs/types/OpenapiSchemaPartialSegment.html +1 -1
- package/docs/types/OpenapiSchemaPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaString.html +1 -1
- package/docs/types/OpenapiShorthandAllTypes.html +1 -1
- package/docs/types/OpenapiShorthandPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiTypeField.html +1 -1
- package/docs/types/Pascalized.html +1 -1
- package/docs/types/PrimaryKeyType.html +1 -1
- package/docs/types/RoundingPrecision.html +1 -1
- package/docs/types/SerializableClassOrSerializerCallback.html +1 -1
- package/docs/types/SerializableDreamClassOrViewModelClass.html +1 -1
- package/docs/types/SerializableDreamOrViewModel.html +1 -1
- package/docs/types/SerializableTypes.html +1 -1
- package/docs/types/Snakeified.html +1 -1
- package/docs/types/Timestamp.html +1 -1
- package/docs/types/UpdateableAssociationProperties.html +1 -1
- package/docs/types/UpdateableProperties.html +1 -1
- package/docs/types/ValidationType.html +1 -1
- package/docs/types/ViewModelSerializerKey.html +1 -1
- package/docs/types/WhereStatementForDream.html +1 -1
- package/docs/types/WhereStatementForDreamClass.html +1 -1
- package/docs/variables/DreamConst.html +1 -1
- package/docs/variables/TRIGRAM_OPERATORS.html +1 -1
- package/docs/variables/openapiPrimitiveTypes-1.html +1 -1
- package/docs/variables/openapiShorthandPrimitiveTypes-1.html +1 -1
- package/docs/variables/ops.html +1 -1
- package/docs/variables/primaryKeyTypes.html +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -290,7 +290,7 @@ Open the generated migration, create the pg_trgm extension and create a gin inde
|
|
|
290
290
|
|
|
291
291
|
```ts
|
|
292
292
|
import { Kysely, sql } from 'kysely'
|
|
293
|
-
import { createGinIndex, createExtension } from '@
|
|
293
|
+
import { createGinIndex, createExtension } from '@rvoh/dream'
|
|
294
294
|
|
|
295
295
|
export async function up(db: Kysely<any>): Promise<void> {
|
|
296
296
|
// this only needs to be run once per db
|
|
@@ -315,7 +315,7 @@ NODE_ENV=development yarn psy db:migrate
|
|
|
315
315
|
Now you can take full advantage of pg_trgm using the dream adapters!
|
|
316
316
|
|
|
317
317
|
```ts
|
|
318
|
-
import { ops } from '@
|
|
318
|
+
import { ops } from '@rvoh/dream'
|
|
319
319
|
|
|
320
320
|
// applies a score match of 0.3
|
|
321
321
|
const users = await User.where({ name: ops.similarity('steeven hawkins') }).all()
|
package/boilerplate/cli/index.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import '../conf/loadEnv'
|
|
9
9
|
|
|
10
|
-
import { DreamCLI } from '@
|
|
10
|
+
import { DreamCLI } from '@rvoh/dream'
|
|
11
11
|
import { Command } from 'commander'
|
|
12
12
|
import seedDb from '../db/seed'
|
|
13
13
|
import initializeDreamApplication from './helpers/initializeDreamApplication'
|
package/boilerplate/conf/repl.ts
CHANGED
package/boilerplate/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"lint": "yarn run eslint --no-warn-ignored \"src/**/*.ts\" \"spec/**/*.ts\""
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@
|
|
16
|
+
"@rvoh/dream": "1.0.0",
|
|
17
17
|
"@types/luxon": "^3.4.2",
|
|
18
18
|
"@types/node": "^20.11.17",
|
|
19
19
|
"@types/pg": "^8.11.3",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@eslint/js": "=9.0.0",
|
|
28
|
-
"@
|
|
28
|
+
"@rvoh/dream-spec-helpers": "1.0.0",
|
|
29
29
|
"@types/jest": "^29.5.12",
|
|
30
30
|
"@types/luxon": "^3.4.2",
|
|
31
31
|
"@types/node": "^20.11.17",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"lint": "yarn run eslint --no-warn-ignored \"src/**/*.ts\" \"spec/**/*.ts\""
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@
|
|
16
|
+
"@rvoh/dream": "1.0.0",
|
|
17
17
|
"@types/luxon": "^3.4.2",
|
|
18
18
|
"@types/node": "^20.11.17",
|
|
19
19
|
"@types/pg": "^8.11.3",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@eslint/js": "=9.0.0",
|
|
28
|
-
"@
|
|
28
|
+
"@rvoh/dream-spec-helpers": "1.0.0",
|
|
29
29
|
"@types/jest": "^29.5.12",
|
|
30
30
|
"@types/luxon": "^3.4.2",
|
|
31
31
|
"@types/node": "^20.11.17",
|
|
@@ -59,7 +59,7 @@ export type Timestamp = ColumnType<DateTime | CalendarDate>`);
|
|
|
59
59
|
function addCustomImports(file) {
|
|
60
60
|
const calendarDateImportStatement = EnvInternal_js_1.default.boolean('DREAM_CORE_DEVELOPMENT')
|
|
61
61
|
? "import CalendarDate from '../../src/helpers/CalendarDate'"
|
|
62
|
-
: "import { CalendarDate } from '@
|
|
62
|
+
: "import { CalendarDate } from '@rvoh/dream'";
|
|
63
63
|
const customImports = `${calendarDateImportStatement}
|
|
64
64
|
import { DateTime } from 'luxon'`;
|
|
65
65
|
return `${(0, autogeneratedFileMessage_js_1.default)()}${customImports}
|
|
@@ -5,7 +5,7 @@ class DreamtsBuilder {
|
|
|
5
5
|
const { configPath, dbPath, typesPath, factoriesPath, modelsPath, serializersPath, servicesPath, modelSpecsPath, primaryKeyType, } = options;
|
|
6
6
|
return `\
|
|
7
7
|
import * as path from 'path'
|
|
8
|
-
import { DreamApplication } from '@
|
|
8
|
+
import { DreamApplication } from '@rvoh/dream'
|
|
9
9
|
import inflections from './inflections'
|
|
10
10
|
|
|
11
11
|
export default async function (app: DreamApplication) {
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
: '';
|
|
27
27
|
const calendarDateImportStatement = EnvInternal_js_1.default.boolean('DREAM_CORE_DEVELOPMENT')
|
|
28
28
|
? "import CalendarDate from '../../src/helpers/CalendarDate'"
|
|
29
|
-
: "import { CalendarDate } from '@
|
|
29
|
+
: "import { CalendarDate } from '@rvoh/dream'";
|
|
30
30
|
const dreamApp = index_js_2.default.getOrFail();
|
|
31
31
|
const newSchemaFileContents = `\
|
|
32
32
|
${(0, autogeneratedFileMessage_js_1.default)()}
|
|
@@ -74,7 +74,7 @@ public ${(0, camelize_js_1.default)(attributeName)}: ${getAttributeType(attribut
|
|
|
74
74
|
timestamps = timestamps.replace(/\n$/, '');
|
|
75
75
|
const tableName = (0, snakeify_js_1.default)((0, pluralize_esm_1.default)(fullyQualifiedModelName.replace(/\//g, '_')));
|
|
76
76
|
return `\
|
|
77
|
-
import { ${(0, uniq_js_1.default)(dreamImports).join(', ')} } from '@
|
|
77
|
+
import { ${(0, uniq_js_1.default)(dreamImports).join(', ')} } from '@rvoh/dream'${(0, uniq_js_1.default)(modelImportStatements).join('')}
|
|
78
78
|
|
|
79
79
|
const Deco = new Decorators<InstanceType<typeof ${modelClassName}>>()
|
|
80
80
|
|
|
@@ -48,7 +48,7 @@ function generateFactoryContent({ fullyQualifiedModelName, columnsWithTypes, })
|
|
|
48
48
|
const relativePath = (0, relativeDreamPath_js_1.default)('factories', 'models', fullyQualifiedModelName);
|
|
49
49
|
const modelClassName = (0, globalClassNameFromFullyQualifiedModelName_js_1.default)(fullyQualifiedModelName);
|
|
50
50
|
return `\
|
|
51
|
-
import { ${(0, uniq_js_1.default)(dreamImports).join(', ')} } from '@
|
|
51
|
+
import { ${(0, uniq_js_1.default)(dreamImports).join(', ')} } from '@rvoh/dream'
|
|
52
52
|
import ${modelClassName} from '${relativePath}'${additionalImports.length ? '\n' + (0, uniq_js_1.default)(additionalImports).join('\n') : ''}
|
|
53
53
|
${stringAttributes.length ? '\nlet counter = 0\n' : ''}
|
|
54
54
|
export default async function create${modelClassName}(attrs: UpdateableProperties<${modelClassName}> = {}) {
|
|
@@ -68,7 +68,7 @@ export async function down(db: Kysely<any>): Promise<void> {
|
|
|
68
68
|
const columnDefLines = columnDefs.length ? newline + columnDefs.join(newline) : '';
|
|
69
69
|
const columnDropLines = columnDrops.length ? newline + columnDrops.join(newline) + newline : '';
|
|
70
70
|
return `\
|
|
71
|
-
${dreamImports.length ? `import { ${dreamImports.join(', ')} } from '@
|
|
71
|
+
${dreamImports.length ? `import { ${dreamImports.join(', ')} } from '@rvoh/dream'\n` : ''}import { ${kyselyImports.join(', ')} } from 'kysely'
|
|
72
72
|
|
|
73
73
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
74
|
export async function up(db: Kysely<any>): Promise<void> {
|
|
@@ -57,7 +57,7 @@ function generateSerializerContent({ fullyQualifiedModelName, columnsWithTypes =
|
|
|
57
57
|
});
|
|
58
58
|
let dreamImport = '';
|
|
59
59
|
if (dreamImports.length) {
|
|
60
|
-
dreamImport = `import { ${(0, uniq_js_1.default)(dreamImports).join(', ')} } from '@
|
|
60
|
+
dreamImport = `import { ${(0, uniq_js_1.default)(dreamImports).join(', ')} } from '@rvoh/dream'`;
|
|
61
61
|
}
|
|
62
62
|
const additionalImportsStr = additionalImports.length ? (0, uniq_js_1.default)(additionalImports).join('') : '';
|
|
63
63
|
return `\
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"lint": "yarn run eslint --no-warn-ignored \"src/**/*.ts\" \"spec/**/*.ts\""
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@
|
|
16
|
+
"@rvoh/dream": "1.0.0",
|
|
17
17
|
"@types/luxon": "^3.4.2",
|
|
18
18
|
"@types/node": "^20.11.17",
|
|
19
19
|
"@types/pg": "^8.11.3",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@eslint/js": "=9.0.0",
|
|
28
|
-
"@
|
|
28
|
+
"@rvoh/dream-spec-helpers": "1.0.0",
|
|
29
29
|
"@types/jest": "^29.5.12",
|
|
30
30
|
"@types/luxon": "^3.4.2",
|
|
31
31
|
"@types/node": "^20.11.17",
|
|
@@ -56,7 +56,7 @@ export type Timestamp = ColumnType<DateTime | CalendarDate>`);
|
|
|
56
56
|
function addCustomImports(file) {
|
|
57
57
|
const calendarDateImportStatement = EnvInternal.boolean('DREAM_CORE_DEVELOPMENT')
|
|
58
58
|
? "import CalendarDate from '../../src/helpers/CalendarDate'"
|
|
59
|
-
: "import { CalendarDate } from '@
|
|
59
|
+
: "import { CalendarDate } from '@rvoh/dream'";
|
|
60
60
|
const customImports = `${calendarDateImportStatement}
|
|
61
61
|
import { DateTime } from 'luxon'`;
|
|
62
62
|
return `${autogeneratedFileDisclaimer()}${customImports}
|
|
@@ -3,7 +3,7 @@ export default class DreamtsBuilder {
|
|
|
3
3
|
const { configPath, dbPath, typesPath, factoriesPath, modelsPath, serializersPath, servicesPath, modelSpecsPath, primaryKeyType, } = options;
|
|
4
4
|
return `\
|
|
5
5
|
import * as path from 'path'
|
|
6
|
-
import { DreamApplication } from '@
|
|
6
|
+
import { DreamApplication } from '@rvoh/dream'
|
|
7
7
|
import inflections from './inflections'
|
|
8
8
|
|
|
9
9
|
export default async function (app: DreamApplication) {
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
: '';
|
|
25
25
|
const calendarDateImportStatement = EnvInternal.boolean('DREAM_CORE_DEVELOPMENT')
|
|
26
26
|
? "import CalendarDate from '../../src/helpers/CalendarDate'"
|
|
27
|
-
: "import { CalendarDate } from '@
|
|
27
|
+
: "import { CalendarDate } from '@rvoh/dream'";
|
|
28
28
|
const dreamApp = DreamApplication.getOrFail();
|
|
29
29
|
const newSchemaFileContents = `\
|
|
30
30
|
${autogeneratedFileDisclaimer()}
|
|
@@ -71,7 +71,7 @@ public ${camelize(attributeName)}: ${getAttributeType(attribute, modelClassName)
|
|
|
71
71
|
timestamps = timestamps.replace(/\n$/, '');
|
|
72
72
|
const tableName = snakeify(pluralize(fullyQualifiedModelName.replace(/\//g, '_')));
|
|
73
73
|
return `\
|
|
74
|
-
import { ${uniq(dreamImports).join(', ')} } from '@
|
|
74
|
+
import { ${uniq(dreamImports).join(', ')} } from '@rvoh/dream'${uniq(modelImportStatements).join('')}
|
|
75
75
|
|
|
76
76
|
const Deco = new Decorators<InstanceType<typeof ${modelClassName}>>()
|
|
77
77
|
|
|
@@ -45,7 +45,7 @@ export default function generateFactoryContent({ fullyQualifiedModelName, column
|
|
|
45
45
|
const relativePath = relativeDreamPath('factories', 'models', fullyQualifiedModelName);
|
|
46
46
|
const modelClassName = globalClassNameFromFullyQualifiedModelName(fullyQualifiedModelName);
|
|
47
47
|
return `\
|
|
48
|
-
import { ${uniq(dreamImports).join(', ')} } from '@
|
|
48
|
+
import { ${uniq(dreamImports).join(', ')} } from '@rvoh/dream'
|
|
49
49
|
import ${modelClassName} from '${relativePath}'${additionalImports.length ? '\n' + uniq(additionalImports).join('\n') : ''}
|
|
50
50
|
${stringAttributes.length ? '\nlet counter = 0\n' : ''}
|
|
51
51
|
export default async function create${modelClassName}(attrs: UpdateableProperties<${modelClassName}> = {}) {
|
|
@@ -65,7 +65,7 @@ export async function down(db: Kysely<any>): Promise<void> {
|
|
|
65
65
|
const columnDefLines = columnDefs.length ? newline + columnDefs.join(newline) : '';
|
|
66
66
|
const columnDropLines = columnDrops.length ? newline + columnDrops.join(newline) + newline : '';
|
|
67
67
|
return `\
|
|
68
|
-
${dreamImports.length ? `import { ${dreamImports.join(', ')} } from '@
|
|
68
|
+
${dreamImports.length ? `import { ${dreamImports.join(', ')} } from '@rvoh/dream'\n` : ''}import { ${kyselyImports.join(', ')} } from 'kysely'
|
|
69
69
|
|
|
70
70
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
71
71
|
export async function up(db: Kysely<any>): Promise<void> {
|
|
@@ -54,7 +54,7 @@ export default function generateSerializerContent({ fullyQualifiedModelName, col
|
|
|
54
54
|
});
|
|
55
55
|
let dreamImport = '';
|
|
56
56
|
if (dreamImports.length) {
|
|
57
|
-
dreamImport = `import { ${uniq(dreamImports).join(', ')} } from '@
|
|
57
|
+
dreamImport = `import { ${uniq(dreamImports).join(', ')} } from '@rvoh/dream'`;
|
|
58
58
|
}
|
|
59
59
|
const additionalImportsStr = additionalImports.length ? uniq(additionalImports).join('') : '';
|
|
60
60
|
return `\
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Benchmark | @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="Benchmark.html">Benchmark</a></li></ul><h1>Class Benchmark</h1></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>Benchmark | @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="Benchmark.html">Benchmark</a></li></ul><h1>Class Benchmark</h1></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/87bdad3c6fdd2205159f6cf84c1f2d46b9ecc956/src/helpers/benchmark.ts#L6">src/helpers/benchmark.ts:6</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="Benchmark.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
2
2
|
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="Benchmark.html#mark" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>mark</span></a>
|
|
3
3
|
<a href="Benchmark.html#start" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>start</span></a>
|
|
4
|
-
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_Benchmark" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Benchmark</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Benchmark.html" class="tsd-signature-type tsd-kind-class">Benchmark</a><a href="#constructor.new_Benchmark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="Benchmark.html" class="tsd-signature-type tsd-kind-class">Benchmark</a></h4></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="mark" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>mark</span><a href="#mark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="mark.mark-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">mark</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span>, <span class="tsd-kind-parameter">level</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#mark.mark-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">message</span>: <span class="tsd-signature-type">string</span></span></li><li><span><span class="tsd-kind-parameter">level</span>: <span class="tsd-signature-type">BenchmarkLogLevel</span><span class="tsd-signature-symbol"> = 'log'</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
4
|
+
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_Benchmark" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Benchmark</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="Benchmark.html" class="tsd-signature-type tsd-kind-class">Benchmark</a><a href="#constructor.new_Benchmark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="Benchmark.html" class="tsd-signature-type tsd-kind-class">Benchmark</a></h4></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="mark" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>mark</span><a href="#mark" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="mark.mark-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">mark</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span>, <span class="tsd-kind-parameter">level</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#mark.mark-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">message</span>: <span class="tsd-signature-type">string</span></span></li><li><span><span class="tsd-kind-parameter">level</span>: <span class="tsd-signature-type">BenchmarkLogLevel</span><span class="tsd-signature-symbol"> = 'log'</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/87bdad3c6fdd2205159f6cf84c1f2d46b9ecc956/src/helpers/benchmark.ts#L12">src/helpers/benchmark.ts:12</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="start" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>start</span><a href="#start" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="start.start-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">start</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#start.start-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/87bdad3c6fdd2205159f6cf84c1f2d46b9ecc956/src/helpers/benchmark.ts#L8">src/helpers/benchmark.ts:8</a></li></ul></aside></li></ul></section></section></details></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><details open class="tsd-accordion tsd-page-navigation"><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>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#mark" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>mark</span></a><a href="#start" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>start</span></a></div></details></div></details></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>
|