@azure/arm-hardwaresecuritymodules 2.0.0-alpha.20250717.3 → 2.0.0-alpha.20250730.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/api/azureDedicatedHSMResourceProviderContext.js +16 -10
- package/dist/browser/api/azureDedicatedHSMResourceProviderContext.js.map +1 -1
- package/dist/browser/api/cloudHsmClusterBackupStatus/operations.js +10 -5
- package/dist/browser/api/cloudHsmClusterBackupStatus/operations.js.map +1 -1
- package/dist/browser/api/cloudHsmClusterPrivateEndpointConnections/operations.js +28 -11
- package/dist/browser/api/cloudHsmClusterPrivateEndpointConnections/operations.js.map +1 -1
- package/dist/browser/api/cloudHsmClusterPrivateLinkResources/operations.js +8 -3
- package/dist/browser/api/cloudHsmClusterPrivateLinkResources/operations.js.map +1 -1
- package/dist/browser/api/cloudHsmClusterRestoreStatus/operations.js +10 -5
- package/dist/browser/api/cloudHsmClusterRestoreStatus/operations.js.map +1 -1
- package/dist/browser/api/cloudHsmClusters/operations.js +111 -49
- package/dist/browser/api/cloudHsmClusters/operations.js.map +1 -1
- package/dist/browser/api/dedicatedHsm/operations.js +68 -29
- package/dist/browser/api/dedicatedHsm/operations.js.map +1 -1
- package/dist/browser/api/operations/operations.js +8 -3
- package/dist/browser/api/operations/operations.js.map +1 -1
- package/dist/browser/api/privateEndpointConnections/operations.js +8 -3
- package/dist/browser/api/privateEndpointConnections/operations.js.map +1 -1
- package/dist/browser/azureDedicatedHSMResourceProvider.js +24 -3
- package/dist/browser/azureDedicatedHSMResourceProvider.js.map +1 -1
- package/dist/browser/classic/cloudHsmClusterBackupStatus/index.js +3 -1
- package/dist/browser/classic/cloudHsmClusterBackupStatus/index.js.map +1 -1
- package/dist/browser/classic/cloudHsmClusterPrivateEndpointConnections/index.js +3 -1
- package/dist/browser/classic/cloudHsmClusterPrivateEndpointConnections/index.js.map +1 -1
- package/dist/browser/classic/cloudHsmClusterPrivateLinkResources/index.js +3 -1
- package/dist/browser/classic/cloudHsmClusterPrivateLinkResources/index.js.map +1 -1
- package/dist/browser/classic/cloudHsmClusterRestoreStatus/index.js +3 -1
- package/dist/browser/classic/cloudHsmClusterRestoreStatus/index.js.map +1 -1
- package/dist/browser/classic/cloudHsmClusters/index.js +3 -1
- package/dist/browser/classic/cloudHsmClusters/index.js.map +1 -1
- package/dist/browser/classic/dedicatedHsm/index.js +3 -1
- package/dist/browser/classic/dedicatedHsm/index.js.map +1 -1
- package/dist/browser/classic/operations/index.js +3 -1
- package/dist/browser/classic/operations/index.js.map +1 -1
- package/dist/browser/classic/privateEndpointConnections/index.js +3 -1
- package/dist/browser/classic/privateEndpointConnections/index.js.map +1 -1
- package/dist/browser/restorePollerHelpers.js +11 -13
- package/dist/browser/restorePollerHelpers.js.map +1 -1
- package/dist/browser/static-helpers/pagingHelpers.js +31 -50
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/browser/static-helpers/pollingHelpers.js +14 -11
- package/dist/browser/static-helpers/pollingHelpers.js.map +1 -1
- package/dist/browser/static-helpers/urlTemplate.js +2 -2
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -1
- package/dist/commonjs/api/azureDedicatedHSMResourceProviderContext.js +16 -10
- package/dist/commonjs/api/azureDedicatedHSMResourceProviderContext.js.map +1 -1
- package/dist/commonjs/api/cloudHsmClusterBackupStatus/operations.js +10 -5
- package/dist/commonjs/api/cloudHsmClusterBackupStatus/operations.js.map +1 -1
- package/dist/commonjs/api/cloudHsmClusterPrivateEndpointConnections/operations.js +28 -11
- package/dist/commonjs/api/cloudHsmClusterPrivateEndpointConnections/operations.js.map +1 -1
- package/dist/commonjs/api/cloudHsmClusterPrivateLinkResources/operations.js +8 -3
- package/dist/commonjs/api/cloudHsmClusterPrivateLinkResources/operations.js.map +1 -1
- package/dist/commonjs/api/cloudHsmClusterRestoreStatus/operations.js +10 -5
- package/dist/commonjs/api/cloudHsmClusterRestoreStatus/operations.js.map +1 -1
- package/dist/commonjs/api/cloudHsmClusters/operations.js +111 -49
- package/dist/commonjs/api/cloudHsmClusters/operations.js.map +1 -1
- package/dist/commonjs/api/dedicatedHsm/operations.js +68 -29
- package/dist/commonjs/api/dedicatedHsm/operations.js.map +1 -1
- package/dist/commonjs/api/operations/operations.js +8 -3
- package/dist/commonjs/api/operations/operations.js.map +1 -1
- package/dist/commonjs/api/privateEndpointConnections/operations.js +8 -3
- package/dist/commonjs/api/privateEndpointConnections/operations.js.map +1 -1
- package/dist/commonjs/azureDedicatedHSMResourceProvider.js +24 -3
- package/dist/commonjs/azureDedicatedHSMResourceProvider.js.map +1 -1
- package/dist/commonjs/classic/cloudHsmClusterBackupStatus/index.js +3 -1
- package/dist/commonjs/classic/cloudHsmClusterBackupStatus/index.js.map +1 -1
- package/dist/commonjs/classic/cloudHsmClusterPrivateEndpointConnections/index.js +3 -1
- package/dist/commonjs/classic/cloudHsmClusterPrivateEndpointConnections/index.js.map +1 -1
- package/dist/commonjs/classic/cloudHsmClusterPrivateLinkResources/index.js +3 -1
- package/dist/commonjs/classic/cloudHsmClusterPrivateLinkResources/index.js.map +1 -1
- package/dist/commonjs/classic/cloudHsmClusterRestoreStatus/index.js +3 -1
- package/dist/commonjs/classic/cloudHsmClusterRestoreStatus/index.js.map +1 -1
- package/dist/commonjs/classic/cloudHsmClusters/index.js +3 -1
- package/dist/commonjs/classic/cloudHsmClusters/index.js.map +1 -1
- package/dist/commonjs/classic/dedicatedHsm/index.js +3 -1
- package/dist/commonjs/classic/dedicatedHsm/index.js.map +1 -1
- package/dist/commonjs/classic/operations/index.js +3 -1
- package/dist/commonjs/classic/operations/index.js.map +1 -1
- package/dist/commonjs/classic/privateEndpointConnections/index.js +3 -1
- package/dist/commonjs/classic/privateEndpointConnections/index.js.map +1 -1
- package/dist/commonjs/restorePollerHelpers.js +11 -13
- package/dist/commonjs/restorePollerHelpers.js.map +1 -1
- package/dist/commonjs/static-helpers/pagingHelpers.js +31 -50
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/commonjs/static-helpers/pollingHelpers.js +14 -11
- package/dist/commonjs/static-helpers/pollingHelpers.js.map +1 -1
- package/dist/commonjs/static-helpers/urlTemplate.js +2 -2
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/api/azureDedicatedHSMResourceProviderContext.js +16 -10
- package/dist/esm/api/azureDedicatedHSMResourceProviderContext.js.map +1 -1
- package/dist/esm/api/cloudHsmClusterBackupStatus/operations.js +10 -5
- package/dist/esm/api/cloudHsmClusterBackupStatus/operations.js.map +1 -1
- package/dist/esm/api/cloudHsmClusterPrivateEndpointConnections/operations.js +28 -11
- package/dist/esm/api/cloudHsmClusterPrivateEndpointConnections/operations.js.map +1 -1
- package/dist/esm/api/cloudHsmClusterPrivateLinkResources/operations.js +8 -3
- package/dist/esm/api/cloudHsmClusterPrivateLinkResources/operations.js.map +1 -1
- package/dist/esm/api/cloudHsmClusterRestoreStatus/operations.js +10 -5
- package/dist/esm/api/cloudHsmClusterRestoreStatus/operations.js.map +1 -1
- package/dist/esm/api/cloudHsmClusters/operations.js +111 -49
- package/dist/esm/api/cloudHsmClusters/operations.js.map +1 -1
- package/dist/esm/api/dedicatedHsm/operations.js +68 -29
- package/dist/esm/api/dedicatedHsm/operations.js.map +1 -1
- package/dist/esm/api/operations/operations.js +8 -3
- package/dist/esm/api/operations/operations.js.map +1 -1
- package/dist/esm/api/privateEndpointConnections/operations.js +8 -3
- package/dist/esm/api/privateEndpointConnections/operations.js.map +1 -1
- package/dist/esm/azureDedicatedHSMResourceProvider.js +24 -3
- package/dist/esm/azureDedicatedHSMResourceProvider.js.map +1 -1
- package/dist/esm/classic/cloudHsmClusterBackupStatus/index.js +3 -1
- package/dist/esm/classic/cloudHsmClusterBackupStatus/index.js.map +1 -1
- package/dist/esm/classic/cloudHsmClusterPrivateEndpointConnections/index.js +3 -1
- package/dist/esm/classic/cloudHsmClusterPrivateEndpointConnections/index.js.map +1 -1
- package/dist/esm/classic/cloudHsmClusterPrivateLinkResources/index.js +3 -1
- package/dist/esm/classic/cloudHsmClusterPrivateLinkResources/index.js.map +1 -1
- package/dist/esm/classic/cloudHsmClusterRestoreStatus/index.js +3 -1
- package/dist/esm/classic/cloudHsmClusterRestoreStatus/index.js.map +1 -1
- package/dist/esm/classic/cloudHsmClusters/index.js +3 -1
- package/dist/esm/classic/cloudHsmClusters/index.js.map +1 -1
- package/dist/esm/classic/dedicatedHsm/index.js +3 -1
- package/dist/esm/classic/dedicatedHsm/index.js.map +1 -1
- package/dist/esm/classic/operations/index.js +3 -1
- package/dist/esm/classic/operations/index.js.map +1 -1
- package/dist/esm/classic/privateEndpointConnections/index.js +3 -1
- package/dist/esm/classic/privateEndpointConnections/index.js.map +1 -1
- package/dist/esm/restorePollerHelpers.js +11 -13
- package/dist/esm/restorePollerHelpers.js.map +1 -1
- package/dist/esm/static-helpers/pagingHelpers.js +31 -50
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/esm/static-helpers/pollingHelpers.js +14 -11
- package/dist/esm/static-helpers/pollingHelpers.js.map +1 -1
- package/dist/esm/static-helpers/urlTemplate.js +2 -2
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -1
- package/dist/react-native/api/azureDedicatedHSMResourceProviderContext.js +16 -10
- package/dist/react-native/api/azureDedicatedHSMResourceProviderContext.js.map +1 -1
- package/dist/react-native/api/cloudHsmClusterBackupStatus/operations.js +10 -5
- package/dist/react-native/api/cloudHsmClusterBackupStatus/operations.js.map +1 -1
- package/dist/react-native/api/cloudHsmClusterPrivateEndpointConnections/operations.js +28 -11
- package/dist/react-native/api/cloudHsmClusterPrivateEndpointConnections/operations.js.map +1 -1
- package/dist/react-native/api/cloudHsmClusterPrivateLinkResources/operations.js +8 -3
- package/dist/react-native/api/cloudHsmClusterPrivateLinkResources/operations.js.map +1 -1
- package/dist/react-native/api/cloudHsmClusterRestoreStatus/operations.js +10 -5
- package/dist/react-native/api/cloudHsmClusterRestoreStatus/operations.js.map +1 -1
- package/dist/react-native/api/cloudHsmClusters/operations.js +111 -49
- package/dist/react-native/api/cloudHsmClusters/operations.js.map +1 -1
- package/dist/react-native/api/dedicatedHsm/operations.js +68 -29
- package/dist/react-native/api/dedicatedHsm/operations.js.map +1 -1
- package/dist/react-native/api/operations/operations.js +8 -3
- package/dist/react-native/api/operations/operations.js.map +1 -1
- package/dist/react-native/api/privateEndpointConnections/operations.js +8 -3
- package/dist/react-native/api/privateEndpointConnections/operations.js.map +1 -1
- package/dist/react-native/azureDedicatedHSMResourceProvider.js +24 -3
- package/dist/react-native/azureDedicatedHSMResourceProvider.js.map +1 -1
- package/dist/react-native/classic/cloudHsmClusterBackupStatus/index.js +3 -1
- package/dist/react-native/classic/cloudHsmClusterBackupStatus/index.js.map +1 -1
- package/dist/react-native/classic/cloudHsmClusterPrivateEndpointConnections/index.js +3 -1
- package/dist/react-native/classic/cloudHsmClusterPrivateEndpointConnections/index.js.map +1 -1
- package/dist/react-native/classic/cloudHsmClusterPrivateLinkResources/index.js +3 -1
- package/dist/react-native/classic/cloudHsmClusterPrivateLinkResources/index.js.map +1 -1
- package/dist/react-native/classic/cloudHsmClusterRestoreStatus/index.js +3 -1
- package/dist/react-native/classic/cloudHsmClusterRestoreStatus/index.js.map +1 -1
- package/dist/react-native/classic/cloudHsmClusters/index.js +3 -1
- package/dist/react-native/classic/cloudHsmClusters/index.js.map +1 -1
- package/dist/react-native/classic/dedicatedHsm/index.js +3 -1
- package/dist/react-native/classic/dedicatedHsm/index.js.map +1 -1
- package/dist/react-native/classic/operations/index.js +3 -1
- package/dist/react-native/classic/operations/index.js.map +1 -1
- package/dist/react-native/classic/privateEndpointConnections/index.js +3 -1
- package/dist/react-native/classic/privateEndpointConnections/index.js.map +1 -1
- package/dist/react-native/restorePollerHelpers.js +11 -13
- package/dist/react-native/restorePollerHelpers.js.map +1 -1
- package/dist/react-native/static-helpers/pagingHelpers.js +31 -50
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/react-native/static-helpers/pollingHelpers.js +14 -11
- package/dist/react-native/static-helpers/pollingHelpers.js.map +1 -1
- package/dist/react-native/static-helpers/urlTemplate.js +2 -2
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -1
- package/package.json +2 -2
- package/review/arm-hardwaresecuritymodules-api-cloudHsmClusterBackupStatus-node.api.md +22 -22
- package/review/arm-hardwaresecuritymodules-api-cloudHsmClusterPrivateEndpointConnections-node.api.md +36 -36
- package/review/arm-hardwaresecuritymodules-api-cloudHsmClusterPrivateLinkResources-node.api.md +19 -19
- package/review/arm-hardwaresecuritymodules-api-cloudHsmClusterRestoreStatus-node.api.md +22 -22
- package/review/arm-hardwaresecuritymodules-api-cloudHsmClusters-node.api.md +96 -96
- package/review/arm-hardwaresecuritymodules-api-dedicatedHsm-node.api.md +68 -68
- package/review/arm-hardwaresecuritymodules-api-node.api.md +27 -27
- package/review/arm-hardwaresecuritymodules-api-operations-node.api.md +19 -19
- package/review/arm-hardwaresecuritymodules-api-privateEndpointConnections-node.api.md +19 -19
- package/review/arm-hardwaresecuritymodules-models-node.api.md +471 -471
- package/review/arm-hardwaresecuritymodules-node.api.md +703 -703
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/cloudHsmClusterRestoreStatus/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA6BlC,gGAMC;AA/BD,wFAA2E;AAc3E,SAAS,gCAAgC,CAAC,OAAiD;IACzF,OAAO;QACL,GAAG,EAAE,CACH,iBAAyB,EACzB,mBAA2B,EAC3B,KAAa,EACb,OAAuD,EACvD,EAAE,CAAC,IAAA,mBAAG,EAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,SAAgB,0CAA0C,CACxD,OAAiD;IAEjD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/cloudHsmClusterRestoreStatus/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA6BlC,gGAMC;AA/BD,wFAA2E;AAc3E,SAAS,gCAAgC,CAAC,OAAiD;IACzF,OAAO;QACL,GAAG,EAAE,CACH,iBAAyB,EACzB,mBAA2B,EAC3B,KAAa,EACb,OAAuD,EACvD,EAAE,CAAC,IAAA,mBAAG,EAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,SAAgB,0CAA0C,CACxD,OAAiD;IAEjD,OAAO;QACL,GAAG,gCAAgC,CAAC,OAAO,CAAC;KAC7C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AzureDedicatedHSMResourceProviderContext } from \"../../api/azureDedicatedHSMResourceProviderContext.js\";\nimport { CloudHsmClusterRestoreStatusGetOptionalParams } from \"../../api/cloudHsmClusterRestoreStatus/options.js\";\nimport { get } from \"../../api/cloudHsmClusterRestoreStatus/operations.js\";\nimport { PollerLike, OperationState } from \"@azure/core-lro\";\n\n/** Interface representing a CloudHsmClusterRestoreStatus operations. */\nexport interface CloudHsmClusterRestoreStatusOperations {\n /** Gets the restore operation status of the specified Cloud HSM Cluster */\n get: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n jobId: string,\n options?: CloudHsmClusterRestoreStatusGetOptionalParams,\n ) => PollerLike<OperationState<void>, void>;\n}\n\nfunction _getCloudHsmClusterRestoreStatus(context: AzureDedicatedHSMResourceProviderContext) {\n return {\n get: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n jobId: string,\n options?: CloudHsmClusterRestoreStatusGetOptionalParams,\n ) => get(context, resourceGroupName, cloudHsmClusterName, jobId, options),\n };\n}\n\nexport function _getCloudHsmClusterRestoreStatusOperations(\n context: AzureDedicatedHSMResourceProviderContext,\n): CloudHsmClusterRestoreStatusOperations {\n return {\n ..._getCloudHsmClusterRestoreStatus(context),\n };\n}\n"]}
|
|
@@ -19,6 +19,8 @@ function _getCloudHsmClusters(context) {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
function _getCloudHsmClustersOperations(context) {
|
|
22
|
-
return
|
|
22
|
+
return {
|
|
23
|
+
..._getCloudHsmClusters(context),
|
|
24
|
+
};
|
|
23
25
|
}
|
|
24
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/cloudHsmClusters/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAiKlC,wEAMC;AAjJD,4EAWkD;AAyElD,SAAS,oBAAoB,CAAC,OAAiD;IAC7E,OAAO;QACL,OAAO,EAAE,CACP,iBAAyB,EACzB,mBAA2B,EAC3B,wBAAkD,EAClD,OAA+C,EAC/C,EAAE,CACF,IAAA,uBAAO,EAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,OAAO,CAAC;QAC7F,yBAAyB,EAAE,CACzB,iBAAyB,EACzB,mBAA2B,EAC3B,OAAiE,EACjE,EAAE,CAAC,IAAA,yCAAyB,EAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,OAAO,CAAC;QACxF,MAAM,EAAE,CACN,iBAAyB,EACzB,mBAA2B,EAC3B,OAA8C,EAC9C,EAAE,CAAC,IAAA,sBAAM,EAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,OAAO,CAAC;QACrE,wBAAwB,EAAE,CACxB,iBAAyB,EACzB,mBAA2B,EAC3B,OAAgE,EAChE,EAAE,CAAC,IAAA,wCAAwB,EAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,OAAO,CAAC;QACvF,kBAAkB,EAAE,CAAC,OAA0D,E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AAE,OAAO,CAAC;QACnF,GAAG,EAAE,CACH,iBAAyB,EACzB,mBAA2B,EAC3B,OAA2C,EAC3C,EAAE,CAAC,IAAA,mBAAG,EAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,OAAO,CAAC;KACnE,CAAC;AACJ,CAAC;AAED,SAAgB,8BAA8B,CAC5C,OAAiD;IAEjD,OAAO;QACL,GAAG,oBAAoB,CAAC,OAAO,CAAC;KACjC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AzureDedicatedHSMResourceProviderContext } from \"../../api/azureDedicatedHSMResourceProviderContext.js\";\nimport {\n CloudHsmCluster,\n CloudHsmClusterPatchParameters,\n BackupResult,\n RestoreRequestProperties,\n RestoreResult,\n} from \"../../models/models.js\";\nimport {\n CloudHsmClustersRestoreOptionalParams,\n CloudHsmClustersValidateRestorePropertiesOptionalParams,\n CloudHsmClustersBackupOptionalParams,\n CloudHsmClustersValidateBackupPropertiesOptionalParams,\n CloudHsmClustersListBySubscriptionOptionalParams,\n CloudHsmClustersListByResourceGroupOptionalParams,\n CloudHsmClustersDeleteOptionalParams,\n CloudHsmClustersUpdateOptionalParams,\n CloudHsmClustersCreateOrUpdateOptionalParams,\n CloudHsmClustersGetOptionalParams,\n} from \"../../api/cloudHsmClusters/options.js\";\nimport {\n restore,\n validateRestoreProperties,\n backup,\n validateBackupProperties,\n listBySubscription,\n listByResourceGroup,\n $delete,\n update,\n createOrUpdate,\n get,\n} from \"../../api/cloudHsmClusters/operations.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { PollerLike, OperationState } from \"@azure/core-lro\";\n\n/** Interface representing a CloudHsmClusters operations. */\nexport interface CloudHsmClustersOperations {\n /** Restores all key materials of a specified Cloud HSM Cluster */\n restore: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n restoreRequestProperties: RestoreRequestProperties,\n options?: CloudHsmClustersRestoreOptionalParams,\n ) => PollerLike<OperationState<RestoreResult>, RestoreResult>;\n /** Queued validating pre restore operation */\n validateRestoreProperties: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersValidateRestorePropertiesOptionalParams,\n ) => PollerLike<OperationState<RestoreResult>, RestoreResult>;\n /** Create a backup of the Cloud HSM Cluster in the specified subscription */\n backup: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersBackupOptionalParams,\n ) => PollerLike<OperationState<BackupResult>, BackupResult>;\n /** Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. */\n validateBackupProperties: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersValidateBackupPropertiesOptionalParams,\n ) => PollerLike<OperationState<BackupResult>, BackupResult>;\n /** The List operation gets information about the Cloud HSM Clusters associated with the subscription. */\n listBySubscription: (\n options?: CloudHsmClustersListBySubscriptionOptionalParams,\n ) => PagedAsyncIterableIterator<CloudHsmCluster>;\n /** The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. */\n listByResourceGroup: (\n resourceGroupName: string,\n options?: CloudHsmClustersListByResourceGroupOptionalParams,\n ) => PagedAsyncIterableIterator<CloudHsmCluster>;\n /** Deletes the specified Cloud HSM Cluster */\n /**\n * @fixme delete is a reserved word that cannot be used as an operation name.\n * Please add @clientName(\"clientName\") or @clientName(\"<JS-Specific-Name>\", \"javascript\")\n * to the operation to override the generated name.\n */\n delete: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersDeleteOptionalParams,\n ) => PollerLike<OperationState<void>, void>;\n /** Update a Cloud HSM Cluster in the specified subscription. */\n update: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n body: CloudHsmClusterPatchParameters,\n options?: CloudHsmClustersUpdateOptionalParams,\n ) => PollerLike<OperationState<CloudHsmCluster>, CloudHsmCluster>;\n /** Create or Update a Cloud HSM Cluster in the specified subscription. */\n createOrUpdate: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n body: CloudHsmCluster,\n options?: CloudHsmClustersCreateOrUpdateOptionalParams,\n ) => PollerLike<OperationState<CloudHsmCluster>, CloudHsmCluster>;\n /** Gets the specified Cloud HSM Cluster */\n get: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersGetOptionalParams,\n ) => Promise<CloudHsmCluster>;\n}\n\nfunction _getCloudHsmClusters(context: AzureDedicatedHSMResourceProviderContext) {\n return {\n restore: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n restoreRequestProperties: RestoreRequestProperties,\n options?: CloudHsmClustersRestoreOptionalParams,\n ) =>\n restore(context, resourceGroupName, cloudHsmClusterName, restoreRequestProperties, options),\n validateRestoreProperties: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersValidateRestorePropertiesOptionalParams,\n ) => validateRestoreProperties(context, resourceGroupName, cloudHsmClusterName, options),\n backup: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersBackupOptionalParams,\n ) => backup(context, resourceGroupName, cloudHsmClusterName, options),\n validateBackupProperties: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersValidateBackupPropertiesOptionalParams,\n ) => validateBackupProperties(context, resourceGroupName, cloudHsmClusterName, options),\n listBySubscription: (options?: CloudHsmClustersListBySubscriptionOptionalParams) =>\n listBySubscription(context, options),\n listByResourceGroup: (\n resourceGroupName: string,\n options?: CloudHsmClustersListByResourceGroupOptionalParams,\n ) => listByResourceGroup(context, resourceGroupName, options),\n delete: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersDeleteOptionalParams,\n ) => $delete(context, resourceGroupName, cloudHsmClusterName, options),\n update: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n body: CloudHsmClusterPatchParameters,\n options?: CloudHsmClustersUpdateOptionalParams,\n ) => update(context, resourceGroupName, cloudHsmClusterName, body, options),\n createOrUpdate: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n body: CloudHsmCluster,\n options?: CloudHsmClustersCreateOrUpdateOptionalParams,\n ) => createOrUpdate(context, resourceGroupName, cloudHsmClusterName, body, options),\n get: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: CloudHsmClustersGetOptionalParams,\n ) => get(context, resourceGroupName, cloudHsmClusterName, options),\n };\n}\n\nexport function _getCloudHsmClustersOperations(\n context: AzureDedicatedHSMResourceProviderContext,\n): CloudHsmClustersOperations {\n return {\n ..._getCloudHsmClusters(context),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/dedicatedHsm/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA+GlC,gEAMC;AApGD,wEAQ8C;AAsD9C,SAAS,gBAAgB,CAAC,OAAiD;IACzE,OAAO;QACL,wCAAwC,EAAE,CACxC,iBAAyB,EACzB,IAAY,EACZ,OAA4E,EAC5E,EAAE,CAAC,IAAA,wDAAwC,EAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,CAAC;QACxF,kBAAkB,EAAE,CAAC,OAAsD,EAAE,EAAE,CAC7E,IAAA,kCAAkB,EAAC,OAAO,EAAE,OAAO,CAAC;QACtC,mBAAmB,EAAE,CACnB,iBAAyB,EACzB,OAAuD,EACvD,EAAE,CAAC,IAAA,mCAAmB,EAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,CAAC;QAC7D,MAAM,EAAE,CAAC,iBAAyB,EAAE,IAAY,EAAE,OAA0C,EAAE,EAAE,CAC9F,IAAA,uBAAO,EAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,CAAC;QACpD,MAAM,EAAE,CACN,iBAAyB,EACzB,IAAY,EACZ,UAAuC,EACvC,OAA0C,EAC1C,EAAE,CAAC,IAAA,sBAAM,EAAC,OAAO,EAAE,iBA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C,IAAA,sBAAM,EAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;QAClE,cAAc,EAAE,CACd,iBAAyB,EACzB,IAAY,EACZ,UAAwB,EACxB,OAAkD,EAClD,EAAE,CAAC,IAAA,8BAAc,EAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC;QAC1E,GAAG,EAAE,CAAC,iBAAyB,EAAE,IAAY,EAAE,OAAuC,EAAE,EAAE,CACxF,IAAA,mBAAG,EAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,CAAC;KACjD,CAAC;AACJ,CAAC;AAED,SAAgB,0BAA0B,CACxC,OAAiD;IAEjD,OAAO;QACL,GAAG,gBAAgB,CAAC,OAAO,CAAC;KAC7B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AzureDedicatedHSMResourceProviderContext } from \"../../api/azureDedicatedHSMResourceProviderContext.js\";\nimport {\n DedicatedHsm,\n DedicatedHsmPatchParameters,\n OutboundEnvironmentEndpoint,\n} from \"../../models/models.js\";\nimport {\n DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams,\n DedicatedHsmListBySubscriptionOptionalParams,\n DedicatedHsmListByResourceGroupOptionalParams,\n DedicatedHsmDeleteOptionalParams,\n DedicatedHsmUpdateOptionalParams,\n DedicatedHsmCreateOrUpdateOptionalParams,\n DedicatedHsmGetOptionalParams,\n} from \"../../api/dedicatedHsm/options.js\";\nimport {\n listOutboundNetworkDependenciesEndpoints,\n listBySubscription,\n listByResourceGroup,\n $delete,\n update,\n createOrUpdate,\n get,\n} from \"../../api/dedicatedHsm/operations.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { PollerLike, OperationState } from \"@azure/core-lro\";\n\n/** Interface representing a DedicatedHsm operations. */\nexport interface DedicatedHsmOperations {\n /** Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. */\n listOutboundNetworkDependenciesEndpoints: (\n resourceGroupName: string,\n name: string,\n options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams,\n ) => PagedAsyncIterableIterator<OutboundEnvironmentEndpoint>;\n /** The List operation gets information about the dedicated HSMs associated with the subscription. */\n listBySubscription: (\n options?: DedicatedHsmListBySubscriptionOptionalParams,\n ) => PagedAsyncIterableIterator<DedicatedHsm>;\n /** The List operation gets information about the dedicated HSMs associated with the subscription and within the specified resource group. */\n listByResourceGroup: (\n resourceGroupName: string,\n options?: DedicatedHsmListByResourceGroupOptionalParams,\n ) => PagedAsyncIterableIterator<DedicatedHsm>;\n /** Deletes the specified Azure Dedicated HSM. */\n /**\n * @fixme delete is a reserved word that cannot be used as an operation name.\n * Please add @clientName(\"clientName\") or @clientName(\"<JS-Specific-Name>\", \"javascript\")\n * to the operation to override the generated name.\n */\n delete: (\n resourceGroupName: string,\n name: string,\n options?: DedicatedHsmDeleteOptionalParams,\n ) => PollerLike<OperationState<void>, void>;\n /** Update a dedicated HSM in the specified subscription. */\n update: (\n resourceGroupName: string,\n name: string,\n parameters: DedicatedHsmPatchParameters,\n options?: DedicatedHsmUpdateOptionalParams,\n ) => PollerLike<OperationState<DedicatedHsm>, DedicatedHsm>;\n /** Create or Update a dedicated HSM in the specified subscription. */\n createOrUpdate: (\n resourceGroupName: string,\n name: string,\n parameters: DedicatedHsm,\n options?: DedicatedHsmCreateOrUpdateOptionalParams,\n ) => PollerLike<OperationState<DedicatedHsm>, DedicatedHsm>;\n /** Gets the specified Azure dedicated HSM. */\n get: (\n resourceGroupName: string,\n name: string,\n options?: DedicatedHsmGetOptionalParams,\n ) => Promise<DedicatedHsm>;\n}\n\nfunction _getDedicatedHsm(context: AzureDedicatedHSMResourceProviderContext) {\n return {\n listOutboundNetworkDependenciesEndpoints: (\n resourceGroupName: string,\n name: string,\n options?: DedicatedHsmListOutboundNetworkDependenciesEndpointsOptionalParams,\n ) => listOutboundNetworkDependenciesEndpoints(context, resourceGroupName, name, options),\n listBySubscription: (options?: DedicatedHsmListBySubscriptionOptionalParams) =>\n listBySubscription(context, options),\n listByResourceGroup: (\n resourceGroupName: string,\n options?: DedicatedHsmListByResourceGroupOptionalParams,\n ) => listByResourceGroup(context, resourceGroupName, options),\n delete: (resourceGroupName: string, name: string, options?: DedicatedHsmDeleteOptionalParams) =>\n $delete(context, resourceGroupName, name, options),\n update: (\n resourceGroupName: string,\n name: string,\n parameters: DedicatedHsmPatchParameters,\n options?: DedicatedHsmUpdateOptionalParams,\n ) => update(context, resourceGroupName, name, parameters, options),\n createOrUpdate: (\n resourceGroupName: string,\n name: string,\n parameters: DedicatedHsm,\n options?: DedicatedHsmCreateOrUpdateOptionalParams,\n ) => createOrUpdate(context, resourceGroupName, name, parameters, options),\n get: (resourceGroupName: string, name: string, options?: DedicatedHsmGetOptionalParams) =>\n get(context, resourceGroupName, name, options),\n };\n}\n\nexport function _getDedicatedHsmOperations(\n context: AzureDedicatedHSMResourceProviderContext,\n): DedicatedHsmOperations {\n return {\n ..._getDedicatedHsm(context),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/operations/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoBlC,4DAMC;AArBD,sEAA0D;AAS1D,SAAS,cAAc,CAAC,OAAiD;IACvE,OAAO;QACL,IAAI,EAAE,CAAC,OAAsC,EAAE,EAAE,CAAC,IAAA,oBAAI,EAAC,OAAO,EAAE,OAAO,CAAC;KACzE,CAAC;AACJ,CAAC;AAED,SAAgB,wBAAwB,CACtC,OAAiD;IAEjD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/operations/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoBlC,4DAMC;AArBD,sEAA0D;AAS1D,SAAS,cAAc,CAAC,OAAiD;IACvE,OAAO;QACL,IAAI,EAAE,CAAC,OAAsC,EAAE,EAAE,CAAC,IAAA,oBAAI,EAAC,OAAO,EAAE,OAAO,CAAC;KACzE,CAAC;AACJ,CAAC;AAED,SAAgB,wBAAwB,CACtC,OAAiD;IAEjD,OAAO;QACL,GAAG,cAAc,CAAC,OAAO,CAAC;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AzureDedicatedHSMResourceProviderContext } from \"../../api/azureDedicatedHSMResourceProviderContext.js\";\nimport { Operation } from \"../../models/models.js\";\nimport { OperationsListOptionalParams } from \"../../api/operations/options.js\";\nimport { list } from \"../../api/operations/operations.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a Operations operations. */\nexport interface OperationsOperations {\n /** List the operations for the provider */\n list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator<Operation>;\n}\n\nfunction _getOperations(context: AzureDedicatedHSMResourceProviderContext) {\n return {\n list: (options?: OperationsListOptionalParams) => list(context, options),\n };\n}\n\nexport function _getOperationsOperations(\n context: AzureDedicatedHSMResourceProviderContext,\n): OperationsOperations {\n return {\n ..._getOperations(context),\n };\n}\n"]}
|
|
@@ -10,6 +10,8 @@ function _getPrivateEndpointConnections(context) {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
function _getPrivateEndpointConnectionsOperations(context) {
|
|
13
|
-
return
|
|
13
|
+
return {
|
|
14
|
+
..._getPrivateEndpointConnections(context),
|
|
15
|
+
};
|
|
14
16
|
}
|
|
15
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/privateEndpointConnections/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA4BlC,4FAMC;AA7BD,sFAA2F;AAa3F,SAAS,8BAA8B,CAAC,OAAiD;IACvF,OAAO;QACL,qBAAqB,EAAE,CACrB,iBAAyB,EACzB,mBAA2B,EAC3B,OAAuE,EACvE,EAAE,CAAC,IAAA,qCAAqB,EAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,OAAO,CAAC;KACrF,CAAC;AACJ,CAAC;AAED,SAAgB,wCAAwC,CACtD,OAAiD;IAEjD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/privateEndpointConnections/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA4BlC,4FAMC;AA7BD,sFAA2F;AAa3F,SAAS,8BAA8B,CAAC,OAAiD;IACvF,OAAO;QACL,qBAAqB,EAAE,CACrB,iBAAyB,EACzB,mBAA2B,EAC3B,OAAuE,EACvE,EAAE,CAAC,IAAA,qCAAqB,EAAC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,OAAO,CAAC;KACrF,CAAC;AACJ,CAAC;AAED,SAAgB,wCAAwC,CACtD,OAAiD;IAEjD,OAAO;QACL,GAAG,8BAA8B,CAAC,OAAO,CAAC;KAC3C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AzureDedicatedHSMResourceProviderContext } from \"../../api/azureDedicatedHSMResourceProviderContext.js\";\nimport { PrivateEndpointConnection } from \"../../models/models.js\";\nimport { PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams } from \"../../api/privateEndpointConnections/options.js\";\nimport { listByCloudHsmCluster } from \"../../api/privateEndpointConnections/operations.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a PrivateEndpointConnections operations. */\nexport interface PrivateEndpointConnectionsOperations {\n /** The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster */\n listByCloudHsmCluster: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams,\n ) => PagedAsyncIterableIterator<PrivateEndpointConnection>;\n}\n\nfunction _getPrivateEndpointConnections(context: AzureDedicatedHSMResourceProviderContext) {\n return {\n listByCloudHsmCluster: (\n resourceGroupName: string,\n cloudHsmClusterName: string,\n options?: PrivateEndpointConnectionsListByCloudHsmClusterOptionalParams,\n ) => listByCloudHsmCluster(context, resourceGroupName, cloudHsmClusterName, options),\n };\n}\n\nexport function _getPrivateEndpointConnectionsOperations(\n context: AzureDedicatedHSMResourceProviderContext,\n): PrivateEndpointConnectionsOperations {\n return {\n ..._getPrivateEndpointConnections(context),\n };\n}\n"]}
|
|
@@ -16,21 +16,20 @@ const core_lro_1 = require("@azure/core-lro");
|
|
|
16
16
|
* needs to be constructed after the original one is not in scope.
|
|
17
17
|
*/
|
|
18
18
|
function restorePoller(client, serializedState, sourceOperation, options) {
|
|
19
|
-
var _a, _b, _c;
|
|
20
19
|
const pollerConfig = (0, core_lro_1.deserializeState)(serializedState).config;
|
|
21
20
|
const { initialRequestUrl, requestMethod, metadata } = pollerConfig;
|
|
22
21
|
if (!initialRequestUrl || !requestMethod) {
|
|
23
|
-
throw new Error(`Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation
|
|
22
|
+
throw new Error(`Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`);
|
|
24
23
|
}
|
|
25
|
-
const resourceLocationConfig = metadata
|
|
26
|
-
const { deserializer, expectedStatuses = [] } =
|
|
27
|
-
const deserializeHelper =
|
|
24
|
+
const resourceLocationConfig = metadata?.["resourceLocationConfig"];
|
|
25
|
+
const { deserializer, expectedStatuses = [] } = getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};
|
|
26
|
+
const deserializeHelper = options?.processResponseBody ?? deserializer;
|
|
28
27
|
if (!deserializeHelper) {
|
|
29
|
-
throw new Error(`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation
|
|
28
|
+
throw new Error(`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`);
|
|
30
29
|
}
|
|
31
|
-
return (0, pollingHelpers_js_1.getLongRunningPoller)(
|
|
32
|
-
updateIntervalInMs: options
|
|
33
|
-
abortSignal: options
|
|
30
|
+
return (0, pollingHelpers_js_1.getLongRunningPoller)(client["_client"] ?? client, deserializeHelper, expectedStatuses, {
|
|
31
|
+
updateIntervalInMs: options?.updateIntervalInMs,
|
|
32
|
+
abortSignal: options?.abortSignal,
|
|
34
33
|
resourceLocationConfig,
|
|
35
34
|
restoreFrom: serializedState,
|
|
36
35
|
initialRequestUrl,
|
|
@@ -79,7 +78,6 @@ const deserializeMap = {
|
|
|
79
78
|
},
|
|
80
79
|
};
|
|
81
80
|
function getDeserializationHelper(urlStr, method) {
|
|
82
|
-
var _a, _b, _c, _d;
|
|
83
81
|
const path = new URL(urlStr).pathname;
|
|
84
82
|
const pathParts = path.split("/");
|
|
85
83
|
// Traverse list to match the longest candidate
|
|
@@ -99,13 +97,13 @@ function getDeserializationHelper(urlStr, method) {
|
|
|
99
97
|
// track if we have found a match to return the values found.
|
|
100
98
|
let found = true;
|
|
101
99
|
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
102
|
-
if (
|
|
103
|
-
const start = candidateParts[i].indexOf("}") + 1, end =
|
|
100
|
+
if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
|
|
101
|
+
const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
|
|
104
102
|
// If the current part of the candidate is a "template" part
|
|
105
103
|
// Try to use the suffix of pattern to match the path
|
|
106
104
|
// {guid} ==> $
|
|
107
105
|
// {guid}:export ==> :export$
|
|
108
|
-
const isMatched = new RegExp(`${
|
|
106
|
+
const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
|
|
109
107
|
if (!isMatched) {
|
|
110
108
|
found = false;
|
|
111
109
|
break;
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B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AzureDedicatedHSMResourceProvider } from \"./azureDedicatedHSMResourceProvider.js\";\nimport {\n _$deleteDeserialize,\n _updateDeserialize,\n _createOrUpdateDeserialize,\n} from \"./api/dedicatedHsm/operations.js\";\nimport { _$deleteDeserialize as _$deleteDeserializeCloudHsmClusterPrivateEndpointConnections } from \"./api/cloudHsmClusterPrivateEndpointConnections/operations.js\";\nimport { _getDeserialize } from \"./api/cloudHsmClusterRestoreStatus/operations.js\";\nimport { _getDeserialize as _getDeserializeCloudHsmClusterBackupStatus } from \"./api/cloudHsmClusterBackupStatus/operations.js\";\nimport {\n _restoreDeserialize,\n _validateRestorePropertiesDeserialize,\n _backupDeserialize,\n _validateBackupPropertiesDeserialize,\n _$deleteDeserialize as _$deleteDeserializeCloudHsmClusters,\n _updateDeserialize as _updateDeserializeCloudHsmClusters,\n _createOrUpdateDeserialize as _createOrUpdateDeserializeCloudHsmClusters,\n} from \"./api/cloudHsmClusters/operations.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n PollerLike,\n OperationState,\n deserializeState,\n ResourceLocationConfig,\n} from \"@azure/core-lro\";\n\nexport interface RestorePollerOptions<\n TResult,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n> extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /** Deserialization function for raw response body */\n processResponseBody?: (result: TResponse) => Promise<TResult>;\n}\n\n/**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n */\nexport function restorePoller<TResponse extends PathUncheckedResponse, TResult>(\n client: AzureDedicatedHSMResourceProvider,\n serializedState: string,\n sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>,\n options?: RestorePollerOptions<TResult>,\n): PollerLike<OperationState<TResult>, TResult> {\n const pollerConfig = deserializeState(serializedState).config;\n const { initialRequestUrl, requestMethod, metadata } = pollerConfig;\n if (!initialRequestUrl || !requestMethod) {\n throw new Error(\n `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`,\n );\n }\n const resourceLocationConfig = metadata?.[\"resourceLocationConfig\"] as\n | ResourceLocationConfig\n | undefined;\n const { deserializer, expectedStatuses = [] } =\n getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};\n const deserializeHelper = options?.processResponseBody ?? deserializer;\n if (!deserializeHelper) {\n throw new Error(\n `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,\n );\n }\n return getLongRunningPoller(\n (client as any)[\"_client\"] ?? client,\n deserializeHelper as (result: TResponse) => Promise<TResult>,\n expectedStatuses,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n resourceLocationConfig,\n restoreFrom: serializedState,\n initialRequestUrl,\n },\n );\n}\n\ninterface DeserializationHelper {\n deserializer: Function;\n expectedStatuses: string[];\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}\":\n {\n deserializer: _$deleteDeserialize,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}\":\n { deserializer: _updateDeserialize, expectedStatuses: [\"200\", \"202\"] },\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}\":\n {\n deserializer: _createOrUpdateDeserialize,\n expectedStatuses: [\"200\", \"201\"],\n },\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}\":\n {\n deserializer: _$deleteDeserializeCloudHsmClusterPrivateEndpointConnections,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId}\":\n { deserializer: _getDeserialize, expectedStatuses: [\"200\", \"202\"] },\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId}\":\n {\n deserializer: _getDeserializeCloudHsmClusterBackupStatus,\n expectedStatuses: [\"200\", \"202\"],\n },\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore\":\n { deserializer: _restoreDeserialize, expectedStatuses: [\"202\", \"200\"] },\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties\":\n {\n deserializer: _validateRestorePropertiesDeserialize,\n expectedStatuses: [\"202\", \"200\"],\n },\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup\":\n { deserializer: _backupDeserialize, expectedStatuses: [\"202\", \"200\"] },\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties\":\n {\n deserializer: _validateBackupPropertiesDeserialize,\n expectedStatuses: [\"202\", \"200\"],\n },\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}\":\n {\n deserializer: _$deleteDeserializeCloudHsmClusters,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}\":\n {\n deserializer: _updateDeserializeCloudHsmClusters,\n expectedStatuses: [\"200\", \"202\"],\n },\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}\":\n {\n deserializer: _createOrUpdateDeserializeCloudHsmClusters,\n expectedStatuses: [\"200\", \"201\"],\n },\n};\n\nfunction getDeserializationHelper(\n urlStr: string,\n method: string,\n): DeserializationHelper | undefined {\n const path = new URL(urlStr).pathname;\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: DeserializationHelper | undefined;\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(deserializeMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"restorePollerHelpers.js","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAiDlC,sCAoCC;AAlFD,oEAI0C;AAC1C,iGAAoK;AACpK,oFAAmF;AACnF,mFAAgI;AAChI,wEAQ8C;AAC9C,0EAA0E;AAG1E,8CAKyB;AAgBzB;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,MAAyC,EACzC,eAAuB,EACvB,eAAiF,EACjF,OAAuC;IAEvC,MAAM,YAAY,GAAG,IAAA,2BAAgB,EAAC,eAAe,CAAC,CAAC,MAAM,CAAC;IAC9D,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC;IACpE,IAAI,CAAC,iBAAiB,IAAI,CAAC,aAAa,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,6BAA6B,eAAe,wBAAwB,eAAe,EAAE,IAAI,EAAE,CAC5F,CAAC;IACJ,CAAC;IACD,MAAM,sBAAsB,GAAG,QAAQ,EAAE,CAAC,wBAAwB,CAErD,CAAC;IACd,MA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gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AzureDedicatedHSMResourceProvider } from \"./azureDedicatedHSMResourceProvider.js\";\nimport {\n _$deleteDeserialize,\n _updateDeserialize,\n _createOrUpdateDeserialize,\n} from \"./api/dedicatedHsm/operations.js\";\nimport { _$deleteDeserialize as _$deleteDeserializeCloudHsmClusterPrivateEndpointConnections } from \"./api/cloudHsmClusterPrivateEndpointConnections/operations.js\";\nimport { _getDeserialize } from \"./api/cloudHsmClusterRestoreStatus/operations.js\";\nimport { _getDeserialize as _getDeserializeCloudHsmClusterBackupStatus } from \"./api/cloudHsmClusterBackupStatus/operations.js\";\nimport {\n _restoreDeserialize,\n _validateRestorePropertiesDeserialize,\n _backupDeserialize,\n _validateBackupPropertiesDeserialize,\n _$deleteDeserialize as _$deleteDeserializeCloudHsmClusters,\n _updateDeserialize as _updateDeserializeCloudHsmClusters,\n _createOrUpdateDeserialize as _createOrUpdateDeserializeCloudHsmClusters,\n} from \"./api/cloudHsmClusters/operations.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n PollerLike,\n OperationState,\n deserializeState,\n ResourceLocationConfig,\n} from \"@azure/core-lro\";\n\nexport interface RestorePollerOptions<\n TResult,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n> extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /** Deserialization function for raw response body */\n processResponseBody?: (result: TResponse) => Promise<TResult>;\n}\n\n/**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n */\nexport function restorePoller<TResponse extends PathUncheckedResponse, TResult>(\n client: AzureDedicatedHSMResourceProvider,\n serializedState: string,\n sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>,\n options?: RestorePollerOptions<TResult>,\n): PollerLike<OperationState<TResult>, TResult> {\n const pollerConfig = deserializeState(serializedState).config;\n const { initialRequestUrl, requestMethod, metadata } = pollerConfig;\n if (!initialRequestUrl || !requestMethod) {\n throw new Error(\n `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`,\n );\n }\n const resourceLocationConfig = metadata?.[\"resourceLocationConfig\"] as\n | ResourceLocationConfig\n | undefined;\n const { deserializer, expectedStatuses = [] } =\n getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};\n const deserializeHelper = options?.processResponseBody ?? deserializer;\n if (!deserializeHelper) {\n throw new Error(\n `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,\n );\n }\n return getLongRunningPoller(\n (client as any)[\"_client\"] ?? client,\n deserializeHelper as (result: TResponse) => Promise<TResult>,\n expectedStatuses,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n resourceLocationConfig,\n restoreFrom: serializedState,\n initialRequestUrl,\n },\n );\n}\n\ninterface DeserializationHelper {\n deserializer: Function;\n expectedStatuses: string[];\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}\":\n {\n deserializer: _$deleteDeserialize,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}\":\n { deserializer: _updateDeserialize, expectedStatuses: [\"200\", \"202\"] },\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}\":\n {\n deserializer: _createOrUpdateDeserialize,\n expectedStatuses: [\"200\", \"201\"],\n },\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}\":\n {\n deserializer: _$deleteDeserializeCloudHsmClusterPrivateEndpointConnections,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId}\":\n { deserializer: _getDeserialize, expectedStatuses: [\"200\", \"202\"] },\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId}\":\n {\n deserializer: _getDeserializeCloudHsmClusterBackupStatus,\n expectedStatuses: [\"200\", \"202\"],\n },\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore\":\n { deserializer: _restoreDeserialize, expectedStatuses: [\"202\", \"200\"] },\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties\":\n {\n deserializer: _validateRestorePropertiesDeserialize,\n expectedStatuses: [\"202\", \"200\"],\n },\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup\":\n { deserializer: _backupDeserialize, expectedStatuses: [\"202\", \"200\"] },\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties\":\n {\n deserializer: _validateBackupPropertiesDeserialize,\n expectedStatuses: [\"202\", \"200\"],\n },\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}\":\n {\n deserializer: _$deleteDeserializeCloudHsmClusters,\n expectedStatuses: [\"202\", \"204\", \"200\"],\n },\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}\":\n {\n deserializer: _updateDeserializeCloudHsmClusters,\n expectedStatuses: [\"200\", \"202\"],\n },\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}\":\n {\n deserializer: _createOrUpdateDeserializeCloudHsmClusters,\n expectedStatuses: [\"200\", \"201\"],\n },\n};\n\nfunction getDeserializationHelper(\n urlStr: string,\n method: string,\n): DeserializationHelper | undefined {\n const path = new URL(urlStr).pathname;\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: DeserializationHelper | undefined;\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(deserializeMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.buildPagedAsyncIterator = buildPagedAsyncIterator;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
6
|
const core_client_1 = require("@azure-rest/core-client");
|
|
8
7
|
const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
|
|
9
8
|
/**
|
|
10
9
|
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
11
10
|
*/
|
|
12
11
|
function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody, expectedStatuses, options = {}) {
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const nextLinkName = (_b = options.nextLinkName) !== null && _b !== void 0 ? _b : "nextLink";
|
|
12
|
+
const itemName = options.itemName ?? "value";
|
|
13
|
+
const nextLinkName = options.nextLinkName ?? "nextLink";
|
|
16
14
|
const pagedResult = {
|
|
17
15
|
getPage: async (pageLink) => {
|
|
18
16
|
const result = pageLink === undefined
|
|
@@ -28,7 +26,7 @@ function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody
|
|
|
28
26
|
};
|
|
29
27
|
},
|
|
30
28
|
byPage: (settings) => {
|
|
31
|
-
const { continuationToken } = settings
|
|
29
|
+
const { continuationToken } = settings ?? {};
|
|
32
30
|
return getPageAsyncIterator(pagedResult, {
|
|
33
31
|
pageLink: continuationToken,
|
|
34
32
|
});
|
|
@@ -44,7 +42,6 @@ function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody
|
|
|
44
42
|
* @returns a paged async iterator that iterates over results.
|
|
45
43
|
*/
|
|
46
44
|
function getPagedAsyncIterator(pagedResult) {
|
|
47
|
-
var _a;
|
|
48
45
|
const iter = getItemAsyncIterator(pagedResult);
|
|
49
46
|
return {
|
|
50
47
|
next() {
|
|
@@ -53,55 +50,39 @@ function getPagedAsyncIterator(pagedResult) {
|
|
|
53
50
|
[Symbol.asyncIterator]() {
|
|
54
51
|
return this;
|
|
55
52
|
},
|
|
56
|
-
byPage:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
byPage: pagedResult?.byPage ??
|
|
54
|
+
((settings) => {
|
|
55
|
+
const { continuationToken } = settings ?? {};
|
|
56
|
+
return getPageAsyncIterator(pagedResult, {
|
|
57
|
+
pageLink: continuationToken,
|
|
58
|
+
});
|
|
59
|
+
}),
|
|
62
60
|
};
|
|
63
61
|
}
|
|
64
|
-
function getItemAsyncIterator(pagedResult) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
for (var _d = true, pages_1 = tslib_1.__asyncValues(pages), pages_1_1; pages_1_1 = yield tslib_1.__await(pages_1.next()), _a = pages_1_1.done, !_a; _d = true) {
|
|
70
|
-
_c = pages_1_1.value;
|
|
71
|
-
_d = false;
|
|
72
|
-
const page = _c;
|
|
73
|
-
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
77
|
-
finally {
|
|
78
|
-
try {
|
|
79
|
-
if (!_d && !_a && (_b = pages_1.return)) yield tslib_1.__await(_b.call(pages_1));
|
|
80
|
-
}
|
|
81
|
-
finally { if (e_1) throw e_1.error; }
|
|
82
|
-
}
|
|
83
|
-
});
|
|
62
|
+
async function* getItemAsyncIterator(pagedResult) {
|
|
63
|
+
const pages = getPageAsyncIterator(pagedResult);
|
|
64
|
+
for await (const page of pages) {
|
|
65
|
+
yield* page;
|
|
66
|
+
}
|
|
84
67
|
}
|
|
85
|
-
function getPageAsyncIterator(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
68
|
+
async function* getPageAsyncIterator(pagedResult, options = {}) {
|
|
69
|
+
const { pageLink } = options;
|
|
70
|
+
let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);
|
|
71
|
+
if (!response) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
let result = response.page;
|
|
75
|
+
result.continuationToken = response.nextPageLink;
|
|
76
|
+
yield result;
|
|
77
|
+
while (response.nextPageLink) {
|
|
78
|
+
response = await pagedResult.getPage(response.nextPageLink);
|
|
89
79
|
if (!response) {
|
|
90
|
-
return
|
|
80
|
+
return;
|
|
91
81
|
}
|
|
92
|
-
|
|
82
|
+
result = response.page;
|
|
93
83
|
result.continuationToken = response.nextPageLink;
|
|
94
|
-
yield
|
|
95
|
-
|
|
96
|
-
response = yield tslib_1.__await(pagedResult.getPage(response.nextPageLink));
|
|
97
|
-
if (!response) {
|
|
98
|
-
return yield tslib_1.__await(void 0);
|
|
99
|
-
}
|
|
100
|
-
result = response.page;
|
|
101
|
-
result.continuationToken = response.nextPageLink;
|
|
102
|
-
yield yield tslib_1.__await(result);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
84
|
+
yield result;
|
|
85
|
+
}
|
|
105
86
|
}
|
|
106
87
|
/**
|
|
107
88
|
* Gets for the value of nextLink in the body
|
|
@@ -127,7 +108,7 @@ function getElements(body, itemName) {
|
|
|
127
108
|
if (!Array.isArray(value)) {
|
|
128
109
|
throw new core_rest_pipeline_1.RestError(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
129
110
|
}
|
|
130
|
-
return value
|
|
111
|
+
return value ?? [];
|
|
131
112
|
}
|
|
132
113
|
/**
|
|
133
114
|
* Checks if a request failed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqFlC,0DAqCC;;AAxHD,yDAAyF;AACzF,kEAAsD;AA+EtD;;GAEG;AACH,SAAgB,uBAAuB,CAMrC,MAAc,EACd,kBAAgD,EAChD,mBAAgE,EAChE,gBAA0B,EAC1B,UAA0C,EAAE;;IAE5C,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC;IAC7C,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,YAAY,mCAAI,UAAU,CAAC;IACxD,MAAM,WAAW,GAAgD;QAC/D,OAAO,EAAE,KAAK,EAAE,QAAiB,EAAE,EAAE;YACnC,MAAM,MAAM,GACV,QAAQ,KAAK,SAAS;gBACpB,CAAC,CAAC,MAAM,kBAAkB,EAAE;gBAC5B,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;YACjD,kBAAkB,CAAC,MAAM,EAAE,g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AgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACzF,MAAM,IAAI,8BAAS,CACjB,iBAAiB,YAAY,oDAAoD,OAAO,QAAQ,EAAE,CACnG,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,8BAAS,CACjB,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAE,gBAA0B;IACrF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,IAAA,6BAAe,EACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options for the byPage method\n */\nexport interface PageSettings {\n /**\n * A reference to a specific page to start iterating from.\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that describes a page of results.\n */\nexport type ContinuablePage<TElement, TPage = TElement[]> = TPage & {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n};\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * Link to the first page of results.\n */\n firstPageLink?: string;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => TElement[];\n}\n\n/**\n * Options for the paging helper\n */\nexport interface BuildPagedAsyncIteratorOptions {\n itemName?: string;\n nextLinkName?: string;\n}\n\n/**\n * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator\n */\nexport function buildPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n>(\n client: Client,\n getInitialResponse: () => PromiseLike<TResponse>,\n processResponseBody: (result: TResponse) => PromiseLike<unknown>,\n expectedStatuses: string[],\n options: BuildPagedAsyncIteratorOptions = {},\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const itemName = options.itemName ?? \"value\";\n const nextLinkName = options.nextLinkName ?? \"nextLink\";\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n const result =\n pageLink === undefined\n ? await getInitialResponse()\n : await client.pathUnchecked(pageLink).get();\n checkPagingRequest(result, expectedStatuses);\n const results = await processResponseBody(result as TResponse);\n const nextLink = getNextLink(results, nextLinkName);\n const values = getElements<TElement>(results, itemName) as TPage;\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n byPage: (settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n },\n };\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\n\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n ((settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n }),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n for await (const page of pages) {\n yield* page as unknown as TElement[];\n }\n}\n\nasync function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n options: {\n pageLink?: string;\n } = {},\n): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n let result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n }\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\" && nextLink !== null) {\n throw new RestError(\n `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,\n );\n }\n\n if (nextLink === null) {\n return undefined;\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n if (!Array.isArray(value)) {\n throw new RestError(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqFlC,0DAqCC;AAxHD,yDAAyF;AACzF,kEAAsD;AA+EtD;;GAEG;AACH,SAAgB,uBAAuB,CAMrC,MAAc,EACd,kBAAgD,EAChD,mBAAgE,EAChE,gBAA0B,EAC1B,UAA0C,EAAE;IAE5C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CA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YAAqB;IACvD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,QAAQ,GAAI,IAAgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACzF,MAAM,IAAI,8BAAS,CACjB,iBAAiB,YAAY,oDAAoD,OAAO,QAAQ,EAAE,CACnG,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,8BAAS,CACjB,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,IAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAE,gBAA0B;IACrF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,IAAA,6BAAe,EACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options for the byPage method\n */\nexport interface PageSettings {\n /**\n * A reference to a specific page to start iterating from.\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that describes a page of results.\n */\nexport type ContinuablePage<TElement, TPage = TElement[]> = TPage & {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n};\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * Link to the first page of results.\n */\n firstPageLink?: string;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => TElement[];\n}\n\n/**\n * Options for the paging helper\n */\nexport interface BuildPagedAsyncIteratorOptions {\n itemName?: string;\n nextLinkName?: string;\n}\n\n/**\n * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator\n */\nexport function buildPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n>(\n client: Client,\n getInitialResponse: () => PromiseLike<TResponse>,\n processResponseBody: (result: TResponse) => PromiseLike<unknown>,\n expectedStatuses: string[],\n options: BuildPagedAsyncIteratorOptions = {},\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const itemName = options.itemName ?? \"value\";\n const nextLinkName = options.nextLinkName ?? \"nextLink\";\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n const result =\n pageLink === undefined\n ? await getInitialResponse()\n : await client.pathUnchecked(pageLink).get();\n checkPagingRequest(result, expectedStatuses);\n const results = await processResponseBody(result as TResponse);\n const nextLink = getNextLink(results, nextLinkName);\n const values = getElements<TElement>(results, itemName) as TPage;\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n byPage: (settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n },\n };\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\n\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n ((settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n }),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n for await (const page of pages) {\n yield* page as unknown as TElement[];\n }\n}\n\nasync function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n options: {\n pageLink?: string;\n } = {},\n): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n let result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n }\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\" && nextLink !== null) {\n throw new RestError(\n `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,\n );\n }\n\n if (nextLink === null) {\n return undefined;\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n if (!Array.isArray(value)) {\n throw new RestError(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
|
|
@@ -21,23 +21,22 @@ function getLongRunningPoller(client, processResponseBody, expectedStatuses, opt
|
|
|
21
21
|
return getLroResponse(initialResponse, expectedStatuses);
|
|
22
22
|
},
|
|
23
23
|
sendPollRequest: async (path, pollOptions) => {
|
|
24
|
-
var _a, _b, _c, _d, _e, _f;
|
|
25
24
|
// The poll request would both listen to the user provided abort signal and the poller's own abort signal
|
|
26
25
|
function abortListener() {
|
|
27
26
|
pollAbortController.abort();
|
|
28
27
|
}
|
|
29
28
|
const abortSignal = pollAbortController.signal;
|
|
30
|
-
if (
|
|
29
|
+
if (options.abortSignal?.aborted) {
|
|
31
30
|
pollAbortController.abort();
|
|
32
31
|
}
|
|
33
|
-
else if (
|
|
32
|
+
else if (pollOptions?.abortSignal?.aborted) {
|
|
34
33
|
pollAbortController.abort();
|
|
35
34
|
}
|
|
36
35
|
else if (!abortSignal.aborted) {
|
|
37
|
-
|
|
36
|
+
options.abortSignal?.addEventListener("abort", abortListener, {
|
|
38
37
|
once: true,
|
|
39
38
|
});
|
|
40
|
-
|
|
39
|
+
pollOptions?.abortSignal?.addEventListener("abort", abortListener, {
|
|
41
40
|
once: true,
|
|
42
41
|
});
|
|
43
42
|
}
|
|
@@ -46,16 +45,16 @@ function getLongRunningPoller(client, processResponseBody, expectedStatuses, opt
|
|
|
46
45
|
response = await client.pathUnchecked(path).get({ abortSignal });
|
|
47
46
|
}
|
|
48
47
|
finally {
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
options.abortSignal?.removeEventListener("abort", abortListener);
|
|
49
|
+
pollOptions?.abortSignal?.removeEventListener("abort", abortListener);
|
|
51
50
|
}
|
|
52
51
|
return getLroResponse(response, expectedStatuses);
|
|
53
52
|
},
|
|
54
53
|
};
|
|
55
54
|
return (0, core_lro_1.createHttpPoller)(poller, {
|
|
56
|
-
intervalInMs: options
|
|
57
|
-
resourceLocationConfig: options
|
|
58
|
-
restoreFrom: options
|
|
55
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
56
|
+
resourceLocationConfig: options?.resourceLocationConfig,
|
|
57
|
+
restoreFrom: options?.restoreFrom,
|
|
59
58
|
processResult: (result) => {
|
|
60
59
|
return processResponseBody(result);
|
|
61
60
|
},
|
|
@@ -73,7 +72,11 @@ function getLroResponse(response, expectedStatuses) {
|
|
|
73
72
|
}
|
|
74
73
|
return {
|
|
75
74
|
flatResponse: response,
|
|
76
|
-
rawResponse:
|
|
75
|
+
rawResponse: {
|
|
76
|
+
...response,
|
|
77
|
+
statusCode: Number.parseInt(response.status),
|
|
78
|
+
body: response.body,
|
|
79
|
+
},
|
|
77
80
|
};
|
|
78
81
|
}
|
|
79
82
|
//# sourceMappingURL=pollingHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pollingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pollingHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuClC,oDA8DC;AAnGD,8CAOyB;AAEzB,yDAAyF;AA4BzF,SAAgB,oBAAoB,CAClC,MAAc,EACd,mBAA4D,EAC5D,gBAA0B,EAC1B,OAA+C;IAE/C,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC;IACpD,IAAI,CAAC,WAAW,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IACD,IAAI,eAAe,GAA0B,SAAS,CAAC;IACvD,MAAM,mBAAmB,GAAG,IAAI,eAAe,EAAE,CAAC;IAClD,MAAM,MAAM,GAAgC;QAC1C,kBAAkB,EAAE,KAAK,IAAI,EAAE;YAC7B,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACnF,CAAC;YACD,eAAe,GAAG,MAAM,kBAAkB,EAAE,CAAC;YAC7C,OAAO,cAAc,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;QAC3D,CAAC;QACD,eAAe,EAAE,KAAK,EACpB,IAAY,EACZ,WAEC,EACD,EAAE
|
|
1
|
+
{"version":3,"file":"pollingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pollingHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuClC,oDA8DC;AAnGD,8CAOyB;AAEzB,yDAAyF;AA4BzF,SAA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\n// Licensed under the MIT License.\n\nimport {\n PollerLike,\n OperationState,\n ResourceLocationConfig,\n RunningOperation,\n createHttpPoller,\n OperationResponse,\n} from \"@azure/core-lro\";\n\nimport { Client, PathUncheckedResponse, createRestError } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\n\nexport interface GetLongRunningPollerOptions<TResponse> {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * The potential location of the result of the LRO if specified by the LRO extension in the swagger.\n */\n resourceLocationConfig?: ResourceLocationConfig;\n /**\n * The original url of the LRO\n * Should not be null when restoreFrom is set\n */\n initialRequestUrl?: string;\n /**\n * A serialized poller which can be used to resume an existing paused Long-Running-Operation.\n */\n restoreFrom?: string;\n /**\n * The function to get the initial response\n */\n getInitialResponse?: () => PromiseLike<TResponse>;\n}\nexport function getLongRunningPoller<TResponse extends PathUncheckedResponse, TResult = void>(\n client: Client,\n processResponseBody: (result: TResponse) => Promise<TResult>,\n expectedStatuses: string[],\n options: GetLongRunningPollerOptions<TResponse>,\n): PollerLike<OperationState<TResult>, TResult> {\n const { restoreFrom, getInitialResponse } = options;\n if (!restoreFrom && !getInitialResponse) {\n throw new Error(\"Either restoreFrom or getInitialResponse must be specified\");\n }\n let initialResponse: TResponse | undefined = undefined;\n const pollAbortController = new AbortController();\n const poller: RunningOperation<TResponse> = {\n sendInitialRequest: async () => {\n if (!getInitialResponse) {\n throw new Error(\"getInitialResponse is required when initializing a new poller\");\n }\n initialResponse = await getInitialResponse();\n return getLroResponse(initialResponse, expectedStatuses);\n },\n sendPollRequest: async (\n path: string,\n pollOptions?: {\n abortSignal?: AbortSignalLike;\n },\n ) => {\n // The poll request would both listen to the user provided abort signal and the poller's own abort signal\n function abortListener(): void {\n pollAbortController.abort();\n }\n const abortSignal = pollAbortController.signal;\n if (options.abortSignal?.aborted) {\n pollAbortController.abort();\n } else if (pollOptions?.abortSignal?.aborted) {\n pollAbortController.abort();\n } else if (!abortSignal.aborted) {\n options.abortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n pollOptions?.abortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n }\n let response;\n try {\n response = await client.pathUnchecked(path).get({ abortSignal });\n } finally {\n options.abortSignal?.removeEventListener(\"abort\", abortListener);\n pollOptions?.abortSignal?.removeEventListener(\"abort\", abortListener);\n }\n\n return getLroResponse(response as TResponse, expectedStatuses);\n },\n };\n return createHttpPoller(poller, {\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: options?.resourceLocationConfig,\n restoreFrom: options?.restoreFrom,\n processResult: (result: unknown) => {\n return processResponseBody(result as TResponse);\n },\n });\n}\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @param deserializeFn - deserialize function to convert Rest response to modular output\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResponse extends PathUncheckedResponse>(\n response: TResponse,\n expectedStatuses: string[],\n): OperationResponse<TResponse> {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(response);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n"]}
|
|
@@ -7,7 +7,7 @@ exports.expandUrlTemplate = expandUrlTemplate;
|
|
|
7
7
|
// helpers
|
|
8
8
|
// ---------------------
|
|
9
9
|
function encodeComponent(val, reserved, op) {
|
|
10
|
-
return (reserved
|
|
10
|
+
return (reserved ?? op === "+") || op === "#"
|
|
11
11
|
? encodeReservedComponent(val)
|
|
12
12
|
: encodeRFC3986URIComponent(val);
|
|
13
13
|
}
|
|
@@ -160,7 +160,7 @@ function expandUrlTemplate(template, context, option) {
|
|
|
160
160
|
varValue: context[varMatch[1]],
|
|
161
161
|
varName: varMatch[1],
|
|
162
162
|
modifier: varMatch[2] || varMatch[3],
|
|
163
|
-
reserved: option
|
|
163
|
+
reserved: option?.allowReserved,
|
|
164
164
|
});
|
|
165
165
|
if (varValue) {
|
|
166
166
|
result.push(varValue);
|