@azure/data-tables 13.1.2-alpha.20220415.2 → 13.1.2-alpha.20220418.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.
@@ -2,7 +2,6 @@
2
2
  // Licensed under the MIT license.
3
3
  import { HeaderConstants, TRANSACTION_HTTP_LINE_ENDING, TRANSACTION_HTTP_VERSION_1_1, } from "./utils/constants";
4
4
  import { createHttpHeaders, createPipelineRequest, } from "@azure/core-rest-pipeline";
5
- import { URL } from "./utils/url";
6
5
  import { getChangeSetBoundary } from "./utils/transactionHelpers";
7
6
  export const transactionRequestAssemblePolicyName = "transactionRequestAssemblePolicy";
8
7
  const dummyResponse = {
@@ -1 +1 @@
1
- {"version":3,"file":"TablePolicies.js","sourceRoot":"","sources":["../../src/TablePolicies.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAKL,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,MAAM,oCAAoC,GAAG,kCAAkC,CAAC;AAEvF,MAAM,aAAa,GAAqB;IACtC,OAAO,EAAE,qBAAqB,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IAC/C,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,iBAAiB,EAAE;CAC7B,CAAC;AAEF,MAAM,UAAU,gCAAgC,CAC9C,SAAmB,EACnB,WAAmB;IAEnB,OAAO;QACL,IAAI,EAAE,oCAAoC;QAC1C,KAAK,CAAC,WAAW,CAAC,OAAwB;YACxC,MAAM,UAAU,GAAG,yBAAyB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YACnE,SAAS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AG,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,aAAa,IAAI,4BAA4B,EAAE,EAAE,sCAAsC;KACxH,CAAC;IAEF,uBAAuB;IACvB,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE;QAC3C,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;KACtC;IAED,0BAA0B;IAC1B,UAAU,CAAC,IAAI,CAAC,GAAG,4BAA4B,EAAE,CAAC,CAAC,CAAC,oDAAoD;IACxG,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;KACvC;IAED,qCAAqC;IACrC,OAAO,UAAU,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;AACvD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n HeaderConstants,\n TRANSACTION_HTTP_LINE_ENDING,\n TRANSACTION_HTTP_VERSION_1_1,\n} from \"./utils/constants\";\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n createHttpHeaders,\n createPipelineRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { URL } from \"./utils/url\";\nimport { getChangeSetBoundary } from \"./utils/transactionHelpers\";\n\nexport const transactionRequestAssemblePolicyName = \"transactionRequestAssemblePolicy\";\n\nconst dummyResponse: PipelineResponse = {\n request: createPipelineRequest({ url: \"FAKE\" }),\n status: 200,\n headers: createHttpHeaders(),\n};\n\nexport function transactionRequestAssemblePolicy(\n bodyParts: string[],\n changesetId: string\n): PipelinePolicy {\n return {\n name: transactionRequestAssemblePolicyName,\n async sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n const subRequest = getNextSubrequestBodyPart(request, changesetId);\n bodyParts.push(subRequest);\n // Intercept request from going to wire\n return dummyResponse;\n },\n };\n}\n\nexport const transactionHeaderFilterPolicyName = \"transactionHeaderFilterPolicy\";\n\nexport function transactionHeaderFilterPolicy(): PipelinePolicy {\n return {\n name: transactionHeaderFilterPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n // The subrequests should not have the x-ms-version header.\n request.headers.delete(HeaderConstants.X_MS_VERSION);\n return next(request);\n },\n };\n}\n\nfunction getSubRequestUrl(url: string): string {\n const sasTokenParts = [\"sv\", \"ss\", \"srt\", \"sp\", \"se\", \"st\", \"spr\", \"sig\"];\n const urlParsed = new URL(url);\n sasTokenParts.forEach((part) => urlParsed.searchParams.delete(part));\n return urlParsed.toString();\n}\n\nfunction getNextSubrequestBodyPart(request: PipelineRequest, changesetId: string) {\n const changesetBoundary = getChangeSetBoundary(changesetId);\n const subRequestPrefix = `--${changesetBoundary}${TRANSACTION_HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${TRANSACTION_HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`;\n\n const subRequestUrl = getSubRequestUrl(request.url);\n // Start to assemble sub request\n const subRequest = [\n subRequestPrefix, // sub request constant prefix\n \"\", // empty line after sub request's content ID\n `${request.method.toString()} ${subRequestUrl} ${TRANSACTION_HTTP_VERSION_1_1}`, // sub request start line with method,\n ];\n\n // Add required headers\n for (const [name, value] of request.headers) {\n subRequest.push(`${name}: ${value}`);\n }\n\n // Append sub-request body\n subRequest.push(`${TRANSACTION_HTTP_LINE_ENDING}`); // sub request's headers need end with an empty line\n if (request.body) {\n subRequest.push(String(request.body));\n }\n\n // Add subrequest to transaction body\n return subRequest.join(TRANSACTION_HTTP_LINE_ENDING);\n}\n"]}
1
+ {"version":3,"file":"TablePolicies.js","sourceRoot":"","sources":["../../src/TablePolicies.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,mBA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TION_HTTP_VERSION_1_1,\n} from \"./utils/constants\";\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n createHttpHeaders,\n createPipelineRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { getChangeSetBoundary } from \"./utils/transactionHelpers\";\n\nexport const transactionRequestAssemblePolicyName = \"transactionRequestAssemblePolicy\";\n\nconst dummyResponse: PipelineResponse = {\n request: createPipelineRequest({ url: \"FAKE\" }),\n status: 200,\n headers: createHttpHeaders(),\n};\n\nexport function transactionRequestAssemblePolicy(\n bodyParts: string[],\n changesetId: string\n): PipelinePolicy {\n return {\n name: transactionRequestAssemblePolicyName,\n async sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n const subRequest = getNextSubrequestBodyPart(request, changesetId);\n bodyParts.push(subRequest);\n // Intercept request from going to wire\n return dummyResponse;\n },\n };\n}\n\nexport const transactionHeaderFilterPolicyName = \"transactionHeaderFilterPolicy\";\n\nexport function transactionHeaderFilterPolicy(): PipelinePolicy {\n return {\n name: transactionHeaderFilterPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n // The subrequests should not have the x-ms-version header.\n request.headers.delete(HeaderConstants.X_MS_VERSION);\n return next(request);\n },\n };\n}\n\nfunction getSubRequestUrl(url: string): string {\n const sasTokenParts = [\"sv\", \"ss\", \"srt\", \"sp\", \"se\", \"st\", \"spr\", \"sig\"];\n const urlParsed = new URL(url);\n sasTokenParts.forEach((part) => urlParsed.searchParams.delete(part));\n return urlParsed.toString();\n}\n\nfunction getNextSubrequestBodyPart(request: PipelineRequest, changesetId: string) {\n const changesetBoundary = getChangeSetBoundary(changesetId);\n const subRequestPrefix = `--${changesetBoundary}${TRANSACTION_HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${TRANSACTION_HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`;\n\n const subRequestUrl = getSubRequestUrl(request.url);\n // Start to assemble sub request\n const subRequest = [\n subRequestPrefix, // sub request constant prefix\n \"\", // empty line after sub request's content ID\n `${request.method.toString()} ${subRequestUrl} ${TRANSACTION_HTTP_VERSION_1_1}`, // sub request start line with method,\n ];\n\n // Add required headers\n for (const [name, value] of request.headers) {\n subRequest.push(`${name}: ${value}`);\n }\n\n // Append sub-request body\n subRequest.push(`${TRANSACTION_HTTP_LINE_ENDING}`); // sub request's headers need end with an empty line\n if (request.body) {\n subRequest.push(String(request.body));\n }\n\n // Add subrequest to transaction body\n return subRequest.join(TRANSACTION_HTTP_LINE_ENDING);\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  import { HeaderConstants } from "./utils/constants";
4
- import { URL } from "./utils/url";
5
4
  import { computeHMACSHA256 } from "./utils/computeHMACSHA256";
6
5
  /**
7
6
  * The programmatic identifier of the tablesNamedKeyCredentialPolicy.
@@ -1 +1 @@
1
- {"version":3,"file":"tablesNamedCredentialPolicy.js","sourceRoot":"","sources":["../../src/tablesNamedCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,gCAAgC,CAAC;AAEnF;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAAC,UAA8B;IAC3E,SAAS,WAAW,CAAC,OAAwB;QAC3C,MAAM,WAAW,GAAG,sBAAsB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAChE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED,OAAO;QACL,IAAI,EAAE,kCAAkC;QACxC,K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,CAAC,UAAU,CAAC,CAAC;IAE9C,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,EAAE,CAAC;KACX;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,8BAA8B,CACrC,OAAwB,EACxB,UAA8B;IAE9B,kJAAkJ;IAClJ,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC;IACjC,IAAI,2BAA2B,GAAG,GAAG,GAAG,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;IAE/D,sKAAsK;IACtK,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE1C,IAAI,IAAI,EAAE;QACR,2BAA2B,GAAG,GAAG,2BAA2B,SAAS,IAAI,EAAE,CAAC;KAC7E;IAED,OAAO,2BAA2B,CAAC;AACrC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { HeaderConstants } from \"./utils/constants\";\nimport { NamedKeyCredential } from \"@azure/core-auth\";\nimport { URL } from \"./utils/url\";\nimport { computeHMACSHA256 } from \"./utils/computeHMACSHA256\";\n\n/**\n * The programmatic identifier of the tablesNamedKeyCredentialPolicy.\n */\nexport const tablesNamedKeyCredentialPolicyName = \"tablesNamedKeyCredentialPolicy\";\n\n/**\n * tablesNamedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key.\n */\nexport function tablesNamedKeyCredentialPolicy(credential: NamedKeyCredential): PipelinePolicy {\n function signRequest(request: PipelineRequest): void {\n const headerValue = getAuthorizationHeader(request, credential);\n request.headers.set(HeaderConstants.AUTHORIZATION, headerValue);\n }\n\n return {\n name: tablesNamedKeyCredentialPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n signRequest(request);\n return next(request);\n },\n };\n}\n\nexport function getAuthorizationHeader(\n request: PipelineRequest,\n credential: NamedKeyCredential\n): string {\n if (!request.headers.has(HeaderConstants.X_MS_DATE)) {\n request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString());\n }\n\n if (request.body && typeof request.body === \"string\" && request.body.length > 0) {\n request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));\n }\n\n // If x-ms-date is present, use it otherwise date\n const dateHeader = getHeaderValueToSign(request, HeaderConstants.X_MS_DATE);\n\n if (!dateHeader) {\n throw new Error(\"Failed to sign request: x-ms-date or date header must be present\");\n }\n\n const stringToSign: string = [\n dateHeader,\n getCanonicalizedResourceString(request, credential),\n ].join(\"\\n\");\n\n const signature = computeHMACSHA256(stringToSign, credential.key);\n\n return `SharedKeyLite ${credential.name}:${signature}`;\n}\n\nfunction getHeaderValueToSign(request: PipelineRequest, headerName: string): string {\n const value = request.headers.get(headerName);\n\n if (!value) {\n return \"\";\n }\n return value;\n}\n\nfunction getCanonicalizedResourceString(\n request: PipelineRequest,\n credential: NamedKeyCredential\n): string {\n // https://docs.microsoft.com/rest/api/storageservices/authorize-with-shared-key#shared-key-lite-and-table-service-format-for-2009-09-19-and-later\n const url = new URL(request.url);\n const path = url.pathname || \"/\";\n let canonicalizedResourceString = \"/\" + credential.name + path;\n\n // The query string should include the question mark and the comp parameter (for example, ?comp=metadata). No other parameters should be included on the query string.\n const comp = url.searchParams.get(\"comp\");\n\n if (comp) {\n canonicalizedResourceString = `${canonicalizedResourceString}?comp=${comp}`;\n }\n\n return canonicalizedResourceString;\n}\n"]}
1
+ {"version":3,"file":"tablesNamedCredentialPolicy.js","sourceRoot":"","sources":["../../src/tablesNamedCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,i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,CAAC,CAAC;KACrF;IAED,MAAM,YAAY,GAAW;QAC3B,UAAU;QACV,8BAA8B,CAAC,OAAO,EAAE,UAAU,CAAC;KACpD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,SAAS,GAAG,iBAAiB,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAElE,OAAO,iBAAiB,UAAU,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC;AACzD,CAAC;AAED,SAAS,oBAAoB,CAAC,OAAwB,EAAE,UAAkB;IACxE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAE9C,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,EAAE,CAAC;KACX;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,8BAA8B,CACrC,OAAwB,EACxB,UAA8B;IAE9B,kJAAkJ;IAClJ,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC;IACjC,IAAI,2BAA2B,GAAG,GAAG,GAAG,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;IAE/D,sKAAsK;IACtK,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE1C,IAAI,IAAI,EAAE;QACR,2BAA2B,GAAG,GAAG,2BAA2B,SAAS,IAAI,EAAE,CAAC;KAC7E;IAED,OAAO,2BAA2B,CAAC;AACrC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { HeaderConstants } from \"./utils/constants\";\nimport { NamedKeyCredential } from \"@azure/core-auth\";\nimport { computeHMACSHA256 } from \"./utils/computeHMACSHA256\";\n\n/**\n * The programmatic identifier of the tablesNamedKeyCredentialPolicy.\n */\nexport const tablesNamedKeyCredentialPolicyName = \"tablesNamedKeyCredentialPolicy\";\n\n/**\n * tablesNamedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key.\n */\nexport function tablesNamedKeyCredentialPolicy(credential: NamedKeyCredential): PipelinePolicy {\n function signRequest(request: PipelineRequest): void {\n const headerValue = getAuthorizationHeader(request, credential);\n request.headers.set(HeaderConstants.AUTHORIZATION, headerValue);\n }\n\n return {\n name: tablesNamedKeyCredentialPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n signRequest(request);\n return next(request);\n },\n };\n}\n\nexport function getAuthorizationHeader(\n request: PipelineRequest,\n credential: NamedKeyCredential\n): string {\n if (!request.headers.has(HeaderConstants.X_MS_DATE)) {\n request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString());\n }\n\n if (request.body && typeof request.body === \"string\" && request.body.length > 0) {\n request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));\n }\n\n // If x-ms-date is present, use it otherwise date\n const dateHeader = getHeaderValueToSign(request, HeaderConstants.X_MS_DATE);\n\n if (!dateHeader) {\n throw new Error(\"Failed to sign request: x-ms-date or date header must be present\");\n }\n\n const stringToSign: string = [\n dateHeader,\n getCanonicalizedResourceString(request, credential),\n ].join(\"\\n\");\n\n const signature = computeHMACSHA256(stringToSign, credential.key);\n\n return `SharedKeyLite ${credential.name}:${signature}`;\n}\n\nfunction getHeaderValueToSign(request: PipelineRequest, headerName: string): string {\n const value = request.headers.get(headerName);\n\n if (!value) {\n return \"\";\n }\n return value;\n}\n\nfunction getCanonicalizedResourceString(\n request: PipelineRequest,\n credential: NamedKeyCredential\n): string {\n // https://docs.microsoft.com/rest/api/storageservices/authorize-with-shared-key#shared-key-lite-and-table-service-format-for-2009-09-19-and-later\n const url = new URL(request.url);\n const path = url.pathname || \"/\";\n let canonicalizedResourceString = \"/\" + credential.name + path;\n\n // The query string should include the question mark and the comp parameter (for example, ?comp=metadata). No other parameters should be included on the query string.\n const comp = url.searchParams.get(\"comp\");\n\n if (comp) {\n canonicalizedResourceString = `${canonicalizedResourceString}?comp=${comp}`;\n }\n\n return canonicalizedResourceString;\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- import { URL, URLSearchParams } from "./utils/url";
4
3
  /**
5
4
  * The programmatic identifier of the tablesSASTokenPolicy.
6
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"tablesSASTokenPolicy.js","sourceRoot":"","sources":["../../src/tablesSASTokenPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAQlC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAyB;IAC5D,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAwB,EAAE,UAAyB;IAChF,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC5D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEjC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,SAAS,EAAE;QACrC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KACtC;IACD,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { URL, URLSearchParams } from \"./utils/url\";\nimport { SASCredential } from \"@azure/core-auth\";\n\n/**\n * The programmatic identifier of the tablesSASTokenPolicy.\n */\nexport const tablesSASTokenPolicyName = \"tablesSASTokenPolicy\";\n\n/**\n * tablesSASTokenPolicy is a policy used to sign HTTP request with a shared key.\n */\nexport function tablesSASTokenPolicy(credential: SASCredential): PipelinePolicy {\n return {\n name: tablesSASTokenPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n signURLWithSAS(request, credential);\n return next(request);\n },\n };\n}\n\nexport function signURLWithSAS(request: PipelineRequest, credential: SASCredential): void {\n const sasParams = new URLSearchParams(credential.signature);\n const url = new URL(request.url);\n\n for (const [name, value] of sasParams) {\n url.searchParams.append(name, value);\n }\n request.url = url.toString();\n}\n"]}
1
+ {"version":3,"file":"tablesSASTokenPolicy.js","sourceRoot":"","sources":["../../src/tablesSASTokenPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAyB;IAC5D,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAwB,EAAE,UAAyB;IAChF,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC5D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEjC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,SAAS,EAAE;QACrC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;KACtC;IACD,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { SASCredential } from \"@azure/core-auth\";\n\n/**\n * The programmatic identifier of the tablesSASTokenPolicy.\n */\nexport const tablesSASTokenPolicyName = \"tablesSASTokenPolicy\";\n\n/**\n * tablesSASTokenPolicy is a policy used to sign HTTP request with a shared key.\n */\nexport function tablesSASTokenPolicy(credential: SASCredential): PipelinePolicy {\n return {\n name: tablesSASTokenPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n signURLWithSAS(request, credential);\n return next(request);\n },\n };\n}\n\nexport function signURLWithSAS(request: PipelineRequest, credential: SASCredential): void {\n const sasParams = new URLSearchParams(credential.signature);\n const url = new URL(request.url);\n\n for (const [name, value] of sasParams) {\n url.searchParams.append(name, value);\n }\n request.url = url.toString();\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  import { fromAccountConnectionString, getAccountConnectionString } from "./accountConnectionString";
4
- import { URL } from "./url";
5
4
  const DevelopmentConnectionString = "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1";
6
5
  /**
7
6
  * This function parses a connection string into a set of
@@ -1 +1 @@
1
- {"version":3,"file":"connectionString.js","sourceRoot":"","sources":["../../../src/utils/connectionString.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAGpG,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,MAAM,2BAA2B,GAC/B,sNAAsN,CAAC;AAEzN;;;;;;;;;GASG;AACH,MAAM,UAAU,mCAAmC,CACjD,gBAAwB,EACxB,UAAqC,EAAE;IAEvC,IAAI,gBAAgB,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/E,gBAAgB,GAAG,2BAA2B,CAAC;QAC/C,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;KACxC;IACD,MAAM,cAAc,GAAG,4BAA4B,CAAC,gBAAgB,CAAC,CAAC;IACtE,IAAI,cAAc,CAAC,IAAI,KAAK,mBAAmB,EAAE;QAC/C,OAAO,2BAA2B,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;KAC7D;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,eAAe,EAAE;QAClD,OAAO;YACL,GAAG,EAAE,GAAG,cAAc,CAAC,GAAG,IAAI,cAAc,CAAC,UAAU,EAAE;YACzD,OAAO;SACR,CAAC;KACH;SAAM;QACL,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;KACH;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,gBAAwB;IACnE,0DAA0D;IAC1D,IAAI,aAAa,GAAG,oBAAoB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAC5E,uCAAuC;IACvC,kGAAkG;IAClG,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,C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M,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,WAAW,CAAC;IAEhB,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC;IAClC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,IAAI,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;QACrD,0EAA0E;QAC1E,uCAAuC;QACvC,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QACjD,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KAClC;SAAM,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE;QAChC,iFAAiF;QACjF,2GAA2G;QAC3G,mCAAmC;QACnC,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;KAC5B;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;KAC7E;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientParamsFromConnectionString, ConnectionString } from \"./internalModels\";\nimport { fromAccountConnectionString, getAccountConnectionString } from \"./accountConnectionString\";\n\nimport { TableServiceClientOptions } from \"../models\";\nimport { URL } from \"./url\";\n\nconst DevelopmentConnectionString =\n \"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1\";\n\n/**\n * This function parses a connection string into a set of\n * parameters to pass to be passed to TableClientService,\n * depending on the connection string type these parameter would\n * contain:\n * - Account Connection String: A pipeline to sign the request with a SharedKey\n * - SAS Connection String: Attach a SAS token to the storage account url for authentication\n * @param connectionString - Connection string to parse\n * @param options - TableService client options\n */\nexport function getClientParamsFromConnectionString(\n connectionString: string,\n options: TableServiceClientOptions = {}\n): ClientParamsFromConnectionString {\n if (connectionString.toLowerCase().indexOf(\"usedevelopmentstorage=true\") !== -1) {\n connectionString = DevelopmentConnectionString;\n options.allowInsecureConnection = true;\n }\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n return fromAccountConnectionString(extractedCreds, options);\n } else if (extractedCreds.kind === \"SASConnString\") {\n return {\n url: `${extractedCreds.url}?${extractedCreds.accountSas}`,\n options,\n };\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\"\n );\n }\n}\n\n/**\n * Extracts the parts of an Storage account connection string.\n *\n * @param connectionString - Connection string.\n * @returns String key value pairs of the storage account's url and credentials.\n */\nexport function extractConnectionStringParts(connectionString: string): ConnectionString {\n // Matching TableEndpoint in the Account connection string\n let tableEndpoint = getValueInConnString(connectionString, \"TableEndpoint\");\n // Slicing off '/' at the end if exists\n // (The methods that use `extractConnectionStringParts` expect the url to not have `/` at the end)\n tableEndpoint = tableEndpoint.endsWith(\"/\") ? tableEndpoint.slice(0, -1) : tableEndpoint;\n\n if (isAccountConnectionString(connectionString)) {\n return getAccountConnectionString(\n getValueInConnString(connectionString, \"AccountName\"),\n getValueInConnString(connectionString, \"AccountKey\"),\n getValueInConnString(connectionString, \"DefaultEndpointsProtocol\"),\n getValueInConnString(connectionString, \"EndpointSuffix\"),\n tableEndpoint\n );\n } else {\n return getSASConnectionString(connectionString, tableEndpoint);\n }\n}\n\n/**\n * Checks whether a connection string is an Account Connection string or not\n */\nfunction isAccountConnectionString(connectionString: string) {\n const lowercaseConnectionString = connectionString.toLowerCase();\n return (\n lowercaseConnectionString.search(\"defaultendpointsprotocol=\") !== -1 &&\n lowercaseConnectionString.search(\"accountkey=\") !== -1\n );\n}\n\nfunction getSASConnectionString(connectionString: string, tableEndpoint: string): ConnectionString {\n const accountName = getAccountNameFromUrl(tableEndpoint);\n const accountSas = getValueInConnString(connectionString, \"SharedAccessSignature\");\n if (!tableEndpoint) {\n throw new Error(\"Invalid TableEndpoint in the provided SAS Connection String\");\n } else if (!accountSas) {\n throw new Error(\"Invalid SharedAccessSignature in the provided SAS Connection String\");\n } else if (!accountName) {\n throw new Error(\"Invalid AccountName in the provided SAS Connection String\");\n }\n\n return { kind: \"SASConnString\", url: tableEndpoint, accountName, accountSas };\n}\n\nfunction getValueInConnString(\n connectionString: string,\n argument:\n | \"TableEndpoint\"\n | \"AccountName\"\n | \"AccountKey\"\n | \"DefaultEndpointsProtocol\"\n | \"EndpointSuffix\"\n | \"SharedAccessSignature\"\n): string {\n const searchKey = argument.toLowerCase();\n const elements = connectionString.split(\";\").filter((e) => Boolean(e));\n for (const element of elements) {\n const trimmedElement = element.trim();\n const [elementKey, value] = getValuePair(trimmedElement);\n const key = elementKey.toLowerCase();\n if (key === searchKey) {\n return value;\n }\n }\n return \"\";\n}\n\nfunction getValuePair(kvp: string): string[] {\n // If the string is not in kvp format <key>=<valye> return an empty array\n if (!kvp || kvp.indexOf(\"=\") === -1) {\n return [];\n }\n // Get the substring before the first '='\n const key = kvp.substr(0, kvp.indexOf(\"=\"));\n // Get the substring after the first '='\n const value = kvp.substr(kvp.indexOf(\"=\") + 1);\n\n return [key, value];\n}\n\n/**\n * Extracts account name from the url\n * @param url - URL to extract the account name from\n * @returns The account name\n */\nfunction getAccountNameFromUrl(url: string): string {\n if (!url) {\n return url;\n }\n\n const parsedUrl = new URL(url);\n let accountName;\n\n const host = parsedUrl.host || \"\";\n const path = parsedUrl.pathname || \"\";\n const hostParts = host.split(\".\");\n const pathParts = path.split(\"/\");\n\n if (hostParts.length >= 1 && hostParts[1] === \"table\") {\n // `${defaultEndpointsProtocol}://${accountName}.table.${endpointSuffix}`;\n // Slicing off '/' at the end if exists\n url = url.endsWith(\"/\") ? url.slice(0, -1) : url;\n accountName = host.split(\".\")[0];\n } else if (pathParts.length >= 1) {\n // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/\n // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/\n // .getPath() -> /devstoreaccount1/\n accountName = pathParts[1];\n } else {\n throw new Error(\"Unable to extract accountName with provided information.\");\n }\n\n return accountName;\n}\n"]}
1
+ {"version":3,"file":"connectionString.js","sourceRoot":"","sources":["../../../src/utils/connectionString.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAIpG,MAAM,2BAA2B,GAC/B,sNAAsN,CAAC;AAEzN;;;;;;;;;GASG;AACH,MAAM,UAAU,mCAAmC,CACjD,gBAAwB,EACxB,UAAqC,EAAE;IAEvC,IAAI,gBAAgB,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/E,gBAAgB,GAAG,2BAA2B,CAAC;QAC/C,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;KACxC;IACD,MAAM,cAAc,GAAG,4BAA4B,CAAC,gBAAgB,CAAC,CAAC;IACtE,IAAI,cAAc,CAAC,IAAI,KAAK,mBAAmB,EAAE;QAC/C,OAAO,2BAA2B,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;KAC7D;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,eAAe,EAAE;QAClD,OAAO;YACL,GAAG,EAAE,GAAG,cAAc,CAAC,GAAG,IAAI,cAAc,CAA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KAC7E;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientParamsFromConnectionString, ConnectionString } from \"./internalModels\";\nimport { fromAccountConnectionString, getAccountConnectionString } from \"./accountConnectionString\";\n\nimport { TableServiceClientOptions } from \"../models\";\n\nconst DevelopmentConnectionString =\n \"DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1\";\n\n/**\n * This function parses a connection string into a set of\n * parameters to pass to be passed to TableClientService,\n * depending on the connection string type these parameter would\n * contain:\n * - Account Connection String: A pipeline to sign the request with a SharedKey\n * - SAS Connection String: Attach a SAS token to the storage account url for authentication\n * @param connectionString - Connection string to parse\n * @param options - TableService client options\n */\nexport function getClientParamsFromConnectionString(\n connectionString: string,\n options: TableServiceClientOptions = {}\n): ClientParamsFromConnectionString {\n if (connectionString.toLowerCase().indexOf(\"usedevelopmentstorage=true\") !== -1) {\n connectionString = DevelopmentConnectionString;\n options.allowInsecureConnection = true;\n }\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n return fromAccountConnectionString(extractedCreds, options);\n } else if (extractedCreds.kind === \"SASConnString\") {\n return {\n url: `${extractedCreds.url}?${extractedCreds.accountSas}`,\n options,\n };\n } else {\n throw new Error(\n \"Connection string must be either an Account connection string or a SAS connection string\"\n );\n }\n}\n\n/**\n * Extracts the parts of an Storage account connection string.\n *\n * @param connectionString - Connection string.\n * @returns String key value pairs of the storage account's url and credentials.\n */\nexport function extractConnectionStringParts(connectionString: string): ConnectionString {\n // Matching TableEndpoint in the Account connection string\n let tableEndpoint = getValueInConnString(connectionString, \"TableEndpoint\");\n // Slicing off '/' at the end if exists\n // (The methods that use `extractConnectionStringParts` expect the url to not have `/` at the end)\n tableEndpoint = tableEndpoint.endsWith(\"/\") ? tableEndpoint.slice(0, -1) : tableEndpoint;\n\n if (isAccountConnectionString(connectionString)) {\n return getAccountConnectionString(\n getValueInConnString(connectionString, \"AccountName\"),\n getValueInConnString(connectionString, \"AccountKey\"),\n getValueInConnString(connectionString, \"DefaultEndpointsProtocol\"),\n getValueInConnString(connectionString, \"EndpointSuffix\"),\n tableEndpoint\n );\n } else {\n return getSASConnectionString(connectionString, tableEndpoint);\n }\n}\n\n/**\n * Checks whether a connection string is an Account Connection string or not\n */\nfunction isAccountConnectionString(connectionString: string) {\n const lowercaseConnectionString = connectionString.toLowerCase();\n return (\n lowercaseConnectionString.search(\"defaultendpointsprotocol=\") !== -1 &&\n lowercaseConnectionString.search(\"accountkey=\") !== -1\n );\n}\n\nfunction getSASConnectionString(connectionString: string, tableEndpoint: string): ConnectionString {\n const accountName = getAccountNameFromUrl(tableEndpoint);\n const accountSas = getValueInConnString(connectionString, \"SharedAccessSignature\");\n if (!tableEndpoint) {\n throw new Error(\"Invalid TableEndpoint in the provided SAS Connection String\");\n } else if (!accountSas) {\n throw new Error(\"Invalid SharedAccessSignature in the provided SAS Connection String\");\n } else if (!accountName) {\n throw new Error(\"Invalid AccountName in the provided SAS Connection String\");\n }\n\n return { kind: \"SASConnString\", url: tableEndpoint, accountName, accountSas };\n}\n\nfunction getValueInConnString(\n connectionString: string,\n argument:\n | \"TableEndpoint\"\n | \"AccountName\"\n | \"AccountKey\"\n | \"DefaultEndpointsProtocol\"\n | \"EndpointSuffix\"\n | \"SharedAccessSignature\"\n): string {\n const searchKey = argument.toLowerCase();\n const elements = connectionString.split(\";\").filter((e) => Boolean(e));\n for (const element of elements) {\n const trimmedElement = element.trim();\n const [elementKey, value] = getValuePair(trimmedElement);\n const key = elementKey.toLowerCase();\n if (key === searchKey) {\n return value;\n }\n }\n return \"\";\n}\n\nfunction getValuePair(kvp: string): string[] {\n // If the string is not in kvp format <key>=<valye> return an empty array\n if (!kvp || kvp.indexOf(\"=\") === -1) {\n return [];\n }\n // Get the substring before the first '='\n const key = kvp.substr(0, kvp.indexOf(\"=\"));\n // Get the substring after the first '='\n const value = kvp.substr(kvp.indexOf(\"=\") + 1);\n\n return [key, value];\n}\n\n/**\n * Extracts account name from the url\n * @param url - URL to extract the account name from\n * @returns The account name\n */\nfunction getAccountNameFromUrl(url: string): string {\n if (!url) {\n return url;\n }\n\n const parsedUrl = new URL(url);\n let accountName;\n\n const host = parsedUrl.host || \"\";\n const path = parsedUrl.pathname || \"\";\n const hostParts = host.split(\".\");\n const pathParts = path.split(\"/\");\n\n if (hostParts.length >= 1 && hostParts[1] === \"table\") {\n // `${defaultEndpointsProtocol}://${accountName}.table.${endpointSuffix}`;\n // Slicing off '/' at the end if exists\n url = url.endsWith(\"/\") ? url.slice(0, -1) : url;\n accountName = host.split(\".\")[0];\n } else if (pathParts.length >= 1) {\n // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/\n // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/\n // .getPath() -> /devstoreaccount1/\n accountName = pathParts[1];\n } else {\n throw new Error(\"Unable to extract accountName with provided information.\");\n }\n\n return accountName;\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- import { URL } from "./url";
4
3
  export function isCosmosEndpoint(url) {
5
4
  const parsedURL = new URL(url);
6
5
  if (parsedURL.hostname.indexOf(".table.cosmosdb.") !== -1) {
@@ -1 +1 @@
1
- {"version":3,"file":"isCosmosEndpoint.js","sourceRoot":"","sources":["../../../src/utils/isCosmosEndpoint.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAE;QACzD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE;QACvD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,SAAS,CAAC,QAAQ,KAAK,WAAW,IAAI,SAAS,CAAC,IAAI,KAAK,OAAO,EAAE;QACpE,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { URL } from \"./url\";\n\nexport function isCosmosEndpoint(url: string): boolean {\n const parsedURL = new URL(url);\n if (parsedURL.hostname.indexOf(\".table.cosmosdb.\") !== -1) {\n return true;\n }\n\n if (parsedURL.hostname.indexOf(\".table.cosmos.\") !== -1) {\n return true;\n }\n\n if (parsedURL.hostname === \"localhost\" && parsedURL.port !== \"10002\") {\n return true;\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"file":"isCosmosEndpoint.js","sourceRoot":"","sources":["../../../src/utils/isCosmosEndpoint.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAE;QACzD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE;QACvD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,SAAS,CAAC,QAAQ,KAAK,WAAW,IAAI,SAAS,CAAC,IAAI,KAAK,OAAO,EAAE;QACpE,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport function isCosmosEndpoint(url: string): boolean {\n const parsedURL = new URL(url);\n if (parsedURL.hostname.indexOf(\".table.cosmosdb.\") !== -1) {\n return true;\n }\n\n if (parsedURL.hostname.indexOf(\".table.cosmos.\") !== -1) {\n return true;\n }\n\n if (parsedURL.hostname === \"localhost\" && parsedURL.port !== \"10002\") {\n return true;\n }\n\n return false;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/data-tables",
3
- "version": "13.1.2-alpha.20220415.2",
3
+ "version": "13.1.2-alpha.20220418.2",
4
4
  "description": "An isomorphic client library for the Azure Tables service.",
5
5
  "sdk-type": "client",
6
6
  "main": "dist/index.js",
@@ -8,7 +8,6 @@
8
8
  "browser": {
9
9
  "./dist-esm/src/tablesNamedCredentialPolicy.js": "./dist-esm/src/tablesNamedCredentialPolicy.browser.js",
10
10
  "./dist-esm/src/utils/accountConnectionString.js": "./dist-esm/src/utils/accountConnectionString.browser.js",
11
- "./dist-esm/src/utils/url.js": "./dist-esm/src/utils/url.browser.js",
12
11
  "./dist-esm/src/utils/computeHMACSHA256.js": "./dist-esm/src/utils/computeHMACSHA256.browser.js",
13
12
  "./dist-esm/src/utils/bufferSerializer.js": "./dist-esm/src/utils/bufferSerializer.browser.js",
14
13
  "./dist-esm/src/utils/transactionHeaders.js": "./dist-esm/src/utils/transactionHeaders.browser.js",
@@ -1,6 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- const url = URL;
4
- const urlSearchParams = URLSearchParams;
5
- export { url as URL, urlSearchParams as URLSearchParams };
6
- //# sourceMappingURL=url.browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url.browser.js","sourceRoot":"","sources":["../../../src/utils/url.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,GAAG,GAAG,GAAG,CAAC;AAChB,MAAM,eAAe,GAAG,eAAe,CAAC;AAExC,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,eAAe,IAAI,eAAe,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nconst url = URL;\nconst urlSearchParams = URLSearchParams;\n\nexport { url as URL, urlSearchParams as URLSearchParams };\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export { URL, URLSearchParams } from "url";
4
- //# sourceMappingURL=url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url.js","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { URL, URLSearchParams } from \"url\";\n"]}