@azure/data-tables 13.3.0-alpha.20241029.1 → 13.3.0-alpha.20241030.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +0 -5
- package/dist/index.js.map +1 -1
- package/dist-esm/src/TableClient.js +1 -1
- package/dist-esm/src/TableClient.js.map +1 -1
- package/dist-esm/src/TablePolicies.js +1 -1
- package/dist-esm/src/TablePolicies.js.map +1 -1
- package/dist-esm/src/TableServiceClient.js +1 -1
- package/dist-esm/src/TableServiceClient.js.map +1 -1
- package/dist-esm/src/TableTransaction.js +2 -2
- package/dist-esm/src/TableTransaction.js.map +1 -1
- package/dist-esm/src/cosmosPathPolicy.js.map +1 -1
- package/dist-esm/src/logger.js.map +1 -1
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/sas/accountSasSignatureValues.js.map +1 -1
- package/dist-esm/src/sas/generateAccountSas.js +1 -1
- package/dist-esm/src/sas/generateAccountSas.js.map +1 -1
- package/dist-esm/src/sas/generateTableSas.js +1 -1
- package/dist-esm/src/sas/generateTableSas.js.map +1 -1
- package/dist-esm/src/sas/sasQueryParameters.js.map +1 -1
- package/dist-esm/src/sas/tableSasSignatureValues.js +0 -5
- package/dist-esm/src/sas/tableSasSignatureValues.js.map +1 -1
- package/dist-esm/src/secondaryEndpointPolicy.js.map +1 -1
- package/dist-esm/src/serialization.js.map +1 -1
- package/dist-esm/src/tablesNamedCredentialPolicy.browser.js.map +1 -1
- package/dist-esm/src/tablesNamedCredentialPolicy.js.map +1 -1
- package/dist-esm/src/tablesSASTokenPolicy.js.map +1 -1
- package/dist-esm/src/utils/accountConnectionString.browser.js.map +1 -1
- package/dist-esm/src/utils/accountConnectionString.js.map +1 -1
- package/dist-esm/src/utils/apiVersionPolicy.js.map +1 -1
- package/dist-esm/src/utils/baseTransactionHeaders.js.map +1 -1
- package/dist-esm/src/utils/challengeAuthenticationUtils.js.map +1 -1
- package/dist-esm/src/utils/connectionString.js.map +1 -1
- package/dist-esm/src/utils/errorHelpers.js.map +1 -1
- package/dist-esm/src/utils/internalModels.js.map +1 -1
- package/dist-esm/src/utils/isCredential.js +1 -1
- package/dist-esm/src/utils/isCredential.js.map +1 -1
- package/dist-esm/src/utils/transactionHeaders.js.map +1 -1
- package/package.json +1 -1
- package/types/latest/data-tables.d.ts +6 -6
|
@@ -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;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,CAAC;QAChF,gBAAgB,GAAG,2BAA2B,CAAC;QAC/C,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;IACzC,CAAC;IACD,MAAM,cAAc,GAAG,4BAA4B,CAAC,gBAAgB,CAAC,CAAC;IACtE,IAAI,cAAc,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;QAChD,OAAO,2BAA2B,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;SAAM,IAAI,cAAc,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QACnD,OAAO;YACL,GAAG,EAAE,GAAG,cAAc,CAAC,GAAG,IAAI,cAAc,CAAC,UAAU,EAAE;YACzD,OAAO;SACR,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,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O,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
|
+
{"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,CAAC;QAChF,gBAAgB,GAAG,2BAA2B,CAAC;QAC/C,OAAO,CAAC,uBAAuB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tD,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;IACnC,CAAC;SAAM,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACjC,iFAAiF;QACjF,2GAA2G;QAC3G,mCAAmC;QACnC,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientParamsFromConnectionString, ConnectionString } from \"./internalModels\";\nimport { fromAccountConnectionString, getAccountConnectionString } from \"./accountConnectionString\";\n\nimport type { 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHelpers.js","sourceRoot":"","sources":["../../../src/utils/errorHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAsBlC,MAAM,UAAU,wBAAwB,CACtC,KAAc,EACd,UAA2E,EAAE;;IAE7E,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC9C,IACE,aAAa;QACb,aAAa,CAAC,MAAM,KAAK,GAAG;QAC5B,CAAA,MAAA,aAAa,CAAC,UAAU,CAAC,UAAU,0CAAE,IAAI,MAAK,oBAAoB,EAClE,CAAC;QACD,MAAA,OAAO,CAAC,MAAM,0CAAE,IAAI,CAAC,SAAS,OAAO,CAAC,SAAS,iBAAiB,CAAC,CAAC;QAElE,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,aAAa,GAA8B,KAAK,CAAC,QAAqC,CAAC;IAE7F,IAAI,CAAC,aAAa,IAAI,CAAC,2BAA2B,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7E,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAQ,KAAmB,CAAC,IAAI,KAAK,WAAW,CAAC;AACnD,CAAC;AAED,SAAS,2BAA2B,CAClC,iBAAsB;IAEtB,OAAO,OAAO,CAAC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,UAAU,CAAC,CAAC;AAChD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationOptions, OperationRequest } from \"@azure/core-client\";\nimport { PipelineResponse, RestError } from \"@azure/core-rest-pipeline\";\nimport { AzureLogger } from \"@azure/logger\";\nimport { TableServiceError } from \"../generated\";\n\nexport type TableServiceErrorResponse = PipelineResponse & {\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders?: Record<string, unknown>;\n /**\n * The response body as parsed JSON or XML.\n */\n parsedBody: TableServiceError;\n /**\n * The request that generated the response.\n */\n request: OperationRequest;\n};\n\nexport function handleTableAlreadyExists(\n error: unknown,\n options: OperationOptions & { tableName?: string; logger?: AzureLogger } = {},\n): void {\n const responseError = getErrorResponse(error);\n if (\n responseError &&\n responseError.status === 409 &&\n responseError.parsedBody.odataError?.code === \"TableAlreadyExists\"\n ) {\n options.logger?.info(`Table ${options.tableName} already Exists`);\n\n if (options.onResponse) {\n options.onResponse(responseError, {});\n }\n } else {\n throw error;\n }\n}\n\nfunction getErrorResponse(error: unknown): TableServiceErrorResponse | undefined {\n if (!isRestError(error)) {\n return undefined;\n }\n\n const errorResponse: TableServiceErrorResponse = error.response as TableServiceErrorResponse;\n\n if (!errorResponse || !isTableServiceErrorResponse(errorResponse.parsedBody)) {\n return undefined;\n }\n\n return errorResponse;\n}\n\nfunction isRestError(error: unknown): error is RestError {\n return (error as RestError).name === \"RestError\";\n}\n\nfunction isTableServiceErrorResponse(\n errorResponseBody: any,\n): errorResponseBody is TableServiceError {\n return Boolean(errorResponseBody?.odataError);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"errorHelpers.js","sourceRoot":"","sources":["../../../src/utils/errorHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAsBlC,MAAM,UAAU,wBAAwB,CACtC,KAAc,EACd,UAA2E,EAAE;;IAE7E,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC9C,IACE,aAAa;QACb,aAAa,CAAC,MAAM,KAAK,GAAG;QAC5B,CAAA,MAAA,aAAa,CAAC,UAAU,CAAC,UAAU,0CAAE,IAAI,MAAK,oBAAoB,EAClE,CAAC;QACD,MAAA,OAAO,CAAC,MAAM,0CAAE,IAAI,CAAC,SAAS,OAAO,CAAC,SAAS,iBAAiB,CAAC,CAAC;QAElE,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,aAAa,GAA8B,KAAK,CAAC,QAAqC,CAAC;IAE7F,IAAI,CAAC,aAAa,IAAI,CAAC,2BAA2B,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7E,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAQ,KAAmB,CAAC,IAAI,KAAK,WAAW,CAAC;AACnD,CAAC;AAED,SAAS,2BAA2B,CAClC,iBAAsB;IAEtB,OAAO,OAAO,CAAC,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,UAAU,CAAC,CAAC;AAChD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, OperationRequest } from \"@azure/core-client\";\nimport type { PipelineResponse, RestError } from \"@azure/core-rest-pipeline\";\nimport type { AzureLogger } from \"@azure/logger\";\nimport type { TableServiceError } from \"../generated\";\n\nexport type TableServiceErrorResponse = PipelineResponse & {\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders?: Record<string, unknown>;\n /**\n * The response body as parsed JSON or XML.\n */\n parsedBody: TableServiceError;\n /**\n * The request that generated the response.\n */\n request: OperationRequest;\n};\n\nexport function handleTableAlreadyExists(\n error: unknown,\n options: OperationOptions & { tableName?: string; logger?: AzureLogger } = {},\n): void {\n const responseError = getErrorResponse(error);\n if (\n responseError &&\n responseError.status === 409 &&\n responseError.parsedBody.odataError?.code === \"TableAlreadyExists\"\n ) {\n options.logger?.info(`Table ${options.tableName} already Exists`);\n\n if (options.onResponse) {\n options.onResponse(responseError, {});\n }\n } else {\n throw error;\n }\n}\n\nfunction getErrorResponse(error: unknown): TableServiceErrorResponse | undefined {\n if (!isRestError(error)) {\n return undefined;\n }\n\n const errorResponse: TableServiceErrorResponse = error.response as TableServiceErrorResponse;\n\n if (!errorResponse || !isTableServiceErrorResponse(errorResponse.parsedBody)) {\n return undefined;\n }\n\n return errorResponse;\n}\n\nfunction isRestError(error: unknown): error is RestError {\n return (error as RestError).name === \"RestError\";\n}\n\nfunction isTableServiceErrorResponse(\n errorResponseBody: any,\n): errorResponseBody is TableServiceError {\n return Boolean(errorResponseBody?.odataError);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalModels.js","sourceRoot":"","sources":["../../../src/utils/internalModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CreateTableEntityResponse,\n DeleteTableEntityOptions,\n GetTableEntityOptions,\n GetTableEntityResponse,\n ListTableEntitiesOptions,\n TableEntity,\n TableEntityResult,\n TableItem,\n TableServiceClientOptions,\n TableTransactionResponse,\n TransactionAction,\n UpdateMode,\n UpdateTableEntityOptions,\n} from \"../models\";\nimport { DeleteTableEntityResponse, UpdateEntityResponse, UpsertEntityResponse } from \"..\";\nimport { Pipeline, PipelineRequest } from \"@azure/core-rest-pipeline\";\nimport { NamedKeyCredential } from \"@azure/core-auth\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nexport interface ConnectionString {\n kind: \"AccountConnString\" | \"SASConnString\";\n url: string;\n accountName: string;\n accountKey?: any;\n accountSas?: string;\n}\n\n/**\n * Contains response data for the listTable operation.\n */\nexport type ListTableItemsResponse = Array<TableItem> & {\n /**\n * This header contains the continuation token value.\n */\n nextTableName?: string;\n};\n\n/**\n * Contains response data for the getEntity operation.\n */\nexport type ListEntitiesResponse<T extends object> = Array<TableEntityResult<T>> & {\n /**\n * Contains the continuation token value for the next page.\n */\n continuationToken?: string;\n};\n\nexport interface ClientParamsFromConnectionString {\n url: string;\n options?: TableServiceClientOptions;\n credential?: NamedKeyCredential;\n}\n\n/**\n * Transaction request builder\n */\nexport interface InnerTransactionRequest {\n /**\n * Transaction request body\n */\n body: string[];\n /**\n * Creates a pipeline to intercept sub-requests and\n * build the request body\n */\n createPipeline(): Pipeline;\n /**\n * Adds an operation to add to the transaction body\n * @param request - The operation to add\n */\n appendSubRequestToBody(request: PipelineRequest): void;\n /**\n * Gets the transaction request body\n */\n getHttpRequestBody(): string;\n}\n\nexport interface InternalTransactionClientOptions extends TableServiceClientOptions {\n innerTransactionRequest: InnerTransactionRequest;\n}\n\n/**\n * Describes the shape of a TableClient\n */\nexport interface TableClientLike {\n /**\n * Represents a pipeline for making a HTTP request to a URL.\n */\n pipeline: Pipeline;\n /**\n * Name of the table to perform operations on.\n */\n readonly tableName: string;\n /**\n * Creates the current table.\n * @param options - The options parameters.\n */\n createTable(options?: OperationOptions): Promise<void>;\n /**\n * Submits a Transaction which is composed of a set of actions.\n * @param actions - tuple that contains the action to perform, and the entity to perform the action with\n */\n submitTransaction(actions: TransactionAction[]): Promise<TableTransactionResponse>;\n /**\n * Insert entity in the table.\n * @param entity - The properties for the table entity.\n * @param options - The options parameters.\n */\n createEntity<T extends object>(\n entity: TableEntity<T>,\n options?: OperationOptions,\n ): Promise<CreateTableEntityResponse>;\n /**\n * Permanently deletes the current table with all of its entities.\n * @param options - The options parameters.\n */\n deleteTable(options?: OperationOptions): Promise<void>;\n /**\n * Permanently deletes the current table if it exists in the account.\n * @param options - The options parameters.\n */\n deleteEntity(\n partitionKey: string,\n rowKey: string,\n options?: DeleteTableEntityOptions,\n ): Promise<DeleteTableEntityResponse>;\n /**\n * Returns a single entity in the table.\n * @param partitionKey - The partition key of the entity.\n * @param rowKey - The row key of the entity.\n * @param options - The options parameters.\n */\n getEntity<T extends object>(\n partitionKey: string,\n rowKey: string,\n options?: GetTableEntityOptions,\n ): Promise<GetTableEntityResponse<T>>;\n /**\n * Queries entities in a table.\n * @param tableName - The name of the table.\n * @param options - The options parameters.\n */\n listEntities<T extends object>(\n options?: ListTableEntitiesOptions,\n ): PagedAsyncIterableIterator<T, ListEntitiesResponse<T>>;\n /**\n * Update an entity in the table.\n * @param entity - The properties of the entity to be updated.\n * @param mode - The different modes for updating the entity:\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n * @param options - The options parameters.\n */\n updateEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode,\n options?: UpdateTableEntityOptions,\n ): Promise<UpdateEntityResponse>;\n /**\n * Upsert an entity in the table.\n * @param tableName - The name of the table.\n * @param entity - The properties for the table entity.\n * @param mode - The different modes for updating the entity:\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n * @param options - The options parameters.\n */\n upsertEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode,\n options?: OperationOptions,\n ): Promise<UpsertEntityResponse>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internalModels.js","sourceRoot":"","sources":["../../../src/utils/internalModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n CreateTableEntityResponse,\n DeleteTableEntityOptions,\n GetTableEntityOptions,\n GetTableEntityResponse,\n ListTableEntitiesOptions,\n TableEntity,\n TableEntityResult,\n TableItem,\n TableServiceClientOptions,\n TableTransactionResponse,\n TransactionAction,\n UpdateMode,\n UpdateTableEntityOptions,\n} from \"../models\";\nimport type { DeleteTableEntityResponse, UpdateEntityResponse, UpsertEntityResponse } from \"..\";\nimport type { Pipeline, PipelineRequest } from \"@azure/core-rest-pipeline\";\nimport type { NamedKeyCredential } from \"@azure/core-auth\";\nimport type { OperationOptions } from \"@azure/core-client\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nexport interface ConnectionString {\n kind: \"AccountConnString\" | \"SASConnString\";\n url: string;\n accountName: string;\n accountKey?: any;\n accountSas?: string;\n}\n\n/**\n * Contains response data for the listTable operation.\n */\nexport type ListTableItemsResponse = Array<TableItem> & {\n /**\n * This header contains the continuation token value.\n */\n nextTableName?: string;\n};\n\n/**\n * Contains response data for the getEntity operation.\n */\nexport type ListEntitiesResponse<T extends object> = Array<TableEntityResult<T>> & {\n /**\n * Contains the continuation token value for the next page.\n */\n continuationToken?: string;\n};\n\nexport interface ClientParamsFromConnectionString {\n url: string;\n options?: TableServiceClientOptions;\n credential?: NamedKeyCredential;\n}\n\n/**\n * Transaction request builder\n */\nexport interface InnerTransactionRequest {\n /**\n * Transaction request body\n */\n body: string[];\n /**\n * Creates a pipeline to intercept sub-requests and\n * build the request body\n */\n createPipeline(): Pipeline;\n /**\n * Adds an operation to add to the transaction body\n * @param request - The operation to add\n */\n appendSubRequestToBody(request: PipelineRequest): void;\n /**\n * Gets the transaction request body\n */\n getHttpRequestBody(): string;\n}\n\nexport interface InternalTransactionClientOptions extends TableServiceClientOptions {\n innerTransactionRequest: InnerTransactionRequest;\n}\n\n/**\n * Describes the shape of a TableClient\n */\nexport interface TableClientLike {\n /**\n * Represents a pipeline for making a HTTP request to a URL.\n */\n pipeline: Pipeline;\n /**\n * Name of the table to perform operations on.\n */\n readonly tableName: string;\n /**\n * Creates the current table.\n * @param options - The options parameters.\n */\n createTable(options?: OperationOptions): Promise<void>;\n /**\n * Submits a Transaction which is composed of a set of actions.\n * @param actions - tuple that contains the action to perform, and the entity to perform the action with\n */\n submitTransaction(actions: TransactionAction[]): Promise<TableTransactionResponse>;\n /**\n * Insert entity in the table.\n * @param entity - The properties for the table entity.\n * @param options - The options parameters.\n */\n createEntity<T extends object>(\n entity: TableEntity<T>,\n options?: OperationOptions,\n ): Promise<CreateTableEntityResponse>;\n /**\n * Permanently deletes the current table with all of its entities.\n * @param options - The options parameters.\n */\n deleteTable(options?: OperationOptions): Promise<void>;\n /**\n * Permanently deletes the current table if it exists in the account.\n * @param options - The options parameters.\n */\n deleteEntity(\n partitionKey: string,\n rowKey: string,\n options?: DeleteTableEntityOptions,\n ): Promise<DeleteTableEntityResponse>;\n /**\n * Returns a single entity in the table.\n * @param partitionKey - The partition key of the entity.\n * @param rowKey - The row key of the entity.\n * @param options - The options parameters.\n */\n getEntity<T extends object>(\n partitionKey: string,\n rowKey: string,\n options?: GetTableEntityOptions,\n ): Promise<GetTableEntityResponse<T>>;\n /**\n * Queries entities in a table.\n * @param tableName - The name of the table.\n * @param options - The options parameters.\n */\n listEntities<T extends object>(\n options?: ListTableEntitiesOptions,\n ): PagedAsyncIterableIterator<T, ListEntitiesResponse<T>>;\n /**\n * Update an entity in the table.\n * @param entity - The properties of the entity to be updated.\n * @param mode - The different modes for updating the entity:\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n * @param options - The options parameters.\n */\n updateEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode,\n options?: UpdateTableEntityOptions,\n ): Promise<UpdateEntityResponse>;\n /**\n * Upsert an entity in the table.\n * @param tableName - The name of the table.\n * @param entity - The properties for the table entity.\n * @param mode - The different modes for updating the entity:\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n * @param options - The options parameters.\n */\n upsertEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode,\n options?: OperationOptions,\n ): Promise<UpsertEntityResponse>;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { isNamedKeyCredential, isSASCredential, isTokenCredential
|
|
3
|
+
import { isNamedKeyCredential, isSASCredential, isTokenCredential } from "@azure/core-auth";
|
|
4
4
|
export function isCredential(credential) {
|
|
5
5
|
return (isSASCredential(credential) || isNamedKeyCredential(credential) || isTokenCredential(credential));
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isCredential.js","sourceRoot":"","sources":["../../../src/utils/isCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"isCredential.js","sourceRoot":"","sources":["../../../src/utils/isCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE5F,MAAM,UAAU,YAAY,CAC1B,UAAmB;IAEnB,OAAO,CACL,eAAe,CAAC,UAAU,CAAC,IAAI,oBAAoB,CAAC,UAAU,CAAC,IAAI,iBAAiB,CAAC,UAAU,CAAC,CACjG,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NamedKeyCredential, SASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isNamedKeyCredential, isSASCredential, isTokenCredential } from \"@azure/core-auth\";\n\nexport function isCredential(\n credential: unknown,\n): credential is NamedKeyCredential | SASCredential | TokenCredential {\n return (\n isSASCredential(credential) || isNamedKeyCredential(credential) || isTokenCredential(credential)\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactionHeaders.js","sourceRoot":"","sources":["../../../src/utils/transactionHeaders.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,eAAuB;IAC3D,MAAM,WAAW,GAAG,yBAAyB,CAAC,eAAe,CAAC,CAAC;IAC/D,uCACK,WAAW;QACd,6FAA6F;QAC7F,gBAAgB,EAAE,OAAO,EACzB,UAAU,EAAE,YAAY,IACxB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { getBaseTransactionHeaders } from \"./baseTransactionHeaders\";\n\n/**\n * @internal\n * Builds an object with the required headers for a Transaction request. For Node\n */\nexport function getTransactionHeaders(transactionGuid: string): RawHttpHeaders {\n const baseHeaders = getBaseTransactionHeaders(transactionGuid);\n return {\n ...baseHeaders,\n // The below headers are not supported in the browser as they are flagged as \"unsafe headers\"\n \"Accept-Charset\": \"UTF-8\",\n Connection: \"Keep-Alive\",\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"transactionHeaders.js","sourceRoot":"","sources":["../../../src/utils/transactionHeaders.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,eAAuB;IAC3D,MAAM,WAAW,GAAG,yBAAyB,CAAC,eAAe,CAAC,CAAC;IAC/D,uCACK,WAAW;QACd,6FAA6F;QAC7F,gBAAgB,EAAE,OAAO,EACzB,UAAU,EAAE,YAAY,IACxB;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { getBaseTransactionHeaders } from \"./baseTransactionHeaders\";\n\n/**\n * @internal\n * Builds an object with the required headers for a Transaction request. For Node\n */\nexport function getTransactionHeaders(transactionGuid: string): RawHttpHeaders {\n const baseHeaders = getBaseTransactionHeaders(transactionGuid);\n return {\n ...baseHeaders,\n // The below headers are not supported in the browser as they are flagged as \"unsafe headers\"\n \"Accept-Charset\": \"UTF-8\",\n Connection: \"Keep-Alive\",\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { AzureNamedKeyCredential } from '@azure/core-auth';
|
|
2
2
|
import { AzureSASCredential } from '@azure/core-auth';
|
|
3
|
-
import { CommonClientOptions } from '@azure/core-client';
|
|
3
|
+
import type { CommonClientOptions } from '@azure/core-client';
|
|
4
4
|
import * as coreClient from '@azure/core-client';
|
|
5
5
|
import { NamedKeyCredential } from '@azure/core-auth';
|
|
6
|
-
import { OperationOptions } from '@azure/core-client';
|
|
7
|
-
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
8
|
-
import { Pipeline } from '@azure/core-rest-pipeline';
|
|
6
|
+
import type { OperationOptions } from '@azure/core-client';
|
|
7
|
+
import type { PagedAsyncIterableIterator } from '@azure/core-paging';
|
|
8
|
+
import type { Pipeline } from '@azure/core-rest-pipeline';
|
|
9
9
|
import { RestError } from '@azure/core-rest-pipeline';
|
|
10
|
-
import { SASCredential } from '@azure/core-auth';
|
|
11
|
-
import { TokenCredential } from '@azure/core-auth';
|
|
10
|
+
import type { SASCredential } from '@azure/core-auth';
|
|
11
|
+
import type { TokenCredential } from '@azure/core-auth';
|
|
12
12
|
|
|
13
13
|
/** An Access policy. */
|
|
14
14
|
export declare interface AccessPolicy {
|