@@ -19,6 +19,7 @@ import { BulkInsertConventions } from "./BulkInsertConventions.js";
1919import { InMemoryDocumentSessionOperations } from "../Session/InMemoryDocumentSessionOperations.js" ;
2020import { ShardingConventions } from "./ShardingConventions.js" ;
2121import { plural } from "../../ext/pluralize/pluralize.js" ;
22+ import { HttpCompressionAlgorithm } from "../../Http/HttpCompressionAlgorithm.js" ;
2223
2324export type IdConvention = ( databaseName : string , entity : object ) => Promise < string > ;
2425export type IValueForQueryConverter < T > =
@@ -98,7 +99,9 @@ export class DocumentConventions {
9899 private _customFetch : any ;
99100 private _dateUtil : DateUtil ;
100101
101- private _useCompression : boolean ;
102+ private _useHttpDecompression : boolean | null = null ;
103+ private _httpCompressionAlgorithm : HttpCompressionAlgorithm = "Gzip" ;
104+
102105 private _sendApplicationIdentifier : boolean ;
103106
104107 private readonly _bulkInsert : BulkInsertConventions ;
@@ -156,8 +159,6 @@ export class DocumentConventions {
156159 documentConventions : this
157160 } ) ;
158161
159- this . _useCompression = null ;
160-
161162 this . _dateUtilOpts = { } ;
162163 this . _dateUtil = new DateUtil ( this . _dateUtilOpts ) ;
163164
@@ -407,10 +408,6 @@ export class DocumentConventions {
407408 this . _maxHttpCacheSize = value ;
408409 }
409410
410- public get hasExplicitlySetCompressionUsage ( ) {
411- return this . _useCompression !== null ;
412- }
413-
414411 public get waitForIndexesAfterSaveChangesTimeout ( ) {
415412 return this . _waitForIndexesAfterSaveChangesTimeout ;
416413 }
@@ -438,17 +435,26 @@ export class DocumentConventions {
438435 this . _waitForReplicationAfterSaveChangesTimeout = value ;
439436 }
440437
441- public get useCompression ( ) {
442- if ( this . _useCompression === null ) {
438+ /**
439+ * Can accept compressed HTTP response content and will use decompression methods
440+ */
441+ public get useHttpDecompression ( ) {
442+ if ( this . _useHttpDecompression === null ) {
443443 return true ;
444444 }
445-
446- return this . _useCompression ;
445+ return this . _useHttpDecompression ;
447446 }
448447
449- public set useCompression ( value ) {
448+ /**
449+ * Can accept compressed HTTP response content and will use decompression methods
450+ */
451+ public set useHttpDecompression ( value : boolean ) {
450452 this . _assertNotFrozen ( ) ;
451- this . _useCompression = value ;
453+ this . _useHttpDecompression = value ;
454+ }
455+
456+ public get httpCompressionAlgorithm ( ) {
457+ return this . _httpCompressionAlgorithm ;
452458 }
453459
454460 private _dateUtilOpts : DateUtilOpts ;
0 commit comments