[Tables] Multiple small fixes to Tables SDK (#18211)

* Multiple small fixes to Tables SDK

* Remove un-needed changes

* Update sdk/tables/data-tables/README.md

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

* Update sdk/tables/data-tables/README.md

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

* Update sdk/tables/data-tables/src/serialization.ts

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

* Update sdk/tables/data-tables/src/utils/bufferSerializer.ts

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

* bring back base64 encoding

* update sample name

* Fix format and update changelog

* Update sample name

* Remove un-needed re-recordings

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
This commit is contained in:
Jose Manuel Heredia Hidalgo 2021-10-18 07:57:05 -07:00 коммит произвёл GitHub
Родитель 5215a7d829
Коммит 0c47584b30
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
18 изменённых файлов: 1218 добавлений и 22 удалений

Просмотреть файл

@ -3,11 +3,15 @@
## 12.2.0 (Unreleased)
### Features Added
- Take `continuationToken` as a `PageSetting` and expose it in the page when listing entities `byPage`. [#](https://github.com/Azure/azure-sdk-for-js/pull/)
- Take `continuationToken` as a `PageSetting` and expose it in the page when listing entities `byPage`. [#18179](https://github.com/Azure/azure-sdk-for-js/pull/18179)
### Breaking Changes
### Bugs Fixed
- Document usage of SDK with Azurite. [#18211](https://github.com/Azure/azure-sdk-for-js/pull/18211)
- Issue #17407 - Correctly handle etag in select filter. [#18211](https://github.com/Azure/azure-sdk-for-js/pull/18211)
- Issue #18079 - Correctly handle creating entities with properties containing empty strings "". Fixes Insert throws "Unknown EDM type object" error with property value { value: "", type: "String" }. [#18211](https://github.com/Azure/azure-sdk-for-js/pull/18211)
- Issue #18148 - Correctly deserialize Decimal numbers checking for isSafeInteger. Fixes listEntities always returns an Int32 type for a value of "1.23456789012346e+24". [#18211](https://github.com/Azure/azure-sdk-for-js/pull/18211)
### Other Changes

Просмотреть файл

@ -351,6 +351,38 @@ async function main() {
main();
```
## Azurite and Storage Emulator
The Azure Tables Client SDK also works with Azurite, an Azure Storage and Tables API compatible server emulator. Please refer to the ([Azurite repository](https://github.com/Azure/Azurite#azurite-v3)) on how to get started using it.
### Connecting to Azurite with Connection String shortcut
The easiest way to connect to Azurite from your application is to configure a connection string that references the shortcut `UseDevelopmentStorage=true`. The shortcut is equivalent to the full connection string for the emulator, which specifies the account name, the account key, and the emulator endpoints for each of the Azure Storage services: ([see more](https://github.com/Azure/Azurite#http-connection-strings)). Using this shortcut, the Azure Tables Client SDK would setup the default connection string and `allowInsecureConnection` in the client options.
```typescript
import { TableClient } from "@azure/data-tables"
const connectionString = "UseDevelopmentStorage=true";
const client = TableClient.fromConnectionString(connectionString, "myTable");
```
### Connecting to Azurite without Connection String shortcut
You can connect to azurite manually without using the connection string shortcut by specifying the service URL and `AzureNamedKeyCredential` or a custom connection string. However, `allowInsecureConnection` will need to be set manually in case Azurite runs in an `http` endpoint.
```typescript
import { TableClient, AzureNamedKeyCredential } from "@azure/data-tables"
const client = new TableClient(
"<Azurite-http-table-endpoint>",
"myTable",
new AzureNamedKeyCredential(
"<Azurite-account-name>",
"<Azurite-account-key>"
),
{ allowInsecureConnection: true }
);
```
## Troubleshooting
### General

Просмотреть файл

@ -0,0 +1,53 @@
{
"recordings": [
{
"method": "POST",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser",
"query": {},
"requestBody": "{\"PartitionKey\":\"doubleSci\",\"RowKey\":\"0\",\"Value\":\"1.23456789012346e+24\",\"Value@odata.type\":\"Edm.Double\"}",
"status": 204,
"response": "",
"responseHeaders": {
"cache-control": "no-cache",
"content-length": "0",
"dataserviceid": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser(PartitionKey='doubleSci',RowKey='0')",
"date": "Fri, 15 Oct 2021 16:13:35 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A36.2651423Z'\"",
"location": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser(PartitionKey='doubleSci',RowKey='0')",
"preference-applied": "return-no-content",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "358ddc0f-1bd6-489a-bce8-2a52f1f13d26",
"x-ms-request-id": "8cdfcec2-8002-0028-41df-c1f600000000",
"x-ms-version": "2019-02-02"
}
},
{
"method": "GET",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser(PartitionKey='doubleSci',RowKey='0')",
"query": {},
"requestBody": null,
"status": 200,
"response": "{\"odata.metadata\":\"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestSASConnectionStringbrowser/@Element\",\"odata.etag\":\"W/\\\"datetime'2021-10-15T16%3A13%3A36.2651423Z'\\\"\",\"PartitionKey\":\"doubleSci\",\"RowKey\":\"0\",\"Timestamp\":\"2021-10-15T16:13:36.2651423Z\",\"Value\":1.23456789012346E+24}",
"responseHeaders": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding",
"cache-control": "no-cache",
"content-type": "application/json;odata=minimalmetadata;streaming=true;charset=utf-8",
"date": "Fri, 15 Oct 2021 16:13:35 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A36.2651423Z'\"",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"transfer-encoding": "chunked",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "73f428be-f09f-4429-935b-d8ec5136dd08",
"x-ms-request-id": "8cdfcec9-8002-0028-47df-c1f600000000",
"x-ms-version": "2019-02-02"
}
}
],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
},
"hash": "7dd48a133bde99cc0165acfe9c3e74f7"
}

Просмотреть файл

@ -0,0 +1,53 @@
{
"recordings": [
{
"method": "POST",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser",
"query": {},
"requestBody": "{\"PartitionKey\":\"emptyString\",\"RowKey\":\"0\",\"value\":\"\",\"value@odata.type\":\"Edm.String\"}",
"status": 204,
"response": "",
"responseHeaders": {
"cache-control": "no-cache",
"content-length": "0",
"dataserviceid": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser(PartitionKey='emptyString',RowKey='0')",
"date": "Fri, 15 Oct 2021 16:13:35 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A36.3391946Z'\"",
"location": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser(PartitionKey='emptyString',RowKey='0')",
"preference-applied": "return-no-content",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "550a1868-d933-4108-ac53-68d5b6977a26",
"x-ms-request-id": "8cdfcece-8002-0028-4cdf-c1f600000000",
"x-ms-version": "2019-02-02"
}
},
{
"method": "GET",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser(PartitionKey='emptyString',RowKey='0')",
"query": {},
"requestBody": null,
"status": 200,
"response": "{\"odata.metadata\":\"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestSASConnectionStringbrowser/@Element\",\"odata.etag\":\"W/\\\"datetime'2021-10-15T16%3A13%3A36.3391946Z'\\\"\",\"PartitionKey\":\"emptyString\",\"RowKey\":\"0\",\"Timestamp\":\"2021-10-15T16:13:36.3391946Z\",\"value\":\"\"}",
"responseHeaders": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding",
"cache-control": "no-cache",
"content-type": "application/json;odata=minimalmetadata;streaming=true;charset=utf-8",
"date": "Fri, 15 Oct 2021 16:13:35 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A36.3391946Z'\"",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"transfer-encoding": "chunked",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "8431b603-e921-4886-98e2-38d1b538f7ad",
"x-ms-request-id": "8cdfced3-8002-0028-51df-c1f600000000",
"x-ms-version": "2019-02-02"
}
}
],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
},
"hash": "492b3df9da7ef54dc9bd2793d3b3c229"
}

Просмотреть файл

@ -0,0 +1,55 @@
{
"recordings": [
{
"method": "POST",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser",
"query": {},
"requestBody": "{\"PartitionKey\":\"P2_browser\",\"RowKey\":\"R1\",\"foo\":\"testEntity\",\"bar\":123,\"baz\":true}",
"status": 204,
"response": "",
"responseHeaders": {
"cache-control": "no-cache",
"content-length": "0",
"dataserviceid": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser(PartitionKey='P2_browser',RowKey='R1')",
"date": "Fri, 15 Oct 2021 16:13:34 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A35.3585022Z'\"",
"location": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser(PartitionKey='P2_browser',RowKey='R1')",
"preference-applied": "return-no-content",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "b3caf4c0-9290-4351-9f32-693d91fa2f91",
"x-ms-request-id": "8cdfce38-8002-0028-41df-c1f600000000",
"x-ms-version": "2019-02-02"
}
},
{
"method": "GET",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringbrowser(PartitionKey='P2_browser',RowKey='R1')",
"query": {
"$select": "baz,PartitionKey,RowKey"
},
"requestBody": null,
"status": 200,
"response": "{\"odata.metadata\":\"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestSASConnectionStringbrowser/@Element&$select=baz,PartitionKey,RowKey\",\"odata.etag\":\"W/\\\"datetime'2021-10-15T16%3A13%3A35.3585022Z'\\\"\",\"PartitionKey\":\"P2_browser\",\"RowKey\":\"R1\",\"baz\":true}",
"responseHeaders": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding",
"cache-control": "no-cache",
"content-type": "application/json;odata=minimalmetadata;streaming=true;charset=utf-8",
"date": "Fri, 15 Oct 2021 16:13:34 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A35.3585022Z'\"",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"transfer-encoding": "chunked",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "34aaca51-a4fc-4031-a1dc-7acbed25731b",
"x-ms-request-id": "8cdfce40-8002-0028-49df-c1f600000000",
"x-ms-version": "2019-02-02"
}
}
],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
},
"hash": "87c305eb9ae0ad0aa3a2566737c1fc85"
}

Просмотреть файл

@ -0,0 +1,77 @@
{
"recordings": [
{
"method": "POST",
"url": "https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token",
"query": {},
"requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F",
"status": 200,
"response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}",
"responseHeaders": {
"cache-control": "no-store, no-cache",
"content-length": "1318",
"content-type": "application/json; charset=utf-8",
"date": "Fri, 15 Oct 2021 16:13:32 GMT",
"expires": "-1",
"nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}",
"p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"",
"pragma": "no-cache",
"referrer-policy": "strict-origin-when-cross-origin",
"report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+est\"}]}",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"x-content-type-options": "nosniff",
"x-ms-ests-server": "2.1.12158.6 - NCUS ProdSlices",
"x-ms-request-id": "3babb410-07c5-43a9-b17d-104329ef0a00"
}
},
{
"method": "POST",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser",
"query": {},
"requestBody": "{\"PartitionKey\":\"doubleSci\",\"RowKey\":\"0\",\"Value\":\"1.23456789012346e+24\",\"Value@odata.type\":\"Edm.Double\"}",
"status": 204,
"response": "",
"responseHeaders": {
"cache-control": "no-cache",
"content-length": "0",
"dataserviceid": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser(PartitionKey='doubleSci',RowKey='0')",
"date": "Fri, 15 Oct 2021 16:13:32 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A33.4031205Z'\"",
"location": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser(PartitionKey='doubleSci',RowKey='0')",
"preference-applied": "return-no-content",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "9b7e8050-4917-4995-979e-5389b6c939a4",
"x-ms-request-id": "8cdfcd1c-8002-0028-3ddf-c1f600000000",
"x-ms-version": "2019-02-02"
}
},
{
"method": "GET",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser(PartitionKey='doubleSci',RowKey='0')",
"query": {},
"requestBody": null,
"status": 200,
"response": "{\"odata.metadata\":\"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestTokenCredentialbrowser/@Element\",\"odata.etag\":\"W/\\\"datetime'2021-10-15T16%3A13%3A33.4031205Z'\\\"\",\"PartitionKey\":\"doubleSci\",\"RowKey\":\"0\",\"Timestamp\":\"2021-10-15T16:13:33.4031205Z\",\"Value\":1.23456789012346E+24}",
"responseHeaders": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding",
"cache-control": "no-cache",
"content-type": "application/json;odata=minimalmetadata;streaming=true;charset=utf-8",
"date": "Fri, 15 Oct 2021 16:13:32 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A33.4031205Z'\"",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"transfer-encoding": "chunked",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "113a0111-3673-4dc2-9587-18144aa090c9",
"x-ms-request-id": "8cdfcd26-8002-0028-47df-c1f600000000",
"x-ms-version": "2019-02-02"
}
}
],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
},
"hash": "7dd48a133bde99cc0165acfe9c3e74f7"
}

Просмотреть файл

@ -0,0 +1,77 @@
{
"recordings": [
{
"method": "POST",
"url": "https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token",
"query": {},
"requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F",
"status": 200,
"response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}",
"responseHeaders": {
"cache-control": "no-store, no-cache",
"content-length": "1318",
"content-type": "application/json; charset=utf-8",
"date": "Fri, 15 Oct 2021 16:13:33 GMT",
"expires": "-1",
"nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}",
"p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"",
"pragma": "no-cache",
"referrer-policy": "strict-origin-when-cross-origin",
"report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+est\"}]}",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"x-content-type-options": "nosniff",
"x-ms-ests-server": "2.1.12158.6 - WUS2 ProdSlices",
"x-ms-request-id": "2158fdff-7ae6-46b3-a337-930a8e421700"
}
},
{
"method": "POST",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser",
"query": {},
"requestBody": "{\"PartitionKey\":\"emptyString\",\"RowKey\":\"0\",\"value\":\"\",\"value@odata.type\":\"Edm.String\"}",
"status": 204,
"response": "",
"responseHeaders": {
"cache-control": "no-cache",
"content-length": "0",
"dataserviceid": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser(PartitionKey='emptyString',RowKey='0')",
"date": "Fri, 15 Oct 2021 16:13:33 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A33.6733118Z'\"",
"location": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser(PartitionKey='emptyString',RowKey='0')",
"preference-applied": "return-no-content",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "8f770af6-f046-46c5-9bbb-3cef6f817002",
"x-ms-request-id": "8cdfcd4c-8002-0028-6cdf-c1f600000000",
"x-ms-version": "2019-02-02"
}
},
{
"method": "GET",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser(PartitionKey='emptyString',RowKey='0')",
"query": {},
"requestBody": null,
"status": 200,
"response": "{\"odata.metadata\":\"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestTokenCredentialbrowser/@Element\",\"odata.etag\":\"W/\\\"datetime'2021-10-15T16%3A13%3A33.6733118Z'\\\"\",\"PartitionKey\":\"emptyString\",\"RowKey\":\"0\",\"Timestamp\":\"2021-10-15T16:13:33.6733118Z\",\"value\":\"\"}",
"responseHeaders": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding",
"cache-control": "no-cache",
"content-type": "application/json;odata=minimalmetadata;streaming=true;charset=utf-8",
"date": "Fri, 15 Oct 2021 16:13:33 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A33.6733118Z'\"",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"transfer-encoding": "chunked",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "d07189d2-580a-413c-8fa1-1b950122630f",
"x-ms-request-id": "8cdfcd50-8002-0028-70df-c1f600000000",
"x-ms-version": "2019-02-02"
}
}
],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
},
"hash": "492b3df9da7ef54dc9bd2793d3b3c229"
}

Просмотреть файл

@ -0,0 +1,79 @@
{
"recordings": [
{
"method": "POST",
"url": "https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token",
"query": {},
"requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F",
"status": 200,
"response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}",
"responseHeaders": {
"cache-control": "no-store, no-cache",
"content-length": "1318",
"content-type": "application/json; charset=utf-8",
"date": "Fri, 15 Oct 2021 16:13:30 GMT",
"expires": "-1",
"nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}",
"p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"",
"pragma": "no-cache",
"referrer-policy": "strict-origin-when-cross-origin",
"report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+est\"}]}",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"x-content-type-options": "nosniff",
"x-ms-ests-server": "2.1.12158.6 - SCUS ProdSlices",
"x-ms-request-id": "5e5989f2-f8da-4a4a-92fc-211e07ff0c00"
}
},
{
"method": "POST",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser",
"query": {},
"requestBody": "{\"PartitionKey\":\"P2_browser\",\"RowKey\":\"R1\",\"foo\":\"testEntity\",\"bar\":123,\"baz\":true}",
"status": 204,
"response": "",
"responseHeaders": {
"cache-control": "no-cache",
"content-length": "0",
"dataserviceid": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser(PartitionKey='P2_browser',RowKey='R1')",
"date": "Fri, 15 Oct 2021 16:13:30 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A30.8202964Z'\"",
"location": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser(PartitionKey='P2_browser',RowKey='R1')",
"preference-applied": "return-no-content",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "038d0f6e-e77f-4eee-baa1-a8eeea24fa89",
"x-ms-request-id": "8cdfcb8c-8002-0028-58df-c1f600000000",
"x-ms-version": "2019-02-02"
}
},
{
"method": "GET",
"url": "https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialbrowser(PartitionKey='P2_browser',RowKey='R1')",
"query": {
"$select": "baz,PartitionKey,RowKey"
},
"requestBody": null,
"status": 200,
"response": "{\"odata.metadata\":\"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestTokenCredentialbrowser/@Element&$select=baz,PartitionKey,RowKey\",\"odata.etag\":\"W/\\\"datetime'2021-10-15T16%3A13%3A30.8202964Z'\\\"\",\"PartitionKey\":\"P2_browser\",\"RowKey\":\"R1\",\"baz\":true}",
"responseHeaders": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding",
"cache-control": "no-cache",
"content-type": "application/json;odata=minimalmetadata;streaming=true;charset=utf-8",
"date": "Fri, 15 Oct 2021 16:13:30 GMT",
"etag": "W/\"datetime'2021-10-15T16%3A13%3A30.8202964Z'\"",
"server": "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0",
"transfer-encoding": "chunked",
"x-content-type-options": "nosniff",
"x-ms-client-request-id": "6a11af02-4a88-43f2-9c1a-1e20dd4fcc40",
"x-ms-request-id": "8cdfcb96-8002-0028-62df-c1f600000000",
"x-ms-version": "2019-02-02"
}
}
],
"uniqueTestInfo": {
"uniqueName": {},
"newDate": {}
},
"hash": "87c305eb9ae0ad0aa3a2566737c1fc85"
}

Просмотреть файл

@ -0,0 +1,65 @@
let nock = require('nock');
module.exports.hash = "335e0b4973b45c70ad7e96137b48f182";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.post('/tableClientTestSASConnectionStringnode', {"PartitionKey":"doubleSci","RowKey":"0","Value":"1.23456789012346e+24","Value@odata.type":"Edm.Double"})
.query(true)
.reply(204, "", [
'Cache-Control',
'no-cache',
'Content-Length',
'0',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A12.8275567Z'"`,
'Location',
"https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringnode(PartitionKey='doubleSci',RowKey='0')",
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7e89c-c002-000d-2bdf-c16eb3000000',
'x-ms-client-request-id',
'8c981ccf-4bde-4502-bb01-7d2c16de6ade',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Preference-Applied',
'return-no-content',
'DataServiceId',
"https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringnode(PartitionKey='doubleSci',RowKey='0')",
'Date',
'Fri, 15 Oct 2021 16:13:12 GMT'
]);
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.get(`/tableClientTestSASConnectionStringnode(PartitionKey='doubleSci',RowKey='0')`)
.query(true)
.reply(200, {"odata.metadata":"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestSASConnectionStringnode/@Element","odata.etag":"W/\"datetime'2021-10-15T16%3A13%3A12.8275567Z'\"","PartitionKey":"doubleSci","RowKey":"0","Timestamp":"2021-10-15T16:13:12.8275567Z","Value":1.23456789012346e+24}, [
'Cache-Control',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json;odata=minimalmetadata;streaming=true;charset=utf-8',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A12.8275567Z'"`,
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7e8c6-c002-000d-53df-c16eb3000000',
'x-ms-client-request-id',
'9fafc3ea-689a-4e75-8a49-d025b1843ec1',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Expose-Headers',
'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding',
'Access-Control-Allow-Origin',
'*',
'Date',
'Fri, 15 Oct 2021 16:13:12 GMT'
]);

Просмотреть файл

@ -0,0 +1,65 @@
let nock = require('nock');
module.exports.hash = "b40d1df4fdfc9b761ea69dc8957bdd58";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.post('/tableClientTestSASConnectionStringnode', {"PartitionKey":"emptyString","RowKey":"0","value":"","value@odata.type":"Edm.String"})
.query(true)
.reply(204, "", [
'Cache-Control',
'no-cache',
'Content-Length',
'0',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A12.9366343Z'"`,
'Location',
"https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringnode(PartitionKey='emptyString',RowKey='0')",
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7e8ed-c002-000d-78df-c16eb3000000',
'x-ms-client-request-id',
'0e4e9d39-5af2-456f-8342-a7767153819b',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Preference-Applied',
'return-no-content',
'DataServiceId',
"https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringnode(PartitionKey='emptyString',RowKey='0')",
'Date',
'Fri, 15 Oct 2021 16:13:12 GMT'
]);
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.get(`/tableClientTestSASConnectionStringnode(PartitionKey='emptyString',RowKey='0')`)
.query(true)
.reply(200, {"odata.metadata":"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestSASConnectionStringnode/@Element","odata.etag":"W/\"datetime'2021-10-15T16%3A13%3A12.9366343Z'\"","PartitionKey":"emptyString","RowKey":"0","Timestamp":"2021-10-15T16:13:12.9366343Z","value":""}, [
'Cache-Control',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json;odata=minimalmetadata;streaming=true;charset=utf-8',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A12.9366343Z'"`,
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7e906-c002-000d-10df-c16eb3000000',
'x-ms-client-request-id',
'3bda5a30-c67e-474a-b91d-445faf15b27f',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Expose-Headers',
'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding',
'Access-Control-Allow-Origin',
'*',
'Date',
'Fri, 15 Oct 2021 16:13:12 GMT'
]);

Просмотреть файл

@ -0,0 +1,65 @@
let nock = require('nock');
module.exports.hash = "16a7761419d838f6802e5dab46f2456e";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.post('/tableClientTestSASConnectionStringnode', {"PartitionKey":"P2_node","RowKey":"R1","foo":"testEntity","bar":123,"baz":true})
.query(true)
.reply(204, "", [
'Cache-Control',
'no-cache',
'Content-Length',
'0',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A11.9719581Z'"`,
'Location',
"https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringnode(PartitionKey='P2_node',RowKey='R1')",
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7e58a-c002-000d-3cdf-c16eb3000000',
'x-ms-client-request-id',
'e38189a2-5a3b-4df2-9bae-08bb06177f94',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Preference-Applied',
'return-no-content',
'DataServiceId',
"https://fakeaccount.table.core.windows.net/tableClientTestSASConnectionStringnode(PartitionKey='P2_node',RowKey='R1')",
'Date',
'Fri, 15 Oct 2021 16:13:11 GMT'
]);
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.get(`/tableClientTestSASConnectionStringnode(PartitionKey='P2_node',RowKey='R1')`)
.query(true)
.reply(200, {"odata.metadata":"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestSASConnectionStringnode/@Element&$select=baz,PartitionKey,RowKey","odata.etag":"W/\"datetime'2021-10-15T16%3A13%3A11.9719581Z'\"","PartitionKey":"P2_node","RowKey":"R1","baz":true}, [
'Cache-Control',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json;odata=minimalmetadata;streaming=true;charset=utf-8',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A11.9719581Z'"`,
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7e5b7-c002-000d-68df-c16eb3000000',
'x-ms-client-request-id',
'e216844f-b682-471a-9c40-c14cf4cc6317',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Expose-Headers',
'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding',
'Access-Control-Allow-Origin',
'*',
'Date',
'Fri, 15 Oct 2021 16:13:11 GMT'
]);

Просмотреть файл

@ -0,0 +1,169 @@
let nock = require('nock');
module.exports.hash = "335e0b4973b45c70ad7e96137b48f182";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'75138bec-fc7e-450e-83fb-c4dec1719e00',
'x-ms-ests-server',
'2.1.12108.10 - EUS ProdSlices',
'Set-Cookie',
'fpc=An1e3cJs23hOhK64Qw20ssk; expires=Sun, 14-Nov-2021 16:13:09 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrJXdpH7tHnysOJ5J9Swx32AxHXSOQZgbqVVSC5Cy_BYKW21VuFbKoTqzt8ULbbEjJJwozqqPFG277n-mBfS1iZvXO57nZoEibJjV7-K0n2L_x5-VA0WME8MgRU1V1Ey6YBAWayfaOVmQbdVU8muKQ4NQ2rbK0vj7b0zqjQgp5q-ogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'7a0be1a3-6424-46a4-9c50-7c7ba1bc0900',
'x-ms-ests-server',
'2.1.12158.6 - NCUS ProdSlices',
'Set-Cookie',
'fpc=AhOiYs5YDCFOt8nSimb27D0; expires=Sun, 14-Nov-2021 16:13:09 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevr97YUUy5CaZlyJP_Uh3KkwDAXU3MMsE70peThgNvpZAehEqCvmxSeNl1JcDoZ5TH6znHLWvT2CAAtfp_RrBU72oti6uq1Fe42z_Br9glsQiJpz_uENPUYrSpG1Jh8FjtvzFu36Ie5c6AM_wnS3y6JZ8qrHpQ4IaPXX8TEghzUocYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.2&x-client-OS=linux&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=df3f8016-726e-41d9-9333-ad2032f683d1&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'255319e9-21b9-4ea1-9526-136f43c31a00',
'x-ms-ests-server',
'2.1.12158.6 - WUS2 ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=AgMx-C9j6yVKhqdaY1DZlKLJVDEwAQAAAJWf-9gOAAAA; expires=Sun, 14-Nov-2021 16:13:09 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT',
'Content-Length',
'1318'
]);
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.post('/tableClientTestTokenCredentialnode', {"PartitionKey":"doubleSci","RowKey":"0","Value":"1.23456789012346e+24","Value@odata.type":"Edm.Double"})
.reply(204, "", [
'Cache-Control',
'no-cache',
'Content-Length',
'0',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A09.5052325Z'"`,
'Location',
"https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialnode(PartitionKey='doubleSci',RowKey='0')",
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7de2c-c002-000d-49df-c16eb3000000',
'x-ms-client-request-id',
'e2964c02-23df-4480-8907-2c4c73614dab',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Preference-Applied',
'return-no-content',
'DataServiceId',
"https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialnode(PartitionKey='doubleSci',RowKey='0')",
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT'
]);
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.get(`/tableClientTestTokenCredentialnode(PartitionKey='doubleSci',RowKey='0')`)
.reply(200, {"odata.metadata":"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestTokenCredentialnode/@Element","odata.etag":"W/\"datetime'2021-10-15T16%3A13%3A09.5052325Z'\"","PartitionKey":"doubleSci","RowKey":"0","Timestamp":"2021-10-15T16:13:09.5052325Z","Value":1.23456789012346e+24}, [
'Cache-Control',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json;odata=minimalmetadata;streaming=true;charset=utf-8',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A09.5052325Z'"`,
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7de4e-c002-000d-69df-c16eb3000000',
'x-ms-client-request-id',
'9433eb60-47a6-4b05-be94-941b3ac4307a',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Expose-Headers',
'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding',
'Access-Control-Allow-Origin',
'*',
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT'
]);

Просмотреть файл

@ -0,0 +1,169 @@
let nock = require('nock');
module.exports.hash = "b40d1df4fdfc9b761ea69dc8957bdd58";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'ab8f49cd-b7ae-42c3-8c3d-dc4bdaa11900',
'x-ms-ests-server',
'2.1.12158.6 - SCUS ProdSlices',
'Set-Cookie',
'fpc=Agrh-IUeIJZDjhLCtU-7aGk; expires=Sun, 14-Nov-2021 16:13:09 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrwmL5qg0ocF1-hKF0X3oGOftLFbnYYPihlN56KtAq2HZvs40u2fIlGQVaZ6bKBfgAWvJKT2xRF1JLCN31Zy2EceyowCU_Gf_wvACPATp_cVYUnb7K-UsI52Y7PHxFA7czZwatnScMJV2NQZkIKtmbDOAno9t0OkY48afARzPtGcYgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'3d888375-66ed-4f17-b6c4-973cc5530a00',
'x-ms-ests-server',
'2.1.12158.6 - EUS ProdSlices',
'Set-Cookie',
'fpc=Agl7-Wa29vBKsJoI8-Fc5bY; expires=Sun, 14-Nov-2021 16:13:09 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrjNJgGKNU-fYkWKIBmxRoVfMZ6i_Ijgu4hkQYINO3QShlXxSFwAQ1OyF2VifGJyK2zhtdEnng1XPo6oRrzcva2xfy_QBiy4DBqoAoXLr82qKLUmM1L0_Ee38gOw8-IBwqQ8v5T7ajs5BMin0xdCZbOeKJAdvtgzGMXILHxAWoIa4gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.2&x-client-OS=linux&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=1be562ce-a1d1-413d-8fa1-7c4db2ef8d5c&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'0db9bbe6-a8d3-40c7-b626-04f7bee81a00',
'x-ms-ests-server',
'2.1.12158.6 - WUS2 ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=AsZYN4C6bVtBhze9oh7uwu8; expires=Sun, 14-Nov-2021 16:13:09 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT',
'Content-Length',
'1318'
]);
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.post('/tableClientTestTokenCredentialnode', {"PartitionKey":"emptyString","RowKey":"0","value":"","value@odata.type":"Edm.String"})
.reply(204, "", [
'Cache-Control',
'no-cache',
'Content-Length',
'0',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A09.9945744Z'"`,
'Location',
"https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialnode(PartitionKey='emptyString',RowKey='0')",
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7df99-c002-000d-29df-c16eb3000000',
'x-ms-client-request-id',
'47385c93-65a8-4c2c-b6e2-34f57916ab32',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Preference-Applied',
'return-no-content',
'DataServiceId',
"https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialnode(PartitionKey='emptyString',RowKey='0')",
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT'
]);
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.get(`/tableClientTestTokenCredentialnode(PartitionKey='emptyString',RowKey='0')`)
.reply(200, {"odata.metadata":"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestTokenCredentialnode/@Element","odata.etag":"W/\"datetime'2021-10-15T16%3A13%3A09.9945744Z'\"","PartitionKey":"emptyString","RowKey":"0","Timestamp":"2021-10-15T16:13:09.9945744Z","value":""}, [
'Cache-Control',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json;odata=minimalmetadata;streaming=true;charset=utf-8',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A09.9945744Z'"`,
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7dfaf-c002-000d-3fdf-c16eb3000000',
'x-ms-client-request-id',
'06b6f881-4c6c-4154-ae90-3457e280b661',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Expose-Headers',
'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding',
'Access-Control-Allow-Origin',
'*',
'Date',
'Fri, 15 Oct 2021 16:13:09 GMT'
]);

Просмотреть файл

@ -0,0 +1,170 @@
let nock = require('nock');
module.exports.hash = "16a7761419d838f6802e5dab46f2456e";
module.exports.testInfo = {"uniqueName":{},"newDate":{}}
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/common/discovery/instance')
.query(true)
.reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'4526ddfd-b575-4876-9af1-31179a803b00',
'x-ms-ests-server',
'2.1.12108.11 - WUS2 ProdSlices',
'Set-Cookie',
'fpc=Am0un-2fPxFNmk3G87UTCVg; expires=Sun, 14-Nov-2021 16:13:04 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrhbG9t252-EaPsqGG_UnHzaoU5Do6VhLaEPlOB7Bb4tDnOAk1X8aMNGel3vvzXl1oGxkpBTeP7Ho3Hbc7DsGWkHBi5vImGnWSgXFFrt9ntqGc6bWktR8SL8frX5GViDxRRcMby-xSMnmtRI3O713cQsTV4TF0HvnV0N2msTQWqBEgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Fri, 15 Oct 2021 16:13:04 GMT',
'Content-Length',
'980'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.get('/88888888-8888-8888-8888-888888888888/v2.0/.well-known/openid-configuration')
.reply(200, {"token_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/88888888-8888-8888-8888-888888888888/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [
'Cache-Control',
'max-age=86400, private',
'Content-Type',
'application/json; charset=utf-8',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Allow-Origin',
'*',
'Access-Control-Allow-Methods',
'GET, OPTIONS',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'a0023411-81b2-4d1d-8e65-e39b14e00900',
'x-ms-ests-server',
'2.1.12158.6 - NCUS ProdSlices',
'Set-Cookie',
'fpc=AuiTsjDc4gxLkAmYHTWoguM; expires=Sun, 14-Nov-2021 16:13:04 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrzGjSsLtOWpG31i2VXq_F4Yj3Ujc8jvYOrcdsSEf1XoRv3M_94uwh5ieXz3ax2AE4JCwJhpF7AUKgtTLh3v3k5r3316MrCPZIoTyIfi07kvnCeI0ArPfle_LmzTqPGBwNhJDAYvqtLeZOq8b1UkeLjUT2KLcSOUuc-4LISY6BCn0gAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Fri, 15 Oct 2021 16:13:04 GMT',
'Content-Length',
'1753'
]);
nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true})
.post('/88888888-8888-8888-8888-888888888888/oauth2/v2.0/token', "client_id=azure_client_id&scope=https%3A%2F%2Fsanitized%2F&grant_type=client_credentials&x-client-SKU=msal.js.node&x-client-VER=1.3.2&x-client-OS=linux&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=5|771,2,,,|,&x-client-last-telemetry=5|0|||0,0&client-request-id=d64f467a-088c-4044-9823-12a328087036&client_secret=azure_client_secret&claims=%7B%22access_token%22%3A%7B%22xms_cc%22%3A%7B%22values%22%3A%5B%22CP1%22%5D%7D%7D%7D")
.reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [
'Cache-Control',
'no-store, no-cache',
'Pragma',
'no-cache',
'Content-Type',
'application/json; charset=utf-8',
'Expires',
'-1',
'Strict-Transport-Security',
'max-age=31536000; includeSubDomains',
'X-Content-Type-Options',
'nosniff',
'P3P',
'CP="DSP CUR OTPi IND OTRi ONL FIN"',
'x-ms-request-id',
'ca900ec4-f6d3-44e8-a7c5-872af3db0b00',
'x-ms-ests-server',
'2.1.12158.6 - SCUS ProdSlices',
'x-ms-clitelem',
'1,0,0,,',
'Set-Cookie',
'fpc=AkrYnJ-yDAxBgYdjYsEjdPnJVDEwAQAAAJCf-9gOAAAA; expires=Sun, 14-Nov-2021 16:13:04 GMT; path=/; secure; HttpOnly; SameSite=None',
'Set-Cookie',
'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly',
'Set-Cookie',
'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly',
'Date',
'Fri, 15 Oct 2021 16:13:04 GMT',
'Content-Length',
'1318'
]);
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.post('/tableClientTestTokenCredentialnode', {"PartitionKey":"P2_node","RowKey":"R1","foo":"testEntity","bar":123,"baz":true})
.reply(204, "", [
'Cache-Control',
'no-cache',
'Content-Length',
'0',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A04.9780654Z'"`,
'Location',
"https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialnode(PartitionKey='P2_node',RowKey='R1')",
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7d0d2-c002-000d-1fdf-c16eb3000000',
'x-ms-client-request-id',
'e8aa37a3-526a-42bb-a6db-97f6d303eef0',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Preference-Applied',
'return-no-content',
'DataServiceId',
"https://fakeaccount.table.core.windows.net/tableClientTestTokenCredentialnode(PartitionKey='P2_node',RowKey='R1')",
'Date',
'Fri, 15 Oct 2021 16:13:04 GMT'
]);
nock('https://fakeaccount.table.core.windows.net:443', {"encodedQueryParams":true})
.get(`/tableClientTestTokenCredentialnode(PartitionKey='P2_node',RowKey='R1')`)
.query(true)
.reply(200, {"odata.metadata":"https://fakeaccount.table.core.windows.net/$metadata#tableClientTestTokenCredentialnode/@Element&$select=baz,PartitionKey,RowKey","odata.etag":"W/\"datetime'2021-10-15T16%3A13%3A04.9780654Z'\"","PartitionKey":"P2_node","RowKey":"R1","baz":true}, [
'Cache-Control',
'no-cache',
'Transfer-Encoding',
'chunked',
'Content-Type',
'application/json;odata=minimalmetadata;streaming=true;charset=utf-8',
'ETag',
`W/"datetime'2021-10-15T16%3A13%3A04.9780654Z'"`,
'Server',
'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id',
'5af7d0e4-c002-000d-31df-c16eb3000000',
'x-ms-client-request-id',
'5a6c418e-3489-4a57-ab37-68730e6a8dd2',
'x-ms-version',
'2019-02-02',
'X-Content-Type-Options',
'nosniff',
'Access-Control-Expose-Headers',
'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,X-Content-Type-Options,Cache-Control,ETag,Content-Type,Content-Length,Date,Transfer-Encoding',
'Access-Control-Allow-Origin',
'*',
'Date',
'Fri, 15 Oct 2021 16:13:04 GMT'
]);

Просмотреть файл

@ -16,7 +16,7 @@ dotenv.config();
const tablesUrl = process.env["TABLES_URL"] || "";
const sasToken = process.env["SAS_TOKEN"] || "";
async function listEntitiesPage() {
async function usingContinuationToken() {
const tableName = `manualListByPage`;
// See authenticationMethods sample for other options of creating a new client
@ -61,6 +61,6 @@ async function listEntitiesPage() {
}
}
listEntitiesPage().catch((err) => {
usingContinuationToken().catch((err) => {
console.error("The sample encountered an error:", err);
});

Просмотреть файл

@ -25,10 +25,7 @@ import {
DeleteTableEntityResponse,
SetAccessPolicyResponse
} from "./generatedModels";
import {
QueryOptions as GeneratedQueryOptions,
TableQueryEntitiesOptionalParams
} from "./generated/models";
import { TableQueryEntitiesOptionalParams } from "./generated/models";
import { getClientParamsFromConnectionString } from "./utils/connectionString";
import {
isNamedKeyCredential,
@ -47,6 +44,7 @@ import {
deserializeObjectsArray,
deserializeSignedIdentifier,
serialize,
serializeQueryOptions,
serializeSignedIdentifiers
} from "./serialization";
import { Table } from "./generated/operationsInterfaces";
@ -393,7 +391,7 @@ export class TableClient {
const { disableTypeConversion, queryOptions, ...getEntityOptions } = updatedOptions || {};
await this.table.queryEntitiesWithPartitionAndRowKey(this.tableName, partitionKey, rowKey, {
...getEntityOptions,
queryOptions: this.convertQueryOptions(queryOptions || {}),
queryOptions: serializeQueryOptions(queryOptions || {}),
onResponse
});
const tableEntity = deserialize<TableEntityResult<T>>(
@ -523,7 +521,7 @@ export class TableClient {
options: InternalListTableEntitiesOptions = {}
): Promise<TableEntityResultPage<T>> {
const { disableTypeConversion = false } = options;
const queryOptions = this.convertQueryOptions(options.queryOptions || {});
const queryOptions = serializeQueryOptions(options.queryOptions || {});
const listEntitiesOptions: TableQueryEntitiesOptionalParams = {
...options,
queryOptions
@ -920,15 +918,6 @@ export class TableClient {
return this.transactionClient.submitTransaction();
}
private convertQueryOptions(query: TableEntityQueryOptions): GeneratedQueryOptions {
const { select, ...queryOptions } = query;
const mappedQuery: GeneratedQueryOptions = { ...queryOptions };
if (select) {
mappedQuery.select = select.join(",");
}
return mappedQuery;
}
/**
*
* Creates an instance of TableClient from connection string.

Просмотреть файл

@ -1,9 +1,12 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { base64Encode, base64Decode } from "./utils/bufferSerializer";
import { EdmTypes, SignedIdentifier } from "./models";
import { EdmTypes, SignedIdentifier, TableEntityQueryOptions } from "./models";
import { truncatedISO8061Date } from "./utils/truncateISO8061Date";
import { SignedIdentifier as GeneratedSignedIdentifier } from "./generated/models";
import {
SignedIdentifier as GeneratedSignedIdentifier,
QueryOptions as GeneratedQueryOptions
} from "./generated/models";
const propertyCaseMap: Map<string, string> = new Map<string, string>([
["PartitionKey", "partitionKey"],
@ -80,7 +83,7 @@ function serializeObject(obj: { value: any; type: EdmTypes }): serializedType {
}
function getSerializedValue(value: any): serializedType {
if (typeof value === "object" && value?.value && value?.type) {
if (typeof value === "object" && value?.value !== undefined && value?.type !== undefined) {
return serializeObject(value);
} else {
return serializePrimitive(value);
@ -180,7 +183,7 @@ function inferTypedObject(propertyName: string, value: number | string | boolean
*/
function getTypedNumber(value: number): { value: string; type: "Int32" | "Double" } {
const valueStr = String(value);
if (Number.isInteger(value)) {
if (Number.isSafeInteger(value)) {
return { value: valueStr, type: "Int32" };
} else {
return { value: valueStr, type: "Double" };
@ -243,3 +246,17 @@ export function deserializeSignedIdentifier(
};
});
}
export function serializeQueryOptions(query: TableEntityQueryOptions): GeneratedQueryOptions {
const { select, ...queryOptions } = query;
const mappedQuery: GeneratedQueryOptions = { ...queryOptions };
// Properties that are always returned by the service but are not allowed in select
const excludeFromSelect = ["etag", "odata.etag"];
if (select) {
mappedQuery.select = select
.filter((p) => !excludeFromSelect.includes(p))
.map(translatePropertyNameForSerialization)
.join(",");
}
return mappedQuery;
}

Просмотреть файл

@ -195,6 +195,31 @@ authModes.forEach((authMode) => {
assert.equal(result.testField, testEntity.testField);
});
it("should select specific properties", async () => {
const testEntity = {
partitionKey: `P2_${suffix}`,
rowKey: "R1",
foo: "testEntity",
bar: 123,
baz: true
};
await client.createEntity(testEntity);
const result = await client.getEntity(testEntity.partitionKey, testEntity.rowKey, {
queryOptions: { select: ["baz", "partitionKey", "rowKey", "etag"] }
});
assert.isDefined(result.etag);
assert.equal(result.baz, testEntity.baz);
assert.equal(result.partitionKey, testEntity.partitionKey);
assert.equal(result.rowKey, testEntity.rowKey);
// properties not included in select should be undefined in the result
assert.isUndefined(result.bar);
assert.isUndefined(result.foo);
});
it("should createEntity with Date", async () => {
const testDate = "2020-09-17T00:00:00.111Z";
const testEntity = {
@ -409,6 +434,38 @@ authModes.forEach((authMode) => {
assert.equal(result.floatingPointNumber, 3.14);
});
it("should createEntity with double number in scientific notation", async () => {
const inputEntity = {
partitionKey: "doubleSci",
rowKey: "0",
Value: { value: "1.23456789012346e+24", type: "Double" }
};
await client.createEntity(inputEntity);
const result = await client.getEntity(inputEntity.partitionKey, inputEntity.rowKey, {
disableTypeConversion: true
});
assert.deepEqual(result.Value, inputEntity.Value);
});
it("should createEntity with empty string", async () => {
const inputEntity = {
partitionKey: "emptyString",
rowKey: "0",
value: { value: "", type: "String" }
};
await client.createEntity(inputEntity);
const result = await client.getEntity(inputEntity.partitionKey, inputEntity.rowKey, {
disableTypeConversion: true
});
assert.deepEqual(result.value, inputEntity.value);
});
it("should createEntity with primitive int and float without automatic type conversion", async () => {
type TestType = {
integerNumber: number;