@azure/cosmos 4.5.0-alpha.20250829.1 → 4.5.1
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/common/constants.js +1 -1
- package/dist/browser/common/constants.js.map +1 -1
- package/dist/browser/globalEndpointManager.d.ts.map +1 -1
- package/dist/browser/globalEndpointManager.js +15 -19
- package/dist/browser/globalEndpointManager.js.map +1 -1
- package/dist/browser/retry/defaultRetryPolicy.d.ts.map +1 -1
- package/dist/browser/retry/defaultRetryPolicy.js +3 -4
- package/dist/browser/retry/defaultRetryPolicy.js.map +1 -1
- package/dist/browser/retry/endpointDiscoveryRetryPolicy.d.ts +3 -2
- package/dist/browser/retry/endpointDiscoveryRetryPolicy.d.ts.map +1 -1
- package/dist/browser/retry/endpointDiscoveryRetryPolicy.js +13 -5
- package/dist/browser/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
- package/dist/browser/retry/retryUtility.d.ts.map +1 -1
- package/dist/browser/retry/retryUtility.js +3 -2
- package/dist/browser/retry/retryUtility.js.map +1 -1
- package/dist/commonjs/common/constants.js +1 -1
- package/dist/commonjs/common/constants.js.map +1 -1
- package/dist/commonjs/globalEndpointManager.d.ts.map +1 -1
- package/dist/commonjs/globalEndpointManager.js +15 -19
- package/dist/commonjs/globalEndpointManager.js.map +1 -1
- package/dist/commonjs/retry/defaultRetryPolicy.d.ts.map +1 -1
- package/dist/commonjs/retry/defaultRetryPolicy.js +2 -3
- package/dist/commonjs/retry/defaultRetryPolicy.js.map +1 -1
- package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.d.ts +3 -2
- package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.d.ts.map +1 -1
- package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.js +13 -5
- package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
- package/dist/commonjs/retry/retryUtility.d.ts.map +1 -1
- package/dist/commonjs/retry/retryUtility.js +3 -2
- package/dist/commonjs/retry/retryUtility.js.map +1 -1
- package/dist/esm/common/constants.js +1 -1
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/globalEndpointManager.d.ts.map +1 -1
- package/dist/esm/globalEndpointManager.js +15 -19
- package/dist/esm/globalEndpointManager.js.map +1 -1
- package/dist/esm/retry/defaultRetryPolicy.d.ts.map +1 -1
- package/dist/esm/retry/defaultRetryPolicy.js +3 -4
- package/dist/esm/retry/defaultRetryPolicy.js.map +1 -1
- package/dist/esm/retry/endpointDiscoveryRetryPolicy.d.ts +3 -2
- package/dist/esm/retry/endpointDiscoveryRetryPolicy.d.ts.map +1 -1
- package/dist/esm/retry/endpointDiscoveryRetryPolicy.js +13 -5
- package/dist/esm/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
- package/dist/esm/retry/retryUtility.d.ts.map +1 -1
- package/dist/esm/retry/retryUtility.js +3 -2
- package/dist/esm/retry/retryUtility.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/globalEndpointManager.d.ts.map +1 -1
- package/dist/react-native/globalEndpointManager.js +15 -19
- package/dist/react-native/globalEndpointManager.js.map +1 -1
- package/dist/react-native/retry/defaultRetryPolicy.d.ts.map +1 -1
- package/dist/react-native/retry/defaultRetryPolicy.js +3 -4
- package/dist/react-native/retry/defaultRetryPolicy.js.map +1 -1
- package/dist/react-native/retry/endpointDiscoveryRetryPolicy.d.ts +3 -2
- package/dist/react-native/retry/endpointDiscoveryRetryPolicy.d.ts.map +1 -1
- package/dist/react-native/retry/endpointDiscoveryRetryPolicy.js +13 -5
- package/dist/react-native/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
- package/dist/react-native/retry/retryUtility.d.ts.map +1 -1
- package/dist/react-native/retry/retryUtility.js +3 -2
- package/dist/react-native/retry/retryUtility.js.map +1 -1
- package/package.json +2 -2
|
@@ -187,7 +187,7 @@ export const Constants = {
|
|
|
187
187
|
AzureNamespace: "Azure.Cosmos",
|
|
188
188
|
AzurePackageName: "@azure/cosmos",
|
|
189
189
|
SDKName: "azure-cosmos-js",
|
|
190
|
-
SDKVersion: "4.5.
|
|
190
|
+
SDKVersion: "4.5.1",
|
|
191
191
|
// Diagnostics
|
|
192
192
|
CosmosDbDiagnosticLevelEnvVarName: "AZURE_COSMOSDB_DIAGNOSTICS_LEVEL",
|
|
193
193
|
// Bulk Operations
|
|
@@ -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;QAC3B,YAAY,EAAE,eAAe;QAC7B,eAAe,EAAE,kBAAkB;QACnC,YAAY,EAAE,cAAc;QAC5B,SAAS,EAAE,YAAY;QACvB,eAAe,EAAE,gBAAgB;QACjC,eAAe,EAAE,mBAAmB;QACpC,OAAO,EAAE,UAAU;QACnB,WAAW,EAAE,eAAe;QAC5B,aAAa,EAAE,gBAAgB;QAC/B,cAAc,EAAE,iBAAiB;QACjC,SAAS,EAAE,YAAY;QACvB,YAAY,EAAE,eAAe;QAC7B,gBAAgB,EAAE,mBAAmB;QACrC,eAAe,EAAE,kBAAkB;QACnC,eAAe,EAAE,kBAAkB;QACnC,UAAU,EAAE,aAAa;QACzB,YAAY,EAAE,eAAe;QAC7B,MAAM,EAAE,QAAQ;QAChB,aAAa,EAAE,gBAAgB;QAC/B,cAAc,EAAE,iBAAiB;QACjC,OAAO,EAAE,UAAU;QACnB,iBAAiB,EAAE,qBAAqB;QACxC,WAAW,EAAE,cAAc;QAC3B,kBAAkB,EAAE,qBAAqB;QACzC,YAAY,EAAE,eAAe;QAC7B,iBAAiB,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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\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.5.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\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;;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;QAC3B,YAAY,EAAE,eAAe;QAC7B,eAAe,EAAE,kBAAkB;QACnC,YAAY,EAAE,cAAc;QAC5B,SAAS,EAAE,YAAY;QACvB,eAAe,EAAE,gBAAgB;QACjC,eAAe,EAAE,mBAAmB;QACpC,OAAO,EAAE,UAAU;QACnB,WAAW,EAAE,eAAe;QAC5B,aAAa,EAAE,gBAAgB;QAC/B,cAAc,EAAE,iBAAiB;QACjC,SAAS,EAAE,YAAY;QACvB,YAAY,EAAE,eAAe;QAC7B,gBAAgB,EAAE,mBAAmB;QACrC,eAAe,EAAE,kBAAkB;QACnC,eAAe,EAAE,kBAAkB;QACnC,UAAU,EAAE,aAAa;QACzB,YAAY,EAAE,eAAe;QAC7B,MAAM,EAAE,QAAQ;QAChB,aAAa,EAAE,gBAAgB;QAC/B,cAAc,EAAE,iBAAiB;QACjC,OAAO,EAAE,UAAU;QACnB,iBAAiB,EAAE,qBAAqB;QACxC,WAAW,EAAE,cAAc;QAC3B,kBAAkB,EAAE,qBAAqB;QACzC,YAAY,EAAE,eAAe;QAC7B,iBAAiB,EAAE,oBAAoB;QACvC,UAAU,EAAE,aAAa;QACzB,SAAS,EAAE,YAAY;QACvB,eAAe,EAAE,kBAAkB;QACnC,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,MAAM;QACZ,wBAAwB,EAAE,6BAA6B;QACvD,yBAAyB,EAAE,8BAA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IACxE,2GAA8E,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\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.5.1\",\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\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalEndpointManager.d.ts","sourceRoot":"","sources":["../../src/globalEndpointManager.ts"],"names":[],"mappings":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CAAC;IAIzE,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAIlD,iBAAiB,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAIhE;;OAEG;IACU,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAIpD,qCAAqC,CAChD,cAAc,EAAE,sBAAsB,EACtC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAUH,sCAAsC,CACjD,cAAc,EAAE,sBAAsB,EACtC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAYT,4BAA4B,CACjC,YAAY,CAAC,EAAE,YAAY,EAC3B,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO;IAcG,sBAAsB,CACjC,cAAc,EAAE,sBAAsB,EACtC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,yBAAyB,GAAE,MAAU,GACpC,OAAO,CAAC,MAAM,CAAC;IAyElB;;;;;OAKG;IACU,mBAAmB,CAAC,cAAc,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYvF,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;CA4BrC"}
|
|
@@ -168,18 +168,18 @@ export class GlobalEndpointManager {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
refreshEndpoints(databaseAccount) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const existingLocation = this.readableLocations.find((loc) => loc.name === location.name);
|
|
179
|
-
if (!existingLocation) {
|
|
180
|
-
this.readableLocations.push(location);
|
|
171
|
+
const oldWritableLocations = this.writeableLocations;
|
|
172
|
+
const oldReadableLocations = this.readableLocations;
|
|
173
|
+
function merge(loc, oldList) {
|
|
174
|
+
const prev = oldList.find((o) => o.name === loc.name);
|
|
175
|
+
if (prev) {
|
|
176
|
+
loc.unavailable = prev.unavailable;
|
|
177
|
+
loc.lastUnavailabilityTimestampInMs = prev.lastUnavailabilityTimestampInMs;
|
|
181
178
|
}
|
|
179
|
+
return loc;
|
|
182
180
|
}
|
|
181
|
+
this.writeableLocations = databaseAccount.writableLocations.map((loc) => merge({ ...loc }, oldWritableLocations));
|
|
182
|
+
this.readableLocations = databaseAccount.readableLocations.map((loc) => merge({ ...loc }, oldReadableLocations));
|
|
183
183
|
}
|
|
184
184
|
refreshStaleUnavailableLocations() {
|
|
185
185
|
const now = Date.now();
|
|
@@ -196,21 +196,17 @@ export class GlobalEndpointManager {
|
|
|
196
196
|
*/
|
|
197
197
|
updateLocation(now, unavailableLocations, allLocations) {
|
|
198
198
|
for (const location of unavailableLocations) {
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
201
|
-
now -
|
|
199
|
+
const unavailableLocation = allLocations.find((loc) => loc.name === location.name);
|
|
200
|
+
if (unavailableLocation &&
|
|
201
|
+
now - unavailableLocation.lastUnavailabilityTimestampInMs >
|
|
202
202
|
Constants.LocationUnavailableExpirationTimeInMs) {
|
|
203
|
-
|
|
203
|
+
unavailableLocation.unavailable = false;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
cleanUnavailableLocationList(now, unavailableLocations) {
|
|
208
208
|
return unavailableLocations.filter((loc) => {
|
|
209
|
-
|
|
210
|
-
now - loc.lastUnavailabilityTimestampInMs >= Constants.LocationUnavailableExpirationTimeInMs) {
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
return true;
|
|
209
|
+
return (now - loc.lastUnavailabilityTimestampInMs < Constants.LocationUnavailableExpirationTimeInMs);
|
|
214
210
|
});
|
|
215
211
|
}
|
|
216
212
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalEndpointManager.js","sourceRoot":"","sources":["../../src/globalEndpointManager.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAI/E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IA4BtB;IA3BV;;OAEG;IACK,eAAe,CAAS;IAChC;;OAEG;IACI,uBAAuB,CAAU;IAChC,YAAY,CAAU;IACtB,OAAO,CAAsB;IACrC;;OAEG;IACK,kBAAkB,CAAW;IAC7B,kBAAkB,GAAe,EAAE,CAAC;IACpC,iBAAiB,GAAe,EAAE,CAAC;IACnC,4BAA4B,GAAe,EAAE,CAAC;IAC9C,6BAA6B,GAAe,EAAE,CAAC;IAC/C,4BAA4B,CAAU;IAEvC,uBAAuB,CAAS;IACvC;;;OAGG;IACH,YACE,OAA4B,EACpB,mBAGuC;QAHvC,wBAAmB,GAAnB,mBAAmB,CAGoB;QAE/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;QACxC,IAAI,CAAC,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,uBAAuB,CAAC;QAChF,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC;QAC3E,IAAI,CAAC,uBAAuB,GAAG,IAA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AAC,CAAC;YAC/E,IAAI,aAAa,EAAE,CAAC;gBAClB,kDAAkD;gBAClD,MAAM,yBAAyB,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;gBAEnD,0FAA0F;gBAC1F,MAAM,6BAA6B,GACjC,yBAAyB,GAAG,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBAElE,8CAA8C;gBAC9C,+EAA+E;gBAC/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;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 { 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\";\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 * @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 }\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 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 // 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\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 }\n\n const locations = isReadRequest(operationType)\n ? this.readableLocations\n : this.writeableLocations;\n\n let location;\n // If we have preferred locations, try each one in order and use the first available one\n if (\n this.preferredLocations &&\n this.preferredLocations.length > 0 &&\n startServiceEndpointIndex < this.preferredLocations.length\n ) {\n for (let i = startServiceEndpointIndex; i < this.preferredLocations.length; i++) {\n const preferredLocation = this.preferredLocations[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 loc.unavailable !== true;\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 for (const location of databaseAccount.writableLocations) {\n const existingLocation = this.writeableLocations.find((loc) => loc.name === location.name);\n if (!existingLocation) {\n this.writeableLocations.push(location);\n }\n }\n for (const location of databaseAccount.readableLocations) {\n const existingLocation = this.readableLocations.find((loc) => loc.name === location.name);\n if (!existingLocation) {\n this.readableLocations.push(location);\n }\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 unavaialableLocation = allLocations.find((loc) => loc.name === location.name);\n if (\n unavaialableLocation &&\n now - unavaialableLocation.lastUnavailabilityTimestampInMs >\n Constants.LocationUnavailableExpirationTimeInMs\n ) {\n unavaialableLocation.unavailable = false;\n }\n }\n }\n\n private cleanUnavailableLocationList(now: number, unavailableLocations: Location[]): Location[] {\n return unavailableLocations.filter((loc) => {\n if (\n loc &&\n now - loc.lastUnavailabilityTimestampInMs >= Constants.LocationUnavailableExpirationTimeInMs\n ) {\n return false;\n }\n return true;\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"]}
|
|
1
|
+
{"version":3,"file":"globalEndpointManager.js","sourceRoot":"","sources":["../../src/globalEndpointManager.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAI/E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CA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;gBAC/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;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 { 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\";\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 * @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 }\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 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 // 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\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 }\n\n const locations = isReadRequest(operationType)\n ? this.readableLocations\n : this.writeableLocations;\n\n let location;\n // If we have preferred locations, try each one in order and use the first available one\n if (\n this.preferredLocations &&\n this.preferredLocations.length > 0 &&\n startServiceEndpointIndex < this.preferredLocations.length\n ) {\n for (let i = startServiceEndpointIndex; i < this.preferredLocations.length; i++) {\n const preferredLocation = this.preferredLocations[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 loc.unavailable !== true;\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultRetryPolicy.d.ts","sourceRoot":"","sources":["../../../src/retry/defaultRetryPolicy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"defaultRetryPolicy.d.ts","sourceRoot":"","sources":["../../../src/retry/defaultRetryPolicy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgHpD;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,WAAW;IAKxC,OAAO,CAAC,aAAa;IAJjC,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,wBAAwB,CAAa;IACtC,cAAc,EAAE,MAAM,CAAQ;gBAEjB,aAAa,EAAE,aAAa;IAChD;;;OAGG;IACU,WAAW,CACtB,GAAG,EAAE,aAAa,EAClB,cAAc,EAAE,sBAAsB,GACrC,OAAO,CAAC,OAAO,CAAC;CAapB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OperationType
|
|
1
|
+
import { OperationType } from "../common/index.js";
|
|
2
2
|
import { TimeoutErrorCode } from "../request/TimeoutError.js";
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
@@ -101,9 +101,8 @@ const CONNECTION_ERROR_CODES = [
|
|
|
101
101
|
* @hidden
|
|
102
102
|
*/
|
|
103
103
|
function needsRetry(operationType, code) {
|
|
104
|
-
return (
|
|
105
|
-
(
|
|
106
|
-
CONNECTION_ERROR_CODES.includes(code)));
|
|
104
|
+
return ((operationType === OperationType.Read || operationType === OperationType.Query) &&
|
|
105
|
+
CONNECTION_ERROR_CODES.includes(code));
|
|
107
106
|
}
|
|
108
107
|
/**
|
|
109
108
|
* This class implements the default connection retry policy for requests.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultRetryPolicy.js","sourceRoot":"","sources":["../../../src/retry/defaultRetryPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"defaultRetryPolicy.js","sourceRoot":"","sources":["../../../src/retry/defaultRetryPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D;;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;GAEG;AACH,SAAS,UAAU,CAAC,aAA4B,EAAE,IAAqB;IACrE,OAAO,CACL,CAAC,aAAa,KAAK,aAAa,CAAC,IAAI,IAAI,aAAa,KAAK,aAAa,CAAC,KAAK,CAAC;QAC/E,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,CACtC,CAAC;AACJ,CAAC;AACD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAKT;IAJZ,QAAQ,GAAW,EAAE,CAAC;IACtB,wBAAwB,GAAW,CAAC,CAAC;IACtC,cAAc,GAAW,IAAI,CAAC;IAErC,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IACpD;;;OAGG;IACI,KAAK,CAAC,WAAW,CACtB,GAAkB,EAClB,cAAsC;QAEtC,IAAI,GAAG,EAAE,CAAC;YACR,IACE,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,QAAQ;gBAC7C,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,EACxC,CAAC;gBACD,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC,CAAC;gBAC7D,IAAI,CAAC,wBAAwB,EAAE,CAAC;gBAChC,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { DiagnosticNodeInternal } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { OperationType } from \"../common/index.js\";\nimport type { ErrorResponse } from \"../request/index.js\";\nimport { TimeoutErrorCode } from \"../request/TimeoutError.js\";\nimport type { RetryPolicy } from \"./RetryPolicy.js\";\n\n/**\n * @hidden\n */\n// Windows Socket Error Codes\nconst WindowsInterruptedFunctionCall = 10004;\n/**\n * @hidden\n */\nconst WindowsFileHandleNotValid = 10009;\n/**\n * @hidden\n */\nconst WindowsPermissionDenied = 10013;\n/**\n * @hidden\n */\nconst WindowsBadAddress = 10014;\n/**\n * @hidden\n */\nconst WindowsInvalidArgumnet = 10022;\n/**\n * @hidden\n */\nconst WindowsResourceTemporarilyUnavailable = 10035;\n/**\n * @hidden\n */\nconst WindowsOperationNowInProgress = 10036;\n/**\n * @hidden\n */\nconst WindowsAddressAlreadyInUse = 10048;\n/**\n * @hidden\n */\nconst WindowsConnectionResetByPeer = 10054;\n/**\n * @hidden\n */\nconst WindowsCannotSendAfterSocketShutdown = 10058;\n/**\n * @hidden\n */\nconst WindowsConnectionTimedOut = 10060;\n/**\n * @hidden\n */\nconst WindowsConnectionRefused = 10061;\n/**\n * @hidden\n */\nconst WindowsNameTooLong = 10063;\n/**\n * @hidden\n */\nconst WindowsHostIsDown = 10064;\n/**\n * @hidden\n */\nconst WindowsNoRouteTohost = 10065;\n/**\n * @hidden\n */\n\n// Linux Error Codes\n/**\n * @hidden\n */\nconst LinuxConnectionReset = \"ECONNRESET\";\n\n// Node Error Codes\n/**\n * @hidden\n */\nconst BrokenPipe = \"EPIPE\";\n\n/**\n * @hidden\n */\nconst CONNECTION_ERROR_CODES = [\n WindowsInterruptedFunctionCall,\n WindowsFileHandleNotValid,\n WindowsPermissionDenied,\n WindowsBadAddress,\n WindowsInvalidArgumnet,\n WindowsResourceTemporarilyUnavailable,\n WindowsOperationNowInProgress,\n WindowsAddressAlreadyInUse,\n WindowsConnectionResetByPeer,\n WindowsCannotSendAfterSocketShutdown,\n WindowsConnectionTimedOut,\n WindowsConnectionRefused,\n WindowsNameTooLong,\n WindowsHostIsDown,\n WindowsNoRouteTohost,\n LinuxConnectionReset,\n TimeoutErrorCode,\n BrokenPipe,\n];\n\n/**\n * @hidden\n */\nfunction needsRetry(operationType: OperationType, code: number | string): boolean {\n return (\n (operationType === OperationType.Read || operationType === OperationType.Query) &&\n CONNECTION_ERROR_CODES.includes(code)\n );\n}\n/**\n * This class implements the default connection retry policy for requests.\n * @hidden\n */\nexport class DefaultRetryPolicy implements RetryPolicy {\n private maxTries: number = 10;\n private currentRetryAttemptCount: number = 0;\n public retryAfterInMs: number = 1000;\n\n constructor(private operationType: OperationType) {}\n /**\n * Determines whether the request should be retried or not.\n * @param err - Error returned by the request.\n */\n public async shouldRetry(\n err: ErrorResponse,\n diagnosticNode: DiagnosticNodeInternal,\n ): Promise<boolean> {\n if (err) {\n if (\n this.currentRetryAttemptCount < this.maxTries &&\n needsRetry(this.operationType, err.code)\n ) {\n diagnosticNode.addData({ successfulRetryPolicy: \"default\" });\n this.currentRetryAttemptCount++;\n return true;\n }\n }\n return false;\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DiagnosticNodeInternal } from "../diagnostics/DiagnosticNodeInternal.js";
|
|
2
|
-
import
|
|
2
|
+
import { OperationType, ResourceType } from "../common/index.js";
|
|
3
3
|
import type { GlobalEndpointManager } from "../globalEndpointManager.js";
|
|
4
4
|
import type { ErrorResponse, RequestContext } from "../request/index.js";
|
|
5
5
|
import type { RetryContext } from "./RetryContext.js";
|
|
@@ -11,6 +11,7 @@ import { GlobalPartitionEndpointManager } from "../globalPartitionEndpointManage
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class EndpointDiscoveryRetryPolicy implements RetryPolicy {
|
|
13
13
|
private globalEndpointManager;
|
|
14
|
+
private resourceType;
|
|
14
15
|
private operationType;
|
|
15
16
|
private globalPartitionEndpointManager?;
|
|
16
17
|
/** Current retry attempt count. */
|
|
@@ -24,7 +25,7 @@ export declare class EndpointDiscoveryRetryPolicy implements RetryPolicy {
|
|
|
24
25
|
/**
|
|
25
26
|
* @param globalEndpointManager - The GlobalEndpointManager instance.
|
|
26
27
|
*/
|
|
27
|
-
constructor(globalEndpointManager: GlobalEndpointManager, operationType: OperationType, globalPartitionEndpointManager?: GlobalPartitionEndpointManager);
|
|
28
|
+
constructor(globalEndpointManager: GlobalEndpointManager, resourceType: ResourceType, operationType: OperationType, globalPartitionEndpointManager?: GlobalPartitionEndpointManager);
|
|
28
29
|
/**
|
|
29
30
|
* Determines whether the request should be retried or not.
|
|
30
31
|
* @param err - Error returned by the request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpointDiscoveryRetryPolicy.d.ts","sourceRoot":"","sources":["../../../src/retry/endpointDiscoveryRetryPolicy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,
|
|
1
|
+
{"version":3,"file":"endpointDiscoveryRetryPolicy.d.ts","sourceRoot":"","sources":["../../../src/retry/endpointDiscoveryRetryPolicy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAEtF;;;GAGG;AACH,qBAAa,4BAA6B,YAAW,WAAW;IAe5D,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,8BAA8B,CAAC;IAjBzC,mCAAmC;IAC5B,wBAAwB,EAAE,MAAM,CAAC;IACxC,sCAAsC;IAC/B,cAAc,EAAE,MAAM,CAAC;IAE9B,+CAA+C;IAC/C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAO;IACvC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAQ;IAE9C;;OAEG;gBAEO,qBAAqB,EAAE,qBAAqB,EAC5C,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,8BAA8B,CAAC,EAAE,8BAA8B;IAOzE;;;OAGG;IACU,WAAW,CACtB,GAAG,EAAE,aAAa,EAClB,cAAc,EAAE,sBAAsB,EACtC,YAAY,CAAC,EAAE,YAAY,EAC3B,gBAAgB,CAAC,EAAE,MAAM,EACzB,cAAc,CAAC,EAAE,cAAc,GAC9B,OAAO,CAAC,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;CAoDxC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OperationType, ResourceType } from "../common/index.js";
|
|
1
2
|
import { isReadRequest } from "../common/helper.js";
|
|
2
3
|
/**
|
|
3
4
|
* This class implements the retry policy for endpoint discovery.
|
|
@@ -5,6 +6,7 @@ import { isReadRequest } from "../common/helper.js";
|
|
|
5
6
|
*/
|
|
6
7
|
export class EndpointDiscoveryRetryPolicy {
|
|
7
8
|
globalEndpointManager;
|
|
9
|
+
resourceType;
|
|
8
10
|
operationType;
|
|
9
11
|
globalPartitionEndpointManager;
|
|
10
12
|
/** Current retry attempt count. */
|
|
@@ -18,8 +20,9 @@ export class EndpointDiscoveryRetryPolicy {
|
|
|
18
20
|
/**
|
|
19
21
|
* @param globalEndpointManager - The GlobalEndpointManager instance.
|
|
20
22
|
*/
|
|
21
|
-
constructor(globalEndpointManager, operationType, globalPartitionEndpointManager) {
|
|
23
|
+
constructor(globalEndpointManager, resourceType, operationType, globalPartitionEndpointManager) {
|
|
22
24
|
this.globalEndpointManager = globalEndpointManager;
|
|
25
|
+
this.resourceType = resourceType;
|
|
23
26
|
this.operationType = operationType;
|
|
24
27
|
this.globalPartitionEndpointManager = globalPartitionEndpointManager;
|
|
25
28
|
this.maxTries = EndpointDiscoveryRetryPolicy.maxTries;
|
|
@@ -50,16 +53,21 @@ export class EndpointDiscoveryRetryPolicy {
|
|
|
50
53
|
return false;
|
|
51
54
|
}
|
|
52
55
|
this.currentRetryAttemptCount++;
|
|
56
|
+
retryContext.retryCount = this.currentRetryAttemptCount;
|
|
57
|
+
retryContext.clearSessionTokenNotAvailable = false;
|
|
58
|
+
retryContext.retryRequestOnPreferredLocations = false;
|
|
59
|
+
diagnosticNode.addData({ successfulRetryPolicy: "endpointDiscovery" });
|
|
60
|
+
// check if this is a readDatabaseAccount call
|
|
61
|
+
// If yes, then simply return true (avoid recursive call triggered for readDatabaseAccount)
|
|
62
|
+
if (this.resourceType === ResourceType.none && this.operationType === OperationType.Read) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
53
65
|
if (isReadRequest(this.operationType)) {
|
|
54
66
|
await this.globalEndpointManager.markCurrentLocationUnavailableForRead(diagnosticNode, locationEndpoint);
|
|
55
67
|
}
|
|
56
68
|
else {
|
|
57
69
|
await this.globalEndpointManager.markCurrentLocationUnavailableForWrite(diagnosticNode, locationEndpoint);
|
|
58
70
|
}
|
|
59
|
-
retryContext.retryCount = this.currentRetryAttemptCount;
|
|
60
|
-
retryContext.clearSessionTokenNotAvailable = false;
|
|
61
|
-
retryContext.retryRequestOnPreferredLocations = false;
|
|
62
|
-
diagnosticNode.addData({ successfulRetryPolicy: "endpointDiscovery" });
|
|
63
71
|
return true;
|
|
64
72
|
}
|
|
65
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpointDiscoveryRetryPolicy.js","sourceRoot":"","sources":["../../../src/retry/endpointDiscoveryRetryPolicy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpointDiscoveryRetryPolicy.js","sourceRoot":"","sources":["../../../src/retry/endpointDiscoveryRetryPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOpD;;;GAGG;AACH,MAAM,OAAO,4BAA4B;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,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAChC,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC,wBAAwB,CAAC;QACxD,YAAY,CAAC,6BAA6B,GAAG,KAAK,CAAC;QACnD,YAAY,CAAC,gCAAgC,GAAG,KAAK,CAAC;QACtD,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAEvE,8CAA8C;QAC9C,2FAA2F;QAC3F,IAAI,IAAI,CAAC,YAAY,KAAK,YAAY,CAAC,IAAI,IAAI,IAAI,CAAC,aAAa,KAAK,aAAa,CAAC,IAAI,EAAE,CAAC;YACzF,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,CAAC,qBAAqB,CAAC,qCAAqC,CACpE,cAAc,EACd,gBAAgB,CACjB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,qBAAqB,CAAC,sCAAsC,CACrE,cAAc,EACd,gBAAgB,CACjB,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { DiagnosticNodeInternal } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { OperationType, ResourceType } from \"../common/index.js\";\nimport { isReadRequest } from \"../common/helper.js\";\nimport type { GlobalEndpointManager } from \"../globalEndpointManager.js\";\nimport type { ErrorResponse, RequestContext } from \"../request/index.js\";\nimport type { RetryContext } from \"./RetryContext.js\";\nimport type { RetryPolicy } from \"./RetryPolicy.js\";\nimport { GlobalPartitionEndpointManager } from \"../globalPartitionEndpointManager.js\";\n\n/**\n * This class implements the retry policy for endpoint discovery.\n * @hidden\n */\nexport class EndpointDiscoveryRetryPolicy implements RetryPolicy {\n /** Current retry attempt count. */\n public currentRetryAttemptCount: number;\n /** Retry interval in milliseconds. */\n public retryAfterInMs: number;\n\n /** Max number of retry attempts to perform. */\n private maxTries: number;\n private static readonly maxTries = 120; // TODO: Constant?\n private static readonly retryAfterInMs = 1000;\n\n /**\n * @param globalEndpointManager - The GlobalEndpointManager instance.\n */\n constructor(\n private globalEndpointManager: GlobalEndpointManager,\n private resourceType: ResourceType,\n private operationType: OperationType,\n private globalPartitionEndpointManager?: GlobalPartitionEndpointManager,\n ) {\n this.maxTries = EndpointDiscoveryRetryPolicy.maxTries;\n this.currentRetryAttemptCount = 0;\n this.retryAfterInMs = EndpointDiscoveryRetryPolicy.retryAfterInMs;\n }\n\n /**\n * Determines whether the request should be retried or not.\n * @param err - Error returned by the request.\n */\n public async shouldRetry(\n err: ErrorResponse,\n diagnosticNode: DiagnosticNodeInternal,\n retryContext?: RetryContext,\n locationEndpoint?: string,\n requestContext?: RequestContext,\n ): Promise<boolean | [boolean, string]> {\n if (!err) {\n return false;\n }\n\n if (!retryContext || !locationEndpoint) {\n return false;\n }\n\n if (!this.globalEndpointManager.enableEndpointDiscovery) {\n return false;\n }\n\n if (this.globalPartitionEndpointManager) {\n const didFailover = await this.globalPartitionEndpointManager.tryPartitionLevelFailover(\n requestContext,\n diagnosticNode,\n );\n if (didFailover) {\n return true;\n }\n }\n\n if (this.currentRetryAttemptCount >= this.maxTries) {\n return false;\n }\n\n this.currentRetryAttemptCount++;\n retryContext.retryCount = this.currentRetryAttemptCount;\n retryContext.clearSessionTokenNotAvailable = false;\n retryContext.retryRequestOnPreferredLocations = false;\n diagnosticNode.addData({ successfulRetryPolicy: \"endpointDiscovery\" });\n\n // check if this is a readDatabaseAccount call\n // If yes, then simply return true (avoid recursive call triggered for readDatabaseAccount)\n if (this.resourceType === ResourceType.none && this.operationType === OperationType.Read) {\n return true;\n }\n\n if (isReadRequest(this.operationType)) {\n await this.globalEndpointManager.markCurrentLocationUnavailableForRead(\n diagnosticNode,\n locationEndpoint,\n );\n } else {\n await this.globalEndpointManager.markCurrentLocationUnavailableForWrite(\n diagnosticNode,\n locationEndpoint,\n );\n }\n return true;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retryUtility.d.ts","sourceRoot":"","sources":["../../../src/retry/retryUtility.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAEvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;GAEG;AACH,UAAU,WAAW;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,EAAE,sBAAsB,CAAC;IACvC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,EAAE,CACd,cAAc,EAAE,sBAAsB,EACtC,cAAc,EAAE,cAAc,KAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,UAAU,aAAa;IACrB,4BAA4B,EAAE,4BAA4B,CAAC;IAC3D,2BAA2B,EAAE,2BAA2B,CAAC;IACzD,sBAAsB,EAAE,kBAAkB,CAAC;IAC3C,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,0BAA0B,EAAE,0BAA0B,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AC;IACvC,0BAA0B,EAAE,0BAA0B,CAAC;CACxD;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,EAC5B,cAAc,EACd,YAAgC,EAChC,aAAa,EACb,cAAc,EACd,cAAc,GACf,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAoJtC"}
|
|
@@ -21,7 +21,7 @@ export async function execute({ diagnosticNode, retryContext = { retryCount: 0 }
|
|
|
21
21
|
localDiagnosticNode.addData({ requestAttempNumber: retryContext.retryCount });
|
|
22
22
|
if (!retryPolicies) {
|
|
23
23
|
retryPolicies = {
|
|
24
|
-
endpointDiscoveryRetryPolicy: new EndpointDiscoveryRetryPolicy(requestContext.globalEndpointManager, requestContext.operationType, requestContext.globalPartitionEndpointManager),
|
|
24
|
+
endpointDiscoveryRetryPolicy: new EndpointDiscoveryRetryPolicy(requestContext.globalEndpointManager, requestContext.resourceType, requestContext.operationType, requestContext.globalPartitionEndpointManager),
|
|
25
25
|
resourceThrottleRetryPolicy: new ResourceThrottleRetryPolicy(requestContext.connectionPolicy.retryOptions ?? {}),
|
|
26
26
|
sessionReadRetryPolicy: new SessionRetryPolicy(requestContext.globalEndpointManager, requestContext.resourceType, requestContext.operationType, requestContext.connectionPolicy),
|
|
27
27
|
defaultRetryPolicy: new DefaultRetryPolicy(requestContext.operationType),
|
|
@@ -65,7 +65,8 @@ export async function execute({ diagnosticNode, retryContext = { retryCount: 0 }
|
|
|
65
65
|
if (correlatedActivityId) {
|
|
66
66
|
headers[Constants.HttpHeaders.CorrelatedActivityId] = correlatedActivityId;
|
|
67
67
|
}
|
|
68
|
-
if (err.code ===
|
|
68
|
+
if (err.code === StatusCodes.ENOTFOUND ||
|
|
69
|
+
err.code === "REQUEST_SEND_ERROR" ||
|
|
69
70
|
(err.code === StatusCodes.Forbidden &&
|
|
70
71
|
(err.substatus === SubStatusCodes.DatabaseAccountNotFound ||
|
|
71
72
|
err.substatus === SubStatusCodes.WriteForbidden))) {
|