@azure/arm-managedops 1.0.0-alpha.20260205.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/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/browser/api/index.d.ts +2 -0
- package/dist/browser/api/index.js +4 -0
- package/dist/browser/api/index.js.map +1 -0
- package/dist/browser/api/managedOps/index.d.ts +3 -0
- package/dist/browser/api/managedOps/index.js +4 -0
- package/dist/browser/api/managedOps/index.js.map +1 -0
- package/dist/browser/api/managedOps/operations.d.ts +32 -0
- package/dist/browser/api/managedOps/operations.js +159 -0
- package/dist/browser/api/managedOps/operations.js.map +1 -0
- package/dist/browser/api/managedOps/options.d.ts +23 -0
- package/dist/browser/api/managedOps/options.js +4 -0
- package/dist/browser/api/managedOps/options.js.map +1 -0
- package/dist/browser/api/managedOpsContext.d.ts +22 -0
- package/dist/browser/api/managedOpsContext.js +37 -0
- package/dist/browser/api/managedOpsContext.js.map +1 -0
- package/dist/browser/api/operations/index.d.ts +3 -0
- package/dist/browser/api/operations/index.js +4 -0
- package/dist/browser/api/operations/index.js.map +1 -0
- package/dist/browser/api/operations/operations.d.ts +10 -0
- package/dist/browser/api/operations/operations.js +31 -0
- package/dist/browser/api/operations/operations.js.map +1 -0
- package/dist/browser/api/operations/options.d.ts +5 -0
- package/dist/browser/api/operations/options.js +4 -0
- package/dist/browser/api/operations/options.js.map +1 -0
- package/dist/browser/classic/index.d.ts +3 -0
- package/dist/browser/classic/index.js +4 -0
- package/dist/browser/classic/index.js.map +1 -0
- package/dist/browser/classic/managedOps/index.d.ts +25 -0
- package/dist/browser/classic/managedOps/index.js +18 -0
- package/dist/browser/classic/managedOps/index.js.map +1 -0
- package/dist/browser/classic/operations/index.d.ts +11 -0
- package/dist/browser/classic/operations/index.js +14 -0
- package/dist/browser/classic/operations/index.js.map +1 -0
- package/dist/browser/index.d.ts +12 -0
- package/dist/browser/index.js +8 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/managedOpsClient.d.ts +18 -0
- package/dist/browser/managedOpsClient.js +29 -0
- package/dist/browser/managedOpsClient.js.map +1 -0
- package/dist/browser/models/index.d.ts +2 -0
- package/dist/browser/models/index.js +4 -0
- package/dist/browser/models/index.js.map +1 -0
- package/dist/browser/models/models.d.ts +331 -0
- package/dist/browser/models/models.js +314 -0
- package/dist/browser/models/models.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/restorePollerHelpers.d.ts +21 -0
- package/dist/browser/restorePollerHelpers.js +90 -0
- package/dist/browser/restorePollerHelpers.js.map +1 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.js +38 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/pagingHelpers.d.ts +73 -0
- package/dist/browser/static-helpers/pagingHelpers.js +121 -0
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/pollingHelpers.d.ts +30 -0
- package/dist/browser/static-helpers/pollingHelpers.js +79 -0
- package/dist/browser/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/browser/static-helpers/urlTemplate.js +200 -0
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/api/index.d.ts +2 -0
- package/dist/commonjs/api/index.js +8 -0
- package/dist/commonjs/api/index.js.map +1 -0
- package/dist/commonjs/api/managedOps/index.d.ts +3 -0
- package/dist/commonjs/api/managedOps/index.js +12 -0
- package/dist/commonjs/api/managedOps/index.js.map +1 -0
- package/dist/commonjs/api/managedOps/operations.d.ts +32 -0
- package/dist/commonjs/api/managedOps/operations.js +176 -0
- package/dist/commonjs/api/managedOps/operations.js.map +1 -0
- package/dist/commonjs/api/managedOps/options.d.ts +23 -0
- package/dist/commonjs/api/managedOps/options.js +5 -0
- package/dist/commonjs/api/managedOps/options.js.map +1 -0
- package/dist/commonjs/api/managedOpsContext.d.ts +22 -0
- package/dist/commonjs/api/managedOpsContext.js +40 -0
- package/dist/commonjs/api/managedOpsContext.js.map +1 -0
- package/dist/commonjs/api/operations/index.d.ts +3 -0
- package/dist/commonjs/api/operations/index.js +8 -0
- package/dist/commonjs/api/operations/index.js.map +1 -0
- package/dist/commonjs/api/operations/operations.d.ts +10 -0
- package/dist/commonjs/api/operations/operations.js +36 -0
- package/dist/commonjs/api/operations/operations.js.map +1 -0
- package/dist/commonjs/api/operations/options.d.ts +5 -0
- package/dist/commonjs/api/operations/options.js +5 -0
- package/dist/commonjs/api/operations/options.js.map +1 -0
- package/dist/commonjs/classic/index.d.ts +3 -0
- package/dist/commonjs/classic/index.js +5 -0
- package/dist/commonjs/classic/index.js.map +1 -0
- package/dist/commonjs/classic/managedOps/index.d.ts +25 -0
- package/dist/commonjs/classic/managedOps/index.js +21 -0
- package/dist/commonjs/classic/managedOps/index.js.map +1 -0
- package/dist/commonjs/classic/operations/index.d.ts +11 -0
- package/dist/commonjs/classic/operations/index.js +17 -0
- package/dist/commonjs/classic/operations/index.js.map +1 -0
- package/dist/commonjs/index.d.ts +12 -0
- package/dist/commonjs/index.js +18 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/managedOpsClient.d.ts +18 -0
- package/dist/commonjs/managedOpsClient.js +33 -0
- package/dist/commonjs/managedOpsClient.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.js +12 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/models.d.ts +331 -0
- package/dist/commonjs/models/models.js +355 -0
- package/dist/commonjs/models/models.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/restorePollerHelpers.d.ts +21 -0
- package/dist/commonjs/restorePollerHelpers.js +93 -0
- package/dist/commonjs/restorePollerHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.js +42 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts +73 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js +124 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/pollingHelpers.d.ts +30 -0
- package/dist/commonjs/static-helpers/pollingHelpers.js +82 -0
- package/dist/commonjs/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/commonjs/static-helpers/urlTemplate.js +203 -0
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/api/index.js +4 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/managedOps/index.d.ts +3 -0
- package/dist/esm/api/managedOps/index.js +4 -0
- package/dist/esm/api/managedOps/index.js.map +1 -0
- package/dist/esm/api/managedOps/operations.d.ts +32 -0
- package/dist/esm/api/managedOps/operations.js +159 -0
- package/dist/esm/api/managedOps/operations.js.map +1 -0
- package/dist/esm/api/managedOps/options.d.ts +23 -0
- package/dist/esm/api/managedOps/options.js +4 -0
- package/dist/esm/api/managedOps/options.js.map +1 -0
- package/dist/esm/api/managedOpsContext.d.ts +22 -0
- package/dist/esm/api/managedOpsContext.js +37 -0
- package/dist/esm/api/managedOpsContext.js.map +1 -0
- package/dist/esm/api/operations/index.d.ts +3 -0
- package/dist/esm/api/operations/index.js +4 -0
- package/dist/esm/api/operations/index.js.map +1 -0
- package/dist/esm/api/operations/operations.d.ts +10 -0
- package/dist/esm/api/operations/operations.js +31 -0
- package/dist/esm/api/operations/operations.js.map +1 -0
- package/dist/esm/api/operations/options.d.ts +5 -0
- package/dist/esm/api/operations/options.js +4 -0
- package/dist/esm/api/operations/options.js.map +1 -0
- package/dist/esm/classic/index.d.ts +3 -0
- package/dist/esm/classic/index.js +4 -0
- package/dist/esm/classic/index.js.map +1 -0
- package/dist/esm/classic/managedOps/index.d.ts +25 -0
- package/dist/esm/classic/managedOps/index.js +18 -0
- package/dist/esm/classic/managedOps/index.js.map +1 -0
- package/dist/esm/classic/operations/index.d.ts +11 -0
- package/dist/esm/classic/operations/index.js +14 -0
- package/dist/esm/classic/operations/index.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/managedOpsClient.d.ts +18 -0
- package/dist/esm/managedOpsClient.js +29 -0
- package/dist/esm/managedOpsClient.js.map +1 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/models.d.ts +331 -0
- package/dist/esm/models/models.js +314 -0
- package/dist/esm/models/models.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/restorePollerHelpers.d.ts +21 -0
- package/dist/esm/restorePollerHelpers.js +90 -0
- package/dist/esm/restorePollerHelpers.js.map +1 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.js +38 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/pagingHelpers.d.ts +73 -0
- package/dist/esm/static-helpers/pagingHelpers.js +121 -0
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/pollingHelpers.d.ts +30 -0
- package/dist/esm/static-helpers/pollingHelpers.js +79 -0
- package/dist/esm/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/esm/static-helpers/urlTemplate.js +200 -0
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -0
- package/dist/react-native/api/index.d.ts +2 -0
- package/dist/react-native/api/index.js +4 -0
- package/dist/react-native/api/index.js.map +1 -0
- package/dist/react-native/api/managedOps/index.d.ts +3 -0
- package/dist/react-native/api/managedOps/index.js +4 -0
- package/dist/react-native/api/managedOps/index.js.map +1 -0
- package/dist/react-native/api/managedOps/operations.d.ts +32 -0
- package/dist/react-native/api/managedOps/operations.js +159 -0
- package/dist/react-native/api/managedOps/operations.js.map +1 -0
- package/dist/react-native/api/managedOps/options.d.ts +23 -0
- package/dist/react-native/api/managedOps/options.js +4 -0
- package/dist/react-native/api/managedOps/options.js.map +1 -0
- package/dist/react-native/api/managedOpsContext.d.ts +22 -0
- package/dist/react-native/api/managedOpsContext.js +37 -0
- package/dist/react-native/api/managedOpsContext.js.map +1 -0
- package/dist/react-native/api/operations/index.d.ts +3 -0
- package/dist/react-native/api/operations/index.js +4 -0
- package/dist/react-native/api/operations/index.js.map +1 -0
- package/dist/react-native/api/operations/operations.d.ts +10 -0
- package/dist/react-native/api/operations/operations.js +31 -0
- package/dist/react-native/api/operations/operations.js.map +1 -0
- package/dist/react-native/api/operations/options.d.ts +5 -0
- package/dist/react-native/api/operations/options.js +4 -0
- package/dist/react-native/api/operations/options.js.map +1 -0
- package/dist/react-native/classic/index.d.ts +3 -0
- package/dist/react-native/classic/index.js +4 -0
- package/dist/react-native/classic/index.js.map +1 -0
- package/dist/react-native/classic/managedOps/index.d.ts +25 -0
- package/dist/react-native/classic/managedOps/index.js +18 -0
- package/dist/react-native/classic/managedOps/index.js.map +1 -0
- package/dist/react-native/classic/operations/index.d.ts +11 -0
- package/dist/react-native/classic/operations/index.js +14 -0
- package/dist/react-native/classic/operations/index.js.map +1 -0
- package/dist/react-native/index.d.ts +12 -0
- package/dist/react-native/index.js +8 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/managedOpsClient.d.ts +18 -0
- package/dist/react-native/managedOpsClient.js +29 -0
- package/dist/react-native/managedOpsClient.js.map +1 -0
- package/dist/react-native/models/index.d.ts +2 -0
- package/dist/react-native/models/index.js +4 -0
- package/dist/react-native/models/index.js.map +1 -0
- package/dist/react-native/models/models.d.ts +331 -0
- package/dist/react-native/models/models.js +314 -0
- package/dist/react-native/models/models.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/restorePollerHelpers.d.ts +21 -0
- package/dist/react-native/restorePollerHelpers.js +90 -0
- package/dist/react-native/restorePollerHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/react-native/static-helpers/cloudSettingHelpers.js +38 -0
- package/dist/react-native/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/pagingHelpers.d.ts +73 -0
- package/dist/react-native/static-helpers/pagingHelpers.js +121 -0
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/pollingHelpers.d.ts +30 -0
- package/dist/react-native/static-helpers/pollingHelpers.js +79 -0
- package/dist/react-native/static-helpers/pollingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/react-native/static-helpers/urlTemplate.js +200 -0
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -0
- package/package.json +216 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAgBlC,MAAM,UAAU,gCAAgC,CAAC,IAAS;IACxD,OAAO;QACL,KAAK,EAAE,0BAA0B,CAAC,IAAI,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C,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC;AAQD,MAAM,UAAU,yBAAyB,CAAC,IAAqB;IAC7D,OAAO;QACL,UAAU,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC;YAC7B,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;YACpB,CAAC,CAAC,mCAAmC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAC5D,CAAC;AACJ,CAAC;AAQD,MAAM,UAAU,mCAAmC,CAAC,IAA+B;IACjF,OAAO;QACL,oBAAoB,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC;YACjD,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC;YAC9B,CAAC,CAAC,8BAA8B,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;KACjE,CAAC;AACJ,CAAC;AAED,iEAAiE;AACjE,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,yBAAyB;IACzB,wDAAuC,CAAA;AACzC,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This file contains only generated model types and their (de)serializers.\n * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input.\n */\n/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */\nexport interface _OperationListResult {\n /** The Operation items on this page */\n value: Operation[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\nexport function _operationListResultDeserializer(item: any): _OperationListResult {\n return {\n value: operationArrayDeserializer(item[\"value\"]),\n nextLink: item[\"nextLink\"],\n };\n}\n\nexport function operationArrayDeserializer(result: Array<Operation>): any[] {\n return result.map((item) => {\n return operationDeserializer(item);\n });\n}\n\n/** Details of a REST API operation, returned from the Resource Provider Operations API */\nexport interface Operation {\n /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\" */\n readonly name?: string;\n /** Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations. */\n readonly isDataAction?: boolean;\n /** Localized display information for this particular operation. */\n display?: OperationDisplay;\n /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\" */\n readonly origin?: Origin;\n /** Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. */\n readonly actionType?: ActionType;\n}\n\nexport function operationDeserializer(item: any): Operation {\n return {\n name: item[\"name\"],\n isDataAction: item[\"isDataAction\"],\n display: !item[\"display\"] ? item[\"display\"] : operationDisplayDeserializer(item[\"display\"]),\n origin: item[\"origin\"],\n actionType: item[\"actionType\"],\n };\n}\n\n/** Localized display information for an operation. */\nexport interface OperationDisplay {\n /** The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\". */\n readonly provider?: string;\n /** The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\". */\n readonly resource?: string;\n /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\". */\n readonly operation?: string;\n /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */\n readonly description?: string;\n}\n\nexport function operationDisplayDeserializer(item: any): OperationDisplay {\n return {\n provider: item[\"provider\"],\n resource: item[\"resource\"],\n operation: item[\"operation\"],\n description: item[\"description\"],\n };\n}\n\n/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\" */\nexport enum KnownOrigin {\n /** Indicates the operation is initiated by a user. */\n User = \"user\",\n /** Indicates the operation is initiated by a system. */\n System = \"system\",\n /** Indicates the operation is initiated by a user or system. */\n UserSystem = \"user,system\",\n}\n\n/**\n * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\" \\\n * {@link KnownOrigin} can be used interchangeably with Origin,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **user**: Indicates the operation is initiated by a user. \\\n * **system**: Indicates the operation is initiated by a system. \\\n * **user,system**: Indicates the operation is initiated by a user or system.\n */\nexport type Origin = string;\n\n/** Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. */\nexport enum KnownActionType {\n /** Actions are for internal-only APIs. */\n Internal = \"Internal\",\n}\n\n/**\n * Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs. \\\n * {@link KnownActionType} can be used interchangeably with ActionType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Internal**: Actions are for internal-only APIs.\n */\nexport type ActionType = string;\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */\nexport interface ErrorResponse {\n /** The error object. */\n error?: ErrorDetail;\n}\n\nexport function errorResponseDeserializer(item: any): ErrorResponse {\n return {\n error: !item[\"error\"] ? item[\"error\"] : errorDetailDeserializer(item[\"error\"]),\n };\n}\n\n/** The error detail. */\nexport interface ErrorDetail {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: ErrorDetail[];\n /** The error additional info. */\n readonly additionalInfo?: ErrorAdditionalInfo[];\n}\n\nexport function errorDetailDeserializer(item: any): ErrorDetail {\n return {\n code: item[\"code\"],\n message: item[\"message\"],\n target: item[\"target\"],\n details: !item[\"details\"] ? item[\"details\"] : errorDetailArrayDeserializer(item[\"details\"]),\n additionalInfo: !item[\"additionalInfo\"]\n ? item[\"additionalInfo\"]\n : errorAdditionalInfoArrayDeserializer(item[\"additionalInfo\"]),\n };\n}\n\nexport function errorDetailArrayDeserializer(result: Array<ErrorDetail>): any[] {\n return result.map((item) => {\n return errorDetailDeserializer(item);\n });\n}\n\nexport function errorAdditionalInfoArrayDeserializer(result: Array<ErrorAdditionalInfo>): any[] {\n return result.map((item) => {\n return errorAdditionalInfoDeserializer(item);\n });\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfo {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: any;\n}\n\nexport function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo {\n return {\n type: item[\"type\"],\n info: item[\"info\"],\n };\n}\n\n/** The Managed Operations resource. */\nexport interface ManagedOp extends ProxyResource {\n /** The resource-specific properties for this resource. */\n properties?: ManagedOpsProperties;\n}\n\nexport function managedOpSerializer(item: ManagedOp): any {\n return {\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : managedOpsPropertiesSerializer(item[\"properties\"]),\n };\n}\n\nexport function managedOpDeserializer(item: any): ManagedOp {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : managedOpsPropertiesDeserializer(item[\"properties\"]),\n };\n}\n\n/** Properties of the ManagedOps resource. */\nexport interface ManagedOpsProperties {\n /** Product plan details of this resource. */\n readonly sku?: Sku;\n /** Provisioning state of the resource. */\n readonly provisioningState?: ProvisioningState;\n /** Desired configuration input by the user. */\n desiredConfiguration: DesiredConfiguration;\n /** Services provisioned by this resource. */\n readonly services?: ServiceInformation;\n /** Policy assignments created for managing services. */\n readonly policyAssignmentProperties?: PolicyAssignmentProperties;\n}\n\nexport function managedOpsPropertiesSerializer(item: ManagedOpsProperties): any {\n return { desiredConfiguration: desiredConfigurationSerializer(item[\"desiredConfiguration\"]) };\n}\n\nexport function managedOpsPropertiesDeserializer(item: any): ManagedOpsProperties {\n return {\n sku: !item[\"sku\"] ? item[\"sku\"] : skuDeserializer(item[\"sku\"]),\n provisioningState: item[\"provisioningState\"],\n desiredConfiguration: desiredConfigurationDeserializer(item[\"desiredConfiguration\"]),\n services: !item[\"services\"]\n ? item[\"services\"]\n : serviceInformationDeserializer(item[\"services\"]),\n policyAssignmentProperties: !item[\"policyAssignmentProperties\"]\n ? item[\"policyAssignmentProperties\"]\n : policyAssignmentPropertiesDeserializer(item[\"policyAssignmentProperties\"]),\n };\n}\n\n/** Specifies the service plan for this resource. */\nexport interface Sku {\n /** Name of the SKU. */\n name: string;\n /** Pricing tier of the SKU. */\n tier: string;\n}\n\nexport function skuDeserializer(item: any): Sku {\n return {\n name: item[\"name\"],\n tier: item[\"tier\"],\n };\n}\n\n/** The provisioning state of a resource. */\nexport enum KnownProvisioningState {\n /** Resource has been created. */\n Succeeded = \"Succeeded\",\n /** Resource creation failed. */\n Failed = \"Failed\",\n /** Resource creation was canceled. */\n Canceled = \"Canceled\",\n /** The resource has begun provisioning. */\n Provisioning = \"Provisioning\",\n /** The resource is being deleted. */\n Deleting = \"Deleting\",\n}\n\n/**\n * The provisioning state of a resource. \\\n * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Succeeded**: Resource has been created. \\\n * **Failed**: Resource creation failed. \\\n * **Canceled**: Resource creation was canceled. \\\n * **Provisioning**: The resource has begun provisioning. \\\n * **Deleting**: The resource is being deleted.\n */\nexport type ProvisioningState = string;\n\n/** Desired configuration input by the user. */\nexport interface DesiredConfiguration {\n /** Configuration for the Change Tracking and Inventory service. */\n changeTrackingAndInventory: ChangeTrackingConfiguration;\n /** Configuration for the Azure Monitor Insights service. */\n azureMonitorInsights: AzureMonitorConfiguration;\n /** User assigned Managed Identity used to perform operations on machines managed by Ops360. */\n userAssignedManagedIdentityId: string;\n /** Desired enablement state of the Defender For Servers service. */\n defenderForServers?: string;\n /** Desired enablement state of the Defender Cloud Security Posture Management (CSPM) service. */\n defenderCspm?: string;\n}\n\nexport function desiredConfigurationSerializer(item: DesiredConfiguration): any {\n return {\n changeTrackingAndInventory: changeTrackingConfigurationSerializer(\n item[\"changeTrackingAndInventory\"],\n ),\n azureMonitorInsights: azureMonitorConfigurationSerializer(item[\"azureMonitorInsights\"]),\n userAssignedManagedIdentityId: item[\"userAssignedManagedIdentityId\"],\n defenderForServers: item[\"defenderForServers\"],\n defenderCspm: item[\"defenderCspm\"],\n };\n}\n\nexport function desiredConfigurationDeserializer(item: any): DesiredConfiguration {\n return {\n changeTrackingAndInventory: changeTrackingConfigurationDeserializer(\n item[\"changeTrackingAndInventory\"],\n ),\n azureMonitorInsights: azureMonitorConfigurationDeserializer(item[\"azureMonitorInsights\"]),\n userAssignedManagedIdentityId: item[\"userAssignedManagedIdentityId\"],\n defenderForServers: item[\"defenderForServers\"],\n defenderCspm: item[\"defenderCspm\"],\n };\n}\n\n/** Configuration for the Change Tracking and Inventory service. */\nexport interface ChangeTrackingConfiguration {\n /** Log analytics workspace resource ID used by the service. */\n logAnalyticsWorkspaceId: string;\n}\n\nexport function changeTrackingConfigurationSerializer(item: ChangeTrackingConfiguration): any {\n return { logAnalyticsWorkspaceId: item[\"logAnalyticsWorkspaceId\"] };\n}\n\nexport function changeTrackingConfigurationDeserializer(item: any): ChangeTrackingConfiguration {\n return {\n logAnalyticsWorkspaceId: item[\"logAnalyticsWorkspaceId\"],\n };\n}\n\n/** Configuration for the Azure Monitor Insights service. */\nexport interface AzureMonitorConfiguration {\n /** Azure monitor workspace resource ID used by the service. */\n azureMonitorWorkspaceId: string;\n}\n\nexport function azureMonitorConfigurationSerializer(item: AzureMonitorConfiguration): any {\n return { azureMonitorWorkspaceId: item[\"azureMonitorWorkspaceId\"] };\n}\n\nexport function azureMonitorConfigurationDeserializer(item: any): AzureMonitorConfiguration {\n return {\n azureMonitorWorkspaceId: item[\"azureMonitorWorkspaceId\"],\n };\n}\n\n/** Services provisioned by this resource. */\nexport interface ServiceInformation {\n /** Change Tracking and Inventory service information. */\n readonly changeTrackingAndInventory?: ChangeTrackingInformation;\n /** Azure Monitor Insights service information. */\n readonly azureMonitorInsights?: AzureMonitorInformation;\n /** Azure Update Manager service information. */\n readonly azureUpdateManager?: UpdateManagerInformation;\n /** Azure Policy and Machine Configuration service information. */\n readonly azurePolicyAndMachineConfiguration?: GuestConfigurationInformation;\n /** Defender for Servers service information. */\n readonly defenderForServers?: DefenderForServersInformation;\n /** Defender for Cloud's Cloud security posture management (CSPM) service information. */\n readonly defenderCspm?: DefenderCspmInformation;\n}\n\nexport function serviceInformationDeserializer(item: any): ServiceInformation {\n return {\n changeTrackingAndInventory: !item[\"changeTrackingAndInventory\"]\n ? item[\"changeTrackingAndInventory\"]\n : changeTrackingInformationDeserializer(item[\"changeTrackingAndInventory\"]),\n azureMonitorInsights: !item[\"azureMonitorInsights\"]\n ? item[\"azureMonitorInsights\"]\n : azureMonitorInformationDeserializer(item[\"azureMonitorInsights\"]),\n azureUpdateManager: !item[\"azureUpdateManager\"]\n ? item[\"azureUpdateManager\"]\n : updateManagerInformationDeserializer(item[\"azureUpdateManager\"]),\n azurePolicyAndMachineConfiguration: !item[\"azurePolicyAndMachineConfiguration\"]\n ? item[\"azurePolicyAndMachineConfiguration\"]\n : guestConfigurationInformationDeserializer(item[\"azurePolicyAndMachineConfiguration\"]),\n defenderForServers: !item[\"defenderForServers\"]\n ? item[\"defenderForServers\"]\n : defenderForServersInformationDeserializer(item[\"defenderForServers\"]),\n defenderCspm: !item[\"defenderCspm\"]\n ? item[\"defenderCspm\"]\n : defenderCspmInformationDeserializer(item[\"defenderCspm\"]),\n };\n}\n\n/** Change Tracking and Inventory service information. */\nexport interface ChangeTrackingInformation {\n /** ID of Data Collection Rule (DCR) associated with this service. */\n dcrId: string;\n /** Indicates whether the service is enabled. */\n enablementStatus: string;\n}\n\nexport function changeTrackingInformationDeserializer(item: any): ChangeTrackingInformation {\n return {\n dcrId: item[\"dcrId\"],\n enablementStatus: item[\"enablementStatus\"],\n };\n}\n\n/** Azure Monitor Insights service information. */\nexport interface AzureMonitorInformation {\n /** ID of Data Collection Rule (DCR) associated with this service. */\n dcrId: string;\n /** Indicates whether the service is enabled. */\n enablementStatus: string;\n}\n\nexport function azureMonitorInformationDeserializer(item: any): AzureMonitorInformation {\n return {\n dcrId: item[\"dcrId\"],\n enablementStatus: item[\"enablementStatus\"],\n };\n}\n\n/** Azure Update Manager service information. */\nexport interface UpdateManagerInformation {\n /** Indicates whether the service is enabled. */\n enablementStatus: string;\n}\n\nexport function updateManagerInformationDeserializer(item: any): UpdateManagerInformation {\n return {\n enablementStatus: item[\"enablementStatus\"],\n };\n}\n\n/** Azure Policy and Machine Configuration service information. */\nexport interface GuestConfigurationInformation {\n /** Indicates whether the service is enabled. */\n enablementStatus: string;\n}\n\nexport function guestConfigurationInformationDeserializer(\n item: any,\n): GuestConfigurationInformation {\n return {\n enablementStatus: item[\"enablementStatus\"],\n };\n}\n\n/** Defender for Servers service information. */\nexport interface DefenderForServersInformation {\n /** Indicates whether the service is enabled. */\n enablementStatus: string;\n}\n\nexport function defenderForServersInformationDeserializer(\n item: any,\n): DefenderForServersInformation {\n return {\n enablementStatus: item[\"enablementStatus\"],\n };\n}\n\n/** Defender Cloud Security Posture Management (CSPM) service information. */\nexport interface DefenderCspmInformation {\n /** Indicates whether the service is enabled. */\n enablementStatus: string;\n}\n\nexport function defenderCspmInformationDeserializer(item: any): DefenderCspmInformation {\n return {\n enablementStatus: item[\"enablementStatus\"],\n };\n}\n\n/** Policy assignments created for managing services. */\nexport interface PolicyAssignmentProperties {\n /** Policy initiative assignment ID. */\n policyInitiativeAssignmentId: string;\n}\n\nexport function policyAssignmentPropertiesDeserializer(item: any): PolicyAssignmentProperties {\n return {\n policyInitiativeAssignmentId: item[\"policyInitiativeAssignmentId\"],\n };\n}\n\n/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */\nexport interface ProxyResource extends Resource {}\n\nexport function proxyResourceSerializer(item: ProxyResource): any {\n return item;\n}\n\nexport function proxyResourceDeserializer(item: any): ProxyResource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n };\n}\n\n/** Common fields that are returned in the response for all Azure Resource Manager resources */\nexport interface Resource {\n /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */\n readonly id?: string;\n /** The name of the resource */\n readonly name?: string;\n /** The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\" */\n readonly type?: string;\n /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */\n readonly systemData?: SystemData;\n}\n\nexport function resourceSerializer(item: Resource): any {\n return item;\n}\n\nexport function resourceDeserializer(item: any): Resource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n };\n}\n\n/** Metadata pertaining to creation and last modification of the resource. */\nexport interface SystemData {\n /** The identity that created the resource. */\n createdBy?: string;\n /** The type of identity that created the resource. */\n createdByType?: CreatedByType;\n /** The timestamp of resource creation (UTC). */\n createdAt?: Date;\n /** The identity that last modified the resource. */\n lastModifiedBy?: string;\n /** The type of identity that last modified the resource. */\n lastModifiedByType?: CreatedByType;\n /** The timestamp of resource last modification (UTC) */\n lastModifiedAt?: Date;\n}\n\nexport function systemDataDeserializer(item: any): SystemData {\n return {\n createdBy: item[\"createdBy\"],\n createdByType: item[\"createdByType\"],\n createdAt: !item[\"createdAt\"] ? item[\"createdAt\"] : new Date(item[\"createdAt\"]),\n lastModifiedBy: item[\"lastModifiedBy\"],\n lastModifiedByType: item[\"lastModifiedByType\"],\n lastModifiedAt: !item[\"lastModifiedAt\"]\n ? item[\"lastModifiedAt\"]\n : new Date(item[\"lastModifiedAt\"]),\n };\n}\n\n/** The kind of entity that created the resource. */\nexport enum KnownCreatedByType {\n /** The entity was created by a user. */\n User = \"User\",\n /** The entity was created by an application. */\n Application = \"Application\",\n /** The entity was created by a managed identity. */\n ManagedIdentity = \"ManagedIdentity\",\n /** The entity was created by a key. */\n Key = \"Key\",\n}\n\n/**\n * The kind of entity that created the resource. \\\n * {@link KnownCreatedByType} can be used interchangeably with CreatedByType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **User**: The entity was created by a user. \\\n * **Application**: The entity was created by an application. \\\n * **ManagedIdentity**: The entity was created by a managed identity. \\\n * **Key**: The entity was created by a key.\n */\nexport type CreatedByType = string;\n\n/** The response of a ManagedOp list operation. */\nexport interface _ManagedOpListResult {\n /** The ManagedOp items on this page */\n value: ManagedOp[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\nexport function _managedOpListResultDeserializer(item: any): _ManagedOpListResult {\n return {\n value: managedOpArrayDeserializer(item[\"value\"]),\n nextLink: item[\"nextLink\"],\n };\n}\n\nexport function managedOpArraySerializer(result: Array<ManagedOp>): any[] {\n return result.map((item) => {\n return managedOpSerializer(item);\n });\n}\n\nexport function managedOpArrayDeserializer(result: Array<ManagedOp>): any[] {\n return result.map((item) => {\n return managedOpDeserializer(item);\n });\n}\n\n/** The type used for update operations of the ManagedOp. */\nexport interface ManagedOpUpdate {\n /** The resource-specific properties for this resource. */\n properties?: ManagedOpUpdateProperties;\n}\n\nexport function managedOpUpdateSerializer(item: ManagedOpUpdate): any {\n return {\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : managedOpUpdatePropertiesSerializer(item[\"properties\"]),\n };\n}\n\n/** The updatable properties of the ManagedOp. */\nexport interface ManagedOpUpdateProperties {\n /** Desired configuration input by the user. */\n desiredConfiguration?: DesiredConfiguration;\n}\n\nexport function managedOpUpdatePropertiesSerializer(item: ManagedOpUpdateProperties): any {\n return {\n desiredConfiguration: !item[\"desiredConfiguration\"]\n ? item[\"desiredConfiguration\"]\n : desiredConfigurationSerializer(item[\"desiredConfiguration\"]),\n };\n}\n\n/** Known values of {@link Versions} that the service accepts. */\nexport enum KnownVersions {\n /** 2025-07-28-preview */\n V20250728Preview = \"2025-07-28-preview\",\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ManagedOpsClient } from "./managedOpsClient.js";
|
|
2
|
+
import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
3
|
+
import type { AbortSignalLike } from "@azure/abort-controller";
|
|
4
|
+
import type { PollerLike, OperationState } from "@azure/core-lro";
|
|
5
|
+
export interface RestorePollerOptions<TResult, TResponse extends PathUncheckedResponse = PathUncheckedResponse> extends OperationOptions {
|
|
6
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
7
|
+
updateIntervalInMs?: number;
|
|
8
|
+
/**
|
|
9
|
+
* The signal which can be used to abort requests.
|
|
10
|
+
*/
|
|
11
|
+
abortSignal?: AbortSignalLike;
|
|
12
|
+
/** Deserialization function for raw response body */
|
|
13
|
+
processResponseBody?: (result: TResponse) => Promise<TResult>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates a poller from the serialized state of another poller. This can be
|
|
17
|
+
* useful when you want to create pollers on a different host or a poller
|
|
18
|
+
* needs to be constructed after the original one is not in scope.
|
|
19
|
+
*/
|
|
20
|
+
export declare function restorePoller<TResponse extends PathUncheckedResponse, TResult>(client: ManagedOpsClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>, options?: RestorePollerOptions<TResult>): PollerLike<OperationState<TResult>, TResult>;
|
|
21
|
+
//# sourceMappingURL=restorePollerHelpers.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { _$deleteDeserialize, _updateDeserialize, _createOrUpdateDeserialize, } from "./api/managedOps/operations.js";
|
|
4
|
+
import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js";
|
|
5
|
+
import { deserializeState } from "@azure/core-lro";
|
|
6
|
+
/**
|
|
7
|
+
* Creates a poller from the serialized state of another poller. This can be
|
|
8
|
+
* useful when you want to create pollers on a different host or a poller
|
|
9
|
+
* needs to be constructed after the original one is not in scope.
|
|
10
|
+
*/
|
|
11
|
+
export function restorePoller(client, serializedState, sourceOperation, options) {
|
|
12
|
+
const pollerConfig = deserializeState(serializedState).config;
|
|
13
|
+
const { initialRequestUrl, requestMethod, metadata } = pollerConfig;
|
|
14
|
+
if (!initialRequestUrl || !requestMethod) {
|
|
15
|
+
throw new Error(`Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`);
|
|
16
|
+
}
|
|
17
|
+
const resourceLocationConfig = metadata?.["resourceLocationConfig"];
|
|
18
|
+
const { deserializer, expectedStatuses = [] } = getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};
|
|
19
|
+
const deserializeHelper = options?.processResponseBody ?? deserializer;
|
|
20
|
+
if (!deserializeHelper) {
|
|
21
|
+
throw new Error(`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`);
|
|
22
|
+
}
|
|
23
|
+
return getLongRunningPoller(client["_client"] ?? client, deserializeHelper, expectedStatuses, {
|
|
24
|
+
updateIntervalInMs: options?.updateIntervalInMs,
|
|
25
|
+
abortSignal: options?.abortSignal,
|
|
26
|
+
resourceLocationConfig,
|
|
27
|
+
restoreFrom: serializedState,
|
|
28
|
+
initialRequestUrl,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const deserializeMap = {
|
|
32
|
+
"DELETE /subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps/{managedOpsName}": { deserializer: _$deleteDeserialize, expectedStatuses: ["202", "204", "200", "201"] },
|
|
33
|
+
"PATCH /subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps/{managedOpsName}": { deserializer: _updateDeserialize, expectedStatuses: ["200", "202", "201"] },
|
|
34
|
+
"PUT /subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps/{managedOpsName}": { deserializer: _createOrUpdateDeserialize, expectedStatuses: ["200", "201", "202"] },
|
|
35
|
+
};
|
|
36
|
+
function getDeserializationHelper(urlStr, method) {
|
|
37
|
+
const path = new URL(urlStr).pathname;
|
|
38
|
+
const pathParts = path.split("/");
|
|
39
|
+
// Traverse list to match the longest candidate
|
|
40
|
+
// matchedLen: the length of candidate path
|
|
41
|
+
// matchedValue: the matched status code array
|
|
42
|
+
let matchedLen = -1, matchedValue;
|
|
43
|
+
// Iterate the responseMap to find a match
|
|
44
|
+
for (const [key, value] of Object.entries(deserializeMap)) {
|
|
45
|
+
// Extracting the path from the map key which is in format
|
|
46
|
+
// GET /path/foo
|
|
47
|
+
if (!key.startsWith(method)) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const candidatePath = getPathFromMapKey(key);
|
|
51
|
+
// Get each part of the url path
|
|
52
|
+
const candidateParts = candidatePath.split("/");
|
|
53
|
+
// track if we have found a match to return the values found.
|
|
54
|
+
let found = true;
|
|
55
|
+
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
56
|
+
if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
|
|
57
|
+
const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
|
|
58
|
+
// If the current part of the candidate is a "template" part
|
|
59
|
+
// Try to use the suffix of pattern to match the path
|
|
60
|
+
// {guid} ==> $
|
|
61
|
+
// {guid}:export ==> :export$
|
|
62
|
+
const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
|
|
63
|
+
if (!isMatched) {
|
|
64
|
+
found = false;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
// If the candidate part is not a template and
|
|
70
|
+
// the parts don't match mark the candidate as not found
|
|
71
|
+
// to move on with the next candidate path.
|
|
72
|
+
if (candidateParts[i] !== pathParts[j]) {
|
|
73
|
+
found = false;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// We finished evaluating the current candidate parts
|
|
78
|
+
// Update the matched value if and only if we found the longer pattern
|
|
79
|
+
if (found && candidatePath.length > matchedLen) {
|
|
80
|
+
matchedLen = candidatePath.length;
|
|
81
|
+
matchedValue = value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return matchedValue;
|
|
85
|
+
}
|
|
86
|
+
function getPathFromMapKey(mapKey) {
|
|
87
|
+
const pathStart = mapKey.indexOf("/");
|
|
88
|
+
return mapKey.slice(pathStart);
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=restorePollerHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restorePollerHelpers.js","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAI1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAgBnD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAwB,EACxB,eAAuB,EACvB,eAAiF,EACjF,OAAuC;IAEvC,MAAM,YAAY,GAAG,gBAAgB,CAAC,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,MAAM,EAAE,YAAY,EAAE,gBAAgB,GAAG,EAAE,EAAE,GAC3C,wBAAwB,CAAC,iBAAiB,EAAE,aAA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ACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;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 type { ManagedOpsClient } from \"./managedOpsClient.js\";\nimport {\n _$deleteDeserialize,\n _updateDeserialize,\n _createOrUpdateDeserialize,\n} from \"./api/managedOps/operations.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport type { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type { PollerLike, OperationState, ResourceLocationConfig } from \"@azure/core-lro\";\nimport { deserializeState } 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: ManagedOpsClient,\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: (result: PathUncheckedResponse) => Promise<any>;\n expectedStatuses: string[];\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"DELETE /subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps/{managedOpsName}\":\n { deserializer: _$deleteDeserialize, expectedStatuses: [\"202\", \"204\", \"200\", \"201\"] },\n \"PATCH /subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps/{managedOpsName}\":\n { deserializer: _updateDeserialize, expectedStatuses: [\"200\", \"202\", \"201\"] },\n \"PUT /subscriptions/{subscriptionId}/providers/Microsoft.ManagedOps/managedOps/{managedOpsName}\":\n { deserializer: _createOrUpdateDeserialize, expectedStatuses: [\"200\", \"201\", \"202\"] },\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"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An enum to describe Azure Cloud environments.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
5
|
+
export declare enum AzureClouds {
|
|
6
|
+
/** Azure public cloud, which is the default cloud for Azure SDKs. */
|
|
7
|
+
AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
|
|
8
|
+
/** Azure China cloud */
|
|
9
|
+
AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
|
|
10
|
+
/** Azure US government cloud */
|
|
11
|
+
AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT"
|
|
12
|
+
}
|
|
13
|
+
/** The supported values for cloud setting as a string literal type */
|
|
14
|
+
export type AzureSupportedClouds = `${AzureClouds}`;
|
|
15
|
+
/**
|
|
16
|
+
* Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
|
|
17
|
+
* @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
|
|
18
|
+
* @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
|
|
19
|
+
* @throws {Error} Throws an error if an unknown cloud setting is provided.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined;
|
|
22
|
+
//# sourceMappingURL=cloudSettingHelpers.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* An enum to describe Azure Cloud environments.
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export var AzureClouds;
|
|
8
|
+
(function (AzureClouds) {
|
|
9
|
+
/** Azure public cloud, which is the default cloud for Azure SDKs. */
|
|
10
|
+
AzureClouds["AZURE_PUBLIC_CLOUD"] = "AZURE_PUBLIC_CLOUD";
|
|
11
|
+
/** Azure China cloud */
|
|
12
|
+
AzureClouds["AZURE_CHINA_CLOUD"] = "AZURE_CHINA_CLOUD";
|
|
13
|
+
/** Azure US government cloud */
|
|
14
|
+
AzureClouds["AZURE_US_GOVERNMENT"] = "AZURE_US_GOVERNMENT";
|
|
15
|
+
})(AzureClouds || (AzureClouds = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
|
|
18
|
+
* @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
|
|
19
|
+
* @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
|
|
20
|
+
* @throws {Error} Throws an error if an unknown cloud setting is provided.
|
|
21
|
+
*/
|
|
22
|
+
export function getArmEndpoint(cloudSetting) {
|
|
23
|
+
if (cloudSetting === undefined) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const cloudEndpoints = {
|
|
27
|
+
AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/",
|
|
28
|
+
AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/",
|
|
29
|
+
AZURE_PUBLIC_CLOUD: "https://management.azure.com/",
|
|
30
|
+
};
|
|
31
|
+
if (cloudSetting in cloudEndpoints) {
|
|
32
|
+
return cloudEndpoints[cloudSetting];
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new Error(`Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=cloudSettingHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudSettingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/cloudSettingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AACH,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,qEAAqE;IACrE,wDAAyC,CAAA;IACzC,wBAAwB;IACxB,sDAAuC,CAAA;IACvC,gCAAgC;IAChC,0DAA2C,CAAA;AAC7C,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAKD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,YAAmC;IAChE,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,cAAc,GAA6C;QAC/D,iBAAiB,EAAE,sCAAsC;QACzD,mBAAmB,EAAE,uCAAuC;QAC5D,kBAAkB,EAAE,+BAA+B;KACpD,CAAC;IACF,IAAI,YAAY,IAAI,cAAc,EAAE,CAAC;QACnC,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,0BAA0B,YAAY,6DAA6D,CACpG,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * An enum to describe Azure Cloud environments.\n * @enum {string}\n */\nexport enum AzureClouds {\n /** Azure public cloud, which is the default cloud for Azure SDKs. */\n AZURE_PUBLIC_CLOUD = \"AZURE_PUBLIC_CLOUD\",\n /** Azure China cloud */\n AZURE_CHINA_CLOUD = \"AZURE_CHINA_CLOUD\",\n /** Azure US government cloud */\n AZURE_US_GOVERNMENT = \"AZURE_US_GOVERNMENT\",\n}\n\n/** The supported values for cloud setting as a string literal type */\nexport type AzureSupportedClouds = `${AzureClouds}`;\n\n/**\n * Gets the Azure Resource Manager endpoint URL for the specified cloud setting.\n * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.\n * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.\n * @throws {Error} Throws an error if an unknown cloud setting is provided.\n */\nexport function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined {\n if (cloudSetting === undefined) {\n return undefined;\n }\n const cloudEndpoints: Record<keyof typeof AzureClouds, string> = {\n AZURE_CHINA_CLOUD: \"https://management.chinacloudapi.cn/\",\n AZURE_US_GOVERNMENT: \"https://management.usgovcloudapi.net/\",\n AZURE_PUBLIC_CLOUD: \"https://management.azure.com/\",\n };\n if (cloudSetting in cloudEndpoints) {\n return cloudEndpoints[cloudSetting];\n } else {\n throw new Error(\n `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`,\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the byPage method
|
|
4
|
+
*/
|
|
5
|
+
export interface PageSettings {
|
|
6
|
+
/**
|
|
7
|
+
* A reference to a specific page to start iterating from.
|
|
8
|
+
*/
|
|
9
|
+
continuationToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface that describes a page of results.
|
|
13
|
+
*/
|
|
14
|
+
export type ContinuablePage<TElement, TPage = TElement[]> = TPage & {
|
|
15
|
+
/**
|
|
16
|
+
* The token that keeps track of where to continue the iterator
|
|
17
|
+
*/
|
|
18
|
+
continuationToken?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
22
|
+
*/
|
|
23
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
24
|
+
/**
|
|
25
|
+
* The next method, part of the iteration protocol
|
|
26
|
+
*/
|
|
27
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
30
|
+
*/
|
|
31
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
32
|
+
/**
|
|
33
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
34
|
+
*/
|
|
35
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An interface that describes how to communicate with the service.
|
|
39
|
+
*/
|
|
40
|
+
export interface PagedResult<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
41
|
+
/**
|
|
42
|
+
* Link to the first page of results.
|
|
43
|
+
*/
|
|
44
|
+
firstPageLink?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A method that returns a page of results.
|
|
47
|
+
*/
|
|
48
|
+
getPage: (pageLink?: string) => Promise<{
|
|
49
|
+
page: TPage;
|
|
50
|
+
nextPageLink?: string;
|
|
51
|
+
} | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* a function to implement the `byPage` method on the paged async iterator.
|
|
54
|
+
*/
|
|
55
|
+
byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
56
|
+
/**
|
|
57
|
+
* A function to extract elements from a page.
|
|
58
|
+
*/
|
|
59
|
+
toElements?: (page: TPage) => TElement[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Options for the paging helper
|
|
63
|
+
*/
|
|
64
|
+
export interface BuildPagedAsyncIteratorOptions {
|
|
65
|
+
itemName?: string;
|
|
66
|
+
nextLinkName?: string;
|
|
67
|
+
nextLinkMethod?: "GET" | "POST";
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
71
|
+
*/
|
|
72
|
+
export declare function buildPagedAsyncIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings, TResponse extends PathUncheckedResponse = PathUncheckedResponse>(client: Client, getInitialResponse: () => PromiseLike<TResponse>, processResponseBody: (result: TResponse) => PromiseLike<unknown>, expectedStatuses: string[], options?: BuildPagedAsyncIteratorOptions): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
73
|
+
//# sourceMappingURL=pagingHelpers.d.ts.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { createRestError } from "@azure-rest/core-client";
|
|
4
|
+
import { RestError } from "@azure/core-rest-pipeline";
|
|
5
|
+
/**
|
|
6
|
+
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
7
|
+
*/
|
|
8
|
+
export function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody, expectedStatuses, options = {}) {
|
|
9
|
+
const itemName = options.itemName ?? "value";
|
|
10
|
+
const nextLinkName = options.nextLinkName ?? "nextLink";
|
|
11
|
+
const nextLinkMethod = options.nextLinkMethod ?? "GET";
|
|
12
|
+
const pagedResult = {
|
|
13
|
+
getPage: async (pageLink) => {
|
|
14
|
+
const result = pageLink === undefined
|
|
15
|
+
? await getInitialResponse()
|
|
16
|
+
: nextLinkMethod === "POST"
|
|
17
|
+
? await client.pathUnchecked(pageLink).post()
|
|
18
|
+
: await client.pathUnchecked(pageLink).get();
|
|
19
|
+
checkPagingRequest(result, expectedStatuses);
|
|
20
|
+
const results = await processResponseBody(result);
|
|
21
|
+
const nextLink = getNextLink(results, nextLinkName);
|
|
22
|
+
const values = getElements(results, itemName);
|
|
23
|
+
return {
|
|
24
|
+
page: values,
|
|
25
|
+
nextPageLink: nextLink,
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
byPage: (settings) => {
|
|
29
|
+
const { continuationToken } = settings ?? {};
|
|
30
|
+
return getPageAsyncIterator(pagedResult, {
|
|
31
|
+
pageLink: continuationToken,
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
return getPagedAsyncIterator(pagedResult);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* returns an async iterator that iterates over results. It also has a `byPage`
|
|
39
|
+
* method that returns pages of items at once.
|
|
40
|
+
*
|
|
41
|
+
* @param pagedResult - an object that specifies how to get pages.
|
|
42
|
+
* @returns a paged async iterator that iterates over results.
|
|
43
|
+
*/
|
|
44
|
+
function getPagedAsyncIterator(pagedResult) {
|
|
45
|
+
const iter = getItemAsyncIterator(pagedResult);
|
|
46
|
+
return {
|
|
47
|
+
next() {
|
|
48
|
+
return iter.next();
|
|
49
|
+
},
|
|
50
|
+
[Symbol.asyncIterator]() {
|
|
51
|
+
return this;
|
|
52
|
+
},
|
|
53
|
+
byPage: pagedResult?.byPage ??
|
|
54
|
+
((settings) => {
|
|
55
|
+
const { continuationToken } = settings ?? {};
|
|
56
|
+
return getPageAsyncIterator(pagedResult, {
|
|
57
|
+
pageLink: continuationToken,
|
|
58
|
+
});
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
async function* getItemAsyncIterator(pagedResult) {
|
|
63
|
+
const pages = getPageAsyncIterator(pagedResult);
|
|
64
|
+
for await (const page of pages) {
|
|
65
|
+
yield* page;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
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);
|
|
79
|
+
if (!response) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
result = response.page;
|
|
83
|
+
result.continuationToken = response.nextPageLink;
|
|
84
|
+
yield result;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Gets for the value of nextLink in the body
|
|
89
|
+
*/
|
|
90
|
+
function getNextLink(body, nextLinkName) {
|
|
91
|
+
if (!nextLinkName) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
const nextLink = body[nextLinkName];
|
|
95
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) {
|
|
96
|
+
throw new RestError(`Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`);
|
|
97
|
+
}
|
|
98
|
+
if (nextLink === null) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
return nextLink;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Gets the elements of the current request in the body.
|
|
105
|
+
*/
|
|
106
|
+
function getElements(body, itemName) {
|
|
107
|
+
const value = body[itemName];
|
|
108
|
+
if (!Array.isArray(value)) {
|
|
109
|
+
throw new RestError(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
110
|
+
}
|
|
111
|
+
return value ?? [];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Checks if a request failed
|
|
115
|
+
*/
|
|
116
|
+
function checkPagingRequest(response, expectedStatuses) {
|
|
117
|
+
if (!expectedStatuses.includes(response.status)) {
|
|
118
|
+
throw createRestError(`Pagination failed with unexpected statusCode ${response.status}`, response);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=pagingHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAgFtD;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAMrC,MAAc,EACd,kBAAgD,EAChD,mBAAgE,EAChE,gBAA0B,EAC1B,UAA0C,EAAE;IAE5C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC;IAC7C,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,UAAU,CAAC;IACxD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,KAAK,CAAC;IACvD,MAAM,WAAW,GAAgD;QAC/D,OAAO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AAC,IAAa,EAAE,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,SAAS,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,SAAS,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,eAAe,CACnB,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 type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } 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 nextLinkMethod?: \"GET\" | \"POST\";\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 nextLinkMethod = options.nextLinkMethod ?? \"GET\";\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n const result =\n pageLink === undefined\n ? await getInitialResponse()\n : nextLinkMethod === \"POST\"\n ? await client.pathUnchecked(pageLink).post()\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"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro";
|
|
2
|
+
import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
3
|
+
import type { AbortSignalLike } from "@azure/abort-controller";
|
|
4
|
+
export interface GetLongRunningPollerOptions<TResponse> {
|
|
5
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
6
|
+
updateIntervalInMs?: number;
|
|
7
|
+
/**
|
|
8
|
+
* The signal which can be used to abort requests.
|
|
9
|
+
*/
|
|
10
|
+
abortSignal?: AbortSignalLike;
|
|
11
|
+
/**
|
|
12
|
+
* The potential location of the result of the LRO if specified by the LRO extension in the swagger.
|
|
13
|
+
*/
|
|
14
|
+
resourceLocationConfig?: ResourceLocationConfig;
|
|
15
|
+
/**
|
|
16
|
+
* The original url of the LRO
|
|
17
|
+
* Should not be null when restoreFrom is set
|
|
18
|
+
*/
|
|
19
|
+
initialRequestUrl?: string;
|
|
20
|
+
/**
|
|
21
|
+
* A serialized poller which can be used to resume an existing paused Long-Running-Operation.
|
|
22
|
+
*/
|
|
23
|
+
restoreFrom?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The function to get the initial response
|
|
26
|
+
*/
|
|
27
|
+
getInitialResponse?: () => PromiseLike<TResponse>;
|
|
28
|
+
}
|
|
29
|
+
export declare function getLongRunningPoller<TResponse extends PathUncheckedResponse, TResult = void>(client: Client, processResponseBody: (result: TResponse) => Promise<TResult>, expectedStatuses: string[], options: GetLongRunningPollerOptions<TResponse>): PollerLike<OperationState<TResult>, TResult>;
|
|
30
|
+
//# sourceMappingURL=pollingHelpers.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { createHttpPoller } from "@azure/core-lro";
|
|
4
|
+
import { createRestError } from "@azure-rest/core-client";
|
|
5
|
+
export function getLongRunningPoller(client, processResponseBody, expectedStatuses, options) {
|
|
6
|
+
const { restoreFrom, getInitialResponse } = options;
|
|
7
|
+
if (!restoreFrom && !getInitialResponse) {
|
|
8
|
+
throw new Error("Either restoreFrom or getInitialResponse must be specified");
|
|
9
|
+
}
|
|
10
|
+
let initialResponse = undefined;
|
|
11
|
+
const pollAbortController = new AbortController();
|
|
12
|
+
const poller = {
|
|
13
|
+
sendInitialRequest: async () => {
|
|
14
|
+
if (!getInitialResponse) {
|
|
15
|
+
throw new Error("getInitialResponse is required when initializing a new poller");
|
|
16
|
+
}
|
|
17
|
+
initialResponse = await getInitialResponse();
|
|
18
|
+
return getLroResponse(initialResponse, expectedStatuses);
|
|
19
|
+
},
|
|
20
|
+
sendPollRequest: async (path, pollOptions) => {
|
|
21
|
+
// The poll request would both listen to the user provided abort signal and the poller's own abort signal
|
|
22
|
+
function abortListener() {
|
|
23
|
+
pollAbortController.abort();
|
|
24
|
+
}
|
|
25
|
+
const abortSignal = pollAbortController.signal;
|
|
26
|
+
if (options.abortSignal?.aborted) {
|
|
27
|
+
pollAbortController.abort();
|
|
28
|
+
}
|
|
29
|
+
else if (pollOptions?.abortSignal?.aborted) {
|
|
30
|
+
pollAbortController.abort();
|
|
31
|
+
}
|
|
32
|
+
else if (!abortSignal.aborted) {
|
|
33
|
+
options.abortSignal?.addEventListener("abort", abortListener, {
|
|
34
|
+
once: true,
|
|
35
|
+
});
|
|
36
|
+
pollOptions?.abortSignal?.addEventListener("abort", abortListener, {
|
|
37
|
+
once: true,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
let response;
|
|
41
|
+
try {
|
|
42
|
+
response = await client.pathUnchecked(path).get({ abortSignal });
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
options.abortSignal?.removeEventListener("abort", abortListener);
|
|
46
|
+
pollOptions?.abortSignal?.removeEventListener("abort", abortListener);
|
|
47
|
+
}
|
|
48
|
+
return getLroResponse(response, expectedStatuses);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
return createHttpPoller(poller, {
|
|
52
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
53
|
+
resourceLocationConfig: options?.resourceLocationConfig,
|
|
54
|
+
restoreFrom: options?.restoreFrom,
|
|
55
|
+
processResult: (result) => {
|
|
56
|
+
return processResponseBody(result);
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Converts a Rest Client response to a response that the LRO implementation understands
|
|
62
|
+
* @param response - a rest client http response
|
|
63
|
+
* @param deserializeFn - deserialize function to convert Rest response to modular output
|
|
64
|
+
* @returns - An LRO response that the LRO implementation understands
|
|
65
|
+
*/
|
|
66
|
+
function getLroResponse(response, expectedStatuses) {
|
|
67
|
+
if (!expectedStatuses.includes(response.status)) {
|
|
68
|
+
throw createRestError(response);
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
flatResponse: response,
|
|
72
|
+
rawResponse: {
|
|
73
|
+
...response,
|
|
74
|
+
statusCode: Number.parseInt(response.status),
|
|
75
|
+
body: response.body,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=pollingHelpers.js.map
|