@azure-rest/iot-device-update 1.0.0-alpha.20220606.1 → 1.0.0-beta.2
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 +1 -1
- package/dist/index.js +174 -5
- package/dist/index.js.map +1 -1
- package/dist-esm/src/clientDefinitions.js +4 -0
- package/dist-esm/src/clientDefinitions.js.map +1 -0
- package/dist-esm/src/deviceUpdate.js +11 -3
- package/dist-esm/src/deviceUpdate.js.map +1 -1
- package/dist-esm/src/index.js +2 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/isUnexpected.js +158 -0
- package/dist-esm/src/isUnexpected.js.map +1 -0
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/outputModels.js.map +1 -1
- package/dist-esm/src/paginateHelper.js.map +1 -1
- package/dist-esm/src/parameters.js.map +1 -1
- package/dist-esm/src/pollingHelper.js +3 -1
- package/dist-esm/src/pollingHelper.js.map +1 -1
- package/dist-esm/src/responses.js.map +1 -1
- package/package.json +16 -17
- package/review/iot-device-update.api.md +2190 -0
- package/types/iot-device-update.d.ts +2090 -0
- package/types/iot-device-update-rest.d.ts +0 -1665
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceUpdate.js","sourceRoot":"","sources":["../../src/deviceUpdate.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAqIlC,OAAO,EAAyB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA0gB3E,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,WAAW,QAAQ,EAAE,CAAC;IACzD,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,oBAAoB,CAAC;IAChE,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,wCAAwC,CAAC;SACnD,GACF,CAAC;IAEF,OAAO,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAA2B,CAAC;AAC5E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DeviceManagementCollectLogsParameters,\n DeviceManagementCreateOrUpdateDeploymentParameters,\n DeviceManagementCreateOrUpdateGroupParameters,\n DeviceManagementDeleteDeploymentParameters,\n DeviceManagementDeleteGroupParameters,\n DeviceManagementGetDeploymentParameters,\n DeviceManagementGetDeploymentStatusParameters,\n DeviceManagementGetDeviceClassParameters,\n DeviceManagementGetDeviceModuleParameters,\n DeviceManagementGetDeviceParameters,\n DeviceManagementGetDeviceTagParameters,\n DeviceManagementGetGroupParameters,\n DeviceManagementGetGroupUpdateComplianceParameters,\n DeviceManagementGetLogCollectionOperationDetailedStatusParameters,\n DeviceManagementGetLogCollectionOperationParameters,\n DeviceManagementGetOperationParameters,\n DeviceManagementGetUpdateComplianceParameters,\n DeviceManagementImportDevicesParameters,\n DeviceManagementListBestUpdatesForGroupParameters,\n DeviceManagementListDeploymentDevicesParameters,\n DeviceManagementListDeploymentsForGroupParameters,\n DeviceManagementListDeviceClassesParameters,\n DeviceManagementListDeviceTagsParameters,\n DeviceManagementListDevicesParameters,\n DeviceManagementListGroupsParameters,\n DeviceManagementListInstallableUpdatesForDeviceClassParameters,\n DeviceManagementListLogCollectionOperationsParameters,\n DeviceManagementListOperationsParameters,\n DeviceManagementRetryDeploymentParameters,\n DeviceManagementStopDeploymentParameters,\n DeviceUpdateDeleteUpdateParameters,\n DeviceUpdateGetFileParameters,\n DeviceUpdateGetOperationParameters,\n DeviceUpdateGetUpdateParameters,\n DeviceUpdateImportUpdateParameters,\n DeviceUpdateListFilesParameters,\n DeviceUpdateListNamesParameters,\n DeviceUpdateListOperationsParameters,\n DeviceUpdateListProvidersParameters,\n DeviceUpdateListUpdatesParameters,\n DeviceUpdateListVersionsParameters,\n} from \"./parameters\";\nimport {\n DeviceManagementCollectLogs201Response,\n DeviceManagementCollectLogsdefaultResponse,\n DeviceManagementCreateOrUpdateDeployment200Response,\n DeviceManagementCreateOrUpdateDeploymentdefaultResponse,\n DeviceManagementCreateOrUpdateGroup200Response,\n DeviceManagementCreateOrUpdateGroupdefaultResponse,\n DeviceManagementDeleteDeployment204Response,\n DeviceManagementDeleteDeploymentdefaultResponse,\n DeviceManagementDeleteGroup204Response,\n DeviceManagementDeleteGroupdefaultResponse,\n DeviceManagementGetDeployment200Response,\n DeviceManagementGetDeploymentStatus200Response,\n DeviceManagementGetDeploymentStatusdefaultResponse,\n DeviceManagementGetDeploymentdefaultResponse,\n DeviceManagementGetDevice200Response,\n DeviceManagementGetDeviceClass200Response,\n DeviceManagementGetDeviceClassdefaultResponse,\n DeviceManagementGetDeviceModule200Response,\n DeviceManagementGetDeviceModuledefaultResponse,\n DeviceManagementGetDeviceTag200Response,\n DeviceManagementGetDeviceTagdefaultResponse,\n DeviceManagementGetDevicedefaultResponse,\n DeviceManagementGetGroup200Response,\n DeviceManagementGetGroupUpdateCompliance200Response,\n DeviceManagementGetGroupUpdateCompliancedefaultResponse,\n DeviceManagementGetGroupdefaultResponse,\n DeviceManagementGetLogCollectionOperation200Response,\n DeviceManagementGetLogCollectionOperationDetailedStatus200Response,\n DeviceManagementGetLogCollectionOperationDetailedStatusdefaultResponse,\n DeviceManagementGetLogCollectionOperationdefaultResponse,\n DeviceManagementGetOperation200Response,\n DeviceManagementGetOperation304Response,\n DeviceManagementGetOperationdefaultResponse,\n DeviceManagementGetUpdateCompliance200Response,\n DeviceManagementGetUpdateCompliancedefaultResponse,\n DeviceManagementImportDevices202Response,\n DeviceManagementImportDevicesdefaultResponse,\n DeviceManagementListBestUpdatesForGroup200Response,\n DeviceManagementListBestUpdatesForGroupdefaultResponse,\n DeviceManagementListDeploymentDevices200Response,\n DeviceManagementListDeploymentDevicesdefaultResponse,\n DeviceManagementListDeploymentsForGroup200Response,\n DeviceManagementListDeploymentsForGroupdefaultResponse,\n DeviceManagementListDeviceClasses200Response,\n DeviceManagementListDeviceClassesdefaultResponse,\n DeviceManagementListDeviceTags200Response,\n DeviceManagementListDeviceTagsdefaultResponse,\n DeviceManagementListDevices200Response,\n DeviceManagementListDevicesdefaultResponse,\n DeviceManagementListGroups200Response,\n DeviceManagementListGroupsdefaultResponse,\n DeviceManagementListInstallableUpdatesForDeviceClass200Response,\n DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse,\n DeviceManagementListLogCollectionOperations200Response,\n DeviceManagementListLogCollectionOperationsdefaultResponse,\n DeviceManagementListOperations200Response,\n DeviceManagementListOperationsdefaultResponse,\n DeviceManagementRetryDeployment200Response,\n DeviceManagementRetryDeploymentdefaultResponse,\n DeviceManagementStopDeployment200Response,\n DeviceManagementStopDeploymentdefaultResponse,\n DeviceUpdateDeleteUpdate202Response,\n DeviceUpdateDeleteUpdatedefaultResponse,\n DeviceUpdateGetFile200Response,\n DeviceUpdateGetFile304Response,\n DeviceUpdateGetFiledefaultResponse,\n DeviceUpdateGetOperation200Response,\n DeviceUpdateGetOperation304Response,\n DeviceUpdateGetOperationdefaultResponse,\n DeviceUpdateGetUpdate200Response,\n DeviceUpdateGetUpdate304Response,\n DeviceUpdateGetUpdatedefaultResponse,\n DeviceUpdateImportUpdate202Response,\n DeviceUpdateImportUpdatedefaultResponse,\n DeviceUpdateListFiles200Response,\n DeviceUpdateListFilesdefaultResponse,\n DeviceUpdateListNames200Response,\n DeviceUpdateListNamesdefaultResponse,\n DeviceUpdateListOperations200Response,\n DeviceUpdateListOperationsdefaultResponse,\n DeviceUpdateListProviders200Response,\n DeviceUpdateListProvidersdefaultResponse,\n DeviceUpdateListUpdates200Response,\n DeviceUpdateListUpdatesdefaultResponse,\n DeviceUpdateListVersions200Response,\n DeviceUpdateListVersionsdefaultResponse,\n} from \"./responses\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface DeviceUpdateImportUpdate {\n /** Import new update version. */\n post(\n options: DeviceUpdateImportUpdateParameters\n ): Promise<DeviceUpdateImportUpdate202Response | DeviceUpdateImportUpdatedefaultResponse>;\n /** Get a list of all updates that have been imported to Device Update for IoT Hub. */\n get(\n options?: DeviceUpdateListUpdatesParameters\n ): Promise<DeviceUpdateListUpdates200Response | DeviceUpdateListUpdatesdefaultResponse>;\n}\n\nexport interface DeviceUpdateGetUpdate {\n /** Get a specific update version. */\n get(\n options?: DeviceUpdateGetUpdateParameters\n ): Promise<\n | DeviceUpdateGetUpdate200Response\n | DeviceUpdateGetUpdate304Response\n | DeviceUpdateGetUpdatedefaultResponse\n >;\n /** Delete a specific update version. */\n delete(\n options?: DeviceUpdateDeleteUpdateParameters\n ): Promise<DeviceUpdateDeleteUpdate202Response | DeviceUpdateDeleteUpdatedefaultResponse>;\n}\n\nexport interface DeviceUpdateListProviders {\n /** Get a list of all update providers that have been imported to Device Update for IoT Hub. */\n get(\n options?: DeviceUpdateListProvidersParameters\n ): Promise<DeviceUpdateListProviders200Response | DeviceUpdateListProvidersdefaultResponse>;\n}\n\nexport interface DeviceUpdateListNames {\n /** Get a list of all update names that match the specified provider. */\n get(\n options?: DeviceUpdateListNamesParameters\n ): Promise<DeviceUpdateListNames200Response | DeviceUpdateListNamesdefaultResponse>;\n}\n\nexport interface DeviceUpdateListVersions {\n /** Get a list of all update versions that match the specified provider and name. */\n get(\n options?: DeviceUpdateListVersionsParameters\n ): Promise<DeviceUpdateListVersions200Response | DeviceUpdateListVersionsdefaultResponse>;\n}\n\nexport interface DeviceUpdateListFiles {\n /** Get a list of all update file identifiers for the specified version. */\n get(\n options?: DeviceUpdateListFilesParameters\n ): Promise<DeviceUpdateListFiles200Response | DeviceUpdateListFilesdefaultResponse>;\n}\n\nexport interface DeviceUpdateGetFile {\n /** Get a specific update file from the version. */\n get(\n options?: DeviceUpdateGetFileParameters\n ): Promise<\n | DeviceUpdateGetFile200Response\n | DeviceUpdateGetFile304Response\n | DeviceUpdateGetFiledefaultResponse\n >;\n}\n\nexport interface DeviceUpdateListOperations {\n /** Get a list of all import update operations. Completed operations are kept for 7 days before auto-deleted. Delete operations are not returned by this API version. */\n get(\n options?: DeviceUpdateListOperationsParameters\n ): Promise<DeviceUpdateListOperations200Response | DeviceUpdateListOperationsdefaultResponse>;\n}\n\nexport interface DeviceUpdateGetOperation {\n /** Retrieve operation status. */\n get(\n options?: DeviceUpdateGetOperationParameters\n ): Promise<\n | DeviceUpdateGetOperation200Response\n | DeviceUpdateGetOperation304Response\n | DeviceUpdateGetOperationdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeviceClasses {\n /** Gets a list of all device classes (unique combinations of device manufacturer and model) for all devices connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementListDeviceClassesParameters\n ): Promise<\n DeviceManagementListDeviceClasses200Response | DeviceManagementListDeviceClassesdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeviceClass {\n /** Gets the properties of a device class. */\n get(\n options?: DeviceManagementGetDeviceClassParameters\n ): Promise<\n DeviceManagementGetDeviceClass200Response | DeviceManagementGetDeviceClassdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListInstallableUpdatesForDeviceClass {\n /** Gets a list of installable updates for a device class. */\n get(\n options?: DeviceManagementListInstallableUpdatesForDeviceClassParameters\n ): Promise<\n | DeviceManagementListInstallableUpdatesForDeviceClass200Response\n | DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDevices {\n /** Gets a list of devices connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementListDevicesParameters\n ): Promise<DeviceManagementListDevices200Response | DeviceManagementListDevicesdefaultResponse>;\n /** Import existing devices from IoT Hub. */\n post(\n options: DeviceManagementImportDevicesParameters\n ): Promise<\n DeviceManagementImportDevices202Response | DeviceManagementImportDevicesdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDevice {\n /** Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementGetDeviceParameters\n ): Promise<DeviceManagementGetDevice200Response | DeviceManagementGetDevicedefaultResponse>;\n}\n\nexport interface DeviceManagementGetDeviceModule {\n /** Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementGetDeviceModuleParameters\n ): Promise<\n DeviceManagementGetDeviceModule200Response | DeviceManagementGetDeviceModuledefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetUpdateCompliance {\n /** Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates. */\n get(\n options?: DeviceManagementGetUpdateComplianceParameters\n ): Promise<\n | DeviceManagementGetUpdateCompliance200Response\n | DeviceManagementGetUpdateCompliancedefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeviceTags {\n /** Gets a list of available group device tags for all devices connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementListDeviceTagsParameters\n ): Promise<\n DeviceManagementListDeviceTags200Response | DeviceManagementListDeviceTagsdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeviceTag {\n /** Gets a count of how many devices have a device tag. */\n get(\n options?: DeviceManagementGetDeviceTagParameters\n ): Promise<DeviceManagementGetDeviceTag200Response | DeviceManagementGetDeviceTagdefaultResponse>;\n}\n\nexport interface DeviceManagementListGroups {\n /** Gets a list of all device groups. */\n get(\n options?: DeviceManagementListGroupsParameters\n ): Promise<DeviceManagementListGroups200Response | DeviceManagementListGroupsdefaultResponse>;\n}\n\nexport interface DeviceManagementGetGroup {\n /** Gets the properties of a group. */\n get(\n options?: DeviceManagementGetGroupParameters\n ): Promise<DeviceManagementGetGroup200Response | DeviceManagementGetGroupdefaultResponse>;\n /** Create or update a device group. */\n put(\n options: DeviceManagementCreateOrUpdateGroupParameters\n ): Promise<\n | DeviceManagementCreateOrUpdateGroup200Response\n | DeviceManagementCreateOrUpdateGroupdefaultResponse\n >;\n /** Deletes a device group. */\n delete(\n options?: DeviceManagementDeleteGroupParameters\n ): Promise<DeviceManagementDeleteGroup204Response | DeviceManagementDeleteGroupdefaultResponse>;\n}\n\nexport interface DeviceManagementGetGroupUpdateCompliance {\n /** Get group update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update. */\n get(\n options?: DeviceManagementGetGroupUpdateComplianceParameters\n ): Promise<\n | DeviceManagementGetGroupUpdateCompliance200Response\n | DeviceManagementGetGroupUpdateCompliancedefaultResponse\n >;\n}\n\nexport interface DeviceManagementListBestUpdatesForGroup {\n /** Get the best available updates for a group and a count of how many devices need each update. */\n get(\n options?: DeviceManagementListBestUpdatesForGroupParameters\n ): Promise<\n | DeviceManagementListBestUpdatesForGroup200Response\n | DeviceManagementListBestUpdatesForGroupdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeploymentsForGroup {\n /** Gets a list of deployments for a group. */\n get(\n options?: DeviceManagementListDeploymentsForGroupParameters\n ): Promise<\n | DeviceManagementListDeploymentsForGroup200Response\n | DeviceManagementListDeploymentsForGroupdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeployment {\n /** Gets the properties of a deployment. */\n get(\n options?: DeviceManagementGetDeploymentParameters\n ): Promise<\n DeviceManagementGetDeployment200Response | DeviceManagementGetDeploymentdefaultResponse\n >;\n /** Creates or updates a deployment. */\n put(\n options: DeviceManagementCreateOrUpdateDeploymentParameters\n ): Promise<\n | DeviceManagementCreateOrUpdateDeployment200Response\n | DeviceManagementCreateOrUpdateDeploymentdefaultResponse\n >;\n /** Deletes a deployment. */\n delete(\n options?: DeviceManagementDeleteDeploymentParameters\n ): Promise<\n DeviceManagementDeleteDeployment204Response | DeviceManagementDeleteDeploymentdefaultResponse\n >;\n /** Stops a deployment. */\n post(\n options: DeviceManagementStopDeploymentParameters | DeviceManagementRetryDeploymentParameters\n ):\n | Promise<\n DeviceManagementStopDeployment200Response | DeviceManagementStopDeploymentdefaultResponse\n >\n | Promise<\n DeviceManagementRetryDeployment200Response | DeviceManagementRetryDeploymentdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeploymentStatus {\n /** Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed. */\n get(\n options?: DeviceManagementGetDeploymentStatusParameters\n ): Promise<\n | DeviceManagementGetDeploymentStatus200Response\n | DeviceManagementGetDeploymentStatusdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeploymentDevices {\n /** Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. */\n get(\n options?: DeviceManagementListDeploymentDevicesParameters\n ): Promise<\n | DeviceManagementListDeploymentDevices200Response\n | DeviceManagementListDeploymentDevicesdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetOperation {\n /** Retrieve operation status. */\n get(\n options?: DeviceManagementGetOperationParameters\n ): Promise<\n | DeviceManagementGetOperation200Response\n | DeviceManagementGetOperation304Response\n | DeviceManagementGetOperationdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListOperations {\n /** Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. */\n get(\n options?: DeviceManagementListOperationsParameters\n ): Promise<\n DeviceManagementListOperations200Response | DeviceManagementListOperationsdefaultResponse\n >;\n}\n\nexport interface DeviceManagementCollectLogs {\n /** Start the device diagnostics log collection operation on specified devices. */\n put(\n options: DeviceManagementCollectLogsParameters\n ): Promise<DeviceManagementCollectLogs201Response | DeviceManagementCollectLogsdefaultResponse>;\n /** Get the device diagnostics log collection operation */\n get(\n options?: DeviceManagementGetLogCollectionOperationParameters\n ): Promise<\n | DeviceManagementGetLogCollectionOperation200Response\n | DeviceManagementGetLogCollectionOperationdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListLogCollectionOperations {\n /** Get all device diagnostics log collection operations */\n get(\n options?: DeviceManagementListLogCollectionOperationsParameters\n ): Promise<\n | DeviceManagementListLogCollectionOperations200Response\n | DeviceManagementListLogCollectionOperationsdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetLogCollectionOperationDetailedStatus {\n /** Get device diagnostics log collection operation with detailed status */\n get(\n options?: DeviceManagementGetLogCollectionOperationDetailedStatusParameters\n ): Promise<\n | DeviceManagementGetLogCollectionOperationDetailedStatus200Response\n | DeviceManagementGetLogCollectionOperationDetailedStatusdefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates' has methods for the following verbs: post, get */\n (path: \"/deviceupdate/{instanceId}/updates\", instanceId: string): DeviceUpdateImportUpdate;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions/\\{version\\}' has methods for the following verbs: get, delete */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}\",\n instanceId: string,\n provider: string,\n name: string,\n version: string\n ): DeviceUpdateGetUpdate;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers\",\n instanceId: string\n ): DeviceUpdateListProviders;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names\",\n instanceId: string,\n provider: string\n ): DeviceUpdateListNames;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions\",\n instanceId: string,\n provider: string,\n name: string\n ): DeviceUpdateListVersions;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions/\\{version\\}/files' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files\",\n instanceId: string,\n provider: string,\n name: string,\n version: string\n ): DeviceUpdateListFiles;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions/\\{version\\}/files/\\{fileId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}\",\n instanceId: string,\n provider: string,\n name: string,\n version: string,\n fileId: string\n ): DeviceUpdateGetFile;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/operations' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/operations\",\n instanceId: string\n ): DeviceUpdateListOperations;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/operations/\\{operationId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/operations/{operationId}\",\n instanceId: string,\n operationId: string\n ): DeviceUpdateGetOperation;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceclasses' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceclasses\",\n instanceId: string\n ): DeviceManagementListDeviceClasses;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceclasses/\\{deviceClassId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceclasses/{deviceClassId}\",\n instanceId: string,\n deviceClassId: string\n ): DeviceManagementGetDeviceClass;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceclasses/\\{deviceClassId\\}/installableupdates' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceclasses/{deviceClassId}/installableupdates\",\n instanceId: string,\n deviceClassId: string\n ): DeviceManagementListInstallableUpdatesForDeviceClass;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devices' has methods for the following verbs: get, post */\n (\n path: \"/deviceupdate/{instanceId}/management/devices\",\n instanceId: string\n ): DeviceManagementListDevices;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devices/\\{deviceId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devices/{deviceId}\",\n instanceId: string,\n deviceId: string\n ): DeviceManagementGetDevice;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devices/\\{deviceId\\}/modules/\\{moduleId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}\",\n instanceId: string,\n deviceId: string,\n moduleId: string\n ): DeviceManagementGetDeviceModule;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/updatecompliance' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/updatecompliance\",\n instanceId: string\n ): DeviceManagementGetUpdateCompliance;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devicetags' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devicetags\",\n instanceId: string\n ): DeviceManagementListDeviceTags;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devicetags/\\{tagName\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devicetags/{tagName}\",\n instanceId: string,\n tagName: string\n ): DeviceManagementGetDeviceTag;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups\",\n instanceId: string\n ): DeviceManagementListGroups;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}' has methods for the following verbs: get, put, delete */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}\",\n instanceId: string,\n groupId: string\n ): DeviceManagementGetGroup;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/updateCompliance' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/updateCompliance\",\n instanceId: string,\n groupId: string\n ): DeviceManagementGetGroupUpdateCompliance;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/bestUpdates' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/bestUpdates\",\n instanceId: string,\n groupId: string\n ): DeviceManagementListBestUpdatesForGroup;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments\",\n instanceId: string,\n groupId: string\n ): DeviceManagementListDeploymentsForGroup;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments/\\{deploymentId\\}' has methods for the following verbs: get, put, delete, post */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}\",\n instanceId: string,\n groupId: string,\n deploymentId: string\n ): DeviceManagementGetDeployment;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments/\\{deploymentId\\}/status' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status\",\n instanceId: string,\n groupId: string,\n deploymentId: string\n ): DeviceManagementGetDeploymentStatus;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments/\\{deploymentId\\}/devicestates' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/devicestates\",\n instanceId: string,\n groupId: string,\n deploymentId: string\n ): DeviceManagementListDeploymentDevices;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/operations/\\{operationId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/operations/{operationId}\",\n instanceId: string,\n operationId: string\n ): DeviceManagementGetOperation;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/operations' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/operations\",\n instanceId: string\n ): DeviceManagementListOperations;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceDiagnostics/logCollections/\\{operationId\\}' has methods for the following verbs: put, get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}\",\n instanceId: string,\n operationId: string\n ): DeviceManagementCollectLogs;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceDiagnostics/logCollections' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceDiagnostics/logCollections\",\n instanceId: string\n ): DeviceManagementListLogCollectionOperations;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceDiagnostics/logCollections/\\{operationId\\}/detailedStatus' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus\",\n instanceId: string,\n operationId: string\n ): DeviceManagementGetLogCollectionOperationDetailedStatus;\n}\n\nexport type DeviceUpdateRestClient = Client & {\n path: Routes;\n};\n\nexport default function DeviceUpdate(\n endpoint: string,\n credentials: TokenCredential,\n options: ClientOptions = {}\n): DeviceUpdateRestClient {\n const baseUrl = options.baseUrl ?? `https://${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"2021-06-01-preview\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://api.adu.microsoft.com/.default\"],\n },\n };\n\n return getClient(baseUrl, credentials, options) as DeviceUpdateRestClient;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"deviceUpdate.js","sourceRoot":"","sources":["../../src/deviceUpdate.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AAInE,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,QAAgB,EAChB,WAA4B,EAC5B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,WAAW,QAAQ,EAAE,CAAC;IACzD,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,oBAAoB,CAAC;IAChE,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,wCAAwC,CAAC;SACnD,GACF,CAAC;IAEF,MAAM,aAAa,GAAG,8CAA8C,CAAC;IACrE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAuB,CAAC;IAE9E,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { DeviceUpdateClient } from \"./clientDefinitions\";\n\nexport default function createClient(\n endpoint: string,\n credentials: TokenCredential,\n options: ClientOptions = {}\n): DeviceUpdateClient {\n const baseUrl = options.baseUrl ?? `https://${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"2022-07-01-preview\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://api.adu.microsoft.com/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-iot-device-update-rest/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as DeviceUpdateClient;\n\n return client;\n}\n"]}
|
package/dist-esm/src/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import DeviceUpdate from "./deviceUpdate";
|
|
|
4
4
|
export * from "./deviceUpdate";
|
|
5
5
|
export * from "./parameters";
|
|
6
6
|
export * from "./responses";
|
|
7
|
+
export * from "./clientDefinitions";
|
|
8
|
+
export * from "./isUnexpected";
|
|
7
9
|
export * from "./models";
|
|
8
10
|
export * from "./outputModels";
|
|
9
11
|
export * from "./paginateHelper";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAEhC,eAAe,YAAY,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport DeviceUpdate from \"./deviceUpdate\";\n\nexport * from \"./deviceUpdate\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\nexport * from \"./pollingHelper\";\n\nexport default DeviceUpdate;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAEhC,eAAe,YAAY,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport DeviceUpdate from \"./deviceUpdate\";\n\nexport * from \"./deviceUpdate\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\nexport * from \"./pollingHelper\";\n\nexport default DeviceUpdate;\n"]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
const responseMap = {
|
|
4
|
+
"GET /deviceUpdate/{instanceId}/updates": ["200"],
|
|
5
|
+
"POST /deviceUpdate/{instanceId}/updates:import": ["202"],
|
|
6
|
+
"GET /deviceUpdate/{instanceId}/updates:import": ["202"],
|
|
7
|
+
"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}": [
|
|
8
|
+
"200",
|
|
9
|
+
"304",
|
|
10
|
+
],
|
|
11
|
+
"DELETE /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}": [
|
|
12
|
+
"202",
|
|
13
|
+
],
|
|
14
|
+
"GET /deviceUpdate/{instanceId}/updates/providers": ["200"],
|
|
15
|
+
"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names": ["200"],
|
|
16
|
+
"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions": ["200"],
|
|
17
|
+
"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files": [
|
|
18
|
+
"200",
|
|
19
|
+
],
|
|
20
|
+
"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}": [
|
|
21
|
+
"200",
|
|
22
|
+
"304",
|
|
23
|
+
],
|
|
24
|
+
"GET /deviceUpdate/{instanceId}/updates/operations": ["200"],
|
|
25
|
+
"GET /deviceUpdate/{instanceId}/updates/operations/{operationId}": ["200", "304"],
|
|
26
|
+
"GET /deviceUpdate/{instanceId}/management/deviceClasses": ["200"],
|
|
27
|
+
"GET /deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}": ["200"],
|
|
28
|
+
"PATCH /deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}": ["200"],
|
|
29
|
+
"DELETE /deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}": ["204"],
|
|
30
|
+
"GET /deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates": [
|
|
31
|
+
"200",
|
|
32
|
+
],
|
|
33
|
+
"GET /deviceUpdate/{instanceId}/management/devices": ["200"],
|
|
34
|
+
"POST /deviceUpdate/{instanceId}/management/devices:import": ["202"],
|
|
35
|
+
"GET /deviceUpdate/{instanceId}/management/devices:import": ["202"],
|
|
36
|
+
"GET /deviceUpdate/{instanceId}/management/devices/{deviceId}": ["200"],
|
|
37
|
+
"GET /deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}": ["200"],
|
|
38
|
+
"GET /deviceUpdate/{instanceId}/management/updateCompliance": ["200"],
|
|
39
|
+
"GET /deviceUpdate/{instanceId}/management/groups": ["200"],
|
|
40
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}": ["200"],
|
|
41
|
+
"DELETE /deviceUpdate/{instanceId}/management/groups/{groupId}": ["204"],
|
|
42
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance": ["200"],
|
|
43
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates": ["200"],
|
|
44
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments": ["200"],
|
|
45
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}": ["200"],
|
|
46
|
+
"PUT /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}": ["200"],
|
|
47
|
+
"DELETE /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}": [
|
|
48
|
+
"204",
|
|
49
|
+
],
|
|
50
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status": [
|
|
51
|
+
"200",
|
|
52
|
+
],
|
|
53
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups": ["200"],
|
|
54
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}": [
|
|
55
|
+
"200",
|
|
56
|
+
],
|
|
57
|
+
"DELETE /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}": [
|
|
58
|
+
"204",
|
|
59
|
+
],
|
|
60
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/updateCompliance": [
|
|
61
|
+
"200",
|
|
62
|
+
],
|
|
63
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/bestUpdates": [
|
|
64
|
+
"200",
|
|
65
|
+
],
|
|
66
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments": [
|
|
67
|
+
"200",
|
|
68
|
+
],
|
|
69
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}": [
|
|
70
|
+
"200",
|
|
71
|
+
],
|
|
72
|
+
"DELETE /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}": [
|
|
73
|
+
"204",
|
|
74
|
+
],
|
|
75
|
+
"POST /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:cancel": [
|
|
76
|
+
"200",
|
|
77
|
+
],
|
|
78
|
+
"POST /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:retry": [
|
|
79
|
+
"200",
|
|
80
|
+
],
|
|
81
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/status": [
|
|
82
|
+
"200",
|
|
83
|
+
],
|
|
84
|
+
"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/devicestates": [
|
|
85
|
+
"200",
|
|
86
|
+
],
|
|
87
|
+
"GET /deviceUpdate/{instanceId}/management/operations/{operationId}": ["200", "304"],
|
|
88
|
+
"GET /deviceUpdate/{instanceId}/management/operations": ["200"],
|
|
89
|
+
"PUT /deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}": [
|
|
90
|
+
"201",
|
|
91
|
+
],
|
|
92
|
+
"GET /deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}": [
|
|
93
|
+
"200",
|
|
94
|
+
],
|
|
95
|
+
"GET /deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections": ["200"],
|
|
96
|
+
"GET /deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus": [
|
|
97
|
+
"200",
|
|
98
|
+
],
|
|
99
|
+
"GET /deviceUpdate/{instanceId}/management/deviceDiagnostics/deviceHealth": ["200"],
|
|
100
|
+
};
|
|
101
|
+
export function isUnexpected(response) {
|
|
102
|
+
const lroOriginal = response.headers["x-ms-original-url"];
|
|
103
|
+
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
104
|
+
const method = response.request.method;
|
|
105
|
+
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
106
|
+
if (!pathDetails) {
|
|
107
|
+
pathDetails = geParametrizedPathSuccess(url.pathname);
|
|
108
|
+
}
|
|
109
|
+
return !pathDetails.includes(response.status);
|
|
110
|
+
}
|
|
111
|
+
function geParametrizedPathSuccess(path) {
|
|
112
|
+
const pathParts = path.split("/");
|
|
113
|
+
// Iterate the responseMap to find a match
|
|
114
|
+
for (const [key, value] of Object.entries(responseMap)) {
|
|
115
|
+
// Extracting the path from the map key which is in format
|
|
116
|
+
// GET /path/foo
|
|
117
|
+
const candidatePath = getPathFromMapKey(key);
|
|
118
|
+
// Get each part of the url path
|
|
119
|
+
const candidateParts = candidatePath.split("/");
|
|
120
|
+
// If the candidate and actual paths don't match in size
|
|
121
|
+
// we move on to the next candidate path
|
|
122
|
+
if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {
|
|
123
|
+
// track if we have found a match to return the values found.
|
|
124
|
+
let found = true;
|
|
125
|
+
for (let i = 0; i < candidateParts.length; i++) {
|
|
126
|
+
if (candidateParts[i].startsWith("{") && candidateParts[i].endsWith("}")) {
|
|
127
|
+
// If the current part of the candidate is a "template" part
|
|
128
|
+
// it is a match with the actual path part on hand
|
|
129
|
+
// skip as the parameterized part can match anything
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
// If the candidate part is not a template and
|
|
133
|
+
// the parts don't match mark the candidate as not found
|
|
134
|
+
// to move on with the next candidate path.
|
|
135
|
+
if (candidateParts[i] !== pathParts[i]) {
|
|
136
|
+
found = false;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// We finished evaluating the current candidate parts
|
|
141
|
+
// if all parts matched we return the success values form
|
|
142
|
+
// the path mapping.
|
|
143
|
+
if (found) {
|
|
144
|
+
return value;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// No match was found, return an empty array.
|
|
149
|
+
return [];
|
|
150
|
+
}
|
|
151
|
+
function hasParametrizedPath(path) {
|
|
152
|
+
return path.includes("/{");
|
|
153
|
+
}
|
|
154
|
+
function getPathFromMapKey(mapKey) {
|
|
155
|
+
const pathStart = mapKey.indexOf("/");
|
|
156
|
+
return mapKey.slice(pathStart);
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=isUnexpected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA6GlC,MAAM,WAAW,GAA6B;IAC5C,wCAAwC,EAAE,CAAC,KAAK,CAAC;IACjD,gDAAgD,EAAE,CAAC,KAAK,CAAC;IACzD,+CAA+C,EAAE,CAAC,KAAK,CAAC;IACxD,6FAA6F,EAAE;QAC7F,KAAK;QACL,KAAK;KACN;IACD,gGAAgG,EAAE;QAChG,KAAK;KACN;IACD,kDAAkD,EAAE,CAAC,KAAK,CAAC;IAC3D,mEAAmE,EAAE,CAAC,KAAK,CAAC;IAC5E,mFAAmF,EAAE,CAAC,KAAK,CAAC;IAC5F,mGAAmG,EAAE;QACnG,KAAK;KACN;IACD,4GAA4G,EAAE;QAC5G,KAAK;QACL,KAAK;KACN;IACD,mDAAmD,EAAE,CAAC,KAAK,CAAC;IAC5D,iEAAiE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACjF,yDAAyD,EAAE,CAAC,KAAK,CAAC;IAClE,yEAAyE,EAAE,CAAC,KAAK,CAAC;IAClF,2EAA2E,EAAE,CAAC,KAAK,CAAC;IACpF,4EAA4E,EAAE,CAAC,KAAK,CAAC;IACrF,4FAA4F,EAAE;QAC5F,KAAK;KACN;IACD,mDAAmD,EAAE,CAAC,KAAK,CAAC;IAC5D,2DAA2D,EAAE,CAAC,KAAK,CAAC;IACpE,0DAA0D,EAAE,CAAC,KAAK,CAAC;IACnE,8DAA8D,EAAE,CAAC,KAAK,CAAC;IACvE,iFAAiF,EAAE,CAAC,KAAK,CAAC;IAC1F,4DAA4D,EAAE,CAAC,KAAK,CAAC;IACrE,kDAAkD,EAAE,CAAC,KAAK,CAAC;IAC3D,4DAA4D,EAAE,CAAC,KAAK,CAAC;IACrE,+DAA+D,EAAE,CAAC,KAAK,CAAC;IACxE,6EAA6E,EAAE,CAAC,KAAK,CAAC;IACtF,wEAAwE,EAAE,CAAC,KAAK,CAAC;IACjF,wEAAwE,EAAE,CAAC,KAAK,CAAC;IACjF,uFAAuF,EAAE,CAAC,KAAK,CAAC;IAChG,uFAAuF,EAAE,CAAC,KAAK,CAAC;IAChG,0FAA0F,EAAE;QAC1F,KAAK;KACN;IACD,8FAA8F,EAAE;QAC9F,KAAK;KACN;IACD,iFAAiF,EAAE,CAAC,KAAK,CAAC;IAC1F,iGAAiG,EAAE;QACjG,KAAK;KACN;IACD,oGAAoG,EAAE;QACpG,KAAK;KACN;IACD,kHAAkH,EAAE;QAClH,KAAK;KACN;IACD,6GAA6G,EAAE;QAC7G,KAAK;KACN;IACD,6GAA6G,EAAE;QAC7G,KAAK;KACN;IACD,4HAA4H,EAAE;QAC5H,KAAK;KACN;IACD,+HAA+H,EAAE;QAC/H,KAAK;KACN;IACD,oIAAoI,EAAE;QACpI,KAAK;KACN;IACD,mIAAmI,EAAE;QACnI,KAAK;KACN;IACD,mIAAmI,EAAE;QACnI,KAAK;KACN;IACD,yIAAyI,EAAE;QACzI,KAAK;KACN;IACD,oEAAoE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACpF,sDAAsD,EAAE,CAAC,KAAK,CAAC;IAC/D,0FAA0F,EAAE;QAC1F,KAAK;KACN;IACD,0FAA0F,EAAE;QAC1F,KAAK;KACN;IACD,4EAA4E,EAAE,CAAC,KAAK,CAAC;IACrF,yGAAyG,EAAE;QACzG,KAAK;KACN;IACD,0EAA0E,EAAE,CAAC,KAAK,CAAC;CACpF,CAAC;AAkOF,MAAM,UAAU,YAAY,CAC1B,QAwGmD;IAoDnD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;IACvC,IAAI,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3D,IAAI,CAAC,WAAW,EAAE;QAChB,WAAW,GAAG,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;KACvD;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,yBAAyB,CAAC,IAAY;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,0CAA0C;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACtD,0DAA0D;QAC1D,gBAAgB;QAChB,MAAM,aAAa,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAC7C,gCAAgC;QAChC,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhD,wDAAwD;QACxD,wCAAwC;QACxC,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE;YAC1E,6DAA6D;YAC7D,IAAI,KAAK,GAAG,IAAI,CAAC;YACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBACxE,4DAA4D;oBAC5D,kDAAkD;oBAClD,oDAAoD;oBACpD,SAAS;iBACV;gBAED,8CAA8C;gBAC9C,wDAAwD;gBACxD,2CAA2C;gBAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;oBACtC,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;aACF;YAED,qDAAqD;YACrD,yDAAyD;YACzD,oBAAoB;YACpB,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,6CAA6C;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7B,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 {\n DeviceUpdateListUpdates200Response,\n DeviceUpdateListUpdatesdefaultResponse,\n DeviceUpdateImportUpdate202Response,\n DeviceUpdateImportUpdatedefaultResponse,\n DeviceUpdateGetUpdate200Response,\n DeviceUpdateGetUpdate304Response,\n DeviceUpdateGetUpdatedefaultResponse,\n DeviceUpdateDeleteUpdate202Response,\n DeviceUpdateDeleteUpdatedefaultResponse,\n DeviceUpdateListProviders200Response,\n DeviceUpdateListProvidersdefaultResponse,\n DeviceUpdateListNames200Response,\n DeviceUpdateListNamesdefaultResponse,\n DeviceUpdateListVersions200Response,\n DeviceUpdateListVersionsdefaultResponse,\n DeviceUpdateListFiles200Response,\n DeviceUpdateListFilesdefaultResponse,\n DeviceUpdateGetFile200Response,\n DeviceUpdateGetFile304Response,\n DeviceUpdateGetFiledefaultResponse,\n DeviceUpdateListOperations200Response,\n DeviceUpdateListOperationsdefaultResponse,\n DeviceUpdateGetOperation200Response,\n DeviceUpdateGetOperation304Response,\n DeviceUpdateGetOperationdefaultResponse,\n DeviceManagementListDeviceClasses200Response,\n DeviceManagementListDeviceClassesdefaultResponse,\n DeviceManagementGetDeviceClass200Response,\n DeviceManagementGetDeviceClassdefaultResponse,\n DeviceManagementUpdateDeviceClass200Response,\n DeviceManagementUpdateDeviceClassdefaultResponse,\n DeviceManagementDeleteDeviceClass204Response,\n DeviceManagementDeleteDeviceClassdefaultResponse,\n DeviceManagementListInstallableUpdatesForDeviceClass200Response,\n DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse,\n DeviceManagementListDevices200Response,\n DeviceManagementListDevicesdefaultResponse,\n DeviceManagementImportDevices202Response,\n DeviceManagementImportDevicesdefaultResponse,\n DeviceManagementGetDevice200Response,\n DeviceManagementGetDevicedefaultResponse,\n DeviceManagementGetDeviceModule200Response,\n DeviceManagementGetDeviceModuledefaultResponse,\n DeviceManagementGetUpdateCompliance200Response,\n DeviceManagementGetUpdateCompliancedefaultResponse,\n DeviceManagementListGroups200Response,\n DeviceManagementListGroupsdefaultResponse,\n DeviceManagementGetGroup200Response,\n DeviceManagementGetGroupdefaultResponse,\n DeviceManagementDeleteGroup204Response,\n DeviceManagementDeleteGroupdefaultResponse,\n DeviceManagementGetUpdateComplianceForGroup200Response,\n DeviceManagementGetUpdateComplianceForGroupdefaultResponse,\n DeviceManagementListBestUpdatesForGroup200Response,\n DeviceManagementListBestUpdatesForGroupdefaultResponse,\n DeviceManagementListDeploymentsForGroup200Response,\n DeviceManagementListDeploymentsForGroupdefaultResponse,\n DeviceManagementGetDeployment200Response,\n DeviceManagementGetDeploymentdefaultResponse,\n DeviceManagementCreateOrUpdateDeployment200Response,\n DeviceManagementCreateOrUpdateDeploymentdefaultResponse,\n DeviceManagementDeleteDeployment204Response,\n DeviceManagementDeleteDeploymentdefaultResponse,\n DeviceManagementGetDeploymentStatus200Response,\n DeviceManagementGetDeploymentStatusdefaultResponse,\n DeviceManagementListDeviceClassSubgroupsForGroup200Response,\n DeviceManagementListDeviceClassSubgroupsForGroupdefaultResponse,\n DeviceManagementGetDeviceClassSubgroup200Response,\n DeviceManagementGetDeviceClassSubgroupdefaultResponse,\n DeviceManagementDeleteDeviceClassSubgroup204Response,\n DeviceManagementDeleteDeviceClassSubgroupdefaultResponse,\n DeviceManagementGetDeviceClassSubgroupUpdateCompliance200Response,\n DeviceManagementGetDeviceClassSubgroupUpdateCompliancedefaultResponse,\n DeviceManagementGetBestUpdatesForDeviceClassSubgroup200Response,\n DeviceManagementGetBestUpdatesForDeviceClassSubgroupdefaultResponse,\n DeviceManagementListDeploymentsForDeviceClassSubgroup200Response,\n DeviceManagementListDeploymentsForDeviceClassSubgroupdefaultResponse,\n DeviceManagementGetDeploymentForDeviceClassSubgroup200Response,\n DeviceManagementGetDeploymentForDeviceClassSubgroupdefaultResponse,\n DeviceManagementDeleteDeploymentForDeviceClassSubgroup204Response,\n DeviceManagementDeleteDeploymentForDeviceClassSubgroupdefaultResponse,\n DeviceManagementStopDeployment200Response,\n DeviceManagementStopDeploymentdefaultResponse,\n DeviceManagementRetryDeployment200Response,\n DeviceManagementRetryDeploymentdefaultResponse,\n DeviceManagementGetDeviceClassSubgroupDeploymentStatus200Response,\n DeviceManagementGetDeviceClassSubgroupDeploymentStatusdefaultResponse,\n DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment200Response,\n DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentdefaultResponse,\n DeviceManagementGetOperation200Response,\n DeviceManagementGetOperation304Response,\n DeviceManagementGetOperationdefaultResponse,\n DeviceManagementListOperations200Response,\n DeviceManagementListOperationsdefaultResponse,\n DeviceManagementStartLogCollection201Response,\n DeviceManagementStartLogCollectiondefaultResponse,\n DeviceManagementGetLogCollection200Response,\n DeviceManagementGetLogCollectiondefaultResponse,\n DeviceManagementListLogCollections200Response,\n DeviceManagementListLogCollectionsdefaultResponse,\n DeviceManagementGetLogCollectionDetailedStatus200Response,\n DeviceManagementGetLogCollectionDetailedStatusdefaultResponse,\n DeviceManagementListDeviceHealth200Response,\n DeviceManagementListDeviceHealthdefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /deviceUpdate/{instanceId}/updates\": [\"200\"],\n \"POST /deviceUpdate/{instanceId}/updates:import\": [\"202\"],\n \"GET /deviceUpdate/{instanceId}/updates:import\": [\"202\"],\n \"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}\": [\n \"200\",\n \"304\",\n ],\n \"DELETE /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}\": [\n \"202\",\n ],\n \"GET /deviceUpdate/{instanceId}/updates/providers\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}\": [\n \"200\",\n \"304\",\n ],\n \"GET /deviceUpdate/{instanceId}/updates/operations\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/updates/operations/{operationId}\": [\"200\", \"304\"],\n \"GET /deviceUpdate/{instanceId}/management/deviceClasses\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}\": [\"200\"],\n \"PATCH /deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}\": [\"200\"],\n \"DELETE /deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}\": [\"204\"],\n \"GET /deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/devices\": [\"200\"],\n \"POST /deviceUpdate/{instanceId}/management/devices:import\": [\"202\"],\n \"GET /deviceUpdate/{instanceId}/management/devices:import\": [\"202\"],\n \"GET /deviceUpdate/{instanceId}/management/devices/{deviceId}\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/updateCompliance\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/groups\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}\": [\"200\"],\n \"DELETE /deviceUpdate/{instanceId}/management/groups/{groupId}\": [\"204\"],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}\": [\"200\"],\n \"PUT /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}\": [\"200\"],\n \"DELETE /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}\": [\n \"204\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}\": [\n \"200\",\n ],\n \"DELETE /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}\": [\n \"204\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/updateCompliance\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/bestUpdates\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}\": [\n \"200\",\n ],\n \"DELETE /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}\": [\n \"204\",\n ],\n \"POST /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:cancel\": [\n \"200\",\n ],\n \"POST /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:retry\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/status\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/devicestates\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/operations/{operationId}\": [\"200\", \"304\"],\n \"GET /deviceUpdate/{instanceId}/management/operations\": [\"200\"],\n \"PUT /deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}\": [\n \"201\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections\": [\"200\"],\n \"GET /deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus\": [\n \"200\",\n ],\n \"GET /deviceUpdate/{instanceId}/management/deviceDiagnostics/deviceHealth\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: DeviceUpdateListUpdates200Response | DeviceUpdateListUpdatesdefaultResponse\n): response is DeviceUpdateListUpdatesdefaultResponse;\nexport function isUnexpected(\n response: DeviceUpdateImportUpdate202Response | DeviceUpdateImportUpdatedefaultResponse\n): response is DeviceUpdateImportUpdatedefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceUpdateGetUpdate200Response\n | DeviceUpdateGetUpdate304Response\n | DeviceUpdateGetUpdatedefaultResponse\n): response is DeviceUpdateGetUpdatedefaultResponse;\nexport function isUnexpected(\n response: DeviceUpdateDeleteUpdate202Response | DeviceUpdateDeleteUpdatedefaultResponse\n): response is DeviceUpdateDeleteUpdatedefaultResponse;\nexport function isUnexpected(\n response: DeviceUpdateListProviders200Response | DeviceUpdateListProvidersdefaultResponse\n): response is DeviceUpdateListProvidersdefaultResponse;\nexport function isUnexpected(\n response: DeviceUpdateListNames200Response | DeviceUpdateListNamesdefaultResponse\n): response is DeviceUpdateListNamesdefaultResponse;\nexport function isUnexpected(\n response: DeviceUpdateListVersions200Response | DeviceUpdateListVersionsdefaultResponse\n): response is DeviceUpdateListVersionsdefaultResponse;\nexport function isUnexpected(\n response: DeviceUpdateListFiles200Response | DeviceUpdateListFilesdefaultResponse\n): response is DeviceUpdateListFilesdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceUpdateGetFile200Response\n | DeviceUpdateGetFile304Response\n | DeviceUpdateGetFiledefaultResponse\n): response is DeviceUpdateGetFiledefaultResponse;\nexport function isUnexpected(\n response: DeviceUpdateListOperations200Response | DeviceUpdateListOperationsdefaultResponse\n): response is DeviceUpdateListOperationsdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceUpdateGetOperation200Response\n | DeviceUpdateGetOperation304Response\n | DeviceUpdateGetOperationdefaultResponse\n): response is DeviceUpdateGetOperationdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListDeviceClasses200Response\n | DeviceManagementListDeviceClassesdefaultResponse\n): response is DeviceManagementListDeviceClassesdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetDeviceClass200Response\n | DeviceManagementGetDeviceClassdefaultResponse\n): response is DeviceManagementGetDeviceClassdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementUpdateDeviceClass200Response\n | DeviceManagementUpdateDeviceClassdefaultResponse\n): response is DeviceManagementUpdateDeviceClassdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementDeleteDeviceClass204Response\n | DeviceManagementDeleteDeviceClassdefaultResponse\n): response is DeviceManagementDeleteDeviceClassdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListInstallableUpdatesForDeviceClass200Response\n | DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse\n): response is DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse;\nexport function isUnexpected(\n response: DeviceManagementListDevices200Response | DeviceManagementListDevicesdefaultResponse\n): response is DeviceManagementListDevicesdefaultResponse;\nexport function isUnexpected(\n response: DeviceManagementImportDevices202Response | DeviceManagementImportDevicesdefaultResponse\n): response is DeviceManagementImportDevicesdefaultResponse;\nexport function isUnexpected(\n response: DeviceManagementGetDevice200Response | DeviceManagementGetDevicedefaultResponse\n): response is DeviceManagementGetDevicedefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetDeviceModule200Response\n | DeviceManagementGetDeviceModuledefaultResponse\n): response is DeviceManagementGetDeviceModuledefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetUpdateCompliance200Response\n | DeviceManagementGetUpdateCompliancedefaultResponse\n): response is DeviceManagementGetUpdateCompliancedefaultResponse;\nexport function isUnexpected(\n response: DeviceManagementListGroups200Response | DeviceManagementListGroupsdefaultResponse\n): response is DeviceManagementListGroupsdefaultResponse;\nexport function isUnexpected(\n response: DeviceManagementGetGroup200Response | DeviceManagementGetGroupdefaultResponse\n): response is DeviceManagementGetGroupdefaultResponse;\nexport function isUnexpected(\n response: DeviceManagementDeleteGroup204Response | DeviceManagementDeleteGroupdefaultResponse\n): response is DeviceManagementDeleteGroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetUpdateComplianceForGroup200Response\n | DeviceManagementGetUpdateComplianceForGroupdefaultResponse\n): response is DeviceManagementGetUpdateComplianceForGroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListBestUpdatesForGroup200Response\n | DeviceManagementListBestUpdatesForGroupdefaultResponse\n): response is DeviceManagementListBestUpdatesForGroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListDeploymentsForGroup200Response\n | DeviceManagementListDeploymentsForGroupdefaultResponse\n): response is DeviceManagementListDeploymentsForGroupdefaultResponse;\nexport function isUnexpected(\n response: DeviceManagementGetDeployment200Response | DeviceManagementGetDeploymentdefaultResponse\n): response is DeviceManagementGetDeploymentdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementCreateOrUpdateDeployment200Response\n | DeviceManagementCreateOrUpdateDeploymentdefaultResponse\n): response is DeviceManagementCreateOrUpdateDeploymentdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementDeleteDeployment204Response\n | DeviceManagementDeleteDeploymentdefaultResponse\n): response is DeviceManagementDeleteDeploymentdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetDeploymentStatus200Response\n | DeviceManagementGetDeploymentStatusdefaultResponse\n): response is DeviceManagementGetDeploymentStatusdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListDeviceClassSubgroupsForGroup200Response\n | DeviceManagementListDeviceClassSubgroupsForGroupdefaultResponse\n): response is DeviceManagementListDeviceClassSubgroupsForGroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetDeviceClassSubgroup200Response\n | DeviceManagementGetDeviceClassSubgroupdefaultResponse\n): response is DeviceManagementGetDeviceClassSubgroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementDeleteDeviceClassSubgroup204Response\n | DeviceManagementDeleteDeviceClassSubgroupdefaultResponse\n): response is DeviceManagementDeleteDeviceClassSubgroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetDeviceClassSubgroupUpdateCompliance200Response\n | DeviceManagementGetDeviceClassSubgroupUpdateCompliancedefaultResponse\n): response is DeviceManagementGetDeviceClassSubgroupUpdateCompliancedefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetBestUpdatesForDeviceClassSubgroup200Response\n | DeviceManagementGetBestUpdatesForDeviceClassSubgroupdefaultResponse\n): response is DeviceManagementGetBestUpdatesForDeviceClassSubgroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListDeploymentsForDeviceClassSubgroup200Response\n | DeviceManagementListDeploymentsForDeviceClassSubgroupdefaultResponse\n): response is DeviceManagementListDeploymentsForDeviceClassSubgroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetDeploymentForDeviceClassSubgroup200Response\n | DeviceManagementGetDeploymentForDeviceClassSubgroupdefaultResponse\n): response is DeviceManagementGetDeploymentForDeviceClassSubgroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementDeleteDeploymentForDeviceClassSubgroup204Response\n | DeviceManagementDeleteDeploymentForDeviceClassSubgroupdefaultResponse\n): response is DeviceManagementDeleteDeploymentForDeviceClassSubgroupdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementStopDeployment200Response\n | DeviceManagementStopDeploymentdefaultResponse\n): response is DeviceManagementStopDeploymentdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementRetryDeployment200Response\n | DeviceManagementRetryDeploymentdefaultResponse\n): response is DeviceManagementRetryDeploymentdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetDeviceClassSubgroupDeploymentStatus200Response\n | DeviceManagementGetDeviceClassSubgroupDeploymentStatusdefaultResponse\n): response is DeviceManagementGetDeviceClassSubgroupDeploymentStatusdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment200Response\n | DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentdefaultResponse\n): response is DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetOperation200Response\n | DeviceManagementGetOperation304Response\n | DeviceManagementGetOperationdefaultResponse\n): response is DeviceManagementGetOperationdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListOperations200Response\n | DeviceManagementListOperationsdefaultResponse\n): response is DeviceManagementListOperationsdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementStartLogCollection201Response\n | DeviceManagementStartLogCollectiondefaultResponse\n): response is DeviceManagementStartLogCollectiondefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetLogCollection200Response\n | DeviceManagementGetLogCollectiondefaultResponse\n): response is DeviceManagementGetLogCollectiondefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListLogCollections200Response\n | DeviceManagementListLogCollectionsdefaultResponse\n): response is DeviceManagementListLogCollectionsdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementGetLogCollectionDetailedStatus200Response\n | DeviceManagementGetLogCollectionDetailedStatusdefaultResponse\n): response is DeviceManagementGetLogCollectionDetailedStatusdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceManagementListDeviceHealth200Response\n | DeviceManagementListDeviceHealthdefaultResponse\n): response is DeviceManagementListDeviceHealthdefaultResponse;\nexport function isUnexpected(\n response:\n | DeviceUpdateListUpdates200Response\n | DeviceUpdateListUpdatesdefaultResponse\n | DeviceUpdateImportUpdate202Response\n | DeviceUpdateImportUpdatedefaultResponse\n | DeviceUpdateGetUpdate200Response\n | DeviceUpdateGetUpdate304Response\n | DeviceUpdateGetUpdatedefaultResponse\n | DeviceUpdateDeleteUpdate202Response\n | DeviceUpdateDeleteUpdatedefaultResponse\n | DeviceUpdateListProviders200Response\n | DeviceUpdateListProvidersdefaultResponse\n | DeviceUpdateListNames200Response\n | DeviceUpdateListNamesdefaultResponse\n | DeviceUpdateListVersions200Response\n | DeviceUpdateListVersionsdefaultResponse\n | DeviceUpdateListFiles200Response\n | DeviceUpdateListFilesdefaultResponse\n | DeviceUpdateGetFile200Response\n | DeviceUpdateGetFile304Response\n | DeviceUpdateGetFiledefaultResponse\n | DeviceUpdateListOperations200Response\n | DeviceUpdateListOperationsdefaultResponse\n | DeviceUpdateGetOperation200Response\n | DeviceUpdateGetOperation304Response\n | DeviceUpdateGetOperationdefaultResponse\n | DeviceManagementListDeviceClasses200Response\n | DeviceManagementListDeviceClassesdefaultResponse\n | DeviceManagementGetDeviceClass200Response\n | DeviceManagementGetDeviceClassdefaultResponse\n | DeviceManagementUpdateDeviceClass200Response\n | DeviceManagementUpdateDeviceClassdefaultResponse\n | DeviceManagementDeleteDeviceClass204Response\n | DeviceManagementDeleteDeviceClassdefaultResponse\n | DeviceManagementListInstallableUpdatesForDeviceClass200Response\n | DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse\n | DeviceManagementListDevices200Response\n | DeviceManagementListDevicesdefaultResponse\n | DeviceManagementImportDevices202Response\n | DeviceManagementImportDevicesdefaultResponse\n | DeviceManagementGetDevice200Response\n | DeviceManagementGetDevicedefaultResponse\n | DeviceManagementGetDeviceModule200Response\n | DeviceManagementGetDeviceModuledefaultResponse\n | DeviceManagementGetUpdateCompliance200Response\n | DeviceManagementGetUpdateCompliancedefaultResponse\n | DeviceManagementListGroups200Response\n | DeviceManagementListGroupsdefaultResponse\n | DeviceManagementGetGroup200Response\n | DeviceManagementGetGroupdefaultResponse\n | DeviceManagementDeleteGroup204Response\n | DeviceManagementDeleteGroupdefaultResponse\n | DeviceManagementGetUpdateComplianceForGroup200Response\n | DeviceManagementGetUpdateComplianceForGroupdefaultResponse\n | DeviceManagementListBestUpdatesForGroup200Response\n | DeviceManagementListBestUpdatesForGroupdefaultResponse\n | DeviceManagementListDeploymentsForGroup200Response\n | DeviceManagementListDeploymentsForGroupdefaultResponse\n | DeviceManagementGetDeployment200Response\n | DeviceManagementGetDeploymentdefaultResponse\n | DeviceManagementCreateOrUpdateDeployment200Response\n | DeviceManagementCreateOrUpdateDeploymentdefaultResponse\n | DeviceManagementDeleteDeployment204Response\n | DeviceManagementDeleteDeploymentdefaultResponse\n | DeviceManagementGetDeploymentStatus200Response\n | DeviceManagementGetDeploymentStatusdefaultResponse\n | DeviceManagementListDeviceClassSubgroupsForGroup200Response\n | DeviceManagementListDeviceClassSubgroupsForGroupdefaultResponse\n | DeviceManagementGetDeviceClassSubgroup200Response\n | DeviceManagementGetDeviceClassSubgroupdefaultResponse\n | DeviceManagementDeleteDeviceClassSubgroup204Response\n | DeviceManagementDeleteDeviceClassSubgroupdefaultResponse\n | DeviceManagementGetDeviceClassSubgroupUpdateCompliance200Response\n | DeviceManagementGetDeviceClassSubgroupUpdateCompliancedefaultResponse\n | DeviceManagementGetBestUpdatesForDeviceClassSubgroup200Response\n | DeviceManagementGetBestUpdatesForDeviceClassSubgroupdefaultResponse\n | DeviceManagementListDeploymentsForDeviceClassSubgroup200Response\n | DeviceManagementListDeploymentsForDeviceClassSubgroupdefaultResponse\n | DeviceManagementGetDeploymentForDeviceClassSubgroup200Response\n | DeviceManagementGetDeploymentForDeviceClassSubgroupdefaultResponse\n | DeviceManagementDeleteDeploymentForDeviceClassSubgroup204Response\n | DeviceManagementDeleteDeploymentForDeviceClassSubgroupdefaultResponse\n | DeviceManagementStopDeployment200Response\n | DeviceManagementStopDeploymentdefaultResponse\n | DeviceManagementRetryDeployment200Response\n | DeviceManagementRetryDeploymentdefaultResponse\n | DeviceManagementGetDeviceClassSubgroupDeploymentStatus200Response\n | DeviceManagementGetDeviceClassSubgroupDeploymentStatusdefaultResponse\n | DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment200Response\n | DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentdefaultResponse\n | DeviceManagementGetOperation200Response\n | DeviceManagementGetOperation304Response\n | DeviceManagementGetOperationdefaultResponse\n | DeviceManagementListOperations200Response\n | DeviceManagementListOperationsdefaultResponse\n | DeviceManagementStartLogCollection201Response\n | DeviceManagementStartLogCollectiondefaultResponse\n | DeviceManagementGetLogCollection200Response\n | DeviceManagementGetLogCollectiondefaultResponse\n | DeviceManagementListLogCollections200Response\n | DeviceManagementListLogCollectionsdefaultResponse\n | DeviceManagementGetLogCollectionDetailedStatus200Response\n | DeviceManagementGetLogCollectionDetailedStatusdefaultResponse\n | DeviceManagementListDeviceHealth200Response\n | DeviceManagementListDeviceHealthdefaultResponse\n): response is\n | DeviceUpdateListUpdatesdefaultResponse\n | DeviceUpdateImportUpdatedefaultResponse\n | DeviceUpdateGetUpdatedefaultResponse\n | DeviceUpdateDeleteUpdatedefaultResponse\n | DeviceUpdateListProvidersdefaultResponse\n | DeviceUpdateListNamesdefaultResponse\n | DeviceUpdateListVersionsdefaultResponse\n | DeviceUpdateListFilesdefaultResponse\n | DeviceUpdateGetFiledefaultResponse\n | DeviceUpdateListOperationsdefaultResponse\n | DeviceUpdateGetOperationdefaultResponse\n | DeviceManagementListDeviceClassesdefaultResponse\n | DeviceManagementGetDeviceClassdefaultResponse\n | DeviceManagementUpdateDeviceClassdefaultResponse\n | DeviceManagementDeleteDeviceClassdefaultResponse\n | DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse\n | DeviceManagementListDevicesdefaultResponse\n | DeviceManagementImportDevicesdefaultResponse\n | DeviceManagementGetDevicedefaultResponse\n | DeviceManagementGetDeviceModuledefaultResponse\n | DeviceManagementGetUpdateCompliancedefaultResponse\n | DeviceManagementListGroupsdefaultResponse\n | DeviceManagementGetGroupdefaultResponse\n | DeviceManagementDeleteGroupdefaultResponse\n | DeviceManagementGetUpdateComplianceForGroupdefaultResponse\n | DeviceManagementListBestUpdatesForGroupdefaultResponse\n | DeviceManagementListDeploymentsForGroupdefaultResponse\n | DeviceManagementGetDeploymentdefaultResponse\n | DeviceManagementCreateOrUpdateDeploymentdefaultResponse\n | DeviceManagementDeleteDeploymentdefaultResponse\n | DeviceManagementGetDeploymentStatusdefaultResponse\n | DeviceManagementListDeviceClassSubgroupsForGroupdefaultResponse\n | DeviceManagementGetDeviceClassSubgroupdefaultResponse\n | DeviceManagementDeleteDeviceClassSubgroupdefaultResponse\n | DeviceManagementGetDeviceClassSubgroupUpdateCompliancedefaultResponse\n | DeviceManagementGetBestUpdatesForDeviceClassSubgroupdefaultResponse\n | DeviceManagementListDeploymentsForDeviceClassSubgroupdefaultResponse\n | DeviceManagementGetDeploymentForDeviceClassSubgroupdefaultResponse\n | DeviceManagementDeleteDeploymentForDeviceClassSubgroupdefaultResponse\n | DeviceManagementStopDeploymentdefaultResponse\n | DeviceManagementRetryDeploymentdefaultResponse\n | DeviceManagementGetDeviceClassSubgroupDeploymentStatusdefaultResponse\n | DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentdefaultResponse\n | DeviceManagementGetOperationdefaultResponse\n | DeviceManagementListOperationsdefaultResponse\n | DeviceManagementStartLogCollectiondefaultResponse\n | DeviceManagementGetLogCollectiondefaultResponse\n | DeviceManagementListLogCollectionsdefaultResponse\n | DeviceManagementGetLogCollectionDetailedStatusdefaultResponse\n | DeviceManagementListDeviceHealthdefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = geParametrizedPathSuccess(url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (candidateParts[i].startsWith(\"{\") && candidateParts[i].endsWith(\"}\")) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\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[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport interface ImportUpdateInputItem {\n /** Import manifest metadata like source URL, file size/hashes, etc. */\n importManifest: ImportManifestMetadata;\n /** Friendly update name. */\n friendlyName?: string;\n /** One or more update file properties like filename and source URL. */\n files?: Array<FileImportMetadata>;\n}\n\nexport interface ImportManifestMetadata {\n /** Azure Blob location from which the import manifest can be downloaded by Device Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 hours. */\n url: string;\n /** File size in number of bytes. */\n sizeInBytes: number;\n /** A JSON object containing the hash(es) of the file. At least SHA256 hash is required. This object can be thought of as a set of key-value pairs where the key is the hash algorithm, and the value is the hash of the file calculated using that algorithm. */\n hashes: Record<string, string>;\n}\n\nexport interface FileImportMetadata {\n /** Update file name as specified inside import manifest. */\n filename: string;\n /** Azure Blob location from which the update file can be downloaded by Device Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 hours. */\n url: string;\n}\n\nexport interface
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport interface UpdateId {\n /** Update provider. */\n provider: string;\n /** Update name. */\n name: string;\n /** Update version. */\n version: string;\n}\n\nexport interface ImportUpdateInputItem {\n /** Import manifest metadata like source URL, file size/hashes, etc. */\n importManifest: ImportManifestMetadata;\n /** Friendly update name. */\n friendlyName?: string;\n /** One or more update file properties like filename and source URL. */\n files?: Array<FileImportMetadata>;\n}\n\nexport interface ImportManifestMetadata {\n /** Azure Blob location from which the import manifest can be downloaded by Device Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 hours. */\n url: string;\n /** File size in number of bytes. */\n sizeInBytes: number;\n /** A JSON object containing the hash(es) of the file. At least SHA256 hash is required. This object can be thought of as a set of key-value pairs where the key is the hash algorithm, and the value is the hash of the file calculated using that algorithm. */\n hashes: Record<string, string>;\n}\n\nexport interface FileImportMetadata {\n /** Update file name as specified inside import manifest. */\n filename: string;\n /** Azure Blob location from which the update file can be downloaded by Device Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 hours. */\n url: string;\n}\n\nexport interface UpdateInfo {\n /** Update identifier. */\n updateId: UpdateId;\n /** Update description. */\n description?: string;\n /** Friendly update name. */\n friendlyName?: string;\n}\n\nexport interface PatchBody {\n /** The device class friendly name. */\n friendlyName: string;\n}\n\nexport interface Deployment {\n /** The caller-provided deployment identifier. */\n deploymentId: string;\n /** The deployment start datetime. */\n startDateTime: Date | string;\n /** Update information for the update in the deployment. */\n update: UpdateInfo;\n /** The group identity for the devices the deployment is intended to update. */\n groupId: string;\n /** The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update */\n deviceClassSubgroups?: Array<string>;\n /** Boolean flag indicating whether the deployment was canceled. */\n isCanceled?: boolean;\n /** Boolean flag indicating whether the deployment has been retried. */\n isRetried?: boolean;\n /** The rollback policy for the deployment. */\n rollbackPolicy?: CloudInitiatedRollbackPolicy;\n /** Boolean flag indicating whether the deployment is a rollback deployment. */\n isCloudInitiatedRollback?: boolean;\n}\n\nexport interface CloudInitiatedRollbackPolicy {\n /** Update to rollback to. */\n update: UpdateInfo;\n /** Failure conditions to initiate rollback policy. */\n failure: CloudInitiatedRollbackPolicyFailure;\n}\n\nexport interface CloudInitiatedRollbackPolicyFailure {\n /** Percentage of devices that failed. */\n devicesFailedPercentage: number;\n /** Number of devices that failed. */\n devicesFailedCount: number;\n}\n\nexport interface LogCollection {\n /** The log collection id. */\n operationId?: string;\n /** Array of Device Update agent ids */\n deviceList: Array<DeviceUpdateAgentId>;\n /** Description of the diagnostics operation. */\n description?: string;\n /** The timestamp when the operation was created. */\n createdDateTime?: string;\n /** A timestamp for when the current state was entered. */\n lastActionDateTime?: string;\n /** Operation status. */\n status?: \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n}\n\nexport interface DeviceUpdateAgentId {\n /** Device Id */\n deviceId: string;\n /** Module Id */\n moduleId?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport interface UpdateOutput {\n /** Update identity. */\n updateId: UpdateIdOutput;\n /** Update description specified by creator. */\n description?: string;\n /** Friendly update name specified by importer. */\n friendlyName?: string;\n /** Whether the update can be deployed to a device on its own. */\n isDeployable?: boolean;\n /** Update type. Deprecated in latest import manifest schema. */\n updateType?: string;\n /** String interpreted by Device Update client to determine if the update is installed on the device. Deprecated in latest import manifest schema. */\n installedCriteria?: string;\n /** List of update compatibility information. */\n compatibility: Array<Record<string, string>>;\n /** Update install instructions. */\n instructions?: InstructionsOutput;\n /** List of update identities that reference this update. */\n referencedBy?: Array<UpdateIdOutput>;\n /** Update aggregate scan result (calculated from payload file scan results). */\n scanResult?: string;\n /** Schema version of manifest used to import the update. */\n manifestVersion: string;\n /** Date and time in UTC when the update was imported. */\n importedDateTime: string;\n /** Date and time in UTC when the update was created. */\n createdDateTime: string;\n /** Update ETag. */\n etag?: string;\n}\n\nexport interface UpdateIdOutput {\n /** Update provider. */\n provider: string;\n /** Update name. */\n name: string;\n /** Update version. */\n version: string;\n}\n\nexport interface InstructionsOutput {\n /** Collection of installation steps. */\n steps: Array<StepOutput>;\n}\n\nexport interface StepOutput {\n /** Step type. */\n type?: \"Inline\" | \"Reference\";\n /** Step description. */\n description?: string;\n /** Identity of handler that will execute this step. Required if step type is inline. */\n handler?: string;\n /** Parameters to be passed to handler during execution. */\n handlerProperties?: Record<string, unknown>;\n /** Collection of file names to be passed to handler during execution. Required if step type is inline. */\n files?: Array<string>;\n /** Referenced child update identity. Required if step type is reference. */\n updateId?: UpdateIdOutput;\n}\n\nexport interface ErrorResponseOutput {\n /** The error details. */\n error: ErrorModelOutput;\n}\n\nexport interface ErrorModelOutput {\n /** Server defined error code. */\n code: string;\n /** A human-readable representation of the error. */\n message: string;\n /** The target of the error. */\n target?: string;\n /** An array of errors that led to the reported error. */\n details?: Array<ErrorModelOutput>;\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerErrorOutput;\n /** Date and time in UTC when the error occurred. */\n occurredDateTime?: string;\n}\n\nexport interface InnerErrorOutput {\n /** A more specific error code than what was provided by the containing error. */\n code: string;\n /** A human-readable representation of the error. */\n message?: string;\n /** The internal error or exception message. */\n errorDetail?: string;\n /** An object containing more specific information than the current object about the error. */\n innerError?: InnerErrorOutput;\n}\n\nexport interface UpdateListOutput {\n /** The collection of pageable items. */\n value: Array<UpdateOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface StringsListOutput {\n /** The collection of pageable items. */\n value: Array<string>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface UpdateFileOutput {\n /** File identity, generated by server at import time. */\n fileId: string;\n /** File name. */\n fileName: string;\n /** File size in number of bytes. */\n sizeInBytes: number;\n /** Mapping of hashing algorithm to base64 encoded hash values. */\n hashes: Record<string, string>;\n /** File MIME type. */\n mimeType?: string;\n /** Anti-malware scan result. */\n scanResult?: string;\n /** Anti-malware scan details. */\n scanDetails?: string;\n /** File ETag. */\n etag?: string;\n}\n\nexport interface UpdateOperationsListOutput {\n /** The collection of pageable items. */\n value: Array<UpdateOperationOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface UpdateOperationOutput {\n /** Operation Id. */\n operationId: string;\n /** Operation status. */\n status: \"Undefined\" | \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n /** The identity of update being imported or deleted. For import, this property will only be populated after import manifest is processed successfully. */\n updateId?: UpdateIdOutput;\n /** Location of the imported update when operation is successful. */\n resourceLocation?: string;\n /** Operation error encountered, if any. */\n error?: ErrorModelOutput;\n /** Operation correlation identity that can used by Microsoft Support for troubleshooting. */\n traceId?: string;\n /** Date and time in UTC when the operation status was last updated. */\n lastActionDateTime: string;\n /** Date and time in UTC when the operation was created. */\n createdDateTime: string;\n /** Operation ETag. */\n etag?: string;\n}\n\nexport interface DeviceClassesListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceClassOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeviceClassOutput {\n /** The device class identifier. */\n deviceClassId: string;\n /** The compat properties of the device class. This object can be thought of as a set of key-value pairs where the key is the name of the compatibility property and the value is the value of the compatibility property. There will always be at least 1 compat property */\n compatProperties: Record<string, string>;\n /** Update identity. */\n bestCompatibleUpdateId: UpdateIdOutput;\n}\n\nexport interface UpdateIdsListOutput {\n /** The collection of pageable items. */\n value: Array<UpdateIdOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DevicesListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeviceOutput {\n /** Device identity. */\n deviceId: string;\n /** Device module identity. */\n moduleId?: string;\n /** Device class identity. */\n deviceClassId: string;\n /** Device manufacturer. */\n manufacturer: string;\n /** Device model. */\n model: string;\n /** Device group identity. */\n groupId?: string;\n /** Update identity. */\n lastAttemptedUpdateId?: UpdateIdOutput;\n /** State of the device in its last deployment. */\n deploymentStatus?: \"Succeeded\" | \"InProgress\" | \"Failed\" | \"Canceled\" | \"Incompatible\";\n /** Update identity. */\n installedUpdateId?: UpdateIdOutput;\n /** Boolean flag indicating whether the latest update is installed on the device */\n onLatestUpdate: boolean;\n /** The deployment identifier for the last deployment to the device */\n lastDeploymentId?: string;\n /** Last install result. */\n lastInstallResult?: InstallResultOutput;\n}\n\nexport interface InstallResultOutput {\n /** Install result code. */\n resultCode: number;\n /** Install extended result code */\n extendedResultCode: number;\n /** A string containing further details about the install result */\n resultDetails?: string;\n /** Array of step results */\n stepResults?: Array<StepResultOutput>;\n}\n\nexport interface StepResultOutput {\n /** It is update id for update steps; otherwise it is null. */\n updateId?: UpdateIdOutput;\n /** Step description. It might be null for update steps. */\n description?: string;\n /** Install result code. */\n resultCode: number;\n /** Install extended result code */\n extendedResultCode: number;\n /** A string containing further details about the install result */\n resultDetails?: string;\n}\n\nexport interface UpdateComplianceOutput {\n /** Total number of devices. */\n totalDeviceCount: number;\n /** Number of devices on the latest update. */\n onLatestUpdateDeviceCount: number;\n /** Number of devices with a newer update available. */\n newUpdatesAvailableDeviceCount: number;\n /** Number of devices with update in-progress. */\n updatesInProgressDeviceCount: number;\n}\n\nexport interface DeviceTagsListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceTagOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeviceTagOutput {\n /** Tag name. */\n tagName: string;\n /** Number of devices with this tag. */\n deviceCount: number;\n}\n\nexport interface GroupsListOutput {\n /** The collection of pageable items. */\n value: Array<GroupOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface GroupOutput {\n /** Group identity. */\n groupId: string;\n /** Group type. */\n groupType:\n | \"DeviceClassIdAndIoTHubTag\"\n | \"InvalidDeviceClassIdAndIoTHubTag\"\n | \"DefaultDeviceClassId\";\n /** IoT Hub tags. */\n tags: Array<string>;\n /** Date and time when the update was created. */\n createdDateTime: string;\n /** The number of devices in the group. */\n deviceCount?: number;\n /** The deployment Id for the group. */\n deploymentId?: string;\n /** The device class Id for the group. */\n deviceClassId?: string;\n}\n\nexport interface UpdatableDevicesListOutput {\n /** The collection of pageable items. */\n value: Array<UpdatableDevicesOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface UpdatableDevicesOutput {\n /** Update identity. */\n updateId: UpdateIdOutput;\n /** Total number of devices for which the update is applicable. */\n deviceCount: number;\n}\n\nexport interface DeploymentsListOutput {\n /** The collection of pageable items. */\n value: Array<DeploymentOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeploymentOutput {\n /** The deployment identifier. */\n deploymentId: string;\n /** The deployment start datetime. */\n startDateTime: string;\n /** Update identity. */\n updateId: UpdateIdOutput;\n /** The group identity */\n groupId: string;\n /** Boolean flag indicating whether the deployment was canceled. */\n isCanceled?: boolean;\n /** Boolean flag indicating whether the deployment has been retried. */\n isRetried?: boolean;\n}\n\nexport interface DeploymentStatusOutput {\n /** The state of the deployment. */\n deploymentState: \"Active\" | \"Inactive\" | \"Canceled\";\n /** The total number of devices in the deployment. */\n totalDevices?: number;\n /** The number of devices that are currently in deployment. */\n devicesInProgressCount?: number;\n /** The number of devices that have completed deployment with a failure. */\n devicesCompletedFailedCount?: number;\n /** The number of devices which have successfully completed deployment. */\n devicesCompletedSucceededCount?: number;\n /** The number of devices which have had their deployment canceled. */\n devicesCanceledCount?: number;\n}\n\nexport interface DeploymentDeviceStatesListOutput {\n /** The collection of pageable items. */\n value: Array<DeploymentDeviceStateOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeploymentDeviceStateOutput {\n /** Device identity. */\n deviceId: string;\n /** Device module identity. */\n moduleId?: string;\n /** The number of times this deployment has been retried on this device. */\n retryCount: number;\n /** Boolean flag indicating whether this device is in a newer deployment and can no longer retry this deployment. */\n movedOnToNewDeployment: boolean;\n /** Deployment device state. */\n deviceState: \"Succeeded\" | \"InProgress\" | \"Failed\" | \"Canceled\" | \"Incompatible\";\n}\n\nexport interface DeviceOperationOutput {\n /** Operation Id. */\n operationId: string;\n /** Operation status. */\n status: \"Undefined\" | \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n /** Operation error encountered, if any. */\n error?: ErrorModelOutput;\n /** Operation correlation identity that can used by Microsoft Support for troubleshooting. */\n traceId?: string;\n /** Date and time in UTC when the operation status was last updated. */\n lastActionDateTime: string;\n /** Date and time in UTC when the operation was created. */\n createdDateTime: string;\n /** Operation ETag. */\n etag?: string;\n}\n\nexport interface DeviceOperationsListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceOperationOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface LogCollectionOperationOutput {\n /** The diagnostics operation id. */\n operationId?: string;\n /** Array of Device Update agent ids */\n deviceList: Array<DeviceUpdateAgentIdOutput>;\n /** Description of the diagnostics operation. */\n description?: string;\n /** The timestamp when the operation was created. */\n createdDateTime?: string;\n /** A timestamp for when the current state was entered. */\n lastActionDateTime?: string;\n /** Operation status. */\n status?: \"Undefined\" | \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n}\n\nexport interface DeviceUpdateAgentIdOutput {\n /** Device Id */\n deviceId: string;\n /** Module Id */\n moduleId?: string;\n}\n\nexport interface LogCollectionOperationListOutput {\n /** The collection of pageable items. */\n value: Array<LogCollectionOperationOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface LogCollectionOperationDetailedStatusOutput {\n /** The device diagnostics operation id. */\n operationId?: string;\n /** The timestamp when the operation was created. */\n createdDateTime?: string;\n /** A timestamp for when the current state was entered. */\n lastActionDateTime?: string;\n /** Operation status. */\n status?: \"Undefined\" | \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n /** Status of the devices in the operation */\n deviceStatus?: Array<LogCollectionOperationDeviceStatusOutput>;\n /** Device diagnostics operation description. */\n description?: string;\n}\n\nexport interface LogCollectionOperationDeviceStatusOutput {\n /** Device id */\n deviceId: string;\n /** Module id. */\n moduleId?: string;\n /** Log upload status */\n status: \"Undefined\" | \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n /** Log upload result code */\n resultCode?: string;\n /** Log upload extended result code */\n extendedResultCode?: string;\n /** Log upload location */\n logLocation?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport interface UpdateListOutput {\n /** The collection of pageable items. */\n value: Array<UpdateOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface UpdateOutput {\n /** Update identity. */\n updateId: UpdateIdOutput;\n /** Update description specified by creator. */\n description?: string;\n /** Friendly update name specified by importer. */\n friendlyName?: string;\n /** Whether the update can be deployed to a device on its own. */\n isDeployable?: boolean;\n /** Update type. Deprecated in latest import manifest schema. */\n updateType?: string;\n /** String interpreted by Device Update client to determine if the update is installed on the device. Deprecated in latest import manifest schema. */\n installedCriteria?: string;\n /** List of update compatibility information. */\n compatibility: Array<Record<string, string>>;\n /** Update install instructions. */\n instructions?: InstructionsOutput;\n /** List of update identities that reference this update. */\n referencedBy?: Array<UpdateIdOutput>;\n /** Update aggregate scan result (calculated from payload file scan results). */\n scanResult?: string;\n /** Schema version of manifest used to import the update. */\n manifestVersion: string;\n /** Date and time in UTC when the update was imported. */\n importedDateTime: string;\n /** Date and time in UTC when the update was created. */\n createdDateTime: string;\n /** Update ETag. */\n etag?: string;\n}\n\nexport interface UpdateIdOutput {\n /** Update provider. */\n provider: string;\n /** Update name. */\n name: string;\n /** Update version. */\n version: string;\n}\n\nexport interface InstructionsOutput {\n /** Collection of installation steps. */\n steps: Array<StepOutput>;\n}\n\nexport interface StepOutput {\n /** Step type. */\n type?: \"Inline\" | \"Reference\";\n /** Step description. */\n description?: string;\n /** Identity of handler that will execute this step. Required if step type is inline. */\n handler?: string;\n /** Parameters to be passed to handler during execution. */\n handlerProperties?: Record<string, unknown>;\n /** Collection of file names to be passed to handler during execution. Required if step type is inline. */\n files?: Array<string>;\n /** Referenced child update identity. Required if step type is reference. */\n updateId?: UpdateIdOutput;\n}\n\nexport interface ErrorResponseOutput {\n /** The error details. */\n error: ErrorModelOutput;\n}\n\nexport interface ErrorModelOutput {\n /** Server defined error code. */\n code: string;\n /** A human-readable representation of the error. */\n message: string;\n /** The target of the error. */\n target?: string;\n /** An array of errors that led to the reported error. */\n details?: Array<ErrorModelOutput>;\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerErrorOutput;\n /** Date and time in UTC when the error occurred. */\n occurredDateTime?: string;\n}\n\nexport interface InnerErrorOutput {\n /** A more specific error code than what was provided by the containing error. */\n code: string;\n /** A human-readable representation of the error. */\n message?: string;\n /** The internal error or exception message. */\n errorDetail?: string;\n /** An object containing more specific information than the current object about the error. */\n innerError?: InnerErrorOutput;\n}\n\nexport interface StringsListOutput {\n /** The collection of pageable items. */\n value: Array<string>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface UpdateFileOutput extends UpdateFileBaseOutput {\n /** File identity, generated by server at import time. */\n fileId: string;\n /** Optional related files metadata used together DownloadHandler metadata to download payload file. */\n relatedFiles?: Array<UpdateFileBaseOutput>;\n /** Optional download handler for utilizing related files to download payload file. */\n downloadHandler?: UpdateFileDownloadHandlerOutput;\n /** File ETag. */\n etag?: string;\n}\n\nexport interface UpdateFileBaseOutput {\n /** File name. */\n fileName: string;\n /** File size in number of bytes. */\n sizeInBytes: number;\n /** Mapping of hashing algorithm to base64 encoded hash values. */\n hashes: Record<string, string>;\n /** File MIME type. */\n mimeType?: string;\n /** Anti-malware scan result. */\n scanResult?: string;\n /** Anti-malware scan details. */\n scanDetails?: string;\n /** Optional file properties (not consumed by service but pass-through to device). */\n properties?: Record<string, string>;\n}\n\nexport interface UpdateFileDownloadHandlerOutput {\n /** Download handler identifier. */\n id: string;\n}\n\nexport interface UpdateOperationsListOutput {\n /** The collection of pageable items. */\n value: Array<UpdateOperationOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface UpdateOperationOutput {\n /** Operation Id. */\n operationId: string;\n /** Operation status. */\n status: \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n /** The update being imported or deleted. For import, this property will only be populated after import manifest is processed successfully. */\n update?: UpdateInfoOutput;\n /** Location of the imported update when operation is successful. */\n resourceLocation?: string;\n /** Operation error encountered, if any. */\n error?: ErrorModelOutput;\n /** Operation correlation identity that can used by Microsoft Support for troubleshooting. */\n traceId?: string;\n /** Date and time in UTC when the operation status was last updated. */\n lastActionDateTime: string;\n /** Date and time in UTC when the operation was created. */\n createdDateTime: string;\n /** Operation ETag. */\n etag?: string;\n}\n\nexport interface UpdateInfoOutput {\n /** Update identifier. */\n updateId: UpdateIdOutput;\n /** Update description. */\n description?: string;\n /** Friendly update name. */\n friendlyName?: string;\n}\n\nexport interface DeviceClassesListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceClassOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeviceClassOutput {\n /** The device class identifier. */\n deviceClassId: string;\n /** The device class friendly name. This can be updated by callers after the device class has been automatically created. */\n friendlyName?: string;\n /** The device class properties that are used to calculate the device class Id */\n deviceClassProperties: DeviceClassPropertiesOutput;\n /** Update that is best compatible with this device class. */\n bestCompatibleUpdate?: UpdateInfoOutput;\n}\n\nexport interface DeviceClassPropertiesOutput {\n /** The Device Update agent contract model. */\n contractModel?: ContractModelOutput;\n /** The compat properties of the device class. This object can be thought of as a set of key-value pairs where the key is the name of the compatibility property and the value is the value of the compatibility property. There will always be at least 1 compat property */\n compatProperties: Record<string, string>;\n}\n\nexport interface ContractModelOutput {\n /** The Device Update agent contract model Id of the device class. This is also used to calculate the device class Id. */\n id: string;\n /** The Device Update agent contract model name of the device class. Intended to be a more readable form of the contract model Id. */\n name: string;\n}\n\nexport interface UpdateInfoListOutput {\n /** The collection of pageable items. */\n value: Array<UpdateInfoOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DevicesListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeviceOutput {\n /** Device identity. */\n deviceId: string;\n /** Device module identity. */\n moduleId?: string;\n /** Device class identity. */\n deviceClassId: string;\n /** Device group identity. */\n groupId?: string;\n /** The update that device last attempted to install. */\n lastAttemptedUpdate?: UpdateInfoOutput;\n /** State of the device in its last deployment. */\n deploymentStatus?: \"Succeeded\" | \"InProgress\" | \"Canceled\" | \"Failed\";\n /** Currently installed update on device. */\n installedUpdate?: UpdateInfoOutput;\n /** Boolean flag indicating whether the latest update is installed on the device */\n onLatestUpdate: boolean;\n /** The deployment identifier for the last deployment to the device */\n lastDeploymentId?: string;\n /** Last install result. */\n lastInstallResult?: InstallResultOutput;\n}\n\nexport interface InstallResultOutput {\n /** Install result code. */\n resultCode: number;\n /** Install extended result code */\n extendedResultCode: number;\n /** A string containing further details about the install result */\n resultDetails?: string;\n /** Array of step results */\n stepResults?: Array<StepResultOutput>;\n}\n\nexport interface StepResultOutput {\n /** The update that this step installs if it is of reference type. */\n update?: UpdateInfoOutput;\n /** Step description. */\n description?: string;\n /** Install result code. */\n resultCode: number;\n /** Install extended result code */\n extendedResultCode: number;\n /** A string containing further details about the install result */\n resultDetails?: string;\n}\n\nexport interface UpdateComplianceOutput {\n /** Total number of devices. */\n totalDeviceCount: number;\n /** Number of devices on the latest update. */\n onLatestUpdateDeviceCount: number;\n /** Number of devices with a newer update available. */\n newUpdatesAvailableDeviceCount: number;\n /** Number of devices with update in-progress. */\n updatesInProgressDeviceCount: number;\n}\n\nexport interface GroupsListOutput {\n /** The collection of pageable items. */\n value: Array<GroupOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface GroupOutput {\n /** Group identity. */\n groupId: string;\n /** Group type. */\n groupType: \"IoTHubTag\" | \"DefaultNoTag\";\n /** Date and time when the update was created. */\n createdDateTime: string;\n /** The number of devices in the group. */\n deviceCount?: number;\n /** The count of subgroups with new updates available. */\n subgroupsWithNewUpdatesAvailableCount?: number;\n /** The count of subgroups with updates in progress. */\n subgroupsWithUpdatesInProgressCount?: number;\n /** The count of subgroups with devices on the latest update. */\n subgroupsWithOnLatestUpdateCount?: number;\n /** The active deployment Ids for the group */\n deployments?: Array<string>;\n}\n\nexport interface DeviceClassSubgroupUpdatableDevicesListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceClassSubgroupUpdatableDevicesOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeviceClassSubgroupUpdatableDevicesOutput {\n /** The group Id */\n groupId: string;\n /** The device class subgroup's device class Id */\n deviceClassId: string;\n /** Update information. */\n update: UpdateInfoOutput;\n /** Total number of devices for which the update is applicable. */\n deviceCount: number;\n}\n\nexport interface DeploymentsListOutput {\n /** The collection of pageable items. */\n value: Array<DeploymentOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeploymentOutput {\n /** The caller-provided deployment identifier. */\n deploymentId: string;\n /** The deployment start datetime. */\n startDateTime: string;\n /** Update information for the update in the deployment. */\n update: UpdateInfoOutput;\n /** The group identity for the devices the deployment is intended to update. */\n groupId: string;\n /** The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update */\n deviceClassSubgroups?: Array<string>;\n /** Boolean flag indicating whether the deployment was canceled. */\n isCanceled?: boolean;\n /** Boolean flag indicating whether the deployment has been retried. */\n isRetried?: boolean;\n /** The rollback policy for the deployment. */\n rollbackPolicy?: CloudInitiatedRollbackPolicyOutput;\n /** Boolean flag indicating whether the deployment is a rollback deployment. */\n isCloudInitiatedRollback?: boolean;\n}\n\nexport interface CloudInitiatedRollbackPolicyOutput {\n /** Update to rollback to. */\n update: UpdateInfoOutput;\n /** Failure conditions to initiate rollback policy. */\n failure: CloudInitiatedRollbackPolicyFailureOutput;\n}\n\nexport interface CloudInitiatedRollbackPolicyFailureOutput {\n /** Percentage of devices that failed. */\n devicesFailedPercentage: number;\n /** Number of devices that failed. */\n devicesFailedCount: number;\n}\n\nexport interface DeploymentStatusOutput {\n /** The group identity */\n groupId: string;\n /** The state of the deployment. */\n deploymentState: \"Active\" | \"ActiveWithSubgroupFailures\" | \"Failed\" | \"Inactive\" | \"Canceled\";\n /** The error details of the Failed state. This is not present if the deployment state is not Failed. */\n error?: ErrorModelOutput;\n /** The collection of device class subgroup status objects */\n subgroupStatus: Array<DeviceClassSubgroupDeploymentStatusOutput>;\n}\n\nexport interface DeviceClassSubgroupDeploymentStatusOutput {\n /** The group identity */\n groupId: string;\n /** The device class subgroup identity */\n deviceClassId: string;\n /** The state of the subgroup deployment. */\n deploymentState: \"Active\" | \"Failed\" | \"Inactive\" | \"Canceled\";\n /** The error details of the Failed state. This is not present if the deployment state is not Failed. */\n error?: ErrorModelOutput;\n /** The total number of devices in the deployment. */\n totalDevices?: number;\n /** The number of devices that are currently in deployment. */\n devicesInProgressCount?: number;\n /** The number of devices that have completed deployment with a failure. */\n devicesCompletedFailedCount?: number;\n /** The number of devices which have successfully completed deployment. */\n devicesCompletedSucceededCount?: number;\n /** The number of devices which have had their deployment canceled. */\n devicesCanceledCount?: number;\n}\n\nexport interface DeviceClassSubgroupsListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceClassSubgroupOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeviceClassSubgroupOutput {\n /** Device class subgroup identity. */\n deviceClassId: string;\n /** Group identity. */\n groupId: string;\n /** Date and time when the device class subgroup was created. */\n createdDateTime: string;\n /** The number of devices in the device class subgroup. */\n deviceCount?: number;\n /** The active deployment Id for the device class subgroup. */\n deploymentId?: string;\n}\n\nexport interface DeploymentDeviceStatesListOutput {\n /** The collection of pageable items. */\n value: Array<DeploymentDeviceStateOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeploymentDeviceStateOutput {\n /** Device identity. */\n deviceId: string;\n /** Device module identity. */\n moduleId?: string;\n /** The number of times this deployment has been retried on this device. */\n retryCount: number;\n /** Boolean flag indicating whether this device is in a newer deployment and can no longer retry this deployment. */\n movedOnToNewDeployment: boolean;\n /** Deployment device state. */\n deviceState: \"Succeeded\" | \"InProgress\" | \"Canceled\" | \"Failed\";\n}\n\nexport interface DeviceOperationOutput {\n /** Operation Id. */\n operationId: string;\n /** Operation status. */\n status: \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n /** Operation error encountered, if any. */\n error?: ErrorModelOutput;\n /** Operation correlation identity that can used by Microsoft Support for troubleshooting. */\n traceId?: string;\n /** Date and time in UTC when the operation status was last updated. */\n lastActionDateTime: string;\n /** Date and time in UTC when the operation was created. */\n createdDateTime: string;\n /** Operation ETag. */\n etag?: string;\n}\n\nexport interface DeviceOperationsListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceOperationOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface LogCollectionOutput {\n /** The log collection id. */\n operationId?: string;\n /** Array of Device Update agent ids */\n deviceList: Array<DeviceUpdateAgentIdOutput>;\n /** Description of the diagnostics operation. */\n description?: string;\n /** The timestamp when the operation was created. */\n createdDateTime?: string;\n /** A timestamp for when the current state was entered. */\n lastActionDateTime?: string;\n /** Operation status. */\n status?: \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n}\n\nexport interface DeviceUpdateAgentIdOutput {\n /** Device Id */\n deviceId: string;\n /** Module Id */\n moduleId?: string;\n}\n\nexport interface LogCollectionListOutput {\n /** The collection of pageable items. */\n value: Array<LogCollectionOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface LogCollectionOperationDetailedStatusOutput {\n /** The device diagnostics operation id. */\n operationId?: string;\n /** The timestamp when the operation was created. */\n createdDateTime?: string;\n /** A timestamp for when the current state was entered. */\n lastActionDateTime?: string;\n /** Operation status. */\n status?: \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n /** Status of the devices in the operation */\n deviceStatus?: Array<LogCollectionOperationDeviceStatusOutput>;\n /** Device diagnostics operation description. */\n description?: string;\n}\n\nexport interface LogCollectionOperationDeviceStatusOutput {\n /** Device id */\n deviceId: string;\n /** Module id. */\n moduleId?: string;\n /** Log upload status */\n status: \"NotStarted\" | \"Running\" | \"Succeeded\" | \"Failed\";\n /** Log upload result code */\n resultCode?: string;\n /** Log upload extended result code */\n extendedResultCode?: string;\n /** Log upload location */\n logLocation?: string;\n}\n\nexport interface DeviceHealthListOutput {\n /** The collection of pageable items. */\n value: Array<DeviceHealthOutput>;\n /** The link to the next page of items. */\n nextLink?: string;\n}\n\nexport interface DeviceHealthOutput {\n /** Device id */\n deviceId: string;\n /** Module id */\n moduleId?: string;\n /** Aggregate device health state */\n state: \"healthy\" | \"unhealthy\";\n /** Digital twin model Id */\n digitalTwinModelId?: string;\n /** Array of health checks and their results */\n healthChecks: Array<HealthCheckOutput>;\n}\n\nexport interface HealthCheckOutput {\n /** Health check name */\n name?: string;\n /** Health check result */\n result?: \"success\" | \"userError\";\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"paginateHelper.js","sourceRoot":"","sources":["../../src/paginateHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,qBAAqB,EAA2C,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAU,eAAe,EAAyB,MAAM,yBAAyB,CAAC;AAyCzF;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,eAA0B,EAC1B,UAAoC,EAAE;IAItC,IAAI,QAAQ,GAAG,IAAI,CAAC;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC;IACzB,MAAM,YAAY,GAAG,UAAU,CAAC;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,WAAW,GAA4B;QAC3C,aAAa,EAAE,EAAE;QACjB,OAAO,EACL,OAAO,aAAa,KAAK,UAAU;YACjC,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,KAAK,EAAE,QAAgB,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;gBACvF,QAAQ,GAAG,KAAK,CAAC;gBACjB,kBAAkB,CAAC,MAAM,CAAC,CAAC;gBAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;gBACxD,MAAM,MAAM,GAAG,WAAW,CAAW,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBAC5D,OAAO;oBACL,IAAI,EAAE,MAAM;oBACZ,YAAY,EAAE,QAAQ;iBACvB,CAAC;YACJ,CAAC;KACR,CAAC;IAEF,OAAO,qBAAqB,CAAC,WAAW,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,IAAa,EAAE,YAAqB;IACvD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,QAAQ,GAAI,IAAgC,CAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACnE,MAAM,IAAI,KAAK,CAAC,iBAAiB,YAAY,kCAAkC,CAAC,CAAC;KAClF;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;IAEjE,qEAAqE;IACrE,qEAAqE;IACrE,iDAAiD;IACjD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;KACH;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;KACH;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {}\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\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\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or 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\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\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): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport { Deployment, Group, ImportUpdateInputItem, LogCollectionOperation } from \"./models\";\n\nexport interface DeviceUpdateImportUpdateBodyParam {\n /** The update to be imported. */\n body: Array<ImportUpdateInputItem>;\n}\n\nexport interface DeviceUpdateImportUpdateQueryParamProperties {\n /** Import update action. */\n action: \"import\";\n}\n\nexport interface DeviceUpdateImportUpdateQueryParam {\n queryParameters: DeviceUpdateImportUpdateQueryParamProperties;\n}\n\nexport interface DeviceUpdateImportUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DeviceUpdateImportUpdateParameters = DeviceUpdateImportUpdateQueryParam &\n DeviceUpdateImportUpdateMediaTypesParam &\n DeviceUpdateImportUpdateBodyParam &\n RequestParameters;\n\nexport interface DeviceUpdateListUpdatesQueryParamProperties {\n /** Request updates matching a free-text search expression. */\n $search?: string;\n /** Filter updates by its properties. */\n $filter?: string;\n}\n\nexport interface DeviceUpdateListUpdatesQueryParam {\n queryParameters?: DeviceUpdateListUpdatesQueryParamProperties;\n}\n\nexport type DeviceUpdateListUpdatesParameters = DeviceUpdateListUpdatesQueryParam &\n RequestParameters;\n\nexport interface DeviceUpdateGetUpdateHeaders {\n /** Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. */\n \"If-None-Match\"?: string;\n}\n\nexport interface DeviceUpdateGetUpdateHeaderParam {\n headers: RawHttpHeadersInput & DeviceUpdateGetUpdateHeaders;\n}\n\nexport type DeviceUpdateGetUpdateParameters = DeviceUpdateGetUpdateHeaderParam & RequestParameters;\nexport type DeviceUpdateDeleteUpdateParameters = RequestParameters;\nexport type DeviceUpdateListProvidersParameters = RequestParameters;\nexport type DeviceUpdateListNamesParameters = RequestParameters;\n\nexport interface DeviceUpdateListVersionsQueryParamProperties {\n /** Filter updates by its properties. */\n $filter?: string;\n}\n\nexport interface DeviceUpdateListVersionsQueryParam {\n queryParameters?: DeviceUpdateListVersionsQueryParamProperties;\n}\n\nexport type DeviceUpdateListVersionsParameters = DeviceUpdateListVersionsQueryParam &\n RequestParameters;\nexport type DeviceUpdateListFilesParameters = RequestParameters;\n\nexport interface DeviceUpdateGetFileHeaders {\n /** Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. */\n \"If-None-Match\"?: string;\n}\n\nexport interface DeviceUpdateGetFileHeaderParam {\n headers: RawHttpHeadersInput & DeviceUpdateGetFileHeaders;\n}\n\nexport type DeviceUpdateGetFileParameters = DeviceUpdateGetFileHeaderParam & RequestParameters;\n\nexport interface DeviceUpdateListOperationsQueryParamProperties {\n /** Restricts the set of operations returned. Only one specific filter is supported: \"status eq 'NotStarted' or status eq 'Running'\" */\n $filter?: string;\n /** Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. */\n $top?: number;\n}\n\nexport interface DeviceUpdateListOperationsQueryParam {\n queryParameters?: DeviceUpdateListOperationsQueryParamProperties;\n}\n\nexport type DeviceUpdateListOperationsParameters = DeviceUpdateListOperationsQueryParam &\n RequestParameters;\n\nexport interface DeviceUpdateGetOperationHeaders {\n /** Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. */\n \"If-None-Match\"?: string;\n}\n\nexport interface DeviceUpdateGetOperationHeaderParam {\n headers: RawHttpHeadersInput & DeviceUpdateGetOperationHeaders;\n}\n\nexport type DeviceUpdateGetOperationParameters = DeviceUpdateGetOperationHeaderParam &\n RequestParameters;\nexport type DeviceManagementListDeviceClassesParameters = RequestParameters;\nexport type DeviceManagementGetDeviceClassParameters = RequestParameters;\nexport type DeviceManagementListInstallableUpdatesForDeviceClassParameters = RequestParameters;\n\nexport interface DeviceManagementListDevicesQueryParamProperties {\n /** Restricts the set of devices returned. You can filter on device GroupId or DeviceClassId. */\n $filter?: string;\n}\n\nexport interface DeviceManagementListDevicesQueryParam {\n queryParameters?: DeviceManagementListDevicesQueryParamProperties;\n}\n\nexport type DeviceManagementListDevicesParameters = DeviceManagementListDevicesQueryParam &\n RequestParameters;\n\nexport interface DeviceManagementImportDevicesBodyParam {\n /** The types of devices to import. */\n body: \"Devices\" | \"Modules\" | \"All\";\n}\n\nexport interface DeviceManagementImportDevicesQueryParamProperties {\n /** Devices action. */\n action: \"import\";\n}\n\nexport interface DeviceManagementImportDevicesQueryParam {\n queryParameters: DeviceManagementImportDevicesQueryParamProperties;\n}\n\nexport interface DeviceManagementImportDevicesMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DeviceManagementImportDevicesParameters = DeviceManagementImportDevicesQueryParam &\n DeviceManagementImportDevicesMediaTypesParam &\n DeviceManagementImportDevicesBodyParam &\n RequestParameters;\nexport type DeviceManagementGetDeviceParameters = RequestParameters;\nexport type DeviceManagementGetDeviceModuleParameters = RequestParameters;\nexport type DeviceManagementGetUpdateComplianceParameters = RequestParameters;\nexport type DeviceManagementListDeviceTagsParameters = RequestParameters;\nexport type DeviceManagementGetDeviceTagParameters = RequestParameters;\nexport type DeviceManagementListGroupsParameters = RequestParameters;\nexport type DeviceManagementGetGroupParameters = RequestParameters;\n\nexport interface DeviceManagementCreateOrUpdateGroupBodyParam {\n /** The group properties. */\n body: Group;\n}\n\nexport interface DeviceManagementCreateOrUpdateGroupMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DeviceManagementCreateOrUpdateGroupParameters = DeviceManagementCreateOrUpdateGroupMediaTypesParam &\n DeviceManagementCreateOrUpdateGroupBodyParam &\n RequestParameters;\nexport type DeviceManagementDeleteGroupParameters = RequestParameters;\nexport type DeviceManagementGetGroupUpdateComplianceParameters = RequestParameters;\n\nexport interface DeviceManagementListBestUpdatesForGroupQueryParamProperties {\n /** Restricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property. */\n $filter?: string;\n}\n\nexport interface DeviceManagementListBestUpdatesForGroupQueryParam {\n queryParameters?: DeviceManagementListBestUpdatesForGroupQueryParamProperties;\n}\n\nexport type DeviceManagementListBestUpdatesForGroupParameters = DeviceManagementListBestUpdatesForGroupQueryParam &\n RequestParameters;\n\nexport interface DeviceManagementListDeploymentsForGroupQueryParamProperties {\n /** Restricts the set of deployments returned. You can filter on update Provider, Name and Version property. */\n $filter?: string;\n}\n\nexport interface DeviceManagementListDeploymentsForGroupQueryParam {\n queryParameters?: DeviceManagementListDeploymentsForGroupQueryParamProperties;\n}\n\nexport type DeviceManagementListDeploymentsForGroupParameters = DeviceManagementListDeploymentsForGroupQueryParam &\n RequestParameters;\nexport type DeviceManagementGetDeploymentParameters = RequestParameters;\n\nexport interface DeviceManagementCreateOrUpdateDeploymentBodyParam {\n /** The deployment properties. */\n body: Deployment;\n}\n\nexport interface DeviceManagementCreateOrUpdateDeploymentMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DeviceManagementCreateOrUpdateDeploymentParameters = DeviceManagementCreateOrUpdateDeploymentMediaTypesParam &\n DeviceManagementCreateOrUpdateDeploymentBodyParam &\n RequestParameters;\nexport type DeviceManagementDeleteDeploymentParameters = RequestParameters;\nexport type DeviceManagementGetDeploymentStatusParameters = RequestParameters;\n\nexport interface DeviceManagementListDeploymentDevicesQueryParamProperties {\n /** Restricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState. */\n $filter?: string;\n}\n\nexport interface DeviceManagementListDeploymentDevicesQueryParam {\n queryParameters?: DeviceManagementListDeploymentDevicesQueryParamProperties;\n}\n\nexport type DeviceManagementListDeploymentDevicesParameters = DeviceManagementListDeploymentDevicesQueryParam &\n RequestParameters;\n\nexport interface DeviceManagementGetOperationHeaders {\n /** Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. */\n \"If-None-Match\"?: string;\n}\n\nexport interface DeviceManagementGetOperationHeaderParam {\n headers: RawHttpHeadersInput & DeviceManagementGetOperationHeaders;\n}\n\nexport type DeviceManagementGetOperationParameters = DeviceManagementGetOperationHeaderParam &\n RequestParameters;\n\nexport interface DeviceManagementListOperationsQueryParamProperties {\n /** Restricts the set of operations returned. Only one specific filter is supported: \"status eq 'NotStarted' or status eq 'Running'\" */\n $filter?: string;\n /** Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. */\n $top?: number;\n}\n\nexport interface DeviceManagementListOperationsQueryParam {\n queryParameters?: DeviceManagementListOperationsQueryParamProperties;\n}\n\nexport type DeviceManagementListOperationsParameters = DeviceManagementListOperationsQueryParam &\n RequestParameters;\n\nexport interface DeviceManagementCollectLogsBodyParam {\n /** The deployment properties. */\n body: LogCollectionOperation;\n}\n\nexport interface DeviceManagementCollectLogsMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DeviceManagementCollectLogsParameters = DeviceManagementCollectLogsMediaTypesParam &\n DeviceManagementCollectLogsBodyParam &\n RequestParameters;\nexport type DeviceManagementGetLogCollectionOperationParameters = RequestParameters;\nexport type DeviceManagementListLogCollectionOperationsParameters = RequestParameters;\nexport type DeviceManagementGetLogCollectionOperationDetailedStatusParameters = RequestParameters;\n\nexport interface DeviceManagementStopDeploymentQueryParamProperties {\n /** Cancel deployment action. */\n action: \"cancel\";\n}\n\nexport interface DeviceManagementStopDeploymentQueryParam {\n queryParameters: DeviceManagementStopDeploymentQueryParamProperties;\n}\n\nexport type DeviceManagementStopDeploymentParameters = DeviceManagementStopDeploymentQueryParam &\n RequestParameters;\n\nexport interface DeviceManagementRetryDeploymentQueryParamProperties {\n /** Retry deployment action. */\n action: \"retry\";\n}\n\nexport interface DeviceManagementRetryDeploymentQueryParam {\n queryParameters: DeviceManagementRetryDeploymentQueryParamProperties;\n}\n\nexport type DeviceManagementRetryDeploymentParameters = DeviceManagementRetryDeploymentQueryParam &\n RequestParameters;\n"]}
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport { RequestParameters } from \"@azure-rest/core-client\";\nimport { ImportUpdateInputItem, PatchBody, Deployment, LogCollection } from \"./models\";\n\nexport interface DeviceUpdateListUpdatesQueryParamProperties {\n /** Request updates matching a free-text search expression. */\n search?: string;\n /** Filter updates by its properties. */\n filter?: string;\n}\n\nexport interface DeviceUpdateListUpdatesQueryParam {\n queryParameters?: DeviceUpdateListUpdatesQueryParamProperties;\n}\n\nexport type DeviceUpdateListUpdatesParameters = DeviceUpdateListUpdatesQueryParam &\n RequestParameters;\n\nexport interface DeviceUpdateImportUpdateBodyParam {\n /** The update to be imported. */\n body: Array<ImportUpdateInputItem>;\n}\n\nexport interface DeviceUpdateImportUpdateMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DeviceUpdateImportUpdateParameters = DeviceUpdateImportUpdateMediaTypesParam &\n DeviceUpdateImportUpdateBodyParam &\n RequestParameters;\n\nexport interface DeviceUpdateGetUpdateHeaders {\n /** Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. */\n \"If-None-Match\"?: string;\n}\n\nexport interface DeviceUpdateGetUpdateHeaderParam {\n headers: RawHttpHeadersInput & DeviceUpdateGetUpdateHeaders;\n}\n\nexport type DeviceUpdateGetUpdateParameters = DeviceUpdateGetUpdateHeaderParam & RequestParameters;\nexport type DeviceUpdateDeleteUpdateParameters = RequestParameters;\nexport type DeviceUpdateListProvidersParameters = RequestParameters;\nexport type DeviceUpdateListNamesParameters = RequestParameters;\n\nexport interface DeviceUpdateListVersionsQueryParamProperties {\n /** Filter updates by its properties. */\n filter?: string;\n}\n\nexport interface DeviceUpdateListVersionsQueryParam {\n queryParameters?: DeviceUpdateListVersionsQueryParamProperties;\n}\n\nexport type DeviceUpdateListVersionsParameters = DeviceUpdateListVersionsQueryParam &\n RequestParameters;\nexport type DeviceUpdateListFilesParameters = RequestParameters;\n\nexport interface DeviceUpdateGetFileHeaders {\n /** Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. */\n \"If-None-Match\"?: string;\n}\n\nexport interface DeviceUpdateGetFileHeaderParam {\n headers: RawHttpHeadersInput & DeviceUpdateGetFileHeaders;\n}\n\nexport type DeviceUpdateGetFileParameters = DeviceUpdateGetFileHeaderParam & RequestParameters;\n\nexport interface DeviceUpdateListOperationsQueryParamProperties {\n /** Restricts the set of operations returned. Only one specific filter is supported: \"status eq 'NotStarted' or status eq 'Running'\" */\n filter?: string;\n /** Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. */\n top?: number;\n}\n\nexport interface DeviceUpdateListOperationsQueryParam {\n queryParameters?: DeviceUpdateListOperationsQueryParamProperties;\n}\n\nexport type DeviceUpdateListOperationsParameters = DeviceUpdateListOperationsQueryParam &\n RequestParameters;\n\nexport interface DeviceUpdateGetOperationHeaders {\n /** Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. */\n \"If-None-Match\"?: string;\n}\n\nexport interface DeviceUpdateGetOperationHeaderParam {\n headers: RawHttpHeadersInput & DeviceUpdateGetOperationHeaders;\n}\n\nexport type DeviceUpdateGetOperationParameters = DeviceUpdateGetOperationHeaderParam &\n RequestParameters;\nexport type DeviceManagementListDeviceClassesParameters = RequestParameters;\nexport type DeviceManagementGetDeviceClassParameters = RequestParameters;\n\nexport interface DeviceManagementUpdateDeviceClassBodyParam {\n /** The device class json merge patch body. Currently only supports patching friendlyName */\n body: PatchBody;\n}\n\nexport interface DeviceManagementUpdateDeviceClassMediaTypesParam {\n /** Request content type */\n contentType?: \"application/merge-patch+json\";\n}\n\nexport type DeviceManagementUpdateDeviceClassParameters = DeviceManagementUpdateDeviceClassMediaTypesParam &\n DeviceManagementUpdateDeviceClassBodyParam &\n RequestParameters;\nexport type DeviceManagementDeleteDeviceClassParameters = RequestParameters;\nexport type DeviceManagementListInstallableUpdatesForDeviceClassParameters = RequestParameters;\n\nexport interface DeviceManagementListDevicesQueryParamProperties {\n /** Restricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus. */\n filter?: string;\n}\n\nexport interface DeviceManagementListDevicesQueryParam {\n queryParameters?: DeviceManagementListDevicesQueryParamProperties;\n}\n\nexport type DeviceManagementListDevicesParameters = DeviceManagementListDevicesQueryParam &\n RequestParameters;\n\nexport interface DeviceManagementImportDevicesBodyParam {\n /** The types of devices to import. */\n body: \"Devices\" | \"Modules\" | \"All\";\n}\n\nexport interface DeviceManagementImportDevicesMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DeviceManagementImportDevicesParameters = DeviceManagementImportDevicesMediaTypesParam &\n DeviceManagementImportDevicesBodyParam &\n RequestParameters;\nexport type DeviceManagementGetDeviceParameters = RequestParameters;\nexport type DeviceManagementGetDeviceModuleParameters = RequestParameters;\nexport type DeviceManagementGetUpdateComplianceParameters = RequestParameters;\n\nexport interface DeviceManagementListGroupsQueryParamProperties {\n /** Orders the set of groups returned. You can order by any combination of groupId, device count, created date, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount. */\n orderby?: string;\n}\n\nexport interface DeviceManagementListGroupsQueryParam {\n queryParameters?: DeviceManagementListGroupsQueryParamProperties;\n}\n\nexport type DeviceManagementListGroupsParameters = DeviceManagementListGroupsQueryParam &\n RequestParameters;\nexport type DeviceManagementGetGroupParameters = RequestParameters;\nexport type DeviceManagementDeleteGroupParameters = RequestParameters;\nexport type DeviceManagementGetUpdateComplianceForGroupParameters = RequestParameters;\n\nexport interface DeviceManagementListBestUpdatesForGroupQueryParamProperties {\n /** Restricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property. This filter is deprecated and should not be used. */\n filter?: string;\n}\n\nexport interface DeviceManagementListBestUpdatesForGroupQueryParam {\n queryParameters?: DeviceManagementListBestUpdatesForGroupQueryParamProperties;\n}\n\nexport type DeviceManagementListBestUpdatesForGroupParameters = DeviceManagementListBestUpdatesForGroupQueryParam &\n RequestParameters;\n\nexport interface DeviceManagementListDeploymentsForGroupQueryParamProperties {\n /** Orders the set of deployments returned. You can order by start date. */\n orderby?: string;\n}\n\nexport interface DeviceManagementListDeploymentsForGroupQueryParam {\n queryParameters?: DeviceManagementListDeploymentsForGroupQueryParamProperties;\n}\n\nexport type DeviceManagementListDeploymentsForGroupParameters = DeviceManagementListDeploymentsForGroupQueryParam &\n RequestParameters;\nexport type DeviceManagementGetDeploymentParameters = RequestParameters;\n\nexport interface DeviceManagementCreateOrUpdateDeploymentBodyParam {\n /** The deployment properties. */\n body: Deployment;\n}\n\nexport interface DeviceManagementCreateOrUpdateDeploymentMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DeviceManagementCreateOrUpdateDeploymentParameters = DeviceManagementCreateOrUpdateDeploymentMediaTypesParam &\n DeviceManagementCreateOrUpdateDeploymentBodyParam &\n RequestParameters;\nexport type DeviceManagementDeleteDeploymentParameters = RequestParameters;\nexport type DeviceManagementGetDeploymentStatusParameters = RequestParameters;\n\nexport interface DeviceManagementListDeviceClassSubgroupsForGroupQueryParamProperties {\n /** Restricts the set of device class subgroups returned. You can filter on compat properties by name and value. */\n filter?: string;\n}\n\nexport interface DeviceManagementListDeviceClassSubgroupsForGroupQueryParam {\n queryParameters?: DeviceManagementListDeviceClassSubgroupsForGroupQueryParamProperties;\n}\n\nexport type DeviceManagementListDeviceClassSubgroupsForGroupParameters = DeviceManagementListDeviceClassSubgroupsForGroupQueryParam &\n RequestParameters;\nexport type DeviceManagementGetDeviceClassSubgroupParameters = RequestParameters;\nexport type DeviceManagementDeleteDeviceClassSubgroupParameters = RequestParameters;\nexport type DeviceManagementGetDeviceClassSubgroupUpdateComplianceParameters = RequestParameters;\nexport type DeviceManagementGetBestUpdatesForDeviceClassSubgroupParameters = RequestParameters;\n\nexport interface DeviceManagementListDeploymentsForDeviceClassSubgroupQueryParamProperties {\n /** Orders the set of deployments returned. You can order by start date. */\n orderby?: string;\n}\n\nexport interface DeviceManagementListDeploymentsForDeviceClassSubgroupQueryParam {\n queryParameters?: DeviceManagementListDeploymentsForDeviceClassSubgroupQueryParamProperties;\n}\n\nexport type DeviceManagementListDeploymentsForDeviceClassSubgroupParameters = DeviceManagementListDeploymentsForDeviceClassSubgroupQueryParam &\n RequestParameters;\nexport type DeviceManagementGetDeploymentForDeviceClassSubgroupParameters = RequestParameters;\nexport type DeviceManagementDeleteDeploymentForDeviceClassSubgroupParameters = RequestParameters;\nexport type DeviceManagementStopDeploymentParameters = RequestParameters;\nexport type DeviceManagementRetryDeploymentParameters = RequestParameters;\nexport type DeviceManagementGetDeviceClassSubgroupDeploymentStatusParameters = RequestParameters;\n\nexport interface DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentQueryParamProperties {\n /** Restricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState. */\n filter?: string;\n}\n\nexport interface DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentQueryParam {\n queryParameters?: DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentQueryParamProperties;\n}\n\nexport type DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentParameters = DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentQueryParam &\n RequestParameters;\n\nexport interface DeviceManagementGetOperationHeaders {\n /** Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value. */\n \"If-None-Match\"?: string;\n}\n\nexport interface DeviceManagementGetOperationHeaderParam {\n headers: RawHttpHeadersInput & DeviceManagementGetOperationHeaders;\n}\n\nexport type DeviceManagementGetOperationParameters = DeviceManagementGetOperationHeaderParam &\n RequestParameters;\n\nexport interface DeviceManagementListOperationsQueryParamProperties {\n /** Restricts the set of operations returned. Only one specific filter is supported: \"status eq 'NotStarted' or status eq 'Running'\" */\n filter?: string;\n /** Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. */\n top?: number;\n}\n\nexport interface DeviceManagementListOperationsQueryParam {\n queryParameters?: DeviceManagementListOperationsQueryParamProperties;\n}\n\nexport type DeviceManagementListOperationsParameters = DeviceManagementListOperationsQueryParam &\n RequestParameters;\n\nexport interface DeviceManagementStartLogCollectionBodyParam {\n /** The log collection properties. */\n body: LogCollection;\n}\n\nexport interface DeviceManagementStartLogCollectionMediaTypesParam {\n /** Request content type */\n contentType?: \"application/json\";\n}\n\nexport type DeviceManagementStartLogCollectionParameters = DeviceManagementStartLogCollectionMediaTypesParam &\n DeviceManagementStartLogCollectionBodyParam &\n RequestParameters;\nexport type DeviceManagementGetLogCollectionParameters = RequestParameters;\nexport type DeviceManagementListLogCollectionsParameters = RequestParameters;\nexport type DeviceManagementGetLogCollectionDetailedStatusParameters = RequestParameters;\n\nexport interface DeviceManagementListDeviceHealthQueryParamProperties {\n /** Filter list by specified properties. */\n filter: string;\n}\n\nexport interface DeviceManagementListDeviceHealthQueryParam {\n queryParameters: DeviceManagementListDeviceHealthQueryParamProperties;\n}\n\nexport type DeviceManagementListDeviceHealthParameters = DeviceManagementListDeviceHealthQueryParam &\n RequestParameters;\n"]}
|
|
@@ -24,7 +24,9 @@ export function getLongRunningPoller(client, initialResponse, options = {}) {
|
|
|
24
24
|
// which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
|
|
25
25
|
// depending on the lro pattern that the service implements. If non is provided we default to the initial path.
|
|
26
26
|
const response = await client.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url).get();
|
|
27
|
-
|
|
27
|
+
const lroResponse = getLroResponse(response);
|
|
28
|
+
lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
|
|
29
|
+
return lroResponse;
|
|
28
30
|
},
|
|
29
31
|
};
|
|
30
32
|
return new LroEngine(poller, options);
|