@azure/arm-storage 16.1.1 → 17.0.0-alpha.20211111.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/CHANGELOG.md +26 -0
- package/{LICENSE.txt → LICENSE} +1 -1
- package/README.md +63 -80
- package/dist/index.js +10964 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/esm/coreClientLro.d.ts +26 -0
- package/esm/coreClientLro.d.ts.map +1 -0
- package/esm/coreClientLro.js +186 -0
- package/esm/coreClientLro.js.map +1 -0
- package/esm/index.d.ts +5002 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +13 -0
- package/esm/index.js.map +1 -0
- package/esm/lro/azureAsyncPolling.d.ts +3 -0
- package/esm/lro/azureAsyncPolling.d.ts.map +1 -0
- package/esm/lro/azureAsyncPolling.js +67 -0
- package/esm/lro/azureAsyncPolling.js.map +1 -0
- package/esm/lro/bodyPolling.d.ts +8 -0
- package/esm/lro/bodyPolling.d.ts.map +1 -0
- package/esm/lro/bodyPolling.js +37 -0
- package/esm/lro/bodyPolling.js.map +1 -0
- package/esm/lro/index.d.ts +4 -0
- package/esm/lro/index.d.ts.map +1 -0
- package/{src/models/operationsMappers.ts → esm/lro/index.js} +5 -10
- package/esm/lro/index.js.map +1 -0
- package/esm/lro/locationPolling.d.ts +3 -0
- package/esm/lro/locationPolling.d.ts.map +1 -0
- package/esm/lro/locationPolling.js +19 -0
- package/esm/lro/locationPolling.js.map +1 -0
- package/esm/lro/lroEngine.d.ts +14 -0
- package/esm/lro/lroEngine.d.ts.map +1 -0
- package/esm/lro/lroEngine.js +41 -0
- package/esm/lro/lroEngine.js.map +1 -0
- package/esm/lro/models.d.ts +138 -0
- package/esm/lro/models.d.ts.map +1 -0
- package/esm/lro/models.js +14 -0
- package/esm/lro/models.js.map +1 -0
- package/esm/lro/operation.d.ts +36 -0
- package/esm/lro/operation.d.ts.map +1 -0
- package/esm/lro/operation.js +82 -0
- package/esm/lro/operation.js.map +1 -0
- package/esm/lro/passthrough.d.ts +3 -0
- package/esm/lro/passthrough.d.ts.map +1 -0
- package/esm/{models/operationsMappers.js → lro/passthrough.js} +8 -2
- package/esm/lro/passthrough.js.map +1 -0
- package/esm/lro/requestUtils.d.ts +16 -0
- package/esm/lro/requestUtils.d.ts.map +1 -0
- package/esm/lro/requestUtils.js +73 -0
- package/esm/lro/requestUtils.js.map +1 -0
- package/esm/lro/stateMachine.d.ts +18 -0
- package/esm/lro/stateMachine.d.ts.map +1 -0
- package/esm/lro/stateMachine.js +84 -0
- package/esm/lro/stateMachine.js.map +1 -0
- package/esm/models/index.d.ts +2673 -4395
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +331 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/mappers.d.ts +146 -138
- package/esm/models/mappers.d.ts.map +1 -1
- package/esm/models/mappers.js +2734 -2563
- package/esm/models/mappers.js.map +1 -1
- package/esm/models/parameters.d.ts +59 -33
- package/esm/models/parameters.d.ts.map +1 -1
- package/esm/models/parameters.js +267 -159
- package/esm/models/parameters.js.map +1 -1
- package/esm/operations/blobContainers.d.ts +213 -561
- package/esm/operations/blobContainers.d.ts.map +1 -1
- package/esm/operations/blobContainers.js +578 -429
- package/esm/operations/blobContainers.js.map +1 -1
- package/esm/operations/blobInventoryPolicies.d.ts +47 -109
- package/esm/operations/blobInventoryPolicies.d.ts.map +1 -1
- package/esm/operations/blobInventoryPolicies.js +163 -105
- package/esm/operations/blobInventoryPolicies.js.map +1 -1
- package/esm/operations/blobServices.d.ts +39 -89
- package/esm/operations/blobServices.d.ts.map +1 -1
- package/esm/operations/blobServices.js +133 -89
- package/esm/operations/blobServices.js.map +1 -1
- package/esm/operations/deletedAccounts.d.ts +20 -47
- package/esm/operations/deletedAccounts.d.ts.map +1 -1
- package/esm/operations/deletedAccounts.js +111 -69
- package/esm/operations/deletedAccounts.js.map +1 -1
- package/esm/operations/encryptionScopes.d.ts +65 -166
- package/esm/operations/encryptionScopes.d.ts.map +1 -1
- package/esm/operations/encryptionScopes.js +211 -131
- package/esm/operations/encryptionScopes.js.map +1 -1
- package/esm/operations/fileServices.d.ts +25 -89
- package/esm/operations/fileServices.d.ts.map +1 -1
- package/esm/operations/fileServices.js +86 -83
- package/esm/operations/fileServices.js.map +1 -1
- package/esm/operations/fileShares.d.ts +100 -256
- package/esm/operations/fileShares.d.ts.map +1 -1
- package/esm/operations/fileShares.js +316 -164
- package/esm/operations/fileShares.js.map +1 -1
- package/esm/operations/index.d.ts.map +1 -1
- package/esm/operations/index.js +1 -2
- package/esm/operations/index.js.map +1 -1
- package/esm/operations/managementPolicies.d.ts +30 -89
- package/esm/operations/managementPolicies.d.ts.map +1 -1
- package/esm/operations/managementPolicies.js +89 -92
- package/esm/operations/managementPolicies.js.map +1 -1
- package/esm/operations/objectReplicationPoliciesOperations.d.ts +54 -130
- package/esm/operations/objectReplicationPoliciesOperations.d.ts.map +1 -1
- package/esm/operations/objectReplicationPoliciesOperations.js +170 -102
- package/esm/operations/objectReplicationPoliciesOperations.js.map +1 -1
- package/esm/operations/operations.d.ts +14 -15
- package/esm/operations/operations.d.ts.map +1 -1
- package/esm/operations/operations.js +67 -29
- package/esm/operations/operations.js.map +1 -1
- package/esm/operations/privateEndpointConnections.d.ts +46 -126
- package/esm/operations/privateEndpointConnections.d.ts.map +1 -1
- package/esm/operations/privateEndpointConnections.js +171 -103
- package/esm/operations/privateEndpointConnections.js.map +1 -1
- package/esm/operations/privateLinkResources.d.ts +11 -31
- package/esm/operations/privateLinkResources.d.ts.map +1 -1
- package/esm/operations/privateLinkResources.js +32 -36
- package/esm/operations/privateLinkResources.js.map +1 -1
- package/esm/operations/queue.d.ts +69 -196
- package/esm/operations/queue.d.ts.map +1 -1
- package/esm/operations/queue.js +230 -162
- package/esm/operations/queue.js.map +1 -1
- package/esm/operations/queueServices.d.ts +29 -87
- package/esm/operations/queueServices.d.ts.map +1 -1
- package/esm/operations/queueServices.js +86 -87
- package/esm/operations/queueServices.js.map +1 -1
- package/esm/operations/skus.d.ts +14 -15
- package/esm/operations/skus.d.ts.map +1 -1
- package/esm/operations/skus.js +67 -32
- package/esm/operations/skus.js.map +1 -1
- package/esm/operations/storageAccounts.d.ts +163 -381
- package/esm/operations/storageAccounts.d.ts.map +1 -1
- package/esm/operations/storageAccounts.js +605 -501
- package/esm/operations/storageAccounts.js.map +1 -1
- package/esm/operations/tableOperations.d.ts +67 -184
- package/esm/operations/tableOperations.d.ts.map +1 -1
- package/esm/operations/tableOperations.js +220 -143
- package/esm/operations/tableOperations.js.map +1 -1
- package/esm/operations/tableServices.d.ts +29 -87
- package/esm/operations/tableServices.d.ts.map +1 -1
- package/esm/operations/tableServices.js +86 -87
- package/esm/operations/tableServices.js.map +1 -1
- package/esm/operations/usages.d.ts +15 -18
- package/esm/operations/usages.d.ts.map +1 -1
- package/esm/operations/usages.js +73 -34
- package/esm/operations/usages.js.map +1 -1
- package/esm/operationsInterfaces/blobContainers.d.ts +247 -0
- package/esm/operationsInterfaces/blobContainers.d.ts.map +1 -0
- package/{src/models/usagesMappers.ts → esm/operationsInterfaces/blobContainers.js} +2 -7
- package/esm/operationsInterfaces/blobContainers.js.map +1 -0
- package/esm/operationsInterfaces/blobInventoryPolicies.d.ts +54 -0
- package/esm/operationsInterfaces/blobInventoryPolicies.d.ts.map +1 -0
- package/esm/{models/usagesMappers.js → operationsInterfaces/blobInventoryPolicies.js} +2 -2
- package/esm/operationsInterfaces/blobInventoryPolicies.js.map +1 -0
- package/esm/operationsInterfaces/blobServices.d.ts +41 -0
- package/esm/operationsInterfaces/blobServices.d.ts.map +1 -0
- package/{src/models/skusMappers.ts → esm/operationsInterfaces/blobServices.js} +2 -8
- package/esm/operationsInterfaces/blobServices.js.map +1 -0
- package/esm/operationsInterfaces/deletedAccounts.d.ts +19 -0
- package/esm/operationsInterfaces/deletedAccounts.d.ts.map +1 -0
- package/esm/{models/skusMappers.js → operationsInterfaces/deletedAccounts.js} +2 -2
- package/esm/operationsInterfaces/deletedAccounts.js.map +1 -0
- package/esm/operationsInterfaces/encryptionScopes.d.ts +64 -0
- package/esm/operationsInterfaces/encryptionScopes.d.ts.map +1 -0
- package/esm/operationsInterfaces/encryptionScopes.js +9 -0
- package/esm/operationsInterfaces/encryptionScopes.js.map +1 -0
- package/esm/operationsInterfaces/fileServices.d.ts +39 -0
- package/esm/operationsInterfaces/fileServices.d.ts.map +1 -0
- package/esm/operationsInterfaces/fileServices.js +9 -0
- package/esm/operationsInterfaces/fileServices.js.map +1 -0
- package/esm/operationsInterfaces/fileShares.d.ts +102 -0
- package/esm/operationsInterfaces/fileShares.d.ts.map +1 -0
- package/esm/operationsInterfaces/fileShares.js +9 -0
- package/esm/operationsInterfaces/fileShares.js.map +1 -0
- package/esm/operationsInterfaces/index.d.ts +20 -0
- package/esm/operationsInterfaces/index.d.ts.map +1 -0
- package/esm/operationsInterfaces/index.js +27 -0
- package/esm/operationsInterfaces/index.js.map +1 -0
- package/esm/operationsInterfaces/managementPolicies.d.ts +42 -0
- package/esm/operationsInterfaces/managementPolicies.d.ts.map +1 -0
- package/esm/operationsInterfaces/managementPolicies.js +9 -0
- package/esm/operationsInterfaces/managementPolicies.js.map +1 -0
- package/esm/operationsInterfaces/objectReplicationPoliciesOperations.d.ts +61 -0
- package/esm/operationsInterfaces/objectReplicationPoliciesOperations.d.ts.map +1 -0
- package/esm/operationsInterfaces/objectReplicationPoliciesOperations.js +9 -0
- package/esm/operationsInterfaces/objectReplicationPoliciesOperations.js.map +1 -0
- package/esm/operationsInterfaces/operations.d.ts +12 -0
- package/esm/operationsInterfaces/operations.d.ts.map +1 -0
- package/esm/operationsInterfaces/operations.js +9 -0
- package/esm/operationsInterfaces/operations.js.map +1 -0
- package/esm/operationsInterfaces/privateEndpointConnections.d.ts +54 -0
- package/esm/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
- package/esm/operationsInterfaces/privateEndpointConnections.js +9 -0
- package/esm/operationsInterfaces/privateEndpointConnections.js.map +1 -0
- package/esm/operationsInterfaces/privateLinkResources.d.ts +15 -0
- package/esm/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
- package/esm/operationsInterfaces/privateLinkResources.js +9 -0
- package/esm/operationsInterfaces/privateLinkResources.js.map +1 -0
- package/esm/operationsInterfaces/queue.d.ts +71 -0
- package/esm/operationsInterfaces/queue.d.ts.map +1 -0
- package/esm/operationsInterfaces/queue.js +9 -0
- package/esm/operationsInterfaces/queue.js.map +1 -0
- package/esm/operationsInterfaces/queueServices.d.ts +39 -0
- package/esm/operationsInterfaces/queueServices.d.ts.map +1 -0
- package/esm/operationsInterfaces/queueServices.js +9 -0
- package/esm/operationsInterfaces/queueServices.js.map +1 -0
- package/esm/operationsInterfaces/skus.d.ts +12 -0
- package/esm/operationsInterfaces/skus.d.ts.map +1 -0
- package/esm/operationsInterfaces/skus.js +9 -0
- package/esm/operationsInterfaces/skus.js.map +1 -0
- package/esm/operationsInterfaces/storageAccounts.d.ts +197 -0
- package/esm/operationsInterfaces/storageAccounts.d.ts.map +1 -0
- package/esm/operationsInterfaces/storageAccounts.js +9 -0
- package/esm/operationsInterfaces/storageAccounts.js.map +1 -0
- package/esm/operationsInterfaces/tableOperations.d.ts +69 -0
- package/esm/operationsInterfaces/tableOperations.d.ts.map +1 -0
- package/esm/operationsInterfaces/tableOperations.js +9 -0
- package/esm/operationsInterfaces/tableOperations.js.map +1 -0
- package/esm/operationsInterfaces/tableServices.d.ts +39 -0
- package/esm/operationsInterfaces/tableServices.d.ts.map +1 -0
- package/esm/operationsInterfaces/tableServices.js +9 -0
- package/esm/operationsInterfaces/tableServices.js.map +1 -0
- package/esm/operationsInterfaces/usages.d.ts +13 -0
- package/esm/operationsInterfaces/usages.d.ts.map +1 -0
- package/esm/operationsInterfaces/usages.js +9 -0
- package/esm/operationsInterfaces/usages.js.map +1 -0
- package/esm/storageManagementClient.d.ts +26 -35
- package/esm/storageManagementClient.d.ts.map +1 -1
- package/esm/storageManagementClient.js +27 -42
- package/esm/storageManagementClient.js.map +1 -1
- package/esm/storageManagementClientContext.d.ts +10 -16
- package/esm/storageManagementClientContext.d.ts.map +1 -1
- package/esm/storageManagementClientContext.js +32 -44
- package/esm/storageManagementClientContext.js.map +1 -1
- package/package.json +57 -18
- package/review/arm-storage.api.md +2659 -0
- package/rollup.config.js +181 -30
- package/src/coreClientLro.ts +323 -0
- package/src/index.ts +13 -0
- package/src/lro/azureAsyncPolling.ts +96 -0
- package/src/lro/bodyPolling.ts +54 -0
- package/src/lro/index.ts +26 -0
- package/src/lro/locationPolling.ts +30 -0
- package/src/lro/lroEngine.ts +61 -0
- package/src/lro/models.ts +173 -0
- package/src/lro/operation.ts +120 -0
- package/src/lro/passthrough.ts +23 -0
- package/src/lro/requestUtils.ts +105 -0
- package/src/lro/stateMachine.ts +138 -0
- package/src/models/index.ts +2813 -4492
- package/src/models/mappers.ts +2745 -2553
- package/src/models/parameters.ts +354 -160
- package/src/operations/blobContainers.ts +719 -1037
- package/src/operations/blobInventoryPolicies.ts +182 -211
- package/src/operations/blobServices.ts +150 -177
- package/src/operations/deletedAccounts.ts +111 -112
- package/src/operations/encryptionScopes.ts +233 -291
- package/src/operations/fileServices.ts +99 -171
- package/src/operations/fileShares.ts +335 -560
- package/src/operations/index.ts +1 -2
- package/src/operations/managementPolicies.ts +102 -175
- package/src/operations/objectReplicationPoliciesOperations.ts +187 -227
- package/src/operations/operations.ts +61 -38
- package/src/operations/privateEndpointConnections.ts +177 -214
- package/src/operations/privateLinkResources.ts +37 -60
- package/src/operations/queue.ts +269 -365
- package/src/operations/queueServices.ts +103 -173
- package/src/operations/skus.ts +59 -41
- package/src/operations/storageAccounts.ts +779 -872
- package/src/operations/tableOperations.ts +255 -328
- package/src/operations/tableServices.ts +103 -173
- package/src/operations/usages.ts +73 -45
- package/src/operationsInterfaces/blobContainers.ts +366 -0
- package/src/operationsInterfaces/blobInventoryPolicies.ts +92 -0
- package/src/operationsInterfaces/blobServices.ts +70 -0
- package/src/operationsInterfaces/deletedAccounts.ts +39 -0
- package/src/operationsInterfaces/encryptionScopes.ts +103 -0
- package/src/operationsInterfaces/fileServices.ts +68 -0
- package/src/operationsInterfaces/fileShares.ts +163 -0
- package/src/operationsInterfaces/index.ts +27 -0
- package/src/operationsInterfaces/managementPolicies.ts +74 -0
- package/src/operationsInterfaces/objectReplicationPoliciesOperations.ts +98 -0
- package/src/operationsInterfaces/operations.ts +23 -0
- package/src/operationsInterfaces/privateEndpointConnections.ts +91 -0
- package/src/operationsInterfaces/privateLinkResources.ts +30 -0
- package/src/operationsInterfaces/queue.ts +117 -0
- package/src/operationsInterfaces/queueServices.ts +68 -0
- package/src/operationsInterfaces/skus.ts +23 -0
- package/src/operationsInterfaces/storageAccounts.ts +320 -0
- package/src/operationsInterfaces/tableOperations.ts +112 -0
- package/src/operationsInterfaces/tableServices.ts +68 -0
- package/src/operationsInterfaces/usages.ts +25 -0
- package/src/storageManagementClient.ts +94 -67
- package/src/storageManagementClientContext.ts +42 -46
- package/tsconfig.json +2 -1
- package/dist/arm-storage.js +0 -10687
- package/dist/arm-storage.js.map +0 -1
- package/dist/arm-storage.min.js +0 -1
- package/dist/arm-storage.min.js.map +0 -1
- package/esm/models/blobContainersMappers.d.ts +0 -2
- package/esm/models/blobContainersMappers.d.ts.map +0 -1
- package/esm/models/blobContainersMappers.js +0 -9
- package/esm/models/blobContainersMappers.js.map +0 -1
- package/esm/models/blobInventoryPoliciesMappers.d.ts +0 -2
- package/esm/models/blobInventoryPoliciesMappers.d.ts.map +0 -1
- package/esm/models/blobInventoryPoliciesMappers.js +0 -9
- package/esm/models/blobInventoryPoliciesMappers.js.map +0 -1
- package/esm/models/blobServicesMappers.d.ts +0 -2
- package/esm/models/blobServicesMappers.d.ts.map +0 -1
- package/esm/models/blobServicesMappers.js +0 -9
- package/esm/models/blobServicesMappers.js.map +0 -1
- package/esm/models/deletedAccountsMappers.d.ts +0 -2
- package/esm/models/deletedAccountsMappers.d.ts.map +0 -1
- package/esm/models/deletedAccountsMappers.js +0 -9
- package/esm/models/deletedAccountsMappers.js.map +0 -1
- package/esm/models/encryptionScopesMappers.d.ts +0 -2
- package/esm/models/encryptionScopesMappers.d.ts.map +0 -1
- package/esm/models/encryptionScopesMappers.js +0 -9
- package/esm/models/encryptionScopesMappers.js.map +0 -1
- package/esm/models/fileServicesMappers.d.ts +0 -2
- package/esm/models/fileServicesMappers.d.ts.map +0 -1
- package/esm/models/fileServicesMappers.js +0 -9
- package/esm/models/fileServicesMappers.js.map +0 -1
- package/esm/models/fileSharesMappers.d.ts +0 -2
- package/esm/models/fileSharesMappers.d.ts.map +0 -1
- package/esm/models/fileSharesMappers.js +0 -9
- package/esm/models/fileSharesMappers.js.map +0 -1
- package/esm/models/managementPoliciesMappers.d.ts +0 -2
- package/esm/models/managementPoliciesMappers.d.ts.map +0 -1
- package/esm/models/managementPoliciesMappers.js +0 -9
- package/esm/models/managementPoliciesMappers.js.map +0 -1
- package/esm/models/objectReplicationPoliciesOperationsMappers.d.ts +0 -2
- package/esm/models/objectReplicationPoliciesOperationsMappers.d.ts.map +0 -1
- package/esm/models/objectReplicationPoliciesOperationsMappers.js +0 -9
- package/esm/models/objectReplicationPoliciesOperationsMappers.js.map +0 -1
- package/esm/models/operationsMappers.d.ts +0 -2
- package/esm/models/operationsMappers.d.ts.map +0 -1
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/privateEndpointConnectionsMappers.d.ts +0 -2
- package/esm/models/privateEndpointConnectionsMappers.d.ts.map +0 -1
- package/esm/models/privateEndpointConnectionsMappers.js +0 -9
- package/esm/models/privateEndpointConnectionsMappers.js.map +0 -1
- package/esm/models/privateLinkResourcesMappers.d.ts +0 -2
- package/esm/models/privateLinkResourcesMappers.d.ts.map +0 -1
- package/esm/models/privateLinkResourcesMappers.js +0 -9
- package/esm/models/privateLinkResourcesMappers.js.map +0 -1
- package/esm/models/queueMappers.d.ts +0 -2
- package/esm/models/queueMappers.d.ts.map +0 -1
- package/esm/models/queueMappers.js +0 -9
- package/esm/models/queueMappers.js.map +0 -1
- package/esm/models/queueServicesMappers.d.ts +0 -2
- package/esm/models/queueServicesMappers.d.ts.map +0 -1
- package/esm/models/queueServicesMappers.js +0 -9
- package/esm/models/queueServicesMappers.js.map +0 -1
- package/esm/models/skusMappers.d.ts +0 -2
- package/esm/models/skusMappers.d.ts.map +0 -1
- package/esm/models/skusMappers.js.map +0 -1
- package/esm/models/storageAccountsMappers.d.ts +0 -2
- package/esm/models/storageAccountsMappers.d.ts.map +0 -1
- package/esm/models/storageAccountsMappers.js +0 -9
- package/esm/models/storageAccountsMappers.js.map +0 -1
- package/esm/models/tableOperationsMappers.d.ts +0 -2
- package/esm/models/tableOperationsMappers.d.ts.map +0 -1
- package/esm/models/tableOperationsMappers.js +0 -9
- package/esm/models/tableOperationsMappers.js.map +0 -1
- package/esm/models/tableServicesMappers.d.ts +0 -2
- package/esm/models/tableServicesMappers.d.ts.map +0 -1
- package/esm/models/tableServicesMappers.js +0 -9
- package/esm/models/tableServicesMappers.js.map +0 -1
- package/esm/models/usagesMappers.d.ts +0 -2
- package/esm/models/usagesMappers.d.ts.map +0 -1
- package/esm/models/usagesMappers.js.map +0 -1
- package/src/models/blobContainersMappers.ts +0 -106
- package/src/models/blobInventoryPoliciesMappers.ts +0 -99
- package/src/models/blobServicesMappers.ts +0 -98
- package/src/models/deletedAccountsMappers.ts +0 -99
- package/src/models/encryptionScopesMappers.ts +0 -100
- package/src/models/fileServicesMappers.ts +0 -98
- package/src/models/fileSharesMappers.ts +0 -99
- package/src/models/managementPoliciesMappers.ts +0 -97
- package/src/models/objectReplicationPoliciesOperationsMappers.ts +0 -99
- package/src/models/privateEndpointConnectionsMappers.ts +0 -100
- package/src/models/privateLinkResourcesMappers.ts +0 -98
- package/src/models/queueMappers.ts +0 -98
- package/src/models/queueServicesMappers.ts +0 -98
- package/src/models/storageAccountsMappers.ts +0 -109
- package/src/models/tableOperationsMappers.ts +0 -98
- package/src/models/tableServicesMappers.ts +0 -98
package/rollup.config.js
CHANGED
|
@@ -1,37 +1,188 @@
|
|
|
1
|
-
|
|
2
|
-
import nodeResolve from "rollup-plugin-node-resolve";
|
|
3
|
-
import sourcemaps from "rollup-plugin-sourcemaps";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @type {rollup.RollupFileOptions}
|
|
7
|
-
*/
|
|
8
|
-
const config = {
|
|
9
|
-
input: "./esm/storageManagementClient.js",
|
|
10
|
-
external: [
|
|
11
|
-
"@azure/ms-rest-js",
|
|
12
|
-
"@azure/ms-rest-azure-js"
|
|
13
|
-
],
|
|
14
|
-
output: {
|
|
15
|
-
file: "./dist/arm-storage.js",
|
|
16
|
-
format: "umd",
|
|
17
|
-
name: "Azure.ArmStorage",
|
|
18
|
-
sourcemap: true,
|
|
19
|
-
globals: {
|
|
20
|
-
"@azure/ms-rest-js": "msRest",
|
|
21
|
-
"@azure/ms-rest-azure-js": "msRestAzure"
|
|
22
|
-
},
|
|
23
|
-
banner: `/*
|
|
1
|
+
/*
|
|
24
2
|
* Copyright (c) Microsoft Corporation.
|
|
25
3
|
* Licensed under the MIT License.
|
|
26
4
|
*
|
|
27
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
28
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
10
|
+
import cjs from "@rollup/plugin-commonjs";
|
|
11
|
+
import sourcemaps from "rollup-plugin-sourcemaps";
|
|
12
|
+
import multiEntry from "@rollup/plugin-multi-entry";
|
|
13
|
+
import json from "@rollup/plugin-json";
|
|
14
|
+
|
|
15
|
+
import nodeBuiltins from "builtin-modules";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: this manual configuration is only needed because OpenTelemetry uses an
|
|
21
|
+
* __exportStar downleveled helper function to declare its exports which confuses
|
|
22
|
+
* rollup's automatic discovery mechanism.
|
|
23
|
+
*
|
|
24
|
+
* @returns an object reference that can be `...`'d into your cjs() configuration.
|
|
25
|
+
*/
|
|
26
|
+
export function openTelemetryCommonJs() {
|
|
27
|
+
const namedExports = {};
|
|
28
|
+
|
|
29
|
+
for (const key of [
|
|
30
|
+
"@opentelemetry/api",
|
|
31
|
+
"@azure/core-tracing/node_modules/@opentelemetry/api"
|
|
32
|
+
]) {
|
|
33
|
+
namedExports[key] = [
|
|
34
|
+
"SpanKind",
|
|
35
|
+
"TraceFlags",
|
|
36
|
+
"getSpan",
|
|
37
|
+
"setSpan",
|
|
38
|
+
"SpanStatusCode",
|
|
39
|
+
"getSpanContext",
|
|
40
|
+
"setSpanContext"
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
|
|
45
|
+
|
|
46
|
+
for (const version of releasedOpenTelemetryVersions) {
|
|
47
|
+
namedExports[
|
|
48
|
+
// working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
|
|
49
|
+
`../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
|
|
50
|
+
] = [
|
|
51
|
+
"SpanKind",
|
|
52
|
+
"TraceFlags",
|
|
53
|
+
"getSpan",
|
|
54
|
+
"setSpan",
|
|
55
|
+
"StatusCode",
|
|
56
|
+
"CanonicalCode",
|
|
57
|
+
"getSpanContext",
|
|
58
|
+
"setSpanContext"
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return namedExports;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// #region Warning Handler
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A function that can determine whether a rollupwarning should be ignored. If
|
|
69
|
+
* the function returns `true`, then the warning will not be displayed.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
function ignoreNiseSinonEvalWarnings(warning) {
|
|
73
|
+
return (
|
|
74
|
+
warning.code === "EVAL" &&
|
|
75
|
+
warning.id &&
|
|
76
|
+
(warning.id.includes("node_modules/nise") ||
|
|
77
|
+
warning.id.includes("node_modules/sinon")) === true
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function ignoreChaiCircularDependencyWarnings(warning) {
|
|
82
|
+
return (
|
|
83
|
+
warning.code === "CIRCULAR_DEPENDENCY" &&
|
|
84
|
+
warning.importer && warning.importer.includes("node_modules/chai") === true
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const warningInhibitors = [
|
|
89
|
+
ignoreChaiCircularDependencyWarnings,
|
|
90
|
+
ignoreNiseSinonEvalWarnings
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Construct a warning handler for the shared rollup configuration
|
|
95
|
+
* that ignores certain warnings that are not relevant to testing.
|
|
96
|
+
*/
|
|
97
|
+
function makeOnWarnForTesting() {
|
|
98
|
+
return (warning, warn) => {
|
|
99
|
+
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
|
|
100
|
+
if (warningInhibitors.every((inhib) => !inhib(warning))) {
|
|
101
|
+
warn(warning);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// #endregion
|
|
107
|
+
|
|
108
|
+
function makeBrowserTestConfig() {
|
|
109
|
+
const config = {
|
|
110
|
+
input: {
|
|
111
|
+
include: ["dist-esm/test/**/*.spec.js"],
|
|
112
|
+
exclude: ["dist-esm/test/**/node/**"]
|
|
113
|
+
},
|
|
114
|
+
output: {
|
|
115
|
+
file: `dist-test/index.browser.js`,
|
|
116
|
+
format: "umd",
|
|
117
|
+
sourcemap: true
|
|
118
|
+
},
|
|
119
|
+
preserveSymlinks: false,
|
|
120
|
+
plugins: [
|
|
121
|
+
multiEntry({ exports: false }),
|
|
122
|
+
nodeResolve({
|
|
123
|
+
mainFields: ["module", "browser"]
|
|
124
|
+
}),
|
|
125
|
+
cjs({
|
|
126
|
+
namedExports: {
|
|
127
|
+
// Chai's strange internal architecture makes it impossible to statically
|
|
128
|
+
// analyze its exports.
|
|
129
|
+
chai: [
|
|
130
|
+
"version",
|
|
131
|
+
"use",
|
|
132
|
+
"util",
|
|
133
|
+
"config",
|
|
134
|
+
"expect",
|
|
135
|
+
"should",
|
|
136
|
+
"assert"
|
|
137
|
+
],
|
|
138
|
+
...openTelemetryCommonJs()
|
|
139
|
+
}
|
|
140
|
+
}),
|
|
141
|
+
json(),
|
|
142
|
+
sourcemaps()
|
|
143
|
+
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
|
|
144
|
+
],
|
|
145
|
+
onwarn: makeOnWarnForTesting(),
|
|
146
|
+
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
|
|
147
|
+
// rollup started respecting the "sideEffects" field in package.json. Since
|
|
148
|
+
// our package.json sets "sideEffects=false", this also applies to test
|
|
149
|
+
// code, which causes all tests to be removed by tree-shaking.
|
|
150
|
+
treeshake: false
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
return config;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const defaultConfigurationOptions = {
|
|
157
|
+
disableBrowserBundle: false
|
|
35
158
|
};
|
|
36
159
|
|
|
37
|
-
export
|
|
160
|
+
export function makeConfig(pkg, options) {
|
|
161
|
+
options = {
|
|
162
|
+
...defaultConfigurationOptions,
|
|
163
|
+
...(options || {})
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const baseConfig = {
|
|
167
|
+
// Use the package's module field if it has one
|
|
168
|
+
input: pkg["module"] || "dist-esm/src/index.js",
|
|
169
|
+
external: [
|
|
170
|
+
...nodeBuiltins,
|
|
171
|
+
...Object.keys(pkg.dependencies),
|
|
172
|
+
...Object.keys(pkg.devDependencies)
|
|
173
|
+
],
|
|
174
|
+
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
|
|
175
|
+
preserveSymlinks: false,
|
|
176
|
+
plugins: [sourcemaps(), nodeResolve(), cjs()]
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const config = [baseConfig];
|
|
180
|
+
|
|
181
|
+
if (!options.disableBrowserBundle) {
|
|
182
|
+
config.push(makeBrowserTestConfig());
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return config;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export default makeConfig(require("./package.json"));
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
|
10
|
+
// Licensed under the MIT License.
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
OperationArguments,
|
|
14
|
+
OperationSpec,
|
|
15
|
+
OperationResponseMap,
|
|
16
|
+
FullOperationResponse
|
|
17
|
+
} from "@azure/core-client";
|
|
18
|
+
import {
|
|
19
|
+
LroResourceLocationConfig,
|
|
20
|
+
GetLroStatusFromResponse,
|
|
21
|
+
LongRunningOperation,
|
|
22
|
+
LroConfig,
|
|
23
|
+
LroMode,
|
|
24
|
+
LroResponse,
|
|
25
|
+
LroStatus,
|
|
26
|
+
createGetLroStatusFromResponse,
|
|
27
|
+
RawResponse
|
|
28
|
+
} from "./lro";
|
|
29
|
+
|
|
30
|
+
export const successStates = ["succeeded"];
|
|
31
|
+
export const failureStates = ["failed", "canceled", "cancelled"];
|
|
32
|
+
export const terminalStates = successStates.concat(failureStates);
|
|
33
|
+
|
|
34
|
+
export type SendOperationFn<T> = (
|
|
35
|
+
args: OperationArguments,
|
|
36
|
+
spec: OperationSpec
|
|
37
|
+
) => Promise<LroResponse<T>>;
|
|
38
|
+
|
|
39
|
+
export function createPollingMethod<TResult>(
|
|
40
|
+
sendOperationFn: SendOperationFn<TResult>,
|
|
41
|
+
GetLroStatusFromResponse: GetLroStatusFromResponse<TResult>,
|
|
42
|
+
args: OperationArguments,
|
|
43
|
+
spec: OperationSpec,
|
|
44
|
+
mode?: LroMode
|
|
45
|
+
): (path?: string) => Promise<LroStatus<TResult>> {
|
|
46
|
+
/**
|
|
47
|
+
* Polling calls will always return a status object i.e. {"status": "success"}
|
|
48
|
+
* these intermediate responses are not described in the swagger so we need to
|
|
49
|
+
* pass custom mappers at runtime.
|
|
50
|
+
* This function replaces all the existing mappers to be able to deserialize a status object
|
|
51
|
+
* @param responses Original set of responses defined in the operation
|
|
52
|
+
*/
|
|
53
|
+
function getCompositeMappers(responses: {
|
|
54
|
+
[responseCode: string]: OperationResponseMap;
|
|
55
|
+
}): {
|
|
56
|
+
[responseCode: string]: OperationResponseMap;
|
|
57
|
+
} {
|
|
58
|
+
return Object.keys(responses).reduce((acc, statusCode) => {
|
|
59
|
+
return {
|
|
60
|
+
...acc,
|
|
61
|
+
[statusCode]: {
|
|
62
|
+
...responses[statusCode],
|
|
63
|
+
bodyMapper: {
|
|
64
|
+
type: {
|
|
65
|
+
name: "Composite",
|
|
66
|
+
modelProperties: {
|
|
67
|
+
status: {
|
|
68
|
+
serializedName: "status",
|
|
69
|
+
type: {
|
|
70
|
+
name: "String"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}, {} as { [responseCode: string]: OperationResponseMap });
|
|
79
|
+
}
|
|
80
|
+
let response: LroStatus<TResult> | undefined = undefined;
|
|
81
|
+
const customerCallback = args?.options?.onResponse;
|
|
82
|
+
const updatedArgs = {
|
|
83
|
+
...args,
|
|
84
|
+
options: {
|
|
85
|
+
...args.options,
|
|
86
|
+
onResponse: (
|
|
87
|
+
rawResponse: FullOperationResponse,
|
|
88
|
+
flatResponse: unknown
|
|
89
|
+
): void => {
|
|
90
|
+
response = GetLroStatusFromResponse(
|
|
91
|
+
{
|
|
92
|
+
statusCode: rawResponse.status,
|
|
93
|
+
body: rawResponse.parsedBody,
|
|
94
|
+
headers: rawResponse.headers.toJSON()
|
|
95
|
+
},
|
|
96
|
+
flatResponse as TResult
|
|
97
|
+
);
|
|
98
|
+
if (response.done) {
|
|
99
|
+
customerCallback?.(rawResponse, flatResponse);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
// Make sure we don't send any body to the get request
|
|
105
|
+
const { requestBody, responses, ...restSpec } = spec;
|
|
106
|
+
if (mode === "AzureAsync") {
|
|
107
|
+
return async (path?: string) => {
|
|
108
|
+
await sendOperationFn(updatedArgs, {
|
|
109
|
+
...restSpec,
|
|
110
|
+
responses: getCompositeMappers(responses),
|
|
111
|
+
httpMethod: "GET",
|
|
112
|
+
...(path && { path })
|
|
113
|
+
});
|
|
114
|
+
return response!;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
return async (path?: string) => {
|
|
118
|
+
await sendOperationFn(updatedArgs, {
|
|
119
|
+
...restSpec,
|
|
120
|
+
responses: responses,
|
|
121
|
+
httpMethod: "GET",
|
|
122
|
+
...(path && { path })
|
|
123
|
+
});
|
|
124
|
+
return response!;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* We need to selectively deserialize our responses, only deserializing if we
|
|
130
|
+
* are in a final Lro response, not deserializing any polling non-terminal responses
|
|
131
|
+
*/
|
|
132
|
+
export function shouldDeserializeLro(lroResourceLocationConfig?: string) {
|
|
133
|
+
let initialOperationInfo: LroResponseInfo | undefined;
|
|
134
|
+
let isInitialRequest = true;
|
|
135
|
+
|
|
136
|
+
return (response: FullOperationResponse) => {
|
|
137
|
+
if (response.status < 200 || response.status >= 300) {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (!initialOperationInfo) {
|
|
142
|
+
initialOperationInfo = getLroData(response);
|
|
143
|
+
} else {
|
|
144
|
+
isInitialRequest = false;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (
|
|
148
|
+
initialOperationInfo.azureAsyncOperation ||
|
|
149
|
+
initialOperationInfo.operationLocation
|
|
150
|
+
) {
|
|
151
|
+
return (
|
|
152
|
+
!isInitialRequest &&
|
|
153
|
+
isAsyncOperationFinalResponse(
|
|
154
|
+
response,
|
|
155
|
+
initialOperationInfo,
|
|
156
|
+
lroResourceLocationConfig
|
|
157
|
+
)
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (initialOperationInfo.location) {
|
|
162
|
+
return isLocationFinalResponse(response);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (initialOperationInfo.requestMethod === "PUT") {
|
|
166
|
+
return isBodyPollingFinalResponse(response);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return true;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function isAsyncOperationFinalResponse(
|
|
174
|
+
response: FullOperationResponse,
|
|
175
|
+
initialOperationInfo: LroResponseInfo,
|
|
176
|
+
lroResourceLocationConfig?: string
|
|
177
|
+
): boolean {
|
|
178
|
+
const status: string = response.parsedBody?.status || "Succeeded";
|
|
179
|
+
if (!terminalStates.includes(status.toLowerCase())) {
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (initialOperationInfo.requestMethod === "DELETE") {
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (
|
|
188
|
+
initialOperationInfo.requestMethod === "PUT" &&
|
|
189
|
+
lroResourceLocationConfig &&
|
|
190
|
+
lroResourceLocationConfig.toLowerCase() === "azure-asyncoperation"
|
|
191
|
+
) {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (
|
|
196
|
+
initialOperationInfo.requestMethod !== "PUT" &&
|
|
197
|
+
!initialOperationInfo.location
|
|
198
|
+
) {
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function isLocationFinalResponse(response: FullOperationResponse): boolean {
|
|
206
|
+
return response.status !== 202;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function isBodyPollingFinalResponse(response: FullOperationResponse): boolean {
|
|
210
|
+
const provisioningState: string =
|
|
211
|
+
response.parsedBody?.properties?.provisioningState || "Succeeded";
|
|
212
|
+
|
|
213
|
+
if (terminalStates.includes(provisioningState.toLowerCase())) {
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
interface LroResponseInfo {
|
|
221
|
+
requestMethod: string;
|
|
222
|
+
azureAsyncOperation?: string;
|
|
223
|
+
operationLocation?: string;
|
|
224
|
+
location?: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function getLroData(result: FullOperationResponse): LroResponseInfo {
|
|
228
|
+
return {
|
|
229
|
+
azureAsyncOperation: result.headers.get("azure-asyncoperation"),
|
|
230
|
+
operationLocation: result.headers.get("operation-location"),
|
|
231
|
+
location: result.headers.get("location"),
|
|
232
|
+
requestMethod: result.request.method
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export function getSpecPath(spec: OperationSpec): string {
|
|
237
|
+
if (spec.path) {
|
|
238
|
+
return spec.path;
|
|
239
|
+
} else {
|
|
240
|
+
throw Error("Bad spec: request path is not found!");
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export class CoreClientLro<T> implements LongRunningOperation<T> {
|
|
245
|
+
constructor(
|
|
246
|
+
private sendOperationFn: SendOperationFn<T>,
|
|
247
|
+
private args: OperationArguments,
|
|
248
|
+
private spec: OperationSpec,
|
|
249
|
+
private lroResourceLocationConfig?: LroResourceLocationConfig,
|
|
250
|
+
public requestPath: string = spec.path!,
|
|
251
|
+
public requestMethod: string = spec.httpMethod
|
|
252
|
+
) {}
|
|
253
|
+
public async sendInitialRequest(
|
|
254
|
+
initializeState: (
|
|
255
|
+
rawResponse: RawResponse,
|
|
256
|
+
flatResponse: unknown
|
|
257
|
+
) => boolean
|
|
258
|
+
): Promise<LroResponse<T>> {
|
|
259
|
+
const { onResponse, ...restOptions } = this.args.options || {};
|
|
260
|
+
return this.sendOperationFn(
|
|
261
|
+
{
|
|
262
|
+
...this.args,
|
|
263
|
+
options: {
|
|
264
|
+
...restOptions,
|
|
265
|
+
onResponse: (
|
|
266
|
+
rawResponse: FullOperationResponse,
|
|
267
|
+
flatResponse: unknown
|
|
268
|
+
) => {
|
|
269
|
+
const isCompleted = initializeState(
|
|
270
|
+
{
|
|
271
|
+
statusCode: rawResponse.status,
|
|
272
|
+
body: rawResponse.parsedBody,
|
|
273
|
+
headers: rawResponse.headers.toJSON()
|
|
274
|
+
},
|
|
275
|
+
flatResponse
|
|
276
|
+
);
|
|
277
|
+
if (isCompleted) {
|
|
278
|
+
onResponse?.(rawResponse, flatResponse);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
this.spec
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
public async sendPollRequest(
|
|
288
|
+
config: LroConfig,
|
|
289
|
+
path: string
|
|
290
|
+
): Promise<LroStatus<T>> {
|
|
291
|
+
const getLroStatusFromResponse = createGetLroStatusFromResponse(
|
|
292
|
+
this,
|
|
293
|
+
config,
|
|
294
|
+
this.lroResourceLocationConfig
|
|
295
|
+
);
|
|
296
|
+
return createPollingMethod(
|
|
297
|
+
this.sendOperationFn,
|
|
298
|
+
getLroStatusFromResponse,
|
|
299
|
+
this.args,
|
|
300
|
+
this.spec,
|
|
301
|
+
config.mode
|
|
302
|
+
)(path);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
public async retrieveAzureAsyncResource(
|
|
306
|
+
path?: string
|
|
307
|
+
): Promise<LroResponse<T>> {
|
|
308
|
+
const updatedArgs = { ...this.args };
|
|
309
|
+
if (updatedArgs.options) {
|
|
310
|
+
(updatedArgs.options as any).shouldDeserialize = true;
|
|
311
|
+
}
|
|
312
|
+
return createPollingMethod(
|
|
313
|
+
this.sendOperationFn,
|
|
314
|
+
(rawResponse, flatResponse) => ({
|
|
315
|
+
rawResponse,
|
|
316
|
+
flatResponse,
|
|
317
|
+
done: true
|
|
318
|
+
}),
|
|
319
|
+
updatedArgs,
|
|
320
|
+
this.spec
|
|
321
|
+
)(path);
|
|
322
|
+
}
|
|
323
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/// <reference lib="esnext.asynciterable" />
|
|
10
|
+
export * from "./models";
|
|
11
|
+
export { StorageManagementClient } from "./storageManagementClient";
|
|
12
|
+
export { StorageManagementClientContext } from "./storageManagementClientContext";
|
|
13
|
+
export * from "./operationsInterfaces";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
|
10
|
+
// Licensed under the MIT license.
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
failureStates,
|
|
14
|
+
LroResourceLocationConfig,
|
|
15
|
+
LongRunningOperation,
|
|
16
|
+
LroBody,
|
|
17
|
+
LroResponse,
|
|
18
|
+
LroStatus,
|
|
19
|
+
RawResponse,
|
|
20
|
+
successStates
|
|
21
|
+
} from "./models";
|
|
22
|
+
import { isUnexpectedPollingResponse } from "./requestUtils";
|
|
23
|
+
|
|
24
|
+
function getResponseStatus(rawResponse: RawResponse): string {
|
|
25
|
+
const { status } = (rawResponse.body as LroBody) ?? {};
|
|
26
|
+
return status?.toLowerCase() ?? "succeeded";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isAzureAsyncPollingDone(rawResponse: RawResponse): boolean {
|
|
30
|
+
const state = getResponseStatus(rawResponse);
|
|
31
|
+
if (
|
|
32
|
+
isUnexpectedPollingResponse(rawResponse) ||
|
|
33
|
+
failureStates.includes(state)
|
|
34
|
+
) {
|
|
35
|
+
throw new Error(`Operation status: ${state}`);
|
|
36
|
+
}
|
|
37
|
+
return successStates.includes(state);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async function sendFinalRequest<TResult>(
|
|
41
|
+
lro: LongRunningOperation<TResult>,
|
|
42
|
+
lroResourceLocationConfig?: LroResourceLocationConfig,
|
|
43
|
+
resourceLocation?: string
|
|
44
|
+
): Promise<LroResponse<TResult> | undefined> {
|
|
45
|
+
switch (lroResourceLocationConfig) {
|
|
46
|
+
case "original-uri":
|
|
47
|
+
return lro.retrieveAzureAsyncResource();
|
|
48
|
+
case "azure-async-operation":
|
|
49
|
+
return Promise.resolve(undefined);
|
|
50
|
+
case "location":
|
|
51
|
+
default:
|
|
52
|
+
return lro.retrieveAzureAsyncResource(resourceLocation);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function processAzureAsyncOperationResult<TResult>(
|
|
57
|
+
lro: LongRunningOperation<TResult>,
|
|
58
|
+
resourceLocation?: string,
|
|
59
|
+
lroResourceLocationConfig?: LroResourceLocationConfig
|
|
60
|
+
): (rawResponse: RawResponse, flatResponse: TResult) => LroStatus<TResult> {
|
|
61
|
+
return (
|
|
62
|
+
rawResponse: RawResponse,
|
|
63
|
+
flatResponse: TResult
|
|
64
|
+
): LroStatus<TResult> => {
|
|
65
|
+
if (isAzureAsyncPollingDone(rawResponse)) {
|
|
66
|
+
if (resourceLocation === undefined) {
|
|
67
|
+
return { rawResponse, flatResponse, done: true };
|
|
68
|
+
} else {
|
|
69
|
+
return {
|
|
70
|
+
rawResponse,
|
|
71
|
+
flatResponse,
|
|
72
|
+
done: false,
|
|
73
|
+
next: async () => {
|
|
74
|
+
const finalResponse = await sendFinalRequest(
|
|
75
|
+
lro,
|
|
76
|
+
lroResourceLocationConfig,
|
|
77
|
+
resourceLocation
|
|
78
|
+
);
|
|
79
|
+
return {
|
|
80
|
+
...(finalResponse ?? {
|
|
81
|
+
rawResponse,
|
|
82
|
+
flatResponse
|
|
83
|
+
}),
|
|
84
|
+
done: true
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
rawResponse,
|
|
92
|
+
flatResponse,
|
|
93
|
+
done: false
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
|
10
|
+
// Licensed under the MIT license.
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
failureStates,
|
|
14
|
+
LroBody,
|
|
15
|
+
LroStatus,
|
|
16
|
+
RawResponse,
|
|
17
|
+
successStates
|
|
18
|
+
} from "./models";
|
|
19
|
+
import { isUnexpectedPollingResponse } from "./requestUtils";
|
|
20
|
+
|
|
21
|
+
function getProvisioningState(rawResponse: RawResponse): string {
|
|
22
|
+
const { properties, provisioningState } = (rawResponse.body as LroBody) ?? {};
|
|
23
|
+
const state: string | undefined =
|
|
24
|
+
properties?.provisioningState ?? provisioningState;
|
|
25
|
+
return state?.toLowerCase() ?? "succeeded";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function isBodyPollingDone(rawResponse: RawResponse): boolean {
|
|
29
|
+
const state = getProvisioningState(rawResponse);
|
|
30
|
+
if (
|
|
31
|
+
isUnexpectedPollingResponse(rawResponse) ||
|
|
32
|
+
failureStates.includes(state)
|
|
33
|
+
) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`The long running operation has failed. The provisioning state: ${state}.`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return successStates.includes(state);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Creates a polling strategy based on BodyPolling which uses the provisioning state
|
|
43
|
+
* from the result to determine the current operation state
|
|
44
|
+
*/
|
|
45
|
+
export function processBodyPollingOperationResult<TResult>(
|
|
46
|
+
rawResponse: RawResponse,
|
|
47
|
+
flatResponse: TResult
|
|
48
|
+
): LroStatus<TResult> {
|
|
49
|
+
return {
|
|
50
|
+
rawResponse,
|
|
51
|
+
flatResponse,
|
|
52
|
+
done: isBodyPollingDone(rawResponse)
|
|
53
|
+
};
|
|
54
|
+
}
|