@azure/template-dpg 1.0.0-beta.2 → 1.0.0-beta.3

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.
Files changed (115) hide show
  1. package/dist/browser/WidgetServiceClient.d.ts +1 -1
  2. package/dist/browser/WidgetServiceClient.d.ts.map +1 -1
  3. package/dist/browser/WidgetServiceClient.js +1 -0
  4. package/dist/browser/WidgetServiceClient.js.map +1 -1
  5. package/dist/browser/api/WidgetServiceContext.d.ts +1 -1
  6. package/dist/browser/api/WidgetServiceContext.d.ts.map +1 -1
  7. package/dist/browser/api/WidgetServiceContext.js.map +1 -1
  8. package/dist/browser/api/index.d.ts +3 -3
  9. package/dist/browser/api/index.d.ts.map +1 -1
  10. package/dist/browser/api/index.js.map +1 -1
  11. package/dist/browser/api/operations.js +20 -27
  12. package/dist/browser/api/operations.js.map +1 -1
  13. package/dist/browser/index.d.ts +4 -4
  14. package/dist/browser/index.d.ts.map +1 -1
  15. package/dist/browser/index.js.map +1 -1
  16. package/dist/browser/rest/index.d.ts +5 -5
  17. package/dist/browser/rest/index.d.ts.map +1 -1
  18. package/dist/browser/rest/index.js +0 -5
  19. package/dist/browser/rest/index.js.map +1 -1
  20. package/dist/browser/rest/isUnexpected.js +4 -5
  21. package/dist/browser/rest/isUnexpected.js.map +1 -1
  22. package/dist/browser/rest/widgetServiceClient.js +11 -8
  23. package/dist/browser/rest/widgetServiceClient.js.map +1 -1
  24. package/dist/commonjs/WidgetServiceClient.d.ts +1 -1
  25. package/dist/commonjs/WidgetServiceClient.d.ts.map +1 -1
  26. package/dist/commonjs/WidgetServiceClient.js +73 -53
  27. package/dist/commonjs/WidgetServiceClient.js.map +7 -1
  28. package/dist/commonjs/api/WidgetServiceContext.d.ts +1 -1
  29. package/dist/commonjs/api/WidgetServiceContext.d.ts.map +1 -1
  30. package/dist/commonjs/api/WidgetServiceContext.js +45 -16
  31. package/dist/commonjs/api/WidgetServiceContext.js.map +7 -1
  32. package/dist/commonjs/api/foo.js +28 -14
  33. package/dist/commonjs/api/foo.js.map +7 -1
  34. package/dist/commonjs/api/index.d.ts +3 -3
  35. package/dist/commonjs/api/index.d.ts.map +1 -1
  36. package/dist/commonjs/api/index.js +41 -15
  37. package/dist/commonjs/api/index.js.map +7 -1
  38. package/dist/commonjs/api/models.js +16 -5
  39. package/dist/commonjs/api/models.js.map +7 -1
  40. package/dist/commonjs/api/operations.js +165 -157
  41. package/dist/commonjs/api/operations.js.map +7 -1
  42. package/dist/commonjs/common/interfaces.js +16 -5
  43. package/dist/commonjs/common/interfaces.js.map +7 -1
  44. package/dist/commonjs/index.d.ts +4 -4
  45. package/dist/commonjs/index.d.ts.map +1 -1
  46. package/dist/commonjs/index.js +28 -8
  47. package/dist/commonjs/index.js.map +7 -1
  48. package/dist/commonjs/logger.js +29 -15
  49. package/dist/commonjs/logger.js.map +7 -1
  50. package/dist/commonjs/rest/clientDefinitions.js +16 -5
  51. package/dist/commonjs/rest/clientDefinitions.js.map +7 -1
  52. package/dist/commonjs/rest/index.d.ts +5 -5
  53. package/dist/commonjs/rest/index.d.ts.map +1 -1
  54. package/dist/commonjs/rest/index.js +43 -22
  55. package/dist/commonjs/rest/index.js.map +7 -1
  56. package/dist/commonjs/rest/isUnexpected.js +73 -68
  57. package/dist/commonjs/rest/isUnexpected.js.map +7 -1
  58. package/dist/commonjs/rest/models.js +16 -5
  59. package/dist/commonjs/rest/models.js.map +7 -1
  60. package/dist/commonjs/rest/outputModels.js +16 -5
  61. package/dist/commonjs/rest/outputModels.js.map +7 -1
  62. package/dist/commonjs/rest/parameters.js +16 -5
  63. package/dist/commonjs/rest/parameters.js.map +7 -1
  64. package/dist/commonjs/rest/responses.js +16 -5
  65. package/dist/commonjs/rest/responses.js.map +7 -1
  66. package/dist/commonjs/rest/widgetServiceClient.js +50 -38
  67. package/dist/commonjs/rest/widgetServiceClient.js.map +7 -1
  68. package/dist/commonjs/tsdoc-metadata.json +11 -11
  69. package/dist/esm/WidgetServiceClient.d.ts +1 -1
  70. package/dist/esm/WidgetServiceClient.d.ts.map +1 -1
  71. package/dist/esm/WidgetServiceClient.js +1 -0
  72. package/dist/esm/WidgetServiceClient.js.map +1 -1
  73. package/dist/esm/api/WidgetServiceContext.d.ts +1 -1
  74. package/dist/esm/api/WidgetServiceContext.d.ts.map +1 -1
  75. package/dist/esm/api/WidgetServiceContext.js.map +1 -1
  76. package/dist/esm/api/index.d.ts +3 -3
  77. package/dist/esm/api/index.d.ts.map +1 -1
  78. package/dist/esm/api/index.js.map +1 -1
  79. package/dist/esm/api/operations.js +20 -27
  80. package/dist/esm/api/operations.js.map +1 -1
  81. package/dist/esm/index.d.ts +4 -4
  82. package/dist/esm/index.d.ts.map +1 -1
  83. package/dist/esm/index.js.map +1 -1
  84. package/dist/esm/rest/index.d.ts +5 -5
  85. package/dist/esm/rest/index.d.ts.map +1 -1
  86. package/dist/esm/rest/index.js +0 -5
  87. package/dist/esm/rest/index.js.map +1 -1
  88. package/dist/esm/rest/isUnexpected.js +4 -5
  89. package/dist/esm/rest/isUnexpected.js.map +1 -1
  90. package/dist/esm/rest/widgetServiceClient.js +11 -8
  91. package/dist/esm/rest/widgetServiceClient.js.map +1 -1
  92. package/dist/react-native/WidgetServiceClient.d.ts +1 -1
  93. package/dist/react-native/WidgetServiceClient.d.ts.map +1 -1
  94. package/dist/react-native/WidgetServiceClient.js +1 -0
  95. package/dist/react-native/WidgetServiceClient.js.map +1 -1
  96. package/dist/react-native/api/WidgetServiceContext.d.ts +1 -1
  97. package/dist/react-native/api/WidgetServiceContext.d.ts.map +1 -1
  98. package/dist/react-native/api/WidgetServiceContext.js.map +1 -1
  99. package/dist/react-native/api/index.d.ts +3 -3
  100. package/dist/react-native/api/index.d.ts.map +1 -1
  101. package/dist/react-native/api/index.js.map +1 -1
  102. package/dist/react-native/api/operations.js +20 -27
  103. package/dist/react-native/api/operations.js.map +1 -1
  104. package/dist/react-native/index.d.ts +4 -4
  105. package/dist/react-native/index.d.ts.map +1 -1
  106. package/dist/react-native/index.js.map +1 -1
  107. package/dist/react-native/rest/index.d.ts +5 -5
  108. package/dist/react-native/rest/index.d.ts.map +1 -1
  109. package/dist/react-native/rest/index.js +0 -5
  110. package/dist/react-native/rest/index.js.map +1 -1
  111. package/dist/react-native/rest/isUnexpected.js +4 -5
  112. package/dist/react-native/rest/isUnexpected.js.map +1 -1
  113. package/dist/react-native/rest/widgetServiceClient.js +11 -8
  114. package/dist/react-native/rest/widgetServiceClient.js.map +1 -1
  115. package/package.json +50 -60
@@ -1 +1,7 @@
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"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/rest/clientDefinitions.ts"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -7,11 +7,11 @@
7
7
  */
8
8
  import WidgetServiceClient from "./widgetServiceClient.js";
9
9
  export * from "./widgetServiceClient.js";
10
- export * from "./parameters.js";
11
- export * from "./responses.js";
12
- export * from "./clientDefinitions.js";
10
+ export type * from "./parameters.js";
11
+ export type * from "./responses.js";
12
+ export type * from "./clientDefinitions.js";
13
13
  export * from "./isUnexpected.js";
14
- export * from "./models.js";
15
- export * from "./outputModels.js";
14
+ export type * from "./models.js";
15
+ export type * from "./outputModels.js";
16
16
  export default WidgetServiceClient;
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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,mBAAmB,iBAAiB,CAAC;AACrC,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,wBAAwB,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,mBAAmB,aAAa,CAAC;AACjC,mBAAmB,mBAAmB,CAAC;AAEvC,eAAe,mBAAmB,CAAC"}
@@ -1,22 +1,43 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- const tslib_1 = require("tslib");
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 widgetServiceClient_js_1 = tslib_1.__importDefault(require("./widgetServiceClient.js"));
14
- tslib_1.__exportStar(require("./widgetServiceClient.js"), exports);
15
- tslib_1.__exportStar(require("./parameters.js"), exports);
16
- tslib_1.__exportStar(require("./responses.js"), exports);
17
- tslib_1.__exportStar(require("./clientDefinitions.js"), exports);
18
- tslib_1.__exportStar(require("./isUnexpected.js"), exports);
19
- tslib_1.__exportStar(require("./models.js"), exports);
20
- tslib_1.__exportStar(require("./outputModels.js"), exports);
21
- exports.default = widgetServiceClient_js_1.default;
22
- //# sourceMappingURL=index.js.map
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var rest_exports = {};
30
+ __export(rest_exports, {
31
+ default: () => rest_default
32
+ });
33
+ module.exports = __toCommonJS(rest_exports);
34
+ var import_widgetServiceClient = __toESM(require("./widgetServiceClient.js"));
35
+ __reExport(rest_exports, require("./widgetServiceClient.js"), module.exports);
36
+ __reExport(rest_exports, require("./isUnexpected.js"), module.exports);
37
+ var rest_default = import_widgetServiceClient.default;
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ ...require("./widgetServiceClient.js"),
41
+ ...require("./isUnexpected.js")
42
+ });
43
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;;;GAMG;AAEH,8FAA2D;AAE3D,mEAAyC;AACzC,0DAAgC;AAChC,yDAA+B;AAC/B,iEAAuC;AACvC,4DAAkC;AAClC,sDAA4B;AAC5B,4DAAkC;AAElC,kBAAe,gCAAmB,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"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/rest/index.ts"],
4
+ "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 type * from \"./parameters.js\";\nexport type * from \"./responses.js\";\nexport type * from \"./clientDefinitions.js\";\nexport * from \"./isUnexpected.js\";\nexport type * from \"./models.js\";\nexport type * from \"./outputModels.js\";\n\nexport default WidgetServiceClient;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,iCAAgC;AAEhC,yBAAc,qCAbd;AAiBA,yBAAc,8BAjBd;AAqBA,IAAO,eAAQ,2BAAAA;",
6
+ "names": ["WidgetServiceClient"]
7
+ }
@@ -1,78 +1,83 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.isUnexpected = isUnexpected;
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var isUnexpected_exports = {};
19
+ __export(isUnexpected_exports, {
20
+ isUnexpected: () => isUnexpected
21
+ });
22
+ module.exports = __toCommonJS(isUnexpected_exports);
6
23
  const responseMap = {
7
- "GET /widgets": ["200"],
8
- "POST /widgets": ["201"],
9
- "GET /widgets/{id}": ["200"],
10
- "PATCH /widgets/{id}": ["200"],
11
- "DELETE /widgets/{id}": ["204"],
12
- "POST /widgets/{id}/analyze": ["200"],
24
+ "GET /widgets": ["200"],
25
+ "POST /widgets": ["201"],
26
+ "GET /widgets/{id}": ["200"],
27
+ "PATCH /widgets/{id}": ["200"],
28
+ "DELETE /widgets/{id}": ["204"],
29
+ "POST /widgets/{id}/analyze": ["200"]
13
30
  };
14
31
  function isUnexpected(response) {
15
- const lroOriginal = response.headers["x-ms-original-url"];
16
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
17
- const method = response.request.method;
18
- let pathDetails = responseMap[`${method} ${url.pathname}`];
19
- if (!pathDetails) {
20
- pathDetails = getParametrizedPathSuccess(method, url.pathname);
21
- }
22
- return !pathDetails.includes(response.status);
32
+ const lroOriginal = response.headers["x-ms-original-url"];
33
+ const url = new URL(lroOriginal ?? response.request.url);
34
+ const method = response.request.method;
35
+ let pathDetails = responseMap[`${method} ${url.pathname}`];
36
+ if (!pathDetails) {
37
+ pathDetails = getParametrizedPathSuccess(method, url.pathname);
38
+ }
39
+ return !pathDetails.includes(response.status);
23
40
  }
24
41
  function getParametrizedPathSuccess(method, path) {
25
- var _a, _b, _c, _d;
26
- const pathParts = path.split("/");
27
- // Traverse list to match the longest candidate
28
- // matchedLen: the length of candidate path
29
- // matchedValue: the matched status code array
30
- let matchedLen = -1, matchedValue = [];
31
- // Iterate the responseMap to find a match
32
- for (const [key, value] of Object.entries(responseMap)) {
33
- // Extracting the path from the map key which is in format
34
- // GET /path/foo
35
- if (!key.startsWith(method)) {
36
- continue;
37
- }
38
- const candidatePath = getPathFromMapKey(key);
39
- // Get each part of the url path
40
- const candidateParts = candidatePath.split("/");
41
- // track if we have found a match to return the values found.
42
- let found = true;
43
- for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
44
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
45
- const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
46
- // If the current part of the candidate is a "template" part
47
- // Try to use the suffix of pattern to match the path
48
- // {guid} ==> $
49
- // {guid}:export ==> :export$
50
- const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
51
- if (!isMatched) {
52
- found = false;
53
- break;
54
- }
55
- continue;
56
- }
57
- // If the candidate part is not a template and
58
- // the parts don't match mark the candidate as not found
59
- // to move on with the next candidate path.
60
- if (candidateParts[i] !== pathParts[j]) {
61
- found = false;
62
- break;
63
- }
64
- }
65
- // We finished evaluating the current candidate parts
66
- // Update the matched value if and only if we found the longer pattern
67
- if (found && candidatePath.length > matchedLen) {
68
- matchedLen = candidatePath.length;
69
- matchedValue = value;
42
+ const pathParts = path.split("/");
43
+ let matchedLen = -1, matchedValue = [];
44
+ for (const [key, value] of Object.entries(responseMap)) {
45
+ if (!key.startsWith(method)) {
46
+ continue;
47
+ }
48
+ const candidatePath = getPathFromMapKey(key);
49
+ const candidateParts = candidatePath.split("/");
50
+ let found = true;
51
+ for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
52
+ if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
53
+ const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
54
+ const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(
55
+ pathParts[j] || ""
56
+ );
57
+ if (!isMatched) {
58
+ found = false;
59
+ break;
70
60
  }
61
+ continue;
62
+ }
63
+ if (candidateParts[i] !== pathParts[j]) {
64
+ found = false;
65
+ break;
66
+ }
67
+ }
68
+ if (found && candidatePath.length > matchedLen) {
69
+ matchedLen = candidatePath.length;
70
+ matchedValue = value;
71
71
  }
72
- return matchedValue;
72
+ }
73
+ return matchedValue;
73
74
  }
74
75
  function getPathFromMapKey(mapKey) {
75
- const pathStart = mapKey.indexOf("/");
76
- return mapKey.slice(pathStart);
76
+ const pathStart = mapKey.indexOf("/");
77
+ return mapKey.slice(pathStart);
77
78
  }
78
- //# sourceMappingURL=isUnexpected.js.map
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ isUnexpected
82
+ });
83
+ //# sourceMappingURL=isUnexpected.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../src/rest/isUnexpected.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoDlC,oCA6BC;AAxDD,MAAM,WAAW,GAA6B;IAC5C,cAAc,EAAE,CAAC,KAAK,CAAC;IACvB,eAAe,EAAE,CAAC,KAAK,CAAC;IACxB,mBAAmB,EAAE,CAAC,KAAK,CAAC;IAC5B,qBAAqB,EAAE,CAAC,KAAK,CAAC;IAC9B,sBAAsB,EAAE,CAAC,KAAK,CAAC;IAC/B,4BAA4B,EAAE,CAAC,KAAK,CAAC;CACtC,CAAC;AAoBF,SAAgB,YAAY,CAC1B,QAYgC;IAQhC,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,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AC,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"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/rest/isUnexpected.ts"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BA,MAAM,cAAwC;AAAA,EAC5C,gBAAgB,CAAC,KAAK;AAAA,EACtB,iBAAiB,CAAC,KAAK;AAAA,EACvB,qBAAqB,CAAC,KAAK;AAAA,EAC3B,uBAAuB,CAAC,KAAK;AAAA,EAC7B,wBAAwB,CAAC,KAAK;AAAA,EAC9B,8BAA8B,CAAC,KAAK;AACtC;AAoBO,SAAS,aACd,UAmB+B;AAC/B,QAAM,cAAc,SAAS,QAAQ,mBAAmB;AACxD,QAAM,MAAM,IAAI,IAAI,eAAe,SAAS,QAAQ,GAAG;AACvD,QAAM,SAAS,SAAS,QAAQ;AAChC,MAAI,cAAc,YAAY,GAAG,MAAM,IAAI,IAAI,QAAQ,EAAE;AACzD,MAAI,CAAC,aAAa;AAChB,kBAAc,2BAA2B,QAAQ,IAAI,QAAQ;AAAA,EAC/D;AACA,SAAO,CAAC,YAAY,SAAS,SAAS,MAAM;A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Module", { value: true });
5
- //# sourceMappingURL=models.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var models_exports = {};
15
+ module.exports = __toCommonJS(models_exports);
16
+ //# sourceMappingURL=models.js.map
@@ -1 +1,7 @@
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"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/rest/models.ts"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,5 +1,16 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=outputModels.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var outputModels_exports = {};
15
+ module.exports = __toCommonJS(outputModels_exports);
16
+ //# sourceMappingURL=outputModels.js.map
@@ -1 +1,7 @@
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"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/rest/outputModels.ts"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,5 +1,16 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=parameters.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var parameters_exports = {};
15
+ module.exports = __toCommonJS(parameters_exports);
16
+ //# sourceMappingURL=parameters.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/rest/parameters.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 { RequestParameters } from \"@azure-rest/core-client\";\nimport type { CreateWidget, UpdateWidget } from \"./models.js\";\n\nexport type ListWidgetsParameters = RequestParameters;\nexport type GetWidgetParameters = RequestParameters;\n\nexport interface CreateWidgetBodyParam {\n body?: CreateWidget;\n}\n\nexport type CreateWidgetParameters = CreateWidgetBodyParam & RequestParameters;\n\nexport interface UpdateWidgetBodyParam {\n body?: UpdateWidget;\n}\n\nexport type UpdateWidgetParameters = UpdateWidgetBodyParam & RequestParameters;\nexport type DeleteWidgetParameters = RequestParameters;\nexport type AnalyzeWidgetParameters = RequestParameters;\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/rest/parameters.ts"],
4
+ "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 { RequestParameters } from \"@azure-rest/core-client\";\nimport type { CreateWidget, UpdateWidget } from \"./models.js\";\n\nexport type ListWidgetsParameters = RequestParameters;\nexport type GetWidgetParameters = RequestParameters;\n\nexport interface CreateWidgetBodyParam {\n body?: CreateWidget;\n}\n\nexport type CreateWidgetParameters = CreateWidgetBodyParam & RequestParameters;\n\nexport interface UpdateWidgetBodyParam {\n body?: UpdateWidget;\n}\n\nexport type UpdateWidgetParameters = UpdateWidgetBodyParam & RequestParameters;\nexport type DeleteWidgetParameters = RequestParameters;\nexport type AnalyzeWidgetParameters = RequestParameters;\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,5 +1,16 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=responses.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var responses_exports = {};
15
+ module.exports = __toCommonJS(responses_exports);
16
+ //# sourceMappingURL=responses.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/rest/responses.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 { HttpResponse } from \"@azure-rest/core-client\";\nimport type { WidgetOutput, WidgetErrorOutput, AnalyzeResultOutput } from \"./outputModels.js\";\n\n/** The request has succeeded. */\nexport interface ListWidgets200Response extends HttpResponse {\n status: \"200\";\n body: Array<WidgetOutput>;\n}\n\nexport interface ListWidgetsDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** The request has succeeded. */\nexport interface GetWidget200Response extends HttpResponse {\n status: \"200\";\n body: WidgetOutput;\n}\n\nexport interface GetWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface CreateWidget201Response extends HttpResponse {\n status: \"201\";\n body: WidgetOutput;\n}\n\nexport interface CreateWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** The request has succeeded. */\nexport interface UpdateWidget200Response extends HttpResponse {\n status: \"200\";\n body: WidgetOutput;\n}\n\nexport interface UpdateWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteWidget204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** The request has succeeded. */\nexport interface AnalyzeWidget200Response extends HttpResponse {\n status: \"200\";\n body: AnalyzeResultOutput;\n}\n\nexport interface AnalyzeWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/rest/responses.ts"],
4
+ "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 { HttpResponse } from \"@azure-rest/core-client\";\nimport type { WidgetOutput, WidgetErrorOutput, AnalyzeResultOutput } from \"./outputModels.js\";\n\n/** The request has succeeded. */\nexport interface ListWidgets200Response extends HttpResponse {\n status: \"200\";\n body: Array<WidgetOutput>;\n}\n\nexport interface ListWidgetsDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** The request has succeeded. */\nexport interface GetWidget200Response extends HttpResponse {\n status: \"200\";\n body: WidgetOutput;\n}\n\nexport interface GetWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface CreateWidget201Response extends HttpResponse {\n status: \"201\";\n body: WidgetOutput;\n}\n\nexport interface CreateWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** The request has succeeded. */\nexport interface UpdateWidget200Response extends HttpResponse {\n status: \"200\";\n body: WidgetOutput;\n}\n\nexport interface UpdateWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteWidget204Response extends HttpResponse {\n status: \"204\";\n}\n\nexport interface DeleteWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n\n/** The request has succeeded. */\nexport interface AnalyzeWidget200Response extends HttpResponse {\n status: \"200\";\n body: AnalyzeResultOutput;\n}\n\nexport interface AnalyzeWidgetDefaultResponse extends HttpResponse {\n status: string;\n body: WidgetErrorOutput;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,42 +1,54 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.default = createClient;
6
- const core_client_1 = require("@azure-rest/core-client");
7
- const core_auth_1 = require("@azure/core-auth");
8
- const logger_js_1 = require("../logger.js");
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var widgetServiceClient_exports = {};
19
+ __export(widgetServiceClient_exports, {
20
+ default: () => createClient
21
+ });
22
+ module.exports = __toCommonJS(widgetServiceClient_exports);
23
+ var import_core_client = require("@azure-rest/core-client");
24
+ var import_core_auth = require("@azure/core-auth");
25
+ var import_logger = require("../logger.js");
9
26
  function createClient(endpoint, credentialOrOptions, options = {}) {
10
- let credential;
11
- if ((0, core_auth_1.isTokenCredential)(credentialOrOptions)) {
12
- credential = credentialOrOptions;
13
- }
14
- else {
15
- options = credentialOrOptions !== null && credentialOrOptions !== void 0 ? credentialOrOptions : {};
16
- }
17
- const client = _createClient(endpoint, options);
18
- (0, core_client_1.addCredentialPipelinePolicy)(client.pipeline, endpoint, { credential, clientOptions: options });
19
- return client;
27
+ let credential;
28
+ if ((0, import_core_auth.isTokenCredential)(credentialOrOptions)) {
29
+ credential = credentialOrOptions;
30
+ } else {
31
+ options = credentialOrOptions ?? {};
32
+ }
33
+ const client = _createClient(endpoint, options);
34
+ (0, import_core_client.addCredentialPipelinePolicy)(client.pipeline, endpoint, { credential, clientOptions: options });
35
+ return client;
20
36
  }
21
- /**
22
- * Initialize a new instance of `WidgetServiceContext`
23
- * @param endpoint - The parameter endpoint
24
- * @param options - the parameter for all optional parameters
25
- */
26
37
  function _createClient(endpoint, options = {}) {
27
- var _a, _b, _c, _d;
28
- const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : `${endpoint}`;
29
- options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "1.0.0";
30
- const userAgentInfo = `azsdk-js-widget-rest/1.0.0-beta.2`;
31
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
32
- ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
33
- : `${userAgentInfo}`;
34
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
35
- userAgentPrefix,
36
- }, loggingOptions: {
37
- logger: (_d = (_c = options.loggingOptions) === null || _c === void 0 ? void 0 : _c.logger) !== null && _d !== void 0 ? _d : logger_js_1.logger.info,
38
- } });
39
- const client = (0, core_client_1.getClient)(baseUrl, options);
40
- return client;
38
+ const baseUrl = options.baseUrl ?? `${endpoint}`;
39
+ options.apiVersion = options.apiVersion ?? "1.0.0";
40
+ const userAgentInfo = `azsdk-js-widget-rest/1.0.0-beta.2`;
41
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` : `${userAgentInfo}`;
42
+ options = {
43
+ ...options,
44
+ userAgentOptions: {
45
+ userAgentPrefix
46
+ },
47
+ loggingOptions: {
48
+ logger: options.loggingOptions?.logger ?? import_logger.logger.info
49
+ }
50
+ };
51
+ const client = (0, import_core_client.getClient)(baseUrl, options);
52
+ return client;
41
53
  }
42
- //# sourceMappingURL=widgetServiceClient.js.map
54
+ //# sourceMappingURL=widgetServiceClient.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"widgetServiceClient.js","sourceRoot":"","sources":["../../../src/rest/widgetServiceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA6BlC,+BAeC;AAjCD,yDAAiF;AAEjF,gDAAqD;AACrD,4CAAsC;AAetC,SAAwB,YAAY,CAClC,QAAgB,EAChB,mBAAqD,EACrD,UAAyB,EAAE;IAE3B,IAAI,UAAuC,CAAC;IAC5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IS 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"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/rest/widgetServiceClient.ts"],
4
+ "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
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,yBAAuD;AAEvD,uBAAkC;AAClC,oBAAuB;AAeR,SAAR,aACL,UACA,qBACA,UAAyB,CAAC,GACJ;AACtB,MAAI;AACJ,UAAI,oCAAkB,mBAAmB,GAAG;AAC1C,iBAAa;AAAA,EACf,OAAO;AACL,cAAU,uBAAuB,CAAC;AAAA,EACpC;AAEA,QAAM,SAAS,cAAc,UAAU,OAAO;AAC9C,sDAA4B,OAAO,UAAU,UAAU,EAAE,YAAY,eAAe,QAAQ,CAAC;AAC7F,SAAO;AACT;AAOA,SAAS,cAAc,UAAkB,UAAyB,CAAC,GAAyB;AAC1F,QAAM,UAAU,QAAQ,WAAW,GAAG,QAAQ;AAC9C,UAAQ,aAAa,QAAQ,cAAc;AAC3C,QAAM,gBAAgB;AACtB,QAAM,kBACJ,QAAQ,oBAAoB,QAAQ,iBAAiB,kBACjD,GAAG,QAAQ,iBAAiB,eAAe,IAAI,aAAa,KAC5D,GAAG,aAAa;AACtB,YAAU;AAAA,IACR,GAAG;AAAA,IACH,kBAAkB;AAAA,MAChB;AAAA,IACF;AAAA,IACA,gBAAgB;AAAA,MACd,QAAQ,QAAQ,gBAAgB,UAAU,qBAAO;AAAA,IACnD;AAAA,EACF;AACA,QAAM,aAAS,8BAAU,SAAS,OAAO;AACzC,SAAO;AACT;",
6
+ "names": []
7
+ }