@azure/template-dpg 1.0.0-beta.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 +4 -3
- package/README.md +4 -6
- package/{types/src/src → dist/browser}/WidgetServiceClient.d.ts +3 -2
- package/dist/browser/WidgetServiceClient.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/browser}/WidgetServiceClient.js +3 -9
- package/dist/browser/WidgetServiceClient.js.map +1 -0
- package/{types/src/src → dist/browser}/api/WidgetServiceContext.d.ts +3 -3
- package/dist/browser/api/WidgetServiceContext.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/api/WidgetServiceContext.js +2 -2
- package/dist/browser/api/WidgetServiceContext.js.map +1 -0
- package/dist/browser/api/foo.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/browser}/api/foo.js +1 -1
- package/dist/browser/api/foo.js.map +1 -0
- package/dist/browser/api/index.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/api/index.js +1 -1
- package/dist/browser/api/index.js.map +1 -0
- package/dist/browser/api/models.d.ts.map +1 -0
- package/dist/browser/api/models.js +4 -0
- package/dist/browser/api/models.js.map +1 -0
- package/{types/src/src → dist/browser}/api/operations.d.ts +5 -4
- package/dist/browser/api/operations.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/api/operations.js +2 -2
- package/dist/browser/api/operations.js.map +1 -0
- package/{types/src/src → dist/browser}/common/interfaces.d.ts +1 -1
- package/dist/browser/common/interfaces.d.ts.map +1 -0
- package/dist/browser/common/interfaces.js +4 -0
- package/dist/browser/common/interfaces.js.map +1 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/browser}/index.js +1 -1
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/browser}/logger.js +1 -1
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/{types/src/src → dist/browser}/rest/clientDefinitions.d.ts +3 -3
- package/{types/src → dist/browser}/rest/clientDefinitions.d.ts.map +1 -1
- package/dist/browser/rest/clientDefinitions.js +4 -0
- package/dist/browser/rest/clientDefinitions.js.map +1 -0
- package/dist/browser/rest/index.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/browser}/rest/index.js +1 -1
- package/dist/browser/rest/index.js.map +1 -0
- package/{types/src/src → dist/browser}/rest/isUnexpected.d.ts +1 -1
- package/dist/browser/rest/isUnexpected.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/browser}/rest/isUnexpected.js +1 -1
- package/dist/browser/rest/isUnexpected.js.map +1 -0
- package/dist/browser/rest/models.d.ts.map +1 -0
- package/dist/browser/rest/models.js +4 -0
- package/dist/browser/rest/models.js.map +1 -0
- package/dist/browser/rest/outputModels.d.ts.map +1 -0
- package/dist/browser/rest/outputModels.js +4 -0
- package/dist/browser/rest/outputModels.js.map +1 -0
- package/{types/src/src → dist/browser}/rest/parameters.d.ts +2 -2
- package/dist/browser/rest/parameters.d.ts.map +1 -0
- package/dist/browser/rest/parameters.js +4 -0
- package/dist/browser/rest/parameters.js.map +1 -0
- package/{types/src/src → dist/browser}/rest/responses.d.ts +2 -2
- package/dist/browser/rest/responses.d.ts.map +1 -0
- package/dist/browser/rest/responses.js +4 -0
- package/dist/browser/rest/responses.js.map +1 -0
- package/{types/src/src → dist/browser}/rest/widgetServiceClient.d.ts +3 -3
- package/dist/browser/rest/widgetServiceClient.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/browser}/rest/widgetServiceClient.js +2 -9
- package/dist/browser/rest/widgetServiceClient.js.map +1 -0
- package/{types/src → dist/commonjs}/WidgetServiceClient.d.ts +3 -9
- package/dist/commonjs/WidgetServiceClient.d.ts.map +1 -0
- package/dist/commonjs/WidgetServiceClient.js +56 -0
- package/dist/commonjs/WidgetServiceClient.js.map +1 -0
- package/{types/src → dist/commonjs}/api/WidgetServiceContext.d.ts +3 -10
- package/dist/commonjs/api/WidgetServiceContext.d.ts.map +1 -0
- package/dist/commonjs/api/WidgetServiceContext.js +18 -0
- package/dist/commonjs/api/WidgetServiceContext.js.map +1 -0
- package/{types/src → dist/commonjs}/api/foo.d.ts +0 -7
- package/dist/commonjs/api/foo.d.ts.map +1 -0
- package/dist/commonjs/api/foo.js +16 -0
- package/dist/commonjs/api/foo.js.map +1 -0
- package/{types/src → dist/commonjs}/api/index.d.ts +0 -7
- package/dist/commonjs/api/index.d.ts.map +1 -0
- package/dist/commonjs/api/index.js +15 -0
- package/dist/commonjs/api/index.js.map +1 -0
- package/{types/src → dist/commonjs}/api/models.d.ts +0 -7
- package/dist/commonjs/api/models.d.ts.map +1 -0
- package/dist/commonjs/api/models.js +5 -0
- package/dist/commonjs/api/models.js.map +1 -0
- package/{types/src → dist/commonjs}/api/operations.d.ts +5 -11
- package/dist/commonjs/api/operations.d.ts.map +1 -0
- package/dist/commonjs/api/operations.js +191 -0
- package/dist/commonjs/api/operations.js.map +1 -0
- package/{types/src → dist/commonjs}/common/interfaces.d.ts +1 -8
- package/dist/commonjs/common/interfaces.d.ts.map +1 -0
- package/dist/commonjs/common/interfaces.js +5 -0
- package/dist/commonjs/common/interfaces.js.map +1 -0
- package/{types/src → dist/commonjs}/index.d.ts +0 -7
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +8 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +15 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/{types/src → dist/commonjs}/rest/clientDefinitions.d.ts +3 -10
- package/dist/commonjs/rest/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/rest/clientDefinitions.js +5 -0
- package/dist/commonjs/rest/clientDefinitions.js.map +1 -0
- package/{types/src → dist/commonjs}/rest/index.d.ts +0 -7
- package/dist/commonjs/rest/index.d.ts.map +1 -0
- package/dist/commonjs/rest/index.js +22 -0
- package/dist/commonjs/rest/index.js.map +1 -0
- package/{types/src → dist/commonjs}/rest/isUnexpected.d.ts +1 -8
- package/dist/commonjs/rest/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/rest/isUnexpected.js +78 -0
- package/dist/commonjs/rest/isUnexpected.js.map +1 -0
- package/{types/src → dist/commonjs}/rest/models.d.ts +0 -7
- package/dist/commonjs/rest/models.d.ts.map +1 -0
- package/dist/commonjs/rest/models.js +5 -0
- package/dist/commonjs/rest/models.js.map +1 -0
- package/{types/src → dist/commonjs}/rest/outputModels.d.ts +0 -7
- package/dist/commonjs/rest/outputModels.d.ts.map +1 -0
- package/dist/commonjs/rest/outputModels.js +5 -0
- package/dist/commonjs/rest/outputModels.js.map +1 -0
- package/{types/src → dist/commonjs}/rest/parameters.d.ts +2 -9
- package/dist/commonjs/rest/parameters.d.ts.map +1 -0
- package/dist/commonjs/rest/parameters.js +5 -0
- package/dist/commonjs/rest/parameters.js.map +1 -0
- package/{types/src → dist/commonjs}/rest/responses.d.ts +2 -9
- package/dist/commonjs/rest/responses.d.ts.map +1 -0
- package/dist/commonjs/rest/responses.js +5 -0
- package/dist/commonjs/rest/responses.js.map +1 -0
- package/{types/src → dist/commonjs}/rest/widgetServiceClient.d.ts +3 -10
- package/dist/commonjs/rest/widgetServiceClient.d.ts.map +1 -0
- package/dist/commonjs/rest/widgetServiceClient.js +42 -0
- package/dist/commonjs/rest/widgetServiceClient.js.map +1 -0
- package/{types/latest → dist/commonjs}/tsdoc-metadata.json +1 -1
- package/dist/esm/WidgetServiceClient.d.ts +42 -0
- package/dist/esm/WidgetServiceClient.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/WidgetServiceClient.js +3 -16
- package/dist/esm/WidgetServiceClient.js.map +1 -0
- package/dist/esm/api/WidgetServiceContext.d.ts +19 -0
- package/dist/esm/api/WidgetServiceContext.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/esm}/api/WidgetServiceContext.js +2 -2
- package/dist/esm/api/WidgetServiceContext.js.map +1 -0
- package/dist/esm/api/foo.d.ts +9 -0
- package/dist/esm/api/foo.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/api/foo.js +1 -8
- package/dist/esm/api/foo.js.map +1 -0
- package/dist/esm/api/index.d.ts +11 -0
- package/dist/esm/api/index.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/esm}/api/index.js +1 -1
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/models.d.ts +25 -0
- package/dist/esm/api/models.d.ts.map +1 -0
- package/dist/esm/api/models.js +4 -0
- package/dist/esm/api/models.js.map +1 -0
- package/dist/esm/api/operations.d.ts +68 -0
- package/dist/esm/api/operations.d.ts.map +1 -0
- package/{dist-esm/src/src → dist/esm}/api/operations.js +2 -2
- package/dist/esm/api/operations.js.map +1 -0
- package/dist/esm/common/interfaces.d.ts +21 -0
- package/dist/esm/common/interfaces.d.ts.map +1 -0
- package/dist/esm/common/interfaces.js +4 -0
- package/dist/esm/common/interfaces.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/index.js +1 -1
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/logger.js +1 -8
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/rest/clientDefinitions.d.ts +52 -0
- package/dist/esm/rest/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/rest/clientDefinitions.js +4 -0
- package/dist/esm/rest/clientDefinitions.js.map +1 -0
- package/dist/esm/rest/index.d.ts +17 -0
- package/dist/esm/rest/index.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/rest/index.js +1 -8
- package/dist/esm/rest/index.js.map +1 -0
- package/dist/esm/rest/isUnexpected.d.ts +15 -0
- package/dist/esm/rest/isUnexpected.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/rest/isUnexpected.js +1 -1
- package/dist/esm/rest/isUnexpected.js.map +1 -0
- package/dist/esm/rest/models.d.ts +20 -0
- package/dist/esm/rest/models.d.ts.map +1 -0
- package/dist/esm/rest/models.js +4 -0
- package/dist/esm/rest/models.js.map +1 -0
- package/dist/esm/rest/outputModels.d.ts +25 -0
- package/dist/esm/rest/outputModels.d.ts.map +1 -0
- package/dist/esm/rest/outputModels.js +4 -0
- package/dist/esm/rest/outputModels.js.map +1 -0
- package/dist/esm/rest/parameters.d.ts +22 -0
- package/dist/esm/rest/parameters.d.ts.map +1 -0
- package/dist/esm/rest/parameters.js +4 -0
- package/dist/esm/rest/parameters.js.map +1 -0
- package/dist/esm/rest/responses.d.ts +63 -0
- package/dist/esm/rest/responses.d.ts.map +1 -0
- package/dist/esm/rest/responses.js +4 -0
- package/dist/esm/rest/responses.js.map +1 -0
- package/dist/esm/rest/widgetServiceClient.d.ts +16 -0
- package/dist/esm/rest/widgetServiceClient.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/rest/widgetServiceClient.js +2 -16
- package/dist/esm/rest/widgetServiceClient.js.map +1 -0
- package/dist/react-native/WidgetServiceClient.d.ts +42 -0
- package/dist/react-native/WidgetServiceClient.d.ts.map +1 -0
- package/dist/react-native/WidgetServiceClient.js +52 -0
- package/dist/react-native/WidgetServiceClient.js.map +1 -0
- package/dist/react-native/api/WidgetServiceContext.d.ts +19 -0
- package/dist/react-native/api/WidgetServiceContext.d.ts.map +1 -0
- package/dist/react-native/api/WidgetServiceContext.js +14 -0
- package/dist/react-native/api/WidgetServiceContext.js.map +1 -0
- package/dist/react-native/api/foo.d.ts +9 -0
- package/dist/react-native/api/foo.d.ts.map +1 -0
- package/dist/react-native/api/foo.js +13 -0
- package/dist/react-native/api/foo.js.map +1 -0
- package/dist/react-native/api/index.d.ts +11 -0
- package/dist/react-native/api/index.d.ts.map +1 -0
- package/dist/react-native/api/index.js +5 -0
- package/dist/react-native/api/index.js.map +1 -0
- package/dist/react-native/api/models.d.ts +25 -0
- package/dist/react-native/api/models.d.ts.map +1 -0
- package/dist/react-native/api/models.js +4 -0
- package/dist/react-native/api/models.js.map +1 -0
- package/dist/react-native/api/operations.d.ts +68 -0
- package/dist/react-native/api/operations.d.ts.map +1 -0
- package/dist/react-native/api/operations.js +171 -0
- package/dist/react-native/api/operations.js.map +1 -0
- package/dist/react-native/common/interfaces.d.ts +21 -0
- package/dist/react-native/common/interfaces.d.ts.map +1 -0
- package/dist/react-native/common/interfaces.js +4 -0
- package/dist/react-native/common/interfaces.js.map +1 -0
- package/dist/react-native/index.d.ts +12 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +4 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +12 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/rest/clientDefinitions.d.ts +52 -0
- package/dist/react-native/rest/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/rest/clientDefinitions.js +4 -0
- package/dist/react-native/rest/clientDefinitions.js.map +1 -0
- package/dist/react-native/rest/index.d.ts +17 -0
- package/dist/react-native/rest/index.d.ts.map +1 -0
- package/dist/react-native/rest/index.js +19 -0
- package/dist/react-native/rest/index.js.map +1 -0
- package/dist/react-native/rest/isUnexpected.d.ts +15 -0
- package/dist/react-native/rest/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/rest/isUnexpected.js +75 -0
- package/dist/react-native/rest/isUnexpected.js.map +1 -0
- package/dist/react-native/rest/models.d.ts +20 -0
- package/dist/react-native/rest/models.d.ts.map +1 -0
- package/dist/react-native/rest/models.js +4 -0
- package/dist/react-native/rest/models.js.map +1 -0
- package/dist/react-native/rest/outputModels.d.ts +25 -0
- package/dist/react-native/rest/outputModels.d.ts.map +1 -0
- package/dist/react-native/rest/outputModels.js +4 -0
- package/dist/react-native/rest/outputModels.js.map +1 -0
- package/dist/react-native/rest/parameters.d.ts +22 -0
- package/dist/react-native/rest/parameters.d.ts.map +1 -0
- package/dist/react-native/rest/parameters.js +4 -0
- package/dist/react-native/rest/parameters.js.map +1 -0
- package/dist/react-native/rest/responses.d.ts +63 -0
- package/dist/react-native/rest/responses.d.ts.map +1 -0
- package/dist/react-native/rest/responses.js +4 -0
- package/dist/react-native/rest/responses.js.map +1 -0
- package/dist/react-native/rest/widgetServiceClient.d.ts +16 -0
- package/dist/react-native/rest/widgetServiceClient.d.ts.map +1 -0
- package/dist/react-native/rest/widgetServiceClient.js +39 -0
- package/dist/react-native/rest/widgetServiceClient.js.map +1 -0
- package/package.json +108 -74
- package/dist/index.cjs +0 -370
- package/dist/index.cjs.map +0 -1
- package/dist-esm/src/WidgetServiceClient.js.map +0 -1
- package/dist-esm/src/api/WidgetServiceContext.js.map +0 -1
- package/dist-esm/src/api/foo.js.map +0 -1
- package/dist-esm/src/api/index.js.map +0 -1
- package/dist-esm/src/api/models.js +0 -4
- package/dist-esm/src/api/models.js.map +0 -1
- package/dist-esm/src/api/operations.js.map +0 -1
- package/dist-esm/src/common/interfaces.js +0 -4
- package/dist-esm/src/common/interfaces.js.map +0 -1
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/logger.js.map +0 -1
- package/dist-esm/src/rest/clientDefinitions.js +0 -4
- package/dist-esm/src/rest/clientDefinitions.js.map +0 -1
- package/dist-esm/src/rest/index.js.map +0 -1
- package/dist-esm/src/rest/isUnexpected.js.map +0 -1
- package/dist-esm/src/rest/models.js +0 -4
- package/dist-esm/src/rest/models.js.map +0 -1
- package/dist-esm/src/rest/outputModels.js +0 -4
- package/dist-esm/src/rest/outputModels.js.map +0 -1
- package/dist-esm/src/rest/parameters.js +0 -4
- package/dist-esm/src/rest/parameters.js.map +0 -1
- package/dist-esm/src/rest/responses.js +0 -4
- package/dist-esm/src/rest/responses.js.map +0 -1
- package/dist-esm/src/rest/widgetServiceClient.js.map +0 -1
- package/dist-esm/src/src/WidgetServiceClient.js.map +0 -1
- package/dist-esm/src/src/api/WidgetServiceContext.js.map +0 -1
- package/dist-esm/src/src/api/foo.js.map +0 -1
- package/dist-esm/src/src/api/index.js.map +0 -1
- package/dist-esm/src/src/api/models.js +0 -4
- package/dist-esm/src/src/api/models.js.map +0 -1
- package/dist-esm/src/src/api/operations.js.map +0 -1
- package/dist-esm/src/src/common/interfaces.js +0 -4
- package/dist-esm/src/src/common/interfaces.js.map +0 -1
- package/dist-esm/src/src/index.js.map +0 -1
- package/dist-esm/src/src/logger.js.map +0 -1
- package/dist-esm/src/src/rest/clientDefinitions.js +0 -4
- package/dist-esm/src/src/rest/clientDefinitions.js.map +0 -1
- package/dist-esm/src/src/rest/index.js.map +0 -1
- package/dist-esm/src/src/rest/isUnexpected.js.map +0 -1
- package/dist-esm/src/src/rest/models.js +0 -4
- package/dist-esm/src/src/rest/models.js.map +0 -1
- package/dist-esm/src/src/rest/outputModels.js +0 -4
- package/dist-esm/src/src/rest/outputModels.js.map +0 -1
- package/dist-esm/src/src/rest/parameters.js +0 -4
- package/dist-esm/src/src/rest/parameters.js.map +0 -1
- package/dist-esm/src/src/rest/responses.js +0 -4
- package/dist-esm/src/src/rest/responses.js.map +0 -1
- package/dist-esm/src/src/rest/widgetServiceClient.js.map +0 -1
- package/types/latest/template-dpg.d.ts +0 -108
- package/types/samples-dev/createWidget.d.ts +0 -2
- package/types/samples-dev/createWidget.d.ts.map +0 -1
- package/types/src/WidgetServiceClient.d.ts.map +0 -1
- package/types/src/api/WidgetServiceContext.d.ts.map +0 -1
- package/types/src/api/foo.d.ts.map +0 -1
- package/types/src/api/index.d.ts.map +0 -1
- package/types/src/api/models.d.ts.map +0 -1
- package/types/src/api/operations.d.ts.map +0 -1
- package/types/src/common/interfaces.d.ts.map +0 -1
- package/types/src/index.d.ts.map +0 -1
- package/types/src/logger.d.ts.map +0 -1
- package/types/src/rest/index.d.ts.map +0 -1
- package/types/src/rest/isUnexpected.d.ts.map +0 -1
- package/types/src/rest/models.d.ts.map +0 -1
- package/types/src/rest/outputModels.d.ts.map +0 -1
- package/types/src/rest/parameters.d.ts.map +0 -1
- package/types/src/rest/responses.d.ts.map +0 -1
- package/types/src/rest/widgetServiceClient.d.ts.map +0 -1
- package/types/src/src/WidgetServiceClient.d.ts.map +0 -1
- package/types/src/src/api/WidgetServiceContext.d.ts.map +0 -1
- package/types/src/src/api/foo.d.ts.map +0 -1
- package/types/src/src/api/index.d.ts.map +0 -1
- package/types/src/src/api/models.d.ts.map +0 -1
- package/types/src/src/api/operations.d.ts.map +0 -1
- package/types/src/src/common/interfaces.d.ts.map +0 -1
- package/types/src/src/index.d.ts.map +0 -1
- package/types/src/src/logger.d.ts.map +0 -1
- package/types/src/src/rest/clientDefinitions.d.ts.map +0 -1
- package/types/src/src/rest/index.d.ts.map +0 -1
- package/types/src/src/rest/isUnexpected.d.ts.map +0 -1
- package/types/src/src/rest/models.d.ts.map +0 -1
- package/types/src/src/rest/outputModels.d.ts.map +0 -1
- package/types/src/src/rest/parameters.d.ts.map +0 -1
- package/types/src/src/rest/responses.d.ts.map +0 -1
- package/types/src/src/rest/widgetServiceClient.d.ts.map +0 -1
- package/types/test/public/widgetService.spec.d.ts +0 -2
- package/types/test/public/widgetService.spec.d.ts.map +0 -1
- /package/{types/src/src → dist/browser}/api/foo.d.ts +0 -0
- /package/{types/src/src → dist/browser}/api/index.d.ts +0 -0
- /package/{types/src/src → dist/browser}/api/models.d.ts +0 -0
- /package/{types/src/src → dist/browser}/index.d.ts +0 -0
- /package/{types/src → dist/browser}/logger.d.ts +0 -0
- /package/{types/src/src → dist/browser}/rest/index.d.ts +0 -0
- /package/{types/src/src → dist/browser}/rest/models.d.ts +0 -0
- /package/{types/src/src → dist/browser}/rest/outputModels.d.ts +0 -0
- /package/{types/src/src → dist/commonjs}/logger.d.ts +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { RestError } from "@azure/core-rest-pipeline";
|
|
4
|
+
import { isUnexpected } from "../rest/index.js";
|
|
5
|
+
import { foo } from "./foo.js";
|
|
6
|
+
export function _listWidgetsSend(context, options = { requestOptions: {} }) {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
return context.path("/widgets").get({
|
|
9
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
10
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
11
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export async function _listWidgetsDeserialize(result) {
|
|
15
|
+
var _a;
|
|
16
|
+
if (isUnexpected(result)) {
|
|
17
|
+
throw result.body;
|
|
18
|
+
}
|
|
19
|
+
return ((_a = result.body) !== null && _a !== void 0 ? _a : []).map((p) => ({
|
|
20
|
+
id: p["id"],
|
|
21
|
+
weight: p["weight"],
|
|
22
|
+
color: p["color"],
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* List all widgets in the system. This operation is not paginated, and returns a simple array of widgets.
|
|
27
|
+
*
|
|
28
|
+
* It does not accept any options or parameters.
|
|
29
|
+
*/
|
|
30
|
+
export async function listWidgets(context, options = { requestOptions: {} }) {
|
|
31
|
+
const result = await _listWidgetsSend(context, options);
|
|
32
|
+
return _listWidgetsDeserialize(result);
|
|
33
|
+
}
|
|
34
|
+
export function _getWidgetSend(context, id, options = { requestOptions: {} }) {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
return context.path("/widgets/{id}", id).get({
|
|
37
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
38
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
39
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export async function _getWidgetDeserialize(result) {
|
|
43
|
+
if (isUnexpected(result)) {
|
|
44
|
+
throw result.body;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
id: result.body["id"],
|
|
48
|
+
weight: result.body["weight"],
|
|
49
|
+
color: result.body["color"],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Get a widget by ID. */
|
|
53
|
+
export async function getWidget(context, id, options = { requestOptions: {} }) {
|
|
54
|
+
const result = await _getWidgetSend(context, id, options);
|
|
55
|
+
return _getWidgetDeserialize(result);
|
|
56
|
+
}
|
|
57
|
+
export function _createWidgetSend(context, weight, color, options = { requestOptions: {} }) {
|
|
58
|
+
var _a, _b, _c;
|
|
59
|
+
return context.path("/widgets").post({
|
|
60
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
61
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
62
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
63
|
+
body: { weight: weight, color: color },
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
export async function _createWidgetDeserialize(result) {
|
|
67
|
+
if (isUnexpected(result)) {
|
|
68
|
+
throw result.body;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
id: result.body["id"],
|
|
72
|
+
weight: result.body["weight"],
|
|
73
|
+
color: result.body["color"],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Create a new widget.
|
|
78
|
+
*
|
|
79
|
+
* The widget ID is not required during creation, as it is automatically set by the server. Providing an ID will
|
|
80
|
+
* result in an error.
|
|
81
|
+
*/
|
|
82
|
+
export async function createWidget(context, weight, color, options = { requestOptions: {} }) {
|
|
83
|
+
const result = await _createWidgetSend(context, weight, color, options);
|
|
84
|
+
return _createWidgetDeserialize(result);
|
|
85
|
+
}
|
|
86
|
+
export function _updateWidgetSend(context, id, options = { requestOptions: {} }) {
|
|
87
|
+
var _a, _b, _c;
|
|
88
|
+
return context.path("/widgets/{id}", id).patch({
|
|
89
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
90
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
91
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
92
|
+
body: { weight: options === null || options === void 0 ? void 0 : options.weight, color: options === null || options === void 0 ? void 0 : options.color },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
export async function _updateWidgetDeserialize(result) {
|
|
96
|
+
if (isUnexpected(result)) {
|
|
97
|
+
throw result.body;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
id: result.body["id"],
|
|
101
|
+
weight: result.body["weight"],
|
|
102
|
+
color: result.body["color"],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Update the contents of the widget. The widget ID is required in the input, but cannot be changed. All other fields
|
|
107
|
+
* are optional and will be updated within the widget if provided.
|
|
108
|
+
*/
|
|
109
|
+
export async function updateWidget(context, id, options = { requestOptions: {} }) {
|
|
110
|
+
const result = await _updateWidgetSend(context, id, options);
|
|
111
|
+
return _updateWidgetDeserialize(result);
|
|
112
|
+
}
|
|
113
|
+
export function _deleteWidgetSend(context, id, options = { requestOptions: {} }) {
|
|
114
|
+
var _a, _b, _c;
|
|
115
|
+
return context.path("/widgets/{id}", id).delete({
|
|
116
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
117
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
118
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
export async function _deleteWidgetDeserialize(result) {
|
|
122
|
+
if (isUnexpected(result)) {
|
|
123
|
+
throw result.body;
|
|
124
|
+
}
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
/** Delete a widget by ID. */
|
|
128
|
+
export async function deleteWidget(context, id, options = { requestOptions: {} }) {
|
|
129
|
+
const result = await _deleteWidgetSend(context, id, options);
|
|
130
|
+
return _deleteWidgetDeserialize(result);
|
|
131
|
+
}
|
|
132
|
+
export function _analyzeWidgetSend(context, id, options = { requestOptions: {} }) {
|
|
133
|
+
var _a, _b, _c;
|
|
134
|
+
return context.path("/widgets/{id}/analyze", id).post({
|
|
135
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
136
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
137
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export async function _analyzeWidgetDeserialize(result) {
|
|
141
|
+
if (isUnexpected(result)) {
|
|
142
|
+
throw result.body;
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
summary: result.body["summary"],
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* In this customization we will perform the following tasks in addition to the generated:
|
|
150
|
+
* - We are going to add special error handling for demonstration purposes
|
|
151
|
+
*/
|
|
152
|
+
export async function analyzeWidget(context, id, options) {
|
|
153
|
+
try {
|
|
154
|
+
foo();
|
|
155
|
+
const result = await _analyzeWidget(context, id, options);
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.error("Error occurred while calling analyzeWidget:", error);
|
|
160
|
+
if (error.message && error.statusCode) {
|
|
161
|
+
throw new RestError(error.message, { code: error.statusCode });
|
|
162
|
+
}
|
|
163
|
+
throw new Error(error);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/** Analyze a widget. The only guarantee is that this method will return a string containing the results of the analysis. */
|
|
167
|
+
async function _analyzeWidget(context, id, options = { requestOptions: {} }) {
|
|
168
|
+
const result = await _analyzeWidgetSend(context, id, options);
|
|
169
|
+
return _analyzeWidgetDeserialize(result);
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/api/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAWlC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAiBtD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAoB/B,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,UAA8B,EAAE,cAAc,EAAE,EAAE,EAAE;;IAEpD,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC;QAClC,uBAAuB,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,uBAAuB;QACxE,eAAe,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,eAAe;QACxD,OAAO,oBAAO,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,CAAE;KAChD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAA2D;;IAE3D,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,CAAC,IAAI,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,MAA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7C,MAA+D;IAE/D,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,CAAC,IAAI,CAAC;IACpB,CAAC;IAED,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;KAChC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAAe,EACf,EAAU,EACV,OAA8B;IAE9B,IAAI,CAAC;QACH,GAAG,EAAE,CAAC;QACN,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1D,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,6CAA6C,EAAE,KAAK,CAAC,CAAC;QACpE,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACtC,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;AACH,CAAC;AAED,4HAA4H;AAC5H,KAAK,UAAU,cAAc,CAC3B,OAAe,EACf,EAAU,EACV,UAAgC,EAAE,cAAc,EAAE,EAAE,EAAE;IAEtD,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,OAAO,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!\n *\n * Any changes you make here may be lost.\n *\n * If you need to make changes, please do so in the original source file, \\{project-root\\}/sources/custom\n */\n\nimport type { StreamableMethod } from \"@azure-rest/core-client\";\nimport { RestError } from \"@azure/core-rest-pipeline\";\nimport type { RequestOptions } from \"../common/interfaces.js\";\nimport type { WidgetServiceContext as Client } from \"../rest/clientDefinitions.js\";\nimport type {\n AnalyzeWidget200Response,\n AnalyzeWidgetDefaultResponse,\n CreateWidget201Response,\n CreateWidgetDefaultResponse,\n DeleteWidget204Response,\n DeleteWidgetDefaultResponse,\n GetWidget200Response,\n GetWidgetDefaultResponse,\n ListWidgets200Response,\n ListWidgetsDefaultResponse,\n UpdateWidget200Response,\n UpdateWidgetDefaultResponse,\n} from \"../rest/index.js\";\nimport { isUnexpected } from \"../rest/index.js\";\nimport { foo } from \"./foo.js\";\nimport type { AnalyzeResult, ColorType, Widget } from \"./models.js\";\n\nexport interface ListWidgetsOptions extends RequestOptions {}\n\nexport interface GetWidgetOptions extends RequestOptions {}\n\nexport interface CreateWidgetOptions extends RequestOptions {}\n\nexport interface UpdateWidgetOptions extends RequestOptions {\n /** The weight of the widget. This is an int32, but must be greater than zero. */\n weight?: number;\n /** The color of the widget. */\n color?: ColorType;\n}\n\nexport interface DeleteWidgetOptions extends RequestOptions {}\n\nexport interface AnalyzeWidgetOptions extends RequestOptions {}\n\nexport function _listWidgetsSend(\n context: Client,\n options: ListWidgetsOptions = { requestOptions: {} },\n): StreamableMethod<ListWidgets200Response | ListWidgetsDefaultResponse> {\n return context.path(\"/widgets\").get({\n allowInsecureConnection: options.requestOptions?.allowInsecureConnection,\n skipUrlEncoding: options.requestOptions?.skipUrlEncoding,\n headers: { ...options.requestOptions?.headers },\n });\n}\n\nexport async function _listWidgetsDeserialize(\n result: ListWidgets200Response | ListWidgetsDefaultResponse,\n): Promise<Widget[]> {\n if (isUnexpected(result)) {\n throw result.body;\n }\n\n return (result.body ?? []).map((p) => ({\n id: p[\"id\"],\n weight: p[\"weight\"],\n color: p[\"color\"],\n }));\n}\n\n/**\n * List all widgets in the system. This operation is not paginated, and returns a simple array of widgets.\n *\n * It does not accept any options or parameters.\n */\nexport async function listWidgets(\n context: Client,\n options: ListWidgetsOptions = { requestOptions: {} },\n): Promise<Widget[]> {\n const result = await _listWidgetsSend(context, options);\n return _listWidgetsDeserialize(result);\n}\n\nexport function _getWidgetSend(\n context: Client,\n id: string,\n options: GetWidgetOptions = { requestOptions: {} },\n): StreamableMethod<GetWidget200Response | GetWidgetDefaultResponse> {\n return context.path(\"/widgets/{id}\", id).get({\n allowInsecureConnection: options.requestOptions?.allowInsecureConnection,\n skipUrlEncoding: options.requestOptions?.skipUrlEncoding,\n headers: { ...options.requestOptions?.headers },\n });\n}\n\nexport async function _getWidgetDeserialize(\n result: GetWidget200Response | GetWidgetDefaultResponse,\n): Promise<Widget> {\n if (isUnexpected(result)) {\n throw result.body;\n }\n\n return {\n id: result.body[\"id\"],\n weight: result.body[\"weight\"],\n color: result.body[\"color\"],\n };\n}\n\n/** Get a widget by ID. */\nexport async function getWidget(\n context: Client,\n id: string,\n options: GetWidgetOptions = { requestOptions: {} },\n): Promise<Widget> {\n const result = await _getWidgetSend(context, id, options);\n return _getWidgetDeserialize(result);\n}\n\nexport function _createWidgetSend(\n context: Client,\n weight: number,\n color: ColorType,\n options: CreateWidgetOptions = { requestOptions: {} },\n): StreamableMethod<CreateWidget201Response | CreateWidgetDefaultResponse> {\n return context.path(\"/widgets\").post({\n allowInsecureConnection: options.requestOptions?.allowInsecureConnection,\n skipUrlEncoding: options.requestOptions?.skipUrlEncoding,\n headers: { ...options.requestOptions?.headers },\n body: { weight: weight, color: color },\n });\n}\n\nexport async function _createWidgetDeserialize(\n result: CreateWidget201Response | CreateWidgetDefaultResponse,\n): Promise<Widget> {\n if (isUnexpected(result)) {\n throw result.body;\n }\n\n return {\n id: result.body[\"id\"],\n weight: result.body[\"weight\"],\n color: result.body[\"color\"],\n };\n}\n\n/**\n * Create a new widget.\n *\n * The widget ID is not required during creation, as it is automatically set by the server. Providing an ID will\n * result in an error.\n */\nexport async function createWidget(\n context: Client,\n weight: number,\n color: ColorType,\n options: CreateWidgetOptions = { requestOptions: {} },\n): Promise<Widget> {\n const result = await _createWidgetSend(context, weight, color, options);\n return _createWidgetDeserialize(result);\n}\n\nexport function _updateWidgetSend(\n context: Client,\n id: string,\n options: UpdateWidgetOptions = { requestOptions: {} },\n): StreamableMethod<UpdateWidget200Response | UpdateWidgetDefaultResponse> {\n return context.path(\"/widgets/{id}\", id).patch({\n allowInsecureConnection: options.requestOptions?.allowInsecureConnection,\n skipUrlEncoding: options.requestOptions?.skipUrlEncoding,\n headers: { ...options.requestOptions?.headers },\n body: { weight: options?.weight, color: options?.color },\n });\n}\n\nexport async function _updateWidgetDeserialize(\n result: UpdateWidget200Response | UpdateWidgetDefaultResponse,\n): Promise<Widget> {\n if (isUnexpected(result)) {\n throw result.body;\n }\n\n return {\n id: result.body[\"id\"],\n weight: result.body[\"weight\"],\n color: result.body[\"color\"],\n };\n}\n\n/**\n * Update the contents of the widget. The widget ID is required in the input, but cannot be changed. All other fields\n * are optional and will be updated within the widget if provided.\n */\nexport async function updateWidget(\n context: Client,\n id: string,\n options: UpdateWidgetOptions = { requestOptions: {} },\n): Promise<Widget> {\n const result = await _updateWidgetSend(context, id, options);\n return _updateWidgetDeserialize(result);\n}\n\nexport function _deleteWidgetSend(\n context: Client,\n id: string,\n options: DeleteWidgetOptions = { requestOptions: {} },\n): StreamableMethod<DeleteWidget204Response | DeleteWidgetDefaultResponse> {\n return context.path(\"/widgets/{id}\", id).delete({\n allowInsecureConnection: options.requestOptions?.allowInsecureConnection,\n skipUrlEncoding: options.requestOptions?.skipUrlEncoding,\n headers: { ...options.requestOptions?.headers },\n });\n}\n\nexport async function _deleteWidgetDeserialize(\n result: DeleteWidget204Response | DeleteWidgetDefaultResponse,\n): Promise<void> {\n if (isUnexpected(result)) {\n throw result.body;\n }\n\n return;\n}\n\n/** Delete a widget by ID. */\nexport async function deleteWidget(\n context: Client,\n id: string,\n options: DeleteWidgetOptions = { requestOptions: {} },\n): Promise<void> {\n const result = await _deleteWidgetSend(context, id, options);\n return _deleteWidgetDeserialize(result);\n}\n\nexport function _analyzeWidgetSend(\n context: Client,\n id: string,\n options: AnalyzeWidgetOptions = { requestOptions: {} },\n): StreamableMethod<AnalyzeWidget200Response | AnalyzeWidgetDefaultResponse> {\n return context.path(\"/widgets/{id}/analyze\", id).post({\n allowInsecureConnection: options.requestOptions?.allowInsecureConnection,\n skipUrlEncoding: options.requestOptions?.skipUrlEncoding,\n headers: { ...options.requestOptions?.headers },\n });\n}\n\nexport async function _analyzeWidgetDeserialize(\n result: AnalyzeWidget200Response | AnalyzeWidgetDefaultResponse,\n): Promise<AnalyzeResult> {\n if (isUnexpected(result)) {\n throw result.body;\n }\n\n return {\n summary: result.body[\"summary\"],\n };\n}\n\n/**\n * In this customization we will perform the following tasks in addition to the generated:\n * - We are going to add special error handling for demonstration purposes\n */\nexport async function analyzeWidget(\n context: Client,\n id: string,\n options?: AnalyzeWidgetOptions,\n): Promise<AnalyzeResult> {\n try {\n foo();\n const result = await _analyzeWidget(context, id, options);\n return result;\n } catch (error: any) {\n console.error(\"Error occurred while calling analyzeWidget:\", error);\n if (error.message && error.statusCode) {\n throw new RestError(error.message, { code: error.statusCode });\n }\n\n throw new Error(error);\n }\n}\n\n/** Analyze a widget. The only guarantee is that this method will return a string containing the results of the analysis. */\nasync function _analyzeWidget(\n context: Client,\n id: string,\n options: AnalyzeWidgetOptions = { requestOptions: {} },\n): Promise<AnalyzeResult> {\n const result = await _analyzeWidgetSend(context, id, options);\n return _analyzeWidgetDeserialize(result);\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
|
+
*
|
|
4
|
+
* Any changes you make here may be lost.
|
|
5
|
+
*
|
|
6
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
|
+
*/
|
|
8
|
+
import type { RawHttpHeadersInput } from "@azure/core-rest-pipeline";
|
|
9
|
+
export interface RequestOptions {
|
|
10
|
+
requestOptions?: {
|
|
11
|
+
/**
|
|
12
|
+
* Headers to send along with the request
|
|
13
|
+
*/
|
|
14
|
+
headers?: RawHttpHeadersInput;
|
|
15
|
+
/** Set to true if the request is sent over HTTP instead of HTTPS */
|
|
16
|
+
allowInsecureConnection?: boolean;
|
|
17
|
+
/** Set to true if you want to skip encoding the path parameters */
|
|
18
|
+
skipUrlEncoding?: boolean;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/common/interfaces.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE;QACf;;WAEG;QACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;QAC9B,oEAAoE;QACpE,uBAAuB,CAAC,EAAE,OAAO,CAAC;QAClC,mEAAmE;QACnE,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/common/interfaces.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!\n *\n * Any changes you make here may be lost.\n *\n * If you need to make changes, please do so in the original source file, \\{project-root\\}/sources/custom\n */\n\nimport type { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\n\nexport interface RequestOptions {\n requestOptions?: {\n /**\n * Headers to send along with the request\n */\n headers?: RawHttpHeadersInput;\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n /** Set to true if you want to skip encoding the path parameters */\n skipUrlEncoding?: boolean;\n };\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
|
+
*
|
|
4
|
+
* Any changes you make here may be lost.
|
|
5
|
+
*
|
|
6
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
|
+
*/
|
|
8
|
+
export { Widget, ColorType, AnalyzeResult } from "./api/models.js";
|
|
9
|
+
export { ListWidgetsOptions, GetWidgetOptions, CreateWidgetOptions, UpdateWidgetOptions, DeleteWidgetOptions, AnalyzeWidgetOptions, } from "./api/operations.js";
|
|
10
|
+
export { WidgetServiceClient, WidgetServiceClientOptions } from "./WidgetServiceClient.js";
|
|
11
|
+
export { RequestOptions } from "./common/interfaces.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmBlC,OAAO,EAAE,mBAAmB,EAA8B,MAAM,0BAA0B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!\n *\n * Any changes you make here may be lost.\n *\n * If you need to make changes, please do so in the original source file, \\{project-root\\}/sources/custom\n */\n\nexport { Widget, ColorType, AnalyzeResult } from \"./api/models.js\";\nexport {\n ListWidgetsOptions,\n GetWidgetOptions,\n CreateWidgetOptions,\n UpdateWidgetOptions,\n DeleteWidgetOptions,\n AnalyzeWidgetOptions,\n} from \"./api/operations.js\";\nexport { WidgetServiceClient, WidgetServiceClientOptions } from \"./WidgetServiceClient.js\";\nexport { RequestOptions } from \"./common/interfaces.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,MAAM,qCAA+B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
5
|
+
*
|
|
6
|
+
* Any changes you make here may be lost.
|
|
7
|
+
*
|
|
8
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
9
|
+
*/
|
|
10
|
+
import { createClientLogger } from "@azure/logger";
|
|
11
|
+
export const logger = createClientLogger("widget");
|
|
12
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!\n *\n * Any changes you make here may be lost.\n *\n * If you need to make changes, please do so in the original source file, \\{project-root\\}/sources/custom\n */\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"widget\");\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
|
+
*
|
|
4
|
+
* Any changes you make here may be lost.
|
|
5
|
+
*
|
|
6
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
|
+
*/
|
|
8
|
+
import type { ListWidgetsParameters, CreateWidgetParameters, GetWidgetParameters, UpdateWidgetParameters, DeleteWidgetParameters, AnalyzeWidgetParameters } from "./parameters.js";
|
|
9
|
+
import type { ListWidgets200Response, ListWidgetsDefaultResponse, CreateWidget201Response, CreateWidgetDefaultResponse, GetWidget200Response, GetWidgetDefaultResponse, UpdateWidget200Response, UpdateWidgetDefaultResponse, DeleteWidget204Response, DeleteWidgetDefaultResponse, AnalyzeWidget200Response, AnalyzeWidgetDefaultResponse } from "./responses.js";
|
|
10
|
+
import type { Client, StreamableMethod } from "@azure-rest/core-client";
|
|
11
|
+
export interface ListWidgets {
|
|
12
|
+
/**
|
|
13
|
+
* List all widgets in the system. This operation is not paginated, and returns a simple array of widgets.
|
|
14
|
+
*
|
|
15
|
+
* It does not accept any options or parameters.
|
|
16
|
+
*/
|
|
17
|
+
get(options?: ListWidgetsParameters): StreamableMethod<ListWidgets200Response | ListWidgetsDefaultResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Create a new widget.
|
|
20
|
+
*
|
|
21
|
+
* The widget ID is not required during creation, as it is automatically set by the server. Providing an ID will
|
|
22
|
+
* result in an error.
|
|
23
|
+
*/
|
|
24
|
+
post(options?: CreateWidgetParameters): StreamableMethod<CreateWidget201Response | CreateWidgetDefaultResponse>;
|
|
25
|
+
}
|
|
26
|
+
export interface GetWidget {
|
|
27
|
+
/** Get a widget by ID. */
|
|
28
|
+
get(options?: GetWidgetParameters): StreamableMethod<GetWidget200Response | GetWidgetDefaultResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Update the contents of the widget. The widget ID is required in the input, but cannot be changed. All other fields
|
|
31
|
+
* are optional and will be updated within the widget if provided.
|
|
32
|
+
*/
|
|
33
|
+
patch(options?: UpdateWidgetParameters): StreamableMethod<UpdateWidget200Response | UpdateWidgetDefaultResponse>;
|
|
34
|
+
/** Delete a widget by ID. */
|
|
35
|
+
delete(options?: DeleteWidgetParameters): StreamableMethod<DeleteWidget204Response | DeleteWidgetDefaultResponse>;
|
|
36
|
+
}
|
|
37
|
+
export interface AnalyzeWidget {
|
|
38
|
+
/** Analyze a widget. The only guarantee is that this method will return a string containing the results of the analysis. */
|
|
39
|
+
post(options?: AnalyzeWidgetParameters): StreamableMethod<AnalyzeWidget200Response | AnalyzeWidgetDefaultResponse>;
|
|
40
|
+
}
|
|
41
|
+
export interface Routes {
|
|
42
|
+
/** Resource for '/widgets' has methods for the following verbs: get, post */
|
|
43
|
+
(path: "/widgets"): ListWidgets;
|
|
44
|
+
/** Resource for '/widgets/\{id\}' has methods for the following verbs: get, patch, delete */
|
|
45
|
+
(path: "/widgets/{id}", id: string): GetWidget;
|
|
46
|
+
/** Resource for '/widgets/\{id\}/analyze' has methods for the following verbs: post */
|
|
47
|
+
(path: "/widgets/{id}/analyze", id: string): AnalyzeWidget;
|
|
48
|
+
}
|
|
49
|
+
export type WidgetServiceContext = Client & {
|
|
50
|
+
path: Routes;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=clientDefinitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.d.ts","sourceRoot":"","sources":["../../../src/rest/clientDefinitions.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,sBAAsB,EACtB,sBAA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AAC,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,uFAAuF;IACvF,CAAC,IAAI,EAAE,uBAAuB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,CAAC;CAC5D;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../../src/rest/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!\n *\n * Any changes you make here may be lost.\n *\n * If you need to make changes, please do so in the original source file, \\{project-root\\}/sources/custom\n */\n\nimport type {\n ListWidgetsParameters,\n CreateWidgetParameters,\n GetWidgetParameters,\n UpdateWidgetParameters,\n DeleteWidgetParameters,\n AnalyzeWidgetParameters,\n} from \"./parameters.js\";\nimport type {\n ListWidgets200Response,\n ListWidgetsDefaultResponse,\n CreateWidget201Response,\n CreateWidgetDefaultResponse,\n GetWidget200Response,\n GetWidgetDefaultResponse,\n UpdateWidget200Response,\n UpdateWidgetDefaultResponse,\n DeleteWidget204Response,\n DeleteWidgetDefaultResponse,\n AnalyzeWidget200Response,\n AnalyzeWidgetDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface ListWidgets {\n /**\n * List all widgets in the system. This operation is not paginated, and returns a simple array of widgets.\n *\n * It does not accept any options or parameters.\n */\n get(\n options?: ListWidgetsParameters,\n ): StreamableMethod<ListWidgets200Response | ListWidgetsDefaultResponse>;\n /**\n * Create a new widget.\n *\n * The widget ID is not required during creation, as it is automatically set by the server. Providing an ID will\n * result in an error.\n */\n post(\n options?: CreateWidgetParameters,\n ): StreamableMethod<CreateWidget201Response | CreateWidgetDefaultResponse>;\n}\n\nexport interface GetWidget {\n /** Get a widget by ID. */\n get(\n options?: GetWidgetParameters,\n ): StreamableMethod<GetWidget200Response | GetWidgetDefaultResponse>;\n /**\n * Update the contents of the widget. The widget ID is required in the input, but cannot be changed. All other fields\n * are optional and will be updated within the widget if provided.\n */\n patch(\n options?: UpdateWidgetParameters,\n ): StreamableMethod<UpdateWidget200Response | UpdateWidgetDefaultResponse>;\n /** Delete a widget by ID. */\n delete(\n options?: DeleteWidgetParameters,\n ): StreamableMethod<DeleteWidget204Response | DeleteWidgetDefaultResponse>;\n}\n\nexport interface AnalyzeWidget {\n /** Analyze a widget. The only guarantee is that this method will return a string containing the results of the analysis. */\n post(\n options?: AnalyzeWidgetParameters,\n ): StreamableMethod<AnalyzeWidget200Response | AnalyzeWidgetDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/widgets' has methods for the following verbs: get, post */\n (path: \"/widgets\"): ListWidgets;\n /** Resource for '/widgets/\\{id\\}' has methods for the following verbs: get, patch, delete */\n (path: \"/widgets/{id}\", id: string): GetWidget;\n /** Resource for '/widgets/\\{id\\}/analyze' has methods for the following verbs: post */\n (path: \"/widgets/{id}/analyze\", id: string): AnalyzeWidget;\n}\n\nexport type WidgetServiceContext = Client & {\n path: Routes;\n};\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
|
+
*
|
|
4
|
+
* Any changes you make here may be lost.
|
|
5
|
+
*
|
|
6
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
|
+
*/
|
|
8
|
+
import WidgetServiceClient from "./widgetServiceClient.js";
|
|
9
|
+
export * from "./widgetServiceClient.js";
|
|
10
|
+
export * from "./parameters.js";
|
|
11
|
+
export * from "./responses.js";
|
|
12
|
+
export * from "./clientDefinitions.js";
|
|
13
|
+
export * from "./isUnexpected.js";
|
|
14
|
+
export * from "./models.js";
|
|
15
|
+
export * from "./outputModels.js";
|
|
16
|
+
export default WidgetServiceClient;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rest/index.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAE3D,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAElC,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
5
|
+
*
|
|
6
|
+
* Any changes you make here may be lost.
|
|
7
|
+
*
|
|
8
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
9
|
+
*/
|
|
10
|
+
import WidgetServiceClient from "./widgetServiceClient.js";
|
|
11
|
+
export * from "./widgetServiceClient.js";
|
|
12
|
+
export * from "./parameters.js";
|
|
13
|
+
export * from "./responses.js";
|
|
14
|
+
export * from "./clientDefinitions.js";
|
|
15
|
+
export * from "./isUnexpected.js";
|
|
16
|
+
export * from "./models.js";
|
|
17
|
+
export * from "./outputModels.js";
|
|
18
|
+
export default WidgetServiceClient;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;GAMG;AAEH,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAE3D,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAElC,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!\n *\n * Any changes you make here may be lost.\n *\n * If you need to make changes, please do so in the original source file, \\{project-root\\}/sources/custom\n */\n\nimport WidgetServiceClient from \"./widgetServiceClient.js\";\n\nexport * from \"./widgetServiceClient.js\";\nexport * from \"./parameters.js\";\nexport * from \"./responses.js\";\nexport * from \"./clientDefinitions.js\";\nexport * from \"./isUnexpected.js\";\nexport * from \"./models.js\";\nexport * from \"./outputModels.js\";\n\nexport default WidgetServiceClient;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
|
+
*
|
|
4
|
+
* Any changes you make here may be lost.
|
|
5
|
+
*
|
|
6
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
|
+
*/
|
|
8
|
+
import type { ListWidgets200Response, ListWidgetsDefaultResponse, CreateWidget201Response, CreateWidgetDefaultResponse, GetWidget200Response, GetWidgetDefaultResponse, UpdateWidget200Response, UpdateWidgetDefaultResponse, DeleteWidget204Response, DeleteWidgetDefaultResponse, AnalyzeWidget200Response, AnalyzeWidgetDefaultResponse } from "./responses.js";
|
|
9
|
+
export declare function isUnexpected(response: ListWidgets200Response | ListWidgetsDefaultResponse): response is ListWidgetsDefaultResponse;
|
|
10
|
+
export declare function isUnexpected(response: CreateWidget201Response | CreateWidgetDefaultResponse): response is CreateWidgetDefaultResponse;
|
|
11
|
+
export declare function isUnexpected(response: GetWidget200Response | GetWidgetDefaultResponse): response is GetWidgetDefaultResponse;
|
|
12
|
+
export declare function isUnexpected(response: UpdateWidget200Response | UpdateWidgetDefaultResponse): response is UpdateWidgetDefaultResponse;
|
|
13
|
+
export declare function isUnexpected(response: DeleteWidget204Response | DeleteWidgetDefaultResponse): response is DeleteWidgetDefaultResponse;
|
|
14
|
+
export declare function isUnexpected(response: AnalyzeWidget200Response | AnalyzeWidgetDefaultResponse): response is AnalyzeWidgetDefaultResponse;
|
|
15
|
+
//# sourceMappingURL=isUnexpected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.d.ts","sourceRoot":"","sources":["../../../src/rest/isUnexpected.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,gBAAgB,CAAC;AAWxB,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,sBAAsB,GAAG,0BAA0B,GAC5D,QAAQ,IAAI,0BAA0B,CAAC;AAC1C,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,uBAAuB,GAAG,2BAA2B,GAC9D,QAAQ,IAAI,2BAA2B,CAAC;AAC3C,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,oBAAoB,GAAG,wBAAwB,GACxD,QAAQ,IAAI,wBAAwB,CAAC;AACxC,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,uBAAuB,GAAG,2BAA2B,GAC9D,QAAQ,IAAI,2BAA2B,CAAC;AAC3C,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,uBAAuB,GAAG,2BAA2B,GAC9D,QAAQ,IAAI,2BAA2B,CAAC;AAC3C,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,wBAAwB,GAAG,4BAA4B,GAChE,QAAQ,IAAI,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
const responseMap = {
|
|
4
|
+
"GET /widgets": ["200"],
|
|
5
|
+
"POST /widgets": ["201"],
|
|
6
|
+
"GET /widgets/{id}": ["200"],
|
|
7
|
+
"PATCH /widgets/{id}": ["200"],
|
|
8
|
+
"DELETE /widgets/{id}": ["204"],
|
|
9
|
+
"POST /widgets/{id}/analyze": ["200"],
|
|
10
|
+
};
|
|
11
|
+
export function isUnexpected(response) {
|
|
12
|
+
const lroOriginal = response.headers["x-ms-original-url"];
|
|
13
|
+
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
14
|
+
const method = response.request.method;
|
|
15
|
+
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
16
|
+
if (!pathDetails) {
|
|
17
|
+
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
18
|
+
}
|
|
19
|
+
return !pathDetails.includes(response.status);
|
|
20
|
+
}
|
|
21
|
+
function getParametrizedPathSuccess(method, path) {
|
|
22
|
+
var _a, _b, _c, _d;
|
|
23
|
+
const pathParts = path.split("/");
|
|
24
|
+
// Traverse list to match the longest candidate
|
|
25
|
+
// matchedLen: the length of candidate path
|
|
26
|
+
// matchedValue: the matched status code array
|
|
27
|
+
let matchedLen = -1, matchedValue = [];
|
|
28
|
+
// Iterate the responseMap to find a match
|
|
29
|
+
for (const [key, value] of Object.entries(responseMap)) {
|
|
30
|
+
// Extracting the path from the map key which is in format
|
|
31
|
+
// GET /path/foo
|
|
32
|
+
if (!key.startsWith(method)) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const candidatePath = getPathFromMapKey(key);
|
|
36
|
+
// Get each part of the url path
|
|
37
|
+
const candidateParts = candidatePath.split("/");
|
|
38
|
+
// track if we have found a match to return the values found.
|
|
39
|
+
let found = true;
|
|
40
|
+
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
41
|
+
if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
|
|
42
|
+
const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
|
|
43
|
+
// If the current part of the candidate is a "template" part
|
|
44
|
+
// Try to use the suffix of pattern to match the path
|
|
45
|
+
// {guid} ==> $
|
|
46
|
+
// {guid}:export ==> :export$
|
|
47
|
+
const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
|
|
48
|
+
if (!isMatched) {
|
|
49
|
+
found = false;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
// If the candidate part is not a template and
|
|
55
|
+
// the parts don't match mark the candidate as not found
|
|
56
|
+
// to move on with the next candidate path.
|
|
57
|
+
if (candidateParts[i] !== pathParts[j]) {
|
|
58
|
+
found = false;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// We finished evaluating the current candidate parts
|
|
63
|
+
// Update the matched value if and only if we found the longer pattern
|
|
64
|
+
if (found && candidatePath.length > matchedLen) {
|
|
65
|
+
matchedLen = candidatePath.length;
|
|
66
|
+
matchedValue = value;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return matchedValue;
|
|
70
|
+
}
|
|
71
|
+
function getPathFromMapKey(mapKey) {
|
|
72
|
+
const pathStart = mapKey.indexOf("/");
|
|
73
|
+
return mapKey.slice(pathStart);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=isUnexpected.js.map
|
|
@@ -0,0 +1 @@
|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CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!\n *\n * Any changes you make here may be lost.\n *\n * If you need to make changes, please do so in the original source file, \\{project-root\\}/sources/custom\n */\n\nimport type {\n ListWidgets200Response,\n ListWidgetsDefaultResponse,\n CreateWidget201Response,\n CreateWidgetDefaultResponse,\n GetWidget200Response,\n GetWidgetDefaultResponse,\n UpdateWidget200Response,\n UpdateWidgetDefaultResponse,\n DeleteWidget204Response,\n DeleteWidgetDefaultResponse,\n AnalyzeWidget200Response,\n AnalyzeWidgetDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /widgets\": [\"200\"],\n \"POST /widgets\": [\"201\"],\n \"GET /widgets/{id}\": [\"200\"],\n \"PATCH /widgets/{id}\": [\"200\"],\n \"DELETE /widgets/{id}\": [\"204\"],\n \"POST /widgets/{id}/analyze\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: ListWidgets200Response | ListWidgetsDefaultResponse,\n): response is ListWidgetsDefaultResponse;\nexport function isUnexpected(\n response: CreateWidget201Response | CreateWidgetDefaultResponse,\n): response is CreateWidgetDefaultResponse;\nexport function isUnexpected(\n response: GetWidget200Response | GetWidgetDefaultResponse,\n): response is GetWidgetDefaultResponse;\nexport function isUnexpected(\n response: UpdateWidget200Response | UpdateWidgetDefaultResponse,\n): response is UpdateWidgetDefaultResponse;\nexport function isUnexpected(\n response: DeleteWidget204Response | DeleteWidgetDefaultResponse,\n): response is DeleteWidgetDefaultResponse;\nexport function isUnexpected(\n response: AnalyzeWidget200Response | AnalyzeWidgetDefaultResponse,\n): response is AnalyzeWidgetDefaultResponse;\nexport function isUnexpected(\n response:\n | ListWidgets200Response\n | ListWidgetsDefaultResponse\n | CreateWidget201Response\n | CreateWidgetDefaultResponse\n | GetWidget200Response\n | GetWidgetDefaultResponse\n | UpdateWidget200Response\n | UpdateWidgetDefaultResponse\n | DeleteWidget204Response\n | DeleteWidgetDefaultResponse\n | AnalyzeWidget200Response\n | AnalyzeWidgetDefaultResponse,\n): response is\n | ListWidgetsDefaultResponse\n | CreateWidgetDefaultResponse\n | GetWidgetDefaultResponse\n | UpdateWidgetDefaultResponse\n | DeleteWidgetDefaultResponse\n | AnalyzeWidgetDefaultResponse {\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 = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\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: string[] = [];\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 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,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
|
+
*
|
|
4
|
+
* Any changes you make here may be lost.
|
|
5
|
+
*
|
|
6
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
|
+
*/
|
|
8
|
+
export interface CreateWidget {
|
|
9
|
+
/** The weight of the widget. This is an int32, but must be greater than zero. */
|
|
10
|
+
weight: number;
|
|
11
|
+
/** The color of the widget. */
|
|
12
|
+
color: "red" | "blue";
|
|
13
|
+
}
|
|
14
|
+
export interface UpdateWidget {
|
|
15
|
+
/** The weight of the widget. This is an int32, but must be greater than zero. */
|
|
16
|
+
weight?: number;
|
|
17
|
+
/** The color of the widget. */
|
|
18
|
+
color?: "red" | "blue";
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/rest/models.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/rest/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!\n *\n * Any changes you make here may be lost.\n *\n * If you need to make changes, please do so in the original source file, \\{project-root\\}/sources/custom\n */\n\nexport interface CreateWidget {\n /** The weight of the widget. This is an int32, but must be greater than zero. */\n weight: number;\n /** The color of the widget. */\n color: \"red\" | \"blue\";\n}\n\nexport interface UpdateWidget {\n /** The weight of the widget. This is an int32, but must be greater than zero. */\n weight?: number;\n /** The color of the widget. */\n color?: \"red\" | \"blue\";\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
3
|
+
*
|
|
4
|
+
* Any changes you make here may be lost.
|
|
5
|
+
*
|
|
6
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
|
+
*/
|
|
8
|
+
export interface WidgetOutput {
|
|
9
|
+
/** The UUID of this widget. This is generated automatically by the service. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** The weight of the widget. This is an int32, but must be greater than zero. */
|
|
12
|
+
weight: number;
|
|
13
|
+
/** The color of the widget. */
|
|
14
|
+
color: "red" | "blue";
|
|
15
|
+
}
|
|
16
|
+
export interface WidgetErrorOutput {
|
|
17
|
+
/** The HTTP error code. */
|
|
18
|
+
code: number;
|
|
19
|
+
/** A human-readable message describing the error. */
|
|
20
|
+
message: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AnalyzeResultOutput {
|
|
23
|
+
summary: string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=outputModels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../../src/rest/outputModels.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAC;IACX,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../../src/rest/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!\n *\n * Any changes you make here may be lost.\n *\n * If you need to make changes, please do so in the original source file, \\{project-root\\}/sources/custom\n */\n\nexport interface WidgetOutput {\n /** The UUID of this widget. This is generated automatically by the service. */\n id: string;\n /** The weight of the widget. This is an int32, but must be greater than zero. */\n weight: number;\n /** The color of the widget. */\n color: \"red\" | \"blue\";\n}\n\nexport interface WidgetErrorOutput {\n /** The HTTP error code. */\n code: number;\n /** A human-readable message describing the error. */\n message: string;\n}\n\nexport interface AnalyzeResultOutput {\n summary: string;\n}\n"]}
|