@typespec/http-client-js 0.16.1-dev.1 → 0.16.1

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 (199) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +4 -0
  3. package/dist/src/components/client-context/client-context-declaration.d.ts +1 -1
  4. package/dist/src/components/client-context/client-context-declaration.d.ts.map +1 -1
  5. package/dist/src/components/client-context/client-context-factory.d.ts +2 -2
  6. package/dist/src/components/client-context/client-context-factory.d.ts.map +1 -1
  7. package/dist/src/components/client-context/client-context-factory.js.map +1 -1
  8. package/dist/src/components/client-context/client-context-options.d.ts +2 -2
  9. package/dist/src/components/client-context/client-context-options.d.ts.map +1 -1
  10. package/dist/src/components/client-context/client-context-options.js.map +1 -1
  11. package/dist/src/components/client-context/client-context.d.ts +1 -1
  12. package/dist/src/components/client-context/client-context.d.ts.map +1 -1
  13. package/dist/src/components/client-context/parametrized-endpoint.d.ts +2 -2
  14. package/dist/src/components/client-context/parametrized-endpoint.d.ts.map +1 -1
  15. package/dist/src/components/client-context/parametrized-endpoint.js.map +1 -1
  16. package/dist/src/components/client-directory.d.ts +2 -2
  17. package/dist/src/components/client-directory.d.ts.map +1 -1
  18. package/dist/src/components/client-directory.js.map +1 -1
  19. package/dist/src/components/client-operation.d.ts +2 -2
  20. package/dist/src/components/client-operation.d.ts.map +1 -1
  21. package/dist/src/components/client-operation.js.map +1 -1
  22. package/dist/src/components/client.d.ts +2 -2
  23. package/dist/src/components/client.d.ts.map +1 -1
  24. package/dist/src/components/client.js.map +1 -1
  25. package/dist/src/components/encoding-provider.d.ts +1 -1
  26. package/dist/src/components/encoding-provider.d.ts.map +1 -1
  27. package/dist/src/components/http-request-options.d.ts +2 -2
  28. package/dist/src/components/http-request-options.d.ts.map +1 -1
  29. package/dist/src/components/http-request-options.js.map +1 -1
  30. package/dist/src/components/http-request-parameters-expression.d.ts +2 -2
  31. package/dist/src/components/http-request-parameters-expression.d.ts.map +1 -1
  32. package/dist/src/components/http-request-parameters-expression.js.map +1 -1
  33. package/dist/src/components/http-request.d.ts +2 -2
  34. package/dist/src/components/http-request.d.ts.map +1 -1
  35. package/dist/src/components/http-request.js.map +1 -1
  36. package/dist/src/components/http-response.d.ts +2 -2
  37. package/dist/src/components/http-response.d.ts.map +1 -1
  38. package/dist/src/components/http-response.js.map +1 -1
  39. package/dist/src/components/operation-handlers/index.d.ts +1 -1
  40. package/dist/src/components/operation-handlers/index.d.ts.map +1 -1
  41. package/dist/src/components/operation-handlers/index.js +0 -1
  42. package/dist/src/components/operation-handlers/index.js.map +1 -1
  43. package/dist/src/components/operation-handlers/operation-pipeline.d.ts +2 -2
  44. package/dist/src/components/operation-handlers/operation-pipeline.d.ts.map +1 -1
  45. package/dist/src/components/operation-handlers/paging/page-item.d.ts +1 -1
  46. package/dist/src/components/operation-handlers/paging/page-item.d.ts.map +1 -1
  47. package/dist/src/components/operation-handlers/paging/page-response.d.ts +2 -2
  48. package/dist/src/components/operation-handlers/paging/page-response.d.ts.map +1 -1
  49. package/dist/src/components/operation-handlers/paging/page-settings.d.ts +2 -2
  50. package/dist/src/components/operation-handlers/paging/page-settings.d.ts.map +1 -1
  51. package/dist/src/components/operation-handlers/paging/paginated-operation-handler.d.ts +1 -1
  52. package/dist/src/components/operation-handlers/paging/paginated-operation-handler.d.ts.map +1 -1
  53. package/dist/src/components/operation-handlers/paging/paginated-operation-handler.js.map +1 -1
  54. package/dist/src/components/operation-handlers/paging/request-send.d.ts +2 -2
  55. package/dist/src/components/operation-handlers/paging/request-send.d.ts.map +1 -1
  56. package/dist/src/components/operation-handlers/paging/request-send.js.map +1 -1
  57. package/dist/src/components/operation-handlers/paging/response-deserialize.d.ts +3 -3
  58. package/dist/src/components/operation-handlers/paging/response-deserialize.d.ts.map +1 -1
  59. package/dist/src/components/operation-handlers/paging/response-deserialize.js.map +1 -1
  60. package/dist/src/components/operation-handlers/paging/util.d.ts +2 -2
  61. package/dist/src/components/operation-handlers/paging/util.d.ts.map +1 -1
  62. package/dist/src/components/operation-handlers/types.d.ts +1 -1
  63. package/dist/src/components/operation-handlers/types.d.ts.map +1 -1
  64. package/dist/src/components/operation-options.d.ts +2 -2
  65. package/dist/src/components/operation-options.d.ts.map +1 -1
  66. package/dist/src/components/operation-parameters.d.ts +3 -3
  67. package/dist/src/components/operation-parameters.d.ts.map +1 -1
  68. package/dist/src/components/operation-parameters.js.map +1 -1
  69. package/dist/src/components/output.d.ts +2 -2
  70. package/dist/src/components/output.d.ts.map +1 -1
  71. package/dist/src/components/static-helpers/bytes-encoding.d.ts +2 -2
  72. package/dist/src/components/static-helpers/bytes-encoding.d.ts.map +1 -1
  73. package/dist/src/components/static-helpers/bytes-encoding.js.map +1 -1
  74. package/dist/src/components/testing/client-options.d.ts +1 -1
  75. package/dist/src/components/testing/client-options.d.ts.map +1 -1
  76. package/dist/src/components/testing/client-options.js.map +1 -1
  77. package/dist/src/components/transforms/data-transform.d.ts +2 -2
  78. package/dist/src/components/transforms/data-transform.d.ts.map +1 -1
  79. package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts +1 -1
  80. package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts.map +1 -1
  81. package/dist/src/components/transforms/json/json-model-additional-properties-transform.js.map +1 -1
  82. package/dist/src/components/transforms/json/json-model-property-transform.d.ts +2 -2
  83. package/dist/src/components/transforms/json/json-model-property-transform.d.ts.map +1 -1
  84. package/dist/src/components/transforms/json/json-model-property-transform.js.map +1 -1
  85. package/dist/src/components/transforms/json/json-transform-discriminator.d.ts +1 -1
  86. package/dist/src/components/transforms/json/json-transform-discriminator.d.ts.map +1 -1
  87. package/dist/src/components/transforms/json/json-transform.d.ts +2 -2
  88. package/dist/src/components/transforms/json/json-transform.d.ts.map +1 -1
  89. package/dist/src/components/transforms/json/json-transform.js.map +1 -1
  90. package/dist/src/components/transforms/json/union-transform.d.ts +1 -1
  91. package/dist/src/components/transforms/json/union-transform.d.ts.map +1 -1
  92. package/dist/src/components/transforms/json/union-transform.js.map +1 -1
  93. package/dist/src/components/transforms/multipart/array-part-transform.d.ts +2 -2
  94. package/dist/src/components/transforms/multipart/array-part-transform.d.ts.map +1 -1
  95. package/dist/src/components/transforms/multipart/file-part-transform.d.ts +2 -2
  96. package/dist/src/components/transforms/multipart/file-part-transform.d.ts.map +1 -1
  97. package/dist/src/components/transforms/multipart/file-part-transform.js.map +1 -1
  98. package/dist/src/components/transforms/multipart/multipart-transform.d.ts +1 -1
  99. package/dist/src/components/transforms/multipart/multipart-transform.d.ts.map +1 -1
  100. package/dist/src/components/transforms/multipart/part-transform.d.ts +1 -1
  101. package/dist/src/components/transforms/multipart/part-transform.d.ts.map +1 -1
  102. package/dist/src/components/transforms/multipart/simple-part-transform.d.ts +2 -2
  103. package/dist/src/components/transforms/multipart/simple-part-transform.d.ts.map +1 -1
  104. package/dist/src/components/transforms/multipart/simple-part-transform.js.map +1 -1
  105. package/dist/src/components/transforms/operation-transform-declaration.d.ts +3 -3
  106. package/dist/src/components/transforms/operation-transform-declaration.d.ts.map +1 -1
  107. package/dist/src/components/transforms/operation-transform-declaration.js.map +1 -1
  108. package/dist/src/components/transforms/operation-transform-expression.d.ts +1 -1
  109. package/dist/src/components/transforms/operation-transform-expression.d.ts.map +1 -1
  110. package/dist/src/components/transforms/operation-transform-expression.js.map +1 -1
  111. package/dist/src/components/transforms/scalar-transform.d.ts +2 -2
  112. package/dist/src/components/transforms/scalar-transform.d.ts.map +1 -1
  113. package/dist/src/components/transforms/scalar-transform.js.map +1 -1
  114. package/dist/src/components/utils/unpack-model-property.d.ts +1 -1
  115. package/dist/src/components/utils/unpack-model-property.d.ts.map +1 -1
  116. package/dist/src/components/utils/unpack-model-property.js.map +1 -1
  117. package/dist/src/components/utils/url-template.d.ts +1 -1
  118. package/dist/src/components/utils/url-template.d.ts.map +1 -1
  119. package/dist/src/context/encoding/encoding-context.d.ts +2 -2
  120. package/dist/src/context/encoding/encoding-context.d.ts.map +1 -1
  121. package/dist/src/context/encoding/encoding-context.js.map +1 -1
  122. package/dist/src/emitter.d.ts +3 -3
  123. package/dist/src/emitter.d.ts.map +1 -1
  124. package/dist/src/emitter.js.map +1 -1
  125. package/dist/src/lib.d.ts.map +1 -1
  126. package/dist/src/lib.js.map +1 -1
  127. package/dist/src/testing/index.d.ts +1 -1
  128. package/dist/src/testing/index.d.ts.map +1 -1
  129. package/dist/src/testing/index.js.map +1 -1
  130. package/dist/src/utils/client-discovery.d.ts +1 -1
  131. package/dist/src/utils/client-discovery.d.ts.map +1 -1
  132. package/dist/src/utils/operations.d.ts +2 -2
  133. package/dist/src/utils/operations.d.ts.map +1 -1
  134. package/dist/src/utils/operations.js.map +1 -1
  135. package/dist/src/utils/parameters.d.ts +5 -5
  136. package/dist/src/utils/parameters.d.ts.map +1 -1
  137. package/dist/src/utils/parameters.js.map +1 -1
  138. package/dist/tsconfig.tsbuildinfo +1 -1
  139. package/package.json +14 -14
  140. package/src/components/client-context/client-context-declaration.tsx +1 -1
  141. package/src/components/client-context/client-context-factory.tsx +5 -3
  142. package/src/components/client-context/client-context-options.tsx +3 -2
  143. package/src/components/client-context/client-context.tsx +1 -1
  144. package/src/components/client-context/parametrized-endpoint.tsx +3 -2
  145. package/src/components/client-directory.tsx +3 -2
  146. package/src/components/client-operation.tsx +3 -2
  147. package/src/components/client.tsx +3 -2
  148. package/src/components/encoding-provider.tsx +1 -1
  149. package/src/components/http-request-options.tsx +3 -2
  150. package/src/components/http-request-parameters-expression.tsx +3 -2
  151. package/src/components/http-request.tsx +3 -2
  152. package/src/components/http-response.tsx +3 -2
  153. package/src/components/operation-handlers/index.tsx +1 -1
  154. package/src/components/operation-handlers/operation-pipeline.tsx +2 -2
  155. package/src/components/operation-handlers/paging/page-item.tsx +1 -1
  156. package/src/components/operation-handlers/paging/page-response.tsx +2 -2
  157. package/src/components/operation-handlers/paging/page-settings.tsx +2 -2
  158. package/src/components/operation-handlers/paging/paginated-operation-handler.tsx +6 -4
  159. package/src/components/operation-handlers/paging/request-send.tsx +3 -2
  160. package/src/components/operation-handlers/paging/response-deserialize.tsx +5 -3
  161. package/src/components/operation-handlers/paging/util.ts +2 -2
  162. package/src/components/operation-handlers/types.tsx +1 -1
  163. package/src/components/operation-options.tsx +2 -2
  164. package/src/components/operation-parameters.tsx +4 -3
  165. package/src/components/output.tsx +2 -2
  166. package/src/components/static-helpers/bytes-encoding.tsx +3 -2
  167. package/src/components/testing/client-options.tsx +2 -1
  168. package/src/components/transforms/content-type-encoding-provider.tsx +1 -1
  169. package/src/components/transforms/data-transform.tsx +2 -2
  170. package/src/components/transforms/json/json-model-additional-properties-transform.tsx +2 -1
  171. package/src/components/transforms/json/json-model-property-transform.tsx +3 -2
  172. package/src/components/transforms/json/json-transform-discriminator.tsx +1 -1
  173. package/src/components/transforms/json/json-transform.tsx +3 -2
  174. package/src/components/transforms/json/union-transform.tsx +2 -1
  175. package/src/components/transforms/multipart/array-part-transform.tsx +2 -2
  176. package/src/components/transforms/multipart/file-part-transform.tsx +3 -2
  177. package/src/components/transforms/multipart/multipart-transform.tsx +1 -1
  178. package/src/components/transforms/multipart/part-transform.tsx +1 -1
  179. package/src/components/transforms/multipart/simple-part-transform.tsx +3 -2
  180. package/src/components/transforms/operation-transform-declaration.tsx +4 -3
  181. package/src/components/transforms/operation-transform-expression.tsx +3 -2
  182. package/src/components/transforms/scalar-transform.tsx +4 -2
  183. package/src/components/utils/unpack-model-property.ts +2 -1
  184. package/src/components/utils/url-template.tsx +1 -1
  185. package/src/context/encoding/encoding-context.tsx +3 -2
  186. package/src/emitter.tsx +4 -3
  187. package/src/lib.ts +2 -1
  188. package/src/testing/index.ts +2 -1
  189. package/src/utils/client-discovery.ts +1 -1
  190. package/src/utils/operations.ts +5 -3
  191. package/src/utils/parameters.tsx +6 -5
  192. package/test/e2e/http/payload/pageable/main.test.ts +2 -4
  193. package/test/e2e/http/type/model/inheritance/single-discriminator/main.test.ts +2 -4
  194. package/test/e2e/http/type/property/additional-properties/main.test.ts +1 -1
  195. package/test/e2e/http/type/property/additional-properties/spreads.test.ts +5 -3
  196. package/test/e2e/http/versioning/added/main.test.ts +1 -2
  197. package/test/e2e/http/versioning/removed/main.test.ts +1 -1
  198. package/test/test-host.ts +2 -1
  199. package/tsconfig.test.json +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/http-client-js",
3
- "version": "0.16.1-dev.1",
3
+ "version": "0.16.1",
4
4
  "type": "module",
5
5
  "homepage": "https://typespec.io",
6
6
  "readme": "https://github.com/microsoft/typespec/blob/main/packages/http-client-js/README.md",
@@ -28,30 +28,25 @@
28
28
  "license": "MIT",
29
29
  "description": "TypeSpec library for emitting Http Client libraries for JavaScript/TypeScript",
30
30
  "peerDependencies": {
31
- "@typespec/compiler": "^1.14.0 || >= 1.15.0-dev.7",
32
- "@typespec/http": "^1.14.0 || >= 1.15.0-dev.3",
33
- "@typespec/rest": "^0.84.0 || >= 0.85.0-dev.0"
31
+ "@typespec/compiler": "^1.15.0",
32
+ "@typespec/rest": "^0.85.0",
33
+ "@typespec/http": "^1.15.0"
34
34
  },
35
35
  "dependencies": {
36
36
  "@alloy-js/core": "^0.24.1",
37
37
  "@alloy-js/typescript": "^0.24.0",
38
- "@typespec/emitter-framework": "^0.19.0 || >= 0.20.0-dev.2",
39
- "@typespec/http-client": "^0.16.0 || >= 0.16.1-dev.0",
40
- "prettier": "^3.9.5"
38
+ "prettier": "^3.9.5",
39
+ "@typespec/emitter-framework": "^0.20.0",
40
+ "@typespec/http-client": "^0.16.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@alloy-js/cli": "^0.24.0",
44
44
  "@alloy-js/rollup-plugin": "^0.1.2",
45
45
  "@types/yargs": "^17.0.35",
46
- "@typespec/http": "^1.14.0 || >= 1.15.0-dev.3",
47
- "@typespec/http-specs": "^0.1.0-alpha.40 || >= 0.1.0-alpha.41-dev.0",
48
- "@typespec/spector": "^0.1.0-alpha.27 || >= 0.1.0-alpha.28-dev.2",
49
46
  "@typespec/ts-http-runtime": "0.3.7",
50
- "@typespec/tspd": "^0.76.0 || >= 0.77.0-dev.4",
51
- "@typespec/versioning": "^0.84.0 || >= 0.85.0-dev.0",
52
47
  "@vitest/ui": "^4.1.3",
53
48
  "change-case": "^5.4.4",
54
- "concurrently": "^10.0.0",
49
+ "concurrently": "^10.0.4",
55
50
  "cross-env": "^10.1.0",
56
51
  "execa": "^9.6.1",
57
52
  "@inquirer/prompts": "^8.4.1",
@@ -61,7 +56,12 @@
61
56
  "typescript": "~6.0.2",
62
57
  "uri-template": "^2.0.0",
63
58
  "vitest": "^4.1.3",
64
- "yargs": "^18.0.0"
59
+ "yargs": "^18.0.0",
60
+ "@typespec/http-specs": "^0.1.0-alpha.41",
61
+ "@typespec/http": "^1.15.0",
62
+ "@typespec/tspd": "^0.77.0",
63
+ "@typespec/spector": "^0.1.0-alpha.28",
64
+ "@typespec/versioning": "^0.85.0"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "alloy build",
@@ -1,6 +1,6 @@
1
1
  import { refkey } from "@alloy-js/core";
2
2
  import * as ts from "@alloy-js/typescript";
3
- import * as cl from "@typespec/http-client";
3
+ import type * as cl from "@typespec/http-client";
4
4
  import { httpRuntimeTemplateLib } from "../external-packages/ts-http-runtime.js";
5
5
 
6
6
  export interface ClientContextDeclarationProps {
@@ -1,9 +1,11 @@
1
- import { Children, For, List, refkey, Refkey } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { For, List, refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import { useTsp } from "@typespec/emitter-framework";
4
5
  import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
5
- import { HttpAuth, type OAuth2Flow } from "@typespec/http";
6
- import * as cl from "@typespec/http-client";
6
+ import type { HttpAuth } from "@typespec/http";
7
+ import { type OAuth2Flow } from "@typespec/http";
8
+ import type * as cl from "@typespec/http-client";
7
9
  import { reportDiagnostic } from "../../lib.js";
8
10
  import { buildClientParameters } from "../../utils/parameters.jsx";
9
11
  import { httpRuntimeTemplateLib } from "../external-packages/ts-http-runtime.js";
@@ -1,6 +1,7 @@
1
- import { Children, For, refkey } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { For, refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import * as cl from "@typespec/http-client";
4
+ import type * as cl from "@typespec/http-client";
4
5
  import { httpRuntimeTemplateLib } from "../external-packages/ts-http-runtime.js";
5
6
 
6
7
  export interface ClientContextOptionsDeclarationProps {
@@ -1,6 +1,6 @@
1
1
  import { type Children } from "@alloy-js/core";
2
2
  import * as ts from "@alloy-js/typescript";
3
- import * as cl from "@typespec/http-client";
3
+ import type * as cl from "@typespec/http-client";
4
4
  import { ClientContextDeclaration } from "./client-context-declaration.jsx";
5
5
  import { ClientContextFactoryDeclaration } from "./client-context-factory.jsx";
6
6
  import { ClientContextOptionsDeclaration } from "./client-context-options.jsx";
@@ -1,6 +1,7 @@
1
- import { code, For, Refkey, refkey, StatementList } from "@alloy-js/core";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { code, For, refkey, StatementList } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { ModelProperty } from "@typespec/compiler";
4
+ import type { ModelProperty } from "@typespec/compiler";
4
5
  import { useTransformNamePolicy } from "@typespec/emitter-framework";
5
6
  import { getDefaultValue } from "../../utils/parameters.jsx";
6
7
 
@@ -1,6 +1,7 @@
1
- import { Children, For, SourceDirectory, StatementList } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { For, SourceDirectory, StatementList } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import * as cl from "@typespec/http-client";
4
+ import type * as cl from "@typespec/http-client";
4
5
  import { useClientLibrary } from "@typespec/http-client";
5
6
  import { ClientContext } from "./client-context/client-context.jsx";
6
7
  import { ClientOperations } from "./client-operation.jsx";
@@ -1,8 +1,9 @@
1
- import { For, List, Refkey, refkey } from "@alloy-js/core";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { For, List, refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import { useTsp } from "@typespec/emitter-framework";
4
5
  import { FunctionDeclaration, TypeExpression } from "@typespec/emitter-framework/typescript";
5
- import { HttpOperation } from "@typespec/http";
6
+ import type { HttpOperation } from "@typespec/http";
6
7
  import * as cl from "@typespec/http-client";
7
8
  import { reportDiagnostic } from "../lib.js";
8
9
  import { getClientcontextDeclarationRef } from "./client-context/client-context-declaration.jsx";
@@ -1,8 +1,9 @@
1
- import { For, List, Refkey, refkey } from "@alloy-js/core";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { For, List, refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import { useTsp } from "@typespec/emitter-framework";
4
5
  import { ClassMethod } from "@typespec/emitter-framework/typescript";
5
- import * as cl from "@typespec/http-client";
6
+ import type * as cl from "@typespec/http-client";
6
7
  import { useClientLibrary } from "@typespec/http-client";
7
8
  import { flattenClients } from "../utils/client-discovery.js";
8
9
  import { buildClientParameters } from "../utils/parameters.jsx";
@@ -1,6 +1,6 @@
1
1
  import { type Children } from "@alloy-js/core";
2
2
  import { EncodingContext } from "../context/encoding/encoding-context.jsx";
3
- import { EncodingDefaults } from "../context/encoding/types.js";
3
+ import type { EncodingDefaults } from "../context/encoding/types.js";
4
4
  export interface EncodingProviderProps {
5
5
  defaults?: EncodingDefaults;
6
6
  children?: Children;
@@ -1,6 +1,7 @@
1
- import { Children, code, Refkey } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { HttpOperation } from "@typespec/http";
4
+ import type { HttpOperation } from "@typespec/http";
4
5
  import { EncodingProvider } from "./encoding-provider.jsx";
5
6
  import { HttpRequestParametersExpression } from "./http-request-parameters-expression.jsx";
6
7
  import { OperationTransformExpression } from "./transforms/operation-transform-expression.jsx";
@@ -1,7 +1,8 @@
1
- import { Children, code, For, List, NamePolicyContext, useNamePolicy } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code, For, List, NamePolicyContext, useNamePolicy } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import { useTransformNamePolicy } from "@typespec/emitter-framework";
4
- import { HttpOperation, HttpProperty } from "@typespec/http";
5
+ import type { HttpOperation, HttpProperty } from "@typespec/http";
5
6
  import { getDefaultValue, hasDefaultValue } from "../utils/parameters.jsx";
6
7
  import { JsonTransform } from "./transforms/json/json-transform.jsx";
7
8
  export interface HttpRequestParametersExpressionProps {
@@ -1,7 +1,8 @@
1
- import { Children, code, List, refkey, Refkey, StatementList } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code, List, refkey, StatementList } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import { Reference } from "@alloy-js/typescript";
4
- import { HttpOperation } from "@typespec/http";
5
+ import type { HttpOperation } from "@typespec/http";
5
6
  import { EncodingProvider } from "./encoding-provider.jsx";
6
7
  import { uriTemplateLib } from "./external-packages/uri-template.js";
7
8
  import { HttpRequestOptions } from "./http-request-options.js";
@@ -1,7 +1,8 @@
1
- import { Children, code, For, List, Refkey } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code, For, List } from "@alloy-js/core";
2
3
  import { isVoidType } from "@typespec/compiler";
3
4
  import { useTsp } from "@typespec/emitter-framework";
4
- import { HttpOperation } from "@typespec/http";
5
+ import type { HttpOperation } from "@typespec/http";
5
6
  import { getCreateRestErrorRefkey } from "./static-helpers/rest-error.jsx";
6
7
  import { ContentTypeEncodingProvider } from "./transforms/content-type-encoding-provider.jsx";
7
8
  import { JsonTransform } from "./transforms/json/json-transform.jsx";
@@ -1,2 +1,2 @@
1
1
  export * from "./operation-pipeline.jsx";
2
- export * from "./types.jsx";
2
+ export type * from "./types.jsx";
@@ -1,7 +1,7 @@
1
1
  import { refkey } from "@alloy-js/core";
2
- import { HttpOperation } from "@typespec/http";
2
+ import type { HttpOperation } from "@typespec/http";
3
3
  import { ClientOperation as DefaultOperationComponent } from "../client-operation.jsx";
4
- import { OperationHandlerPipeline } from "./types.jsx";
4
+ import type { OperationHandlerPipeline } from "./types.jsx";
5
5
 
6
6
  export interface OperationPipelineProps {
7
7
  httpOperation: HttpOperation;
@@ -1,4 +1,4 @@
1
- import { PagingOperation } from "@typespec/compiler";
1
+ import type { PagingOperation } from "@typespec/compiler";
2
2
  import { useTsp } from "@typespec/emitter-framework";
3
3
  import { TypeExpression } from "@typespec/emitter-framework/typescript";
4
4
 
@@ -1,8 +1,8 @@
1
1
  import { For, refkey } from "@alloy-js/core";
2
2
  import * as ts from "@alloy-js/typescript";
3
- import { PagingOperation, PagingProperty } from "@typespec/compiler";
3
+ import type { PagingOperation, PagingProperty } from "@typespec/compiler";
4
4
  import * as ef from "@typespec/emitter-framework/typescript";
5
- import { HttpOperation } from "@typespec/http";
5
+ import type { HttpOperation } from "@typespec/http";
6
6
  export interface PageResponseProps {
7
7
  operation: HttpOperation;
8
8
  pagingOperation: PagingOperation;
@@ -1,8 +1,8 @@
1
1
  import { For, refkey } from "@alloy-js/core";
2
2
  import * as ts from "@alloy-js/typescript";
3
- import { PagingOperation, PagingProperty } from "@typespec/compiler";
3
+ import type { PagingOperation, PagingProperty } from "@typespec/compiler";
4
4
  import * as ef from "@typespec/emitter-framework/typescript";
5
- import { HttpOperation } from "@typespec/http";
5
+ import type { HttpOperation } from "@typespec/http";
6
6
  export interface PageSettingsProps {
7
7
  operation: HttpOperation;
8
8
  pagingOperation: PagingOperation;
@@ -1,8 +1,9 @@
1
- import { Children, code, List, refkey } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code, List, refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import { useTsp } from "@typespec/emitter-framework";
4
5
  import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
5
- import { HttpOperation } from "@typespec/http";
6
+ import type { HttpOperation } from "@typespec/http";
6
7
  import * as cl from "@typespec/http-client";
7
8
  import { reportDiagnostic } from "../../../lib.js";
8
9
  import { getClientcontextDeclarationRef } from "../../client-context/client-context-declaration.jsx";
@@ -24,8 +25,9 @@ import {
24
25
  getHttpRequestDeserializeRefkey,
25
26
  HttpResponseDeserialize,
26
27
  } from "../paging/response-deserialize.jsx";
27
- import { extractPagingDetail, PagingDetail } from "../paging/util.js";
28
- import { OperationHandler } from "../types.js";
28
+ import type { PagingDetail } from "../paging/util.js";
29
+ import { extractPagingDetail } from "../paging/util.js";
30
+ import type { OperationHandler } from "../types.js";
29
31
 
30
32
  export const PaginatedOperationHandler: OperationHandler = {
31
33
  canHandle(httpOperation: HttpOperation): boolean {
@@ -1,8 +1,9 @@
1
- import { List, Refkey, StatementList, code, refkey } from "@alloy-js/core";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { List, StatementList, code, refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import { Reference } from "@alloy-js/typescript";
4
5
  import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
5
- import { HttpOperation } from "@typespec/http";
6
+ import type { HttpOperation } from "@typespec/http";
6
7
  import * as cl from "@typespec/http-client";
7
8
  import { getClientcontextDeclarationRef } from "../../client-context/client-context-declaration.jsx";
8
9
  import { HttpRequestOptions } from "../../http-request-options.jsx";
@@ -1,9 +1,11 @@
1
- import { Children, code, List, Refkey, refkey } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code, List, refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
4
- import { HttpOperation } from "@typespec/http";
5
+ import type { HttpOperation } from "@typespec/http";
5
6
  import { httpRuntimeTemplateLib } from "../../external-packages/ts-http-runtime.js";
6
- import { HttpResponseProps, HttpResponses } from "../../http-response.jsx";
7
+ import type { HttpResponseProps } from "../../http-response.jsx";
8
+ import { HttpResponses } from "../../http-response.jsx";
7
9
  import { getOperationOptionsTypeRefkey } from "../../operation-options.jsx";
8
10
  import { getCreateRestErrorRefkey } from "../../static-helpers/rest-error.jsx";
9
11
 
@@ -1,5 +1,5 @@
1
- import { ModelProperty, PagingOperation } from "@typespec/compiler";
2
- import { HttpOperation } from "@typespec/http";
1
+ import type { ModelProperty, PagingOperation } from "@typespec/compiler";
2
+ import type { HttpOperation } from "@typespec/http";
3
3
 
4
4
  export interface PagingDetail {
5
5
  // Only support the nextLink or continuationToken
@@ -1,5 +1,5 @@
1
1
  import { type Children } from "@alloy-js/core";
2
- import { HttpOperation } from "@typespec/http";
2
+ import type { HttpOperation } from "@typespec/http";
3
3
 
4
4
  export interface OperationHandler {
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  import { For, refkey } from "@alloy-js/core";
2
2
  import * as ts from "@alloy-js/typescript";
3
- import { ModelProperty } from "@typespec/compiler";
3
+ import type { ModelProperty } from "@typespec/compiler";
4
4
  import * as ef from "@typespec/emitter-framework/typescript";
5
- import { HttpOperation } from "@typespec/http";
5
+ import type { HttpOperation } from "@typespec/http";
6
6
  import { hasDefaultValue } from "../utils/parameters.jsx";
7
7
  import { getOperationOptionsInterfaceRefkey } from "./static-helpers/interfaces.jsx";
8
8
  export interface OperationOptionsProps {
@@ -1,8 +1,9 @@
1
- import { Refkey, refkey } from "@alloy-js/core";
2
- import * as ts from "@alloy-js/typescript";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { refkey } from "@alloy-js/core";
3
+ import type * as ts from "@alloy-js/typescript";
3
4
  import { useTransformNamePolicy } from "@typespec/emitter-framework";
4
5
  import * as ef from "@typespec/emitter-framework/typescript";
5
- import { HttpOperation } from "@typespec/http";
6
+ import type { HttpOperation } from "@typespec/http";
6
7
  import { hasDefaultValue } from "../utils/parameters.jsx";
7
8
  import { getOperationOptionsTypeRefkey } from "./operation-options.jsx";
8
9
 
@@ -1,6 +1,6 @@
1
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import type { Children } from "@alloy-js/core/jsx-runtime";
2
2
  import * as ts from "@alloy-js/typescript";
3
- import { Program } from "@typespec/compiler";
3
+ import type { Program } from "@typespec/compiler";
4
4
  import { Output as EFOutput, TransformNamePolicyContext } from "@typespec/emitter-framework";
5
5
  import { ClientLibrary } from "@typespec/http-client/components";
6
6
  import { EncodingProvider } from "./encoding-provider.jsx";
@@ -1,5 +1,6 @@
1
- import { code, Refkey, refkey } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { code, refkey } from "@alloy-js/core";
3
+ import type { Children } from "@alloy-js/core/jsx-runtime";
3
4
  import * as ts from "@alloy-js/typescript";
4
5
 
5
6
  export function getEncodeUint8ArrayRef(): Refkey {
@@ -1,4 +1,5 @@
1
- import { Children, code } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
2
3
 
3
4
  export interface ClientTestOptions {}
4
5
 
@@ -1,5 +1,5 @@
1
1
  import { type Children } from "@alloy-js/core";
2
- import { EncodingDefaults } from "../../context/encoding/types.js";
2
+ import type { EncodingDefaults } from "../../context/encoding/types.js";
3
3
  import { EncodingProvider } from "../encoding-provider.jsx";
4
4
 
5
5
  export interface ContentTypeEncodingProviderProps {
@@ -1,5 +1,5 @@
1
- import { Children, Refkey } from "@alloy-js/core";
2
- import { EncodeData, ModelProperty, Scalar } from "@typespec/compiler";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import type { EncodeData, ModelProperty, Scalar } from "@typespec/compiler";
3
3
  import { useTsp } from "@typespec/emitter-framework";
4
4
  import { reportDiagnostic } from "../../lib.js";
5
5
  import { unpackProperty } from "../utils/unpack-model-property.js";
@@ -1,4 +1,5 @@
1
- import { Children, code, mapJoin } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code, mapJoin } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import type { Model } from "@typespec/compiler";
4
5
  import { useTsp } from "@typespec/emitter-framework";
@@ -1,6 +1,7 @@
1
- import { Children, code, NamePolicyContext, Refkey } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code, NamePolicyContext } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { ModelProperty } from "@typespec/compiler";
4
+ import type { ModelProperty } from "@typespec/compiler";
4
5
  import { useTsp } from "@typespec/emitter-framework";
5
6
  import { unpackProperty } from "../../utils/unpack-model-property.js";
6
7
  import { ScalarDataTransform } from "../data-transform.jsx";
@@ -1,6 +1,6 @@
1
1
  import { code, mapJoin, refkey, useNamePolicy, type Children, type Refkey } from "@alloy-js/core";
2
2
  import * as ts from "@alloy-js/typescript";
3
- import { Discriminator, Model, Union } from "@typespec/compiler";
3
+ import type { Discriminator, Model, Union } from "@typespec/compiler";
4
4
  import { useTsp } from "@typespec/emitter-framework";
5
5
  import { JsonTransform } from "./json-transform.jsx";
6
6
 
@@ -1,5 +1,6 @@
1
- import { code, Refkey } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
3
+ import type { Children } from "@alloy-js/core/jsx-runtime";
3
4
  import type { Type } from "@typespec/compiler";
4
5
  import { useTsp } from "@typespec/emitter-framework";
5
6
  import { ScalarDataTransform } from "../data-transform.jsx";
@@ -1,4 +1,5 @@
1
- import { Children, code, refkey, Refkey } from "@alloy-js/core";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code, refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import type { Union } from "@typespec/compiler";
4
5
  import { useTsp } from "@typespec/emitter-framework";
@@ -1,7 +1,7 @@
1
1
  import { code } from "@alloy-js/core";
2
- import { Children } from "@alloy-js/core/jsx-runtime";
2
+ import type { Children } from "@alloy-js/core/jsx-runtime";
3
3
  import * as ts from "@alloy-js/typescript";
4
- import { HttpOperationPart } from "@typespec/http";
4
+ import type { HttpOperationPart } from "@typespec/http";
5
5
  import { HttpPartTransform } from "./part-transform.jsx";
6
6
 
7
7
  export interface ArrayPartTransformProps {
@@ -1,6 +1,7 @@
1
- import { Children, code } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { HttpOperationPart } from "@typespec/http";
4
+ import type { HttpOperationPart } from "@typespec/http";
4
5
  import { getCreateFilePartDescriptorReference } from "../../static-helpers/multipart-helpers.jsx";
5
6
 
6
7
  export interface FilePartTransformProps {
@@ -1,6 +1,6 @@
1
1
  import { For } from "@alloy-js/core";
2
2
  import { useTransformNamePolicy, useTsp } from "@typespec/emitter-framework";
3
- import { HttpOperationMultipartBody } from "@typespec/http";
3
+ import type { HttpOperationMultipartBody } from "@typespec/http";
4
4
  import { reportDiagnostic } from "../../../lib.js";
5
5
  import { HttpPartTransform } from "./part-transform.jsx";
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { type Children } from "@alloy-js/core";
2
- import { HttpOperationPart } from "@typespec/http";
2
+ import type { HttpOperationPart } from "@typespec/http";
3
3
  import { ArrayPartTransform } from "./array-part-transform.jsx";
4
4
  import { FilePartTransform } from "./file-part-transform.jsx";
5
5
  import { SimplePartTransform } from "./simple-part-transform.jsx";
@@ -1,6 +1,7 @@
1
- import { Children, code, List } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { code, List } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { HttpOperationPart } from "@typespec/http";
4
+ import type { HttpOperationPart } from "@typespec/http";
4
5
  import { JsonTransform } from "../json/json-transform.jsx";
5
6
 
6
7
  export interface SimplePartTransformProps {
@@ -1,8 +1,9 @@
1
- import { Refkey, refkey } from "@alloy-js/core";
1
+ import type { Refkey } from "@alloy-js/core";
2
+ import { refkey } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
4
  import * as ef from "@typespec/emitter-framework/typescript";
4
- import { HttpOperationBody } from "@typespec/http";
5
- import { ClientOperation } from "@typespec/http-client";
5
+ import type { HttpOperationBody } from "@typespec/http";
6
+ import type { ClientOperation } from "@typespec/http-client";
6
7
  import { JsonTransform } from "./json/json-transform.jsx";
7
8
 
8
9
  export interface TransformDeclarationProps {
@@ -1,7 +1,8 @@
1
1
  import * as ts from "@alloy-js/typescript";
2
2
  import type { Type } from "@typespec/compiler";
3
- import { HasName, TransformNamePolicyContext, useTsp } from "@typespec/emitter-framework";
4
- import { HttpOperation } from "@typespec/http";
3
+ import type { HasName } from "@typespec/emitter-framework";
4
+ import { TransformNamePolicyContext, useTsp } from "@typespec/emitter-framework";
5
+ import type { HttpOperation } from "@typespec/http";
5
6
  import { reportDiagnostic } from "../../lib.js";
6
7
  import { ContentTypeEncodingProvider } from "./content-type-encoding-provider.jsx";
7
8
  import { JsonTransform } from "./json/json-transform.jsx";
@@ -1,5 +1,7 @@
1
- import { Children, code, Refkey } from "@alloy-js/core";
2
- import { BytesKnownEncoding, EncodeData, NoTarget, Scalar } from "@typespec/compiler";
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ import { code } from "@alloy-js/core";
3
+ import type { BytesKnownEncoding, EncodeData, Scalar } from "@typespec/compiler";
4
+ import { NoTarget } from "@typespec/compiler";
3
5
  import { useTsp } from "@typespec/emitter-framework";
4
6
  import * as ef from "@typespec/emitter-framework/typescript";
5
7
  import { useDefaultEncoding } from "../../context/encoding/encoding-context.jsx";
@@ -1,4 +1,5 @@
1
- import { isNullType, ModelProperty, Type } from "@typespec/compiler";
1
+ import type { ModelProperty, Type } from "@typespec/compiler";
2
+ import { isNullType } from "@typespec/compiler";
2
3
  import { useTsp } from "@typespec/emitter-framework";
3
4
 
4
5
  /**
@@ -1,5 +1,5 @@
1
1
  import * as ts from "@alloy-js/typescript";
2
- import { ModelProperty } from "@typespec/compiler";
2
+ import type { ModelProperty } from "@typespec/compiler";
3
3
  import { useTransformNamePolicy } from "@typespec/emitter-framework";
4
4
  import { uriTemplateLib } from "../external-packages/uri-template.js";
5
5
 
@@ -1,8 +1,9 @@
1
- import { ComponentContext, createNamedContext, useContext } from "@alloy-js/core";
1
+ import type { ComponentContext } from "@alloy-js/core";
2
+ import { createNamedContext, useContext } from "@alloy-js/core";
2
3
  import { NoTarget } from "@typespec/compiler";
3
4
  import { useTsp } from "@typespec/emitter-framework";
4
5
  import { reportDiagnostic } from "../../lib.js";
5
- import { EncodingDefaults } from "./types.js";
6
+ import type { EncodingDefaults } from "./types.js";
6
7
 
7
8
  export const EncodingContext: ComponentContext<EncodingDefaults> =
8
9
  createNamedContext<EncodingDefaults>("Encoding");
package/src/emitter.tsx CHANGED
@@ -1,6 +1,7 @@
1
- import { Children, SourceDirectory } from "@alloy-js/core";
1
+ import type { Children } from "@alloy-js/core";
2
+ import { SourceDirectory } from "@alloy-js/core";
2
3
  import * as ts from "@alloy-js/typescript";
3
- import { EmitContext } from "@typespec/compiler";
4
+ import type { EmitContext } from "@typespec/compiler";
4
5
  import {
5
6
  Experimental_ComponentOverrides,
6
7
  Experimental_ComponentOverridesConfig,
@@ -17,7 +18,7 @@ import { Interfaces } from "./components/static-helpers/interfaces.jsx";
17
18
  import { MultipartHelpers } from "./components/static-helpers/multipart-helpers.jsx";
18
19
  import { PagingHelpers } from "./components/static-helpers/paging-helper.jsx";
19
20
  import { RestError } from "./components/static-helpers/rest-error.jsx";
20
- import { JsClientEmitterOptions } from "./lib.js";
21
+ import type { JsClientEmitterOptions } from "./lib.js";
21
22
 
22
23
  /**
23
24
  * Main function to handle the emission process.
package/src/lib.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { createTypeSpecLibrary, JSONSchemaType } from "@typespec/compiler";
1
+ import type { JSONSchemaType } from "@typespec/compiler";
2
+ import { createTypeSpecLibrary } from "@typespec/compiler";
2
3
 
3
4
  export interface JsClientEmitterOptions {
4
5
  "package-name"?: string;
@@ -1,5 +1,6 @@
1
1
  import { resolvePath } from "@typespec/compiler";
2
- import { createTestLibrary, TypeSpecTestLibrary } from "@typespec/compiler/testing";
2
+ import type { TypeSpecTestLibrary } from "@typespec/compiler/testing";
3
+ import { createTestLibrary } from "@typespec/compiler/testing";
3
4
  import { fileURLToPath } from "url";
4
5
 
5
6
  /** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */