@azure/arm-sitemanager 1.0.0-beta.1 → 1.0.0
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/README.md +1 -1
- package/dist/browser/api/edgeContext.d.ts +3 -0
- package/dist/browser/api/edgeContext.js +13 -9
- package/dist/browser/api/edgeContext.js.map +1 -1
- package/dist/browser/api/sites/operations.d.ts +1 -1
- package/dist/browser/api/sites/operations.js +43 -20
- package/dist/browser/api/sites/operations.js.map +1 -1
- package/dist/browser/api/sitesByServiceGroup/operations.d.ts +1 -1
- package/dist/browser/api/sitesByServiceGroup/operations.js +43 -20
- package/dist/browser/api/sitesByServiceGroup/operations.js.map +1 -1
- package/dist/browser/api/sitesBySubscription/operations.d.ts +1 -1
- package/dist/browser/api/sitesBySubscription/operations.js +43 -20
- package/dist/browser/api/sitesBySubscription/operations.js.map +1 -1
- package/dist/browser/classic/sites/index.d.ts +1 -1
- package/dist/browser/classic/sites/index.js +3 -1
- package/dist/browser/classic/sites/index.js.map +1 -1
- package/dist/browser/classic/sitesByServiceGroup/index.d.ts +1 -1
- package/dist/browser/classic/sitesByServiceGroup/index.js +3 -1
- package/dist/browser/classic/sitesByServiceGroup/index.js.map +1 -1
- package/dist/browser/classic/sitesBySubscription/index.d.ts +1 -1
- package/dist/browser/classic/sitesBySubscription/index.js +3 -1
- package/dist/browser/classic/sitesBySubscription/index.js.map +1 -1
- package/dist/browser/edgeClient.d.ts +2 -2
- package/dist/browser/edgeClient.js +15 -4
- package/dist/browser/edgeClient.js.map +1 -1
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/models/models.d.ts +3 -9
- package/dist/browser/models/models.js +3 -8
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/restorePollerHelpers.js +14 -16
- package/dist/browser/restorePollerHelpers.js.map +1 -1
- package/dist/browser/static-helpers/cloudSettingHelpers.d.ts +13 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.js +29 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/pagingHelpers.js +31 -50
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/browser/static-helpers/pollingHelpers.js +14 -11
- package/dist/browser/static-helpers/pollingHelpers.js.map +1 -1
- package/dist/browser/static-helpers/urlTemplate.js +4 -3
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -1
- package/dist/commonjs/api/edgeContext.d.ts +3 -0
- package/dist/commonjs/api/edgeContext.js +13 -9
- package/dist/commonjs/api/edgeContext.js.map +1 -1
- package/dist/commonjs/api/sites/operations.d.ts +1 -1
- package/dist/commonjs/api/sites/operations.js +43 -20
- package/dist/commonjs/api/sites/operations.js.map +1 -1
- package/dist/commonjs/api/sitesByServiceGroup/operations.d.ts +1 -1
- package/dist/commonjs/api/sitesByServiceGroup/operations.js +43 -20
- package/dist/commonjs/api/sitesByServiceGroup/operations.js.map +1 -1
- package/dist/commonjs/api/sitesBySubscription/operations.d.ts +1 -1
- package/dist/commonjs/api/sitesBySubscription/operations.js +43 -20
- package/dist/commonjs/api/sitesBySubscription/operations.js.map +1 -1
- package/dist/commonjs/classic/sites/index.d.ts +1 -1
- package/dist/commonjs/classic/sites/index.js +3 -1
- package/dist/commonjs/classic/sites/index.js.map +1 -1
- package/dist/commonjs/classic/sitesByServiceGroup/index.d.ts +1 -1
- package/dist/commonjs/classic/sitesByServiceGroup/index.js +3 -1
- package/dist/commonjs/classic/sitesByServiceGroup/index.js.map +1 -1
- package/dist/commonjs/classic/sitesBySubscription/index.d.ts +1 -1
- package/dist/commonjs/classic/sitesBySubscription/index.js +3 -1
- package/dist/commonjs/classic/sitesBySubscription/index.js.map +1 -1
- package/dist/commonjs/edgeClient.d.ts +2 -2
- package/dist/commonjs/edgeClient.js +20 -9
- package/dist/commonjs/edgeClient.js.map +1 -1
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.js +3 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/models/models.d.ts +3 -9
- package/dist/commonjs/models/models.js +3 -9
- package/dist/commonjs/models/models.js.map +1 -1
- package/dist/commonjs/restorePollerHelpers.js +14 -16
- package/dist/commonjs/restorePollerHelpers.js.map +1 -1
- package/dist/commonjs/static-helpers/cloudSettingHelpers.d.ts +13 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.js +33 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js +31 -50
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/commonjs/static-helpers/pollingHelpers.js +14 -11
- package/dist/commonjs/static-helpers/pollingHelpers.js.map +1 -1
- package/dist/commonjs/static-helpers/urlTemplate.js +4 -3
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/api/edgeContext.d.ts +3 -0
- package/dist/esm/api/edgeContext.js +13 -9
- package/dist/esm/api/edgeContext.js.map +1 -1
- package/dist/esm/api/sites/operations.d.ts +1 -1
- package/dist/esm/api/sites/operations.js +43 -20
- package/dist/esm/api/sites/operations.js.map +1 -1
- package/dist/esm/api/sitesByServiceGroup/operations.d.ts +1 -1
- package/dist/esm/api/sitesByServiceGroup/operations.js +43 -20
- package/dist/esm/api/sitesByServiceGroup/operations.js.map +1 -1
- package/dist/esm/api/sitesBySubscription/operations.d.ts +1 -1
- package/dist/esm/api/sitesBySubscription/operations.js +43 -20
- package/dist/esm/api/sitesBySubscription/operations.js.map +1 -1
- package/dist/esm/classic/sites/index.d.ts +1 -1
- package/dist/esm/classic/sites/index.js +3 -1
- package/dist/esm/classic/sites/index.js.map +1 -1
- package/dist/esm/classic/sitesByServiceGroup/index.d.ts +1 -1
- package/dist/esm/classic/sitesByServiceGroup/index.js +3 -1
- package/dist/esm/classic/sitesByServiceGroup/index.js.map +1 -1
- package/dist/esm/classic/sitesBySubscription/index.d.ts +1 -1
- package/dist/esm/classic/sitesBySubscription/index.js +3 -1
- package/dist/esm/classic/sitesBySubscription/index.js.map +1 -1
- package/dist/esm/edgeClient.d.ts +2 -2
- package/dist/esm/edgeClient.js +15 -4
- package/dist/esm/edgeClient.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/models.d.ts +3 -9
- package/dist/esm/models/models.js +3 -8
- package/dist/esm/models/models.js.map +1 -1
- package/dist/esm/restorePollerHelpers.js +14 -16
- package/dist/esm/restorePollerHelpers.js.map +1 -1
- package/dist/esm/static-helpers/cloudSettingHelpers.d.ts +13 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.js +29 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/pagingHelpers.js +31 -50
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/esm/static-helpers/pollingHelpers.js +14 -11
- package/dist/esm/static-helpers/pollingHelpers.js.map +1 -1
- package/dist/esm/static-helpers/urlTemplate.js +4 -3
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -1
- package/dist/react-native/api/edgeContext.d.ts +3 -0
- package/dist/react-native/api/edgeContext.js +13 -9
- package/dist/react-native/api/edgeContext.js.map +1 -1
- package/dist/react-native/api/sites/operations.d.ts +1 -1
- package/dist/react-native/api/sites/operations.js +43 -20
- package/dist/react-native/api/sites/operations.js.map +1 -1
- package/dist/react-native/api/sitesByServiceGroup/operations.d.ts +1 -1
- package/dist/react-native/api/sitesByServiceGroup/operations.js +43 -20
- package/dist/react-native/api/sitesByServiceGroup/operations.js.map +1 -1
- package/dist/react-native/api/sitesBySubscription/operations.d.ts +1 -1
- package/dist/react-native/api/sitesBySubscription/operations.js +43 -20
- package/dist/react-native/api/sitesBySubscription/operations.js.map +1 -1
- package/dist/react-native/classic/sites/index.d.ts +1 -1
- package/dist/react-native/classic/sites/index.js +3 -1
- package/dist/react-native/classic/sites/index.js.map +1 -1
- package/dist/react-native/classic/sitesByServiceGroup/index.d.ts +1 -1
- package/dist/react-native/classic/sitesByServiceGroup/index.js +3 -1
- package/dist/react-native/classic/sitesByServiceGroup/index.js.map +1 -1
- package/dist/react-native/classic/sitesBySubscription/index.d.ts +1 -1
- package/dist/react-native/classic/sitesBySubscription/index.js +3 -1
- package/dist/react-native/classic/sitesBySubscription/index.js.map +1 -1
- package/dist/react-native/edgeClient.d.ts +2 -2
- package/dist/react-native/edgeClient.js +15 -4
- package/dist/react-native/edgeClient.js.map +1 -1
- package/dist/react-native/index.d.ts +2 -0
- package/dist/react-native/index.js +2 -0
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/models/models.d.ts +3 -9
- package/dist/react-native/models/models.js +3 -8
- package/dist/react-native/models/models.js.map +1 -1
- package/dist/react-native/restorePollerHelpers.js +14 -16
- package/dist/react-native/restorePollerHelpers.js.map +1 -1
- package/dist/react-native/static-helpers/cloudSettingHelpers.d.ts +13 -0
- package/dist/react-native/static-helpers/cloudSettingHelpers.js +29 -0
- package/dist/react-native/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/pagingHelpers.js +31 -50
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/react-native/static-helpers/pollingHelpers.js +14 -11
- package/dist/react-native/static-helpers/pollingHelpers.js.map +1 -1
- package/dist/react-native/static-helpers/urlTemplate.js +4 -3
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -1
- package/package.json +30 -31
- package/CHANGELOG.md +0 -7
- package/dist/browser/api/edgeContext.d.ts.map +0 -1
- package/dist/browser/api/index.d.ts.map +0 -1
- package/dist/browser/api/sites/index.d.ts.map +0 -1
- package/dist/browser/api/sites/operations.d.ts.map +0 -1
- package/dist/browser/api/sites/options.d.ts.map +0 -1
- package/dist/browser/api/sitesByServiceGroup/index.d.ts.map +0 -1
- package/dist/browser/api/sitesByServiceGroup/operations.d.ts.map +0 -1
- package/dist/browser/api/sitesByServiceGroup/options.d.ts.map +0 -1
- package/dist/browser/api/sitesBySubscription/index.d.ts.map +0 -1
- package/dist/browser/api/sitesBySubscription/operations.d.ts.map +0 -1
- package/dist/browser/api/sitesBySubscription/options.d.ts.map +0 -1
- package/dist/browser/classic/index.d.ts.map +0 -1
- package/dist/browser/classic/sites/index.d.ts.map +0 -1
- package/dist/browser/classic/sitesByServiceGroup/index.d.ts.map +0 -1
- package/dist/browser/classic/sitesBySubscription/index.d.ts.map +0 -1
- package/dist/browser/edgeClient.d.ts.map +0 -1
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/logger.d.ts.map +0 -1
- package/dist/browser/models/index.d.ts.map +0 -1
- package/dist/browser/models/models.d.ts.map +0 -1
- package/dist/browser/restorePollerHelpers.d.ts.map +0 -1
- package/dist/browser/static-helpers/pagingHelpers.d.ts.map +0 -1
- package/dist/browser/static-helpers/pollingHelpers.d.ts.map +0 -1
- package/dist/browser/static-helpers/urlTemplate.d.ts.map +0 -1
- package/dist/commonjs/api/edgeContext.d.ts.map +0 -1
- package/dist/commonjs/api/index.d.ts.map +0 -1
- package/dist/commonjs/api/sites/index.d.ts.map +0 -1
- package/dist/commonjs/api/sites/operations.d.ts.map +0 -1
- package/dist/commonjs/api/sites/options.d.ts.map +0 -1
- package/dist/commonjs/api/sitesByServiceGroup/index.d.ts.map +0 -1
- package/dist/commonjs/api/sitesByServiceGroup/operations.d.ts.map +0 -1
- package/dist/commonjs/api/sitesByServiceGroup/options.d.ts.map +0 -1
- package/dist/commonjs/api/sitesBySubscription/index.d.ts.map +0 -1
- package/dist/commonjs/api/sitesBySubscription/operations.d.ts.map +0 -1
- package/dist/commonjs/api/sitesBySubscription/options.d.ts.map +0 -1
- package/dist/commonjs/classic/index.d.ts.map +0 -1
- package/dist/commonjs/classic/sites/index.d.ts.map +0 -1
- package/dist/commonjs/classic/sitesByServiceGroup/index.d.ts.map +0 -1
- package/dist/commonjs/classic/sitesBySubscription/index.d.ts.map +0 -1
- package/dist/commonjs/edgeClient.d.ts.map +0 -1
- package/dist/commonjs/index.d.ts.map +0 -1
- package/dist/commonjs/logger.d.ts.map +0 -1
- package/dist/commonjs/models/index.d.ts.map +0 -1
- package/dist/commonjs/models/models.d.ts.map +0 -1
- package/dist/commonjs/restorePollerHelpers.d.ts.map +0 -1
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts.map +0 -1
- package/dist/commonjs/static-helpers/pollingHelpers.d.ts.map +0 -1
- package/dist/commonjs/static-helpers/urlTemplate.d.ts.map +0 -1
- package/dist/esm/api/edgeContext.d.ts.map +0 -1
- package/dist/esm/api/index.d.ts.map +0 -1
- package/dist/esm/api/sites/index.d.ts.map +0 -1
- package/dist/esm/api/sites/operations.d.ts.map +0 -1
- package/dist/esm/api/sites/options.d.ts.map +0 -1
- package/dist/esm/api/sitesByServiceGroup/index.d.ts.map +0 -1
- package/dist/esm/api/sitesByServiceGroup/operations.d.ts.map +0 -1
- package/dist/esm/api/sitesByServiceGroup/options.d.ts.map +0 -1
- package/dist/esm/api/sitesBySubscription/index.d.ts.map +0 -1
- package/dist/esm/api/sitesBySubscription/operations.d.ts.map +0 -1
- package/dist/esm/api/sitesBySubscription/options.d.ts.map +0 -1
- package/dist/esm/classic/index.d.ts.map +0 -1
- package/dist/esm/classic/sites/index.d.ts.map +0 -1
- package/dist/esm/classic/sitesByServiceGroup/index.d.ts.map +0 -1
- package/dist/esm/classic/sitesBySubscription/index.d.ts.map +0 -1
- package/dist/esm/edgeClient.d.ts.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/logger.d.ts.map +0 -1
- package/dist/esm/models/index.d.ts.map +0 -1
- package/dist/esm/models/models.d.ts.map +0 -1
- package/dist/esm/restorePollerHelpers.d.ts.map +0 -1
- package/dist/esm/static-helpers/pagingHelpers.d.ts.map +0 -1
- package/dist/esm/static-helpers/pollingHelpers.d.ts.map +0 -1
- package/dist/esm/static-helpers/urlTemplate.d.ts.map +0 -1
- package/dist/react-native/api/edgeContext.d.ts.map +0 -1
- package/dist/react-native/api/index.d.ts.map +0 -1
- package/dist/react-native/api/sites/index.d.ts.map +0 -1
- package/dist/react-native/api/sites/operations.d.ts.map +0 -1
- package/dist/react-native/api/sites/options.d.ts.map +0 -1
- package/dist/react-native/api/sitesByServiceGroup/index.d.ts.map +0 -1
- package/dist/react-native/api/sitesByServiceGroup/operations.d.ts.map +0 -1
- package/dist/react-native/api/sitesByServiceGroup/options.d.ts.map +0 -1
- package/dist/react-native/api/sitesBySubscription/index.d.ts.map +0 -1
- package/dist/react-native/api/sitesBySubscription/operations.d.ts.map +0 -1
- package/dist/react-native/api/sitesBySubscription/options.d.ts.map +0 -1
- package/dist/react-native/classic/index.d.ts.map +0 -1
- package/dist/react-native/classic/sites/index.d.ts.map +0 -1
- package/dist/react-native/classic/sitesByServiceGroup/index.d.ts.map +0 -1
- package/dist/react-native/classic/sitesBySubscription/index.d.ts.map +0 -1
- package/dist/react-native/edgeClient.d.ts.map +0 -1
- package/dist/react-native/index.d.ts.map +0 -1
- package/dist/react-native/logger.d.ts.map +0 -1
- package/dist/react-native/models/index.d.ts.map +0 -1
- package/dist/react-native/models/models.d.ts.map +0 -1
- package/dist/react-native/restorePollerHelpers.d.ts.map +0 -1
- package/dist/react-native/static-helpers/pagingHelpers.d.ts.map +0 -1
- package/dist/react-native/static-helpers/pollingHelpers.d.ts.map +0 -1
- package/dist/react-native/static-helpers/urlTemplate.d.ts.map +0 -1
- package/review/arm-sitemanager-api-sites.api.md +0 -50
- package/review/arm-sitemanager-api-sitesByServiceGroup.api.md +0 -50
- package/review/arm-sitemanager-api-sitesBySubscription.api.md +0 -50
- package/review/arm-sitemanager-api.api.md +0 -27
- package/review/arm-sitemanager-models.api.md +0 -115
- package/review/arm-sitemanager.api.md +0 -255
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/models/models.ts"],"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AC,aAAa,CAAC;YACrB,CAAC,CAAC,+BAA+B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACxD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC;KACvB,CAAC;AACJ,CAAC;AAUD,SAAgB,2BAA2B,CAAC,IAAS;IACnD,OAAO;QACL,KAAK,EAAE,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3C,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;KAC3B,CAAC;AACJ,CAAC;AAED,SAAgB,mBAAmB,CAAC,MAAmB;IACrD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,qBAAqB,CAAC,MAAmB;IACvD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,6BAA6B;AAC7B,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,uCAAuC;IACvC,wDAAuC,CAAA;IACvC,uCAAuC;IACvC,wDAAuC,CAAA;AACzC,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Site as ARM Resource */\nexport interface Site extends ProxyResource {\n /** The resource-specific properties for this resource. */\n properties?: SiteProperties;\n}\n\nexport function siteSerializer(item: Site): any {\n return {\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : sitePropertiesSerializer(item[\"properties\"]),\n };\n}\n\nexport function siteDeserializer(item: any): Site {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : sitePropertiesDeserializer(item[\"properties\"]),\n };\n}\n\n/** Site properties */\nexport interface SiteProperties {\n /** displayName of Site resource */\n displayName?: string;\n /** Description of Site resource */\n description?: string;\n /** Physical address of the site */\n siteAddress?: SiteAddressProperties;\n /** Key-value pairs for labeling the site resource. */\n labels?: Record<string, string>;\n /** Provisioning state of last operation */\n readonly provisioningState?: ResourceProvisioningState;\n}\n\nexport function sitePropertiesSerializer(item: SiteProperties): any {\n return {\n displayName: item[\"displayName\"],\n description: item[\"description\"],\n siteAddress: !item[\"siteAddress\"]\n ? item[\"siteAddress\"]\n : siteAddressPropertiesSerializer(item[\"siteAddress\"]),\n labels: item[\"labels\"],\n };\n}\n\nexport function sitePropertiesDeserializer(item: any): SiteProperties {\n return {\n displayName: item[\"displayName\"],\n description: item[\"description\"],\n siteAddress: !item[\"siteAddress\"]\n ? item[\"siteAddress\"]\n : siteAddressPropertiesDeserializer(item[\"siteAddress\"]),\n labels: item[\"labels\"],\n provisioningState: item[\"provisioningState\"],\n };\n}\n\n/** Site address properties */\nexport interface SiteAddressProperties {\n /** First line of the street address */\n streetAddress1?: string;\n /** Second line of the street address */\n streetAddress2?: string;\n /** City of the address */\n city?: string;\n /** State or province of the address */\n stateOrProvince?: string;\n /** Country of the address */\n country?: string;\n /** Postal or ZIP code of the address */\n postalCode?: string;\n}\n\nexport function siteAddressPropertiesSerializer(item: SiteAddressProperties): any {\n return {\n streetAddress1: item[\"streetAddress1\"],\n streetAddress2: item[\"streetAddress2\"],\n city: item[\"city\"],\n stateOrProvince: item[\"stateOrProvince\"],\n country: item[\"country\"],\n postalCode: item[\"postalCode\"],\n };\n}\n\nexport function siteAddressPropertiesDeserializer(item: any): SiteAddressProperties {\n return {\n streetAddress1: item[\"streetAddress1\"],\n streetAddress2: item[\"streetAddress2\"],\n city: item[\"city\"],\n stateOrProvince: item[\"stateOrProvince\"],\n country: item[\"country\"],\n postalCode: item[\"postalCode\"],\n };\n}\n\n/** The provisioning state of a resource type. */\nexport enum KnownResourceProvisioningState {\n /** Resource has been created. */\n Succeeded = \"Succeeded\",\n /** Resource creation failed. */\n Failed = \"Failed\",\n /** Resource creation was canceled. */\n Canceled = \"Canceled\",\n}\n\n/**\n * The provisioning state of a resource type. \\\n * {@link KnownResourceProvisioningState} can be used interchangeably with ResourceProvisioningState,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Succeeded**: Resource has been created. \\\n * **Failed**: Resource creation failed. \\\n * **Canceled**: Resource creation was canceled.\n */\nexport type ResourceProvisioningState = string;\n\n/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */\nexport interface ProxyResource extends Resource {}\n\nexport function proxyResourceSerializer(item: ProxyResource): any {\n return item;\n}\n\nexport function proxyResourceDeserializer(item: any): ProxyResource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n };\n}\n\n/** Common fields that are returned in the response for all Azure Resource Manager resources */\nexport interface Resource {\n /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */\n readonly id?: string;\n /** The name of the resource */\n readonly name?: string;\n /** The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\" */\n readonly type?: string;\n /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */\n readonly systemData?: SystemData;\n}\n\nexport function resourceSerializer(item: Resource): any {\n return item;\n}\n\nexport function resourceDeserializer(item: any): Resource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n };\n}\n\n/** Metadata pertaining to creation and last modification of the resource. */\nexport interface SystemData {\n /** The identity that created the resource. */\n createdBy?: string;\n /** The type of identity that created the resource. */\n createdByType?: CreatedByType;\n /** The timestamp of resource creation (UTC). */\n createdAt?: Date;\n /** The identity that last modified the resource. */\n lastModifiedBy?: string;\n /** The type of identity that last modified the resource. */\n lastModifiedByType?: CreatedByType;\n /** The timestamp of resource last modification (UTC) */\n lastModifiedAt?: Date;\n}\n\nexport function systemDataDeserializer(item: any): SystemData {\n return {\n createdBy: item[\"createdBy\"],\n createdByType: item[\"createdByType\"],\n createdAt: !item[\"createdAt\"] ? item[\"createdAt\"] : new Date(item[\"createdAt\"]),\n lastModifiedBy: item[\"lastModifiedBy\"],\n lastModifiedByType: item[\"lastModifiedByType\"],\n lastModifiedAt: !item[\"lastModifiedAt\"]\n ? item[\"lastModifiedAt\"]\n : new Date(item[\"lastModifiedAt\"]),\n };\n}\n\n/** The kind of entity that created the resource. */\nexport enum KnownCreatedByType {\n /** The entity was created by a user. */\n User = \"User\",\n /** The entity was created by an application. */\n Application = \"Application\",\n /** The entity was created by a managed identity. */\n ManagedIdentity = \"ManagedIdentity\",\n /** The entity was created by a key. */\n Key = \"Key\",\n}\n\n/**\n * The kind of entity that created the resource. \\\n * {@link KnowncreatedByType} can be used interchangeably with createdByType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **User**: The entity was created by a user. \\\n * **Application**: The entity was created by an application. \\\n * **ManagedIdentity**: The entity was created by a managed identity. \\\n * **Key**: The entity was created by a key.\n */\nexport type CreatedByType = string;\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */\nexport interface ErrorResponse {\n /** The error object. */\n error?: ErrorDetail;\n}\n\nexport function errorResponseDeserializer(item: any): ErrorResponse {\n return {\n error: !item[\"error\"] ? item[\"error\"] : errorDetailDeserializer(item[\"error\"]),\n };\n}\n\n/** The error detail. */\nexport interface ErrorDetail {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: ErrorDetail[];\n /** The error additional info. */\n readonly additionalInfo?: ErrorAdditionalInfo[];\n}\n\nexport function errorDetailDeserializer(item: any): ErrorDetail {\n return {\n code: item[\"code\"],\n message: item[\"message\"],\n target: item[\"target\"],\n details: !item[\"details\"] ? item[\"details\"] : errorDetailArrayDeserializer(item[\"details\"]),\n additionalInfo: !item[\"additionalInfo\"]\n ? item[\"additionalInfo\"]\n : errorAdditionalInfoArrayDeserializer(item[\"additionalInfo\"]),\n };\n}\n\nexport function errorDetailArrayDeserializer(result: Array<ErrorDetail>): any[] {\n return result.map((item) => {\n return errorDetailDeserializer(item);\n });\n}\n\nexport function errorAdditionalInfoArrayDeserializer(result: Array<ErrorAdditionalInfo>): any[] {\n return result.map((item) => {\n return errorAdditionalInfoDeserializer(item);\n });\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfo {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: Record<string, any>;\n}\n\nexport function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo {\n return {\n type: item[\"type\"],\n info: !item[\"info\"] ? item[\"info\"] : _errorAdditionalInfoInfoDeserializer(item[\"info\"]),\n };\n}\n\n/** model interface _ErrorAdditionalInfoInfo */\nexport interface _ErrorAdditionalInfoInfo {}\n\nexport function _errorAdditionalInfoInfoDeserializer(item: any): _ErrorAdditionalInfoInfo {\n return item;\n}\n\n/** The type used for update operations of the Site. */\nexport interface SiteUpdate {\n /** The updatable properties of the Site. */\n properties?: SiteUpdateProperties;\n}\n\nexport function siteUpdateSerializer(item: SiteUpdate): any {\n return {\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : siteUpdatePropertiesSerializer(item[\"properties\"]),\n };\n}\n\n/** The updatable properties of the Site. */\nexport interface SiteUpdateProperties {\n /** displayName of Site resource */\n displayName?: string;\n /** Description of Site resource */\n description?: string;\n /** Physical address of the site */\n siteAddress?: SiteAddressProperties;\n /** Key-value pairs for labeling the site resource. */\n labels?: Record<string, string>;\n}\n\nexport function siteUpdatePropertiesSerializer(item: SiteUpdateProperties): any {\n return {\n displayName: item[\"displayName\"],\n description: item[\"description\"],\n siteAddress: !item[\"siteAddress\"]\n ? item[\"siteAddress\"]\n : siteAddressPropertiesSerializer(item[\"siteAddress\"]),\n labels: item[\"labels\"],\n };\n}\n\n/** The response of a Site list operation. */\nexport interface _SiteListResult {\n /** The Site items on this page */\n value: Site[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\nexport function _siteListResultDeserializer(item: any): _SiteListResult {\n return {\n value: siteArrayDeserializer(item[\"value\"]),\n nextLink: item[\"nextLink\"],\n };\n}\n\nexport function siteArraySerializer(result: Array<Site>): any[] {\n return result.map((item) => {\n return siteSerializer(item);\n });\n}\n\nexport function siteArrayDeserializer(result: Array<Site>): any[] {\n return result.map((item) => {\n return siteDeserializer(item);\n });\n}\n\n/** Supported API Versions */\nexport enum KnownVersions {\n /** API Version - 2024-02-01-preview */\n V20240201Preview = \"2024-02-01-preview\",\n /** API Version - 2025-03-01-preview */\n V20250301Preview = \"2025-03-01-preview\",\n}\n"]}
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAQlC,wCAMC;AAED,4CAYC;AAgBD,4DASC;AAED,gEAUC;AAkBD,0EASC;AAED,8EASC;AA0BD,0DAEC;AAED,8DASC;AAcD,gDAEC;AAED,oDASC;AAkBD,wDAWC;AAgCD,8DAIC;AAgBD,0DAUC;AAED,oEAIC;AAED,oFAIC;AAUD,0EAKC;AAQD,oDAMC;AAcD,wEASC;AAUD,kEAKC;AAED,kDAIC;AAED,sDAIC;AAvVD,SAAgB,cAAc,CAAC,IAAU;IACvC,OAAO;QACL,UAAU,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC;YAC7B,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;YACpB,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KACjD,CAAC;AACJ,CAAC;AAED,SAAgB,gBAAgB,CAAC,I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AAC1B,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Site as ARM Resource */\nexport interface Site extends ProxyResource {\n /** The resource-specific properties for this resource. */\n properties?: SiteProperties;\n}\n\nexport function siteSerializer(item: Site): any {\n return {\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : sitePropertiesSerializer(item[\"properties\"]),\n };\n}\n\nexport function siteDeserializer(item: any): Site {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : sitePropertiesDeserializer(item[\"properties\"]),\n };\n}\n\n/** Site properties */\nexport interface SiteProperties {\n /** displayName of Site resource */\n displayName?: string;\n /** Description of Site resource */\n description?: string;\n /** Physical address of the site */\n siteAddress?: SiteAddressProperties;\n /** Key-value pairs for labeling the site resource. */\n labels?: Record<string, string>;\n /** Provisioning state of last operation */\n readonly provisioningState?: ResourceProvisioningState;\n}\n\nexport function sitePropertiesSerializer(item: SiteProperties): any {\n return {\n displayName: item[\"displayName\"],\n description: item[\"description\"],\n siteAddress: !item[\"siteAddress\"]\n ? item[\"siteAddress\"]\n : siteAddressPropertiesSerializer(item[\"siteAddress\"]),\n labels: item[\"labels\"],\n };\n}\n\nexport function sitePropertiesDeserializer(item: any): SiteProperties {\n return {\n displayName: item[\"displayName\"],\n description: item[\"description\"],\n siteAddress: !item[\"siteAddress\"]\n ? item[\"siteAddress\"]\n : siteAddressPropertiesDeserializer(item[\"siteAddress\"]),\n labels: item[\"labels\"],\n provisioningState: item[\"provisioningState\"],\n };\n}\n\n/** Site address properties */\nexport interface SiteAddressProperties {\n /** First line of the street address */\n streetAddress1?: string;\n /** Second line of the street address */\n streetAddress2?: string;\n /** City of the address */\n city?: string;\n /** State or province of the address */\n stateOrProvince?: string;\n /** Country of the address */\n country?: string;\n /** Postal or ZIP code of the address */\n postalCode?: string;\n}\n\nexport function siteAddressPropertiesSerializer(item: SiteAddressProperties): any {\n return {\n streetAddress1: item[\"streetAddress1\"],\n streetAddress2: item[\"streetAddress2\"],\n city: item[\"city\"],\n stateOrProvince: item[\"stateOrProvince\"],\n country: item[\"country\"],\n postalCode: item[\"postalCode\"],\n };\n}\n\nexport function siteAddressPropertiesDeserializer(item: any): SiteAddressProperties {\n return {\n streetAddress1: item[\"streetAddress1\"],\n streetAddress2: item[\"streetAddress2\"],\n city: item[\"city\"],\n stateOrProvince: item[\"stateOrProvince\"],\n country: item[\"country\"],\n postalCode: item[\"postalCode\"],\n };\n}\n\n/** The provisioning state of a resource type. */\nexport enum KnownResourceProvisioningState {\n /** Resource has been created. */\n Succeeded = \"Succeeded\",\n /** Resource creation failed. */\n Failed = \"Failed\",\n /** Resource creation was canceled. */\n Canceled = \"Canceled\",\n}\n\n/**\n * The provisioning state of a resource type. \\\n * {@link KnownResourceProvisioningState} can be used interchangeably with ResourceProvisioningState,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **Succeeded**: Resource has been created. \\\n * **Failed**: Resource creation failed. \\\n * **Canceled**: Resource creation was canceled.\n */\nexport type ResourceProvisioningState = string;\n\n/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */\nexport interface ProxyResource extends Resource {}\n\nexport function proxyResourceSerializer(item: ProxyResource): any {\n return item;\n}\n\nexport function proxyResourceDeserializer(item: any): ProxyResource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n };\n}\n\n/** Common fields that are returned in the response for all Azure Resource Manager resources */\nexport interface Resource {\n /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */\n readonly id?: string;\n /** The name of the resource */\n readonly name?: string;\n /** The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\" */\n readonly type?: string;\n /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */\n readonly systemData?: SystemData;\n}\n\nexport function resourceSerializer(item: Resource): any {\n return item;\n}\n\nexport function resourceDeserializer(item: any): Resource {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n systemData: !item[\"systemData\"]\n ? item[\"systemData\"]\n : systemDataDeserializer(item[\"systemData\"]),\n };\n}\n\n/** Metadata pertaining to creation and last modification of the resource. */\nexport interface SystemData {\n /** The identity that created the resource. */\n createdBy?: string;\n /** The type of identity that created the resource. */\n createdByType?: CreatedByType;\n /** The timestamp of resource creation (UTC). */\n createdAt?: Date;\n /** The identity that last modified the resource. */\n lastModifiedBy?: string;\n /** The type of identity that last modified the resource. */\n lastModifiedByType?: CreatedByType;\n /** The timestamp of resource last modification (UTC) */\n lastModifiedAt?: Date;\n}\n\nexport function systemDataDeserializer(item: any): SystemData {\n return {\n createdBy: item[\"createdBy\"],\n createdByType: item[\"createdByType\"],\n createdAt: !item[\"createdAt\"] ? item[\"createdAt\"] : new Date(item[\"createdAt\"]),\n lastModifiedBy: item[\"lastModifiedBy\"],\n lastModifiedByType: item[\"lastModifiedByType\"],\n lastModifiedAt: !item[\"lastModifiedAt\"]\n ? item[\"lastModifiedAt\"]\n : new Date(item[\"lastModifiedAt\"]),\n };\n}\n\n/** The kind of entity that created the resource. */\nexport enum KnownCreatedByType {\n /** The entity was created by a user. */\n User = \"User\",\n /** The entity was created by an application. */\n Application = \"Application\",\n /** The entity was created by a managed identity. */\n ManagedIdentity = \"ManagedIdentity\",\n /** The entity was created by a key. */\n Key = \"Key\",\n}\n\n/**\n * The kind of entity that created the resource. \\\n * {@link KnowncreatedByType} can be used interchangeably with createdByType,\n * this enum contains the known values that the service supports.\n * ### Known values supported by the service\n * **User**: The entity was created by a user. \\\n * **Application**: The entity was created by an application. \\\n * **ManagedIdentity**: The entity was created by a managed identity. \\\n * **Key**: The entity was created by a key.\n */\nexport type CreatedByType = string;\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */\nexport interface ErrorResponse {\n /** The error object. */\n error?: ErrorDetail;\n}\n\nexport function errorResponseDeserializer(item: any): ErrorResponse {\n return {\n error: !item[\"error\"] ? item[\"error\"] : errorDetailDeserializer(item[\"error\"]),\n };\n}\n\n/** The error detail. */\nexport interface ErrorDetail {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: ErrorDetail[];\n /** The error additional info. */\n readonly additionalInfo?: ErrorAdditionalInfo[];\n}\n\nexport function errorDetailDeserializer(item: any): ErrorDetail {\n return {\n code: item[\"code\"],\n message: item[\"message\"],\n target: item[\"target\"],\n details: !item[\"details\"] ? item[\"details\"] : errorDetailArrayDeserializer(item[\"details\"]),\n additionalInfo: !item[\"additionalInfo\"]\n ? item[\"additionalInfo\"]\n : errorAdditionalInfoArrayDeserializer(item[\"additionalInfo\"]),\n };\n}\n\nexport function errorDetailArrayDeserializer(result: Array<ErrorDetail>): any[] {\n return result.map((item) => {\n return errorDetailDeserializer(item);\n });\n}\n\nexport function errorAdditionalInfoArrayDeserializer(result: Array<ErrorAdditionalInfo>): any[] {\n return result.map((item) => {\n return errorAdditionalInfoDeserializer(item);\n });\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfo {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: any;\n}\n\nexport function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo {\n return {\n type: item[\"type\"],\n info: item[\"info\"],\n };\n}\n\n/** The type used for update operations of the Site. */\nexport interface SiteUpdate {\n /** The updatable properties of the Site. */\n properties?: SiteUpdateProperties;\n}\n\nexport function siteUpdateSerializer(item: SiteUpdate): any {\n return {\n properties: !item[\"properties\"]\n ? item[\"properties\"]\n : siteUpdatePropertiesSerializer(item[\"properties\"]),\n };\n}\n\n/** The updatable properties of the Site. */\nexport interface SiteUpdateProperties {\n /** displayName of Site resource */\n displayName?: string;\n /** Description of Site resource */\n description?: string;\n /** Physical address of the site */\n siteAddress?: SiteAddressProperties;\n /** Key-value pairs for labeling the site resource. */\n labels?: Record<string, string>;\n}\n\nexport function siteUpdatePropertiesSerializer(item: SiteUpdateProperties): any {\n return {\n displayName: item[\"displayName\"],\n description: item[\"description\"],\n siteAddress: !item[\"siteAddress\"]\n ? item[\"siteAddress\"]\n : siteAddressPropertiesSerializer(item[\"siteAddress\"]),\n labels: item[\"labels\"],\n };\n}\n\n/** The response of a Site list operation. */\nexport interface _SiteListResult {\n /** The Site items on this page */\n value: Site[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\nexport function _siteListResultDeserializer(item: any): _SiteListResult {\n return {\n value: siteArrayDeserializer(item[\"value\"]),\n nextLink: item[\"nextLink\"],\n };\n}\n\nexport function siteArraySerializer(result: Array<Site>): any[] {\n return result.map((item) => {\n return siteSerializer(item);\n });\n}\n\nexport function siteArrayDeserializer(result: Array<Site>): any[] {\n return result.map((item) => {\n return siteDeserializer(item);\n });\n}\n\n/** Supported API Versions */\nexport enum KnownVersions {\n /** API Version - 2025-06-01 */\n V20250601 = \"2025-06-01\",\n}\n"]}
|
|
@@ -14,21 +14,20 @@ const core_lro_1 = require("@azure/core-lro");
|
|
|
14
14
|
* needs to be constructed after the original one is not in scope.
|
|
15
15
|
*/
|
|
16
16
|
function restorePoller(client, serializedState, sourceOperation, options) {
|
|
17
|
-
var _a, _b, _c;
|
|
18
17
|
const pollerConfig = (0, core_lro_1.deserializeState)(serializedState).config;
|
|
19
18
|
const { initialRequestUrl, requestMethod, metadata } = pollerConfig;
|
|
20
19
|
if (!initialRequestUrl || !requestMethod) {
|
|
21
|
-
throw new Error(`Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation
|
|
20
|
+
throw new Error(`Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`);
|
|
22
21
|
}
|
|
23
|
-
const resourceLocationConfig = metadata
|
|
24
|
-
const { deserializer, expectedStatuses = [] } =
|
|
25
|
-
const deserializeHelper =
|
|
22
|
+
const resourceLocationConfig = metadata?.["resourceLocationConfig"];
|
|
23
|
+
const { deserializer, expectedStatuses = [] } = getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};
|
|
24
|
+
const deserializeHelper = options?.processResponseBody ?? deserializer;
|
|
26
25
|
if (!deserializeHelper) {
|
|
27
|
-
throw new Error(`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation
|
|
26
|
+
throw new Error(`Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`);
|
|
28
27
|
}
|
|
29
|
-
return (0, pollingHelpers_js_1.getLongRunningPoller)(
|
|
30
|
-
updateIntervalInMs: options
|
|
31
|
-
abortSignal: options
|
|
28
|
+
return (0, pollingHelpers_js_1.getLongRunningPoller)(client["_client"] ?? client, deserializeHelper, expectedStatuses, {
|
|
29
|
+
updateIntervalInMs: options?.updateIntervalInMs,
|
|
30
|
+
abortSignal: options?.abortSignal,
|
|
32
31
|
resourceLocationConfig,
|
|
33
32
|
restoreFrom: serializedState,
|
|
34
33
|
initialRequestUrl,
|
|
@@ -37,19 +36,18 @@ function restorePoller(client, serializedState, sourceOperation, options) {
|
|
|
37
36
|
const deserializeMap = {
|
|
38
37
|
"PUT /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}": {
|
|
39
38
|
deserializer: operations_js_1._createOrUpdateDeserialize,
|
|
40
|
-
expectedStatuses: ["200", "201"],
|
|
39
|
+
expectedStatuses: ["200", "201", "202"],
|
|
41
40
|
},
|
|
42
41
|
"PUT /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}": {
|
|
43
42
|
deserializer: operations_js_2._createOrUpdateDeserialize,
|
|
44
|
-
expectedStatuses: ["200", "201"],
|
|
43
|
+
expectedStatuses: ["200", "201", "202"],
|
|
45
44
|
},
|
|
46
45
|
"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}": {
|
|
47
46
|
deserializer: operations_js_3._createOrUpdateDeserialize,
|
|
48
|
-
expectedStatuses: ["200", "201"],
|
|
47
|
+
expectedStatuses: ["200", "201", "202"],
|
|
49
48
|
},
|
|
50
49
|
};
|
|
51
50
|
function getDeserializationHelper(urlStr, method) {
|
|
52
|
-
var _a, _b, _c, _d;
|
|
53
51
|
const path = new URL(urlStr).pathname;
|
|
54
52
|
const pathParts = path.split("/");
|
|
55
53
|
// Traverse list to match the longest candidate
|
|
@@ -69,13 +67,13 @@ function getDeserializationHelper(urlStr, method) {
|
|
|
69
67
|
// track if we have found a match to return the values found.
|
|
70
68
|
let found = true;
|
|
71
69
|
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
72
|
-
if (
|
|
73
|
-
const start = candidateParts[i].indexOf("}") + 1, end =
|
|
70
|
+
if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
|
|
71
|
+
const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
|
|
74
72
|
// If the current part of the candidate is a "template" part
|
|
75
73
|
// Try to use the suffix of pattern to match the path
|
|
76
74
|
// {guid} ==> $
|
|
77
75
|
// {guid}:export ==> :export$
|
|
78
|
-
const isMatched = new RegExp(`${
|
|
76
|
+
const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
|
|
79
77
|
if (!isMatched) {
|
|
80
78
|
found = false;
|
|
81
79
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restorePollerHelpers.js","sourceRoot":"","sources":["../../src/restorePollerHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAmClC,sCAoCC;AApED,2EAAqF;AACrF,2EAAsI;AACtI,6DAA0G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AG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { EdgeClient } from \"./edgeClient.js\";\nimport { _createOrUpdateDeserialize } from \"./api/sitesByServiceGroup/operations.js\";\nimport { _createOrUpdateDeserialize as _createOrUpdateDeserializeSitesBySubscription } from \"./api/sitesBySubscription/operations.js\";\nimport { _createOrUpdateDeserialize as _createOrUpdateDeserializeSites } from \"./api/sites/operations.js\";\nimport { getLongRunningPoller } from \"./static-helpers/pollingHelpers.js\";\nimport { OperationOptions, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n PollerLike,\n OperationState,\n deserializeState,\n ResourceLocationConfig,\n} from \"@azure/core-lro\";\n\nexport interface RestorePollerOptions<\n TResult,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n> extends OperationOptions {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /** Deserialization function for raw response body */\n processResponseBody?: (result: TResponse) => Promise<TResult>;\n}\n\n/**\n * Creates a poller from the serialized state of another poller. This can be\n * useful when you want to create pollers on a different host or a poller\n * needs to be constructed after the original one is not in scope.\n */\nexport function restorePoller<TResponse extends PathUncheckedResponse, TResult>(\n client: EdgeClient,\n serializedState: string,\n sourceOperation: (...args: any[]) => PollerLike<OperationState<TResult>, TResult>,\n options?: RestorePollerOptions<TResult>,\n): PollerLike<OperationState<TResult>, TResult> {\n const pollerConfig = deserializeState(serializedState).config;\n const { initialRequestUrl, requestMethod, metadata } = pollerConfig;\n if (!initialRequestUrl || !requestMethod) {\n throw new Error(\n `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`,\n );\n }\n const resourceLocationConfig = metadata?.[\"resourceLocationConfig\"] as\n | ResourceLocationConfig\n | undefined;\n const { deserializer, expectedStatuses = [] } =\n getDeserializationHelper(initialRequestUrl, requestMethod) ?? {};\n const deserializeHelper = options?.processResponseBody ?? deserializer;\n if (!deserializeHelper) {\n throw new Error(\n `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`,\n );\n }\n return getLongRunningPoller(\n (client as any)[\"_client\"] ?? client,\n deserializeHelper as (result: TResponse) => Promise<TResult>,\n expectedStatuses,\n {\n updateIntervalInMs: options?.updateIntervalInMs,\n abortSignal: options?.abortSignal,\n resourceLocationConfig,\n restoreFrom: serializedState,\n initialRequestUrl,\n },\n );\n}\n\ninterface DeserializationHelper {\n deserializer: Function;\n expectedStatuses: string[];\n}\n\nconst deserializeMap: Record<string, DeserializationHelper> = {\n \"PUT /providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}\":\n {\n deserializer: _createOrUpdateDeserialize,\n expectedStatuses: [\"200\", \"201\", \"202\"],\n },\n \"PUT /subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}\": {\n deserializer: _createOrUpdateDeserializeSitesBySubscription,\n expectedStatuses: [\"200\", \"201\", \"202\"],\n },\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Edge/sites/{siteName}\":\n {\n deserializer: _createOrUpdateDeserializeSites,\n expectedStatuses: [\"200\", \"201\", \"202\"],\n },\n};\n\nfunction getDeserializationHelper(\n urlStr: string,\n method: string,\n): DeserializationHelper | undefined {\n const path = new URL(urlStr).pathname;\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: DeserializationHelper | undefined;\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(deserializeMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** An enum to describe Azure Cloud. */
|
|
2
|
+
export declare enum AzureClouds {
|
|
3
|
+
/** Azure public cloud, which is the default cloud for Azure SDKs. */
|
|
4
|
+
AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
|
|
5
|
+
/** Azure China cloud */
|
|
6
|
+
AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
|
|
7
|
+
/** Azure US government cloud */
|
|
8
|
+
AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT"
|
|
9
|
+
}
|
|
10
|
+
/** The supported values for cloud setting as a string literal type */
|
|
11
|
+
export type AzureSupportedClouds = `${AzureClouds}`;
|
|
12
|
+
export declare function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined;
|
|
13
|
+
//# sourceMappingURL=cloudSettingHelpers.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.AzureClouds = void 0;
|
|
6
|
+
exports.getArmEndpoint = getArmEndpoint;
|
|
7
|
+
/** An enum to describe Azure Cloud. */
|
|
8
|
+
var AzureClouds;
|
|
9
|
+
(function (AzureClouds) {
|
|
10
|
+
/** Azure public cloud, which is the default cloud for Azure SDKs. */
|
|
11
|
+
AzureClouds["AZURE_PUBLIC_CLOUD"] = "AZURE_PUBLIC_CLOUD";
|
|
12
|
+
/** Azure China cloud */
|
|
13
|
+
AzureClouds["AZURE_CHINA_CLOUD"] = "AZURE_CHINA_CLOUD";
|
|
14
|
+
/** Azure US government cloud */
|
|
15
|
+
AzureClouds["AZURE_US_GOVERNMENT"] = "AZURE_US_GOVERNMENT";
|
|
16
|
+
})(AzureClouds || (exports.AzureClouds = AzureClouds = {}));
|
|
17
|
+
function getArmEndpoint(cloudSetting) {
|
|
18
|
+
if (cloudSetting === undefined) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const cloudEndpoints = {
|
|
22
|
+
AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/",
|
|
23
|
+
AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/",
|
|
24
|
+
AZURE_PUBLIC_CLOUD: "https://management.azure.com/",
|
|
25
|
+
};
|
|
26
|
+
if (cloudSetting in cloudEndpoints) {
|
|
27
|
+
return cloudEndpoints[cloudSetting];
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
throw new Error(`Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=cloudSettingHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudSettingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/cloudSettingHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAelC,wCAgBC;AA7BD,uCAAuC;AACvC,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,qEAAqE;IACrE,wDAAyC,CAAA;IACzC,wBAAwB;IACxB,sDAAuC,CAAA;IACvC,gCAAgC;IAChC,0DAA2C,CAAA;AAC7C,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB;AAKD,SAAgB,cAAc,CAAC,YAAmC;IAChE,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,cAAc,GAA6C;QAC/D,iBAAiB,EAAE,sCAAsC;QACzD,mBAAmB,EAAE,uCAAuC;QAC5D,kBAAkB,EAAE,+BAA+B;KACpD,CAAC;IACF,IAAI,YAAY,IAAI,cAAc,EAAE,CAAC;QACnC,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,0BAA0B,YAAY,6DAA6D,CACpG,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** An enum to describe Azure Cloud. */\nexport enum AzureClouds {\n /** Azure public cloud, which is the default cloud for Azure SDKs. */\n AZURE_PUBLIC_CLOUD = \"AZURE_PUBLIC_CLOUD\",\n /** Azure China cloud */\n AZURE_CHINA_CLOUD = \"AZURE_CHINA_CLOUD\",\n /** Azure US government cloud */\n AZURE_US_GOVERNMENT = \"AZURE_US_GOVERNMENT\",\n}\n\n/** The supported values for cloud setting as a string literal type */\nexport type AzureSupportedClouds = `${AzureClouds}`;\n\nexport function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined {\n if (cloudSetting === undefined) {\n return undefined;\n }\n const cloudEndpoints: Record<keyof typeof AzureClouds, string> = {\n AZURE_CHINA_CLOUD: \"https://management.chinacloudapi.cn/\",\n AZURE_US_GOVERNMENT: \"https://management.usgovcloudapi.net/\",\n AZURE_PUBLIC_CLOUD: \"https://management.azure.com/\",\n };\n if (cloudSetting in cloudEndpoints) {\n return cloudEndpoints[cloudSetting];\n } else {\n throw new Error(\n `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`,\n );\n }\n}\n"]}
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.buildPagedAsyncIterator = buildPagedAsyncIterator;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
6
|
const core_client_1 = require("@azure-rest/core-client");
|
|
8
7
|
const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
|
|
9
8
|
/**
|
|
10
9
|
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
11
10
|
*/
|
|
12
11
|
function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody, expectedStatuses, options = {}) {
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const nextLinkName = (_b = options.nextLinkName) !== null && _b !== void 0 ? _b : "nextLink";
|
|
12
|
+
const itemName = options.itemName ?? "value";
|
|
13
|
+
const nextLinkName = options.nextLinkName ?? "nextLink";
|
|
16
14
|
const pagedResult = {
|
|
17
15
|
getPage: async (pageLink) => {
|
|
18
16
|
const result = pageLink === undefined
|
|
@@ -28,7 +26,7 @@ function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody
|
|
|
28
26
|
};
|
|
29
27
|
},
|
|
30
28
|
byPage: (settings) => {
|
|
31
|
-
const { continuationToken } = settings
|
|
29
|
+
const { continuationToken } = settings ?? {};
|
|
32
30
|
return getPageAsyncIterator(pagedResult, {
|
|
33
31
|
pageLink: continuationToken,
|
|
34
32
|
});
|
|
@@ -44,7 +42,6 @@ function buildPagedAsyncIterator(client, getInitialResponse, processResponseBody
|
|
|
44
42
|
* @returns a paged async iterator that iterates over results.
|
|
45
43
|
*/
|
|
46
44
|
function getPagedAsyncIterator(pagedResult) {
|
|
47
|
-
var _a;
|
|
48
45
|
const iter = getItemAsyncIterator(pagedResult);
|
|
49
46
|
return {
|
|
50
47
|
next() {
|
|
@@ -53,55 +50,39 @@ function getPagedAsyncIterator(pagedResult) {
|
|
|
53
50
|
[Symbol.asyncIterator]() {
|
|
54
51
|
return this;
|
|
55
52
|
},
|
|
56
|
-
byPage:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
byPage: pagedResult?.byPage ??
|
|
54
|
+
((settings) => {
|
|
55
|
+
const { continuationToken } = settings ?? {};
|
|
56
|
+
return getPageAsyncIterator(pagedResult, {
|
|
57
|
+
pageLink: continuationToken,
|
|
58
|
+
});
|
|
59
|
+
}),
|
|
62
60
|
};
|
|
63
61
|
}
|
|
64
|
-
function getItemAsyncIterator(pagedResult) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
for (var _d = true, pages_1 = tslib_1.__asyncValues(pages), pages_1_1; pages_1_1 = yield tslib_1.__await(pages_1.next()), _a = pages_1_1.done, !_a; _d = true) {
|
|
70
|
-
_c = pages_1_1.value;
|
|
71
|
-
_d = false;
|
|
72
|
-
const page = _c;
|
|
73
|
-
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
77
|
-
finally {
|
|
78
|
-
try {
|
|
79
|
-
if (!_d && !_a && (_b = pages_1.return)) yield tslib_1.__await(_b.call(pages_1));
|
|
80
|
-
}
|
|
81
|
-
finally { if (e_1) throw e_1.error; }
|
|
82
|
-
}
|
|
83
|
-
});
|
|
62
|
+
async function* getItemAsyncIterator(pagedResult) {
|
|
63
|
+
const pages = getPageAsyncIterator(pagedResult);
|
|
64
|
+
for await (const page of pages) {
|
|
65
|
+
yield* page;
|
|
66
|
+
}
|
|
84
67
|
}
|
|
85
|
-
function getPageAsyncIterator(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
68
|
+
async function* getPageAsyncIterator(pagedResult, options = {}) {
|
|
69
|
+
const { pageLink } = options;
|
|
70
|
+
let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);
|
|
71
|
+
if (!response) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
let result = response.page;
|
|
75
|
+
result.continuationToken = response.nextPageLink;
|
|
76
|
+
yield result;
|
|
77
|
+
while (response.nextPageLink) {
|
|
78
|
+
response = await pagedResult.getPage(response.nextPageLink);
|
|
89
79
|
if (!response) {
|
|
90
|
-
return
|
|
80
|
+
return;
|
|
91
81
|
}
|
|
92
|
-
|
|
82
|
+
result = response.page;
|
|
93
83
|
result.continuationToken = response.nextPageLink;
|
|
94
|
-
yield
|
|
95
|
-
|
|
96
|
-
response = yield tslib_1.__await(pagedResult.getPage(response.nextPageLink));
|
|
97
|
-
if (!response) {
|
|
98
|
-
return yield tslib_1.__await(void 0);
|
|
99
|
-
}
|
|
100
|
-
result = response.page;
|
|
101
|
-
result.continuationToken = response.nextPageLink;
|
|
102
|
-
yield yield tslib_1.__await(result);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
84
|
+
yield result;
|
|
85
|
+
}
|
|
105
86
|
}
|
|
106
87
|
/**
|
|
107
88
|
* Gets for the value of nextLink in the body
|
|
@@ -127,7 +108,7 @@ function getElements(body, itemName) {
|
|
|
127
108
|
if (!Array.isArray(value)) {
|
|
128
109
|
throw new core_rest_pipeline_1.RestError(`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`);
|
|
129
110
|
}
|
|
130
|
-
return value
|
|
111
|
+
return value ?? [];
|
|
131
112
|
}
|
|
132
113
|
/**
|
|
133
114
|
* Checks if a request failed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqFlC,0DAqCC;;AAxHD,yDAAyF;AACzF,kEAAsD;AA+EtD;;GAEG;AACH,SAAgB,uBAAuB,CAMrC,MAAc,EACd,kBAAgD,EAChD,mBAAgE,EAChE,gBAA0B,EAC1B,UAA0C,EAAE;;IAE5C,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC;IAC7C,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,YAAY,mCAAI,UAAU,CAAC;IACxD,MAAM,WAAW,GAAgD;QAC/D,OAAO,EAAE,KAAK,EAAE,QAAiB,EAAE,EAAE;YACnC,MAAM,MAAM,GACV,QAAQ,KAAK,SAAS;gBACpB,CAAC,CAAC,MAAM,kBAAkB,EAAE;gBAC5B,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;YACjD,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;YAC7C,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,MAAmB,CAAC,CAAC;YAC/D,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YACpD,MAAM,MAAM,GAAG,WAAW,CAAW,OAAO,EAAE,QAAQ,CAAU,CAAC;YACjE,OAAO;gBACL,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE,QAAQ;aACvB,CAAC;QACJ,CAAC;QACD,MAAM,EAAE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,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,8BAAS,CACjB,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAE,gBAA0B;IACrF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,IAAA,6BAAe,EACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options for the byPage method\n */\nexport interface PageSettings {\n /**\n * A reference to a specific page to start iterating from.\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that describes a page of results.\n */\nexport type ContinuablePage<TElement, TPage = TElement[]> = TPage & {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n};\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * Link to the first page of results.\n */\n firstPageLink?: string;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => TElement[];\n}\n\n/**\n * Options for the paging helper\n */\nexport interface BuildPagedAsyncIteratorOptions {\n itemName?: string;\n nextLinkName?: string;\n}\n\n/**\n * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator\n */\nexport function buildPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n>(\n client: Client,\n getInitialResponse: () => PromiseLike<TResponse>,\n processResponseBody: (result: TResponse) => PromiseLike<unknown>,\n expectedStatuses: string[],\n options: BuildPagedAsyncIteratorOptions = {},\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const itemName = options.itemName ?? \"value\";\n const nextLinkName = options.nextLinkName ?? \"nextLink\";\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n const result =\n pageLink === undefined\n ? await getInitialResponse()\n : await client.pathUnchecked(pageLink).get();\n checkPagingRequest(result, expectedStatuses);\n const results = await processResponseBody(result as TResponse);\n const nextLink = getNextLink(results, nextLinkName);\n const values = getElements<TElement>(results, itemName) as TPage;\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n byPage: (settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n },\n };\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\n\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n ((settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n }),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n for await (const page of pages) {\n yield* page as unknown as TElement[];\n }\n}\n\nasync function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n options: {\n pageLink?: string;\n } = {},\n): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n let result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n }\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\" && nextLink !== null) {\n throw new RestError(\n `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,\n );\n }\n\n if (nextLink === null) {\n return undefined;\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n if (!Array.isArray(value)) {\n throw new RestError(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pagingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pagingHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAqFlC,0DAqCC;AAxHD,yDAAyF;AACzF,kEAAsD;AA+EtD;;GAEG;AACH,SAAgB,uBAAuB,CAMrC,MAAc,EACd,kBAAgD,EAChD,mBAAgE,EAChE,gBAA0B,EAC1B,UAA0C,EAAE;IAE5C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC;IAC7C,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,UAAU,CAAC;IACxD,MAAM,WAAW,GAAgD;QAC/D,OAAO,EAAE,KAAK,EAAE,QAAiB,EAAE,EAAE;YACnC,MAAM,MAAM,GACV,QAAQ,KAAK,SAAS;gBACpB,CAAC,CAAC,MAAM,kBAAkB,EAAE;gBAC5B,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC;YACjD,kBAAk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CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAc,IAAa,EAAE,QAAgB;IAC/D,MAAM,KAAK,GAAI,IAAgC,CAAC,QAAQ,CAAQ,CAAC;IACjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,8BAAS,CACjB,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,IAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B,EAAE,gBAA0B;IACrF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,IAAA,6BAAe,EACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Client, createRestError, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\n\n/**\n * Options for the byPage method\n */\nexport interface PageSettings {\n /**\n * A reference to a specific page to start iterating from.\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that describes a page of results.\n */\nexport type ContinuablePage<TElement, TPage = TElement[]> = TPage & {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n};\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\nexport interface PagedResult<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n> {\n /**\n * Link to the first page of results.\n */\n firstPageLink?: string;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => TElement[];\n}\n\n/**\n * Options for the paging helper\n */\nexport interface BuildPagedAsyncIteratorOptions {\n itemName?: string;\n nextLinkName?: string;\n}\n\n/**\n * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator\n */\nexport function buildPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n TResponse extends PathUncheckedResponse = PathUncheckedResponse,\n>(\n client: Client,\n getInitialResponse: () => PromiseLike<TResponse>,\n processResponseBody: (result: TResponse) => PromiseLike<unknown>,\n expectedStatuses: string[],\n options: BuildPagedAsyncIteratorOptions = {},\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const itemName = options.itemName ?? \"value\";\n const nextLinkName = options.nextLinkName ?? \"nextLink\";\n const pagedResult: PagedResult<TElement, TPage, TPageSettings> = {\n getPage: async (pageLink?: string) => {\n const result =\n pageLink === undefined\n ? await getInitialResponse()\n : await client.pathUnchecked(pageLink).get();\n checkPagingRequest(result, expectedStatuses);\n const results = await processResponseBody(result as TResponse);\n const nextLink = getNextLink(results, nextLinkName);\n const values = getElements<TElement>(results, itemName) as TPage;\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n byPage: (settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n },\n };\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\n\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings extends PageSettings = PageSettings,\n>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n ((settings?: TPageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n });\n }),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n for await (const page of pages) {\n yield* page as unknown as TElement[];\n }\n}\n\nasync function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(\n pagedResult: PagedResult<TElement, TPage, TPageSettings>,\n options: {\n pageLink?: string;\n } = {},\n): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n let result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n result = response.page as ContinuablePage<TElement, TPage>;\n result.continuationToken = response.nextPageLink;\n yield result;\n }\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\" && nextLink !== null) {\n throw new RestError(\n `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,\n );\n }\n\n if (nextLink === null) {\n return undefined;\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n if (!Array.isArray(value)) {\n throw new RestError(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
|
|
@@ -21,23 +21,22 @@ function getLongRunningPoller(client, processResponseBody, expectedStatuses, opt
|
|
|
21
21
|
return getLroResponse(initialResponse, expectedStatuses);
|
|
22
22
|
},
|
|
23
23
|
sendPollRequest: async (path, pollOptions) => {
|
|
24
|
-
var _a, _b, _c, _d, _e, _f;
|
|
25
24
|
// The poll request would both listen to the user provided abort signal and the poller's own abort signal
|
|
26
25
|
function abortListener() {
|
|
27
26
|
pollAbortController.abort();
|
|
28
27
|
}
|
|
29
28
|
const abortSignal = pollAbortController.signal;
|
|
30
|
-
if (
|
|
29
|
+
if (options.abortSignal?.aborted) {
|
|
31
30
|
pollAbortController.abort();
|
|
32
31
|
}
|
|
33
|
-
else if (
|
|
32
|
+
else if (pollOptions?.abortSignal?.aborted) {
|
|
34
33
|
pollAbortController.abort();
|
|
35
34
|
}
|
|
36
35
|
else if (!abortSignal.aborted) {
|
|
37
|
-
|
|
36
|
+
options.abortSignal?.addEventListener("abort", abortListener, {
|
|
38
37
|
once: true,
|
|
39
38
|
});
|
|
40
|
-
|
|
39
|
+
pollOptions?.abortSignal?.addEventListener("abort", abortListener, {
|
|
41
40
|
once: true,
|
|
42
41
|
});
|
|
43
42
|
}
|
|
@@ -46,16 +45,16 @@ function getLongRunningPoller(client, processResponseBody, expectedStatuses, opt
|
|
|
46
45
|
response = await client.pathUnchecked(path).get({ abortSignal });
|
|
47
46
|
}
|
|
48
47
|
finally {
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
options.abortSignal?.removeEventListener("abort", abortListener);
|
|
49
|
+
pollOptions?.abortSignal?.removeEventListener("abort", abortListener);
|
|
51
50
|
}
|
|
52
51
|
return getLroResponse(response, expectedStatuses);
|
|
53
52
|
},
|
|
54
53
|
};
|
|
55
54
|
return (0, core_lro_1.createHttpPoller)(poller, {
|
|
56
|
-
intervalInMs: options
|
|
57
|
-
resourceLocationConfig: options
|
|
58
|
-
restoreFrom: options
|
|
55
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
56
|
+
resourceLocationConfig: options?.resourceLocationConfig,
|
|
57
|
+
restoreFrom: options?.restoreFrom,
|
|
59
58
|
processResult: (result) => {
|
|
60
59
|
return processResponseBody(result);
|
|
61
60
|
},
|
|
@@ -73,7 +72,11 @@ function getLroResponse(response, expectedStatuses) {
|
|
|
73
72
|
}
|
|
74
73
|
return {
|
|
75
74
|
flatResponse: response,
|
|
76
|
-
rawResponse:
|
|
75
|
+
rawResponse: {
|
|
76
|
+
...response,
|
|
77
|
+
statusCode: Number.parseInt(response.status),
|
|
78
|
+
body: response.body,
|
|
79
|
+
},
|
|
77
80
|
};
|
|
78
81
|
}
|
|
79
82
|
//# sourceMappingURL=pollingHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pollingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/pollingHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuClC,o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AAC,CAAC;gBACjE,WAAW,EAAE,WAAW,EAAE,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;YACxE,CAAC;YAED,OAAO,cAAc,CAAC,QAAqB,EAAE,gBAAgB,CAAC,CAAC;QACjE,CAAC;KACF,CAAC;IACF,OAAO,IAAA,2BAAgB,EAAC,MAAM,EAAE;QAC9B,YAAY,EAAE,OAAO,EAAE,kBAAkB;QACzC,sBAAsB,EAAE,OAAO,EAAE,sBAAsB;QACvD,WAAW,EAAE,OAAO,EAAE,WAAW;QACjC,aAAa,EAAE,CAAC,MAAe,EAAE,EAAE;YACjC,OAAO,mBAAmB,CAAC,MAAmB,CAAC,CAAC;QAClD,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AACD;;;;;GAKG;AACH,SAAS,cAAc,CACrB,QAAmB,EACnB,gBAA0B;IAE1B,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,IAAA,6BAAe,EAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,WAAW,EAAE;YACX,GAAG,QAAQ;YACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI;SACpB;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n PollerLike,\n OperationState,\n ResourceLocationConfig,\n RunningOperation,\n createHttpPoller,\n OperationResponse,\n} from \"@azure/core-lro\";\n\nimport { Client, PathUncheckedResponse, createRestError } from \"@azure-rest/core-client\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\n\nexport interface GetLongRunningPollerOptions<TResponse> {\n /** Delay to wait until next poll, in milliseconds. */\n updateIntervalInMs?: number;\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * The potential location of the result of the LRO if specified by the LRO extension in the swagger.\n */\n resourceLocationConfig?: ResourceLocationConfig;\n /**\n * The original url of the LRO\n * Should not be null when restoreFrom is set\n */\n initialRequestUrl?: string;\n /**\n * A serialized poller which can be used to resume an existing paused Long-Running-Operation.\n */\n restoreFrom?: string;\n /**\n * The function to get the initial response\n */\n getInitialResponse?: () => PromiseLike<TResponse>;\n}\nexport function getLongRunningPoller<TResponse extends PathUncheckedResponse, TResult = void>(\n client: Client,\n processResponseBody: (result: TResponse) => Promise<TResult>,\n expectedStatuses: string[],\n options: GetLongRunningPollerOptions<TResponse>,\n): PollerLike<OperationState<TResult>, TResult> {\n const { restoreFrom, getInitialResponse } = options;\n if (!restoreFrom && !getInitialResponse) {\n throw new Error(\"Either restoreFrom or getInitialResponse must be specified\");\n }\n let initialResponse: TResponse | undefined = undefined;\n const pollAbortController = new AbortController();\n const poller: RunningOperation<TResponse> = {\n sendInitialRequest: async () => {\n if (!getInitialResponse) {\n throw new Error(\"getInitialResponse is required when initializing a new poller\");\n }\n initialResponse = await getInitialResponse();\n return getLroResponse(initialResponse, expectedStatuses);\n },\n sendPollRequest: async (\n path: string,\n pollOptions?: {\n abortSignal?: AbortSignalLike;\n },\n ) => {\n // The poll request would both listen to the user provided abort signal and the poller's own abort signal\n function abortListener(): void {\n pollAbortController.abort();\n }\n const abortSignal = pollAbortController.signal;\n if (options.abortSignal?.aborted) {\n pollAbortController.abort();\n } else if (pollOptions?.abortSignal?.aborted) {\n pollAbortController.abort();\n } else if (!abortSignal.aborted) {\n options.abortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n pollOptions?.abortSignal?.addEventListener(\"abort\", abortListener, {\n once: true,\n });\n }\n let response;\n try {\n response = await client.pathUnchecked(path).get({ abortSignal });\n } finally {\n options.abortSignal?.removeEventListener(\"abort\", abortListener);\n pollOptions?.abortSignal?.removeEventListener(\"abort\", abortListener);\n }\n\n return getLroResponse(response as TResponse, expectedStatuses);\n },\n };\n return createHttpPoller(poller, {\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: options?.resourceLocationConfig,\n restoreFrom: options?.restoreFrom,\n processResult: (result: unknown) => {\n return processResponseBody(result as TResponse);\n },\n });\n}\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @param deserializeFn - deserialize function to convert Rest response to modular output\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResponse extends PathUncheckedResponse>(\n response: TResponse,\n expectedStatuses: string[],\n): OperationResponse<TResponse> {\n if (!expectedStatuses.includes(response.status)) {\n throw createRestError(response);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n"]}
|
|
@@ -7,7 +7,7 @@ exports.expandUrlTemplate = expandUrlTemplate;
|
|
|
7
7
|
// helpers
|
|
8
8
|
// ---------------------
|
|
9
9
|
function encodeComponent(val, reserved, op) {
|
|
10
|
-
return (reserved
|
|
10
|
+
return (reserved ?? op === "+") || op === "#"
|
|
11
11
|
? encodeReservedComponent(val)
|
|
12
12
|
: encodeRFC3986URIComponent(val);
|
|
13
13
|
}
|
|
@@ -145,7 +145,8 @@ function expandUrlTemplate(template, context, option) {
|
|
|
145
145
|
}
|
|
146
146
|
let op;
|
|
147
147
|
if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) {
|
|
148
|
-
|
|
148
|
+
op = expr[0];
|
|
149
|
+
expr = expr.slice(1);
|
|
149
150
|
}
|
|
150
151
|
const varList = expr.split(/,/g);
|
|
151
152
|
const result = [];
|
|
@@ -160,7 +161,7 @@ function expandUrlTemplate(template, context, option) {
|
|
|
160
161
|
varValue: context[varMatch[1]],
|
|
161
162
|
varName: varMatch[1],
|
|
162
163
|
modifier: varMatch[2] || varMatch[3],
|
|
163
|
-
reserved: option
|
|
164
|
+
reserved: option?.allowReserved,
|
|
164
165
|
});
|
|
165
166
|
if (varValue) {
|
|
166
167
|
result.push(varValue);
|