@azure/cosmos 3.16.4 → 3.17.1-alpha.20220822.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -13
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/types/3.1/cosmos.d.ts +11 -0
- package/dist/types/latest/cosmos.d.ts +11 -1
- package/dist-esm/src/common/constants.js +1 -1
- package/dist-esm/src/common/constants.js.map +1 -1
- package/dist-esm/src/request/SharedOptions.d.ts +1 -3
- package/dist-esm/src/request/SharedOptions.d.ts.map +1 -1
- package/dist-esm/src/request/SharedOptions.js.map +1 -1
- package/dist-esm/src/request/request.d.ts.map +1 -1
- package/dist-esm/src/request/request.js +9 -2
- package/dist-esm/src/request/request.js.map +1 -1
- package/package.json +3 -3
|
@@ -2756,6 +2756,17 @@ export declare interface SharedOptions {
|
|
|
2756
2756
|
* ```
|
|
2757
2757
|
*/
|
|
2758
2758
|
abortSignal?: AbortSignal_2;
|
|
2759
|
+
/**
|
|
2760
|
+
* Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the {@link
|
|
2761
|
+
* com.azure.cosmos.ConsistencyLevel} is {@link com.azure.cosmos.ConsistencyLevel#EVENTUAL} or {@link com.azure.cosmos.ConsistencyLevel#SESSION}, responses from the
|
|
2762
|
+
* integrated cache are guaranteed to be no staler than value indicated by this maxIntegratedCacheStaleness. When the
|
|
2763
|
+
* consistency level is not set, this property is ignored.
|
|
2764
|
+
*
|
|
2765
|
+
* <p>Default value is null</p>
|
|
2766
|
+
*
|
|
2767
|
+
* <p>Cache Staleness is supported in milliseconds granularity. Anything smaller than milliseconds will be ignored.</p>
|
|
2768
|
+
*/
|
|
2769
|
+
maxIntegratedCacheStalenessInMs?: number;
|
|
2759
2770
|
}
|
|
2760
2771
|
export declare interface SpatialIndex {
|
|
2761
2772
|
path: string;
|
|
@@ -2880,7 +2880,17 @@ export declare class Conflicts {
|
|
|
2880
2880
|
* ```
|
|
2881
2881
|
*/
|
|
2882
2882
|
abortSignal?: AbortSignal_2;
|
|
2883
|
-
|
|
2883
|
+
/**
|
|
2884
|
+
* Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the {@link
|
|
2885
|
+
* com.azure.cosmos.ConsistencyLevel} is {@link com.azure.cosmos.ConsistencyLevel#EVENTUAL} or {@link com.azure.cosmos.ConsistencyLevel#SESSION}, responses from the
|
|
2886
|
+
* integrated cache are guaranteed to be no staler than value indicated by this maxIntegratedCacheStaleness. When the
|
|
2887
|
+
* consistency level is not set, this property is ignored.
|
|
2888
|
+
*
|
|
2889
|
+
* <p>Default value is null</p>
|
|
2890
|
+
*
|
|
2891
|
+
* <p>Cache Staleness is supported in milliseconds granularity. Anything smaller than milliseconds will be ignored.</p>
|
|
2892
|
+
*/
|
|
2893
|
+
maxIntegratedCacheStalenessInMs?: number;
|
|
2884
2894
|
}
|
|
2885
2895
|
|
|
2886
2896
|
export declare interface SpatialIndex {
|
|
@@ -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,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;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;IACzD,wFAAkE,CAAA;IAClE,4EAAmD,CAAA;IACnD,qFAAyD,CAAA;IACzD,oFAAuD,CAAA;IACvD,oFAAuD,CAAA;IACvD,iGAAwE,CAAA;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","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 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\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 PageSize: \"x-ms-max-item-count\",\n ItemCount: \"x-ms-item-count\",\n\n // Request sender generated. Simply echoed by backend.\n ActivityId: \"x-ms-activity-id\",\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\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 // 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 // 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\n // Cache Refresh header\n ForceRefresh: \"x-ms-force-refresh\",\n },\n\n // GlobalDB related constants\n WritableLocations: \"writableLocations\",\n ReadableLocations: \"readableLocations\",\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: \"3.16.4\",\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\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}\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"]}
|
|
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,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,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IT 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 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\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 PageSize: \"x-ms-max-item-count\",\n ItemCount: \"x-ms-item-count\",\n\n // Request sender generated. Simply echoed by backend.\n ActivityId: \"x-ms-activity-id\",\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\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 // 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 // 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\n // Cache Refresh header\n ForceRefresh: \"x-ms-force-refresh\",\n },\n\n // GlobalDB related constants\n WritableLocations: \"writableLocations\",\n ReadableLocations: \"readableLocations\",\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: \"3.17.1\",\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\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}\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"]}
|
|
@@ -20,16 +20,14 @@ export interface SharedOptions {
|
|
|
20
20
|
*/
|
|
21
21
|
abortSignal?: AbortSignal;
|
|
22
22
|
/**
|
|
23
|
-
* **(Beta - There may be breaking changes in this property in future releases)**
|
|
24
23
|
* Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the {@link
|
|
25
|
-
* com.azure.cosmos.ConsistencyLevel} is {@link com.azure.cosmos.ConsistencyLevel#EVENTUAL}, responses from the
|
|
24
|
+
* com.azure.cosmos.ConsistencyLevel} is {@link com.azure.cosmos.ConsistencyLevel#EVENTUAL} or {@link com.azure.cosmos.ConsistencyLevel#SESSION}, responses from the
|
|
26
25
|
* integrated cache are guaranteed to be no staler than value indicated by this maxIntegratedCacheStaleness. When the
|
|
27
26
|
* consistency level is not set, this property is ignored.
|
|
28
27
|
*
|
|
29
28
|
* <p>Default value is null</p>
|
|
30
29
|
*
|
|
31
30
|
* <p>Cache Staleness is supported in milliseconds granularity. Anything smaller than milliseconds will be ignored.</p>
|
|
32
|
-
* @beta
|
|
33
31
|
*/
|
|
34
32
|
maxIntegratedCacheStalenessInMs?: number;
|
|
35
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SharedOptions.d.ts","sourceRoot":"","sources":["../../../src/request/SharedOptions.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4GAA4G;IAC5G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B
|
|
1
|
+
{"version":3,"file":"SharedOptions.d.ts","sourceRoot":"","sources":["../../../src/request/SharedOptions.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4GAA4G;IAC5G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;;;;;OASG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;CAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SharedOptions.js","sourceRoot":"","sources":["../../../src/request/SharedOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/// <reference lib=\"dom\" />\nimport { CosmosHeaders } from \"../index\";\nimport { AbortSignal } from \"node-abort-controller\";\n\n/**\n * Options that can be specified for a requested issued to the Azure Cosmos DB servers.=\n */\nexport interface SharedOptions {\n /** Enables/disables getting document container quota related stats for document container read requests. */\n sessionToken?: string;\n /** (Advanced use case) Initial headers to start with when sending requests to Cosmos */\n initialHeaders?: CosmosHeaders;\n /**\n * abortSignal to pass to all underlying network requests created by this method call. See https://developer.mozilla.org/en-US/docs/Web/API/AbortController\n * @example Cancel a read request\n * ```typescript\n * const controller = new AbortController()\n * const {result: item} = await items.query('SELECT * from c', { abortSignal: controller.signal});\n * controller.abort()\n * ```\n */\n abortSignal?: AbortSignal;\n /**\n *
|
|
1
|
+
{"version":3,"file":"SharedOptions.js","sourceRoot":"","sources":["../../../src/request/SharedOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/// <reference lib=\"dom\" />\nimport { CosmosHeaders } from \"../index\";\nimport { AbortSignal } from \"node-abort-controller\";\n\n/**\n * Options that can be specified for a requested issued to the Azure Cosmos DB servers.=\n */\nexport interface SharedOptions {\n /** Enables/disables getting document container quota related stats for document container read requests. */\n sessionToken?: string;\n /** (Advanced use case) Initial headers to start with when sending requests to Cosmos */\n initialHeaders?: CosmosHeaders;\n /**\n * abortSignal to pass to all underlying network requests created by this method call. See https://developer.mozilla.org/en-US/docs/Web/API/AbortController\n * @example Cancel a read request\n * ```typescript\n * const controller = new AbortController()\n * const {result: item} = await items.query('SELECT * from c', { abortSignal: controller.signal});\n * controller.abort()\n * ```\n */\n abortSignal?: AbortSignal;\n /**\n * Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the {@link\n * com.azure.cosmos.ConsistencyLevel} is {@link com.azure.cosmos.ConsistencyLevel#EVENTUAL} or {@link com.azure.cosmos.ConsistencyLevel#SESSION}, responses from the\n * integrated cache are guaranteed to be no staler than value indicated by this maxIntegratedCacheStaleness. When the\n * consistency level is not set, this property is ignored.\n *\n * <p>Default value is null</p>\n *\n * <p>Cache Staleness is supported in milliseconds granularity. Anything smaller than milliseconds will be ignored.</p>\n */\n maxIntegratedCacheStalenessInMs?: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/request/request.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/request/request.ts"],"names":[],"mappings":";AAIA,OAAO,EAAa,UAAU,EAAkC,YAAY,EAAE,MAAM,WAAW,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAetD,cAAc;AACd,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAKpF;AAED;;GAEG;AACH,UAAU,iBAAiB;IACzB,aAAa,EAAE,mBAAmB,CAAC;IACnC,cAAc,EAAE,aAAa,CAAC;IAC9B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,cAAc,GAAG,WAAW,CAAC;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAID;;GAEG;AACH,wBAAsB,UAAU,CAAC,EAC/B,aAAa,EACb,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,OAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,GACb,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CAqJ5C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
+
import { logger } from "@azure/identity";
|
|
3
4
|
import { setAuthorizationHeader } from "../auth";
|
|
4
5
|
import { Constants, HTTPMethod, jsonStringifyAndEscapeNonASCII, ResourceType } from "../common";
|
|
5
6
|
// ----------------------------------------------------------------------------
|
|
@@ -78,8 +79,14 @@ export async function getHeaders({ clientOptions, defaultHeaders, verb, path, re
|
|
|
78
79
|
headers[Constants.HttpHeaders.ConsistencyLevel] = options.consistencyLevel;
|
|
79
80
|
}
|
|
80
81
|
if (options.maxIntegratedCacheStalenessInMs && resourceType === ResourceType.item) {
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
if (typeof options.maxIntegratedCacheStalenessInMs === "number") {
|
|
83
|
+
headers[Constants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness] =
|
|
84
|
+
options.maxIntegratedCacheStalenessInMs.toString();
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
logger.error(`RangeError: maxIntegratedCacheStalenessInMs "${options.maxIntegratedCacheStalenessInMs}" is not a valid parameter.`);
|
|
88
|
+
headers[Constants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness] = "null";
|
|
89
|
+
}
|
|
83
90
|
}
|
|
84
91
|
if (options.resourceTokenExpirySeconds) {
|
|
85
92
|
headers[Constants.HttpHeaders.ResourceTokenExpiry] = options.resourceTokenExpirySeconds;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/request/request.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,8BAA8B,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAMhG,+EAA+E;AAC/E,kBAAkB;AAClB,EAAE;AAEF,cAAc;AACd,SAAS,+BAA+B,CAAC,CAAU;IACjD,qGAAqG;IACrG,8CAA8C;IAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACnC,CAAC;AAED,cAAc;AACd,MAAM,UAAU,YAAY,CAAC,IAA+C;IAC1E,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,+BAA+B,CAAC,IAAI,CAAC,CAAC;KAC9C;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAkBD,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,aAAa,EACb,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,OAAO,GAAG,EAAE,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,GACM;IAClB,MAAM,OAAO,mBACX,CAAC,SAAS,CAAC,WAAW,CAAC,kCAAkC,CAAC,EAAE,CAAC,EAC7D,CAAC,SAAS,CAAC,WAAW,CAAC,yBAAyB,CAAC,EAAE,IAAI,IACpD,cAAc,CAClB,CAAC;IAEF,IAAI,yBAAyB,EAAE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,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,UAAU,CAAC,GAAG,EAAE;QACvD,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE;YAC/C,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC;SAC9D;KACF;IAED,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;QAC1C,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC;KACzD;IAED,IAAI,mBAAmB,KAAK,SAAS,EAAE;QACrC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;KAC1E;IAED,IAAI,OAAO,CAAC,mBAAmB,EAAE;QAC/B,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;KAClF;IAED,IAAI,OAAO,CAAC,uBAAuB,EAAE;QACnC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC;KAC/D;IAED,IACE,aAAa,CAAC,GAAG;QACjB,aAAa,CAAC,cAAc;QAC5B,aAAa,CAAC,aAAa;QAC3B,aAAa,CAAC,cAAc,EAC5B;QACA,MAAM,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;KAC5F;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { setAuthorizationHeader } from \"../auth\";\nimport { Constants, HTTPMethod, jsonStringifyAndEscapeNonASCII, ResourceType } from \"../common\";\nimport { CosmosClientOptions } from \"../CosmosClientOptions\";\nimport { PartitionKey } from \"../documents\";\nimport { CosmosHeaders } from \"../queryExecutionContext\";\nimport { FeedOptions, RequestOptions } from \"./index\";\n\n// ----------------------------------------------------------------------------\n// Utility methods\n//\n\n/** @hidden */\nfunction javaScriptFriendlyJSONStringify(s: unknown): string {\n // two line terminators (Line separator and Paragraph separator) are not needed to be escaped in JSON\n // but are needed to be escaped in JavaScript.\n return JSON.stringify(s)\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\n}\n\n/** @hidden */\nexport function bodyFromData(data: Buffer | string | Record<string, unknown>): string {\n if (typeof data === \"object\") {\n return javaScriptFriendlyJSONStringify(data);\n }\n return data;\n}\n\n/**\n * @hidden\n */\ninterface GetHeadersOptions {\n clientOptions: CosmosClientOptions;\n defaultHeaders: CosmosHeaders;\n verb: HTTPMethod;\n path: string;\n resourceId: string;\n resourceType: ResourceType;\n options: RequestOptions & FeedOptions;\n partitionKeyRangeId?: string;\n useMultipleWriteLocations?: boolean;\n partitionKey?: PartitionKey;\n}\n\nconst JsonContentType = \"application/json\";\n\n/**\n * @hidden\n */\nexport async function getHeaders({\n clientOptions,\n defaultHeaders,\n verb,\n path,\n resourceId,\n resourceType,\n options = {},\n partitionKeyRangeId,\n useMultipleWriteLocations,\n partitionKey,\n}: GetHeadersOptions): Promise<CosmosHeaders> {\n const headers: CosmosHeaders = {\n [Constants.HttpHeaders.ResponseContinuationTokenLimitInKB]: 1,\n [Constants.HttpHeaders.EnableCrossPartitionQuery]: true,\n ...defaultHeaders,\n };\n\n if (useMultipleWriteLocations) {\n headers[Constants.HttpHeaders.ALLOW_MULTIPLE_WRITES] = true;\n }\n\n if (options.continuationTokenLimitInKB) {\n headers[Constants.HttpHeaders.ResponseContinuationTokenLimitInKB] =\n options.continuationTokenLimitInKB;\n }\n if (options.continuationToken) {\n headers[Constants.HttpHeaders.Continuation] = options.continuationToken;\n } else if (options.continuation) {\n headers[Constants.HttpHeaders.Continuation] = options.continuation;\n }\n\n if (options.preTriggerInclude) {\n headers[Constants.HttpHeaders.PreTriggerInclude] =\n options.preTriggerInclude.constructor === Array\n ? (options.preTriggerInclude as string[]).join(\",\")\n : (options.preTriggerInclude as string);\n }\n\n if (options.postTriggerInclude) {\n headers[Constants.HttpHeaders.PostTriggerInclude] =\n options.postTriggerInclude.constructor === Array\n ? (options.postTriggerInclude as string[]).join(\",\")\n : (options.postTriggerInclude as string);\n }\n\n if (options.offerType) {\n headers[Constants.HttpHeaders.OfferType] = options.offerType;\n }\n\n if (options.offerThroughput) {\n headers[Constants.HttpHeaders.OfferThroughput] = options.offerThroughput;\n }\n\n if (options.maxItemCount) {\n headers[Constants.HttpHeaders.PageSize] = options.maxItemCount;\n }\n\n if (options.accessCondition) {\n if (options.accessCondition.type === \"IfMatch\") {\n headers[Constants.HttpHeaders.IfMatch] = options.accessCondition.condition;\n } else {\n headers[Constants.HttpHeaders.IfNoneMatch] = options.accessCondition.condition;\n }\n }\n\n if (options.useIncrementalFeed) {\n headers[Constants.HttpHeaders.A_IM] = \"Incremental Feed\";\n }\n\n if (options.indexingDirective) {\n headers[Constants.HttpHeaders.IndexingDirective] = options.indexingDirective;\n }\n\n if (options.consistencyLevel) {\n headers[Constants.HttpHeaders.ConsistencyLevel] = options.consistencyLevel;\n }\n\n if (options.maxIntegratedCacheStalenessInMs && resourceType === ResourceType.item) {\n headers[Constants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness] =\n options.maxIntegratedCacheStalenessInMs;\n }\n\n if (options.resourceTokenExpirySeconds) {\n headers[Constants.HttpHeaders.ResourceTokenExpiry] = options.resourceTokenExpirySeconds;\n }\n\n if (options.sessionToken) {\n headers[Constants.HttpHeaders.SessionToken] = options.sessionToken;\n }\n\n if (options.enableScanInQuery) {\n headers[Constants.HttpHeaders.EnableScanInQuery] = options.enableScanInQuery;\n }\n\n if (options.populateQuotaInfo) {\n headers[Constants.HttpHeaders.PopulateQuotaInfo] = options.populateQuotaInfo;\n }\n\n if (options.populateQueryMetrics) {\n headers[Constants.HttpHeaders.PopulateQueryMetrics] = options.populateQueryMetrics;\n }\n\n if (options.maxDegreeOfParallelism !== undefined) {\n headers[Constants.HttpHeaders.ParallelizeCrossPartitionQuery] = true;\n }\n\n if (options.populateQuotaInfo) {\n headers[Constants.HttpHeaders.PopulateQuotaInfo] = true;\n }\n\n if (partitionKey !== undefined && !headers[Constants.HttpHeaders.PartitionKey]) {\n if (partitionKey === null || !Array.isArray(partitionKey)) {\n partitionKey = [partitionKey as string];\n }\n headers[Constants.HttpHeaders.PartitionKey] = jsonStringifyAndEscapeNonASCII(partitionKey);\n }\n\n if (clientOptions.key || clientOptions.tokenProvider) {\n headers[Constants.HttpHeaders.XDate] = new Date().toUTCString();\n }\n\n if (verb === HTTPMethod.post || verb === HTTPMethod.put) {\n if (!headers[Constants.HttpHeaders.ContentType]) {\n headers[Constants.HttpHeaders.ContentType] = JsonContentType;\n }\n }\n\n if (!headers[Constants.HttpHeaders.Accept]) {\n headers[Constants.HttpHeaders.Accept] = JsonContentType;\n }\n\n if (partitionKeyRangeId !== undefined) {\n headers[Constants.HttpHeaders.PartitionKeyRangeID] = partitionKeyRangeId;\n }\n\n if (options.enableScriptLogging) {\n headers[Constants.HttpHeaders.EnableScriptLogging] = options.enableScriptLogging;\n }\n\n if (options.disableRUPerMinuteUsage) {\n headers[Constants.HttpHeaders.DisableRUPerMinuteUsage] = true;\n }\n\n if (\n clientOptions.key ||\n clientOptions.resourceTokens ||\n clientOptions.tokenProvider ||\n clientOptions.permissionFeed\n ) {\n await setAuthorizationHeader(clientOptions, verb, path, resourceId, resourceType, headers);\n }\n return headers;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/request/request.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,8BAA8B,EAAE,YAAY,EAA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SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE;YAC/C,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC;SAC9D;KACF;IAED,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;QAC1C,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC;KACzD;IAED,IAAI,mBAAmB,KAAK,SAAS,EAAE;QACrC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;KAC1E;IAED,IAAI,OAAO,CAAC,mBAAmB,EAAE;QAC/B,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;KAClF;IAED,IAAI,OAAO,CAAC,uBAAuB,EAAE;QACnC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC;KAC/D;IAED,IACE,aAAa,CAAC,GAAG;QACjB,aAAa,CAAC,cAAc;QAC5B,aAAa,CAAC,aAAa;QAC3B,aAAa,CAAC,cAAc,EAC5B;QACA,MAAM,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;KAC5F;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { logger } from \"@azure/identity\";\nimport { setAuthorizationHeader } from \"../auth\";\nimport { Constants, HTTPMethod, jsonStringifyAndEscapeNonASCII, ResourceType } from \"../common\";\nimport { CosmosClientOptions } from \"../CosmosClientOptions\";\nimport { PartitionKey } from \"../documents\";\nimport { CosmosHeaders } from \"../queryExecutionContext\";\nimport { FeedOptions, RequestOptions } from \"./index\";\n\n// ----------------------------------------------------------------------------\n// Utility methods\n//\n\n/** @hidden */\nfunction javaScriptFriendlyJSONStringify(s: unknown): string {\n // two line terminators (Line separator and Paragraph separator) are not needed to be escaped in JSON\n // but are needed to be escaped in JavaScript.\n return JSON.stringify(s)\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\n}\n\n/** @hidden */\nexport function bodyFromData(data: Buffer | string | Record<string, unknown>): string {\n if (typeof data === \"object\") {\n return javaScriptFriendlyJSONStringify(data);\n }\n return data;\n}\n\n/**\n * @hidden\n */\ninterface GetHeadersOptions {\n clientOptions: CosmosClientOptions;\n defaultHeaders: CosmosHeaders;\n verb: HTTPMethod;\n path: string;\n resourceId: string;\n resourceType: ResourceType;\n options: RequestOptions & FeedOptions;\n partitionKeyRangeId?: string;\n useMultipleWriteLocations?: boolean;\n partitionKey?: PartitionKey;\n}\n\nconst JsonContentType = \"application/json\";\n\n/**\n * @hidden\n */\nexport async function getHeaders({\n clientOptions,\n defaultHeaders,\n verb,\n path,\n resourceId,\n resourceType,\n options = {},\n partitionKeyRangeId,\n useMultipleWriteLocations,\n partitionKey,\n}: GetHeadersOptions): Promise<CosmosHeaders> {\n const headers: CosmosHeaders = {\n [Constants.HttpHeaders.ResponseContinuationTokenLimitInKB]: 1,\n [Constants.HttpHeaders.EnableCrossPartitionQuery]: true,\n ...defaultHeaders,\n };\n\n if (useMultipleWriteLocations) {\n headers[Constants.HttpHeaders.ALLOW_MULTIPLE_WRITES] = true;\n }\n\n if (options.continuationTokenLimitInKB) {\n headers[Constants.HttpHeaders.ResponseContinuationTokenLimitInKB] =\n options.continuationTokenLimitInKB;\n }\n if (options.continuationToken) {\n headers[Constants.HttpHeaders.Continuation] = options.continuationToken;\n } else if (options.continuation) {\n headers[Constants.HttpHeaders.Continuation] = options.continuation;\n }\n\n if (options.preTriggerInclude) {\n headers[Constants.HttpHeaders.PreTriggerInclude] =\n options.preTriggerInclude.constructor === Array\n ? (options.preTriggerInclude as string[]).join(\",\")\n : (options.preTriggerInclude as string);\n }\n\n if (options.postTriggerInclude) {\n headers[Constants.HttpHeaders.PostTriggerInclude] =\n options.postTriggerInclude.constructor === Array\n ? (options.postTriggerInclude as string[]).join(\",\")\n : (options.postTriggerInclude as string);\n }\n\n if (options.offerType) {\n headers[Constants.HttpHeaders.OfferType] = options.offerType;\n }\n\n if (options.offerThroughput) {\n headers[Constants.HttpHeaders.OfferThroughput] = options.offerThroughput;\n }\n\n if (options.maxItemCount) {\n headers[Constants.HttpHeaders.PageSize] = options.maxItemCount;\n }\n\n if (options.accessCondition) {\n if (options.accessCondition.type === \"IfMatch\") {\n headers[Constants.HttpHeaders.IfMatch] = options.accessCondition.condition;\n } else {\n headers[Constants.HttpHeaders.IfNoneMatch] = options.accessCondition.condition;\n }\n }\n\n if (options.useIncrementalFeed) {\n headers[Constants.HttpHeaders.A_IM] = \"Incremental Feed\";\n }\n\n if (options.indexingDirective) {\n headers[Constants.HttpHeaders.IndexingDirective] = options.indexingDirective;\n }\n\n if (options.consistencyLevel) {\n headers[Constants.HttpHeaders.ConsistencyLevel] = options.consistencyLevel;\n }\n\n if (options.maxIntegratedCacheStalenessInMs && resourceType === ResourceType.item) {\n if (typeof options.maxIntegratedCacheStalenessInMs === \"number\") {\n headers[Constants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness] =\n options.maxIntegratedCacheStalenessInMs.toString();\n } else {\n logger.error(\n `RangeError: maxIntegratedCacheStalenessInMs \"${options.maxIntegratedCacheStalenessInMs}\" is not a valid parameter.`\n );\n headers[Constants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness] = \"null\";\n }\n }\n\n if (options.resourceTokenExpirySeconds) {\n headers[Constants.HttpHeaders.ResourceTokenExpiry] = options.resourceTokenExpirySeconds;\n }\n\n if (options.sessionToken) {\n headers[Constants.HttpHeaders.SessionToken] = options.sessionToken;\n }\n\n if (options.enableScanInQuery) {\n headers[Constants.HttpHeaders.EnableScanInQuery] = options.enableScanInQuery;\n }\n\n if (options.populateQuotaInfo) {\n headers[Constants.HttpHeaders.PopulateQuotaInfo] = options.populateQuotaInfo;\n }\n\n if (options.populateQueryMetrics) {\n headers[Constants.HttpHeaders.PopulateQueryMetrics] = options.populateQueryMetrics;\n }\n\n if (options.maxDegreeOfParallelism !== undefined) {\n headers[Constants.HttpHeaders.ParallelizeCrossPartitionQuery] = true;\n }\n\n if (options.populateQuotaInfo) {\n headers[Constants.HttpHeaders.PopulateQuotaInfo] = true;\n }\n\n if (partitionKey !== undefined && !headers[Constants.HttpHeaders.PartitionKey]) {\n if (partitionKey === null || !Array.isArray(partitionKey)) {\n partitionKey = [partitionKey as string];\n }\n headers[Constants.HttpHeaders.PartitionKey] = jsonStringifyAndEscapeNonASCII(partitionKey);\n }\n\n if (clientOptions.key || clientOptions.tokenProvider) {\n headers[Constants.HttpHeaders.XDate] = new Date().toUTCString();\n }\n\n if (verb === HTTPMethod.post || verb === HTTPMethod.put) {\n if (!headers[Constants.HttpHeaders.ContentType]) {\n headers[Constants.HttpHeaders.ContentType] = JsonContentType;\n }\n }\n\n if (!headers[Constants.HttpHeaders.Accept]) {\n headers[Constants.HttpHeaders.Accept] = JsonContentType;\n }\n\n if (partitionKeyRangeId !== undefined) {\n headers[Constants.HttpHeaders.PartitionKeyRangeID] = partitionKeyRangeId;\n }\n\n if (options.enableScriptLogging) {\n headers[Constants.HttpHeaders.EnableScriptLogging] = options.enableScriptLogging;\n }\n\n if (options.disableRUPerMinuteUsage) {\n headers[Constants.HttpHeaders.DisableRUPerMinuteUsage] = true;\n }\n\n if (\n clientOptions.key ||\n clientOptions.resourceTokens ||\n clientOptions.tokenProvider ||\n clientOptions.permissionFeed\n ) {\n await setAuthorizationHeader(clientOptions, verb, path, resourceId, resourceType, headers);\n }\n return headers;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/cosmos",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.1-alpha.20220822.2",
|
|
4
4
|
"description": "Microsoft Azure Cosmos DB Service Node.js SDK for SQL API",
|
|
5
5
|
"sdk-type": "client",
|
|
6
6
|
"keywords": [
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"uuid": "^8.3.0"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@azure/dev-tool": "
|
|
109
|
-
"@azure/eslint-plugin-azure-sdk": "
|
|
108
|
+
"@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
|
|
109
|
+
"@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
|
|
110
110
|
"@azure/identity": "^2.0.1",
|
|
111
111
|
"@azure/logger": "^1.0.0",
|
|
112
112
|
"@microsoft/api-extractor": "7.18.11",
|