@azure/cosmos 4.6.0 → 4.7.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/browser/ClientContext.js +2 -2
- package/dist/browser/ClientContext.js.map +1 -1
- package/dist/browser/CosmosClient.d.ts.map +1 -1
- package/dist/browser/CosmosClient.js +3 -0
- package/dist/browser/CosmosClient.js.map +1 -1
- package/dist/browser/common/constants.js +1 -1
- package/dist/browser/common/constants.js.map +1 -1
- package/dist/browser/documents/ConnectionPolicy.d.ts +6 -3
- package/dist/browser/documents/ConnectionPolicy.d.ts.map +1 -1
- package/dist/browser/documents/ConnectionPolicy.js +1 -1
- package/dist/browser/documents/ConnectionPolicy.js.map +1 -1
- package/dist/browser/globalEndpointManager.d.ts +0 -6
- package/dist/browser/globalEndpointManager.d.ts.map +1 -1
- package/dist/browser/globalEndpointManager.js +51 -14
- package/dist/browser/globalEndpointManager.js.map +1 -1
- package/dist/browser/globalPartitionEndpointManager.d.ts +1 -1
- package/dist/browser/globalPartitionEndpointManager.d.ts.map +1 -1
- package/dist/browser/globalPartitionEndpointManager.js +36 -11
- package/dist/browser/globalPartitionEndpointManager.js.map +1 -1
- package/dist/browser/request/RequestHandler.js +2 -2
- package/dist/browser/request/RequestHandler.js.map +1 -1
- package/dist/browser/retry/timeoutFailoverRetryPolicy.js +1 -1
- package/dist/browser/retry/timeoutFailoverRetryPolicy.js.map +1 -1
- package/dist/commonjs/ClientContext.js +2 -2
- package/dist/commonjs/ClientContext.js.map +1 -1
- package/dist/commonjs/CosmosClient.d.ts.map +1 -1
- package/dist/commonjs/CosmosClient.js +3 -0
- package/dist/commonjs/CosmosClient.js.map +1 -1
- package/dist/commonjs/common/constants.js +1 -1
- package/dist/commonjs/common/constants.js.map +1 -1
- package/dist/commonjs/documents/ConnectionPolicy.d.ts +6 -3
- package/dist/commonjs/documents/ConnectionPolicy.d.ts.map +1 -1
- package/dist/commonjs/documents/ConnectionPolicy.js +1 -1
- package/dist/commonjs/documents/ConnectionPolicy.js.map +1 -1
- package/dist/commonjs/globalEndpointManager.d.ts +0 -6
- package/dist/commonjs/globalEndpointManager.d.ts.map +1 -1
- package/dist/commonjs/globalEndpointManager.js +51 -14
- package/dist/commonjs/globalEndpointManager.js.map +1 -1
- package/dist/commonjs/globalPartitionEndpointManager.d.ts +1 -1
- package/dist/commonjs/globalPartitionEndpointManager.d.ts.map +1 -1
- package/dist/commonjs/globalPartitionEndpointManager.js +36 -11
- package/dist/commonjs/globalPartitionEndpointManager.js.map +1 -1
- package/dist/commonjs/request/RequestHandler.js +2 -2
- package/dist/commonjs/request/RequestHandler.js.map +1 -1
- package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js +1 -1
- package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/ClientContext.js +2 -2
- package/dist/esm/ClientContext.js.map +1 -1
- package/dist/esm/CosmosClient.d.ts.map +1 -1
- package/dist/esm/CosmosClient.js +3 -0
- package/dist/esm/CosmosClient.js.map +1 -1
- package/dist/esm/common/constants.js +1 -1
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/documents/ConnectionPolicy.d.ts +6 -3
- package/dist/esm/documents/ConnectionPolicy.d.ts.map +1 -1
- package/dist/esm/documents/ConnectionPolicy.js +1 -1
- package/dist/esm/documents/ConnectionPolicy.js.map +1 -1
- package/dist/esm/globalEndpointManager.d.ts +0 -6
- package/dist/esm/globalEndpointManager.d.ts.map +1 -1
- package/dist/esm/globalEndpointManager.js +51 -14
- package/dist/esm/globalEndpointManager.js.map +1 -1
- package/dist/esm/globalPartitionEndpointManager.d.ts +1 -1
- package/dist/esm/globalPartitionEndpointManager.d.ts.map +1 -1
- package/dist/esm/globalPartitionEndpointManager.js +36 -11
- package/dist/esm/globalPartitionEndpointManager.js.map +1 -1
- package/dist/esm/request/RequestHandler.js +2 -2
- package/dist/esm/request/RequestHandler.js.map +1 -1
- package/dist/esm/retry/timeoutFailoverRetryPolicy.js +1 -1
- package/dist/esm/retry/timeoutFailoverRetryPolicy.js.map +1 -1
- package/dist/react-native/ClientContext.js +2 -2
- package/dist/react-native/ClientContext.js.map +1 -1
- package/dist/react-native/CosmosClient.d.ts.map +1 -1
- package/dist/react-native/CosmosClient.js +3 -0
- package/dist/react-native/CosmosClient.js.map +1 -1
- package/dist/react-native/common/constants.js +1 -1
- package/dist/react-native/common/constants.js.map +1 -1
- package/dist/react-native/documents/ConnectionPolicy.d.ts +6 -3
- package/dist/react-native/documents/ConnectionPolicy.d.ts.map +1 -1
- package/dist/react-native/documents/ConnectionPolicy.js +1 -1
- package/dist/react-native/documents/ConnectionPolicy.js.map +1 -1
- package/dist/react-native/globalEndpointManager.d.ts +0 -6
- package/dist/react-native/globalEndpointManager.d.ts.map +1 -1
- package/dist/react-native/globalEndpointManager.js +51 -14
- package/dist/react-native/globalEndpointManager.js.map +1 -1
- package/dist/react-native/globalPartitionEndpointManager.d.ts +1 -1
- package/dist/react-native/globalPartitionEndpointManager.d.ts.map +1 -1
- package/dist/react-native/globalPartitionEndpointManager.js +36 -11
- package/dist/react-native/globalPartitionEndpointManager.js.map +1 -1
- package/dist/react-native/request/RequestHandler.js +2 -2
- package/dist/react-native/request/RequestHandler.js.map +1 -1
- package/dist/react-native/retry/timeoutFailoverRetryPolicy.js +1 -1
- package/dist/react-native/retry/timeoutFailoverRetryPolicy.js.map +1 -1
- package/package.json +14 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,WAAW,EAAE;QACX,aAAa,EAAE,eAAe;QAC9B,IAAI,EAAE,MAAM;QACZ,cAAc,EAAE,eAAe;QAC/B,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,cAAc;QAC3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D,CAAC,EAxCW,sBAAsB,KAAtB,sBAAsB,QAwCjC;AAED,MAAM,CAAN,IAAY,YAiBX;AAjBD,WAAY,YAAY;IACtB,uDAAuC,CAAA;IACvC,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,mDAAmC,CAAA;IACnC,iDAAiC,CAAA;IACjC,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,yDAAyC,CAAA;IACzC,mCAAmB,CAAA;IACnB,yDAAyC,CAAA;IACzC,2DAA2C,CAAA;IAC3C,2DAA2C,CAAA;IAC3C,mCAAmB,CAAA;IACnB,6CAA6B,CAAA;IAC7B,yDAAyC,CAAA;IACzC,iFAAiE,CAAA;AACnE,CAAC,EAjBW,YAAY,KAAZ,YAAY,QAiBvB;AAED,MAAM,CAAN,IAAY,wBAEX;AAFD,WAAY,wBAAwB;IAClC,2FAAkB,CAAA;AACpB,CAAC,EAFW,wBAAwB,KAAxB,wBAAwB,QAEnC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,yFAAS,CAAA;IACT,6FAAW,CAAA;AACb,CAAC,EAHW,4BAA4B,KAA5B,4BAA4B,QAGvC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,mHAAiC,CAAA;IACjC,6GAA8B,CAAA;AAChC,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport interface PartitionKeyRangePropertiesNames {\n // Partition Key Range Constants\n MinInclusive: \"minInclusive\";\n MaxExclusive: \"maxExclusive\";\n Id: \"id\";\n}\n\n/**\n * @hidden\n */\nexport const Constants = {\n HttpHeaders: {\n Authorization: \"authorization\",\n ETag: \"etag\",\n MethodOverride: \"X-HTTP-Method\",\n Slug: \"Slug\",\n ContentType: \"Content-Type\",\n LastModified: \"Last-Modified\",\n ContentEncoding: \"Content-Encoding\",\n CharacterSet: \"CharacterSet\",\n UserAgent: \"User-Agent\",\n CustomUserAgent: \"x-ms-useragent\",\n IfModifiedSince: \"If-Modified-Since\",\n IfMatch: \"If-Match\",\n IfNoneMatch: \"If-None-Match\",\n ContentLength: \"Content-Length\",\n AcceptEncoding: \"Accept-Encoding\",\n KeepAlive: \"Keep-Alive\",\n CacheControl: \"Cache-Control\",\n TransferEncoding: \"Transfer-Encoding\",\n ContentLanguage: \"Content-Language\",\n ContentLocation: \"Content-Location\",\n ContentMd5: \"Content-Md5\",\n ContentRange: \"Content-Range\",\n Accept: \"Accept\",\n AcceptCharset: \"Accept-Charset\",\n AcceptLanguage: \"Accept-Language\",\n IfRange: \"If-Range\",\n IfUnmodifiedSince: \"If-Unmodified-Since\",\n MaxForwards: \"Max-Forwards\",\n ProxyAuthorization: \"Proxy-Authorization\",\n AcceptRanges: \"Accept-Ranges\",\n ProxyAuthenticate: \"Proxy-Authenticate\",\n RetryAfter: \"Retry-After\",\n SetCookie: \"Set-Cookie\",\n WwwAuthenticate: \"Www-Authenticate\",\n Origin: \"Origin\",\n Host: \"Host\",\n AccessControlAllowOrigin: \"Access-Control-Allow-Origin\",\n AccessControlAllowHeaders: \"Access-Control-Allow-Headers\",\n KeyValueEncodingFormat: \"application/x-www-form-urlencoded\",\n WrapAssertionFormat: \"wrap_assertion_format\",\n WrapAssertion: \"wrap_assertion\",\n WrapScope: \"wrap_scope\",\n SimpleToken: \"SWT\",\n HttpDate: \"date\",\n Prefer: \"Prefer\",\n Location: \"Location\",\n Referer: \"referer\",\n A_IM: \"A-IM\",\n PreferReturnMinimal: \"return=minimal\",\n\n // Query\n Query: \"x-ms-documentdb-query\",\n IsQuery: \"x-ms-documentdb-isquery\",\n IsQueryPlan: \"x-ms-cosmos-is-query-plan-request\",\n SupportedQueryFeatures: \"x-ms-cosmos-supported-query-features\",\n QueryVersion: \"x-ms-cosmos-query-version\",\n\n // Our custom Azure Cosmos DB headers\n Continuation: \"x-ms-continuation\",\n ContinuationToken: \"x-ms-continuation-token\",\n PageSize: \"x-ms-max-item-count\",\n ItemCount: \"x-ms-item-count\",\n ChangeFeedWireFormatVersion: \"x-ms-cosmos-changefeed-wire-format-version\",\n\n // Request sender generated. Simply echoed by backend.\n ActivityId: \"x-ms-activity-id\",\n CorrelatedActivityId: \"x-ms-cosmos-correlated-activityid\",\n PreTriggerInclude: \"x-ms-documentdb-pre-trigger-include\",\n PreTriggerExclude: \"x-ms-documentdb-pre-trigger-exclude\",\n PostTriggerInclude: \"x-ms-documentdb-post-trigger-include\",\n PostTriggerExclude: \"x-ms-documentdb-post-trigger-exclude\",\n IndexingDirective: \"x-ms-indexing-directive\",\n SessionToken: \"x-ms-session-token\",\n ConsistencyLevel: \"x-ms-consistency-level\",\n XDate: \"x-ms-date\",\n CollectionPartitionInfo: \"x-ms-collection-partition-info\",\n CollectionServiceInfo: \"x-ms-collection-service-info\",\n // Deprecated, use RetryAfterInMs instead.\n RetryAfterInMilliseconds: \"x-ms-retry-after-ms\",\n RetryAfterInMs: \"x-ms-retry-after-ms\",\n IsFeedUnfiltered: \"x-ms-is-feed-unfiltered\",\n ResourceTokenExpiry: \"x-ms-documentdb-expiry-seconds\",\n EnableScanInQuery: \"x-ms-documentdb-query-enable-scan\",\n EmitVerboseTracesInQuery: \"x-ms-documentdb-query-emit-traces\",\n EnableCrossPartitionQuery: \"x-ms-documentdb-query-enablecrosspartition\",\n ParallelizeCrossPartitionQuery: \"x-ms-documentdb-query-parallelizecrosspartitionquery\",\n ResponseContinuationTokenLimitInKB: \"x-ms-documentdb-responsecontinuationtokenlimitinkb\",\n SDKSupportedCapabilities: \"x-ms-cosmos-sdk-supportedcapabilities\",\n\n // QueryMetrics\n // Request header to tell backend to give you query metrics.\n PopulateQueryMetrics: \"x-ms-documentdb-populatequerymetrics\",\n // Response header that holds the serialized version of query metrics.\n QueryMetrics: \"x-ms-documentdb-query-metrics\",\n\n // IndexMetrics\n // Request header to tell backend to give you index metrics.\n PopulateIndexMetrics: \"x-ms-cosmos-populateindexmetrics-V2\",\n // Response header that holds the serialized version of index metrics.\n IndexUtilization: \"x-ms-cosmos-index-utilization\",\n // Version headers and values\n Version: \"x-ms-version\",\n\n // Owner name\n OwnerFullName: \"x-ms-alt-content-path\",\n\n // Owner ID used for name based request in session token.\n OwnerId: \"x-ms-content-path\",\n\n // Partition Key\n PartitionKey: \"x-ms-documentdb-partitionkey\",\n PartitionKeyRangeID: \"x-ms-documentdb-partitionkeyrangeid\",\n\n // Epk Range headers\n StartEpk: \"x-ms-start-epk\",\n EndEpk: \"x-ms-end-epk\",\n\n // Read Feed Type\n ReadFeedKeyType: \"x-ms-read-key-type\",\n\n // Quota Info\n MaxEntityCount: \"x-ms-root-entity-max-count\",\n CurrentEntityCount: \"x-ms-root-entity-current-count\",\n CollectionQuotaInMb: \"x-ms-collection-quota-mb\",\n CollectionCurrentUsageInMb: \"x-ms-collection-usage-mb\",\n MaxMediaStorageUsageInMB: \"x-ms-max-media-storage-usage-mb\",\n CurrentMediaStorageUsageInMB: \"x-ms-media-storage-usage-mb\",\n RequestCharge: \"x-ms-request-charge\",\n PopulateQuotaInfo: \"x-ms-documentdb-populatequotainfo\",\n MaxResourceQuota: \"x-ms-resource-quota\",\n\n // Offer header\n OfferType: \"x-ms-offer-type\",\n OfferThroughput: \"x-ms-offer-throughput\",\n AutoscaleSettings: \"x-ms-cosmos-offer-autopilot-settings\",\n\n // Custom RUs/minute headers\n DisableRUPerMinuteUsage: \"x-ms-documentdb-disable-ru-per-minute-usage\",\n IsRUPerMinuteUsed: \"x-ms-documentdb-is-ru-per-minute-used\",\n OfferIsRUPerMinuteThroughputEnabled: \"x-ms-offer-is-ru-per-minute-throughput-enabled\",\n\n // Index progress headers\n IndexTransformationProgress: \"x-ms-documentdb-collection-index-transformation-progress\",\n LazyIndexingProgress: \"x-ms-documentdb-collection-lazy-indexing-progress\",\n\n // Upsert header\n IsUpsert: \"x-ms-documentdb-is-upsert\",\n\n // Sub status of the error\n SubStatus: \"x-ms-substatus\",\n\n // StoredProcedure related headers\n EnableScriptLogging: \"x-ms-documentdb-script-enable-logging\",\n ScriptLogResults: \"x-ms-documentdb-script-log-results\",\n\n // Multi-Region Write\n ALLOW_MULTIPLE_WRITES: \"x-ms-cosmos-allow-tentative-writes\",\n\n // Bulk/Batch header\n IsBatchRequest: \"x-ms-cosmos-is-batch-request\",\n IsBatchAtomic: \"x-ms-cosmos-batch-atomic\",\n BatchContinueOnError: \"x-ms-cosmos-batch-continue-on-error\",\n\n // Dedicated Gateway Headers\n DedicatedGatewayPerRequestCacheStaleness: \"x-ms-dedicatedgateway-max-age\",\n DedicatedGatewayPerRequestBypassCache: \"x-ms-dedicatedgateway-bypass-cache\",\n\n // Cache Refresh header\n ForceRefresh: \"x-ms-force-refresh\",\n\n // Throughput related headers\n PriorityLevel: \"x-ms-cosmos-priority-level\",\n ThroughputBucket: \"x-ms-cosmos-throughput-bucket\",\n\n // Encryption Headers\n IsClientEncryptedHeader: \"x-ms-cosmos-is-client-encrypted\",\n IntendedCollectionHeader: \"x-ms-cosmos-intended-collection-rid\",\n DatabaseRidHeader: \"x-ms-cosmos-database-rid\",\n AllowCachedReadsHeader: \"x-ms-cosmos-allow-cachedreads\",\n },\n // ThrottledRequests Retry policy default values\n ThrottledRequestMaxRetryAttemptCount: 9,\n ThrottledRequestMaxWaitTimeInSeconds: 30,\n ThrottledRequestFixedRetryIntervalInMs: 0,\n\n // GlobalDB related constants\n WritableLocations: \"writableLocations\",\n ReadableLocations: \"readableLocations\",\n LocationUnavailableExpirationTimeInMs: 5 * 60 * 1000, // 5 minutes\n StalePartitionUnavailabilityRefreshIntervalInMs: 1 * 60 * 1000, // 1 minute\n AllowedPartitionUnavailabilityDurationInMs: 5 * 60 * 1000, // 5 minutes\n ReadRequestFailureCountThreshold: 10,\n WriteRequestFailureCountThreshold: 5,\n ConsecutiveFailureCountResetIntervalInMS: 1000 * 60 * 1, // 1 minute\n\n // ServiceDocument Resource\n ENABLE_MULTIPLE_WRITABLE_LOCATIONS: \"enableMultipleWriteLocations\",\n EnablePerPartitionFailover: \"enablePerPartitionFailoverBehavior\",\n\n // Background refresh time\n DefaultUnavailableLocationExpirationTimeMS: 5 * 60 * 1000,\n\n // Client generated retry count response header\n ThrottleRetryCount: \"x-ms-throttle-retry-count\",\n ThrottleRetryWaitTimeInMs: \"x-ms-throttle-retry-wait-time-ms\",\n\n // Platform\n CurrentVersion: \"2020-07-15\",\n AzureNamespace: \"Azure.Cosmos\",\n AzurePackageName: \"@azure/cosmos\",\n SDKName: \"azure-cosmos-js\",\n SDKVersion: \"4.6.0\",\n\n // Diagnostics\n CosmosDbDiagnosticLevelEnvVarName: \"AZURE_COSMOSDB_DIAGNOSTICS_LEVEL\",\n\n // Bulk Operations\n DefaultMaxBulkRequestBodySizeInBytes: 220201,\n MaxBulkOperationsCount: 100,\n BulkMaxDegreeOfConcurrency: 20,\n\n // Encryption\n Encryption: {\n DiagnosticsDecryptOperation: \"Decrypt\",\n DiagnosticsDuration: \"Duration in milliseconds\",\n DiagnosticsEncryptionDiagnostics: \"EncryptionDiagnostics\",\n DiagnosticsEncryptOperation: \"Encrypt\",\n DiagnosticsPropertiesEncryptedCount: \"Properties Encrypted Count\",\n DiagnosticsPropertiesDecryptedCount: \"Properties Decrypted Count\",\n DiagnosticsStartTime: \"Start time\",\n },\n\n Quota: {\n CollectionSize: \"collectionSize\",\n },\n\n Path: {\n Root: \"/\",\n DatabasesPathSegment: \"dbs\",\n CollectionsPathSegment: \"colls\",\n UsersPathSegment: \"users\",\n DocumentsPathSegment: \"docs\",\n PermissionsPathSegment: \"permissions\",\n StoredProceduresPathSegment: \"sprocs\",\n TriggersPathSegment: \"triggers\",\n UserDefinedFunctionsPathSegment: \"udfs\",\n ConflictsPathSegment: \"conflicts\",\n AttachmentsPathSegment: \"attachments\",\n PartitionKeyRangesPathSegment: \"pkranges\",\n SchemasPathSegment: \"schemas\",\n OffersPathSegment: \"offers\",\n TopologyPathSegment: \"topology\",\n DatabaseAccountPathSegment: \"databaseaccount\",\n },\n\n PartitionKeyRange: {\n // Partition Key Range Constants\n MinInclusive: \"minInclusive\",\n MaxExclusive: \"maxExclusive\",\n Id: \"id\",\n } as PartitionKeyRangePropertiesNames,\n\n QueryRangeConstants: {\n // Partition Key Range Constants\n MinInclusive: \"minInclusive\",\n MaxExclusive: \"maxExclusive\",\n min: \"min\",\n },\n\n /**\n * @deprecated Use EffectivePartitionKeyConstants instead\n */\n EffectiveParitionKeyConstants: {\n MinimumInclusiveEffectivePartitionKey: \"\",\n MaximumExclusiveEffectivePartitionKey: \"FF\",\n },\n\n EffectivePartitionKeyConstants: {\n MinimumInclusiveEffectivePartitionKey: \"\",\n MaximumExclusiveEffectivePartitionKey: \"FF\",\n },\n\n // Changefeed AllVersionsAndDeletesMode formatting version\n AllVersionsAndDeletesChangeFeedWireFormatVersion: \"2021-09-15\",\n ChangeFeedIfNoneMatchStartFromNowHeader: \"*\",\n // Default TTL for encryption caches is 2 hrs (7200 sec)\n DefaultEncryptionCacheTimeToLiveInSeconds: 7200,\n // Timeout to clear encryption related cache\n EncryptionCacheRefreshIntervalInMs: 60000, // 1 minute\n\n RequestTimeoutForReadsInMs: 2000, // 2 seconds\n};\n\nexport const AAD_DEFAULT_SCOPE = \"https://cosmos.azure.com/.default\";\nexport const AAD_AUTH_PREFIX = \"type=aad&ver=1.0&sig=\";\nexport const AAD_RESOURCE_NOT_FOUND_ERROR = \"AADSTS500011\";\n\n/**\n * @hidden\n */\nexport enum ResourceType {\n none = \"\",\n database = \"dbs\",\n offer = \"offers\",\n user = \"users\",\n permission = \"permissions\",\n container = \"colls\",\n conflicts = \"conflicts\",\n sproc = \"sprocs\",\n udf = \"udfs\",\n trigger = \"triggers\",\n item = \"docs\",\n pkranges = \"pkranges\",\n partitionkey = \"partitionKey\",\n /** resource representing client encryption keys to encrypt/decrypt data */\n clientencryptionkey = \"clientencryptionkeys\",\n}\n\n/**\n * @hidden\n */\nexport enum HTTPMethod {\n get = \"GET\",\n patch = \"PATCH\",\n post = \"POST\",\n put = \"PUT\",\n delete = \"DELETE\",\n}\n\n/**\n * @hidden\n */\nexport enum OperationType {\n Create = \"create\",\n Replace = \"replace\",\n Upsert = \"upsert\",\n Delete = \"delete\",\n Read = \"read\",\n Query = \"query\",\n Execute = \"execute\",\n Batch = \"batch\",\n Patch = \"patch\",\n}\n\n/**\n * @hidden\n */\nexport enum CosmosKeyType {\n PrimaryMaster = \"PRIMARY_MASTER\",\n SecondaryMaster = \"SECONDARY_MASTER\",\n PrimaryReadOnly = \"PRIMARY_READONLY\",\n SecondaryReadOnly = \"SECONDARY_READONLY\",\n}\n\n/**\n * @hidden\n */\nexport enum CosmosContainerChildResourceKind {\n Item = \"ITEM\",\n StoredProcedure = \"STORED_PROCEDURE\",\n UserDefinedFunction = \"USER_DEFINED_FUNCTION\",\n Trigger = \"TRIGGER\",\n}\n/**\n * @hidden\n */\nexport enum PermissionScopeValues {\n /**\n * Values which set permission Scope applicable to control plane related operations.\n */\n ScopeAccountReadValue = 0x0001,\n ScopeAccountListDatabasesValue = 0x0002,\n ScopeDatabaseReadValue = 0x0004,\n ScopeDatabaseReadOfferValue = 0x0008,\n ScopeDatabaseListContainerValue = 0x0010,\n ScopeContainerReadValue = 0x0020,\n ScopeContainerReadOfferValue = 0x0040,\n\n ScopeAccountCreateDatabasesValue = 0x0001,\n ScopeAccountDeleteDatabasesValue = 0x0002,\n ScopeDatabaseDeleteValue = 0x0004,\n ScopeDatabaseReplaceOfferValue = 0x0008,\n ScopeDatabaseCreateContainerValue = 0x0010,\n ScopeDatabaseDeleteContainerValue = 0x0020,\n ScopeContainerReplaceValue = 0x0040,\n ScopeContainerDeleteValue = 0x0080,\n ScopeContainerReplaceOfferValue = 0x0100,\n\n ScopeAccountReadAllAccessValue = 0xffff,\n ScopeDatabaseReadAllAccessValue = PermissionScopeValues.ScopeDatabaseReadValue |\n PermissionScopeValues.ScopeDatabaseReadOfferValue |\n PermissionScopeValues.ScopeDatabaseListContainerValue |\n PermissionScopeValues.ScopeContainerReadValue |\n PermissionScopeValues.ScopeContainerReadOfferValue,\n\n ScopeContainersReadAllAccessValue = PermissionScopeValues.ScopeContainerReadValue |\n PermissionScopeValues.ScopeContainerReadOfferValue,\n\n ScopeAccountWriteAllAccessValue = 0xffff,\n ScopeDatabaseWriteAllAccessValue = PermissionScopeValues.ScopeDatabaseDeleteValue |\n PermissionScopeValues.ScopeDatabaseReplaceOfferValue |\n PermissionScopeValues.ScopeDatabaseCreateContainerValue |\n PermissionScopeValues.ScopeDatabaseDeleteContainerValue |\n PermissionScopeValues.ScopeContainerReplaceValue |\n PermissionScopeValues.ScopeContainerDeleteValue |\n PermissionScopeValues.ScopeContainerReplaceOfferValue,\n\n ScopeContainersWriteAllAccessValue = PermissionScopeValues.ScopeContainerReplaceValue |\n PermissionScopeValues.ScopeContainerDeleteValue |\n PermissionScopeValues.ScopeContainerReplaceOfferValue,\n\n /**\n * Values which set permission Scope applicable to data plane related operations.\n */\n ScopeContainerExecuteQueriesValue = 0x00000001,\n ScopeContainerReadFeedsValue = 0x00000002,\n ScopeContainerReadStoredProceduresValue = 0x00000004,\n ScopeContainerReadUserDefinedFunctionsValue = 0x00000008,\n ScopeContainerReadTriggersValue = 0x00000010,\n ScopeContainerReadConflictsValue = 0x00000020,\n ScopeItemReadValue = 0x00000040,\n ScopeStoredProcedureReadValue = 0x00000080,\n ScopeUserDefinedFunctionReadValue = 0x00000100,\n ScopeTriggerReadValue = 0x00000200,\n\n ScopeContainerCreateItemsValue = 0x00000001,\n ScopeContainerReplaceItemsValue = 0x00000002,\n ScopeContainerUpsertItemsValue = 0x00000004,\n ScopeContainerDeleteItemsValue = 0x00000008,\n ScopeContainerCreateStoredProceduresValue = 0x00000010,\n ScopeContainerReplaceStoredProceduresValue = 0x00000020,\n ScopeContainerDeleteStoredProceduresValue = 0x00000040,\n ScopeContainerExecuteStoredProceduresValue = 0x00000080,\n ScopeContainerCreateTriggersValue = 0x00000100,\n ScopeContainerReplaceTriggersValue = 0x00000200,\n ScopeContainerDeleteTriggersValue = 0x00000400,\n ScopeContainerCreateUserDefinedFunctionsValue = 0x00000800,\n ScopeContainerReplaceUserDefinedFunctionsValue = 0x00001000,\n ScopeContainerDeleteUserDefinedFunctionSValue = 0x00002000,\n ScopeContainerDeleteCONFLICTSValue = 0x00004000,\n ScopeItemReplaceValue = 0x00010000,\n ScopeItemUpsertValue = 0x00020000,\n ScopeItemDeleteValue = 0x00040000,\n ScopeStoredProcedureReplaceValue = 0x00100000,\n ScopeStoredProcedureDeleteValue = 0x00200000,\n ScopeStoredProcedureExecuteValue = 0x00400000,\n ScopeUserDefinedFunctionReplaceValue = 0x00800000,\n ScopeUserDefinedFunctionDeleteValue = 0x01000000,\n ScopeTriggerReplaceValue = 0x02000000,\n ScopeTriggerDeleteValue = 0x04000000,\n\n ScopeContainerReadAllAccessValue = 0xffffffff,\n ScopeItemReadAllAccessValue = PermissionScopeValues.ScopeContainerExecuteQueriesValue |\n PermissionScopeValues.ScopeItemReadValue,\n ScopeContainerWriteAllAccessValue = 0xffffffff,\n ScopeItemWriteAllAccessValue = PermissionScopeValues.ScopeContainerCreateItemsValue |\n PermissionScopeValues.ScopeContainerReplaceItemsValue |\n PermissionScopeValues.ScopeContainerUpsertItemsValue |\n PermissionScopeValues.ScopeContainerDeleteItemsValue |\n PermissionScopeValues.ScopeItemReplaceValue |\n PermissionScopeValues.ScopeItemUpsertValue |\n PermissionScopeValues.ScopeItemDeleteValue,\n\n NoneValue = 0,\n}\n/**\n * @hidden\n */\nexport enum SasTokenPermissionKind {\n ContainerCreateItems = PermissionScopeValues.ScopeContainerCreateItemsValue,\n ContainerReplaceItems = PermissionScopeValues.ScopeContainerReplaceItemsValue,\n ContainerUpsertItems = PermissionScopeValues.ScopeContainerUpsertItemsValue,\n ContainerDeleteItems = PermissionScopeValues.ScopeContainerDeleteValue,\n ContainerExecuteQueries = PermissionScopeValues.ScopeContainerExecuteQueriesValue,\n ContainerReadFeeds = PermissionScopeValues.ScopeContainerReadFeedsValue,\n ContainerCreateStoreProcedure = PermissionScopeValues.ScopeContainerCreateStoredProceduresValue,\n ContainerReadStoreProcedure = PermissionScopeValues.ScopeContainerReadStoredProceduresValue,\n ContainerReplaceStoreProcedure = PermissionScopeValues.ScopeContainerReplaceStoredProceduresValue,\n ContainerDeleteStoreProcedure = PermissionScopeValues.ScopeContainerDeleteStoredProceduresValue,\n ContainerCreateTriggers = PermissionScopeValues.ScopeContainerCreateTriggersValue,\n ContainerReadTriggers = PermissionScopeValues.ScopeContainerReadTriggersValue,\n ContainerReplaceTriggers = PermissionScopeValues.ScopeContainerReplaceTriggersValue,\n ContainerDeleteTriggers = PermissionScopeValues.ScopeContainerDeleteTriggersValue,\n ContainerCreateUserDefinedFunctions = PermissionScopeValues.ScopeContainerCreateUserDefinedFunctionsValue,\n ContainerReadUserDefinedFunctions = PermissionScopeValues.ScopeContainerReadUserDefinedFunctionsValue,\n ContainerReplaceUserDefinedFunctions = PermissionScopeValues.ScopeContainerReplaceUserDefinedFunctionsValue,\n ContainerDeleteUserDefinedFunctions = PermissionScopeValues.ScopeContainerDeleteUserDefinedFunctionSValue,\n ContainerExecuteStoredProcedure = PermissionScopeValues.ScopeContainerExecuteStoredProceduresValue,\n ContainerReadConflicts = PermissionScopeValues.ScopeContainerReadConflictsValue,\n ContainerDeleteConflicts = PermissionScopeValues.ScopeContainerDeleteCONFLICTSValue,\n ContainerReadAny = PermissionScopeValues.ScopeContainerReadOfferValue,\n ContainerFullAccess = PermissionScopeValues.ScopeContainerReadAllAccessValue,\n ItemReadAny = PermissionScopeValues.ScopeItemReplaceValue,\n ItemFullAccess = PermissionScopeValues.ScopeItemReadAllAccessValue,\n ItemRead = PermissionScopeValues.ScopeItemReadValue,\n ItemReplace = PermissionScopeValues.ScopeItemReplaceValue,\n ItemUpsert = PermissionScopeValues.ScopeItemUpsertValue,\n ItemDelete = PermissionScopeValues.ScopeItemDeleteValue,\n StoreProcedureRead = PermissionScopeValues.ScopeStoredProcedureReadValue,\n StoreProcedureReplace = PermissionScopeValues.ScopeStoredProcedureReplaceValue,\n StoreProcedureDelete = PermissionScopeValues.ScopeStoredProcedureDeleteValue,\n StoreProcedureExecute = PermissionScopeValues.ScopeStoredProcedureExecuteValue,\n UserDefinedFuntionRead = PermissionScopeValues.ScopeUserDefinedFunctionReadValue,\n UserDefinedFuntionReplace = PermissionScopeValues.ScopeUserDefinedFunctionReplaceValue,\n UserDefinedFuntionDelete = PermissionScopeValues.ScopeUserDefinedFunctionDeleteValue,\n TriggerRead = PermissionScopeValues.ScopeTriggerReadValue,\n TriggerReplace = PermissionScopeValues.ScopeTriggerReplaceValue,\n TriggerDelete = PermissionScopeValues.ScopeTriggerDeleteValue,\n}\n\nexport enum QueryFeature {\n NonValueAggregate = \"NonValueAggregate\",\n Aggregate = \"Aggregate\",\n Distinct = \"Distinct\",\n MultipleOrderBy = \"MultipleOrderBy\",\n OffsetAndLimit = \"OffsetAndLimit\",\n OrderBy = \"OrderBy\",\n Top = \"Top\",\n CompositeAggregate = \"CompositeAggregate\",\n GroupBy = \"GroupBy\",\n MultipleAggregates = \"MultipleAggregates\",\n NonStreamingOrderBy = \"NonStreamingOrderBy\",\n ListAndSetAggregate = \"ListAndSetAggregate\",\n CountIf = \"CountIf\",\n HybridSearch = \"HybridSearch\",\n WeightedRankFusion = \"WeightedRankFusion\",\n HybridSearchSkipOrderByRewrite = \"HybridSearchSkipOrderByRewrite\",\n}\n\nexport enum SDKSupportedCapabilities {\n PartitionMerge = 1,\n}\n\n/**\n * @hidden\n */\nexport enum PartitionAvailablilityStatus {\n Available,\n Unavailable,\n}\n\n/**\n * @hidden\n */\nexport enum UserAgentFeatureFlags {\n PerPartitionAutomaticFailover = 1,\n PerPartitionCircuitBreaker = 2,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC;;GAE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E,CAAA;IAC9E,yGAA4E,CAAA;IAC5E,2GAA8E,CAAA;IAC9E,yGAAgF,CAAA;IAChF,mHAAsF,CAAA;IACtF,kHAAoF,CAAA;IACpF,mFAAyD,CAAA;IACzD,8FAA+D,CAAA;IAC/D,4FAA6D,CAAA;AAC/D,CAAC,EAxCW,sBAAsB,KAAtB,sBAAsB,QAwCjC;AAED,MAAM,CAAN,IAAY,YAiBX;AAjBD,WAAY,YAAY;IACtB,uDAAuC,CAAA;IACvC,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,mDAAmC,CAAA;IACnC,iDAAiC,CAAA;IACjC,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,yDAAyC,CAAA;IACzC,mCAAmB,CAAA;IACnB,yDAAyC,CAAA;IACzC,2DAA2C,CAAA;IAC3C,2DAA2C,CAAA;IAC3C,mCAAmB,CAAA;IACnB,6CAA6B,CAAA;IAC7B,yDAAyC,CAAA;IACzC,iFAAiE,CAAA;AACnE,CAAC,EAjBW,YAAY,KAAZ,YAAY,QAiBvB;AAED,MAAM,CAAN,IAAY,wBAEX;AAFD,WAAY,wBAAwB;IAClC,2FAAkB,CAAA;AACpB,CAAC,EAFW,wBAAwB,KAAxB,wBAAwB,QAEnC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,yFAAS,CAAA;IACT,6FAAW,CAAA;AACb,CAAC,EAHW,4BAA4B,KAA5B,4BAA4B,QAGvC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,mHAAiC,CAAA;IACjC,6GAA8B,CAAA;AAChC,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport interface PartitionKeyRangePropertiesNames {\n // Partition Key Range Constants\n MinInclusive: \"minInclusive\";\n MaxExclusive: \"maxExclusive\";\n Id: \"id\";\n}\n\n/**\n * @hidden\n */\nexport const Constants = {\n HttpHeaders: {\n Authorization: \"authorization\",\n ETag: \"etag\",\n MethodOverride: \"X-HTTP-Method\",\n Slug: \"Slug\",\n ContentType: \"Content-Type\",\n LastModified: \"Last-Modified\",\n ContentEncoding: \"Content-Encoding\",\n CharacterSet: \"CharacterSet\",\n UserAgent: \"User-Agent\",\n CustomUserAgent: \"x-ms-useragent\",\n IfModifiedSince: \"If-Modified-Since\",\n IfMatch: \"If-Match\",\n IfNoneMatch: \"If-None-Match\",\n ContentLength: \"Content-Length\",\n AcceptEncoding: \"Accept-Encoding\",\n KeepAlive: \"Keep-Alive\",\n CacheControl: \"Cache-Control\",\n TransferEncoding: \"Transfer-Encoding\",\n ContentLanguage: \"Content-Language\",\n ContentLocation: \"Content-Location\",\n ContentMd5: \"Content-Md5\",\n ContentRange: \"Content-Range\",\n Accept: \"Accept\",\n AcceptCharset: \"Accept-Charset\",\n AcceptLanguage: \"Accept-Language\",\n IfRange: \"If-Range\",\n IfUnmodifiedSince: \"If-Unmodified-Since\",\n MaxForwards: \"Max-Forwards\",\n ProxyAuthorization: \"Proxy-Authorization\",\n AcceptRanges: \"Accept-Ranges\",\n ProxyAuthenticate: \"Proxy-Authenticate\",\n RetryAfter: \"Retry-After\",\n SetCookie: \"Set-Cookie\",\n WwwAuthenticate: \"Www-Authenticate\",\n Origin: \"Origin\",\n Host: \"Host\",\n AccessControlAllowOrigin: \"Access-Control-Allow-Origin\",\n AccessControlAllowHeaders: \"Access-Control-Allow-Headers\",\n KeyValueEncodingFormat: \"application/x-www-form-urlencoded\",\n WrapAssertionFormat: \"wrap_assertion_format\",\n WrapAssertion: \"wrap_assertion\",\n WrapScope: \"wrap_scope\",\n SimpleToken: \"SWT\",\n HttpDate: \"date\",\n Prefer: \"Prefer\",\n Location: \"Location\",\n Referer: \"referer\",\n A_IM: \"A-IM\",\n PreferReturnMinimal: \"return=minimal\",\n\n // Query\n Query: \"x-ms-documentdb-query\",\n IsQuery: \"x-ms-documentdb-isquery\",\n IsQueryPlan: \"x-ms-cosmos-is-query-plan-request\",\n SupportedQueryFeatures: \"x-ms-cosmos-supported-query-features\",\n QueryVersion: \"x-ms-cosmos-query-version\",\n\n // Our custom Azure Cosmos DB headers\n Continuation: \"x-ms-continuation\",\n ContinuationToken: \"x-ms-continuation-token\",\n PageSize: \"x-ms-max-item-count\",\n ItemCount: \"x-ms-item-count\",\n ChangeFeedWireFormatVersion: \"x-ms-cosmos-changefeed-wire-format-version\",\n\n // Request sender generated. Simply echoed by backend.\n ActivityId: \"x-ms-activity-id\",\n CorrelatedActivityId: \"x-ms-cosmos-correlated-activityid\",\n PreTriggerInclude: \"x-ms-documentdb-pre-trigger-include\",\n PreTriggerExclude: \"x-ms-documentdb-pre-trigger-exclude\",\n PostTriggerInclude: \"x-ms-documentdb-post-trigger-include\",\n PostTriggerExclude: \"x-ms-documentdb-post-trigger-exclude\",\n IndexingDirective: \"x-ms-indexing-directive\",\n SessionToken: \"x-ms-session-token\",\n ConsistencyLevel: \"x-ms-consistency-level\",\n XDate: \"x-ms-date\",\n CollectionPartitionInfo: \"x-ms-collection-partition-info\",\n CollectionServiceInfo: \"x-ms-collection-service-info\",\n // Deprecated, use RetryAfterInMs instead.\n RetryAfterInMilliseconds: \"x-ms-retry-after-ms\",\n RetryAfterInMs: \"x-ms-retry-after-ms\",\n IsFeedUnfiltered: \"x-ms-is-feed-unfiltered\",\n ResourceTokenExpiry: \"x-ms-documentdb-expiry-seconds\",\n EnableScanInQuery: \"x-ms-documentdb-query-enable-scan\",\n EmitVerboseTracesInQuery: \"x-ms-documentdb-query-emit-traces\",\n EnableCrossPartitionQuery: \"x-ms-documentdb-query-enablecrosspartition\",\n ParallelizeCrossPartitionQuery: \"x-ms-documentdb-query-parallelizecrosspartitionquery\",\n ResponseContinuationTokenLimitInKB: \"x-ms-documentdb-responsecontinuationtokenlimitinkb\",\n SDKSupportedCapabilities: \"x-ms-cosmos-sdk-supportedcapabilities\",\n\n // QueryMetrics\n // Request header to tell backend to give you query metrics.\n PopulateQueryMetrics: \"x-ms-documentdb-populatequerymetrics\",\n // Response header that holds the serialized version of query metrics.\n QueryMetrics: \"x-ms-documentdb-query-metrics\",\n\n // IndexMetrics\n // Request header to tell backend to give you index metrics.\n PopulateIndexMetrics: \"x-ms-cosmos-populateindexmetrics-V2\",\n // Response header that holds the serialized version of index metrics.\n IndexUtilization: \"x-ms-cosmos-index-utilization\",\n // Version headers and values\n Version: \"x-ms-version\",\n\n // Owner name\n OwnerFullName: \"x-ms-alt-content-path\",\n\n // Owner ID used for name based request in session token.\n OwnerId: \"x-ms-content-path\",\n\n // Partition Key\n PartitionKey: \"x-ms-documentdb-partitionkey\",\n PartitionKeyRangeID: \"x-ms-documentdb-partitionkeyrangeid\",\n\n // Epk Range headers\n StartEpk: \"x-ms-start-epk\",\n EndEpk: \"x-ms-end-epk\",\n\n // Read Feed Type\n ReadFeedKeyType: \"x-ms-read-key-type\",\n\n // Quota Info\n MaxEntityCount: \"x-ms-root-entity-max-count\",\n CurrentEntityCount: \"x-ms-root-entity-current-count\",\n CollectionQuotaInMb: \"x-ms-collection-quota-mb\",\n CollectionCurrentUsageInMb: \"x-ms-collection-usage-mb\",\n MaxMediaStorageUsageInMB: \"x-ms-max-media-storage-usage-mb\",\n CurrentMediaStorageUsageInMB: \"x-ms-media-storage-usage-mb\",\n RequestCharge: \"x-ms-request-charge\",\n PopulateQuotaInfo: \"x-ms-documentdb-populatequotainfo\",\n MaxResourceQuota: \"x-ms-resource-quota\",\n\n // Offer header\n OfferType: \"x-ms-offer-type\",\n OfferThroughput: \"x-ms-offer-throughput\",\n AutoscaleSettings: \"x-ms-cosmos-offer-autopilot-settings\",\n\n // Custom RUs/minute headers\n DisableRUPerMinuteUsage: \"x-ms-documentdb-disable-ru-per-minute-usage\",\n IsRUPerMinuteUsed: \"x-ms-documentdb-is-ru-per-minute-used\",\n OfferIsRUPerMinuteThroughputEnabled: \"x-ms-offer-is-ru-per-minute-throughput-enabled\",\n\n // Index progress headers\n IndexTransformationProgress: \"x-ms-documentdb-collection-index-transformation-progress\",\n LazyIndexingProgress: \"x-ms-documentdb-collection-lazy-indexing-progress\",\n\n // Upsert header\n IsUpsert: \"x-ms-documentdb-is-upsert\",\n\n // Sub status of the error\n SubStatus: \"x-ms-substatus\",\n\n // StoredProcedure related headers\n EnableScriptLogging: \"x-ms-documentdb-script-enable-logging\",\n ScriptLogResults: \"x-ms-documentdb-script-log-results\",\n\n // Multi-Region Write\n ALLOW_MULTIPLE_WRITES: \"x-ms-cosmos-allow-tentative-writes\",\n\n // Bulk/Batch header\n IsBatchRequest: \"x-ms-cosmos-is-batch-request\",\n IsBatchAtomic: \"x-ms-cosmos-batch-atomic\",\n BatchContinueOnError: \"x-ms-cosmos-batch-continue-on-error\",\n\n // Dedicated Gateway Headers\n DedicatedGatewayPerRequestCacheStaleness: \"x-ms-dedicatedgateway-max-age\",\n DedicatedGatewayPerRequestBypassCache: \"x-ms-dedicatedgateway-bypass-cache\",\n\n // Cache Refresh header\n ForceRefresh: \"x-ms-force-refresh\",\n\n // Throughput related headers\n PriorityLevel: \"x-ms-cosmos-priority-level\",\n ThroughputBucket: \"x-ms-cosmos-throughput-bucket\",\n\n // Encryption Headers\n IsClientEncryptedHeader: \"x-ms-cosmos-is-client-encrypted\",\n IntendedCollectionHeader: \"x-ms-cosmos-intended-collection-rid\",\n DatabaseRidHeader: \"x-ms-cosmos-database-rid\",\n AllowCachedReadsHeader: \"x-ms-cosmos-allow-cachedreads\",\n },\n // ThrottledRequests Retry policy default values\n ThrottledRequestMaxRetryAttemptCount: 9,\n ThrottledRequestMaxWaitTimeInSeconds: 30,\n ThrottledRequestFixedRetryIntervalInMs: 0,\n\n // GlobalDB related constants\n WritableLocations: \"writableLocations\",\n ReadableLocations: \"readableLocations\",\n LocationUnavailableExpirationTimeInMs: 5 * 60 * 1000, // 5 minutes\n StalePartitionUnavailabilityRefreshIntervalInMs: 1 * 60 * 1000, // 1 minute\n AllowedPartitionUnavailabilityDurationInMs: 5 * 60 * 1000, // 5 minutes\n ReadRequestFailureCountThreshold: 10,\n WriteRequestFailureCountThreshold: 5,\n ConsecutiveFailureCountResetIntervalInMS: 1000 * 60 * 1, // 1 minute\n\n // ServiceDocument Resource\n ENABLE_MULTIPLE_WRITABLE_LOCATIONS: \"enableMultipleWriteLocations\",\n EnablePerPartitionFailover: \"enablePerPartitionFailoverBehavior\",\n\n // Background refresh time\n DefaultUnavailableLocationExpirationTimeMS: 5 * 60 * 1000,\n\n // Client generated retry count response header\n ThrottleRetryCount: \"x-ms-throttle-retry-count\",\n ThrottleRetryWaitTimeInMs: \"x-ms-throttle-retry-wait-time-ms\",\n\n // Platform\n CurrentVersion: \"2020-07-15\",\n AzureNamespace: \"Azure.Cosmos\",\n AzurePackageName: \"@azure/cosmos\",\n SDKName: \"azure-cosmos-js\",\n SDKVersion: \"4.7.0\",\n\n // Diagnostics\n CosmosDbDiagnosticLevelEnvVarName: \"AZURE_COSMOSDB_DIAGNOSTICS_LEVEL\",\n\n // Bulk Operations\n DefaultMaxBulkRequestBodySizeInBytes: 220201,\n MaxBulkOperationsCount: 100,\n BulkMaxDegreeOfConcurrency: 20,\n\n // Encryption\n Encryption: {\n DiagnosticsDecryptOperation: \"Decrypt\",\n DiagnosticsDuration: \"Duration in milliseconds\",\n DiagnosticsEncryptionDiagnostics: \"EncryptionDiagnostics\",\n DiagnosticsEncryptOperation: \"Encrypt\",\n DiagnosticsPropertiesEncryptedCount: \"Properties Encrypted Count\",\n DiagnosticsPropertiesDecryptedCount: \"Properties Decrypted Count\",\n DiagnosticsStartTime: \"Start time\",\n },\n\n Quota: {\n CollectionSize: \"collectionSize\",\n },\n\n Path: {\n Root: \"/\",\n DatabasesPathSegment: \"dbs\",\n CollectionsPathSegment: \"colls\",\n UsersPathSegment: \"users\",\n DocumentsPathSegment: \"docs\",\n PermissionsPathSegment: \"permissions\",\n StoredProceduresPathSegment: \"sprocs\",\n TriggersPathSegment: \"triggers\",\n UserDefinedFunctionsPathSegment: \"udfs\",\n ConflictsPathSegment: \"conflicts\",\n AttachmentsPathSegment: \"attachments\",\n PartitionKeyRangesPathSegment: \"pkranges\",\n SchemasPathSegment: \"schemas\",\n OffersPathSegment: \"offers\",\n TopologyPathSegment: \"topology\",\n DatabaseAccountPathSegment: \"databaseaccount\",\n },\n\n PartitionKeyRange: {\n // Partition Key Range Constants\n MinInclusive: \"minInclusive\",\n MaxExclusive: \"maxExclusive\",\n Id: \"id\",\n } as PartitionKeyRangePropertiesNames,\n\n QueryRangeConstants: {\n // Partition Key Range Constants\n MinInclusive: \"minInclusive\",\n MaxExclusive: \"maxExclusive\",\n min: \"min\",\n },\n\n /**\n * @deprecated Use EffectivePartitionKeyConstants instead\n */\n EffectiveParitionKeyConstants: {\n MinimumInclusiveEffectivePartitionKey: \"\",\n MaximumExclusiveEffectivePartitionKey: \"FF\",\n },\n\n EffectivePartitionKeyConstants: {\n MinimumInclusiveEffectivePartitionKey: \"\",\n MaximumExclusiveEffectivePartitionKey: \"FF\",\n },\n\n // Changefeed AllVersionsAndDeletesMode formatting version\n AllVersionsAndDeletesChangeFeedWireFormatVersion: \"2021-09-15\",\n ChangeFeedIfNoneMatchStartFromNowHeader: \"*\",\n // Default TTL for encryption caches is 2 hrs (7200 sec)\n DefaultEncryptionCacheTimeToLiveInSeconds: 7200,\n // Timeout to clear encryption related cache\n EncryptionCacheRefreshIntervalInMs: 60000, // 1 minute\n\n RequestTimeoutForReadsInMs: 2000, // 2 seconds\n};\n\nexport const AAD_DEFAULT_SCOPE = \"https://cosmos.azure.com/.default\";\nexport const AAD_AUTH_PREFIX = \"type=aad&ver=1.0&sig=\";\nexport const AAD_RESOURCE_NOT_FOUND_ERROR = \"AADSTS500011\";\n\n/**\n * @hidden\n */\nexport enum ResourceType {\n none = \"\",\n database = \"dbs\",\n offer = \"offers\",\n user = \"users\",\n permission = \"permissions\",\n container = \"colls\",\n conflicts = \"conflicts\",\n sproc = \"sprocs\",\n udf = \"udfs\",\n trigger = \"triggers\",\n item = \"docs\",\n pkranges = \"pkranges\",\n partitionkey = \"partitionKey\",\n /** resource representing client encryption keys to encrypt/decrypt data */\n clientencryptionkey = \"clientencryptionkeys\",\n}\n\n/**\n * @hidden\n */\nexport enum HTTPMethod {\n get = \"GET\",\n patch = \"PATCH\",\n post = \"POST\",\n put = \"PUT\",\n delete = \"DELETE\",\n}\n\n/**\n * @hidden\n */\nexport enum OperationType {\n Create = \"create\",\n Replace = \"replace\",\n Upsert = \"upsert\",\n Delete = \"delete\",\n Read = \"read\",\n Query = \"query\",\n Execute = \"execute\",\n Batch = \"batch\",\n Patch = \"patch\",\n}\n\n/**\n * @hidden\n */\nexport enum CosmosKeyType {\n PrimaryMaster = \"PRIMARY_MASTER\",\n SecondaryMaster = \"SECONDARY_MASTER\",\n PrimaryReadOnly = \"PRIMARY_READONLY\",\n SecondaryReadOnly = \"SECONDARY_READONLY\",\n}\n\n/**\n * @hidden\n */\nexport enum CosmosContainerChildResourceKind {\n Item = \"ITEM\",\n StoredProcedure = \"STORED_PROCEDURE\",\n UserDefinedFunction = \"USER_DEFINED_FUNCTION\",\n Trigger = \"TRIGGER\",\n}\n/**\n * @hidden\n */\nexport enum PermissionScopeValues {\n /**\n * Values which set permission Scope applicable to control plane related operations.\n */\n ScopeAccountReadValue = 0x0001,\n ScopeAccountListDatabasesValue = 0x0002,\n ScopeDatabaseReadValue = 0x0004,\n ScopeDatabaseReadOfferValue = 0x0008,\n ScopeDatabaseListContainerValue = 0x0010,\n ScopeContainerReadValue = 0x0020,\n ScopeContainerReadOfferValue = 0x0040,\n\n ScopeAccountCreateDatabasesValue = 0x0001,\n ScopeAccountDeleteDatabasesValue = 0x0002,\n ScopeDatabaseDeleteValue = 0x0004,\n ScopeDatabaseReplaceOfferValue = 0x0008,\n ScopeDatabaseCreateContainerValue = 0x0010,\n ScopeDatabaseDeleteContainerValue = 0x0020,\n ScopeContainerReplaceValue = 0x0040,\n ScopeContainerDeleteValue = 0x0080,\n ScopeContainerReplaceOfferValue = 0x0100,\n\n ScopeAccountReadAllAccessValue = 0xffff,\n ScopeDatabaseReadAllAccessValue = PermissionScopeValues.ScopeDatabaseReadValue |\n PermissionScopeValues.ScopeDatabaseReadOfferValue |\n PermissionScopeValues.ScopeDatabaseListContainerValue |\n PermissionScopeValues.ScopeContainerReadValue |\n PermissionScopeValues.ScopeContainerReadOfferValue,\n\n ScopeContainersReadAllAccessValue = PermissionScopeValues.ScopeContainerReadValue |\n PermissionScopeValues.ScopeContainerReadOfferValue,\n\n ScopeAccountWriteAllAccessValue = 0xffff,\n ScopeDatabaseWriteAllAccessValue = PermissionScopeValues.ScopeDatabaseDeleteValue |\n PermissionScopeValues.ScopeDatabaseReplaceOfferValue |\n PermissionScopeValues.ScopeDatabaseCreateContainerValue |\n PermissionScopeValues.ScopeDatabaseDeleteContainerValue |\n PermissionScopeValues.ScopeContainerReplaceValue |\n PermissionScopeValues.ScopeContainerDeleteValue |\n PermissionScopeValues.ScopeContainerReplaceOfferValue,\n\n ScopeContainersWriteAllAccessValue = PermissionScopeValues.ScopeContainerReplaceValue |\n PermissionScopeValues.ScopeContainerDeleteValue |\n PermissionScopeValues.ScopeContainerReplaceOfferValue,\n\n /**\n * Values which set permission Scope applicable to data plane related operations.\n */\n ScopeContainerExecuteQueriesValue = 0x00000001,\n ScopeContainerReadFeedsValue = 0x00000002,\n ScopeContainerReadStoredProceduresValue = 0x00000004,\n ScopeContainerReadUserDefinedFunctionsValue = 0x00000008,\n ScopeContainerReadTriggersValue = 0x00000010,\n ScopeContainerReadConflictsValue = 0x00000020,\n ScopeItemReadValue = 0x00000040,\n ScopeStoredProcedureReadValue = 0x00000080,\n ScopeUserDefinedFunctionReadValue = 0x00000100,\n ScopeTriggerReadValue = 0x00000200,\n\n ScopeContainerCreateItemsValue = 0x00000001,\n ScopeContainerReplaceItemsValue = 0x00000002,\n ScopeContainerUpsertItemsValue = 0x00000004,\n ScopeContainerDeleteItemsValue = 0x00000008,\n ScopeContainerCreateStoredProceduresValue = 0x00000010,\n ScopeContainerReplaceStoredProceduresValue = 0x00000020,\n ScopeContainerDeleteStoredProceduresValue = 0x00000040,\n ScopeContainerExecuteStoredProceduresValue = 0x00000080,\n ScopeContainerCreateTriggersValue = 0x00000100,\n ScopeContainerReplaceTriggersValue = 0x00000200,\n ScopeContainerDeleteTriggersValue = 0x00000400,\n ScopeContainerCreateUserDefinedFunctionsValue = 0x00000800,\n ScopeContainerReplaceUserDefinedFunctionsValue = 0x00001000,\n ScopeContainerDeleteUserDefinedFunctionSValue = 0x00002000,\n ScopeContainerDeleteCONFLICTSValue = 0x00004000,\n ScopeItemReplaceValue = 0x00010000,\n ScopeItemUpsertValue = 0x00020000,\n ScopeItemDeleteValue = 0x00040000,\n ScopeStoredProcedureReplaceValue = 0x00100000,\n ScopeStoredProcedureDeleteValue = 0x00200000,\n ScopeStoredProcedureExecuteValue = 0x00400000,\n ScopeUserDefinedFunctionReplaceValue = 0x00800000,\n ScopeUserDefinedFunctionDeleteValue = 0x01000000,\n ScopeTriggerReplaceValue = 0x02000000,\n ScopeTriggerDeleteValue = 0x04000000,\n\n ScopeContainerReadAllAccessValue = 0xffffffff,\n ScopeItemReadAllAccessValue = PermissionScopeValues.ScopeContainerExecuteQueriesValue |\n PermissionScopeValues.ScopeItemReadValue,\n ScopeContainerWriteAllAccessValue = 0xffffffff,\n ScopeItemWriteAllAccessValue = PermissionScopeValues.ScopeContainerCreateItemsValue |\n PermissionScopeValues.ScopeContainerReplaceItemsValue |\n PermissionScopeValues.ScopeContainerUpsertItemsValue |\n PermissionScopeValues.ScopeContainerDeleteItemsValue |\n PermissionScopeValues.ScopeItemReplaceValue |\n PermissionScopeValues.ScopeItemUpsertValue |\n PermissionScopeValues.ScopeItemDeleteValue,\n\n NoneValue = 0,\n}\n/**\n * @hidden\n */\nexport enum SasTokenPermissionKind {\n ContainerCreateItems = PermissionScopeValues.ScopeContainerCreateItemsValue,\n ContainerReplaceItems = PermissionScopeValues.ScopeContainerReplaceItemsValue,\n ContainerUpsertItems = PermissionScopeValues.ScopeContainerUpsertItemsValue,\n ContainerDeleteItems = PermissionScopeValues.ScopeContainerDeleteValue,\n ContainerExecuteQueries = PermissionScopeValues.ScopeContainerExecuteQueriesValue,\n ContainerReadFeeds = PermissionScopeValues.ScopeContainerReadFeedsValue,\n ContainerCreateStoreProcedure = PermissionScopeValues.ScopeContainerCreateStoredProceduresValue,\n ContainerReadStoreProcedure = PermissionScopeValues.ScopeContainerReadStoredProceduresValue,\n ContainerReplaceStoreProcedure = PermissionScopeValues.ScopeContainerReplaceStoredProceduresValue,\n ContainerDeleteStoreProcedure = PermissionScopeValues.ScopeContainerDeleteStoredProceduresValue,\n ContainerCreateTriggers = PermissionScopeValues.ScopeContainerCreateTriggersValue,\n ContainerReadTriggers = PermissionScopeValues.ScopeContainerReadTriggersValue,\n ContainerReplaceTriggers = PermissionScopeValues.ScopeContainerReplaceTriggersValue,\n ContainerDeleteTriggers = PermissionScopeValues.ScopeContainerDeleteTriggersValue,\n ContainerCreateUserDefinedFunctions = PermissionScopeValues.ScopeContainerCreateUserDefinedFunctionsValue,\n ContainerReadUserDefinedFunctions = PermissionScopeValues.ScopeContainerReadUserDefinedFunctionsValue,\n ContainerReplaceUserDefinedFunctions = PermissionScopeValues.ScopeContainerReplaceUserDefinedFunctionsValue,\n ContainerDeleteUserDefinedFunctions = PermissionScopeValues.ScopeContainerDeleteUserDefinedFunctionSValue,\n ContainerExecuteStoredProcedure = PermissionScopeValues.ScopeContainerExecuteStoredProceduresValue,\n ContainerReadConflicts = PermissionScopeValues.ScopeContainerReadConflictsValue,\n ContainerDeleteConflicts = PermissionScopeValues.ScopeContainerDeleteCONFLICTSValue,\n ContainerReadAny = PermissionScopeValues.ScopeContainerReadOfferValue,\n ContainerFullAccess = PermissionScopeValues.ScopeContainerReadAllAccessValue,\n ItemReadAny = PermissionScopeValues.ScopeItemReplaceValue,\n ItemFullAccess = PermissionScopeValues.ScopeItemReadAllAccessValue,\n ItemRead = PermissionScopeValues.ScopeItemReadValue,\n ItemReplace = PermissionScopeValues.ScopeItemReplaceValue,\n ItemUpsert = PermissionScopeValues.ScopeItemUpsertValue,\n ItemDelete = PermissionScopeValues.ScopeItemDeleteValue,\n StoreProcedureRead = PermissionScopeValues.ScopeStoredProcedureReadValue,\n StoreProcedureReplace = PermissionScopeValues.ScopeStoredProcedureReplaceValue,\n StoreProcedureDelete = PermissionScopeValues.ScopeStoredProcedureDeleteValue,\n StoreProcedureExecute = PermissionScopeValues.ScopeStoredProcedureExecuteValue,\n UserDefinedFuntionRead = PermissionScopeValues.ScopeUserDefinedFunctionReadValue,\n UserDefinedFuntionReplace = PermissionScopeValues.ScopeUserDefinedFunctionReplaceValue,\n UserDefinedFuntionDelete = PermissionScopeValues.ScopeUserDefinedFunctionDeleteValue,\n TriggerRead = PermissionScopeValues.ScopeTriggerReadValue,\n TriggerReplace = PermissionScopeValues.ScopeTriggerReplaceValue,\n TriggerDelete = PermissionScopeValues.ScopeTriggerDeleteValue,\n}\n\nexport enum QueryFeature {\n NonValueAggregate = \"NonValueAggregate\",\n Aggregate = \"Aggregate\",\n Distinct = \"Distinct\",\n MultipleOrderBy = \"MultipleOrderBy\",\n OffsetAndLimit = \"OffsetAndLimit\",\n OrderBy = \"OrderBy\",\n Top = \"Top\",\n CompositeAggregate = \"CompositeAggregate\",\n GroupBy = \"GroupBy\",\n MultipleAggregates = \"MultipleAggregates\",\n NonStreamingOrderBy = \"NonStreamingOrderBy\",\n ListAndSetAggregate = \"ListAndSetAggregate\",\n CountIf = \"CountIf\",\n HybridSearch = \"HybridSearch\",\n WeightedRankFusion = \"WeightedRankFusion\",\n HybridSearchSkipOrderByRewrite = \"HybridSearchSkipOrderByRewrite\",\n}\n\nexport enum SDKSupportedCapabilities {\n PartitionMerge = 1,\n}\n\n/**\n * @hidden\n */\nexport enum PartitionAvailablilityStatus {\n Available,\n Unavailable,\n}\n\n/**\n * @hidden\n */\nexport enum UserAgentFeatureFlags {\n PerPartitionAutomaticFailover = 1,\n PerPartitionCircuitBreaker = 2,\n}\n"]}
|
|
@@ -31,12 +31,15 @@ export interface ConnectionPolicy {
|
|
|
31
31
|
* Flag to enable/disable Per Partition Level Failover (PPAF). Defaults to true.
|
|
32
32
|
* Automatically failovers to other available partitions when a partition becomes unavailable.
|
|
33
33
|
* When enabled, enablePartitionLevelCircuitBreaker will also be set to true.
|
|
34
|
-
* Note:
|
|
34
|
+
* Note: Dynamic enablement requires both `enableEndpointDiscovery` and
|
|
35
|
+
* `enableBackgroundEndpointRefreshing` to be `true`. If endpoint discovery
|
|
36
|
+
* is disabled, this setting has no effect.
|
|
35
37
|
*/
|
|
36
38
|
enablePartitionLevelFailover?: boolean;
|
|
37
39
|
/**
|
|
38
|
-
* Flag to enable/disable Per Partition Level Circuit Breaker (PPCB). Defaults to
|
|
39
|
-
* Note: Requires enableEndpointDiscovery to be true
|
|
40
|
+
* Flag to enable/disable Per Partition Level Circuit Breaker (PPCB). Defaults to false.
|
|
41
|
+
* Note: Requires `enableEndpointDiscovery` to be `true`. If endpoint discovery
|
|
42
|
+
* is disabled, this setting has no effect.
|
|
40
43
|
*/
|
|
41
44
|
enablePartitionLevelCircuitBreaker?: boolean;
|
|
42
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionPolicy.d.ts","sourceRoot":"","sources":["../../../src/documents/ConnectionPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gGAAgG;IAChG,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,kGAAkG;IAClG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,2FAA2F;IAC3F,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iGAAiG;IACjG,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;kGAC8F;IAC9F,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C
|
|
1
|
+
{"version":3,"file":"ConnectionPolicy.d.ts","sourceRoot":"","sources":["../../../src/documents/ConnectionPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gGAAgG;IAChG,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,kGAAkG;IAClG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,2FAA2F;IAC3F,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iGAAiG;IACjG,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;kGAC8F;IAC9F,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;;;;OAOG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IAEvC;;;;OAIG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAepC,CAAC"}
|
|
@@ -19,6 +19,6 @@ export const defaultConnectionPolicy = Object.freeze({
|
|
|
19
19
|
endpointRefreshRateInMs: 300000,
|
|
20
20
|
enableBackgroundEndpointRefreshing: true,
|
|
21
21
|
enablePartitionLevelFailover: true,
|
|
22
|
-
enablePartitionLevelCircuitBreaker:
|
|
22
|
+
enablePartitionLevelCircuitBreaker: false,
|
|
23
23
|
});
|
|
24
24
|
//# sourceMappingURL=ConnectionPolicy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionPolicy.js","sourceRoot":"","sources":["../../../src/documents/ConnectionPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConnectionPolicy.js","sourceRoot":"","sources":["../../../src/documents/ConnectionPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA8CrD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAqB,MAAM,CAAC,MAAM,CAAC;IACrE,cAAc,EAAE,cAAc,CAAC,OAAO;IACtC,cAAc,EAAE,KAAK;IACrB,uBAAuB,EAAE,IAAI;IAC7B,kBAAkB,EAAE,EAAE;IACtB,YAAY,EAAE;QACZ,oBAAoB,EAAE,SAAS,CAAC,oCAAoC;QACpE,gCAAgC,EAAE,SAAS,CAAC,sCAAsC;QAClF,oBAAoB,EAAE,SAAS,CAAC,oCAAoC;KACrE;IACD,yBAAyB,EAAE,IAAI;IAC/B,uBAAuB,EAAE,MAAM;IAC/B,kCAAkC,EAAE,IAAI;IACxC,4BAA4B,EAAE,IAAI;IAClC,kCAAkC,EAAE,KAAK;CAC1C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Constants } from \"../common/constants.js\";\nimport type { RetryOptions } from \"../retry/retryOptions.js\";\nimport { ConnectionMode } from \"./ConnectionMode.js\";\n/**\n * Represents the Connection policy associated with a CosmosClient in the Azure Cosmos DB database service.\n */\nexport interface ConnectionPolicy {\n /** Determines which mode to connect to Cosmos with. (Currently only supports Gateway option) */\n connectionMode?: ConnectionMode;\n /** Request timeout (time to wait for response from network peer). Represented in milliseconds. */\n requestTimeout?: number;\n /**\n * Flag to enable/disable automatic redirecting of requests based on read/write operations. Default true.\n * Required to call client.dispose() when this is set to true after destroying the CosmosClient inside another process or in the browser.\n */\n enableEndpointDiscovery?: boolean;\n /** List of azure regions to be used as preferred locations for read requests. */\n preferredLocations?: string[];\n /** RetryOptions object which defines several configurable properties used during retry. */\n retryOptions?: RetryOptions;\n /**\n * The flag that enables writes on any locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service.\n * Default is `true`.\n */\n useMultipleWriteLocations?: boolean;\n /** Rate in milliseconds at which the client will refresh the endpoints list in the background */\n endpointRefreshRateInMs?: number;\n /** Flag to enable/disable background refreshing of endpoints. Defaults to true.\n * Endpoint discovery using `enableEndpointsDiscovery` will still work for failed requests. */\n enableBackgroundEndpointRefreshing?: boolean;\n /**\n * Flag to enable/disable Per Partition Level Failover (PPAF). Defaults to true.\n * Automatically failovers to other available partitions when a partition becomes unavailable.\n * When enabled, enablePartitionLevelCircuitBreaker will also be set to true.\n * Note: Dynamic enablement requires both `enableEndpointDiscovery` and\n * `enableBackgroundEndpointRefreshing` to be `true`. If endpoint discovery\n * is disabled, this setting has no effect.\n */\n enablePartitionLevelFailover?: boolean;\n\n /**\n * Flag to enable/disable Per Partition Level Circuit Breaker (PPCB). Defaults to false.\n * Note: Requires `enableEndpointDiscovery` to be `true`. If endpoint discovery\n * is disabled, this setting has no effect.\n */\n enablePartitionLevelCircuitBreaker?: boolean;\n}\n\n/**\n * @hidden\n */\nexport const defaultConnectionPolicy: ConnectionPolicy = Object.freeze({\n connectionMode: ConnectionMode.Gateway,\n requestTimeout: 60000,\n enableEndpointDiscovery: true,\n preferredLocations: [],\n retryOptions: {\n maxRetryAttemptCount: Constants.ThrottledRequestMaxRetryAttemptCount,\n fixedRetryIntervalInMilliseconds: Constants.ThrottledRequestFixedRetryIntervalInMs,\n maxWaitTimeInSeconds: Constants.ThrottledRequestMaxWaitTimeInSeconds,\n },\n useMultipleWriteLocations: true,\n endpointRefreshRateInMs: 300000,\n enableBackgroundEndpointRefreshing: true,\n enablePartitionLevelFailover: true,\n enablePartitionLevelCircuitBreaker: false,\n});\n"]}
|
|
@@ -77,11 +77,5 @@ export declare class GlobalEndpointManager {
|
|
|
77
77
|
* @param locationName - The location name for the azure region like "East US".
|
|
78
78
|
*/
|
|
79
79
|
private static getLocationalEndpoint;
|
|
80
|
-
/**
|
|
81
|
-
* Refreshes the enablePartitionLevelFailover and enablePartitionLevelCircuitBreaker flag
|
|
82
|
-
* based on the value from database account.
|
|
83
|
-
* @param enablePerPartitionFailover - value from database account
|
|
84
|
-
*/
|
|
85
|
-
private refreshPPAFFeatureFlag;
|
|
86
80
|
}
|
|
87
81
|
//# sourceMappingURL=globalEndpointManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalEndpointManager.d.ts","sourceRoot":"","sources":["../../src/globalEndpointManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,mBAAmB,CAAC;AAE/E,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAMtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAKtF;;;GAGG;AACH,qBAAa,qBAAqB;
|
|
1
|
+
{"version":3,"file":"globalEndpointManager.d.ts","sourceRoot":"","sources":["../../src/globalEndpointManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,MAAM,mBAAmB,CAAC;AAE/E,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAMtE,OAAO,KAAK,EAAE,sB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E,sBAAsB,EACtC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,yBAAyB,GAAE,MAAU,GACpC,OAAO,CAAC,MAAM,CAAC;IAqHlB;;;;;OAKG;IACU,mBAAmB,CAAC,cAAc,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAevF,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,gCAAgC;IAexC;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,4BAA4B;IAQpC;;;;OAIG;YACW,iCAAiC;IAuC/C;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CA0DrC"}
|
|
@@ -33,15 +33,30 @@ export class GlobalEndpointManager {
|
|
|
33
33
|
enableMultipleWriteLocations;
|
|
34
34
|
preferredLocationsCount;
|
|
35
35
|
/**
|
|
36
|
-
* Flag to enable/disable the Per Partition Level Failover (PPAF)
|
|
36
|
+
* Flag to enable/disable the Per Partition Level Failover (PPAF). Contains the value from the Connection policy.
|
|
37
37
|
* @internal
|
|
38
38
|
*/
|
|
39
39
|
enablePartitionLevelFailover;
|
|
40
40
|
/**
|
|
41
|
-
* Flag to enable/disable the Per Partition Level Circuit Breaker (PPCB)
|
|
41
|
+
* Flag to enable/disable the Per Partition Level Circuit Breaker (PPCB). Contains the value from the Connection policy.
|
|
42
42
|
* @internal
|
|
43
43
|
*/
|
|
44
44
|
enablePartitionLevelCircuitBreaker;
|
|
45
|
+
/**
|
|
46
|
+
* Cached PPAF enablement status from the last account refresh
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
lastKnownPPAFEnabled;
|
|
50
|
+
/**
|
|
51
|
+
* Cached circuit breaker timer enablement status
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
lastKnownPPCBEnabled;
|
|
55
|
+
/**
|
|
56
|
+
* Event that is raised when circuit breaker timer should start or stop based on PPAF/PPCB status changes
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
onEnablePartitionLevelFailoverConfigChanged;
|
|
45
60
|
/**
|
|
46
61
|
* @param options - The document client instance.
|
|
47
62
|
* @internal
|
|
@@ -56,8 +71,9 @@ export class GlobalEndpointManager {
|
|
|
56
71
|
this.preferredLocationsCount = this.preferredLocations ? this.preferredLocations.length : 0;
|
|
57
72
|
this.enablePartitionLevelFailover = options.connectionPolicy.enablePartitionLevelFailover;
|
|
58
73
|
this.enablePartitionLevelCircuitBreaker =
|
|
59
|
-
options.connectionPolicy.enablePartitionLevelCircuitBreaker
|
|
60
|
-
|
|
74
|
+
options.connectionPolicy.enablePartitionLevelCircuitBreaker;
|
|
75
|
+
this.lastKnownPPCBEnabled = options.connectionPolicy.enablePartitionLevelCircuitBreaker;
|
|
76
|
+
this.lastKnownPPAFEnabled = false;
|
|
61
77
|
}
|
|
62
78
|
/**
|
|
63
79
|
* Gets the current read endpoint from the endpoint cache.
|
|
@@ -161,7 +177,9 @@ export class GlobalEndpointManager {
|
|
|
161
177
|
this.writeableLocations = resourceResponse.resource.writableLocations;
|
|
162
178
|
this.readableLocations = resourceResponse.resource.readableLocations;
|
|
163
179
|
this.enableMultipleWriteLocations = resourceResponse.resource.enableMultipleWritableLocations;
|
|
164
|
-
this.
|
|
180
|
+
if (this.enablePartitionLevelFailover) {
|
|
181
|
+
this.refreshPPAFFeatureFlag(resourceResponse.resource);
|
|
182
|
+
}
|
|
165
183
|
}
|
|
166
184
|
const locations = isReadRequest(operationType)
|
|
167
185
|
? this.readableLocations
|
|
@@ -210,6 +228,9 @@ export class GlobalEndpointManager {
|
|
|
210
228
|
this.isRefreshing = true;
|
|
211
229
|
const databaseAccount = await this.getDatabaseAccountFromAnyEndpoint(diagnosticNode);
|
|
212
230
|
if (databaseAccount) {
|
|
231
|
+
if (this.enablePartitionLevelFailover) {
|
|
232
|
+
this.refreshPPAFFeatureFlag(databaseAccount);
|
|
233
|
+
}
|
|
213
234
|
this.refreshStaleUnavailableLocations();
|
|
214
235
|
this.refreshEndpoints(databaseAccount);
|
|
215
236
|
}
|
|
@@ -324,16 +345,32 @@ export class GlobalEndpointManager {
|
|
|
324
345
|
return null;
|
|
325
346
|
}
|
|
326
347
|
/**
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
* @
|
|
348
|
+
* Checks for changes in PPAF enablement status and raises events if they have changed.
|
|
349
|
+
* It also manages circuit breaker timer state.
|
|
350
|
+
* @internal
|
|
330
351
|
*/
|
|
331
|
-
refreshPPAFFeatureFlag(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
352
|
+
refreshPPAFFeatureFlag(databaseAccount) {
|
|
353
|
+
let shouldEnableCircuitBreakerTimer = false;
|
|
354
|
+
if (this.enablePartitionLevelCircuitBreaker) {
|
|
355
|
+
// If PPCB is enabled in connection policy, always run circuit breaker
|
|
356
|
+
shouldEnableCircuitBreakerTimer = true;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
// If PPCB is disabled, circuit breaker timer depends on PPAF flags
|
|
360
|
+
if (!this.enablePartitionLevelFailover) {
|
|
361
|
+
// If PPAF is disabled in connection policy, don't run circuit breaker ever.
|
|
362
|
+
shouldEnableCircuitBreakerTimer = false;
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
shouldEnableCircuitBreakerTimer =
|
|
366
|
+
databaseAccount.enablePerPartitionFailover ?? this.lastKnownPPAFEnabled ?? false;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
this.lastKnownPPAFEnabled = databaseAccount.enablePerPartitionFailover;
|
|
370
|
+
// Only trigger callback if the circuit breaker timer state has changed
|
|
371
|
+
if (this.lastKnownPPCBEnabled !== shouldEnableCircuitBreakerTimer) {
|
|
372
|
+
this.lastKnownPPCBEnabled = shouldEnableCircuitBreakerTimer;
|
|
373
|
+
this.onEnablePartitionLevelFailoverConfigChanged?.(shouldEnableCircuitBreakerTimer);
|
|
337
374
|
}
|
|
338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F;QACvF,gCAAgC;QAChC,IAAI,0BAA0B,KAAK,KAAK,EAAE,CAAC;YACzC,IAAI,CAAC,4BAA4B,GAAG,0BAA0B,CAAC;YAC/D,IAAI,CAAC,kCAAkC,GAAG,0BAA0B,CAAC;QACvE,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { OperationType, ResourceType, isReadRequest } from \"./common/index.js\";\nimport type { CosmosClientOptions } from \"./CosmosClientOptions.js\";\nimport type { Location, DatabaseAccount } from \"./documents/index.js\";\nimport type { RequestOptions } from \"./index.js\";\nimport type { ResolveServiceEndpointOptions } from \"./GlobalEndpointManagerOptions.js\";\nimport { Constants } from \"./common/constants.js\";\nimport type { ResourceResponse } from \"./request/index.js\";\nimport { MetadataLookUpType } from \"./CosmosDiagnostics.js\";\nimport type { DiagnosticNodeInternal } from \"./diagnostics/DiagnosticNodeInternal.js\";\nimport { withMetadataDiagnostics } from \"./utils/diagnostics.js\";\nimport { normalizeEndpoint } from \"./utils/checkURL.js\";\nimport { canApplyExcludedLocations } from \"./common/helper.js\";\n\n/**\n * @hidden\n * This internal class implements the logic for endpoint management for geo-replicated database accounts.\n */\nexport class GlobalEndpointManager {\n /**\n * The endpoint used to create the client instance.\n */\n private defaultEndpoint: string;\n /**\n * Flag to enable/disable automatic redirecting of requests based on read/write operations.\n */\n public enableEndpointDiscovery: boolean;\n private isRefreshing: boolean;\n private options: CosmosClientOptions;\n /**\n * List of azure regions to be used as preferred locations for read requests.\n */\n private preferredLocations: string[];\n private writeableLocations: Location[] = [];\n private readableLocations: Location[] = [];\n private unavailableReadableLocations: Location[] = [];\n private unavailableWriteableLocations: Location[] = [];\n private enableMultipleWriteLocations: boolean;\n\n public preferredLocationsCount: number;\n /**\n * Flag to enable/disable the Per Partition Level Failover (PPAF)\n * @internal\n */\n public enablePartitionLevelFailover: boolean;\n /**\n * Flag to enable/disable the Per Partition Level Circuit Breaker (PPCB)\n * @internal\n */\n public enablePartitionLevelCircuitBreaker: boolean;\n\n /**\n * @param options - The document client instance.\n * @internal\n */\n constructor(\n options: CosmosClientOptions,\n private readDatabaseAccount: (\n diagnosticNode: DiagnosticNodeInternal,\n opts: RequestOptions,\n ) => Promise<ResourceResponse<DatabaseAccount>>,\n ) {\n this.options = options;\n this.defaultEndpoint = options.endpoint;\n this.enableEndpointDiscovery = options.connectionPolicy.enableEndpointDiscovery;\n this.isRefreshing = false;\n this.preferredLocations = this.options.connectionPolicy.preferredLocations;\n this.preferredLocationsCount = this.preferredLocations ? this.preferredLocations.length : 0;\n this.enablePartitionLevelFailover = options.connectionPolicy.enablePartitionLevelFailover;\n this.enablePartitionLevelCircuitBreaker =\n options.connectionPolicy.enablePartitionLevelCircuitBreaker ||\n options.connectionPolicy.enablePartitionLevelFailover;\n }\n\n /**\n * Gets the current read endpoint from the endpoint cache.\n */\n public async getReadEndpoint(diagnosticNode: DiagnosticNodeInternal): Promise<string> {\n return this.resolveServiceEndpoint(diagnosticNode, ResourceType.item, OperationType.Read);\n }\n\n /**\n * Gets the current write endpoint from the endpoint cache.\n */\n public async getWriteEndpoint(diagnosticNode: DiagnosticNodeInternal): Promise<string> {\n return this.resolveServiceEndpoint(diagnosticNode, ResourceType.item, OperationType.Replace);\n }\n\n public async getReadEndpoints(): Promise<ReadonlyArray<string>> {\n return this.readableLocations.map((loc) => loc.databaseAccountEndpoint);\n }\n\n public async getWriteEndpoints(): Promise<ReadonlyArray<string>> {\n return this.writeableLocations.map((loc) => loc.databaseAccountEndpoint);\n }\n\n /**\n * Gets the read locations from the endpoint cache.\n */\n public async getReadLocations(): Promise<ReadonlyArray<Location>> {\n return this.readableLocations;\n }\n\n public async markCurrentLocationUnavailableForRead(\n diagnosticNode: DiagnosticNodeInternal,\n endpoint: string,\n ): Promise<void> {\n await this.refreshEndpointList(diagnosticNode);\n const location = this.readableLocations.find((loc) => loc.databaseAccountEndpoint === endpoint);\n if (location) {\n location.unavailable = true;\n location.lastUnavailabilityTimestampInMs = Date.now();\n this.unavailableReadableLocations.push(location);\n }\n }\n\n public async markCurrentLocationUnavailableForWrite(\n diagnosticNode: DiagnosticNodeInternal,\n endpoint: string,\n ): Promise<void> {\n await this.refreshEndpointList(diagnosticNode);\n const location = this.writeableLocations.find(\n (loc) => loc.databaseAccountEndpoint === endpoint,\n );\n if (location) {\n location.unavailable = true;\n location.lastUnavailabilityTimestampInMs = Date.now();\n this.unavailableWriteableLocations.push(location);\n }\n }\n\n public canUseMultipleWriteLocations(\n resourceType?: ResourceType,\n operationType?: OperationType,\n ): boolean {\n let canUse =\n this.options.connectionPolicy.useMultipleWriteLocations && this.enableMultipleWriteLocations;\n\n if (resourceType) {\n canUse =\n canUse &&\n (resourceType === ResourceType.item ||\n (resourceType === ResourceType.sproc && operationType === OperationType.Execute));\n }\n\n return canUse;\n }\n\n private getEffectiveExcludedLocations(\n excludedLocations: string[] = [],\n resourceType: ResourceType,\n ): Set<string> {\n if (!canApplyExcludedLocations(resourceType)) {\n return new Set();\n }\n\n return excludedLocations.length ? new Set(excludedLocations.map(normalizeEndpoint)) : new Set();\n }\n\n private filterExcludedLocations(\n preferredLocations: string[],\n excludedLocations?: Set<string>,\n ): string[] {\n if (!excludedLocations || excludedLocations.size === 0) {\n return preferredLocations;\n }\n const filteredLocations = preferredLocations.filter((location) => {\n return !excludedLocations.has(normalizeEndpoint(location));\n });\n return filteredLocations;\n }\n\n public async resolveServiceEndpoint(\n diagnosticNode: DiagnosticNodeInternal,\n resourceType: ResourceType,\n operationType: OperationType,\n startServiceEndpointIndex: number = 0, // Represents the starting index for selecting servers.\n ): Promise<string> {\n return this.resolveServiceEndpointInternal({\n diagnosticNode: diagnosticNode,\n resourceType: resourceType,\n operationType: operationType,\n startServiceEndpointIndex: startServiceEndpointIndex,\n });\n }\n\n /**\n * @internal\n */\n public async resolveServiceEndpointInternal(\n resolveServiceEndpointOptions: ResolveServiceEndpointOptions,\n ): Promise<string> {\n // Extract all fields from ResolveServiceEndpointOptions\n const {\n diagnosticNode,\n resourceType,\n operationType,\n startServiceEndpointIndex,\n excludedLocations = [],\n } = resolveServiceEndpointOptions;\n\n // If endpoint discovery is disabled, always use the user provided endpoint\n\n if (!this.options.connectionPolicy.enableEndpointDiscovery) {\n diagnosticNode.addData({ readFromCache: true }, \"default_endpoint\");\n diagnosticNode.recordEndpointResolution(this.defaultEndpoint);\n return this.defaultEndpoint;\n }\n\n // If getting the database account, always use the user provided endpoint\n if (resourceType === ResourceType.none) {\n diagnosticNode.addData({ readFromCache: true }, \"none_resource\");\n diagnosticNode.recordEndpointResolution(this.defaultEndpoint);\n return this.defaultEndpoint;\n }\n if (this.readableLocations.length === 0 || this.writeableLocations.length === 0) {\n const resourceResponse = await withMetadataDiagnostics(\n async (metadataNode: DiagnosticNodeInternal) => {\n return this.readDatabaseAccount(metadataNode, {\n urlConnection: this.defaultEndpoint,\n });\n },\n diagnosticNode,\n MetadataLookUpType.DatabaseAccountLookUp,\n );\n\n this.writeableLocations = resourceResponse.resource.writableLocations;\n this.readableLocations = resourceResponse.resource.readableLocations;\n this.enableMultipleWriteLocations = resourceResponse.resource.enableMultipleWritableLocations;\n this.refreshPPAFFeatureFlag(resourceResponse.resource.enablePerPartitionFailover);\n }\n\n const locations = isReadRequest(operationType)\n ? this.readableLocations\n : this.writeableLocations;\n\n const effectiveExcludedLocations = this.getEffectiveExcludedLocations(\n excludedLocations,\n resourceType,\n );\n diagnosticNode.addData(\n { excludedLocations: Array.from(effectiveExcludedLocations) },\n \"excluded_locations\",\n );\n\n // Filter locations based on exclusions\n const availableLocations = this.filterExcludedLocations(\n this.preferredLocations,\n effectiveExcludedLocations,\n );\n\n let location;\n // If we have preferred locations, try each one in order and use the first available one\n if (\n availableLocations &&\n availableLocations.length > 0 &&\n startServiceEndpointIndex < availableLocations.length\n ) {\n this.preferredLocationsCount = availableLocations.length;\n\n for (let i = startServiceEndpointIndex; i < availableLocations.length; i++) {\n const preferredLocation = availableLocations[i];\n location = locations.find(\n (loc) =>\n loc.unavailable !== true &&\n normalizeEndpoint(loc.name) === normalizeEndpoint(preferredLocation),\n );\n if (location) {\n break;\n }\n }\n }\n\n // If no preferred locations or one did not match, just grab the first one that is available\n if (!location) {\n const startIndexValid =\n startServiceEndpointIndex >= 0 && startServiceEndpointIndex < locations.length;\n const locationsToSearch = startIndexValid\n ? locations.slice(startServiceEndpointIndex)\n : locations;\n location = locationsToSearch.find((loc) => {\n return (\n loc.unavailable !== true && !effectiveExcludedLocations.has(normalizeEndpoint(loc.name))\n );\n });\n }\n\n location = location ? location : { name: \"\", databaseAccountEndpoint: this.defaultEndpoint };\n diagnosticNode.recordEndpointResolution(location.databaseAccountEndpoint);\n return location.databaseAccountEndpoint;\n }\n\n /**\n * Refreshes the endpoint list by clearning stale unavailability and then\n * retrieving the writable and readable locations from the geo-replicated database account\n * and then updating the locations cache.\n * We skip the refreshing if enableEndpointDiscovery is set to False\n */\n public async refreshEndpointList(diagnosticNode: DiagnosticNodeInternal): Promise<void> {\n if (!this.isRefreshing && this.enableEndpointDiscovery) {\n this.isRefreshing = true;\n const databaseAccount = await this.getDatabaseAccountFromAnyEndpoint(diagnosticNode);\n if (databaseAccount) {\n this.refreshStaleUnavailableLocations();\n this.refreshEndpoints(databaseAccount);\n }\n this.isRefreshing = false;\n }\n }\n\n private refreshEndpoints(databaseAccount: DatabaseAccount): void {\n const oldWritableLocations = this.writeableLocations;\n const oldReadableLocations = this.readableLocations;\n\n function merge(loc: Location, oldList: Location[]): Location {\n const prev = oldList.find((o) => o.name === loc.name);\n if (prev) {\n loc.unavailable = prev.unavailable;\n loc.lastUnavailabilityTimestampInMs = prev.lastUnavailabilityTimestampInMs;\n }\n return loc;\n }\n\n this.writeableLocations = databaseAccount.writableLocations.map((loc) =>\n merge({ ...loc }, oldWritableLocations),\n );\n this.readableLocations = databaseAccount.readableLocations.map((loc) =>\n merge({ ...loc }, oldReadableLocations),\n );\n }\n\n private refreshStaleUnavailableLocations(): void {\n const now = Date.now();\n this.updateLocation(now, this.unavailableReadableLocations, this.readableLocations);\n this.unavailableReadableLocations = this.cleanUnavailableLocationList(\n now,\n this.unavailableReadableLocations,\n );\n\n this.updateLocation(now, this.unavailableWriteableLocations, this.writeableLocations);\n this.unavailableWriteableLocations = this.cleanUnavailableLocationList(\n now,\n this.unavailableWriteableLocations,\n );\n }\n\n /**\n * update the locationUnavailability to undefined if the location is available again\n * @param now - current time\n * @param unavailableLocations - list of unavailable locations\n * @param allLocations - list of all locations\n */\n private updateLocation(\n now: number,\n unavailableLocations: Location[],\n allLocations: Location[],\n ): void {\n for (const location of unavailableLocations) {\n const unavailableLocation = allLocations.find((loc) => loc.name === location.name);\n if (\n unavailableLocation &&\n now - unavailableLocation.lastUnavailabilityTimestampInMs >\n Constants.LocationUnavailableExpirationTimeInMs\n ) {\n unavailableLocation.unavailable = false;\n }\n }\n }\n\n private cleanUnavailableLocationList(now: number, unavailableLocations: Location[]): Location[] {\n return unavailableLocations.filter((loc) => {\n return (\n now - loc.lastUnavailabilityTimestampInMs < Constants.LocationUnavailableExpirationTimeInMs\n );\n });\n }\n\n /**\n * Gets the database account first by using the default endpoint, and if that doesn't returns\n * use the endpoints for the preferred locations in the order they are specified to get\n * the database account.\n */\n private async getDatabaseAccountFromAnyEndpoint(\n diagnosticNode: DiagnosticNodeInternal,\n ): Promise<DatabaseAccount> {\n try {\n const options = { urlConnection: this.defaultEndpoint };\n const { resource: databaseAccount } = await this.readDatabaseAccount(diagnosticNode, options);\n return databaseAccount;\n // If for any reason(non - globaldb related), we are not able to get the database\n // account from the above call to readDatabaseAccount,\n // we would try to get this information from any of the preferred locations that the user\n // might have specified (by creating a locational endpoint)\n // and keeping eating the exception until we get the database account and return None at the end,\n // if we are not able to get that info from any endpoints\n } catch (err: any) {\n // TODO: Tracing\n }\n\n if (this.preferredLocations) {\n for (const location of this.preferredLocations) {\n try {\n const locationalEndpoint = GlobalEndpointManager.getLocationalEndpoint(\n this.defaultEndpoint,\n location,\n );\n const options = { urlConnection: locationalEndpoint };\n const { resource: databaseAccount } = await this.readDatabaseAccount(\n diagnosticNode,\n options,\n );\n if (databaseAccount) {\n return databaseAccount;\n }\n } catch (err: any) {\n // TODO: Tracing\n }\n }\n }\n }\n\n /**\n * Gets the locational endpoint using the location name passed to it using the default endpoint.\n *\n * @param defaultEndpoint - The default endpoint to use for the endpoint.\n * @param locationName - The location name for the azure region like \"East US\".\n */\n private static getLocationalEndpoint(defaultEndpoint: string, locationName: string): string {\n // For defaultEndpoint like 'https://contoso.documents.azure.com:443/' parse it to generate URL format\n // This defaultEndpoint should be global endpoint(and cannot be a locational endpoint)\n // and we agreed to document that\n const endpointUrl = new URL(defaultEndpoint);\n\n // hostname attribute in endpointUrl will return 'contoso.documents.azure.com'\n if (endpointUrl.hostname) {\n const hostnameParts = endpointUrl.hostname.toString().toLowerCase().split(\".\");\n if (hostnameParts) {\n // globalDatabaseAccountName will return 'contoso'\n const globalDatabaseAccountName = hostnameParts[0];\n\n // Prepare the locationalDatabaseAccountName as contoso-EastUS for location_name 'East US'\n const locationalDatabaseAccountName =\n globalDatabaseAccountName + \"-\" + locationName.replace(\" \", \"\");\n\n // Replace 'contoso' with 'contoso-EastUS' and\n // return locationalEndpoint as https://contoso-EastUS.documents.azure.com:443/\n const locationalEndpoint = defaultEndpoint\n .toLowerCase()\n .replace(globalDatabaseAccountName, locationalDatabaseAccountName);\n return locationalEndpoint;\n }\n }\n\n return null;\n }\n\n /**\n * Refreshes the enablePartitionLevelFailover and enablePartitionLevelCircuitBreaker flag\n * based on the value from database account.\n * @param enablePerPartitionFailover - value from database account\n */\n private refreshPPAFFeatureFlag(enablePerPartitionFailover: boolean): void {\n // If the enablePartitionLevelFailover is true, but PPAF is not enabled on the account,\n // we will override it to false.\n if (enablePerPartitionFailover === false) {\n this.enablePartitionLevelFailover = enablePerPartitionFailover;\n this.enablePartitionLevelCircuitBreaker = enablePerPartitionFailover;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"globalEndpointManager.js","source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/E,MAAM,kBAAkB,GAAG,eAAe;qBACvC,WAAW,EAAE;qBACb,OAAO,CAAC,yBAAyB,EAAE,6BAA6B,CAAC,CAAC;gBACrE,OAAO,kBAAkB,CAAC;YAC5B,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACK,sBAAsB,CAAC,eAAgC;QAC7D,IAAI,+BAA+B,GAAG,KAAK,CAAC;QAC5C,IAAI,IAAI,CAAC,kCAAkC,EAAE,CAAC;YAC5C,sEAAsE;YACtE,+BAA+B,GAAG,IAAI,CAAC;QACzC,CAAC;aAAM,CAAC;YACN,mEAAmE;YACnE,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,CAAC;gBACvC,4EAA4E;gBAC5E,+BAA+B,GAAG,KAAK,CAAC;YAC1C,CAAC;iBAAM,CAAC;gBACN,+BAA+B;oBAC7B,eAAe,CAAC,0BAA0B,IAAI,IAAI,CAAC,oBAAoB,IAAI,KAAK,CAAC;YACrF,CAAC;QACH,CAAC;QAED,IAAI,CAAC,oBAAoB,GAAG,eAAe,CAAC,0BAA0B,CAAC;QAEvE,uEAAuE;QACvE,IAAI,IAAI,CAAC,oBAAoB,KAAK,+BAA+B,EAAE,CAAC;YAClE,IAAI,CAAC,oBAAoB,GAAG,+BAA+B,CAAC;YAC5D,IAAI,CAAC,2CAA2C,EAAE,CAAC,+BAA+B,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { OperationType, ResourceType, isReadRequest } from \"./common/index.js\";\nimport type { CosmosClientOptions } from \"./CosmosClientOptions.js\";\nimport type { Location, DatabaseAccount } from \"./documents/index.js\";\nimport type { RequestOptions } from \"./index.js\";\nimport type { ResolveServiceEndpointOptions } from \"./GlobalEndpointManagerOptions.js\";\nimport { Constants } from \"./common/constants.js\";\nimport type { ResourceResponse } from \"./request/index.js\";\nimport { MetadataLookUpType } from \"./CosmosDiagnostics.js\";\nimport type { DiagnosticNodeInternal } from \"./diagnostics/DiagnosticNodeInternal.js\";\nimport { withMetadataDiagnostics } from \"./utils/diagnostics.js\";\nimport { normalizeEndpoint } from \"./utils/checkURL.js\";\nimport { canApplyExcludedLocations } from \"./common/helper.js\";\n\n/**\n * @hidden\n * This internal class implements the logic for endpoint management for geo-replicated database accounts.\n */\nexport class GlobalEndpointManager {\n /**\n * The endpoint used to create the client instance.\n */\n private defaultEndpoint: string;\n /**\n * Flag to enable/disable automatic redirecting of requests based on read/write operations.\n */\n public enableEndpointDiscovery: boolean;\n private isRefreshing: boolean;\n private options: CosmosClientOptions;\n /**\n * List of azure regions to be used as preferred locations for read requests.\n */\n private preferredLocations: string[];\n private writeableLocations: Location[] = [];\n private readableLocations: Location[] = [];\n private unavailableReadableLocations: Location[] = [];\n private unavailableWriteableLocations: Location[] = [];\n private enableMultipleWriteLocations: boolean;\n\n public preferredLocationsCount: number;\n /**\n * Flag to enable/disable the Per Partition Level Failover (PPAF). Contains the value from the Connection policy.\n * @internal\n */\n private enablePartitionLevelFailover: boolean;\n /**\n * Flag to enable/disable the Per Partition Level Circuit Breaker (PPCB). Contains the value from the Connection policy.\n * @internal\n */\n private enablePartitionLevelCircuitBreaker: boolean;\n /**\n * Cached PPAF enablement status from the last account refresh\n * @internal\n */\n public lastKnownPPAFEnabled: boolean;\n /**\n * Cached circuit breaker timer enablement status\n * @internal\n */\n public lastKnownPPCBEnabled: boolean;\n /**\n * Event that is raised when circuit breaker timer should start or stop based on PPAF/PPCB status changes\n * @internal\n */\n public onEnablePartitionLevelFailoverConfigChanged?: (isEnabled: boolean) => void;\n\n /**\n * @param options - The document client instance.\n * @internal\n */\n constructor(\n options: CosmosClientOptions,\n private readDatabaseAccount: (\n diagnosticNode: DiagnosticNodeInternal,\n opts: RequestOptions,\n ) => Promise<ResourceResponse<DatabaseAccount>>,\n ) {\n this.options = options;\n this.defaultEndpoint = options.endpoint;\n this.enableEndpointDiscovery = options.connectionPolicy.enableEndpointDiscovery;\n this.isRefreshing = false;\n this.preferredLocations = this.options.connectionPolicy.preferredLocations;\n this.preferredLocationsCount = this.preferredLocations ? this.preferredLocations.length : 0;\n this.enablePartitionLevelFailover = options.connectionPolicy.enablePartitionLevelFailover;\n this.enablePartitionLevelCircuitBreaker =\n options.connectionPolicy.enablePartitionLevelCircuitBreaker;\n this.lastKnownPPCBEnabled = options.connectionPolicy.enablePartitionLevelCircuitBreaker;\n this.lastKnownPPAFEnabled = false;\n }\n\n /**\n * Gets the current read endpoint from the endpoint cache.\n */\n public async getReadEndpoint(diagnosticNode: DiagnosticNodeInternal): Promise<string> {\n return this.resolveServiceEndpoint(diagnosticNode, ResourceType.item, OperationType.Read);\n }\n\n /**\n * Gets the current write endpoint from the endpoint cache.\n */\n public async getWriteEndpoint(diagnosticNode: DiagnosticNodeInternal): Promise<string> {\n return this.resolveServiceEndpoint(diagnosticNode, ResourceType.item, OperationType.Replace);\n }\n\n public async getReadEndpoints(): Promise<ReadonlyArray<string>> {\n return this.readableLocations.map((loc) => loc.databaseAccountEndpoint);\n }\n\n public async getWriteEndpoints(): Promise<ReadonlyArray<string>> {\n return this.writeableLocations.map((loc) => loc.databaseAccountEndpoint);\n }\n\n /**\n * Gets the read locations from the endpoint cache.\n */\n public async getReadLocations(): Promise<ReadonlyArray<Location>> {\n return this.readableLocations;\n }\n\n public async markCurrentLocationUnavailableForRead(\n diagnosticNode: DiagnosticNodeInternal,\n endpoint: string,\n ): Promise<void> {\n await this.refreshEndpointList(diagnosticNode);\n const location = this.readableLocations.find((loc) => loc.databaseAccountEndpoint === endpoint);\n if (location) {\n location.unavailable = true;\n location.lastUnavailabilityTimestampInMs = Date.now();\n this.unavailableReadableLocations.push(location);\n }\n }\n\n public async markCurrentLocationUnavailableForWrite(\n diagnosticNode: DiagnosticNodeInternal,\n endpoint: string,\n ): Promise<void> {\n await this.refreshEndpointList(diagnosticNode);\n const location = this.writeableLocations.find(\n (loc) => loc.databaseAccountEndpoint === endpoint,\n );\n if (location) {\n location.unavailable = true;\n location.lastUnavailabilityTimestampInMs = Date.now();\n this.unavailableWriteableLocations.push(location);\n }\n }\n\n public canUseMultipleWriteLocations(\n resourceType?: ResourceType,\n operationType?: OperationType,\n ): boolean {\n let canUse =\n this.options.connectionPolicy.useMultipleWriteLocations && this.enableMultipleWriteLocations;\n\n if (resourceType) {\n canUse =\n canUse &&\n (resourceType === ResourceType.item ||\n (resourceType === ResourceType.sproc && operationType === OperationType.Execute));\n }\n\n return canUse;\n }\n\n private getEffectiveExcludedLocations(\n excludedLocations: string[] = [],\n resourceType: ResourceType,\n ): Set<string> {\n if (!canApplyExcludedLocations(resourceType)) {\n return new Set();\n }\n\n return excludedLocations.length ? new Set(excludedLocations.map(normalizeEndpoint)) : new Set();\n }\n\n private filterExcludedLocations(\n preferredLocations: string[],\n excludedLocations?: Set<string>,\n ): string[] {\n if (!excludedLocations || excludedLocations.size === 0) {\n return preferredLocations;\n }\n const filteredLocations = preferredLocations.filter((location) => {\n return !excludedLocations.has(normalizeEndpoint(location));\n });\n return filteredLocations;\n }\n\n public async resolveServiceEndpoint(\n diagnosticNode: DiagnosticNodeInternal,\n resourceType: ResourceType,\n operationType: OperationType,\n startServiceEndpointIndex: number = 0, // Represents the starting index for selecting servers.\n ): Promise<string> {\n return this.resolveServiceEndpointInternal({\n diagnosticNode: diagnosticNode,\n resourceType: resourceType,\n operationType: operationType,\n startServiceEndpointIndex: startServiceEndpointIndex,\n });\n }\n\n /**\n * @internal\n */\n public async resolveServiceEndpointInternal(\n resolveServiceEndpointOptions: ResolveServiceEndpointOptions,\n ): Promise<string> {\n // Extract all fields from ResolveServiceEndpointOptions\n const {\n diagnosticNode,\n resourceType,\n operationType,\n startServiceEndpointIndex,\n excludedLocations = [],\n } = resolveServiceEndpointOptions;\n\n // If endpoint discovery is disabled, always use the user provided endpoint\n\n if (!this.options.connectionPolicy.enableEndpointDiscovery) {\n diagnosticNode.addData({ readFromCache: true }, \"default_endpoint\");\n diagnosticNode.recordEndpointResolution(this.defaultEndpoint);\n return this.defaultEndpoint;\n }\n\n // If getting the database account, always use the user provided endpoint\n if (resourceType === ResourceType.none) {\n diagnosticNode.addData({ readFromCache: true }, \"none_resource\");\n diagnosticNode.recordEndpointResolution(this.defaultEndpoint);\n return this.defaultEndpoint;\n }\n if (this.readableLocations.length === 0 || this.writeableLocations.length === 0) {\n const resourceResponse = await withMetadataDiagnostics(\n async (metadataNode: DiagnosticNodeInternal) => {\n return this.readDatabaseAccount(metadataNode, {\n urlConnection: this.defaultEndpoint,\n });\n },\n diagnosticNode,\n MetadataLookUpType.DatabaseAccountLookUp,\n );\n\n this.writeableLocations = resourceResponse.resource.writableLocations;\n this.readableLocations = resourceResponse.resource.readableLocations;\n this.enableMultipleWriteLocations = resourceResponse.resource.enableMultipleWritableLocations;\n if (this.enablePartitionLevelFailover) {\n this.refreshPPAFFeatureFlag(resourceResponse.resource);\n }\n }\n\n const locations = isReadRequest(operationType)\n ? this.readableLocations\n : this.writeableLocations;\n\n const effectiveExcludedLocations = this.getEffectiveExcludedLocations(\n excludedLocations,\n resourceType,\n );\n diagnosticNode.addData(\n { excludedLocations: Array.from(effectiveExcludedLocations) },\n \"excluded_locations\",\n );\n\n // Filter locations based on exclusions\n const availableLocations = this.filterExcludedLocations(\n this.preferredLocations,\n effectiveExcludedLocations,\n );\n\n let location;\n // If we have preferred locations, try each one in order and use the first available one\n if (\n availableLocations &&\n availableLocations.length > 0 &&\n startServiceEndpointIndex < availableLocations.length\n ) {\n this.preferredLocationsCount = availableLocations.length;\n\n for (let i = startServiceEndpointIndex; i < availableLocations.length; i++) {\n const preferredLocation = availableLocations[i];\n location = locations.find(\n (loc) =>\n loc.unavailable !== true &&\n normalizeEndpoint(loc.name) === normalizeEndpoint(preferredLocation),\n );\n if (location) {\n break;\n }\n }\n }\n\n // If no preferred locations or one did not match, just grab the first one that is available\n if (!location) {\n const startIndexValid =\n startServiceEndpointIndex >= 0 && startServiceEndpointIndex < locations.length;\n const locationsToSearch = startIndexValid\n ? locations.slice(startServiceEndpointIndex)\n : locations;\n location = locationsToSearch.find((loc) => {\n return (\n loc.unavailable !== true && !effectiveExcludedLocations.has(normalizeEndpoint(loc.name))\n );\n });\n }\n\n location = location ? location : { name: \"\", databaseAccountEndpoint: this.defaultEndpoint };\n diagnosticNode.recordEndpointResolution(location.databaseAccountEndpoint);\n return location.databaseAccountEndpoint;\n }\n\n /**\n * Refreshes the endpoint list by clearning stale unavailability and then\n * retrieving the writable and readable locations from the geo-replicated database account\n * and then updating the locations cache.\n * We skip the refreshing if enableEndpointDiscovery is set to False\n */\n public async refreshEndpointList(diagnosticNode: DiagnosticNodeInternal): Promise<void> {\n if (!this.isRefreshing && this.enableEndpointDiscovery) {\n this.isRefreshing = true;\n const databaseAccount = await this.getDatabaseAccountFromAnyEndpoint(diagnosticNode);\n if (databaseAccount) {\n if (this.enablePartitionLevelFailover) {\n this.refreshPPAFFeatureFlag(databaseAccount);\n }\n this.refreshStaleUnavailableLocations();\n this.refreshEndpoints(databaseAccount);\n }\n this.isRefreshing = false;\n }\n }\n\n private refreshEndpoints(databaseAccount: DatabaseAccount): void {\n const oldWritableLocations = this.writeableLocations;\n const oldReadableLocations = this.readableLocations;\n\n function merge(loc: Location, oldList: Location[]): Location {\n const prev = oldList.find((o) => o.name === loc.name);\n if (prev) {\n loc.unavailable = prev.unavailable;\n loc.lastUnavailabilityTimestampInMs = prev.lastUnavailabilityTimestampInMs;\n }\n return loc;\n }\n\n this.writeableLocations = databaseAccount.writableLocations.map((loc) =>\n merge({ ...loc }, oldWritableLocations),\n );\n this.readableLocations = databaseAccount.readableLocations.map((loc) =>\n merge({ ...loc }, oldReadableLocations),\n );\n }\n\n private refreshStaleUnavailableLocations(): void {\n const now = Date.now();\n this.updateLocation(now, this.unavailableReadableLocations, this.readableLocations);\n this.unavailableReadableLocations = this.cleanUnavailableLocationList(\n now,\n this.unavailableReadableLocations,\n );\n\n this.updateLocation(now, this.unavailableWriteableLocations, this.writeableLocations);\n this.unavailableWriteableLocations = this.cleanUnavailableLocationList(\n now,\n this.unavailableWriteableLocations,\n );\n }\n\n /**\n * update the locationUnavailability to undefined if the location is available again\n * @param now - current time\n * @param unavailableLocations - list of unavailable locations\n * @param allLocations - list of all locations\n */\n private updateLocation(\n now: number,\n unavailableLocations: Location[],\n allLocations: Location[],\n ): void {\n for (const location of unavailableLocations) {\n const unavailableLocation = allLocations.find((loc) => loc.name === location.name);\n if (\n unavailableLocation &&\n now - unavailableLocation.lastUnavailabilityTimestampInMs >\n Constants.LocationUnavailableExpirationTimeInMs\n ) {\n unavailableLocation.unavailable = false;\n }\n }\n }\n\n private cleanUnavailableLocationList(now: number, unavailableLocations: Location[]): Location[] {\n return unavailableLocations.filter((loc) => {\n return (\n now - loc.lastUnavailabilityTimestampInMs < Constants.LocationUnavailableExpirationTimeInMs\n );\n });\n }\n\n /**\n * Gets the database account first by using the default endpoint, and if that doesn't returns\n * use the endpoints for the preferred locations in the order they are specified to get\n * the database account.\n */\n private async getDatabaseAccountFromAnyEndpoint(\n diagnosticNode: DiagnosticNodeInternal,\n ): Promise<DatabaseAccount> {\n try {\n const options = { urlConnection: this.defaultEndpoint };\n const { resource: databaseAccount } = await this.readDatabaseAccount(diagnosticNode, options);\n return databaseAccount;\n // If for any reason(non - globaldb related), we are not able to get the database\n // account from the above call to readDatabaseAccount,\n // we would try to get this information from any of the preferred locations that the user\n // might have specified (by creating a locational endpoint)\n // and keeping eating the exception until we get the database account and return None at the end,\n // if we are not able to get that info from any endpoints\n } catch (err: any) {\n // TODO: Tracing\n }\n\n if (this.preferredLocations) {\n for (const location of this.preferredLocations) {\n try {\n const locationalEndpoint = GlobalEndpointManager.getLocationalEndpoint(\n this.defaultEndpoint,\n location,\n );\n const options = { urlConnection: locationalEndpoint };\n const { resource: databaseAccount } = await this.readDatabaseAccount(\n diagnosticNode,\n options,\n );\n if (databaseAccount) {\n return databaseAccount;\n }\n } catch (err: any) {\n // TODO: Tracing\n }\n }\n }\n }\n\n /**\n * Gets the locational endpoint using the location name passed to it using the default endpoint.\n *\n * @param defaultEndpoint - The default endpoint to use for the endpoint.\n * @param locationName - The location name for the azure region like \"East US\".\n */\n private static getLocationalEndpoint(defaultEndpoint: string, locationName: string): string {\n // For defaultEndpoint like 'https://contoso.documents.azure.com:443/' parse it to generate URL format\n // This defaultEndpoint should be global endpoint(and cannot be a locational endpoint)\n // and we agreed to document that\n const endpointUrl = new URL(defaultEndpoint);\n\n // hostname attribute in endpointUrl will return 'contoso.documents.azure.com'\n if (endpointUrl.hostname) {\n const hostnameParts = endpointUrl.hostname.toString().toLowerCase().split(\".\");\n if (hostnameParts) {\n // globalDatabaseAccountName will return 'contoso'\n const globalDatabaseAccountName = hostnameParts[0];\n\n // Prepare the locationalDatabaseAccountName as contoso-EastUS for location_name 'East US'\n const locationalDatabaseAccountName =\n globalDatabaseAccountName + \"-\" + locationName.replace(\" \", \"\");\n\n // Replace 'contoso' with 'contoso-EastUS' and\n // return locationalEndpoint as https://contoso-EastUS.documents.azure.com:443/\n const locationalEndpoint = defaultEndpoint\n .toLowerCase()\n .replace(globalDatabaseAccountName, locationalDatabaseAccountName);\n return locationalEndpoint;\n }\n }\n\n return null;\n }\n\n /**\n * Checks for changes in PPAF enablement status and raises events if they have changed.\n * It also manages circuit breaker timer state.\n * @internal\n */\n private refreshPPAFFeatureFlag(databaseAccount: DatabaseAccount): void {\n let shouldEnableCircuitBreakerTimer = false;\n if (this.enablePartitionLevelCircuitBreaker) {\n // If PPCB is enabled in connection policy, always run circuit breaker\n shouldEnableCircuitBreakerTimer = true;\n } else {\n // If PPCB is disabled, circuit breaker timer depends on PPAF flags\n if (!this.enablePartitionLevelFailover) {\n // If PPAF is disabled in connection policy, don't run circuit breaker ever.\n shouldEnableCircuitBreakerTimer = false;\n } else {\n shouldEnableCircuitBreakerTimer =\n databaseAccount.enablePerPartitionFailover ?? this.lastKnownPPAFEnabled ?? false;\n }\n }\n\n this.lastKnownPPAFEnabled = databaseAccount.enablePerPartitionFailover;\n\n // Only trigger callback if the circuit breaker timer state has changed\n if (this.lastKnownPPCBEnabled !== shouldEnableCircuitBreakerTimer) {\n this.lastKnownPPCBEnabled = shouldEnableCircuitBreakerTimer;\n this.onEnablePartitionLevelFailoverConfigChanged?.(shouldEnableCircuitBreakerTimer);\n }\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ export declare class GlobalPartitionEndpointManager {
|
|
|
9
9
|
private readonly partitionKeyRangeToLocationForReadAndWrite;
|
|
10
10
|
private preferredLocations;
|
|
11
11
|
preferredLocationsCount: number;
|
|
12
|
-
private circuitBreakerFailbackBackgroundRefresher
|
|
12
|
+
private circuitBreakerFailbackBackgroundRefresher?;
|
|
13
13
|
/**
|
|
14
14
|
* Checks eligibility of the request for partition failover and
|
|
15
15
|
* tries to mark the endpoint unavailable for the partition key range. Future
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalPartitionEndpointManager.d.ts","sourceRoot":"","sources":["../../src/globalPartitionEndpointManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,sBAAsB,EAGtB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAMpB;;;GAGG;AACH,qBAAa,8BAA8B;IAevC,OAAO,CAAC,qBAAqB;IAd/B,OAAO,CAAC,QAAQ,CAAC,mCAAmC,CAA6C;IACjG,OAAO,CAAC,QAAQ,CAAC,0CAA0C,CAGzD;IACF,OAAO,CAAC,kBAAkB,CAAW;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IACvC,OAAO,CAAC,yCAAyC,CAAiB;
|
|
1
|
+
{"version":3,"file":"globalPartitionEndpointManager.d.ts","sourceRoot":"","sources":["../../src/globalPartitionEndpointManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,sBAAsB,EAGtB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAMpB;;;GAGG;AACH,qBAAa,8BAA8B;IAevC,OAAO,CAAC,qBAAqB;IAd/B,OAAO,CAAC,QAAQ,CAAC,mCAAmC,CAA6C;IACjG,OAAO,CAAC,QAAQ,CAAC,0CAA0C,CAGzD;IACF,OAAO,CAAC,kBAAkB,CAAW;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IACvC,OAAO,CAAC,yCAAyC,CAAC,CAAiB;IAqBnE;;;;OAIG;IACU,yBAAyB,CACpC,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,sBAAsB,GACrC,OAAO,CAAC,OAAO,CAAC;IA6BnB;;;OAGG;IACU,oCAAoC,CAC/C,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,sBAAsB,GACrC,OAAO,CAAC,cAAc,CAAC;IAiC1B;;;OAGG;IACI,OAAO,IAAI,IAAI;YAOR,8CAA8C;IA2D5D;;;OAGG;YACW,uCAAuC;IA6CrD,yEAAyE;YAC3D,qCAAqC;IA2BnD,0FAA0F;YAC5E,qCAAqC;IAmBnD;;;;OAIG;IACH,OAAO,CAAC,iDAAiD;IAazD;;;;OAIG;IACH,OAAO,CAAC,gDAAgD;IAgBxD;;;;;;OAMG;YACW,wDAAwD;IA8BtE;;;;;;;;OAQG;IACH,OAAO,CAAC,kCAAkC;IAU1C;;;;;OAKG;YACW,8CAA8C;CAqD7D"}
|
|
@@ -26,8 +26,7 @@ export class GlobalPartitionEndpointManager {
|
|
|
26
26
|
this.partitionKeyRangeToLocationForReadAndWrite = new Map();
|
|
27
27
|
this.preferredLocations = options.connectionPolicy.preferredLocations;
|
|
28
28
|
this.preferredLocationsCount = this.preferredLocations ? this.preferredLocations.length : 0;
|
|
29
|
-
if (this.globalEndpointManager.
|
|
30
|
-
this.globalEndpointManager.enablePartitionLevelFailover) {
|
|
29
|
+
if (this.globalEndpointManager.lastKnownPPCBEnabled) {
|
|
31
30
|
this.initiateCircuitBreakerFailbackLoop();
|
|
32
31
|
}
|
|
33
32
|
}
|
|
@@ -86,6 +85,7 @@ export class GlobalPartitionEndpointManager {
|
|
|
86
85
|
dispose() {
|
|
87
86
|
if (this.circuitBreakerFailbackBackgroundRefresher) {
|
|
88
87
|
clearTimeout(this.circuitBreakerFailbackBackgroundRefresher);
|
|
88
|
+
this.circuitBreakerFailbackBackgroundRefresher = undefined;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
async tryMarkEndpointUnavailableForPartitionKeyRange(requestContext, diagnosticNode, isRequestEligibleForPerPartitionAutomaticFailover, isRequestEligibleForPartitionLevelCircuitBreaker) {
|
|
@@ -197,7 +197,7 @@ export class GlobalPartitionEndpointManager {
|
|
|
197
197
|
* and the global endpoint manager cannot use multiple write locations for the request.
|
|
198
198
|
*/
|
|
199
199
|
isRequestEligibleForPerPartitionAutomaticFailover(requestContext) {
|
|
200
|
-
return (this.
|
|
200
|
+
return (this.isPartitionLevelAutomaticFailoverEnabled() &&
|
|
201
201
|
!isReadRequest(requestContext.operationType) &&
|
|
202
202
|
!this.globalEndpointManager.canUseMultipleWriteLocations(requestContext.resourceType, requestContext.operationType));
|
|
203
203
|
}
|
|
@@ -207,8 +207,7 @@ export class GlobalPartitionEndpointManager {
|
|
|
207
207
|
* the global endpoint manager can use multiple write locations for the request.
|
|
208
208
|
*/
|
|
209
209
|
isRequestEligibleForPartitionLevelCircuitBreaker(requestContext) {
|
|
210
|
-
const enablePartitionLevelCircuitBreaker = this.
|
|
211
|
-
this.globalEndpointManager.enablePartitionLevelFailover;
|
|
210
|
+
const enablePartitionLevelCircuitBreaker = this.isPartitionLevelCircuitBreakerEnabled();
|
|
212
211
|
if (!enablePartitionLevelCircuitBreaker) {
|
|
213
212
|
return false;
|
|
214
213
|
}
|
|
@@ -266,12 +265,6 @@ export class GlobalPartitionEndpointManager {
|
|
|
266
265
|
*/
|
|
267
266
|
async openConnectionToUnhealthyEndpointsWithFailback() {
|
|
268
267
|
// If partition level circuit breaker or failover is not enabled, dispose the timer.
|
|
269
|
-
const enablePartitionLevelCircuitBreaker = this.globalEndpointManager.enablePartitionLevelCircuitBreaker ||
|
|
270
|
-
this.globalEndpointManager.enablePartitionLevelFailover;
|
|
271
|
-
if (!enablePartitionLevelCircuitBreaker) {
|
|
272
|
-
this.dispose();
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
268
|
for (const pkRange of this.partitionKeyRangeToLocationForReadAndWrite.keys()) {
|
|
276
269
|
const partitionFailover = this.partitionKeyRangeToLocationForReadAndWrite.get(pkRange);
|
|
277
270
|
if (!partitionFailover)
|
|
@@ -286,5 +279,37 @@ export class GlobalPartitionEndpointManager {
|
|
|
286
279
|
}
|
|
287
280
|
}
|
|
288
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* @internal
|
|
284
|
+
*/
|
|
285
|
+
changeCircuitBreakerFailbackLoop(isEnabled) {
|
|
286
|
+
// Start or stop the circuit breaker failback loop based on PPAF/PPCB status
|
|
287
|
+
if (isEnabled) {
|
|
288
|
+
// Only start if not already running to prevent duplicate timers
|
|
289
|
+
if (!this.circuitBreakerFailbackBackgroundRefresher) {
|
|
290
|
+
this.initiateCircuitBreakerFailbackLoop();
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
// Only dispose if currently running
|
|
295
|
+
if (this.circuitBreakerFailbackBackgroundRefresher) {
|
|
296
|
+
this.dispose();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Gets a value indicating whether per-partition automatic failover is currently enabled.
|
|
302
|
+
* @internal
|
|
303
|
+
*/
|
|
304
|
+
isPartitionLevelAutomaticFailoverEnabled() {
|
|
305
|
+
return this.globalEndpointManager.lastKnownPPAFEnabled;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Gets a value indicating whether per-partition automatic failover is currently enabled.
|
|
309
|
+
* @internal
|
|
310
|
+
*/
|
|
311
|
+
isPartitionLevelCircuitBreakerEnabled() {
|
|
312
|
+
return this.globalEndpointManager.lastKnownPPCBEnabled;
|
|
313
|
+
}
|
|
289
314
|
}
|
|
290
315
|
//# sourceMappingURL=globalPartitionEndpointManager.js.map
|