@typespec/http-client-js 0.4.0-dev.6 → 0.4.0-dev.8

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 (201) hide show
  1. package/dist/src/components/client-context/client-context-declaration.js +1 -2
  2. package/dist/src/components/client-context/client-context-factory.d.ts.map +1 -1
  3. package/dist/src/components/client-context/client-context-factory.js +12 -5
  4. package/dist/src/components/client-context/client-context-options.js +1 -2
  5. package/dist/src/components/client-context/client-context.js +1 -2
  6. package/dist/src/components/client-context/parametrized-endpoint.js +2 -4
  7. package/dist/src/components/client-directory.js +1 -2
  8. package/dist/src/components/client-operation.d.ts.map +1 -1
  9. package/dist/src/components/client-operation.js +5 -3
  10. package/dist/src/components/client.d.ts.map +1 -1
  11. package/dist/src/components/client.js +15 -5
  12. package/dist/src/components/encoding-provider.js +1 -2
  13. package/dist/src/components/external-packages/ts-http-runtime.js +1 -2
  14. package/dist/src/components/external-packages/uri-template.js +1 -2
  15. package/dist/src/components/http-request-options.js +1 -2
  16. package/dist/src/components/http-request-parameters-expression.js +2 -4
  17. package/dist/src/components/http-request.js +2 -5
  18. package/dist/src/components/http-response.d.ts.map +1 -1
  19. package/dist/src/components/http-response.js +6 -5
  20. package/dist/src/components/models.d.ts.map +1 -1
  21. package/dist/src/components/models.js +6 -5
  22. package/dist/src/components/operation-handlers/index.js +1 -2
  23. package/dist/src/components/operation-handlers/operation-pipeline.js +1 -2
  24. package/dist/src/components/operation-handlers/paging/page-item.d.ts.map +1 -1
  25. package/dist/src/components/operation-handlers/paging/page-item.js +5 -3
  26. package/dist/src/components/operation-handlers/paging/page-response.js +1 -2
  27. package/dist/src/components/operation-handlers/paging/page-settings.js +1 -2
  28. package/dist/src/components/operation-handlers/paging/paginated-operation-handler.d.ts.map +1 -1
  29. package/dist/src/components/operation-handlers/paging/paginated-operation-handler.js +9 -5
  30. package/dist/src/components/operation-handlers/paging/request-send.js +2 -4
  31. package/dist/src/components/operation-handlers/paging/response-deserialize.js +2 -4
  32. package/dist/src/components/operation-handlers/paging/util.js +1 -2
  33. package/dist/src/components/operation-options.js +1 -2
  34. package/dist/src/components/operation-parameters.js +1 -2
  35. package/dist/src/components/output.d.ts +2 -0
  36. package/dist/src/components/output.d.ts.map +1 -1
  37. package/dist/src/components/output.js +7 -7
  38. package/dist/src/components/serializers.d.ts.map +1 -1
  39. package/dist/src/components/serializers.js +9 -8
  40. package/dist/src/components/static-helpers/bytes-encoding.js +2 -4
  41. package/dist/src/components/static-helpers/interfaces.js +1 -2
  42. package/dist/src/components/static-helpers/multipart-helpers.js +2 -4
  43. package/dist/src/components/static-helpers/paging-helper.js +2 -4
  44. package/dist/src/components/static-helpers/rest-error.js +2 -4
  45. package/dist/src/components/testing/client-options.js +1 -2
  46. package/dist/src/components/transforms/content-type-encoding-provider.js +1 -2
  47. package/dist/src/components/transforms/data-transform.d.ts.map +1 -1
  48. package/dist/src/components/transforms/data-transform.js +5 -3
  49. package/dist/src/components/transforms/json/json-array-transform.d.ts.map +1 -1
  50. package/dist/src/components/transforms/json/json-array-transform.js +9 -5
  51. package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts.map +1 -1
  52. package/dist/src/components/transforms/json/json-model-additional-properties-transform.js +6 -5
  53. package/dist/src/components/transforms/json/json-model-base-transform.js +2 -4
  54. package/dist/src/components/transforms/json/json-model-property-transform.d.ts.map +1 -1
  55. package/dist/src/components/transforms/json/json-model-property-transform.js +5 -3
  56. package/dist/src/components/transforms/json/json-model-transform.d.ts.map +1 -1
  57. package/dist/src/components/transforms/json/json-model-transform.js +9 -6
  58. package/dist/src/components/transforms/json/json-record-transform.d.ts.map +1 -1
  59. package/dist/src/components/transforms/json/json-record-transform.js +9 -5
  60. package/dist/src/components/transforms/json/json-transform-discriminator.d.ts.map +1 -1
  61. package/dist/src/components/transforms/json/json-transform-discriminator.js +9 -6
  62. package/dist/src/components/transforms/json/json-transform.d.ts.map +1 -1
  63. package/dist/src/components/transforms/json/json-transform.js +11 -3
  64. package/dist/src/components/transforms/json/union-transform.d.ts.map +1 -1
  65. package/dist/src/components/transforms/json/union-transform.js +6 -6
  66. package/dist/src/components/transforms/json/utils/transport-namer.d.ts +2 -1
  67. package/dist/src/components/transforms/json/utils/transport-namer.d.ts.map +1 -1
  68. package/dist/src/components/transforms/json/utils/transport-namer.js +2 -4
  69. package/dist/src/components/transforms/multipart/array-part-transform.js +2 -4
  70. package/dist/src/components/transforms/multipart/file-part-transform.js +1 -2
  71. package/dist/src/components/transforms/multipart/multipart-transform.d.ts.map +1 -1
  72. package/dist/src/components/transforms/multipart/multipart-transform.js +5 -4
  73. package/dist/src/components/transforms/multipart/part-transform.js +1 -2
  74. package/dist/src/components/transforms/multipart/simple-part-transform.d.ts.map +1 -1
  75. package/dist/src/components/transforms/multipart/simple-part-transform.js +5 -3
  76. package/dist/src/components/transforms/operation-transform-declaration.js +1 -2
  77. package/dist/src/components/transforms/operation-transform-expression.d.ts.map +1 -1
  78. package/dist/src/components/transforms/operation-transform-expression.js +5 -4
  79. package/dist/src/components/transforms/scalar-transform.js +96 -80
  80. package/dist/src/components/transforms/transform-name-policy.d.ts.map +1 -1
  81. package/dist/src/components/transforms/transform-name-policy.js +7 -3
  82. package/dist/src/components/utils/unpack-model-property.d.ts.map +1 -1
  83. package/dist/src/components/utils/unpack-model-property.js +5 -3
  84. package/dist/src/components/utils/url-template.js +2 -4
  85. package/dist/src/context/encoding/encoding-context.d.ts.map +1 -1
  86. package/dist/src/context/encoding/encoding-context.js +5 -3
  87. package/dist/src/emitter.js +5 -3
  88. package/dist/src/index.js +1 -2
  89. package/dist/src/lib.js +1 -2
  90. package/dist/src/testing/index.js +1 -2
  91. package/dist/src/utils/client-discovery.js +1 -2
  92. package/dist/src/utils/multipart.d.ts.map +1 -1
  93. package/dist/src/utils/multipart.js +5 -3
  94. package/dist/src/utils/operations.d.ts +3 -2
  95. package/dist/src/utils/operations.d.ts.map +1 -1
  96. package/dist/src/utils/operations.js +13 -15
  97. package/dist/src/utils/parameters.d.ts.map +1 -1
  98. package/dist/src/utils/parameters.js +8 -3
  99. package/dist/tsconfig.tsbuildinfo +1 -1
  100. package/package.json +5 -10
  101. package/src/components/client-context/client-context-factory.tsx +4 -1
  102. package/src/components/client-operation.tsx +2 -1
  103. package/src/components/client.tsx +5 -1
  104. package/src/components/http-response.tsx +2 -1
  105. package/src/components/models.tsx +2 -1
  106. package/src/components/operation-handlers/paging/page-item.tsx +2 -1
  107. package/src/components/operation-handlers/paging/paginated-operation-handler.tsx +3 -1
  108. package/src/components/output.tsx +10 -5
  109. package/src/components/serializers.tsx +6 -4
  110. package/src/components/transforms/data-transform.tsx +2 -1
  111. package/src/components/transforms/json/json-array-transform.tsx +3 -1
  112. package/src/components/transforms/json/json-model-additional-properties-transform.tsx +2 -1
  113. package/src/components/transforms/json/json-model-property-transform.tsx +2 -1
  114. package/src/components/transforms/json/json-model-transform.tsx +3 -1
  115. package/src/components/transforms/json/json-record-transform.tsx +3 -1
  116. package/src/components/transforms/json/json-transform-discriminator.tsx +3 -1
  117. package/src/components/transforms/json/json-transform.tsx +4 -1
  118. package/src/components/transforms/json/union-transform.tsx +2 -1
  119. package/src/components/transforms/json/utils/transport-namer.ts +2 -2
  120. package/src/components/transforms/multipart/multipart-transform.tsx +2 -2
  121. package/src/components/transforms/multipart/simple-part-transform.tsx +2 -1
  122. package/src/components/transforms/operation-transform-expression.tsx +2 -2
  123. package/src/components/transforms/scalar-transform.tsx +42 -32
  124. package/src/components/transforms/transform-name-policy.ts +2 -1
  125. package/src/components/utils/unpack-model-property.ts +2 -1
  126. package/src/context/encoding/encoding-context.tsx +2 -1
  127. package/src/emitter.tsx +2 -2
  128. package/src/utils/multipart.ts +2 -1
  129. package/src/utils/operations.ts +13 -11
  130. package/src/utils/parameters.tsx +3 -1
  131. package/vitest.config.ts +2 -9
  132. package/babel.config.js +0 -4
  133. package/dist/src/components/client-context/client-context-declaration.js.map +0 -1
  134. package/dist/src/components/client-context/client-context-factory.js.map +0 -1
  135. package/dist/src/components/client-context/client-context-options.js.map +0 -1
  136. package/dist/src/components/client-context/client-context.js.map +0 -1
  137. package/dist/src/components/client-context/parametrized-endpoint.js.map +0 -1
  138. package/dist/src/components/client-directory.js.map +0 -1
  139. package/dist/src/components/client-operation.js.map +0 -1
  140. package/dist/src/components/client.js.map +0 -1
  141. package/dist/src/components/encoding-provider.js.map +0 -1
  142. package/dist/src/components/external-packages/ts-http-runtime.js.map +0 -1
  143. package/dist/src/components/external-packages/uri-template.js.map +0 -1
  144. package/dist/src/components/http-request-options.js.map +0 -1
  145. package/dist/src/components/http-request-parameters-expression.js.map +0 -1
  146. package/dist/src/components/http-request.js.map +0 -1
  147. package/dist/src/components/http-response.js.map +0 -1
  148. package/dist/src/components/models.js.map +0 -1
  149. package/dist/src/components/operation-handlers/index.js.map +0 -1
  150. package/dist/src/components/operation-handlers/operation-pipeline.js.map +0 -1
  151. package/dist/src/components/operation-handlers/paging/page-item.js.map +0 -1
  152. package/dist/src/components/operation-handlers/paging/page-response.js.map +0 -1
  153. package/dist/src/components/operation-handlers/paging/page-settings.js.map +0 -1
  154. package/dist/src/components/operation-handlers/paging/paginated-operation-handler.js.map +0 -1
  155. package/dist/src/components/operation-handlers/paging/request-send.js.map +0 -1
  156. package/dist/src/components/operation-handlers/paging/response-deserialize.js.map +0 -1
  157. package/dist/src/components/operation-handlers/paging/util.js.map +0 -1
  158. package/dist/src/components/operation-handlers/types.js.map +0 -1
  159. package/dist/src/components/operation-options.js.map +0 -1
  160. package/dist/src/components/operation-parameters.js.map +0 -1
  161. package/dist/src/components/output.js.map +0 -1
  162. package/dist/src/components/serializers.js.map +0 -1
  163. package/dist/src/components/static-helpers/bytes-encoding.js.map +0 -1
  164. package/dist/src/components/static-helpers/interfaces.js.map +0 -1
  165. package/dist/src/components/static-helpers/multipart-helpers.js.map +0 -1
  166. package/dist/src/components/static-helpers/paging-helper.js.map +0 -1
  167. package/dist/src/components/static-helpers/rest-error.js.map +0 -1
  168. package/dist/src/components/testing/client-options.js.map +0 -1
  169. package/dist/src/components/transforms/content-type-encoding-provider.js.map +0 -1
  170. package/dist/src/components/transforms/data-transform.js.map +0 -1
  171. package/dist/src/components/transforms/json/json-array-transform.js.map +0 -1
  172. package/dist/src/components/transforms/json/json-model-additional-properties-transform.js.map +0 -1
  173. package/dist/src/components/transforms/json/json-model-base-transform.js.map +0 -1
  174. package/dist/src/components/transforms/json/json-model-property-transform.js.map +0 -1
  175. package/dist/src/components/transforms/json/json-model-transform.js.map +0 -1
  176. package/dist/src/components/transforms/json/json-record-transform.js.map +0 -1
  177. package/dist/src/components/transforms/json/json-transform-discriminator.js.map +0 -1
  178. package/dist/src/components/transforms/json/json-transform.js.map +0 -1
  179. package/dist/src/components/transforms/json/union-transform.js.map +0 -1
  180. package/dist/src/components/transforms/json/utils/transport-namer.js.map +0 -1
  181. package/dist/src/components/transforms/multipart/array-part-transform.js.map +0 -1
  182. package/dist/src/components/transforms/multipart/file-part-transform.js.map +0 -1
  183. package/dist/src/components/transforms/multipart/multipart-transform.js.map +0 -1
  184. package/dist/src/components/transforms/multipart/part-transform.js.map +0 -1
  185. package/dist/src/components/transforms/multipart/simple-part-transform.js.map +0 -1
  186. package/dist/src/components/transforms/operation-transform-declaration.js.map +0 -1
  187. package/dist/src/components/transforms/operation-transform-expression.js.map +0 -1
  188. package/dist/src/components/transforms/scalar-transform.js.map +0 -1
  189. package/dist/src/components/transforms/transform-name-policy.js.map +0 -1
  190. package/dist/src/components/utils/unpack-model-property.js.map +0 -1
  191. package/dist/src/components/utils/url-template.js.map +0 -1
  192. package/dist/src/context/encoding/encoding-context.js.map +0 -1
  193. package/dist/src/context/encoding/types.js.map +0 -1
  194. package/dist/src/emitter.js.map +0 -1
  195. package/dist/src/index.js.map +0 -1
  196. package/dist/src/lib.js.map +0 -1
  197. package/dist/src/testing/index.js.map +0 -1
  198. package/dist/src/utils/client-discovery.js.map +0 -1
  199. package/dist/src/utils/multipart.js.map +0 -1
  200. package/dist/src/utils/operations.js.map +0 -1
  201. package/dist/src/utils/parameters.js.map +0 -1
@@ -17,5 +17,4 @@ export function ClientContextDeclaration(props) {
17
17
  return httpRuntimeTemplateLib.Client;
18
18
  }
19
19
  });
20
- }
21
- //# sourceMappingURL=client-context-declaration.js.map
20
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"client-context-factory.d.ts","sourceRoot":"","sources":["../../../../src/components/client-context/client-context-factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAKrC,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ5C,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAE3D;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,yBAAyB,eA8C/E"}
1
+ {"version":3,"file":"client-context-factory.d.ts","sourceRoot":"","sources":["../../../../src/components/client-context/client-context-factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAKrC,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ5C,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAE3D;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,yBAAyB,eA+C/E"}
@@ -1,8 +1,7 @@
1
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ay from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
- import { $ } from "@typespec/compiler/experimental/typekit";
4
+ import { useTsp } from "@typespec/emitter-framework";
6
5
  import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
7
6
  import { reportDiagnostic } from "../../lib.js";
8
7
  import { buildClientParameters } from "../../utils/parameters.js";
@@ -14,6 +13,9 @@ export function getClientContextFactoryRef(client) {
14
13
  return ay.refkey(client, "contextFactory");
15
14
  }
16
15
  export function ClientContextFactoryDeclaration(props) {
16
+ const {
17
+ $
18
+ } = useTsp();
17
19
  const ref = getClientContextFactoryRef(props.client);
18
20
  const contextDeclarationRef = getClientcontextDeclarationRef(props.client);
19
21
  const namePolicy = ts.useTSNamePolicy();
@@ -75,6 +77,9 @@ function ClientFactoryArguments(props) {
75
77
  }) : _$createComponent(ClientOptionsExpression, {})];
76
78
  }
77
79
  function AuthScheme(props) {
80
+ const {
81
+ $
82
+ } = useTsp();
78
83
  switch (props.scheme.type) {
79
84
  case "http":
80
85
  return _$createComponent(ts.ObjectExpression, {
@@ -174,6 +179,9 @@ function OAuth2Flow(props) {
174
179
  });
175
180
  }
176
181
  function AuthSchemeOptions(props) {
182
+ const {
183
+ $
184
+ } = useTsp();
177
185
  const clientCredential = $.client.getAuth(props.client);
178
186
  if (clientCredential.schemes.length === 0) {
179
187
  return null;
@@ -220,5 +228,4 @@ function ClientOptionsExpression(props) {
220
228
  });
221
229
  }
222
230
  });
223
- }
224
- //# sourceMappingURL=client-context-factory.js.map
231
+ }
@@ -42,5 +42,4 @@ export function ClientContextOptionsDeclaration(props) {
42
42
  }), ";"];
43
43
  }
44
44
  });
45
- }
46
- //# sourceMappingURL=client-context-options.js.map
45
+ }
@@ -24,5 +24,4 @@ export function ClientContext(props) {
24
24
  })];
25
25
  }
26
26
  });
27
- }
28
- //# sourceMappingURL=client-context.js.map
27
+ }
@@ -1,5 +1,4 @@
1
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ay from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
4
  import { useTransformNamePolicy } from "@typespec/emitter-framework";
@@ -53,5 +52,4 @@ export function ParametrizedEndpoint(props) {
53
52
  return [params, resolvedEndpoint];
54
53
  }
55
54
  });
56
- }
57
- //# sourceMappingURL=parametrized-endpoint.js.map
55
+ }
@@ -47,5 +47,4 @@ export function SubClients(props) {
47
47
  });
48
48
  }
49
49
  });
50
- }
51
- //# sourceMappingURL=client-directory.js.map
50
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"client-operation.d.ts","sourceRoot":"","sources":["../../../src/components/client-operation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAU5C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,eAqB5D;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAuC1D"}
1
+ {"version":3,"file":"client-operation.d.ts","sourceRoot":"","sources":["../../../src/components/client-operation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAU5C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,eAqB5D;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAwC1D"}
@@ -1,7 +1,7 @@
1
1
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
2
  import * as ay from "@alloy-js/core";
3
3
  import * as ts from "@alloy-js/typescript";
4
- import { $ } from "@typespec/compiler/experimental/typekit";
4
+ import { useTsp } from "@typespec/emitter-framework";
5
5
  import { FunctionDeclaration, TypeExpression } from "@typespec/emitter-framework/typescript";
6
6
  import * as cl from "@typespec/http-client";
7
7
  import { reportDiagnostic } from "../lib.js";
@@ -37,6 +37,9 @@ export function ClientOperations(props) {
37
37
  });
38
38
  }
39
39
  export function ClientOperation(props) {
40
+ const {
41
+ $
42
+ } = useTsp();
40
43
  const clientLibrary = cl.useClientLibrary();
41
44
  const client = clientLibrary.getClientForOperation(props.httpOperation);
42
45
  if (!client) {
@@ -100,5 +103,4 @@ export function ClientOperation(props) {
100
103
  }), ";"];
101
104
  }
102
105
  });
103
- }
104
- //# sourceMappingURL=client-operation.js.map
106
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/components/client.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ5C,MAAM,WAAW,WAAW;CAAG;AAE/B,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,eAmBxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAElD;AAKD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAgDlD;AAgED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;IAClB,IAAI,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC;CACnB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/components/client.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ5C,MAAM,WAAW,WAAW;CAAG;AAE/B,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,eAoBxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAElD;AAKD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAiDlD;AAkED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;IAClB,IAAI,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC;CACnB"}
@@ -1,8 +1,7 @@
1
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ay from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
- import { $ } from "@typespec/compiler/experimental/typekit";
4
+ import { useTsp } from "@typespec/emitter-framework";
6
5
  import { ClassMethod } from "@typespec/emitter-framework/typescript";
7
6
  import { useClientLibrary } from "@typespec/http-client";
8
7
  import { flattenClients } from "../utils/client-discovery.js";
@@ -11,6 +10,9 @@ import { getClientcontextDeclarationRef } from "./client-context/client-context-
11
10
  import { getClientContextFactoryRef } from "./client-context/client-context-factory.js";
12
11
  import { getOperationParameters } from "./operation-parameters.js";
13
12
  export function Client(props) {
13
+ const {
14
+ $
15
+ } = useTsp();
14
16
  const namePolicy = ts.useTSNamePolicy();
15
17
  const {
16
18
  topLevel
@@ -43,6 +45,9 @@ function getClientContextFieldRef(client) {
43
45
  return ay.refkey(client.type, "client-context");
44
46
  }
45
47
  export function ClientClass(props) {
48
+ const {
49
+ $
50
+ } = useTsp();
46
51
  const namePolicy = ts.useTSNamePolicy();
47
52
  const clientName = namePolicy.getName($.client.getName(props.client), "class");
48
53
  const contextMemberRef = getClientContextFieldRef(props.client);
@@ -112,6 +117,9 @@ function getSubClientClassFieldRef(client) {
112
117
  return ay.refkey(client.type, "client-field");
113
118
  }
114
119
  function SubClientClassField(props) {
120
+ const {
121
+ $
122
+ } = useTsp();
115
123
  const parent = props.client.parent;
116
124
  // If sub client has different parameters than client, don't add it as a subclass field
117
125
  // Todo: We need to detect the extra parameters and make this field a factory for the subclient
@@ -129,6 +137,9 @@ function SubClientClassField(props) {
129
137
  });
130
138
  }
131
139
  function ClientConstructor(props) {
140
+ const {
141
+ $
142
+ } = useTsp();
132
143
  const subClients = props.client.subClients.filter(sc => $.client.haveSameConstructor(sc, props.client));
133
144
  const clientContextFieldRef = getClientContextFieldRef(props.client);
134
145
  const clientContextFactoryRef = getClientContextFactoryRef(props.client);
@@ -171,5 +182,4 @@ function NewClientExpression(props) {
171
182
  return props.args;
172
183
  }
173
184
  })];
174
- }
175
- //# sourceMappingURL=client.js.map
185
+ }
@@ -12,5 +12,4 @@ export function EncodingProvider(props) {
12
12
  return props.children;
13
13
  }
14
14
  });
15
- }
16
- //# sourceMappingURL=encoding-provider.js.map
15
+ }
@@ -7,5 +7,4 @@ export const httpRuntimeTemplateLib = createPackage({
7
7
  named: ["Client", "ClientOptions", "getClient", "ApiKeyCredential", "BasicCredential", "BearerTokenCredential", "OAuth2TokenCredential", "AuthorizationCodeFlow", "ClientCredentialsFlow", "ImplicitFlow", "PasswordFlow", "PathUncheckedResponse", "PipelineRequest", "HttpResponse", "RawHttpHeaders"]
8
8
  }
9
9
  }
10
- });
11
- //# sourceMappingURL=ts-http-runtime.js.map
10
+ });
@@ -7,5 +7,4 @@ export const uriTemplateLib = createPackage({
7
7
  named: ["parse"]
8
8
  }
9
9
  }
10
- });
11
- //# sourceMappingURL=uri-template.js.map
10
+ });
@@ -70,5 +70,4 @@ HttpRequestOptions.Body = function HttpRequestOptionsBody(props) {
70
70
  };
71
71
  export function JSONSerializer(props) {
72
72
  return code`JSON.stringify(${props.children})`;
73
- }
74
- //# sourceMappingURL=http-request-options.js.map
73
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ay from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
4
  import { useTransformNamePolicy } from "@typespec/emitter-framework";
@@ -169,5 +168,4 @@ function findHttpPropertyByPath(httpOperation, path) {
169
168
  }
170
169
  }
171
170
  return undefined;
172
- }
173
- //# sourceMappingURL=http-request-parameters-expression.js.map
171
+ }
@@ -1,6 +1,4 @@
1
- import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
4
2
  import { code, List, refkey, StatementList } from "@alloy-js/core";
5
3
  import * as ts from "@alloy-js/typescript";
6
4
  import { Reference } from "@alloy-js/typescript";
@@ -75,5 +73,4 @@ HttpRequest.Url = function HttpUrlDeclaration(props) {
75
73
  });
76
74
  }
77
75
  });
78
- };
79
- //# sourceMappingURL=http-request.js.map
76
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"http-response.d.ts","sourceRoot":"","sources":["../../../src/components/http-response.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,YAOpD;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,YA4CtD"}
1
+ {"version":3,"file":"http-response.d.ts","sourceRoot":"","sources":["../../../src/components/http-response.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,YAOpD;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,YA6CtD"}
@@ -1,8 +1,7 @@
1
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  import { code, For, List } from "@alloy-js/core";
4
3
  import { isVoidType } from "@typespec/compiler";
5
- import { $ } from "@typespec/compiler/experimental/typekit";
4
+ import { useTsp } from "@typespec/emitter-framework";
6
5
  import { getCreateRestErrorRefkey } from "./static-helpers/rest-error.js";
7
6
  import { ContentTypeEncodingProvider } from "./transforms/content-type-encoding-provider.js";
8
7
  import { JsonTransform } from "./transforms/json/json-transform.js";
@@ -19,6 +18,9 @@ export function HttpResponse(props) {
19
18
  });
20
19
  }
21
20
  export function HttpResponses(props) {
21
+ const {
22
+ $
23
+ } = useTsp();
22
24
  // Handle response by status code and content type
23
25
  const responses = $.httpOperation.flattenResponses(props.httpOperation);
24
26
  return _$createComponent(For, {
@@ -65,5 +67,4 @@ export function HttpResponses(props) {
65
67
  return null;
66
68
  }
67
69
  });
68
- }
69
- //# sourceMappingURL=http-response.js.map
70
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/models.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,qCAqBxC"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/models.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,qCAsBxC"}
@@ -1,12 +1,14 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import { For, refkey } from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
- import { $ } from "@typespec/compiler/experimental/typekit";
4
+ import { useTsp } from "@typespec/emitter-framework";
6
5
  import * as ef from "@typespec/emitter-framework/typescript";
7
6
  import { useClientLibrary } from "@typespec/http-client";
8
7
  import { getFileTypeReference } from "./static-helpers/multipart-helpers.js";
9
8
  export function Models(props) {
9
+ const {
10
+ $
11
+ } = useTsp();
10
12
  const clientLibrary = useClientLibrary();
11
13
  const dataTypes = clientLibrary.dataTypes;
12
14
  return _$createComponent(ts.SourceFile, {
@@ -40,5 +42,4 @@ export function Models(props) {
40
42
  });
41
43
  }
42
44
  });
43
- }
44
- //# sourceMappingURL=models.js.map
45
+ }
@@ -1,3 +1,2 @@
1
1
  export * from "./operation-pipeline.js";
2
- export * from "./types.js";
3
- //# sourceMappingURL=index.js.map
2
+ export * from "./types.js";
@@ -24,5 +24,4 @@ export function OperationPipeline({
24
24
  internal: internal,
25
25
  refkey: defaultOperationRefkey
26
26
  });
27
- }
28
- //# sourceMappingURL=operation-pipeline.js.map
27
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"page-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/page-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,eAAe,qCAQnE"}
1
+ {"version":3,"file":"page-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/page-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,eAAe,qCASnE"}
@@ -1,7 +1,10 @@
1
1
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { $ } from "@typespec/compiler/experimental/typekit";
2
+ import { useTsp } from "@typespec/emitter-framework";
3
3
  import { TypeExpression } from "@typespec/emitter-framework/typescript";
4
4
  export function getPageItemTypeName(pagingOperation) {
5
+ const {
6
+ $
7
+ } = useTsp();
5
8
  const type = pagingOperation.output.pageItems.property.type;
6
9
  // only accept array type
7
10
  if (type.kind === "Model" && $.array.is(type)) {
@@ -13,5 +16,4 @@ export function getPageItemTypeName(pagingOperation) {
13
16
  }
14
17
  // not supported and throw exceptions
15
18
  throw new Error("Not supported");
16
- }
17
- //# sourceMappingURL=page-item.js.map
19
+ }
@@ -46,5 +46,4 @@ export function PageResponseDeclaration(props) {
46
46
  });
47
47
  }
48
48
  });
49
- }
50
- //# sourceMappingURL=page-response.js.map
49
+ }
@@ -48,5 +48,4 @@ export function PageSettingsDeclaration(props) {
48
48
  });
49
49
  }
50
50
  });
51
- }
52
- //# sourceMappingURL=page-settings.js.map
51
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"paginated-operation-handler.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/paginated-operation-handler.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,yBAAyB,EAAE,gBA2DvC,CAAC"}
1
+ {"version":3,"file":"paginated-operation-handler.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/paginated-operation-handler.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,yBAAyB,EAAE,gBA6DvC,CAAC"}
@@ -1,8 +1,7 @@
1
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ay from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
- import { $ } from "@typespec/compiler/experimental/typekit";
4
+ import { useTsp } from "@typespec/emitter-framework";
6
5
  import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
7
6
  import * as cl from "@typespec/http-client";
8
7
  import { reportDiagnostic } from "../../../lib.js";
@@ -18,10 +17,16 @@ import { getHttpRequestDeserializeRefkey, HttpResponseDeserialize } from "../pag
18
17
  import { extractPagingDetail } from "../paging/util.js";
19
18
  export const PaginatedOperationHandler = {
20
19
  canHandle(httpOperation) {
20
+ const {
21
+ $
22
+ } = useTsp();
21
23
  const pagingMetadata = $.operation.getPagingMetadata(httpOperation.operation);
22
24
  return pagingMetadata !== undefined;
23
25
  },
24
26
  handle(httpOperation) {
27
+ const {
28
+ $
29
+ } = useTsp();
25
30
  const clientLibrary = cl.useClientLibrary();
26
31
  const client = clientLibrary.getClientForOperation(httpOperation);
27
32
  if (!client) {
@@ -166,5 +171,4 @@ function GetElements(props) {
166
171
  `;
167
172
  }
168
173
  });
169
- }
170
- //# sourceMappingURL=paginated-operation-handler.js.map
174
+ }
@@ -1,5 +1,4 @@
1
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ay from "@alloy-js/core";
4
3
  import { List, StatementList, code, refkey } from "@alloy-js/core";
5
4
  import * as ts from "@alloy-js/typescript";
@@ -74,5 +73,4 @@ export function HttpRequestSend(props) {
74
73
  });
75
74
  }
76
75
  });
77
- }
78
- //# sourceMappingURL=request-send.js.map
76
+ }
@@ -1,5 +1,4 @@
1
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
3
2
  import { code, List, refkey } from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
4
  import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
@@ -47,5 +46,4 @@ export function HttpResponseDeserialize(props) {
47
46
  })];
48
47
  }
49
48
  });
50
- }
51
- //# sourceMappingURL=response-deserialize.js.map
49
+ }
@@ -42,5 +42,4 @@ function getResponseHeader(httpOperation, prop) {
42
42
  }
43
43
  }
44
44
  return undefined;
45
- }
46
- //# sourceMappingURL=util.js.map
45
+ }
@@ -41,5 +41,4 @@ export function OperationOptionsDeclaration(props) {
41
41
  });
42
42
  }
43
43
  });
44
- }
45
- //# sourceMappingURL=operation-options.js.map
44
+ }
@@ -31,5 +31,4 @@ export function getOperationParameters(operation) {
31
31
  optional: true
32
32
  });
33
33
  return parameters;
34
- }
35
- //# sourceMappingURL=operation-parameters.js.map
34
+ }
@@ -1,6 +1,8 @@
1
1
  import * as ay from "@alloy-js/core";
2
+ import { Program } from "@typespec/compiler";
2
3
  export interface OutputProps {
3
4
  children?: ay.Children;
5
+ program: Program;
4
6
  }
5
7
  export declare function Output(props: OutputProps): ay.Children;
6
8
  //# sourceMappingURL=output.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/components/output.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAUrC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC;CACxB;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,eAYxC"}
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/components/output.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAQ7C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,eAgBxC"}
@@ -1,8 +1,6 @@
1
1
  import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import * as ay from "@alloy-js/core";
3
2
  import * as ts from "@alloy-js/typescript";
4
- import { $ } from "@typespec/compiler/experimental/typekit";
5
- import { TransformNamePolicyContext } from "@typespec/emitter-framework";
3
+ import { Output as EFOutput, TransformNamePolicyContext } from "@typespec/emitter-framework";
6
4
  import { ClientLibrary } from "@typespec/http-client/components";
7
5
  import { EncodingProvider } from "./encoding-provider.js";
8
6
  import { httpRuntimeTemplateLib } from "./external-packages/ts-http-runtime.js";
@@ -11,13 +9,16 @@ import { createTransformNamePolicy } from "./transforms/transform-name-policy.js
11
9
  export function Output(props) {
12
10
  const tsNamePolicy = ts.createTSNamePolicy();
13
11
  const defaultTransformNamePolicy = createTransformNamePolicy();
14
- return _$createComponent(ay.Output, {
12
+ return _$createComponent(EFOutput, {
15
13
  namePolicy: tsNamePolicy,
16
14
  externals: [uriTemplateLib, httpRuntimeTemplateLib],
15
+ get program() {
16
+ return props.program;
17
+ },
17
18
  get children() {
18
19
  return _$createComponent(ClientLibrary, {
19
20
  get program() {
20
- return $.program;
21
+ return props.program;
21
22
  },
22
23
  get children() {
23
24
  return _$createComponent(TransformNamePolicyContext.Provider, {
@@ -34,5 +35,4 @@ export function Output(props) {
34
35
  });
35
36
  }
36
37
  });
37
- }
38
- //# sourceMappingURL=output.js.map
38
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/components/serializers.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qCAsC5D"}
1
+ {"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/components/serializers.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qCAuC5D"}
@@ -1,7 +1,6 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ts from "@alloy-js/typescript";
4
- import { $ } from "@typespec/compiler/experimental/typekit";
3
+ import { useTsp } from "@typespec/emitter-framework";
5
4
  import { DateDeserializer, DateRfc3339Serializer, DateRfc7231Deserializer, DateRfc7231Serializer, DateUnixTimestampDeserializer, DateUnixTimestampSerializer } from "@typespec/emitter-framework/typescript";
6
5
  import { useClientLibrary } from "@typespec/http-client";
7
6
  import { flattenClients } from "../utils/client-discovery.js";
@@ -10,6 +9,9 @@ import { DecodeBase64, EncodeUint8Array } from "./static-helpers/bytes-encoding.
10
9
  import { JsonTransformDeclaration } from "./transforms/json/json-transform.js";
11
10
  import { TransformDeclaration } from "./transforms/operation-transform-declaration.js";
12
11
  export function ModelSerializers(props) {
12
+ const {
13
+ $
14
+ } = useTsp();
13
15
  const clientLibrary = useClientLibrary();
14
16
  const dataTypes = clientLibrary.dataTypes;
15
17
  const flatClients = clientLibrary.topLevel.flatMap(c => flattenClients(c));
@@ -26,7 +28,7 @@ export function ModelSerializers(props) {
26
28
  operation: o
27
29
  }))), _$memo(() => dataTypes.filter(m => m.kind === "Model" || m.kind === "Union").map(type => {
28
30
  let bytesDefaultEncoding = "base64";
29
- if (isOrExtendsFile(type)) {
31
+ if (isOrExtendsFile($, type)) {
30
32
  bytesDefaultEncoding = "none";
31
33
  }
32
34
  return _$createComponent(EncodingProvider, {
@@ -47,13 +49,12 @@ export function ModelSerializers(props) {
47
49
  }
48
50
  });
49
51
  }
50
- function isOrExtendsFile(type) {
52
+ function isOrExtendsFile($, type) {
51
53
  if (!$.model.is(type)) {
52
54
  return false;
53
55
  }
54
56
  if ($.model.isHttpFile(type)) {
55
57
  return true;
56
58
  }
57
- return type.baseModel ? isOrExtendsFile(type.baseModel) : false;
58
- }
59
- //# sourceMappingURL=serializers.js.map
59
+ return type.baseModel ? isOrExtendsFile($, type.baseModel) : false;
60
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ay from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
4
  export function getEncodeUint8ArrayRef() {
@@ -62,5 +61,4 @@ export function DecodeBase64() {
62
61
  `;
63
62
  }
64
63
  });
65
- }
66
- //# sourceMappingURL=bytes-encoding.js.map
64
+ }
@@ -37,5 +37,4 @@ export function Interfaces() {
37
37
  return _$createComponent(OperationOptionsInterfaceDeclaration, {});
38
38
  }
39
39
  });
40
- }
41
- //# sourceMappingURL=interfaces.js.map
40
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ay from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
4
  export function getFileContentsTypeReference() {
@@ -81,5 +80,4 @@ function getCreateFilePartParameters() {
81
80
  refkey: ay.refkey(),
82
81
  type: "string"
83
82
  }];
84
- }
85
- //# sourceMappingURL=multipart-helpers.js.map
83
+ }
@@ -1,5 +1,4 @@
1
- import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
1
+ import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
3
2
  import * as ay from "@alloy-js/core";
4
3
  import * as ts from "@alloy-js/typescript";
5
4
  export function getPagedAsyncIterableIteratorRefkey() {
@@ -193,5 +192,4 @@ export function PagingHelpers() {
193
192
  return [_$createComponent(PagedAsyncIterableIteratorInterfaceDeclaration, {}), _$createComponent(PagedResultInterfaceDeclaration, {}), _$createComponent(BuildPagedAsyncIteratorOptionsInterfaceDeclaration, {}), _$createComponent(BuildPagedAsyncIteratorInterfaceDeclaration, {})];
194
193
  }
195
194
  });
196
- }
197
- //# sourceMappingURL=paging-helper.js.map
195
+ }