@azure-rest/arm-servicefabric 1.0.0-beta.1 → 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 (224) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +4 -4
  3. package/README.md +29 -21
  4. package/dist/browser/clientDefinitions.d.ts +137 -0
  5. package/dist/browser/clientDefinitions.d.ts.map +1 -0
  6. package/dist/browser/clientDefinitions.js +4 -0
  7. package/dist/browser/clientDefinitions.js.map +1 -0
  8. package/dist/browser/customizedApiVersionPolicy.d.ts +10 -0
  9. package/dist/browser/customizedApiVersionPolicy.d.ts.map +1 -0
  10. package/{dist-esm/src → dist/browser}/customizedApiVersionPolicy.js +1 -1
  11. package/dist/browser/customizedApiVersionPolicy.js.map +1 -0
  12. package/dist/browser/index.d.ts +12 -0
  13. package/dist/browser/index.d.ts.map +1 -0
  14. package/dist/browser/index.js +14 -0
  15. package/dist/browser/index.js.map +1 -0
  16. package/dist/browser/isUnexpected.d.ts +32 -0
  17. package/dist/browser/isUnexpected.d.ts.map +1 -0
  18. package/{dist-esm/src → dist/browser}/isUnexpected.js +64 -121
  19. package/dist/browser/isUnexpected.js.map +1 -0
  20. package/dist/browser/logger.d.ts +2 -0
  21. package/dist/browser/logger.d.ts.map +1 -0
  22. package/dist/browser/logger.js +5 -0
  23. package/dist/browser/logger.js.map +1 -0
  24. package/dist/browser/models.d.ts +772 -0
  25. package/dist/browser/models.d.ts.map +1 -0
  26. package/dist/browser/models.js +4 -0
  27. package/dist/browser/models.js.map +1 -0
  28. package/dist/browser/outputModels.d.ts +861 -0
  29. package/dist/browser/outputModels.d.ts.map +1 -0
  30. package/dist/browser/outputModels.js +4 -0
  31. package/dist/browser/outputModels.js.map +1 -0
  32. package/dist/browser/package.json +3 -0
  33. package/dist/browser/paginateHelper.d.ts +68 -0
  34. package/dist/browser/paginateHelper.d.ts.map +1 -0
  35. package/{dist-esm/src → dist/browser}/paginateHelper.js +70 -3
  36. package/dist/browser/paginateHelper.js.map +1 -0
  37. package/dist/browser/parameters.d.ts +105 -0
  38. package/dist/browser/parameters.d.ts.map +1 -0
  39. package/dist/browser/parameters.js +4 -0
  40. package/dist/browser/parameters.js.map +1 -0
  41. package/dist/browser/pollingHelper.d.ts +76 -0
  42. package/dist/browser/pollingHelper.d.ts.map +1 -0
  43. package/dist/browser/pollingHelper.js +107 -0
  44. package/dist/browser/pollingHelper.js.map +1 -0
  45. package/dist/browser/responses.d.ts +328 -0
  46. package/dist/browser/responses.d.ts.map +1 -0
  47. package/dist/browser/responses.js +4 -0
  48. package/dist/browser/responses.js.map +1 -0
  49. package/dist/browser/serviceFabricClient.d.ts +15 -0
  50. package/dist/browser/serviceFabricClient.d.ts.map +1 -0
  51. package/dist/browser/serviceFabricClient.js +44 -0
  52. package/dist/browser/serviceFabricClient.js.map +1 -0
  53. package/dist/commonjs/clientDefinitions.d.ts +137 -0
  54. package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
  55. package/dist/commonjs/clientDefinitions.js +5 -0
  56. package/dist/commonjs/clientDefinitions.js.map +1 -0
  57. package/dist/commonjs/customizedApiVersionPolicy.d.ts +10 -0
  58. package/dist/commonjs/customizedApiVersionPolicy.d.ts.map +1 -0
  59. package/dist/commonjs/customizedApiVersionPolicy.js +27 -0
  60. package/dist/commonjs/customizedApiVersionPolicy.js.map +1 -0
  61. package/dist/commonjs/index.d.ts +12 -0
  62. package/dist/commonjs/index.d.ts.map +1 -0
  63. package/dist/commonjs/index.js +17 -0
  64. package/dist/commonjs/index.js.map +1 -0
  65. package/dist/commonjs/isUnexpected.d.ts +32 -0
  66. package/dist/commonjs/isUnexpected.d.ts.map +1 -0
  67. package/dist/commonjs/isUnexpected.js +101 -0
  68. package/dist/commonjs/isUnexpected.js.map +1 -0
  69. package/dist/commonjs/logger.d.ts +2 -0
  70. package/dist/commonjs/logger.d.ts.map +1 -0
  71. package/dist/commonjs/logger.js +8 -0
  72. package/dist/commonjs/logger.js.map +1 -0
  73. package/dist/commonjs/models.d.ts +772 -0
  74. package/dist/commonjs/models.d.ts.map +1 -0
  75. package/dist/commonjs/models.js +5 -0
  76. package/dist/commonjs/models.js.map +1 -0
  77. package/dist/commonjs/outputModels.d.ts +861 -0
  78. package/dist/commonjs/outputModels.d.ts.map +1 -0
  79. package/dist/commonjs/outputModels.js +5 -0
  80. package/dist/commonjs/outputModels.js.map +1 -0
  81. package/dist/commonjs/package.json +3 -0
  82. package/dist/commonjs/paginateHelper.d.ts +68 -0
  83. package/dist/commonjs/paginateHelper.d.ts.map +1 -0
  84. package/dist/commonjs/paginateHelper.js +140 -0
  85. package/dist/commonjs/paginateHelper.js.map +1 -0
  86. package/dist/commonjs/parameters.d.ts +105 -0
  87. package/dist/commonjs/parameters.d.ts.map +1 -0
  88. package/dist/commonjs/parameters.js +5 -0
  89. package/dist/commonjs/parameters.js.map +1 -0
  90. package/dist/commonjs/pollingHelper.d.ts +76 -0
  91. package/dist/commonjs/pollingHelper.d.ts.map +1 -0
  92. package/dist/commonjs/pollingHelper.js +110 -0
  93. package/dist/commonjs/pollingHelper.js.map +1 -0
  94. package/dist/commonjs/responses.d.ts +328 -0
  95. package/dist/commonjs/responses.d.ts.map +1 -0
  96. package/dist/commonjs/responses.js +5 -0
  97. package/dist/commonjs/responses.js.map +1 -0
  98. package/dist/commonjs/serviceFabricClient.d.ts +15 -0
  99. package/dist/commonjs/serviceFabricClient.d.ts.map +1 -0
  100. package/dist/commonjs/serviceFabricClient.js +47 -0
  101. package/dist/commonjs/serviceFabricClient.js.map +1 -0
  102. package/dist/commonjs/tsdoc-metadata.json +11 -0
  103. package/dist/esm/clientDefinitions.d.ts +137 -0
  104. package/dist/esm/clientDefinitions.d.ts.map +1 -0
  105. package/dist/esm/clientDefinitions.js +4 -0
  106. package/dist/esm/clientDefinitions.js.map +1 -0
  107. package/dist/esm/customizedApiVersionPolicy.d.ts +10 -0
  108. package/dist/esm/customizedApiVersionPolicy.d.ts.map +1 -0
  109. package/dist/esm/customizedApiVersionPolicy.js +23 -0
  110. package/dist/esm/customizedApiVersionPolicy.js.map +1 -0
  111. package/dist/esm/index.d.ts +12 -0
  112. package/dist/esm/index.d.ts.map +1 -0
  113. package/dist/esm/index.js +14 -0
  114. package/dist/esm/index.js.map +1 -0
  115. package/dist/esm/isUnexpected.d.ts +32 -0
  116. package/dist/esm/isUnexpected.d.ts.map +1 -0
  117. package/dist/esm/isUnexpected.js +98 -0
  118. package/dist/esm/isUnexpected.js.map +1 -0
  119. package/dist/esm/logger.d.ts +2 -0
  120. package/dist/esm/logger.d.ts.map +1 -0
  121. package/dist/esm/logger.js +5 -0
  122. package/dist/esm/logger.js.map +1 -0
  123. package/dist/esm/models.d.ts +772 -0
  124. package/dist/esm/models.d.ts.map +1 -0
  125. package/dist/esm/models.js +4 -0
  126. package/dist/esm/models.js.map +1 -0
  127. package/dist/esm/outputModels.d.ts +861 -0
  128. package/dist/esm/outputModels.d.ts.map +1 -0
  129. package/dist/esm/outputModels.js +4 -0
  130. package/dist/esm/outputModels.js.map +1 -0
  131. package/dist/esm/package.json +3 -0
  132. package/dist/esm/paginateHelper.d.ts +68 -0
  133. package/dist/esm/paginateHelper.d.ts.map +1 -0
  134. package/dist/esm/paginateHelper.js +137 -0
  135. package/dist/esm/paginateHelper.js.map +1 -0
  136. package/dist/esm/parameters.d.ts +105 -0
  137. package/dist/esm/parameters.d.ts.map +1 -0
  138. package/dist/esm/parameters.js +4 -0
  139. package/dist/esm/parameters.js.map +1 -0
  140. package/dist/esm/pollingHelper.d.ts +76 -0
  141. package/dist/esm/pollingHelper.d.ts.map +1 -0
  142. package/dist/esm/pollingHelper.js +107 -0
  143. package/dist/esm/pollingHelper.js.map +1 -0
  144. package/dist/esm/responses.d.ts +328 -0
  145. package/dist/esm/responses.d.ts.map +1 -0
  146. package/dist/esm/responses.js +4 -0
  147. package/dist/esm/responses.js.map +1 -0
  148. package/dist/esm/serviceFabricClient.d.ts +15 -0
  149. package/dist/esm/serviceFabricClient.d.ts.map +1 -0
  150. package/dist/esm/serviceFabricClient.js +44 -0
  151. package/dist/esm/serviceFabricClient.js.map +1 -0
  152. package/dist/react-native/clientDefinitions.d.ts +137 -0
  153. package/dist/react-native/clientDefinitions.d.ts.map +1 -0
  154. package/dist/react-native/clientDefinitions.js +4 -0
  155. package/dist/react-native/clientDefinitions.js.map +1 -0
  156. package/dist/react-native/customizedApiVersionPolicy.d.ts +10 -0
  157. package/dist/react-native/customizedApiVersionPolicy.d.ts.map +1 -0
  158. package/dist/react-native/customizedApiVersionPolicy.js +23 -0
  159. package/dist/react-native/customizedApiVersionPolicy.js.map +1 -0
  160. package/dist/react-native/index.d.ts +12 -0
  161. package/dist/react-native/index.d.ts.map +1 -0
  162. package/dist/react-native/index.js +14 -0
  163. package/dist/react-native/index.js.map +1 -0
  164. package/dist/react-native/isUnexpected.d.ts +32 -0
  165. package/dist/react-native/isUnexpected.d.ts.map +1 -0
  166. package/dist/react-native/isUnexpected.js +98 -0
  167. package/dist/react-native/isUnexpected.js.map +1 -0
  168. package/dist/react-native/logger.d.ts +2 -0
  169. package/dist/react-native/logger.d.ts.map +1 -0
  170. package/dist/react-native/logger.js +5 -0
  171. package/dist/react-native/logger.js.map +1 -0
  172. package/dist/react-native/models.d.ts +772 -0
  173. package/dist/react-native/models.d.ts.map +1 -0
  174. package/dist/react-native/models.js +4 -0
  175. package/dist/react-native/models.js.map +1 -0
  176. package/dist/react-native/outputModels.d.ts +861 -0
  177. package/dist/react-native/outputModels.d.ts.map +1 -0
  178. package/dist/react-native/outputModels.js +4 -0
  179. package/dist/react-native/outputModels.js.map +1 -0
  180. package/dist/react-native/package.json +3 -0
  181. package/dist/react-native/paginateHelper.d.ts +68 -0
  182. package/dist/react-native/paginateHelper.d.ts.map +1 -0
  183. package/dist/react-native/paginateHelper.js +137 -0
  184. package/dist/react-native/paginateHelper.js.map +1 -0
  185. package/dist/react-native/parameters.d.ts +105 -0
  186. package/dist/react-native/parameters.d.ts.map +1 -0
  187. package/dist/react-native/parameters.js +4 -0
  188. package/dist/react-native/parameters.js.map +1 -0
  189. package/dist/react-native/pollingHelper.d.ts +76 -0
  190. package/dist/react-native/pollingHelper.d.ts.map +1 -0
  191. package/dist/react-native/pollingHelper.js +107 -0
  192. package/dist/react-native/pollingHelper.js.map +1 -0
  193. package/dist/react-native/responses.d.ts +328 -0
  194. package/dist/react-native/responses.d.ts.map +1 -0
  195. package/dist/react-native/responses.js +4 -0
  196. package/dist/react-native/responses.js.map +1 -0
  197. package/dist/react-native/serviceFabricClient.d.ts +15 -0
  198. package/dist/react-native/serviceFabricClient.d.ts.map +1 -0
  199. package/dist/react-native/serviceFabricClient.js +44 -0
  200. package/dist/react-native/serviceFabricClient.js.map +1 -0
  201. package/package.json +89 -80
  202. package/review/{arm-servicefabric.api.md → arm-servicefabric-node.api.md} +306 -311
  203. package/dist/index.js +0 -330
  204. package/dist/index.js.map +0 -1
  205. package/dist-esm/src/clientDefinitions.js +0 -4
  206. package/dist-esm/src/clientDefinitions.js.map +0 -1
  207. package/dist-esm/src/customizedApiVersionPolicy.js.map +0 -1
  208. package/dist-esm/src/index.js +0 -14
  209. package/dist-esm/src/index.js.map +0 -1
  210. package/dist-esm/src/isUnexpected.js.map +0 -1
  211. package/dist-esm/src/models.js +0 -4
  212. package/dist-esm/src/models.js.map +0 -1
  213. package/dist-esm/src/outputModels.js +0 -4
  214. package/dist-esm/src/outputModels.js.map +0 -1
  215. package/dist-esm/src/paginateHelper.js.map +0 -1
  216. package/dist-esm/src/parameters.js +0 -4
  217. package/dist-esm/src/parameters.js.map +0 -1
  218. package/dist-esm/src/pollingHelper.js +0 -48
  219. package/dist-esm/src/pollingHelper.js.map +0 -1
  220. package/dist-esm/src/responses.js +0 -4
  221. package/dist-esm/src/responses.js.map +0 -1
  222. package/dist-esm/src/serviceFabricClient.js +0 -27
  223. package/dist-esm/src/serviceFabricClient.js.map +0 -1
  224. package/types/arm-servicefabric.d.ts +0 -2480
@@ -1,152 +1,95 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
2
+ // Licensed under the MIT License.
3
3
  const responseMap = {
4
- "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
5
- "200",
6
- ],
7
- "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
8
- "200",
9
- "202",
10
- ],
11
- "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
12
- "200",
13
- "202",
14
- ],
15
- "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": [
16
- "200",
17
- "204",
18
- ],
19
- "GET /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters": [
20
- "200",
21
- ],
4
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": ["200"],
5
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": ["200", "202"],
6
+ "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": ["200", "202"],
7
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}": ["200", "204"],
8
+ "GET /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters": ["200"],
22
9
  "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters": ["200"],
23
- "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions": [
24
- "200",
25
- ],
26
- "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}": [
27
- "200",
28
- ],
29
- "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}": [
30
- "200",
31
- ],
32
- "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions": [
33
- "200",
34
- ],
35
- "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions": [
36
- "200",
37
- ],
10
+ "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions": ["200"],
11
+ "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}": ["200"],
12
+ "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}": ["200"],
13
+ "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions": ["200"],
14
+ "GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions": ["200"],
38
15
  "GET /providers/Microsoft.ServiceFabric/operations": ["200"],
39
- "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": [
40
- "200",
41
- ],
42
- "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": [
43
- "200",
44
- ],
45
- "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": [
46
- "202",
47
- "204",
48
- ],
49
- "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes": [
50
- "200",
51
- ],
52
- "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": [
53
- "200",
54
- ],
55
- "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": [
56
- "202",
57
- ],
58
- "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": [
59
- "202",
60
- "204",
61
- ],
62
- "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions": [
63
- "200",
64
- ],
65
- "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
66
- "200",
67
- ],
68
- "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
69
- "202",
70
- ],
71
- "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
72
- "202",
73
- ],
74
- "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": [
75
- "202",
76
- "204",
77
- ],
78
- "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications": [
79
- "200",
80
- ],
81
- "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
82
- "200",
83
- ],
84
- "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
85
- "202",
86
- ],
87
- "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
88
- "202",
89
- ],
90
- "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": [
91
- "202",
92
- "204",
93
- ],
94
- "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services": [
95
- "200",
96
- ],
16
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": ["200"],
17
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": ["200"],
18
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}": ["202", "204"],
19
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes": ["200"],
20
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": ["200"],
21
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": ["202"],
22
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}": ["202", "204"],
23
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions": ["200"],
24
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": ["200"],
25
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": ["202"],
26
+ "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": ["202"],
27
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}": ["202", "204"],
28
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications": ["200"],
29
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": ["200"],
30
+ "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": ["202"],
31
+ "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": ["202"],
32
+ "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}": ["202", "204"],
33
+ "GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services": ["200"],
97
34
  };
98
35
  export function isUnexpected(response) {
99
36
  const lroOriginal = response.headers["x-ms-original-url"];
100
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
37
+ const url = new URL(lroOriginal ?? response.request.url);
101
38
  const method = response.request.method;
102
39
  let pathDetails = responseMap[`${method} ${url.pathname}`];
103
40
  if (!pathDetails) {
104
- pathDetails = geParametrizedPathSuccess(url.pathname);
41
+ pathDetails = getParametrizedPathSuccess(method, url.pathname);
105
42
  }
106
43
  return !pathDetails.includes(response.status);
107
44
  }
108
- function geParametrizedPathSuccess(path) {
45
+ function getParametrizedPathSuccess(method, path) {
109
46
  const pathParts = path.split("/");
47
+ // Traverse list to match the longest candidate
48
+ // matchedLen: the length of candidate path
49
+ // matchedValue: the matched status code array
50
+ let matchedLen = -1, matchedValue = [];
110
51
  // Iterate the responseMap to find a match
111
52
  for (const [key, value] of Object.entries(responseMap)) {
112
53
  // Extracting the path from the map key which is in format
113
54
  // GET /path/foo
55
+ if (!key.startsWith(method)) {
56
+ continue;
57
+ }
114
58
  const candidatePath = getPathFromMapKey(key);
115
59
  // Get each part of the url path
116
60
  const candidateParts = candidatePath.split("/");
117
- // If the candidate and actual paths don't match in size
118
- // we move on to the next candidate path
119
- if (candidateParts.length === pathParts.length && hasParametrizedPath(key)) {
120
- // track if we have found a match to return the values found.
121
- let found = true;
122
- for (let i = 0; i < candidateParts.length; i++) {
123
- if (candidateParts[i].startsWith("{") && candidateParts[i].endsWith("}")) {
124
- // If the current part of the candidate is a "template" part
125
- // it is a match with the actual path part on hand
126
- // skip as the parameterized part can match anything
127
- continue;
128
- }
129
- // If the candidate part is not a template and
130
- // the parts don't match mark the candidate as not found
131
- // to move on with the next candidate path.
132
- if (candidateParts[i] !== pathParts[i]) {
61
+ // track if we have found a match to return the values found.
62
+ let found = true;
63
+ for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
64
+ if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
65
+ const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
66
+ // If the current part of the candidate is a "template" part
67
+ // Try to use the suffix of pattern to match the path
68
+ // {guid} ==> $
69
+ // {guid}:export ==> :export$
70
+ const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
71
+ if (!isMatched) {
133
72
  found = false;
134
73
  break;
135
74
  }
75
+ continue;
136
76
  }
137
- // We finished evaluating the current candidate parts
138
- // if all parts matched we return the success values form
139
- // the path mapping.
140
- if (found) {
141
- return value;
77
+ // If the candidate part is not a template and
78
+ // the parts don't match mark the candidate as not found
79
+ // to move on with the next candidate path.
80
+ if (candidateParts[i] !== pathParts[j]) {
81
+ found = false;
82
+ break;
142
83
  }
143
84
  }
85
+ // We finished evaluating the current candidate parts
86
+ // Update the matched value if and only if we found the longer pattern
87
+ if (found && candidatePath.length > matchedLen) {
88
+ matchedLen = candidatePath.length;
89
+ matchedValue = value;
90
+ }
144
91
  }
145
- // No match was found, return an empty array.
146
- return [];
147
- }
148
- function hasParametrizedPath(path) {
149
- return path.includes("/{");
92
+ return matchedValue;
150
93
  }
151
94
  function getPathFromMapKey(mapKey) {
152
95
  const pathStart = mapKey.indexOf("/");
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAwElC,MAAM,WAAW,GAA6B;IAC5C,iIAAiI,EAC/H,CAAC,KAAK,CAAC;IACT,iIAAiI,EAC/H,CAAC,KAAK,EAAE,KAAK,CAAC;IAChB,mIAAmI,EACjI,CAAC,KAAK,EAAE,KAAK,CAAC;IAChB,oIAAoI,EAClI,CAAC,KAAK,EAAE,KAAK,CAAC;IAChB,mHAAmH,EACjH,CAAC,KAAK,CAAC;IAC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,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ClustersGet200Response,\n ClustersGetDefaultResponse,\n ClustersCreateOrUpdate200Response,\n ClustersCreateOrUpdate202Response,\n ClustersCreateOrUpdateDefaultResponse,\n ClustersUpdate200Response,\n ClustersUpdate202Response,\n ClustersUpdateDefaultResponse,\n ClustersDelete200Response,\n ClustersDelete204Response,\n ClustersDeleteDefaultResponse,\n ClustersListByResourceGroup200Response,\n ClustersListByResourceGroupDefaultResponse,\n ClustersList200Response,\n ClustersListDefaultResponse,\n ClustersListUpgradableVersions200Response,\n ClustersListUpgradableVersionsDefaultResponse,\n ClusterVersionsGet200Response,\n ClusterVersionsGetDefaultResponse,\n ClusterVersionsGetByEnvironment200Response,\n ClusterVersionsGetByEnvironmentDefaultResponse,\n ClusterVersionsList200Response,\n ClusterVersionsListDefaultResponse,\n ClusterVersionsListByEnvironment200Response,\n ClusterVersionsListByEnvironmentDefaultResponse,\n OperationsList200Response,\n OperationsListDefaultResponse,\n ApplicationTypesGet200Response,\n ApplicationTypesGetDefaultResponse,\n ApplicationTypesCreateOrUpdate200Response,\n ApplicationTypesCreateOrUpdateDefaultResponse,\n ApplicationTypesDelete202Response,\n ApplicationTypesDelete204Response,\n ApplicationTypesDeleteDefaultResponse,\n ApplicationTypesList200Response,\n ApplicationTypesListDefaultResponse,\n ApplicationTypeVersionsGet200Response,\n ApplicationTypeVersionsGetDefaultResponse,\n ApplicationTypeVersionsCreateOrUpdate202Response,\n ApplicationTypeVersionsCreateOrUpdateDefaultResponse,\n ApplicationTypeVersionsDelete202Response,\n ApplicationTypeVersionsDelete204Response,\n ApplicationTypeVersionsDeleteDefaultResponse,\n ApplicationTypeVersionsList200Response,\n ApplicationTypeVersionsListDefaultResponse,\n ApplicationsGet200Response,\n ApplicationsGetDefaultResponse,\n ApplicationsCreateOrUpdate202Response,\n ApplicationsCreateOrUpdateDefaultResponse,\n ApplicationsUpdate202Response,\n ApplicationsUpdateDefaultResponse,\n ApplicationsDelete202Response,\n ApplicationsDelete204Response,\n ApplicationsDeleteDefaultResponse,\n ApplicationsList200Response,\n ApplicationsListDefaultResponse,\n ServicesGet200Response,\n ServicesGetDefaultResponse,\n ServicesCreateOrUpdate202Response,\n ServicesCreateOrUpdateDefaultResponse,\n ServicesUpdate202Response,\n ServicesUpdateDefaultResponse,\n ServicesDelete202Response,\n ServicesDelete204Response,\n ServicesDeleteDefaultResponse,\n ServicesList200Response,\n ServicesListDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\":\n [\"200\"],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\":\n [\"200\", \"202\"],\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\":\n [\"200\", \"202\"],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}\":\n [\"200\", \"204\"],\n \"GET /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters\":\n [\"200\"],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters\": [\"200\"],\n \"POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions\":\n [\"200\"],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}\":\n [\"200\"],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}\":\n [\"200\"],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions\":\n [\"200\"],\n \"GET /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions\":\n [\"200\"],\n \"GET /providers/Microsoft.ServiceFabric/operations\": [\"200\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\":\n [\"200\"],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\":\n [\"200\"],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}\":\n [\"202\", \"204\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes\":\n [\"200\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\":\n [\"200\"],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\":\n [\"202\"],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}\":\n [\"202\", \"204\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions\":\n [\"200\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\":\n [\"200\"],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\":\n [\"202\"],\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\":\n [\"202\"],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}\":\n [\"202\", \"204\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications\":\n [\"200\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\":\n [\"200\"],\n \"PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\":\n [\"202\"],\n \"PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\":\n [\"202\"],\n \"DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}\":\n [\"202\", \"204\"],\n \"GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services\":\n [\"200\"],\n};\n\nexport function isUnexpected(\n response: ClustersGet200Response | ClustersGetDefaultResponse,\n): response is ClustersGetDefaultResponse;\nexport function isUnexpected(\n response:\n | ClustersCreateOrUpdate200Response\n | ClustersCreateOrUpdate202Response\n | ClustersCreateOrUpdateDefaultResponse,\n): response is ClustersCreateOrUpdateDefaultResponse;\nexport function isUnexpected(\n response: ClustersUpdate200Response | ClustersUpdate202Response | ClustersUpdateDefaultResponse,\n): response is ClustersUpdateDefaultResponse;\nexport function isUnexpected(\n response: ClustersDelete200Response | ClustersDelete204Response | ClustersDeleteDefaultResponse,\n): response is ClustersDeleteDefaultResponse;\nexport function isUnexpected(\n response: ClustersListByResourceGroup200Response | ClustersListByResourceGroupDefaultResponse,\n): response is ClustersListByResourceGroupDefaultResponse;\nexport function isUnexpected(\n response: ClustersList200Response | ClustersListDefaultResponse,\n): response is ClustersListDefaultResponse;\nexport function isUnexpected(\n response:\n | ClustersListUpgradableVersions200Response\n | ClustersListUpgradableVersionsDefaultResponse,\n): response is ClustersListUpgradableVersionsDefaultResponse;\nexport function isUnexpected(\n response: ClusterVersionsGet200Response | ClusterVersionsGetDefaultResponse,\n): response is ClusterVersionsGetDefaultResponse;\nexport function isUnexpected(\n response:\n | ClusterVersionsGetByEnvironment200Response\n | ClusterVersionsGetByEnvironmentDefaultResponse,\n): response is ClusterVersionsGetByEnvironmentDefaultResponse;\nexport function isUnexpected(\n response: ClusterVersionsList200Response | ClusterVersionsListDefaultResponse,\n): response is ClusterVersionsListDefaultResponse;\nexport function isUnexpected(\n response:\n | ClusterVersionsListByEnvironment200Response\n | ClusterVersionsListByEnvironmentDefaultResponse,\n): response is ClusterVersionsListByEnvironmentDefaultResponse;\nexport function isUnexpected(\n response: OperationsList200Response | OperationsListDefaultResponse,\n): response is OperationsListDefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypesGet200Response | ApplicationTypesGetDefaultResponse,\n): response is ApplicationTypesGetDefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypesCreateOrUpdate200Response\n | ApplicationTypesCreateOrUpdateDefaultResponse,\n): response is ApplicationTypesCreateOrUpdateDefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypesDelete202Response\n | ApplicationTypesDelete204Response\n | ApplicationTypesDeleteDefaultResponse,\n): response is ApplicationTypesDeleteDefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypesList200Response | ApplicationTypesListDefaultResponse,\n): response is ApplicationTypesListDefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypeVersionsGet200Response | ApplicationTypeVersionsGetDefaultResponse,\n): response is ApplicationTypeVersionsGetDefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypeVersionsCreateOrUpdate202Response\n | ApplicationTypeVersionsCreateOrUpdateDefaultResponse,\n): response is ApplicationTypeVersionsCreateOrUpdateDefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationTypeVersionsDelete202Response\n | ApplicationTypeVersionsDelete204Response\n | ApplicationTypeVersionsDeleteDefaultResponse,\n): response is ApplicationTypeVersionsDeleteDefaultResponse;\nexport function isUnexpected(\n response: ApplicationTypeVersionsList200Response | ApplicationTypeVersionsListDefaultResponse,\n): response is ApplicationTypeVersionsListDefaultResponse;\nexport function isUnexpected(\n response: ApplicationsGet200Response | ApplicationsGetDefaultResponse,\n): response is ApplicationsGetDefaultResponse;\nexport function isUnexpected(\n response: ApplicationsCreateOrUpdate202Response | ApplicationsCreateOrUpdateDefaultResponse,\n): response is ApplicationsCreateOrUpdateDefaultResponse;\nexport function isUnexpected(\n response: ApplicationsUpdate202Response | ApplicationsUpdateDefaultResponse,\n): response is ApplicationsUpdateDefaultResponse;\nexport function isUnexpected(\n response:\n | ApplicationsDelete202Response\n | ApplicationsDelete204Response\n | ApplicationsDeleteDefaultResponse,\n): response is ApplicationsDeleteDefaultResponse;\nexport function isUnexpected(\n response: ApplicationsList200Response | ApplicationsListDefaultResponse,\n): response is ApplicationsListDefaultResponse;\nexport function isUnexpected(\n response: ServicesGet200Response | ServicesGetDefaultResponse,\n): response is ServicesGetDefaultResponse;\nexport function isUnexpected(\n response: ServicesCreateOrUpdate202Response | ServicesCreateOrUpdateDefaultResponse,\n): response is ServicesCreateOrUpdateDefaultResponse;\nexport function isUnexpected(\n response: ServicesUpdate202Response | ServicesUpdateDefaultResponse,\n): response is ServicesUpdateDefaultResponse;\nexport function isUnexpected(\n response: ServicesDelete202Response | ServicesDelete204Response | ServicesDeleteDefaultResponse,\n): response is ServicesDeleteDefaultResponse;\nexport function isUnexpected(\n response: ServicesList200Response | ServicesListDefaultResponse,\n): response is ServicesListDefaultResponse;\nexport function isUnexpected(\n response:\n | ClustersGet200Response\n | ClustersGetDefaultResponse\n | ClustersCreateOrUpdate200Response\n | ClustersCreateOrUpdate202Response\n | ClustersCreateOrUpdateDefaultResponse\n | ClustersUpdate200Response\n | ClustersUpdate202Response\n | ClustersUpdateDefaultResponse\n | ClustersDelete200Response\n | ClustersDelete204Response\n | ClustersDeleteDefaultResponse\n | ClustersListByResourceGroup200Response\n | ClustersListByResourceGroupDefaultResponse\n | ClustersList200Response\n | ClustersListDefaultResponse\n | ClustersListUpgradableVersions200Response\n | ClustersListUpgradableVersionsDefaultResponse\n | ClusterVersionsGet200Response\n | ClusterVersionsGetDefaultResponse\n | ClusterVersionsGetByEnvironment200Response\n | ClusterVersionsGetByEnvironmentDefaultResponse\n | ClusterVersionsList200Response\n | ClusterVersionsListDefaultResponse\n | ClusterVersionsListByEnvironment200Response\n | ClusterVersionsListByEnvironmentDefaultResponse\n | OperationsList200Response\n | OperationsListDefaultResponse\n | ApplicationTypesGet200Response\n | ApplicationTypesGetDefaultResponse\n | ApplicationTypesCreateOrUpdate200Response\n | ApplicationTypesCreateOrUpdateDefaultResponse\n | ApplicationTypesDelete202Response\n | ApplicationTypesDelete204Response\n | ApplicationTypesDeleteDefaultResponse\n | ApplicationTypesList200Response\n | ApplicationTypesListDefaultResponse\n | ApplicationTypeVersionsGet200Response\n | ApplicationTypeVersionsGetDefaultResponse\n | ApplicationTypeVersionsCreateOrUpdate202Response\n | ApplicationTypeVersionsCreateOrUpdateDefaultResponse\n | ApplicationTypeVersionsDelete202Response\n | ApplicationTypeVersionsDelete204Response\n | ApplicationTypeVersionsDeleteDefaultResponse\n | ApplicationTypeVersionsList200Response\n | ApplicationTypeVersionsListDefaultResponse\n | ApplicationsGet200Response\n | ApplicationsGetDefaultResponse\n | ApplicationsCreateOrUpdate202Response\n | ApplicationsCreateOrUpdateDefaultResponse\n | ApplicationsUpdate202Response\n | ApplicationsUpdateDefaultResponse\n | ApplicationsDelete202Response\n | ApplicationsDelete204Response\n | ApplicationsDeleteDefaultResponse\n | ApplicationsList200Response\n | ApplicationsListDefaultResponse\n | ServicesGet200Response\n | ServicesGetDefaultResponse\n | ServicesCreateOrUpdate202Response\n | ServicesCreateOrUpdateDefaultResponse\n | ServicesUpdate202Response\n | ServicesUpdateDefaultResponse\n | ServicesDelete202Response\n | ServicesDelete204Response\n | ServicesDeleteDefaultResponse\n | ServicesList200Response\n | ServicesListDefaultResponse,\n): response is\n | ClustersGetDefaultResponse\n | ClustersCreateOrUpdateDefaultResponse\n | ClustersUpdateDefaultResponse\n | ClustersDeleteDefaultResponse\n | ClustersListByResourceGroupDefaultResponse\n | ClustersListDefaultResponse\n | ClustersListUpgradableVersionsDefaultResponse\n | ClusterVersionsGetDefaultResponse\n | ClusterVersionsGetByEnvironmentDefaultResponse\n | ClusterVersionsListDefaultResponse\n | ClusterVersionsListByEnvironmentDefaultResponse\n | OperationsListDefaultResponse\n | ApplicationTypesGetDefaultResponse\n | ApplicationTypesCreateOrUpdateDefaultResponse\n | ApplicationTypesDeleteDefaultResponse\n | ApplicationTypesListDefaultResponse\n | ApplicationTypeVersionsGetDefaultResponse\n | ApplicationTypeVersionsCreateOrUpdateDefaultResponse\n | ApplicationTypeVersionsDeleteDefaultResponse\n | ApplicationTypeVersionsListDefaultResponse\n | ApplicationsGetDefaultResponse\n | ApplicationsCreateOrUpdateDefaultResponse\n | ApplicationsUpdateDefaultResponse\n | ApplicationsDeleteDefaultResponse\n | ApplicationsListDefaultResponse\n | ServicesGetDefaultResponse\n | ServicesCreateOrUpdateDefaultResponse\n | ServicesUpdateDefaultResponse\n | ServicesDeleteDefaultResponse\n | ServicesListDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const logger: import("@azure/logger").AzureLogger;
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,qCAA0C,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createClientLogger } from "@azure/logger";
4
+ export const logger = createClientLogger("arm-servicefabric");
5
+ //# 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,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"arm-servicefabric\");\n"]}