@azure-rest/arm-servicefabric 1.0.0-beta.1 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +4 -6
  3. package/dist/browser/clientDefinitions.d.ts +137 -0
  4. package/dist/browser/clientDefinitions.d.ts.map +1 -0
  5. package/dist/browser/clientDefinitions.js +4 -0
  6. package/dist/browser/clientDefinitions.js.map +1 -0
  7. package/dist/browser/customizedApiVersionPolicy.d.ts +10 -0
  8. package/dist/browser/customizedApiVersionPolicy.d.ts.map +1 -0
  9. package/{dist-esm/src → dist/browser}/customizedApiVersionPolicy.js +1 -1
  10. package/dist/browser/customizedApiVersionPolicy.js.map +1 -0
  11. package/dist/browser/index.d.ts +12 -0
  12. package/dist/browser/index.d.ts.map +1 -0
  13. package/dist/browser/index.js +14 -0
  14. package/dist/browser/index.js.map +1 -0
  15. package/dist/browser/isUnexpected.d.ts +32 -0
  16. package/dist/browser/isUnexpected.d.ts.map +1 -0
  17. package/{dist-esm/src → dist/browser}/isUnexpected.js +64 -120
  18. package/dist/browser/isUnexpected.js.map +1 -0
  19. package/dist/browser/logger.d.ts +2 -0
  20. package/dist/browser/logger.d.ts.map +1 -0
  21. package/dist/browser/logger.js +5 -0
  22. package/dist/browser/logger.js.map +1 -0
  23. package/dist/browser/models.d.ts +772 -0
  24. package/dist/browser/models.d.ts.map +1 -0
  25. package/dist/browser/models.js +4 -0
  26. package/dist/browser/models.js.map +1 -0
  27. package/dist/browser/outputModels.d.ts +861 -0
  28. package/dist/browser/outputModels.d.ts.map +1 -0
  29. package/dist/browser/outputModels.js +4 -0
  30. package/dist/browser/outputModels.js.map +1 -0
  31. package/dist/browser/package.json +3 -0
  32. package/dist/browser/paginateHelper.d.ts +68 -0
  33. package/dist/browser/paginateHelper.d.ts.map +1 -0
  34. package/dist/browser/paginateHelper.js +167 -0
  35. package/dist/browser/paginateHelper.js.map +1 -0
  36. package/dist/browser/parameters.d.ts +105 -0
  37. package/dist/browser/parameters.d.ts.map +1 -0
  38. package/dist/browser/parameters.js +4 -0
  39. package/dist/browser/parameters.js.map +1 -0
  40. package/dist/browser/pollingHelper.d.ts +76 -0
  41. package/dist/browser/pollingHelper.d.ts.map +1 -0
  42. package/dist/browser/pollingHelper.js +104 -0
  43. package/dist/browser/pollingHelper.js.map +1 -0
  44. package/dist/browser/responses.d.ts +328 -0
  45. package/dist/browser/responses.d.ts.map +1 -0
  46. package/dist/browser/responses.js +4 -0
  47. package/dist/browser/responses.js.map +1 -0
  48. package/dist/browser/serviceFabricClient.d.ts +15 -0
  49. package/dist/browser/serviceFabricClient.d.ts.map +1 -0
  50. package/dist/browser/serviceFabricClient.js +42 -0
  51. package/dist/browser/serviceFabricClient.js.map +1 -0
  52. package/dist/commonjs/clientDefinitions.d.ts +137 -0
  53. package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
  54. package/dist/commonjs/clientDefinitions.js +5 -0
  55. package/dist/commonjs/clientDefinitions.js.map +1 -0
  56. package/dist/commonjs/customizedApiVersionPolicy.d.ts +10 -0
  57. package/dist/commonjs/customizedApiVersionPolicy.d.ts.map +1 -0
  58. package/dist/commonjs/customizedApiVersionPolicy.js +27 -0
  59. package/dist/commonjs/customizedApiVersionPolicy.js.map +1 -0
  60. package/dist/commonjs/index.d.ts +12 -0
  61. package/dist/commonjs/index.d.ts.map +1 -0
  62. package/dist/commonjs/index.js +17 -0
  63. package/dist/commonjs/index.js.map +1 -0
  64. package/dist/commonjs/isUnexpected.d.ts +32 -0
  65. package/dist/commonjs/isUnexpected.d.ts.map +1 -0
  66. package/dist/commonjs/isUnexpected.js +102 -0
  67. package/dist/commonjs/isUnexpected.js.map +1 -0
  68. package/dist/commonjs/logger.d.ts +2 -0
  69. package/dist/commonjs/logger.d.ts.map +1 -0
  70. package/dist/commonjs/logger.js +8 -0
  71. package/dist/commonjs/logger.js.map +1 -0
  72. package/dist/commonjs/models.d.ts +772 -0
  73. package/dist/commonjs/models.d.ts.map +1 -0
  74. package/dist/commonjs/models.js +5 -0
  75. package/dist/commonjs/models.js.map +1 -0
  76. package/dist/commonjs/outputModels.d.ts +861 -0
  77. package/dist/commonjs/outputModels.d.ts.map +1 -0
  78. package/dist/commonjs/outputModels.js +5 -0
  79. package/dist/commonjs/outputModels.js.map +1 -0
  80. package/dist/commonjs/package.json +3 -0
  81. package/dist/commonjs/paginateHelper.d.ts +68 -0
  82. package/dist/commonjs/paginateHelper.d.ts.map +1 -0
  83. package/dist/commonjs/paginateHelper.js +170 -0
  84. package/dist/commonjs/paginateHelper.js.map +1 -0
  85. package/dist/commonjs/parameters.d.ts +105 -0
  86. package/dist/commonjs/parameters.d.ts.map +1 -0
  87. package/dist/commonjs/parameters.js +5 -0
  88. package/dist/commonjs/parameters.js.map +1 -0
  89. package/dist/commonjs/pollingHelper.d.ts +76 -0
  90. package/dist/commonjs/pollingHelper.d.ts.map +1 -0
  91. package/dist/commonjs/pollingHelper.js +107 -0
  92. package/dist/commonjs/pollingHelper.js.map +1 -0
  93. package/dist/commonjs/responses.d.ts +328 -0
  94. package/dist/commonjs/responses.d.ts.map +1 -0
  95. package/dist/commonjs/responses.js +5 -0
  96. package/dist/commonjs/responses.js.map +1 -0
  97. package/dist/commonjs/serviceFabricClient.d.ts +15 -0
  98. package/dist/commonjs/serviceFabricClient.d.ts.map +1 -0
  99. package/dist/commonjs/serviceFabricClient.js +45 -0
  100. package/dist/commonjs/serviceFabricClient.js.map +1 -0
  101. package/dist/commonjs/tsdoc-metadata.json +11 -0
  102. package/dist/esm/clientDefinitions.d.ts +137 -0
  103. package/dist/esm/clientDefinitions.d.ts.map +1 -0
  104. package/dist/esm/clientDefinitions.js +4 -0
  105. package/dist/esm/clientDefinitions.js.map +1 -0
  106. package/dist/esm/customizedApiVersionPolicy.d.ts +10 -0
  107. package/dist/esm/customizedApiVersionPolicy.d.ts.map +1 -0
  108. package/dist/esm/customizedApiVersionPolicy.js +23 -0
  109. package/dist/esm/customizedApiVersionPolicy.js.map +1 -0
  110. package/dist/esm/index.d.ts +12 -0
  111. package/dist/esm/index.d.ts.map +1 -0
  112. package/dist/esm/index.js +14 -0
  113. package/dist/esm/index.js.map +1 -0
  114. package/dist/esm/isUnexpected.d.ts +32 -0
  115. package/dist/esm/isUnexpected.d.ts.map +1 -0
  116. package/dist/esm/isUnexpected.js +99 -0
  117. package/dist/esm/isUnexpected.js.map +1 -0
  118. package/dist/esm/logger.d.ts +2 -0
  119. package/dist/esm/logger.d.ts.map +1 -0
  120. package/dist/esm/logger.js +5 -0
  121. package/dist/esm/logger.js.map +1 -0
  122. package/dist/esm/models.d.ts +772 -0
  123. package/dist/esm/models.d.ts.map +1 -0
  124. package/dist/esm/models.js +4 -0
  125. package/dist/esm/models.js.map +1 -0
  126. package/dist/esm/outputModels.d.ts +861 -0
  127. package/dist/esm/outputModels.d.ts.map +1 -0
  128. package/dist/esm/outputModels.js +4 -0
  129. package/dist/esm/outputModels.js.map +1 -0
  130. package/dist/esm/package.json +3 -0
  131. package/dist/esm/paginateHelper.d.ts +68 -0
  132. package/dist/esm/paginateHelper.d.ts.map +1 -0
  133. package/dist/esm/paginateHelper.js +167 -0
  134. package/dist/esm/paginateHelper.js.map +1 -0
  135. package/dist/esm/parameters.d.ts +105 -0
  136. package/dist/esm/parameters.d.ts.map +1 -0
  137. package/dist/esm/parameters.js +4 -0
  138. package/dist/esm/parameters.js.map +1 -0
  139. package/dist/esm/pollingHelper.d.ts +76 -0
  140. package/dist/esm/pollingHelper.d.ts.map +1 -0
  141. package/dist/esm/pollingHelper.js +104 -0
  142. package/dist/esm/pollingHelper.js.map +1 -0
  143. package/dist/esm/responses.d.ts +328 -0
  144. package/dist/esm/responses.d.ts.map +1 -0
  145. package/dist/esm/responses.js +4 -0
  146. package/dist/esm/responses.js.map +1 -0
  147. package/dist/esm/serviceFabricClient.d.ts +15 -0
  148. package/dist/esm/serviceFabricClient.d.ts.map +1 -0
  149. package/dist/esm/serviceFabricClient.js +42 -0
  150. package/dist/esm/serviceFabricClient.js.map +1 -0
  151. package/dist/react-native/clientDefinitions.d.ts +137 -0
  152. package/dist/react-native/clientDefinitions.d.ts.map +1 -0
  153. package/dist/react-native/clientDefinitions.js +4 -0
  154. package/dist/react-native/clientDefinitions.js.map +1 -0
  155. package/dist/react-native/customizedApiVersionPolicy.d.ts +10 -0
  156. package/dist/react-native/customizedApiVersionPolicy.d.ts.map +1 -0
  157. package/dist/react-native/customizedApiVersionPolicy.js +23 -0
  158. package/dist/react-native/customizedApiVersionPolicy.js.map +1 -0
  159. package/dist/react-native/index.d.ts +12 -0
  160. package/dist/react-native/index.d.ts.map +1 -0
  161. package/dist/react-native/index.js +14 -0
  162. package/dist/react-native/index.js.map +1 -0
  163. package/dist/react-native/isUnexpected.d.ts +32 -0
  164. package/dist/react-native/isUnexpected.d.ts.map +1 -0
  165. package/dist/react-native/isUnexpected.js +99 -0
  166. package/dist/react-native/isUnexpected.js.map +1 -0
  167. package/dist/react-native/logger.d.ts +2 -0
  168. package/dist/react-native/logger.d.ts.map +1 -0
  169. package/dist/react-native/logger.js +5 -0
  170. package/dist/react-native/logger.js.map +1 -0
  171. package/dist/react-native/models.d.ts +772 -0
  172. package/dist/react-native/models.d.ts.map +1 -0
  173. package/dist/react-native/models.js +4 -0
  174. package/dist/react-native/models.js.map +1 -0
  175. package/dist/react-native/outputModels.d.ts +861 -0
  176. package/dist/react-native/outputModels.d.ts.map +1 -0
  177. package/dist/react-native/outputModels.js +4 -0
  178. package/dist/react-native/outputModels.js.map +1 -0
  179. package/dist/react-native/package.json +3 -0
  180. package/dist/react-native/paginateHelper.d.ts +68 -0
  181. package/dist/react-native/paginateHelper.d.ts.map +1 -0
  182. package/dist/react-native/paginateHelper.js +167 -0
  183. package/dist/react-native/paginateHelper.js.map +1 -0
  184. package/dist/react-native/parameters.d.ts +105 -0
  185. package/dist/react-native/parameters.d.ts.map +1 -0
  186. package/dist/react-native/parameters.js +4 -0
  187. package/dist/react-native/parameters.js.map +1 -0
  188. package/dist/react-native/pollingHelper.d.ts +76 -0
  189. package/dist/react-native/pollingHelper.d.ts.map +1 -0
  190. package/dist/react-native/pollingHelper.js +104 -0
  191. package/dist/react-native/pollingHelper.js.map +1 -0
  192. package/dist/react-native/responses.d.ts +328 -0
  193. package/dist/react-native/responses.d.ts.map +1 -0
  194. package/dist/react-native/responses.js +4 -0
  195. package/dist/react-native/responses.js.map +1 -0
  196. package/dist/react-native/serviceFabricClient.d.ts +15 -0
  197. package/dist/react-native/serviceFabricClient.d.ts.map +1 -0
  198. package/dist/react-native/serviceFabricClient.js +42 -0
  199. package/dist/react-native/serviceFabricClient.js.map +1 -0
  200. package/package.json +82 -66
  201. package/dist/index.js +0 -330
  202. package/dist/index.js.map +0 -1
  203. package/dist-esm/src/clientDefinitions.js +0 -4
  204. package/dist-esm/src/clientDefinitions.js.map +0 -1
  205. package/dist-esm/src/customizedApiVersionPolicy.js.map +0 -1
  206. package/dist-esm/src/index.js +0 -14
  207. package/dist-esm/src/index.js.map +0 -1
  208. package/dist-esm/src/isUnexpected.js.map +0 -1
  209. package/dist-esm/src/models.js +0 -4
  210. package/dist-esm/src/models.js.map +0 -1
  211. package/dist-esm/src/outputModels.js +0 -4
  212. package/dist-esm/src/outputModels.js.map +0 -1
  213. package/dist-esm/src/paginateHelper.js +0 -70
  214. package/dist-esm/src/paginateHelper.js.map +0 -1
  215. package/dist-esm/src/parameters.js +0 -4
  216. package/dist-esm/src/parameters.js.map +0 -1
  217. package/dist-esm/src/pollingHelper.js +0 -48
  218. package/dist-esm/src/pollingHelper.js.map +0 -1
  219. package/dist-esm/src/responses.js +0 -4
  220. package/dist-esm/src/responses.js.map +0 -1
  221. package/dist-esm/src/serviceFabricClient.js +0 -27
  222. package/dist-esm/src/serviceFabricClient.js.map +0 -1
  223. package/review/arm-servicefabric.api.md +0 -2071
  224. package/types/arm-servicefabric.d.ts +0 -2480
@@ -1,99 +1,36 @@
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"];
@@ -101,52 +38,59 @@ export function isUnexpected(response) {
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) {
46
+ var _a, _b, _c, _d;
109
47
  const pathParts = path.split("/");
48
+ // Traverse list to match the longest candidate
49
+ // matchedLen: the length of candidate path
50
+ // matchedValue: the matched status code array
51
+ let matchedLen = -1, matchedValue = [];
110
52
  // Iterate the responseMap to find a match
111
53
  for (const [key, value] of Object.entries(responseMap)) {
112
54
  // Extracting the path from the map key which is in format
113
55
  // GET /path/foo
56
+ if (!key.startsWith(method)) {
57
+ continue;
58
+ }
114
59
  const candidatePath = getPathFromMapKey(key);
115
60
  // Get each part of the url path
116
61
  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]) {
62
+ // track if we have found a match to return the values found.
63
+ let found = true;
64
+ for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
65
+ if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
66
+ const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
67
+ // If the current part of the candidate is a "template" part
68
+ // Try to use the suffix of pattern to match the path
69
+ // {guid} ==> $
70
+ // {guid}:export ==> :export$
71
+ const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
72
+ if (!isMatched) {
133
73
  found = false;
134
74
  break;
135
75
  }
76
+ continue;
136
77
  }
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;
78
+ // If the candidate part is not a template and
79
+ // the parts don't match mark the candidate as not found
80
+ // to move on with the next candidate path.
81
+ if (candidateParts[i] !== pathParts[j]) {
82
+ found = false;
83
+ break;
142
84
  }
143
85
  }
86
+ // We finished evaluating the current candidate parts
87
+ // Update the matched value if and only if we found the longer pattern
88
+ if (found && candidatePath.length > matchedLen) {
89
+ matchedLen = candidatePath.length;
90
+ matchedValue = value;
91
+ }
144
92
  }
145
- // No match was found, return an empty array.
146
- return [];
147
- }
148
- function hasParametrizedPath(path) {
149
- return path.includes("/{");
93
+ return matchedValue;
150
94
  }
151
95
  function getPathFromMapKey(mapKey) {
152
96
  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,E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ACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport 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"]}