@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 @@
|
|
|
1
|
+
{"version":3,"file":"widgetServiceClient.js","sourceRoot":"","sources":["../../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F,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,GACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,OAAO,CAAyB,CAAC;IACnE,OAAO,MAAM,CAAC;AAChB,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 { ClientOptions } from \"@azure-rest/core-client\";\nimport { addCredentialPipelinePolicy, getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { logger } from \"../logger.js\";\nimport type { WidgetServiceContext } from \"./clientDefinitions.js\";\n\n/**\n * This customization adds credential support to the client. And overloads for when it is optional\n */\nexport default function createClient(\n endpoint: string,\n credential: TokenCredential,\n options?: ClientOptions,\n): WidgetServiceContext;\nexport default function createClient(\n endpoint: string,\n options?: ClientOptions,\n): WidgetServiceContext;\nexport default function createClient(\n endpoint: string,\n credentialOrOptions?: TokenCredential | ClientOptions,\n options: ClientOptions = {},\n): WidgetServiceContext {\n let credential: TokenCredential | undefined;\n if (isTokenCredential(credentialOrOptions)) {\n credential = credentialOrOptions;\n } else {\n options = credentialOrOptions ?? {};\n }\n\n const client = _createClient(endpoint, options);\n addCredentialPipelinePolicy(client.pipeline, endpoint, { credential, clientOptions: options });\n return client;\n}\n\n/**\n * Initialize a new instance of `WidgetServiceContext`\n * @param endpoint - The parameter endpoint\n * @param options - the parameter for all optional parameters\n */\nfunction _createClient(endpoint: string, options: ClientOptions = {}): WidgetServiceContext {\n const baseUrl = options.baseUrl ?? `${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"1.0.0\";\n const userAgentInfo = `azsdk-js-widget-rest/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n };\n const client = getClient(baseUrl, options) as WidgetServiceContext;\n return client;\n}\n"]}
|
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Any changes you make here may be lost.
|
|
12
|
-
*
|
|
13
|
-
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
14
|
-
*/
|
|
15
|
-
import { TokenCredential } from "@azure/core-auth";
|
|
16
|
-
import { AnalyzeResult, AnalyzeWidgetOptions, ColorType, CreateWidgetOptions, DeleteWidgetOptions, GetWidgetOptions, ListWidgetsOptions, UpdateWidgetOptions, Widget, WidgetServiceClientOptions } from "./api/index.js";
|
|
8
|
+
import type { TokenCredential } from "@azure/core-auth";
|
|
9
|
+
import type { WidgetServiceClientOptions } from "./api/WidgetServiceContext.js";
|
|
10
|
+
import type { AnalyzeResult, AnalyzeWidgetOptions, ColorType, CreateWidgetOptions, DeleteWidgetOptions, GetWidgetOptions, ListWidgetsOptions, UpdateWidgetOptions, Widget } from "./api/index.js";
|
|
17
11
|
export { WidgetServiceClientOptions } from "./api/WidgetServiceContext.js";
|
|
18
12
|
export declare class WidgetServiceClient {
|
|
19
13
|
private _client;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetServiceClient.d.ts","sourceRoot":"","sources":["../../src/WidgetServiceClient.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAA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
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.WidgetServiceClient = void 0;
|
|
6
|
+
const core_auth_1 = require("@azure/core-auth");
|
|
7
|
+
const WidgetServiceContext_js_1 = require("./api/WidgetServiceContext.js");
|
|
8
|
+
const index_js_1 = require("./api/index.js");
|
|
9
|
+
class WidgetServiceClient {
|
|
10
|
+
constructor(endpoint, credentialOrOptions, options = {}) {
|
|
11
|
+
if ((0, core_auth_1.isTokenCredential)(credentialOrOptions)) {
|
|
12
|
+
this._client = (0, WidgetServiceContext_js_1.createWidgetService)(endpoint, credentialOrOptions, options);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this._client = (0, WidgetServiceContext_js_1.createWidgetService)(endpoint, credentialOrOptions);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* List all widgets in the system. This operation is not paginated, and returns a simple array of widgets.
|
|
20
|
+
*
|
|
21
|
+
* It does not accept any options or parameters.
|
|
22
|
+
*/
|
|
23
|
+
listWidgets(options = { requestOptions: {} }) {
|
|
24
|
+
return (0, index_js_1.listWidgets)(this._client, options);
|
|
25
|
+
}
|
|
26
|
+
/** Get a widget by ID. */
|
|
27
|
+
getWidget(id, options = { requestOptions: {} }) {
|
|
28
|
+
return (0, index_js_1.getWidget)(this._client, id, options);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a new widget.
|
|
32
|
+
*
|
|
33
|
+
* The widget ID is not required during creation, as it is automatically set by the server. Providing an ID will
|
|
34
|
+
* result in an error.
|
|
35
|
+
*/
|
|
36
|
+
createWidget(weight, color, options = { requestOptions: {} }) {
|
|
37
|
+
return (0, index_js_1.createWidget)(this._client, weight, color, options);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Update the contents of the widget. The widget ID is required in the input, but cannot be changed. All other fields
|
|
41
|
+
* are optional and will be updated within the widget if provided.
|
|
42
|
+
*/
|
|
43
|
+
updateWidget(id, options = { requestOptions: {} }) {
|
|
44
|
+
return (0, index_js_1.updateWidget)(this._client, id, options);
|
|
45
|
+
}
|
|
46
|
+
/** Delete a widget by ID. */
|
|
47
|
+
deleteWidget(id, options = { requestOptions: {} }) {
|
|
48
|
+
return (0, index_js_1.deleteWidget)(this._client, id, options);
|
|
49
|
+
}
|
|
50
|
+
/** Analyze a widget. The only guarantee is that this method will return a string containing the results of the analysis. */
|
|
51
|
+
analyzeWidget(id, options = { requestOptions: {} }) {
|
|
52
|
+
return (0, index_js_1.analyzeWidget)(this._client, id, options);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.WidgetServiceClient = WidgetServiceClient;
|
|
56
|
+
//# sourceMappingURL=WidgetServiceClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetServiceClient.js","sourceRoot":"","sources":["../../src/WidgetServiceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAWlC,gDAAqD;AAErD,2EAAoE;AAYpE,6CAOwB;AAKxB,MAAa,mBAAmB;IAM9B,YACE,QAAgB,EAChB,mBAAkE,EAClE,UAAsC,EAAE;QAExC,IAAI,IAAA,6BAAiB,EAAC,mBAAmB,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,OAAO,GAAG,IAAA,6CAAmB,EAAC,QAAQ,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;QAC7E,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,GAAG,IAAA,6CAAmB,EAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,UAA8B,EAAE,cAAc,EAAE,EAAE,EAAE;QAC9D,OAAO,IAAA,sBAAW,EAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,0BAA0B;IAC1B,SAAS,CAAC,EAAU,EAAE,UAA4B,EAAE,cAAc,EAAE,EAAE,EAAE;QACtE,OAAO,IAAA,oBAAS,EAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACH,YAAY,CACV,MAAc,EACd,KAAgB,EAChB,UAA+B,EAAE,cAAc,EAAE,EAAE,EAAE;QAErD,OAAO,IAAA,uBAAY,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACH,YAAY,CAAC,EAAU,EAAE,UAA+B,EAAE,cAAc,EAAE,EAAE,EAAE;QAC5E,OAAO,IAAA,uBAAY,EAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,6BAA6B;IAC7B,YAAY,CAAC,EAAU,EAAE,UAA+B,EAAE,cAAc,EAAE,EAAE,EAAE;QAC5E,OAAO,IAAA,uBAAY,EAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,4HAA4H;IAC5H,aAAa,CACX,EAAU,EACV,UAAgC,EAAE,cAAc,EAAE,EAAE,EAAE;QAEtD,OAAO,IAAA,wBAAa,EAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;CACF;AAlED,kDAkEC","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 { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { WidgetServiceClientOptions } from \"./api/WidgetServiceContext.js\";\nimport { createWidgetService } from \"./api/WidgetServiceContext.js\";\nimport type {\n AnalyzeResult,\n AnalyzeWidgetOptions,\n ColorType,\n CreateWidgetOptions,\n DeleteWidgetOptions,\n GetWidgetOptions,\n ListWidgetsOptions,\n UpdateWidgetOptions,\n Widget,\n} from \"./api/index.js\";\nimport {\n analyzeWidget,\n createWidget,\n deleteWidget,\n getWidget,\n listWidgets,\n updateWidget,\n} from \"./api/index.js\";\nimport type { WidgetServiceContext } from \"./rest/clientDefinitions.js\";\n\nexport { WidgetServiceClientOptions } from \"./api/WidgetServiceContext.js\";\n\nexport class WidgetServiceClient {\n private _client: WidgetServiceContext;\n\n /** */\n constructor(endpoint: string, options?: WidgetServiceClientOptions);\n constructor(endpoint: string, credential: TokenCredential, options?: WidgetServiceClientOptions);\n constructor(\n endpoint: string,\n credentialOrOptions?: TokenCredential | WidgetServiceClientOptions,\n options: WidgetServiceClientOptions = {},\n ) {\n if (isTokenCredential(credentialOrOptions)) {\n this._client = createWidgetService(endpoint, credentialOrOptions, options);\n } else {\n this._client = createWidgetService(endpoint, credentialOrOptions);\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 */\n listWidgets(options: ListWidgetsOptions = { requestOptions: {} }): Promise<Widget[]> {\n return listWidgets(this._client, options);\n }\n\n /** Get a widget by ID. */\n getWidget(id: string, options: GetWidgetOptions = { requestOptions: {} }): Promise<Widget> {\n return getWidget(this._client, id, options);\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 */\n createWidget(\n weight: number,\n color: ColorType,\n options: CreateWidgetOptions = { requestOptions: {} },\n ): Promise<Widget> {\n return createWidget(this._client, weight, color, options);\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 */\n updateWidget(id: string, options: UpdateWidgetOptions = { requestOptions: {} }): Promise<Widget> {\n return updateWidget(this._client, id, options);\n }\n\n /** Delete a widget by ID. */\n deleteWidget(id: string, options: DeleteWidgetOptions = { requestOptions: {} }): Promise<void> {\n return deleteWidget(this._client, id, options);\n }\n\n /** Analyze a widget. The only guarantee is that this method will return a string containing the results of the analysis. */\n analyzeWidget(\n id: string,\n options: AnalyzeWidgetOptions = { requestOptions: {} },\n ): Promise<AnalyzeResult> {\n return analyzeWidget(this._client, id, options);\n }\n}\n"]}
|
|
@@ -5,16 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Any changes you make here may be lost.
|
|
12
|
-
*
|
|
13
|
-
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
14
|
-
*/
|
|
15
|
-
import { ClientOptions } from "@azure-rest/core-client";
|
|
16
|
-
import { TokenCredential } from "@azure/core-auth";
|
|
17
|
-
import { WidgetServiceContext } from "../rest/index.js";
|
|
8
|
+
import type { ClientOptions } from "@azure-rest/core-client";
|
|
9
|
+
import type { TokenCredential } from "@azure/core-auth";
|
|
10
|
+
import type { WidgetServiceContext } from "../rest/index.js";
|
|
18
11
|
export { WidgetServiceContext } from "../rest/index.js";
|
|
19
12
|
export interface WidgetServiceClientOptions extends ClientOptions {
|
|
20
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetServiceContext.d.ts","sourceRoot":"","sources":["../../../src/api/WidgetServiceContext.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,0BAA2B,SAAQ,aAAa;CAAG;AAEpE;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,aAAa,GACtB,oBAAoB,CAAC;AACxB,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,EAC3B,OAAO,CAAC,EAAE,aAAa,GACtB,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createWidgetService = createWidgetService;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const core_auth_1 = require("@azure/core-auth");
|
|
8
|
+
const widgetServiceClient_js_1 = tslib_1.__importDefault(require("../rest/widgetServiceClient.js"));
|
|
9
|
+
function createWidgetService(endpoint, credentialOrOptions, options = {}) {
|
|
10
|
+
const baseUrl = endpoint;
|
|
11
|
+
if ((0, core_auth_1.isTokenCredential)(credentialOrOptions)) {
|
|
12
|
+
return (0, widgetServiceClient_js_1.default)(baseUrl, credentialOrOptions, options);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return (0, widgetServiceClient_js_1.default)(baseUrl, credentialOrOptions);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=WidgetServiceContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetServiceContext.js","sourceRoot":"","sources":["../../../src/api/WidgetServiceContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAgClC,kDAWC;;AA/BD,gDAAqD;AAErD,oGAAuD;AAkBvD,SAAgB,mBAAmB,CACjC,QAAgB,EAChB,mBAAqD,EACrD,UAAyB,EAAE;IAE3B,MAAM,OAAO,GAAG,QAAQ,CAAC;IACzB,IAAI,IAAA,6BAAiB,EAAC,mBAAmB,CAAC,EAAE,CAAC;QAC3C,OAAO,IAAA,gCAAS,EAAC,OAAO,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;SAAM,CAAC;QACN,OAAO,IAAA,gCAAS,EAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;IACjD,CAAC;AACH,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 { ClientOptions } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { WidgetServiceContext } from \"../rest/index.js\";\nimport getClient from \"../rest/widgetServiceClient.js\";\n\nexport { WidgetServiceContext } from \"../rest/index.js\";\n\nexport interface WidgetServiceClientOptions extends ClientOptions {}\n\n/**\n * This customization adds authentication to the client.\n */\nexport function createWidgetService(\n endpoint: string,\n options?: ClientOptions,\n): WidgetServiceContext;\nexport function createWidgetService(\n endpoint: string,\n credential: TokenCredential,\n options?: ClientOptions,\n): WidgetServiceContext;\nexport function createWidgetService(\n endpoint: string,\n credentialOrOptions?: TokenCredential | ClientOptions,\n options: ClientOptions = {},\n): WidgetServiceContext {\n const baseUrl = endpoint;\n if (isTokenCredential(credentialOrOptions)) {\n return getClient(baseUrl, credentialOrOptions, options);\n } else {\n return getClient(baseUrl, credentialOrOptions);\n }\n}\n"]}
|
|
@@ -1,10 +1,3 @@
|
|
|
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
1
|
/**
|
|
9
2
|
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
10
3
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foo.d.ts","sourceRoot":"","sources":["../../../src/api/foo.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,GAAG,IAAI,IAAI,CAE1B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.foo = foo;
|
|
6
|
+
/**
|
|
7
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
8
|
+
*
|
|
9
|
+
* Any changes you make here may be lost.
|
|
10
|
+
*
|
|
11
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
12
|
+
*/
|
|
13
|
+
function foo() {
|
|
14
|
+
console.log("foo");
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=foo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foo.js","sourceRoot":"","sources":["../../../src/api/foo.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AASlC,kBAEC;AATD;;;;;;GAMG;AACH,SAAgB,GAAG;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACrB,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 */\nexport function foo(): void {\n console.log(\"foo\");\n}\n"]}
|
|
@@ -1,10 +1,3 @@
|
|
|
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
1
|
/**
|
|
9
2
|
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
10
3
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createWidgetService = exports.analyzeWidget = exports.deleteWidget = exports.updateWidget = exports.createWidget = exports.getWidget = exports.listWidgets = void 0;
|
|
6
|
+
var operations_js_1 = require("./operations.js");
|
|
7
|
+
Object.defineProperty(exports, "listWidgets", { enumerable: true, get: function () { return operations_js_1.listWidgets; } });
|
|
8
|
+
Object.defineProperty(exports, "getWidget", { enumerable: true, get: function () { return operations_js_1.getWidget; } });
|
|
9
|
+
Object.defineProperty(exports, "createWidget", { enumerable: true, get: function () { return operations_js_1.createWidget; } });
|
|
10
|
+
Object.defineProperty(exports, "updateWidget", { enumerable: true, get: function () { return operations_js_1.updateWidget; } });
|
|
11
|
+
Object.defineProperty(exports, "deleteWidget", { enumerable: true, get: function () { return operations_js_1.deleteWidget; } });
|
|
12
|
+
Object.defineProperty(exports, "analyzeWidget", { enumerable: true, get: function () { return operations_js_1.analyzeWidget; } });
|
|
13
|
+
var WidgetServiceContext_js_1 = require("./WidgetServiceContext.js");
|
|
14
|
+
Object.defineProperty(exports, "createWidgetService", { enumerable: true, get: function () { return WidgetServiceContext_js_1.createWidgetService; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAWlC,iDAayB;AAZvB,4GAAA,WAAW,OAAA;AACX,0GAAA,SAAS,OAAA;AACT,6GAAA,YAAY,OAAA;AACZ,6GAAA,YAAY,OAAA;AACZ,6GAAA,YAAY,OAAA;AACZ,8GAAA,aAAa,OAAA;AAQf,qEAImC;AAHjC,8HAAA,mBAAmB,OAAA","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 \"./models.js\";\nexport {\n listWidgets,\n getWidget,\n createWidget,\n updateWidget,\n deleteWidget,\n analyzeWidget,\n ListWidgetsOptions,\n GetWidgetOptions,\n CreateWidgetOptions,\n UpdateWidgetOptions,\n DeleteWidgetOptions,\n AnalyzeWidgetOptions,\n} from \"./operations.js\";\nexport {\n createWidgetService,\n WidgetServiceContext,\n WidgetServiceClientOptions,\n} from \"./WidgetServiceContext.js\";\n"]}
|
|
@@ -1,10 +1,3 @@
|
|
|
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
1
|
/**
|
|
9
2
|
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
10
3
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/api/models.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,MAAM;AACN,MAAM,WAAW,MAAM;IACrB,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAC;IACX,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,wBAAwB;AACxB,MAAM;AACN,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,MAAM;AACN,MAAM,WAAW,aAAa;IAC5B,MAAM;IACN,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/api/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\n/** */\nexport interface Widget {\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: ColorType;\n}\n\n/** Type of ColorType */\n/** */\nexport type ColorType = \"red\" | \"blue\";\n\n/** */\nexport interface AnalyzeResult {\n /** */\n summary: string;\n}\n"]}
|
|
@@ -5,17 +5,11 @@
|
|
|
5
5
|
*
|
|
6
6
|
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
14
|
-
*/
|
|
15
|
-
import { StreamableMethod } from "@azure-rest/core-client";
|
|
16
|
-
import { RequestOptions } from "../common/interfaces.js";
|
|
17
|
-
import { AnalyzeWidget200Response, AnalyzeWidgetDefaultResponse, WidgetServiceContext as Client, CreateWidget201Response, CreateWidgetDefaultResponse, DeleteWidget204Response, DeleteWidgetDefaultResponse, GetWidget200Response, GetWidgetDefaultResponse, ListWidgets200Response, ListWidgetsDefaultResponse, UpdateWidget200Response, UpdateWidgetDefaultResponse } from "../rest/index.js";
|
|
18
|
-
import { AnalyzeResult, ColorType, Widget } from "./models.js";
|
|
8
|
+
import type { StreamableMethod } from "@azure-rest/core-client";
|
|
9
|
+
import type { RequestOptions } from "../common/interfaces.js";
|
|
10
|
+
import type { WidgetServiceContext as Client } from "../rest/clientDefinitions.js";
|
|
11
|
+
import type { AnalyzeWidget200Response, AnalyzeWidgetDefaultResponse, CreateWidget201Response, CreateWidgetDefaultResponse, DeleteWidget204Response, DeleteWidgetDefaultResponse, GetWidget200Response, GetWidgetDefaultResponse, ListWidgets200Response, ListWidgetsDefaultResponse, UpdateWidget200Response, UpdateWidgetDefaultResponse } from "../rest/index.js";
|
|
12
|
+
import type { AnalyzeResult, ColorType, Widget } from "./models.js";
|
|
19
13
|
export interface ListWidgetsOptions extends RequestOptions {
|
|
20
14
|
}
|
|
21
15
|
export interface GetWidgetOptions extends RequestOptions {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/api/operations.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,KAAK,EAA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EACV,OAAO,GAAE,mBAA4C,GACpD,gBAAgB,CAAC,uBAAuB,GAAG,2BAA2B,CAAC,CAMzE;AAED,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,uBAAuB,GAAG,2BAA2B,GAC5D,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,6BAA6B;AAC7B,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,mBAA4C,GACpD,OAAO,CAAC,IAAI,CAAC,CAGf;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,oBAA6C,GACrD,gBAAgB,CAAC,wBAAwB,GAAG,4BAA4B,CAAC,CAM3E;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,wBAAwB,GAAG,4BAA4B,GAC9D,OAAO,CAAC,aAAa,CAAC,CAQxB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,aAAa,CAAC,CAaxB"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports._listWidgetsSend = _listWidgetsSend;
|
|
6
|
+
exports._listWidgetsDeserialize = _listWidgetsDeserialize;
|
|
7
|
+
exports.listWidgets = listWidgets;
|
|
8
|
+
exports._getWidgetSend = _getWidgetSend;
|
|
9
|
+
exports._getWidgetDeserialize = _getWidgetDeserialize;
|
|
10
|
+
exports.getWidget = getWidget;
|
|
11
|
+
exports._createWidgetSend = _createWidgetSend;
|
|
12
|
+
exports._createWidgetDeserialize = _createWidgetDeserialize;
|
|
13
|
+
exports.createWidget = createWidget;
|
|
14
|
+
exports._updateWidgetSend = _updateWidgetSend;
|
|
15
|
+
exports._updateWidgetDeserialize = _updateWidgetDeserialize;
|
|
16
|
+
exports.updateWidget = updateWidget;
|
|
17
|
+
exports._deleteWidgetSend = _deleteWidgetSend;
|
|
18
|
+
exports._deleteWidgetDeserialize = _deleteWidgetDeserialize;
|
|
19
|
+
exports.deleteWidget = deleteWidget;
|
|
20
|
+
exports._analyzeWidgetSend = _analyzeWidgetSend;
|
|
21
|
+
exports._analyzeWidgetDeserialize = _analyzeWidgetDeserialize;
|
|
22
|
+
exports.analyzeWidget = analyzeWidget;
|
|
23
|
+
const core_rest_pipeline_1 = require("@azure/core-rest-pipeline");
|
|
24
|
+
const index_js_1 = require("../rest/index.js");
|
|
25
|
+
const foo_js_1 = require("./foo.js");
|
|
26
|
+
function _listWidgetsSend(context, options = { requestOptions: {} }) {
|
|
27
|
+
var _a, _b, _c;
|
|
28
|
+
return context.path("/widgets").get({
|
|
29
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
30
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
31
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
async function _listWidgetsDeserialize(result) {
|
|
35
|
+
var _a;
|
|
36
|
+
if ((0, index_js_1.isUnexpected)(result)) {
|
|
37
|
+
throw result.body;
|
|
38
|
+
}
|
|
39
|
+
return ((_a = result.body) !== null && _a !== void 0 ? _a : []).map((p) => ({
|
|
40
|
+
id: p["id"],
|
|
41
|
+
weight: p["weight"],
|
|
42
|
+
color: p["color"],
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* List all widgets in the system. This operation is not paginated, and returns a simple array of widgets.
|
|
47
|
+
*
|
|
48
|
+
* It does not accept any options or parameters.
|
|
49
|
+
*/
|
|
50
|
+
async function listWidgets(context, options = { requestOptions: {} }) {
|
|
51
|
+
const result = await _listWidgetsSend(context, options);
|
|
52
|
+
return _listWidgetsDeserialize(result);
|
|
53
|
+
}
|
|
54
|
+
function _getWidgetSend(context, id, options = { requestOptions: {} }) {
|
|
55
|
+
var _a, _b, _c;
|
|
56
|
+
return context.path("/widgets/{id}", id).get({
|
|
57
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
58
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
59
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async function _getWidgetDeserialize(result) {
|
|
63
|
+
if ((0, index_js_1.isUnexpected)(result)) {
|
|
64
|
+
throw result.body;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
id: result.body["id"],
|
|
68
|
+
weight: result.body["weight"],
|
|
69
|
+
color: result.body["color"],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** Get a widget by ID. */
|
|
73
|
+
async function getWidget(context, id, options = { requestOptions: {} }) {
|
|
74
|
+
const result = await _getWidgetSend(context, id, options);
|
|
75
|
+
return _getWidgetDeserialize(result);
|
|
76
|
+
}
|
|
77
|
+
function _createWidgetSend(context, weight, color, options = { requestOptions: {} }) {
|
|
78
|
+
var _a, _b, _c;
|
|
79
|
+
return context.path("/widgets").post({
|
|
80
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
81
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
82
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
83
|
+
body: { weight: weight, color: color },
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async function _createWidgetDeserialize(result) {
|
|
87
|
+
if ((0, index_js_1.isUnexpected)(result)) {
|
|
88
|
+
throw result.body;
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
id: result.body["id"],
|
|
92
|
+
weight: result.body["weight"],
|
|
93
|
+
color: result.body["color"],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create a new widget.
|
|
98
|
+
*
|
|
99
|
+
* The widget ID is not required during creation, as it is automatically set by the server. Providing an ID will
|
|
100
|
+
* result in an error.
|
|
101
|
+
*/
|
|
102
|
+
async function createWidget(context, weight, color, options = { requestOptions: {} }) {
|
|
103
|
+
const result = await _createWidgetSend(context, weight, color, options);
|
|
104
|
+
return _createWidgetDeserialize(result);
|
|
105
|
+
}
|
|
106
|
+
function _updateWidgetSend(context, id, options = { requestOptions: {} }) {
|
|
107
|
+
var _a, _b, _c;
|
|
108
|
+
return context.path("/widgets/{id}", id).patch({
|
|
109
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
110
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
111
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
112
|
+
body: { weight: options === null || options === void 0 ? void 0 : options.weight, color: options === null || options === void 0 ? void 0 : options.color },
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
async function _updateWidgetDeserialize(result) {
|
|
116
|
+
if ((0, index_js_1.isUnexpected)(result)) {
|
|
117
|
+
throw result.body;
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
id: result.body["id"],
|
|
121
|
+
weight: result.body["weight"],
|
|
122
|
+
color: result.body["color"],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Update the contents of the widget. The widget ID is required in the input, but cannot be changed. All other fields
|
|
127
|
+
* are optional and will be updated within the widget if provided.
|
|
128
|
+
*/
|
|
129
|
+
async function updateWidget(context, id, options = { requestOptions: {} }) {
|
|
130
|
+
const result = await _updateWidgetSend(context, id, options);
|
|
131
|
+
return _updateWidgetDeserialize(result);
|
|
132
|
+
}
|
|
133
|
+
function _deleteWidgetSend(context, id, options = { requestOptions: {} }) {
|
|
134
|
+
var _a, _b, _c;
|
|
135
|
+
return context.path("/widgets/{id}", id).delete({
|
|
136
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
137
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
138
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
async function _deleteWidgetDeserialize(result) {
|
|
142
|
+
if ((0, index_js_1.isUnexpected)(result)) {
|
|
143
|
+
throw result.body;
|
|
144
|
+
}
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
/** Delete a widget by ID. */
|
|
148
|
+
async function deleteWidget(context, id, options = { requestOptions: {} }) {
|
|
149
|
+
const result = await _deleteWidgetSend(context, id, options);
|
|
150
|
+
return _deleteWidgetDeserialize(result);
|
|
151
|
+
}
|
|
152
|
+
function _analyzeWidgetSend(context, id, options = { requestOptions: {} }) {
|
|
153
|
+
var _a, _b, _c;
|
|
154
|
+
return context.path("/widgets/{id}/analyze", id).post({
|
|
155
|
+
allowInsecureConnection: (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.allowInsecureConnection,
|
|
156
|
+
skipUrlEncoding: (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.skipUrlEncoding,
|
|
157
|
+
headers: Object.assign({}, (_c = options.requestOptions) === null || _c === void 0 ? void 0 : _c.headers),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
async function _analyzeWidgetDeserialize(result) {
|
|
161
|
+
if ((0, index_js_1.isUnexpected)(result)) {
|
|
162
|
+
throw result.body;
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
summary: result.body["summary"],
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* In this customization we will perform the following tasks in addition to the generated:
|
|
170
|
+
* - We are going to add special error handling for demonstration purposes
|
|
171
|
+
*/
|
|
172
|
+
async function analyzeWidget(context, id, options) {
|
|
173
|
+
try {
|
|
174
|
+
(0, foo_js_1.foo)();
|
|
175
|
+
const result = await _analyzeWidget(context, id, options);
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
console.error("Error occurred while calling analyzeWidget:", error);
|
|
180
|
+
if (error.message && error.statusCode) {
|
|
181
|
+
throw new core_rest_pipeline_1.RestError(error.message, { code: error.statusCode });
|
|
182
|
+
}
|
|
183
|
+
throw new Error(error);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/** Analyze a widget. The only guarantee is that this method will return a string containing the results of the analysis. */
|
|
187
|
+
async function _analyzeWidget(context, id, options = { requestOptions: {} }) {
|
|
188
|
+
const result = await _analyzeWidgetSend(context, id, options);
|
|
189
|
+
return _analyzeWidgetDeserialize(result);
|
|
190
|
+
}
|
|
191
|
+
//# 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;;AAiDlC,4CASC;AAED,0DAYC;AAOD,kCAMC;AAED,wCAUC;AAED,sDAYC;AAGD,8BAOC;AAED,8CAYC;AAED,4DAYC;AAQD,oCAQC;AAED,8CAWC;AAED,4DAYC;AAMD,oCAOC;AAED,8CAUC;AAED,4DAQC;AAGD,oCAOC;AAED,gDAUC;AAED,8DAUC;AAMD,sCAiBC;AAjRD,kEA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,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"]}
|
|
@@ -5,14 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
10
|
-
*
|
|
11
|
-
* Any changes you make here may be lost.
|
|
12
|
-
*
|
|
13
|
-
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
14
|
-
*/
|
|
15
|
-
import { RawHttpHeadersInput } from "@azure/core-rest-pipeline";
|
|
8
|
+
import type { RawHttpHeadersInput } from "@azure/core-rest-pipeline";
|
|
16
9
|
export interface RequestOptions {
|
|
17
10
|
requestOptions?: {
|
|
18
11
|
/**
|
|
@@ -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"]}
|
|
@@ -1,10 +1,3 @@
|
|
|
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
1
|
/**
|
|
9
2
|
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
10
3
|
*
|
|
@@ -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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.WidgetServiceClient = void 0;
|
|
6
|
+
var WidgetServiceClient_js_1 = require("./WidgetServiceClient.js");
|
|
7
|
+
Object.defineProperty(exports, "WidgetServiceClient", { enumerable: true, get: function () { return WidgetServiceClient_js_1.WidgetServiceClient; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAmBlC,mEAA2F;AAAlF,6HAAA,mBAAmB,OAAA","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,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.logger = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* THIS IS AN AUTO-GENERATED FILE - DO NOT EDIT!
|
|
8
|
+
*
|
|
9
|
+
* Any changes you make here may be lost.
|
|
10
|
+
*
|
|
11
|
+
* If you need to make changes, please do so in the original source file, \{project-root\}/sources/custom
|
|
12
|
+
*/
|
|
13
|
+
const logger_1 = require("@azure/logger");
|
|
14
|
+
exports.logger = (0, logger_1.createClientLogger)("widget");
|
|
15
|
+
//# 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,0CAAmD;AACtC,QAAA,MAAM,GAAG,IAAA,2BAAkB,EAAC,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"]}
|