@rvoh/dream 2.38.0 → 2.39.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-app/index.js +2 -1
- package/dist/cjs/src/serializer/DreamSerializer.js +5 -5
- package/dist/cjs/src/serializer/ObjectSerializer.js +5 -5
- package/dist/cjs/src/serializer/SerializerRenderer.js +21 -28
- package/dist/cjs/src/serializer/builders/DreamSerializerBuilder.js +40 -33
- package/dist/cjs/src/serializer/builders/ObjectSerializerBuilder.js +38 -33
- package/dist/cjs/src/serializer/helpers/nullFlattenedSerializerKeys.js +44 -68
- package/dist/cjs/src/serializer/helpers/serializersForAssociatedClass.js +4 -3
- package/dist/esm/src/dream-app/index.js +2 -1
- package/dist/esm/src/serializer/DreamSerializer.js +5 -5
- package/dist/esm/src/serializer/ObjectSerializer.js +5 -5
- package/dist/esm/src/serializer/SerializerRenderer.js +21 -28
- package/dist/esm/src/serializer/builders/DreamSerializerBuilder.js +40 -33
- package/dist/esm/src/serializer/builders/ObjectSerializerBuilder.js +38 -33
- package/dist/esm/src/serializer/helpers/nullFlattenedSerializerKeys.js +44 -68
- package/dist/esm/src/serializer/helpers/serializersForAssociatedClass.js +4 -3
- package/dist/types/src/dream-app/index.d.ts +2 -1
- package/dist/types/src/serializer/DreamSerializer.d.ts +5 -5
- package/dist/types/src/serializer/ObjectSerializer.d.ts +5 -5
- package/dist/types/src/serializer/SerializerRenderer.d.ts +1 -1
- package/dist/types/src/serializer/builders/DreamSerializerBuilder.d.ts +43 -35
- package/dist/types/src/serializer/builders/ObjectSerializerBuilder.d.ts +41 -35
- package/dist/types/src/serializer/helpers/nullFlattenedSerializerKeys.d.ts +43 -33
- package/dist/types/src/serializer/helpers/serializersForAssociatedClass.d.ts +4 -3
- package/docs/classes/db.DreamMigrationHelpers.html +11 -11
- package/docs/classes/db.KyselyQueryDriver.html +49 -49
- package/docs/classes/db.PostgresQueryDriver.html +49 -49
- package/docs/classes/db.QueryDriverBase.html +49 -49
- package/docs/classes/errors.CannotSaveMissingDream.html +2 -2
- package/docs/classes/errors.CheckConstraintViolation.html +3 -3
- package/docs/classes/errors.ColumnOverflow.html +3 -3
- package/docs/classes/errors.CreateOrFindByFailedToCreateAndFind.html +3 -3
- package/docs/classes/errors.DataIncompatibleWithDatabaseField.html +3 -3
- package/docs/classes/errors.DataTypeColumnTypeMismatch.html +3 -3
- package/docs/classes/errors.DecryptionError.html +2 -2
- package/docs/classes/errors.DecryptionParseError.html +2 -2
- package/docs/classes/errors.DecryptionRotationError.html +3 -3
- package/docs/classes/errors.GlobalNameNotSet.html +3 -3
- package/docs/classes/errors.InvalidCalendarDate.html +2 -2
- package/docs/classes/errors.InvalidClockTime.html +2 -2
- package/docs/classes/errors.InvalidClockTimeTz.html +2 -2
- package/docs/classes/errors.InvalidDateTime.html +2 -2
- package/docs/classes/errors.MissingSerializersDefinition.html +3 -3
- package/docs/classes/errors.NonLoadedAssociation.html +3 -3
- package/docs/classes/errors.NotNullViolation.html +3 -3
- package/docs/classes/errors.RecordNotFound.html +3 -3
- package/docs/classes/errors.SortableScopeDidNotStabilize.html +3 -3
- package/docs/classes/errors.SortableScopeLockWaitTimedOut.html +3 -3
- package/docs/classes/errors.ValidationError.html +3 -3
- package/docs/classes/index.CalendarDate.html +33 -33
- package/docs/classes/index.ClockTime.html +32 -32
- package/docs/classes/index.ClockTimeTz.html +35 -35
- package/docs/classes/index.DateTime.html +86 -86
- package/docs/classes/index.Decorators.html +19 -19
- package/docs/classes/index.Dream.html +125 -125
- package/docs/classes/index.DreamApp.html +11 -11
- package/docs/classes/index.DreamTransaction.html +3 -3
- package/docs/classes/index.Env.html +5 -5
- package/docs/classes/index.Query.html +65 -65
- package/docs/classes/system.CliFileWriter.html +4 -4
- package/docs/classes/system.DreamBin.html +3 -3
- package/docs/classes/system.DreamCLI.html +7 -7
- package/docs/classes/system.DreamImporter.html +2 -2
- package/docs/classes/system.DreamLogos.html +2 -2
- package/docs/classes/system.DreamSerializerBuilder.html +51 -44
- package/docs/classes/system.ObjectSerializerBuilder.html +49 -43
- package/docs/classes/system.PathHelpers.html +3 -3
- package/docs/classes/utils.Encrypt.html +4 -4
- package/docs/classes/utils.Range.html +2 -2
- package/docs/functions/db.closeAllDbConnections.html +1 -1
- package/docs/functions/db.dreamDbConnections.html +1 -1
- package/docs/functions/db.untypedDb.html +1 -1
- package/docs/functions/db.validateColumn.html +1 -1
- package/docs/functions/db.validateTable.html +1 -1
- package/docs/functions/errors.pgErrorType.html +1 -1
- package/docs/functions/index.DreamSerializer.html +6 -6
- package/docs/functions/index.ObjectSerializer.html +6 -6
- package/docs/functions/index.ReplicaSafe.html +1 -1
- package/docs/functions/index.STI.html +1 -1
- package/docs/functions/index.SoftDelete.html +1 -1
- package/docs/functions/utils.camelize.html +1 -1
- package/docs/functions/utils.capitalize.html +1 -1
- package/docs/functions/utils.cloneDeepSafe.html +1 -1
- package/docs/functions/utils.compact.html +1 -1
- package/docs/functions/utils.groupBy.html +1 -1
- package/docs/functions/utils.hyphenize.html +1 -1
- package/docs/functions/utils.intersection.html +1 -1
- package/docs/functions/utils.isEmpty.html +1 -1
- package/docs/functions/utils.normalizeUnicode.html +1 -1
- package/docs/functions/utils.pascalize.html +1 -1
- package/docs/functions/utils.percent.html +1 -1
- package/docs/functions/utils.range.html +1 -1
- package/docs/functions/utils.round.html +1 -1
- package/docs/functions/utils.sanitizeString.html +1 -1
- package/docs/functions/utils.snakeify.html +1 -1
- package/docs/functions/utils.sort.html +1 -1
- package/docs/functions/utils.sortBy.html +1 -1
- package/docs/functions/utils.sortObjectByKey.html +1 -1
- package/docs/functions/utils.sortObjectByValue.html +1 -1
- package/docs/functions/utils.uncapitalize.html +1 -1
- package/docs/functions/utils.uniq.html +1 -1
- package/docs/interfaces/openapi.OpenapiDescription.html +2 -2
- package/docs/interfaces/openapi.OpenapiSchemaProperties.html +1 -1
- package/docs/interfaces/openapi.OpenapiSchemaPropertiesShorthand.html +1 -1
- package/docs/interfaces/openapi.OpenapiTypeFieldObject.html +1 -1
- package/docs/interfaces/types.BelongsToStatement.html +2 -2
- package/docs/interfaces/types.DecoratorContext.html +2 -2
- package/docs/interfaces/types.DecryptCallbacks.html +2 -2
- package/docs/interfaces/types.DreamAppInitOptions.html +2 -2
- package/docs/interfaces/types.DreamAppOpts.html +2 -2
- package/docs/interfaces/types.DreamDbConfig.html +6 -6
- package/docs/interfaces/types.DurationObject.html +2 -2
- package/docs/interfaces/types.EncryptOptions.html +2 -2
- package/docs/interfaces/types.EncryptionLegacyKeyUsedEvent.html +4 -4
- package/docs/interfaces/types.InternalAnyTypedSerializerRendersMany.html +2 -2
- package/docs/interfaces/types.InternalAnyTypedSerializerRendersOne.html +2 -2
- package/docs/interfaces/types.IntrospectedColumn.html +7 -7
- package/docs/interfaces/types.IntrospectedDatabase.html +2 -2
- package/docs/interfaces/types.IntrospectedEnum.html +2 -2
- package/docs/interfaces/types.IntrospectedTable.html +5 -5
- package/docs/interfaces/types.SerializerRendererOpts.html +2 -2
- package/docs/types/openapi.CommonOpenapiSchemaObjectFields.html +1 -1
- package/docs/types/openapi.OpenapiAllTypes.html +1 -1
- package/docs/types/openapi.OpenapiFormats.html +1 -1
- package/docs/types/openapi.OpenapiNumberFormats.html +1 -1
- package/docs/types/openapi.OpenapiPrimitiveBaseTypes.html +1 -1
- package/docs/types/openapi.OpenapiPrimitiveTypes.html +1 -1
- package/docs/types/openapi.OpenapiSchemaArray.html +1 -1
- package/docs/types/openapi.OpenapiSchemaArrayShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaBase.html +1 -1
- package/docs/types/openapi.OpenapiSchemaBody.html +1 -1
- package/docs/types/openapi.OpenapiSchemaBodyShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaCombinatorFields.html +1 -1
- package/docs/types/openapi.OpenapiSchemaCommonFields.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionAllOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionAnyOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionOneOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionRef.html +2 -2
- package/docs/types/openapi.OpenapiSchemaExpressionRefSchemaShorthand.html +2 -2
- package/docs/types/openapi.OpenapiSchemaInteger.html +1 -1
- package/docs/types/openapi.OpenapiSchemaNull.html +2 -2
- package/docs/types/openapi.OpenapiSchemaNumber.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObject.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectAllOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectAllOfShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectBase.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectBaseShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaPrimitiveGeneric.html +1 -1
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionAllOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionOneOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializableRef.html +2 -2
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializerRef.html +2 -2
- package/docs/types/openapi.OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
- package/docs/types/openapi.OpenapiSchemaString.html +1 -1
- package/docs/types/openapi.OpenapiShorthandAllTypes.html +1 -1
- package/docs/types/openapi.OpenapiShorthandPrimitiveBaseTypes.html +1 -1
- package/docs/types/openapi.OpenapiShorthandPrimitiveTypes.html +1 -1
- package/docs/types/openapi.OpenapiTypeField.html +1 -1
- package/docs/types/system.DreamAppAllowedPackageManagersEnum.html +1 -1
- package/docs/types/types.CalendarDateDurationUnit.html +1 -1
- package/docs/types/types.CalendarDateObject.html +1 -1
- package/docs/types/types.Camelized.html +1 -1
- package/docs/types/types.ClockTimeObject.html +1 -1
- package/docs/types/types.DbConnectionType.html +1 -1
- package/docs/types/types.DbTypes.html +1 -1
- package/docs/types/types.DreamAssociationMetadata.html +1 -1
- package/docs/types/types.DreamAttributes.html +1 -1
- package/docs/types/types.DreamClassAssociationAndStatement.html +1 -1
- package/docs/types/types.DreamClassColumn.html +1 -1
- package/docs/types/types.DreamColumn.html +1 -1
- package/docs/types/types.DreamColumnNames.html +1 -1
- package/docs/types/types.DreamLogLevel.html +1 -1
- package/docs/types/types.DreamLogger.html +2 -2
- package/docs/types/types.DreamModelSerializerType.html +1 -1
- package/docs/types/types.DreamOrViewModelClassSerializerKey.html +1 -1
- package/docs/types/types.DreamOrViewModelSerializerKey.html +1 -1
- package/docs/types/types.DreamParamSafeAttributes.html +1 -1
- package/docs/types/types.DreamParamSafeColumnNames.html +1 -1
- package/docs/types/types.DreamSerializable.html +1 -1
- package/docs/types/types.DreamSerializableArray.html +1 -1
- package/docs/types/types.DreamSerializerKey.html +1 -1
- package/docs/types/types.DreamSerializers.html +1 -1
- package/docs/types/types.DreamVirtualColumns.html +1 -1
- package/docs/types/types.DurationUnit.html +1 -1
- package/docs/types/types.EncryptAlgorithm.html +1 -1
- package/docs/types/types.HasManyStatement.html +1 -1
- package/docs/types/types.HasOneStatement.html +1 -1
- package/docs/types/types.Hyphenized.html +1 -1
- package/docs/types/types.IntrospectedValueType.html +1 -1
- package/docs/types/types.Pascalized.html +1 -1
- package/docs/types/types.PrimaryKeyType.html +1 -1
- package/docs/types/types.RoundingPrecision.html +1 -1
- package/docs/types/types.SerializerCasing.html +1 -1
- package/docs/types/types.SimpleObjectSerializerType.html +1 -1
- package/docs/types/types.Snakeified.html +1 -1
- package/docs/types/types.StrictInterface.html +1 -1
- package/docs/types/types.UpdateableAssociationProperties.html +1 -1
- package/docs/types/types.UpdateableProperties.html +1 -1
- package/docs/types/types.ValidationType.html +1 -1
- package/docs/types/types.ViewModel.html +2 -2
- package/docs/types/types.ViewModelClass.html +1 -1
- package/docs/types/types.WeekdayName.html +1 -1
- package/docs/types/types.WhereStatementForDream.html +1 -1
- package/docs/types/types.WhereStatementForDreamClass.html +1 -1
- package/docs/variables/index.DreamConst.html +1 -1
- package/docs/variables/index.ops.html +1 -1
- package/docs/variables/openapi.openapiPrimitiveTypes.html +1 -1
- package/docs/variables/openapi.openapiShorthandPrimitiveTypes.html +1 -1
- package/docs/variables/system.DreamAppAllowedPackageManagersEnumValues.html +1 -1
- package/docs/variables/system.primaryKeyTypes.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectSerializerBuilder | @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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@rvoh/dream</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/system.html">system</a></li><li><a href="" aria-current="page">ObjectSerializerBuilder</a></li></ul><h1>Class ObjectSerializerBuilder<MaybeNullDataType, PassthroughDataType, DataType></h1></div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="maybenulldatatype"><span class="tsd-kind-type-parameter">MaybeNullDataType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span></li><li><span id="passthroughdatatype"><span class="tsd-kind-type-parameter">PassthroughDataType</span></span></li><li><span id="datatype"><span class="tsd-kind-type-parameter">DataType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span> = <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ObjectSerializerBuilder | @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><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@rvoh/dream</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/system.html">system</a></li><li><a href="" aria-current="page">ObjectSerializerBuilder</a></li></ul><h1>Class ObjectSerializerBuilder<MaybeNullDataType, PassthroughDataType, DataType></h1></div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="maybenulldatatype"><span class="tsd-kind-type-parameter">MaybeNullDataType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span></li><li><span id="passthroughdatatype"><span class="tsd-kind-type-parameter">PassthroughDataType</span></span></li><li><span id="datatype"><span class="tsd-kind-type-parameter">DataType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span> = <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L16">src/serializer/builders/ObjectSerializerBuilder.ts:16</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"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">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="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><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">Properties</h3><div class="tsd-index-list"><a href="#attributes" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>attributes</span></a>
|
|
3
3
|
<a href="#data" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>data</span></a>
|
|
4
4
|
<a href="#passthroughdata" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>passthrough<wbr/>Data</span></a>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<a href="#render" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>render</span></a>
|
|
9
9
|
<a href="#rendersmany" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>renders<wbr/>Many</span></a>
|
|
10
10
|
<a href="#rendersone" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>renders<wbr/>One</span></a>
|
|
11
|
-
</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"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorobjectserializerbuilder"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">ObjectSerializerBuilder</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorobjectserializerbuildermaybenulldatatype">MaybeNullDataType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorobjectserializerbuilderpassthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorobjectserializerbuilderdatatype">DataType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">passthroughData</span><span class="tsd-signature-symbol">?:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#constructorobjectserializerbuilder" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="constructorobjectserializerbuildermaybenulldatatype"><span class="tsd-kind-type-parameter">MaybeNullDataType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span></li><li><span id="constructorobjectserializerbuilderpassthroughdatatype"><span class="tsd-kind-type-parameter">PassthroughDataType</span></span></li><li><span id="constructorobjectserializerbuilderdatatype"><span class="tsd-kind-type-parameter">DataType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a></span></li><li><span><span class="tsd-kind-parameter">passthroughData</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol"> = ...</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/serializer/builders/ObjectSerializerBuilder.ts#L29">src/serializer/builders/ObjectSerializerBuilder.ts:29</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="attributes"><code class="tsd-tag">Protected</code><span>attributes</span><a href="#attributes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">attributes</span><span class="tsd-signature-symbol">:</span> (<br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">InternalAnyTypedSerializerAttribute</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">InternalAnyTypedSerializerDelegatedAttribute</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">InternalAnyTypedSerializerCustomAttribute</span><br/> <span class="tsd-signature-symbol">|</span> <a href="../interfaces/types.InternalAnyTypedSerializerRendersOne.html" class="tsd-signature-type tsd-kind-interface">InternalAnyTypedSerializerRendersOne</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <a href="../interfaces/types.InternalAnyTypedSerializerRendersMany.html" class="tsd-signature-type tsd-kind-interface">InternalAnyTypedSerializerRendersMany</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><br/>)<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/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/serializer/builders/ObjectSerializerBuilder.ts#L21">src/serializer/builders/ObjectSerializerBuilder.ts:21</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="data"><code class="tsd-tag">Protected</code><span>data</span><a href="#data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">data</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/serializer/builders/ObjectSerializerBuilder.ts#L30">src/serializer/builders/ObjectSerializerBuilder.ts:30</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="passthroughdata"><code class="tsd-tag">Protected</code><span>passthrough<wbr/>Data</span><a href="#passthroughdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">passthroughData</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/serializer/builders/ObjectSerializerBuilder.ts#L31">src/serializer/builders/ObjectSerializerBuilder.ts:31</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="attribute"><span>attribute</span><a href="#attribute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="attribute-1"><span class="tsd-kind-call-signature">attribute</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#attributeattributename">AttributeName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#attributeattributename">AttributeName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NonAutomaticSerializerAttributeOptionsWithPossibleDecimalRenderOption</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#attribute-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Includes an attribute from the data object in the serialized output.</p>
|
|
11
|
+
</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"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorobjectserializerbuilder"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">ObjectSerializerBuilder</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorobjectserializerbuildermaybenulldatatype">MaybeNullDataType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorobjectserializerbuilderpassthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorobjectserializerbuilderdatatype">DataType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">data</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">passthroughData</span><span class="tsd-signature-symbol">?:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#constructorobjectserializerbuilder" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="constructorobjectserializerbuildermaybenulldatatype"><span class="tsd-kind-type-parameter">MaybeNullDataType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span></li><li><span id="constructorobjectserializerbuilderpassthroughdatatype"><span class="tsd-kind-type-parameter">PassthroughDataType</span></span></li><li><span id="constructorobjectserializerbuilderdatatype"><span class="tsd-kind-type-parameter">DataType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span> = <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">data</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a></span></li><li><span><span class="tsd-kind-parameter">passthroughData</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol"> = ...</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L29">src/serializer/builders/ObjectSerializerBuilder.ts:29</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="attributes"><code class="tsd-tag">Protected</code><span>attributes</span><a href="#attributes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">attributes</span><span class="tsd-signature-symbol">:</span> (<br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">InternalAnyTypedSerializerAttribute</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">InternalAnyTypedSerializerDelegatedAttribute</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">InternalAnyTypedSerializerCustomAttribute</span><br/> <span class="tsd-signature-symbol">|</span> <a href="../interfaces/types.InternalAnyTypedSerializerRendersOne.html" class="tsd-signature-type tsd-kind-interface">InternalAnyTypedSerializerRendersOne</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <a href="../interfaces/types.InternalAnyTypedSerializerRendersMany.html" class="tsd-signature-type tsd-kind-interface">InternalAnyTypedSerializerRendersMany</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><br/>)<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/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L21">src/serializer/builders/ObjectSerializerBuilder.ts:21</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="data"><code class="tsd-tag">Protected</code><span>data</span><a href="#data" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">data</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L30">src/serializer/builders/ObjectSerializerBuilder.ts:30</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="passthroughdata"><code class="tsd-tag">Protected</code><span>passthrough<wbr/>Data</span><a href="#passthroughdata" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">passthroughData</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L31">src/serializer/builders/ObjectSerializerBuilder.ts:31</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="attribute"><span>attribute</span><a href="#attribute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="attribute-1"><span class="tsd-kind-call-signature">attribute</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#attributeattributename">AttributeName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#attributeattributename">AttributeName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NonAutomaticSerializerAttributeOptionsWithPossibleDecimalRenderOption</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#attribute-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Includes an attribute from the data object in the serialized output.</p>
|
|
12
12
|
<p>For ObjectSerializer, the <code>openapi</code> option is always required since type
|
|
13
13
|
inference is not available for plain objects or ViewModels.</p>
|
|
14
14
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="attributeattributename"><span class="tsd-kind-type-parameter">AttributeName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#attributeattributename">AttributeName</a></span><div class="tsd-comment tsd-typography"><p>The attribute name from the data object</p>
|
|
@@ -27,7 +27,7 @@ serialize as <code>null</code></li>
|
|
|
27
27
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example">Example<a href="#example" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-7">// Required OpenAPI schema</span><br/><span class="hl-1">.</span><span class="hl-5">attribute</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">openapi:</span><span class="hl-1"> { </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-6">'string'</span><span class="hl-1">, </span><span class="hl-4">format:</span><span class="hl-1"> </span><span class="hl-6">'email'</span><span class="hl-1"> }</span><br/><span class="hl-1">})</span><br/><br/><span class="hl-7">// With default value</span><br/><span class="hl-1">.</span><span class="hl-5">attribute</span><span class="hl-1">(</span><span class="hl-6">'status'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">openapi:</span><span class="hl-1"> { </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-6">'string'</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">default:</span><span class="hl-1"> </span><span class="hl-6">'active'</span><br/><span class="hl-1">})</span><br/><br/><span class="hl-7">// Rename output key</span><br/><span class="hl-1">.</span><span class="hl-5">attribute</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">openapi:</span><span class="hl-1"> { </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-6">'string'</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">as:</span><span class="hl-1"> </span><span class="hl-6">'userEmail'</span><br/><span class="hl-1">})</span><br/><br/><span class="hl-7">// Round decimal to 2 places</span><br/><span class="hl-1">.</span><span class="hl-5">attribute</span><span class="hl-1">(</span><span class="hl-6">'price'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">openapi:</span><span class="hl-1"> </span><span class="hl-6">'decimal'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">precision:</span><span class="hl-1"> </span><span class="hl-8">2</span><br/><span class="hl-1">})</span><br/><br/><span class="hl-7">// Mark as optional in OpenAPI (omitted from response when undefined)</span><br/><span class="hl-1">.</span><span class="hl-5">attribute</span><span class="hl-1">(</span><span class="hl-6">'nickname'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">openapi:</span><span class="hl-1"> </span><span class="hl-6">'string'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">required:</span><span class="hl-1"> </span><span class="hl-0">false</span><br/><span class="hl-1">})</span>
|
|
28
28
|
</code><button type="button">Copy</button></pre>
|
|
29
29
|
|
|
30
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
30
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L84">src/serializer/builders/ObjectSerializerBuilder.ts:84</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="customattribute"><span>custom<wbr/>Attribute</span><a href="#customattribute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="customattribute-1"><span class="tsd-kind-call-signature">customAttribute</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">fn</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">()</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CustomAttributeOptions</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#customattribute-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Includes a computed value in the serialized output.</p>
|
|
31
31
|
<p>Executes a callback function to generate a custom attribute value.
|
|
32
32
|
The <code>openapi</code> option is always required since the return type cannot be inferred.</p>
|
|
33
33
|
<p>The callback's return value renders as is, so any fallback belongs in the callback.</p>
|
|
@@ -38,28 +38,29 @@ The <code>openapi</code> option is always required since the return type cannot
|
|
|
38
38
|
<li><code>openapi</code> - (required) OpenAPI schema definition for the computed value</li>
|
|
39
39
|
<li><code>flatten</code> - When <code>true</code>, spreads the returned object's properties directly into the
|
|
40
40
|
parent serialized output instead of nesting them under <code>name</code>. The <code>openapi</code> option
|
|
41
|
-
then describes the whole returned object, not each property
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
then describes the whole returned object, not each property: either an object schema
|
|
42
|
+
with full property bodies (<code>type: 'object'</code>, <code>properties</code>, and <code>required</code> listing the
|
|
43
|
+
keys that are always present), or <code>{ $serializer: SomeSerializer }</code> when the callback
|
|
44
|
+
returns what that serializer renders. A serializer ref with <code>many: true</code> does not
|
|
45
|
+
type-check here, since a list has no properties to spread. Whatever the callback
|
|
46
|
+
returns, each key any shape of the <code>openapi</code> requires renders, as <code>null</code> wherever the
|
|
47
|
+
value does not supply it (a returned plain object's key set to <code>undefined</code> does not
|
|
48
|
+
supply it): a key an object shape lists in its <code>required</code> array, a key a <code>$serializer</code> or
|
|
49
|
+
<code>$serializable</code> ref's serializer declares without <code>required: false</code> (for an STI base,
|
|
50
|
+
any child's serializer), and each such key of any <code>allOf</code>, <code>anyOf</code> or <code>oneOf</code> member. So
|
|
51
|
+
a <code>null</code> return, a serializer built over <code>null</code> or <code>undefined</code> data, or an <code>undefined</code>
|
|
52
|
+
return without <code>required: false</code> renders each of them as <code>null</code>, and a present value
|
|
53
|
+
renders its own keys over them, so a key another shape requires renders as <code>null</code> even
|
|
54
|
+
when the value's own shape leaves it optional; the payload always includes the same
|
|
55
|
+
keys whichever shape the value takes and whether it is null. An optional key no shape
|
|
56
|
+
requires stays absent unless the value supplies it, and an <code>undefined</code> return with
|
|
57
|
+
<code>required: false</code> adds no keys.
|
|
57
58
|
Every key it adds follows the render's casing like the parent's own keys: a returned
|
|
58
59
|
plain object's top-level keys and the <code>openapi</code>'s <code>properties</code> keys are cased (so
|
|
59
60
|
<code>casing: 'snake'</code> renders <code>phoneNumber</code> as <code>phone_number</code>, present or <code>null</code>), while
|
|
60
|
-
nested values render as returned. Attributes render in declaration order, so a key the
|
|
61
|
-
another attribute takes the value of whichever is declared
|
|
62
|
-
that value must match both
|
|
61
|
+
nested values render as returned. Attributes render in declaration order, so a key the
|
|
62
|
+
returned object shares with another attribute takes the value of whichever is declared
|
|
63
|
+
later, and that value must match both the attribute's declaration and the <code>openapi</code>'s</li>
|
|
63
64
|
<li><code>required</code> - Set to <code>false</code> to mark the attribute as optional in the OpenAPI schema;
|
|
64
65
|
when omitted, attributes are required by default</li>
|
|
65
66
|
</ul>
|
|
@@ -67,7 +68,7 @@ when omitted, attributes are required by default</li>
|
|
|
67
68
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-1">Example<a href="#example-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-7">// Simple computed value</span><br/><span class="hl-1">.</span><span class="hl-5">customAttribute</span><span class="hl-1">(</span><span class="hl-6">'fullName'</span><span class="hl-1">, () </span><span class="hl-0">=></span><br/><span class="hl-1"> </span><span class="hl-6">`</span><span class="hl-0">${</span><span class="hl-4">user</span><span class="hl-10">.</span><span class="hl-4">firstName</span><span class="hl-0">}</span><span class="hl-6"> </span><span class="hl-0">${</span><span class="hl-4">user</span><span class="hl-10">.</span><span class="hl-4">lastName</span><span class="hl-0">}</span><span class="hl-6">`</span><span class="hl-1">,</span><br/><span class="hl-1"> { </span><span class="hl-4">openapi:</span><span class="hl-1"> { </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-6">'string'</span><span class="hl-1"> } }</span><br/><span class="hl-1">)</span><br/><br/><span class="hl-7">// Flattened object properties: `openapi` describes the whole returned object</span><br/><span class="hl-1">.</span><span class="hl-5">customAttribute</span><span class="hl-1">(</span><span class="hl-6">'coordinates'</span><span class="hl-1">, () </span><span class="hl-0">=></span><span class="hl-1"> ({ </span><span class="hl-4">lat:</span><span class="hl-1"> </span><span class="hl-8">40.7</span><span class="hl-1">, </span><span class="hl-4">lng:</span><span class="hl-1"> -</span><span class="hl-8">74.0</span><span class="hl-1"> }), {</span><br/><span class="hl-1"> </span><span class="hl-4">flatten:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">openapi:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-6">'object'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">required:</span><span class="hl-1"> [</span><span class="hl-6">'lat'</span><span class="hl-1">, </span><span class="hl-6">'lng'</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-4">properties:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">lat:</span><span class="hl-1"> { </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-6">'number'</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">lng:</span><span class="hl-1"> { </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-6">'number'</span><span class="hl-1"> }</span><br/><span class="hl-1"> }</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">})</span>
|
|
68
69
|
</code><button type="button">Copy</button></pre>
|
|
69
70
|
|
|
70
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
71
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L257">src/serializer/builders/ObjectSerializerBuilder.ts:257</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="delegatedattribute"><span>delegated<wbr/>Attribute</span><a href="#delegatedattribute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="delegatedattribute-1"><span class="tsd-kind-call-signature">delegatedAttribute</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">DreamPropertiesToExclude</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeactualdatatype">ActualDataType</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributetargetname">TargetName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">DreamPropertiesToExclude</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributetargetobject">TargetObject</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributetargetname">TargetName</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeattributename">AttributeName</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributetargetobject">TargetObject</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributetargetobject">TargetObject</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">DreamPropertiesToExclude</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">targetName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributetargetname">TargetName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#delegatedattributeattributename">AttributeName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">NonAutomaticSerializerAttributeOptions</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">precision</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.RoundingPrecision.html" class="tsd-signature-type tsd-kind-type-alias">RoundingPrecision</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">optional</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#delegatedattribute-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Includes an attribute from a nested object in the serialized output.</p>
|
|
71
72
|
<p>Accesses <code>targetName.name</code> on the data object. The <code>openapi</code> option is always
|
|
72
73
|
required. When the target object or the delegated attribute is null/undefined,
|
|
73
74
|
the resolution order is:</p>
|
|
@@ -109,7 +110,7 @@ OpenAPI schema</li>
|
|
|
109
110
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-2">Example<a href="#example-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-7">// Delegate to user.email</span><br/><span class="hl-1">.</span><span class="hl-5">delegatedAttribute</span><span class="hl-1">(</span><span class="hl-6">'user'</span><span class="hl-1">, </span><span class="hl-6">'email'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">openapi:</span><span class="hl-1"> { </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-6">'string'</span><span class="hl-1">, </span><span class="hl-4">format:</span><span class="hl-1"> </span><span class="hl-6">'email'</span><span class="hl-1"> }</span><br/><span class="hl-1">})</span><br/><br/><span class="hl-7">// With default value for null target or attribute</span><br/><span class="hl-1">.</span><span class="hl-5">delegatedAttribute</span><span class="hl-1">(</span><span class="hl-6">'profile'</span><span class="hl-1">, </span><span class="hl-6">'displayName'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">openapi:</span><span class="hl-1"> { </span><span class="hl-4">type:</span><span class="hl-1"> </span><span class="hl-6">'string'</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-4">default:</span><span class="hl-1"> </span><span class="hl-6">'Anonymous User'</span><br/><span class="hl-1">})</span><br/><br/><span class="hl-7">// Rename the output key</span><br/><span class="hl-1">.</span><span class="hl-5">delegatedAttribute</span><span class="hl-1">(</span><span class="hl-6">'profile'</span><span class="hl-1">, </span><span class="hl-6">'avatarUrl'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">openapi:</span><span class="hl-1"> </span><span class="hl-6">'string'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">as:</span><span class="hl-1"> </span><span class="hl-6">'avatar'</span><br/><span class="hl-1">})</span>
|
|
110
111
|
</code><button type="button">Copy</button></pre>
|
|
111
112
|
|
|
112
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
113
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L156">src/serializer/builders/ObjectSerializerBuilder.ts:156</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="render"><span>render</span><a href="#render" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="render-1"><span class="tsd-kind-call-signature">render</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">passthrough</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?:</span> <a href="../interfaces/types.SerializerRendererOpts.html" class="tsd-signature-type tsd-kind-interface">SerializerRendererOpts</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><a href="#render-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Executes the serializer and returns the serialized output.</p>
|
|
113
114
|
<p>Processes all defined attributes, custom attributes, delegated attributes,
|
|
114
115
|
and associations to produce the final serialized object.</p>
|
|
115
116
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">passthrough</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Additional data to pass through to nested serializers
|
|
@@ -119,7 +120,7 @@ and associations to produce the final serialized object.</p>
|
|
|
119
120
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-3">Example<a href="#example-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">result</span><span class="hl-1"> = </span><span class="hl-5">UserViewModelSerializer</span><span class="hl-1">(</span><span class="hl-4">userVm</span><span class="hl-1">).</span><span class="hl-5">render</span><span class="hl-1">()</span><br/><span class="hl-7">// Returns: { id: '123', email: 'user@example.com', ... }</span><br/><br/><span class="hl-7">// With passthrough data for nested serializers</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">result</span><span class="hl-1"> = </span><span class="hl-5">UserViewModelSerializer</span><span class="hl-1">(</span><span class="hl-4">userVm</span><span class="hl-1">).</span><span class="hl-5">render</span><span class="hl-1">({ </span><span class="hl-4">currentUserId:</span><span class="hl-1"> </span><span class="hl-6">'456'</span><span class="hl-1"> })</span>
|
|
120
121
|
</code><button type="button">Copy</button></pre>
|
|
121
122
|
|
|
122
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/serializer/builders/ObjectSerializerBuilder.ts#L527">src/serializer/builders/ObjectSerializerBuilder.ts:527</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="rendersmany"><span>renders<wbr/>Many</span><a href="#rendersmany" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="rendersmany-1"><span class="tsd-kind-call-signature">rendersMany</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">DreamPropertiesToExclude</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyattributename">AttributeName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">DreamPropertiesToExclude</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyattributename">AttributeName</a><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> (<br/> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">|</span> <a href="../types/types.ViewModel.html" class="tsd-signature-type tsd-kind-type-alias">ViewModel</a><br/> )<span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type tsd-kind-type-parameter">U</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type tsd-kind-type-parameter">U</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyserializeroptions">SerializerOptions</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">dreamClass</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="../types/types.ViewModel.html" class="tsd-signature-type tsd-kind-type-alias">ViewModel</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">viewModelClass</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.ViewModelClass.html" class="tsd-signature-type tsd-kind-type-alias">ViewModelClass</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyattributename">AttributeName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">as</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span> <span class="tsd-signature-symbol">&</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyserializeroptions">SerializerOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#rendersmany-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Includes an array of associated objects in the serialized output.</p>
|
|
123
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L533">src/serializer/builders/ObjectSerializerBuilder.ts:533</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="rendersmany"><span>renders<wbr/>Many</span><a href="#rendersmany" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="rendersmany-1"><span class="tsd-kind-call-signature">rendersMany</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">DreamPropertiesToExclude</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyattributename">AttributeName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">DreamPropertiesToExclude</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyattributename">AttributeName</a><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> (<br/> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">|</span> <a href="../types/types.ViewModel.html" class="tsd-signature-type tsd-kind-type-alias">ViewModel</a><br/> )<span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type tsd-kind-type-parameter">U</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type tsd-kind-type-parameter">U</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyserializeroptions">SerializerOptions</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">dreamClass</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="../types/types.ViewModel.html" class="tsd-signature-type tsd-kind-type-alias">ViewModel</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">viewModelClass</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.ViewModelClass.html" class="tsd-signature-type tsd-kind-type-alias">ViewModelClass</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyattributename">AttributeName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">as</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span> <span class="tsd-signature-symbol">&</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyserializeroptions">SerializerOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#rendersmany-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Includes an array of associated objects in the serialized output.</p>
|
|
123
124
|
<p>For ObjectSerializer, explicit serializer configuration is always required
|
|
124
125
|
since association schemas cannot be inferred from plain objects.</p>
|
|
125
126
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="rendersmanyprovidedmodeltype"><span class="tsd-kind-type-parameter">ProvidedModelType</span> = <span class="tsd-signature-type">undefined</span></span></li><li><span id="rendersmanyprovidedattributename"><span class="tsd-kind-type-parameter">ProvidedAttributeName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">DreamPropertiesToExclude</span><span class="tsd-signature-symbol">></span></span></li><li><span id="rendersmanyactualdatatype"><span class="tsd-kind-type-parameter">ActualDataType</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedmodeltype">ProvidedModelType</a></span></li><li><span id="rendersmanyattributename"><span class="tsd-kind-type-parameter">AttributeName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">DreamPropertiesToExclude</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a></span></li><li><span id="rendersmanyassociatedmodeltype"><span class="tsd-kind-type-parameter">AssociatedModelType</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyattributename">AttributeName</a><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> (<a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a> <span class="tsd-signature-symbol">|</span> <a href="../types/types.ViewModel.html" class="tsd-signature-type tsd-kind-type-alias">ViewModel</a>)<span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type tsd-kind-type-parameter">U</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type tsd-kind-type-parameter">U</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></span></li><li><span id="rendersmanyserializeroptions"><span class="tsd-kind-type-parameter">SerializerOptions</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">dreamClass</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="../types/types.ViewModel.html" class="tsd-signature-type tsd-kind-type-alias">ViewModel</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">viewModelClass</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.ViewModelClass.html" class="tsd-signature-type tsd-kind-type-alias">ViewModelClass</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersmanyattributename">AttributeName</a></span><div class="tsd-comment tsd-typography"><p>The association property name (should resolve to an array)</p>
|
|
@@ -146,7 +147,7 @@ since association schemas cannot be inferred from plain objects.</p>
|
|
|
146
147
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-4">Example<a href="#example-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-7">// With explicit serializer function</span><br/><span class="hl-1">.</span><span class="hl-5">rendersMany</span><span class="hl-1">(</span><span class="hl-6">'articles'</span><span class="hl-1">, { </span><span class="hl-4">serializer:</span><span class="hl-1"> </span><span class="hl-4">ArticleSerializer</span><span class="hl-1"> })</span><br/><br/><span class="hl-7">// With Dream class reference and serializer key</span><br/><span class="hl-1">.</span><span class="hl-5">rendersMany</span><span class="hl-1">(</span><span class="hl-6">'posts'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">dreamClass:</span><span class="hl-1"> </span><span class="hl-4">Post</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">serializerKey:</span><span class="hl-1"> </span><span class="hl-6">'summary'</span><br/><span class="hl-1">})</span><br/><br/><span class="hl-7">// With ViewModel class reference</span><br/><span class="hl-1">.</span><span class="hl-5">rendersMany</span><span class="hl-1">(</span><span class="hl-6">'comments'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">viewModelClass:</span><span class="hl-1"> </span><span class="hl-4">CommentViewModel</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">serializer:</span><span class="hl-1"> </span><span class="hl-4">CommentViewModelSerializer</span><br/><span class="hl-1">})</span><br/><br/><span class="hl-7">// Rename output key</span><br/><span class="hl-1">.</span><span class="hl-5">rendersMany</span><span class="hl-1">(</span><span class="hl-6">'articles'</span><span class="hl-1">, { </span><span class="hl-4">serializer:</span><span class="hl-1"> </span><span class="hl-4">ArticleSerializer</span><span class="hl-1">, </span><span class="hl-4">as:</span><span class="hl-1"> </span><span class="hl-6">'posts'</span><span class="hl-1"> })</span>
|
|
147
148
|
</code><button type="button">Copy</button></pre>
|
|
148
149
|
|
|
149
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/serializer/builders/ObjectSerializerBuilder.ts#L449">src/serializer/builders/ObjectSerializerBuilder.ts:449</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="rendersone"><span>renders<wbr/>One</span><a href="#rendersone" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="rendersone-1"><span class="tsd-kind-call-signature">rendersOne</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneattributename">AttributeName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneattributename">AttributeName</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneserializeroptions">SerializerOptions</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">dreamClass</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="../types/types.ViewModel.html" class="tsd-signature-type tsd-kind-type-alias">ViewModel</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">viewModelClass</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.ViewModelClass.html" class="tsd-signature-type tsd-kind-type-alias">ViewModelClass</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneattributename">AttributeName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">as</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">flatten</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">optional</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span> <span class="tsd-signature-symbol">&</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneserializeroptions">SerializerOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#rendersone-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Includes a single associated object in the serialized output.</p>
|
|
150
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L455">src/serializer/builders/ObjectSerializerBuilder.ts:455</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="rendersone"><span>renders<wbr/>One</span><a href="#rendersone" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="rendersone-1"><span class="tsd-kind-call-signature">rendersOne</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneattributename">AttributeName</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneattributename">AttributeName</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneserializeroptions">SerializerOptions</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">dreamClass</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="../types/types.ViewModel.html" class="tsd-signature-type tsd-kind-type-alias">ViewModel</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">viewModelClass</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.ViewModelClass.html" class="tsd-signature-type tsd-kind-type-alias">ViewModelClass</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneattributename">AttributeName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">as</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">flatten</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">optional</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span> <span class="tsd-signature-symbol">&</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneserializeroptions">SerializerOptions</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">ObjectSerializerBuilder</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maybenulldatatype">MaybeNullDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#passthroughdatatype">PassthroughDataType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a><span class="tsd-signature-symbol">></span><a href="#rendersone-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Includes a single associated object in the serialized output.</p>
|
|
150
151
|
<p>For ObjectSerializer, explicit serializer configuration is always required
|
|
151
152
|
since association schemas cannot be inferred from plain objects.</p>
|
|
152
153
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="rendersoneprovidedmodeltype"><span class="tsd-kind-type-parameter">ProvidedModelType</span> = <span class="tsd-signature-type">undefined</span></span></li><li><span id="rendersoneprovidedattributename"><span class="tsd-kind-type-parameter">ProvidedAttributeName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a></span></li><li><span id="rendersoneactualdatatype"><span class="tsd-kind-type-parameter">ActualDataType</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#datatype">DataType</a> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedmodeltype">ProvidedModelType</a></span></li><li><span id="rendersoneattributename"><span class="tsd-kind-type-parameter">AttributeName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">undefined</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneprovidedattributename">ProvidedAttributeName</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a></span></li><li><span id="rendersoneassociatedmodeltype"><span class="tsd-kind-type-parameter">AssociatedModelType</span> = <span class="tsd-signature-type">Exclude</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneactualdatatype">ActualDataType</a><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneattributename">AttributeName</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></span></li><li><span id="rendersoneserializeroptions"><span class="tsd-kind-type-parameter">SerializerOptions</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">dreamClass</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a> <span class="tsd-signature-keyword">extends</span> <a href="../types/types.ViewModel.html" class="tsd-signature-type tsd-kind-type-alias">ViewModel</a><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">serializerKey</span><span class="tsd-signature-symbol">?:</span> <a href="../types/types.DreamOrViewModelSerializerKey.html" class="tsd-signature-type tsd-kind-type-alias">DreamOrViewModelSerializerKey</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneassociatedmodeltype">AssociatedModelType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">viewModelClass</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.ViewModelClass.html" class="tsd-signature-type tsd-kind-type-alias">ViewModelClass</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">serializer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SerializerType</span> <span class="tsd-signature-symbol">}</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#rendersoneattributename">AttributeName</a></span><div class="tsd-comment tsd-typography"><p>The association property name</p>
|
|
@@ -158,23 +159,27 @@ the parent serialized output instead of nesting them under <code>name</code>. At
|
|
|
158
159
|
declaration order, so when the parent and the association share a key (e.g., <code>id</code>),
|
|
159
160
|
whichever is declared later wins: the association's value replaces an attribute declared
|
|
160
161
|
before the <code>rendersOne</code>, and an attribute declared after it replaces the association's.
|
|
161
|
-
|
|
162
|
-
attribute, delegatedAttribute or customAttribute declared without
|
|
163
|
-
every non-flattened <code>rendersOne</code> and <code>rendersMany</code> (for a
|
|
164
|
-
key the serializer of any of its target classes requires,
|
|
165
|
-
STI base, each key the serializer of any of its STI children
|
|
166
|
-
(so an <code>id</code> declared before the <code>rendersOne</code> becomes <code>null</code>
|
|
167
|
-
<code>
|
|
162
|
+
Each key its serializer requires always renders, as <code>null</code> wherever the association
|
|
163
|
+
does not supply it: an attribute, delegatedAttribute or customAttribute declared without
|
|
164
|
+
<code>required: false</code>, and every non-flattened <code>rendersOne</code> and <code>rendersMany</code> (for a
|
|
165
|
+
polymorphic <code>BelongsTo</code>, each key the serializer of any of its target classes requires,
|
|
166
|
+
and for an association to an STI base, each key the serializer of any of its STI children
|
|
167
|
+
requires), in the same order (so an <code>id</code> declared before the <code>rendersOne</code> becomes <code>null</code>
|
|
168
|
+
when the association is <code>null</code>). A flattened <code>customAttribute</code> in that serializer adds the
|
|
168
169
|
keys its <code>openapi</code> requires: a key an object shape lists in its <code>required</code> array, a key a
|
|
169
170
|
<code>$serializer</code> or <code>$serializable</code> ref's serializer declares without <code>required: false</code>, and
|
|
170
171
|
each such key of an <code>allOf</code>, <code>anyOf</code> or <code>oneOf</code> member; a ref with <code>many: true</code> adds none,
|
|
171
|
-
and a flattened <code>customAttribute</code> declared with <code>required: false</code> adds none.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
and a flattened <code>customAttribute</code> declared with <code>required: false</code> adds none. When the
|
|
173
|
+
association is <code>null</code>, each of these keys renders as <code>null</code> and nothing in its serializer
|
|
174
|
+
is rendered, so its custom attribute callbacks do not run. When it is present, the held
|
|
175
|
+
object's serializer renders its own keys over them, so a key another STI child's or
|
|
176
|
+
target's serializer requires renders as <code>null</code> where the held one's serializer does not
|
|
177
|
+
render it, including a key that serializer declares with <code>required: false</code>; the payload
|
|
178
|
+
always includes the same keys whichever is held and whether the association is <code>null</code>. A
|
|
179
|
+
key declared with <code>required: false</code> that no serializer requires stays absent unless it
|
|
180
|
+
renders. The association's OpenAPI schema describes the parent's payload too, so a shared
|
|
181
|
+
key's value must match both the parent's declaration and the association's, whichever
|
|
182
|
+
declaration wins</li>
|
|
178
183
|
<li><code>optional</code> - When <code>true</code>, allows the association to be null/missing without causing
|
|
179
184
|
an <code>OpenapiResponseValidationFailure</code> during Psychic controller unit specs. By default,
|
|
180
185
|
<code>rendersOne</code> expects the association to be present (mirroring the <code>optional</code> option on
|
|
@@ -199,8 +204,9 @@ an <code>OpenapiResponseValidationFailure</code> during Psychic controller unit
|
|
|
199
204
|
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">flatten</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If <code>true</code>, the rendered association's attributes are merged directly into
|
|
200
205
|
the parent object instead of being nested under the association key. A key
|
|
201
206
|
the parent shares with the association takes the value of whichever is
|
|
202
|
-
declared later, and
|
|
203
|
-
|
|
207
|
+
declared later, and each key its serializer requires renders, as <code>null</code>
|
|
208
|
+
wherever the association does not supply it. See the <code>flatten</code> option of
|
|
209
|
+
<code>rendersOne</code>.</p>
|
|
204
210
|
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">optional</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If <code>true</code>, the association is treated as nullable in the OpenAPI spec,
|
|
205
211
|
allowing <code>null</code> when the association doesn't resolve. Set this for
|
|
206
212
|
associations that may not exist.</p>
|
|
@@ -208,4 +214,4 @@ associations that may not exist.</p>
|
|
|
208
214
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-example"><h4 class="tsd-anchor-link" id="example-5">Example<a href="#example-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="typescript"><span class="hl-7">// With explicit serializer function</span><br/><span class="hl-1">.</span><span class="hl-5">rendersOne</span><span class="hl-1">(</span><span class="hl-6">'owner'</span><span class="hl-1">, { </span><span class="hl-4">serializer:</span><span class="hl-1"> </span><span class="hl-4">CustomOwnerSerializer</span><span class="hl-1"> })</span><br/><br/><span class="hl-7">// With Dream class reference and serializer key</span><br/><span class="hl-1">.</span><span class="hl-5">rendersOne</span><span class="hl-1">(</span><span class="hl-6">'creator'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">dreamClass:</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">serializerKey:</span><span class="hl-1"> </span><span class="hl-6">'summary'</span><br/><span class="hl-1">})</span><br/><br/><span class="hl-7">// Allow null association</span><br/><span class="hl-1">.</span><span class="hl-5">rendersOne</span><span class="hl-1">(</span><span class="hl-6">'approver'</span><span class="hl-1">, { </span><span class="hl-4">serializer:</span><span class="hl-1"> </span><span class="hl-4">UserSerializer</span><span class="hl-1">, </span><span class="hl-4">optional:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1"> })</span><br/><br/><span class="hl-7">// Flatten into parent object</span><br/><span class="hl-1">.</span><span class="hl-5">rendersOne</span><span class="hl-1">(</span><span class="hl-6">'profile'</span><span class="hl-1">, { </span><span class="hl-4">serializer:</span><span class="hl-1"> </span><span class="hl-4">ProfileSerializer</span><span class="hl-1">, </span><span class="hl-4">flatten:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1"> })</span>
|
|
209
215
|
</code><button type="button">Copy</button></pre>
|
|
210
216
|
|
|
211
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
217
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ab19acd3c321e5f7aaa49d2441576a6ce2706e20/src/serializer/builders/ObjectSerializerBuilder.ts#L339">src/serializer/builders/ObjectSerializerBuilder.ts:339</a></li></ul></aside></div></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"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>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"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>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="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><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="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#attributes" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>attributes</span></a><a href="#data" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>data</span></a><a href="#passthroughdata" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>passthrough<wbr/>Data</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#attribute"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>attribute</span></a><a href="#customattribute"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>custom<wbr/>Attribute</span></a><a href="#delegatedattribute"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>delegated<wbr/>Attribute</span></a><a href="#render"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>render</span></a><a href="#rendersmany"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>renders<wbr/>Many</span></a><a href="#rendersone"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>renders<wbr/>One</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@rvoh/dream</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><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>
|