@typespec/mutator-framework 0.12.0

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 (221) hide show
  1. package/LICENSE +21 -0
  2. package/dist/src/index.d.ts +3 -0
  3. package/dist/src/index.d.ts.map +1 -0
  4. package/dist/src/index.js +4 -0
  5. package/dist/src/index.js.map +1 -0
  6. package/dist/src/mutation/index.d.ts +13 -0
  7. package/dist/src/mutation/index.d.ts.map +1 -0
  8. package/dist/src/mutation/index.js +13 -0
  9. package/dist/src/mutation/index.js.map +1 -0
  10. package/dist/src/mutation/interface.d.ts +11 -0
  11. package/dist/src/mutation/interface.d.ts.map +1 -0
  12. package/dist/src/mutation/interface.js +17 -0
  13. package/dist/src/mutation/interface.js.map +1 -0
  14. package/dist/src/mutation/intrinsic.d.ts +9 -0
  15. package/dist/src/mutation/intrinsic.d.ts.map +1 -0
  16. package/dist/src/mutation/intrinsic.js +11 -0
  17. package/dist/src/mutation/intrinsic.js.map +1 -0
  18. package/dist/src/mutation/literal.d.ts +9 -0
  19. package/dist/src/mutation/literal.d.ts.map +1 -0
  20. package/dist/src/mutation/literal.js +11 -0
  21. package/dist/src/mutation/literal.js.map +1 -0
  22. package/dist/src/mutation/model-property.d.ts +12 -0
  23. package/dist/src/mutation/model-property.d.ts.map +1 -0
  24. package/dist/src/mutation/model-property.js +18 -0
  25. package/dist/src/mutation/model-property.js.map +1 -0
  26. package/dist/src/mutation/model.d.ts +18 -0
  27. package/dist/src/mutation/model.d.ts.map +1 -0
  28. package/dist/src/mutation/model.js +34 -0
  29. package/dist/src/mutation/model.js.map +1 -0
  30. package/dist/src/mutation/mutation-engine.d.ts +80 -0
  31. package/dist/src/mutation/mutation-engine.d.ts.map +1 -0
  32. package/dist/src/mutation/mutation-engine.js +165 -0
  33. package/dist/src/mutation/mutation-engine.js.map +1 -0
  34. package/dist/src/mutation/mutation-engine.test.d.ts +2 -0
  35. package/dist/src/mutation/mutation-engine.test.d.ts.map +1 -0
  36. package/dist/src/mutation/mutation-engine.test.js +145 -0
  37. package/dist/src/mutation/mutation-engine.test.js.map +1 -0
  38. package/dist/src/mutation/mutation.d.ts +45 -0
  39. package/dist/src/mutation/mutation.d.ts.map +1 -0
  40. package/dist/src/mutation/mutation.js +29 -0
  41. package/dist/src/mutation/mutation.js.map +1 -0
  42. package/dist/src/mutation/operation.d.ts +13 -0
  43. package/dist/src/mutation/operation.d.ts.map +1 -0
  44. package/dist/src/mutation/operation.js +20 -0
  45. package/dist/src/mutation/operation.js.map +1 -0
  46. package/dist/src/mutation/scalar.d.ts +11 -0
  47. package/dist/src/mutation/scalar.d.ts.map +1 -0
  48. package/dist/src/mutation/scalar.js +17 -0
  49. package/dist/src/mutation/scalar.js.map +1 -0
  50. package/dist/src/mutation/simple-mutation-engine.d.ts +8 -0
  51. package/dist/src/mutation/simple-mutation-engine.d.ts.map +1 -0
  52. package/dist/src/mutation/simple-mutation-engine.js +11 -0
  53. package/dist/src/mutation/simple-mutation-engine.js.map +1 -0
  54. package/dist/src/mutation/union-variant.d.ts +10 -0
  55. package/dist/src/mutation/union-variant.d.ts.map +1 -0
  56. package/dist/src/mutation/union-variant.js +12 -0
  57. package/dist/src/mutation/union-variant.js.map +1 -0
  58. package/dist/src/mutation/union.d.ts +11 -0
  59. package/dist/src/mutation/union.d.ts.map +1 -0
  60. package/dist/src/mutation/union.js +18 -0
  61. package/dist/src/mutation/union.js.map +1 -0
  62. package/dist/src/mutation-node/enum-member.d.ts +7 -0
  63. package/dist/src/mutation-node/enum-member.d.ts.map +1 -0
  64. package/dist/src/mutation-node/enum-member.js +6 -0
  65. package/dist/src/mutation-node/enum-member.js.map +1 -0
  66. package/dist/src/mutation-node/enum-member.test.d.ts +2 -0
  67. package/dist/src/mutation-node/enum-member.test.d.ts.map +1 -0
  68. package/dist/src/mutation-node/enum-member.test.js +25 -0
  69. package/dist/src/mutation-node/enum-member.test.js.map +1 -0
  70. package/dist/src/mutation-node/enum.d.ts +8 -0
  71. package/dist/src/mutation-node/enum.d.ts.map +1 -0
  72. package/dist/src/mutation-node/enum.js +30 -0
  73. package/dist/src/mutation-node/enum.js.map +1 -0
  74. package/dist/src/mutation-node/enum.test.d.ts +2 -0
  75. package/dist/src/mutation-node/enum.test.d.ts.map +1 -0
  76. package/dist/src/mutation-node/enum.test.js +25 -0
  77. package/dist/src/mutation-node/enum.test.js.map +1 -0
  78. package/dist/src/mutation-node/factory.d.ts +17 -0
  79. package/dist/src/mutation-node/factory.d.ts.map +1 -0
  80. package/dist/src/mutation-node/factory.js +45 -0
  81. package/dist/src/mutation-node/factory.js.map +1 -0
  82. package/dist/src/mutation-node/index.d.ts +15 -0
  83. package/dist/src/mutation-node/index.d.ts.map +1 -0
  84. package/dist/src/mutation-node/index.js +16 -0
  85. package/dist/src/mutation-node/index.js.map +1 -0
  86. package/dist/src/mutation-node/interface.d.ts +8 -0
  87. package/dist/src/mutation-node/interface.d.ts.map +1 -0
  88. package/dist/src/mutation-node/interface.js +30 -0
  89. package/dist/src/mutation-node/interface.js.map +1 -0
  90. package/dist/src/mutation-node/intrinsic.d.ts +7 -0
  91. package/dist/src/mutation-node/intrinsic.d.ts.map +1 -0
  92. package/dist/src/mutation-node/intrinsic.js +6 -0
  93. package/dist/src/mutation-node/intrinsic.js.map +1 -0
  94. package/dist/src/mutation-node/literal.d.ts +7 -0
  95. package/dist/src/mutation-node/literal.d.ts.map +1 -0
  96. package/dist/src/mutation-node/literal.js +6 -0
  97. package/dist/src/mutation-node/literal.js.map +1 -0
  98. package/dist/src/mutation-node/model-property.d.ts +10 -0
  99. package/dist/src/mutation-node/model-property.d.ts.map +1 -0
  100. package/dist/src/mutation-node/model-property.js +48 -0
  101. package/dist/src/mutation-node/model-property.js.map +1 -0
  102. package/dist/src/mutation-node/model-property.test.d.ts +2 -0
  103. package/dist/src/mutation-node/model-property.test.d.ts.map +1 -0
  104. package/dist/src/mutation-node/model-property.test.js +108 -0
  105. package/dist/src/mutation-node/model-property.test.js.map +1 -0
  106. package/dist/src/mutation-node/model.d.ts +10 -0
  107. package/dist/src/mutation-node/model.d.ts.map +1 -0
  108. package/dist/src/mutation-node/model.js +82 -0
  109. package/dist/src/mutation-node/model.js.map +1 -0
  110. package/dist/src/mutation-node/model.test.d.ts +2 -0
  111. package/dist/src/mutation-node/model.test.d.ts.map +1 -0
  112. package/dist/src/mutation-node/model.test.js +133 -0
  113. package/dist/src/mutation-node/model.test.js.map +1 -0
  114. package/dist/src/mutation-node/mutation-edge.d.ts +18 -0
  115. package/dist/src/mutation-node/mutation-edge.d.ts.map +1 -0
  116. package/dist/src/mutation-node/mutation-edge.js +31 -0
  117. package/dist/src/mutation-node/mutation-edge.js.map +1 -0
  118. package/dist/src/mutation-node/mutation-node.d.ts +29 -0
  119. package/dist/src/mutation-node/mutation-node.d.ts.map +1 -0
  120. package/dist/src/mutation-node/mutation-node.js +82 -0
  121. package/dist/src/mutation-node/mutation-node.js.map +1 -0
  122. package/dist/src/mutation-node/mutation-node.test.d.ts +2 -0
  123. package/dist/src/mutation-node/mutation-node.test.d.ts.map +1 -0
  124. package/dist/src/mutation-node/mutation-node.test.js +88 -0
  125. package/dist/src/mutation-node/mutation-node.test.js.map +1 -0
  126. package/dist/src/mutation-node/mutation-subgraph.d.ts +17 -0
  127. package/dist/src/mutation-node/mutation-subgraph.d.ts.map +1 -0
  128. package/dist/src/mutation-node/mutation-subgraph.js +45 -0
  129. package/dist/src/mutation-node/mutation-subgraph.js.map +1 -0
  130. package/dist/src/mutation-node/operation.d.ts +9 -0
  131. package/dist/src/mutation-node/operation.d.ts.map +1 -0
  132. package/dist/src/mutation-node/operation.js +44 -0
  133. package/dist/src/mutation-node/operation.js.map +1 -0
  134. package/dist/src/mutation-node/scalar.d.ts +8 -0
  135. package/dist/src/mutation-node/scalar.d.ts.map +1 -0
  136. package/dist/src/mutation-node/scalar.js +28 -0
  137. package/dist/src/mutation-node/scalar.js.map +1 -0
  138. package/dist/src/mutation-node/scalar.test.d.ts +2 -0
  139. package/dist/src/mutation-node/scalar.test.d.ts.map +1 -0
  140. package/dist/src/mutation-node/scalar.test.js +40 -0
  141. package/dist/src/mutation-node/scalar.test.js.map +1 -0
  142. package/dist/src/mutation-node/tuple.d.ts +9 -0
  143. package/dist/src/mutation-node/tuple.d.ts.map +1 -0
  144. package/dist/src/mutation-node/tuple.js +32 -0
  145. package/dist/src/mutation-node/tuple.js.map +1 -0
  146. package/dist/src/mutation-node/tuple.test.d.ts +2 -0
  147. package/dist/src/mutation-node/tuple.test.d.ts.map +1 -0
  148. package/dist/src/mutation-node/tuple.test.js +29 -0
  149. package/dist/src/mutation-node/tuple.test.js.map +1 -0
  150. package/dist/src/mutation-node/union-variant.d.ts +8 -0
  151. package/dist/src/mutation-node/union-variant.d.ts.map +1 -0
  152. package/dist/src/mutation-node/union-variant.js +23 -0
  153. package/dist/src/mutation-node/union-variant.js.map +1 -0
  154. package/dist/src/mutation-node/union-variant.test.d.ts +2 -0
  155. package/dist/src/mutation-node/union-variant.test.d.ts.map +1 -0
  156. package/dist/src/mutation-node/union-variant.test.js +27 -0
  157. package/dist/src/mutation-node/union-variant.test.js.map +1 -0
  158. package/dist/src/mutation-node/union.d.ts +8 -0
  159. package/dist/src/mutation-node/union.d.ts.map +1 -0
  160. package/dist/src/mutation-node/union.js +30 -0
  161. package/dist/src/mutation-node/union.js.map +1 -0
  162. package/dist/src/mutation-node/union.test.d.ts +2 -0
  163. package/dist/src/mutation-node/union.test.d.ts.map +1 -0
  164. package/dist/src/mutation-node/union.test.js +25 -0
  165. package/dist/src/mutation-node/union.test.js.map +1 -0
  166. package/dist/test/test-host.d.ts +2 -0
  167. package/dist/test/test-host.d.ts.map +1 -0
  168. package/dist/test/test-host.js +6 -0
  169. package/dist/test/test-host.js.map +1 -0
  170. package/dist/test/utils.d.ts +4 -0
  171. package/dist/test/utils.d.ts.map +1 -0
  172. package/dist/test/utils.js +8 -0
  173. package/dist/test/utils.js.map +1 -0
  174. package/package.json +40 -0
  175. package/package.json.bak +42 -0
  176. package/readme.md +339 -0
  177. package/src/index.ts +4 -0
  178. package/src/mutation/index.ts +12 -0
  179. package/src/mutation/interface.ts +38 -0
  180. package/src/mutation/intrinsic.ts +23 -0
  181. package/src/mutation/literal.ts +29 -0
  182. package/src/mutation/model-property.ts +35 -0
  183. package/src/mutation/model.ts +58 -0
  184. package/src/mutation/mutation-engine.test.ts +202 -0
  185. package/src/mutation/mutation-engine.ts +288 -0
  186. package/src/mutation/mutation.ts +90 -0
  187. package/src/mutation/operation.ts +40 -0
  188. package/src/mutation/scalar.ts +36 -0
  189. package/src/mutation/simple-mutation-engine.ts +21 -0
  190. package/src/mutation/union-variant.ts +30 -0
  191. package/src/mutation/union.ts +39 -0
  192. package/src/mutation-node/enum-member.test.ts +26 -0
  193. package/src/mutation-node/enum-member.ts +8 -0
  194. package/src/mutation-node/enum.test.ts +26 -0
  195. package/src/mutation-node/enum.ts +33 -0
  196. package/src/mutation-node/factory.ts +95 -0
  197. package/src/mutation-node/index.ts +16 -0
  198. package/src/mutation-node/interface.ts +33 -0
  199. package/src/mutation-node/intrinsic.ts +8 -0
  200. package/src/mutation-node/literal.ts +10 -0
  201. package/src/mutation-node/model-property.test.ts +136 -0
  202. package/src/mutation-node/model-property.ts +53 -0
  203. package/src/mutation-node/model.test.ts +151 -0
  204. package/src/mutation-node/model.ts +89 -0
  205. package/src/mutation-node/mutation-edge.ts +43 -0
  206. package/src/mutation-node/mutation-node.test.ts +94 -0
  207. package/src/mutation-node/mutation-node.ts +110 -0
  208. package/src/mutation-node/mutation-subgraph.ts +59 -0
  209. package/src/mutation-node/operation.ts +49 -0
  210. package/src/mutation-node/scalar.test.ts +44 -0
  211. package/src/mutation-node/scalar.ts +32 -0
  212. package/src/mutation-node/tuple.test.ts +30 -0
  213. package/src/mutation-node/tuple.ts +35 -0
  214. package/src/mutation-node/union-variant.test.ts +28 -0
  215. package/src/mutation-node/union-variant.ts +26 -0
  216. package/src/mutation-node/union.test.ts +26 -0
  217. package/src/mutation-node/union.ts +33 -0
  218. package/test/test-host.ts +6 -0
  219. package/test/utils.ts +9 -0
  220. package/tsconfig.json +19 -0
  221. package/vitest.config.ts +4 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
@@ -0,0 +1,3 @@
1
+ export * from "./mutation/index.js";
2
+ export * from "./mutation-node/index.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAGpC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./mutation/index.js";
2
+ // this ordering is important to avoid circular reference errors.
3
+ export * from "./mutation-node/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAEpC,iEAAiE;AACjE,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from "./interface.js";
2
+ export * from "./intrinsic.js";
3
+ export * from "./literal.js";
4
+ export * from "./model-property.js";
5
+ export * from "./model.js";
6
+ export * from "./mutation-engine.js";
7
+ export * from "./mutation.js";
8
+ export * from "./operation.js";
9
+ export * from "./scalar.js";
10
+ export * from "./simple-mutation-engine.js";
11
+ export * from "./union-variant.js";
12
+ export * from "./union.js";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mutation/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from "./interface.js";
2
+ export * from "./intrinsic.js";
3
+ export * from "./literal.js";
4
+ export * from "./model-property.js";
5
+ export * from "./model.js";
6
+ export * from "./mutation-engine.js";
7
+ export * from "./mutation.js";
8
+ export * from "./operation.js";
9
+ export * from "./scalar.js";
10
+ export * from "./simple-mutation-engine.js";
11
+ export * from "./union-variant.js";
12
+ export * from "./union.js";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mutation/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Interface, MemberType } from "@typespec/compiler";
2
+ import type { CustomMutationClasses, MutationEngine, MutationFor, MutationOptions } from "./mutation-engine.js";
3
+ import { Mutation } from "./mutation.js";
4
+ export declare class InterfaceMutation<TOptions extends MutationOptions, TCustomMutations extends CustomMutationClasses> extends Mutation<Interface, TCustomMutations, TOptions> {
5
+ readonly kind = "Interface";
6
+ operations: Map<string, MutationFor<TCustomMutations, "Operation">>;
7
+ constructor(engine: MutationEngine<TCustomMutations>, sourceType: Interface, referenceTypes: MemberType[] | undefined, options: TOptions);
8
+ protected mutateOperations(): void;
9
+ mutate(): void;
10
+ }
11
+ //# sourceMappingURL=interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/mutation/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,iBAAiB,CAC5B,QAAQ,SAAS,eAAe,EAChC,gBAAgB,SAAS,qBAAqB,CAC9C,SAAQ,QAAQ,CAAC,SAAS,EAAE,gBAAgB,EAAE,QAAQ,CAAC;IACvD,QAAQ,CAAC,IAAI,eAAe;IAC5B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAa;gBAG9E,MAAM,EAAE,cAAc,CAAC,gBAAgB,CAAC,EACxC,UAAU,EAAE,SAAS,EACrB,cAAc,EAAE,UAAU,EAAE,YAAK,EACjC,OAAO,EAAE,QAAQ;IAKnB,SAAS,CAAC,gBAAgB;IAS1B,MAAM;CAGP"}
@@ -0,0 +1,17 @@
1
+ import { Mutation } from "./mutation.js";
2
+ export class InterfaceMutation extends Mutation {
3
+ kind = "Interface";
4
+ operations = new Map();
5
+ constructor(engine, sourceType, referenceTypes = [], options) {
6
+ super(engine, sourceType, referenceTypes, options);
7
+ }
8
+ mutateOperations() {
9
+ for (const op of this.sourceType.operations.values()) {
10
+ this.operations.set(op.name, this.engine.mutate(op, this.options));
11
+ }
12
+ }
13
+ mutate() {
14
+ this.mutateOperations();
15
+ }
16
+ }
17
+ //# sourceMappingURL=interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/mutation/interface.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,OAAO,iBAGX,SAAQ,QAA+C;IAC9C,IAAI,GAAG,WAAW,CAAC;IAC5B,UAAU,GAA4D,IAAI,GAAG,EAAE,CAAC;IAEhF,YACE,MAAwC,EACxC,UAAqB,EACrB,iBAA+B,EAAE,EACjC,OAAiB;QAEjB,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAES,gBAAgB;QACxB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC;YACrD,IAAI,CAAC,UAAU,CAAC,GAAG,CACjB,EAAE,CAAC,IAAI,EACP,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAA+C,CACnF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ import type { IntrinsicType, MemberType } from "@typespec/compiler";
2
+ import type { CustomMutationClasses, MutationEngine, MutationOptions } from "./mutation-engine.js";
3
+ import { Mutation } from "./mutation.js";
4
+ export declare class IntrinsicMutation<TOptions extends MutationOptions, TCustomMutations extends CustomMutationClasses, TEngine extends MutationEngine<TCustomMutations> = MutationEngine<TCustomMutations>> extends Mutation<IntrinsicType, TCustomMutations, TOptions, TEngine> {
5
+ readonly kind = "Intrinsic";
6
+ constructor(engine: TEngine, sourceType: IntrinsicType, referenceTypes: MemberType[] | undefined, options: TOptions);
7
+ mutate(): void;
8
+ }
9
+ //# sourceMappingURL=intrinsic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intrinsic.d.ts","sourceRoot":"","sources":["../../../src/mutation/intrinsic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,iBAAiB,CAC5B,QAAQ,SAAS,eAAe,EAChC,gBAAgB,SAAS,qBAAqB,EAC9C,OAAO,SAAS,cAAc,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC,gBAAgB,CAAC,CACnF,SAAQ,QAAQ,CAAC,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC;IACpE,QAAQ,CAAC,IAAI,eAAe;gBAE1B,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,aAAa,EACzB,cAAc,EAAE,UAAU,EAAE,YAAK,EACjC,OAAO,EAAE,QAAQ;IAKnB,MAAM;CAGP"}
@@ -0,0 +1,11 @@
1
+ import { Mutation } from "./mutation.js";
2
+ export class IntrinsicMutation extends Mutation {
3
+ kind = "Intrinsic";
4
+ constructor(engine, sourceType, referenceTypes = [], options) {
5
+ super(engine, sourceType, referenceTypes, options);
6
+ }
7
+ mutate() {
8
+ // No mutations needed for intrinsic types
9
+ }
10
+ }
11
+ //# sourceMappingURL=intrinsic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intrinsic.js","sourceRoot":"","sources":["../../../src/mutation/intrinsic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,OAAO,iBAIX,SAAQ,QAA4D;IAC3D,IAAI,GAAG,WAAW,CAAC;IAC5B,YACE,MAAe,EACf,UAAyB,EACzB,iBAA+B,EAAE,EACjC,OAAiB;QAEjB,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,MAAM;QACJ,0CAA0C;IAC5C,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ import type { BooleanLiteral, MemberType, NumericLiteral, StringLiteral } from "@typespec/compiler";
2
+ import type { CustomMutationClasses, MutationEngine, MutationOptions } from "./mutation-engine.js";
3
+ import { Mutation } from "./mutation.js";
4
+ export declare class LiteralMutation<TOptions extends MutationOptions, TCustomMutations extends CustomMutationClasses, TEngine extends MutationEngine<TCustomMutations> = MutationEngine<TCustomMutations>> extends Mutation<StringLiteral | NumericLiteral | BooleanLiteral, TCustomMutations, TOptions, TEngine> {
5
+ readonly kind = "Literal";
6
+ constructor(engine: TEngine, sourceType: StringLiteral | NumericLiteral | BooleanLiteral, referenceTypes: MemberType[] | undefined, options: TOptions);
7
+ mutate(): void;
8
+ }
9
+ //# sourceMappingURL=literal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../../../src/mutation/literal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,eAAe,CAC1B,QAAQ,SAAS,eAAe,EAChC,gBAAgB,SAAS,qBAAqB,EAC9C,OAAO,SAAS,cAAc,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC,gBAAgB,CAAC,CACnF,SAAQ,QAAQ,CAChB,aAAa,GAAG,cAAc,GAAG,cAAc,EAC/C,gBAAgB,EAChB,QAAQ,EACR,OAAO,CACR;IACC,QAAQ,CAAC,IAAI,aAAa;gBAGxB,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,aAAa,GAAG,cAAc,GAAG,cAAc,EAC3D,cAAc,EAAE,UAAU,EAAE,YAAK,EACjC,OAAO,EAAE,QAAQ;IAKnB,MAAM;CAGP"}
@@ -0,0 +1,11 @@
1
+ import { Mutation } from "./mutation.js";
2
+ export class LiteralMutation extends Mutation {
3
+ kind = "Literal";
4
+ constructor(engine, sourceType, referenceTypes = [], options) {
5
+ super(engine, sourceType, referenceTypes, options);
6
+ }
7
+ mutate() {
8
+ // No mutations needed for literal types
9
+ }
10
+ }
11
+ //# sourceMappingURL=literal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literal.js","sourceRoot":"","sources":["../../../src/mutation/literal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,OAAO,eAIX,SAAQ,QAKT;IACU,IAAI,GAAG,SAAS,CAAC;IAE1B,YACE,MAAe,EACf,UAA2D,EAC3D,iBAA+B,EAAE,EACjC,OAAiB;QAEjB,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,MAAM;QACJ,wCAAwC;IAC1C,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import type { ModelProperty, Type } from "@typespec/compiler";
2
+ import type { MutationSubgraph } from "../mutation-node/mutation-subgraph.js";
3
+ import type { CustomMutationClasses, MutationEngine, MutationFor, MutationOptions } from "./mutation-engine.js";
4
+ import { Mutation } from "./mutation.js";
5
+ export declare class ModelPropertyMutation<TOptions extends MutationOptions, TCustomMutations extends CustomMutationClasses, TEngine extends MutationEngine<TCustomMutations> = MutationEngine<TCustomMutations>> extends Mutation<ModelProperty, TCustomMutations, TOptions, TEngine> {
6
+ readonly kind = "ModelProperty";
7
+ type: MutationFor<TCustomMutations, Type["kind"]>;
8
+ mutate(): void;
9
+ getReferenceMutationNode(subgraph?: MutationSubgraph): import("../index.js").MutationNode<Type>;
10
+ replaceReferencedType(subgraph: MutationSubgraph, newType: Type): MutationFor<TCustomMutations, "Boolean" | "Number" | "String" | "Decorator" | "Intrinsic" | "FunctionParameter" | "Namespace" | "ScalarConstructor" | "StringTemplate" | "StringTemplateSpan" | "TemplateParameter" | "EnumMember" | "Enum" | "Interface" | "UnionVariant" | "ModelProperty" | "Model" | "Operation" | "Scalar" | "Tuple" | "Union">;
11
+ }
12
+ //# sourceMappingURL=model-property.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-property.d.ts","sourceRoot":"","sources":["../../../src/mutation/model-property.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,qBAAqB,CAChC,QAAQ,SAAS,eAAe,EAChC,gBAAgB,SAAS,qBAAqB,EAC9C,OAAO,SAAS,cAAc,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC,gBAAgB,CAAC,CACnF,SAAQ,QAAQ,CAAC,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC;IACpE,QAAQ,CAAC,IAAI,mBAAmB;IAChC,IAAI,EAAG,WAAW,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnD,MAAM;IAIN,wBAAwB,CACtB,QAAQ,GAAE,gBAAuE;IAKnF,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,IAAI;CAMhE"}
@@ -0,0 +1,18 @@
1
+ import { Mutation } from "./mutation.js";
2
+ export class ModelPropertyMutation extends Mutation {
3
+ kind = "ModelProperty";
4
+ type;
5
+ mutate() {
6
+ this.type = this.engine.mutateReference(this.sourceType, this.options);
7
+ }
8
+ getReferenceMutationNode(subgraph = this.engine.getDefaultMutationSubgraph(this.options)) {
9
+ return subgraph.getReferenceNode(this.sourceType);
10
+ }
11
+ replaceReferencedType(subgraph, newType) {
12
+ // First, update the mutation node
13
+ subgraph.getReferenceNode(this.sourceType).replace(newType);
14
+ // then return a new reference mutation for the new type
15
+ return this.engine.mutateReference(this.sourceType, newType, this.options);
16
+ }
17
+ }
18
+ //# sourceMappingURL=model-property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-property.js","sourceRoot":"","sources":["../../../src/mutation/model-property.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,OAAO,qBAIX,SAAQ,QAA4D;IAC3D,IAAI,GAAG,eAAe,CAAC;IAChC,IAAI,CAA+C;IAEnD,MAAM;QACJ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACzE,CAAC;IAED,wBAAwB,CACtB,WAA6B,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC;QAEjF,OAAO,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpD,CAAC;IAED,qBAAqB,CAAC,QAA0B,EAAE,OAAa;QAC7D,kCAAkC;QAClC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5D,wDAAwD;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7E,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ import type { MemberType, Model, Type } from "@typespec/compiler";
2
+ import type { CustomMutationClasses, MutationEngine, MutationFor, MutationOptions } from "./mutation-engine.js";
3
+ import { Mutation } from "./mutation.js";
4
+ export declare class ModelMutation<TOptions extends MutationOptions, TCustomMutations extends CustomMutationClasses, TEngine extends MutationEngine<TCustomMutations> = MutationEngine<TCustomMutations>> extends Mutation<Model, TCustomMutations, TOptions, TEngine> {
5
+ readonly kind = "Model";
6
+ baseModel?: MutationFor<TCustomMutations, "Model">;
7
+ properties: Map<string, MutationFor<TCustomMutations, "ModelProperty">>;
8
+ indexer?: {
9
+ key: MutationFor<TCustomMutations, "Scalar">;
10
+ value: MutationFor<TCustomMutations, Type["kind"]>;
11
+ };
12
+ constructor(engine: TEngine, sourceType: Model, referenceTypes: MemberType[] | undefined, options: TOptions);
13
+ protected mutateBaseModel(): void;
14
+ protected mutateProperties(): void;
15
+ protected mutateIndexer(): void;
16
+ mutate(): void;
17
+ }
18
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/mutation/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,aAAa,CACxB,QAAQ,SAAS,eAAe,EAChC,gBAAgB,SAAS,qBAAqB,EAC9C,OAAO,SAAS,cAAc,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC,gBAAgB,CAAC,CACnF,SAAQ,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC;IAC5D,QAAQ,CAAC,IAAI,WAAW;IACxB,SAAS,CAAC,EAAE,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACnD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAa;IACpF,OAAO,CAAC,EAAE;QACR,GAAG,EAAE,WAAW,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAC7C,KAAK,EAAE,WAAW,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;KACpD,CAAC;gBAGA,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,KAAK,EACjB,cAAc,EAAE,UAAU,EAAE,YAAK,EACjC,OAAO,EAAE,QAAQ;IAKnB,SAAS,CAAC,eAAe;IAMzB,SAAS,CAAC,gBAAgB;IAM1B,SAAS,CAAC,aAAa;IASvB,MAAM;CAKP"}
@@ -0,0 +1,34 @@
1
+ import { Mutation } from "./mutation.js";
2
+ export class ModelMutation extends Mutation {
3
+ kind = "Model";
4
+ baseModel;
5
+ properties = new Map();
6
+ indexer;
7
+ constructor(engine, sourceType, referenceTypes = [], options) {
8
+ super(engine, sourceType, referenceTypes, options);
9
+ }
10
+ mutateBaseModel() {
11
+ if (this.sourceType.baseModel) {
12
+ this.baseModel = this.engine.mutate(this.sourceType.baseModel, this.options);
13
+ }
14
+ }
15
+ mutateProperties() {
16
+ for (const prop of this.sourceType.properties.values()) {
17
+ this.properties.set(prop.name, this.engine.mutate(prop, this.options));
18
+ }
19
+ }
20
+ mutateIndexer() {
21
+ if (this.sourceType.indexer) {
22
+ this.indexer = {
23
+ key: this.engine.mutate(this.sourceType.indexer.key, this.options),
24
+ value: this.engine.mutate(this.sourceType.indexer.value, this.options),
25
+ };
26
+ }
27
+ }
28
+ mutate() {
29
+ this.mutateBaseModel();
30
+ this.mutateProperties();
31
+ this.mutateIndexer();
32
+ }
33
+ }
34
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/mutation/model.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,OAAO,aAIX,SAAQ,QAAoD;IACnD,IAAI,GAAG,OAAO,CAAC;IACxB,SAAS,CAA0C;IACnD,UAAU,GAAgE,IAAI,GAAG,EAAE,CAAC;IACpF,OAAO,CAGL;IAEF,YACE,MAAe,EACf,UAAiB,EACjB,iBAA+B,EAAE,EACjC,OAAiB;QAEjB,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAES,eAAe;QACvB,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;YAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;IAES,gBAAgB;QACxB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC;YACvD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAES,aAAa;QACrB,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,OAAO,GAAG;gBACb,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC;gBAClE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;aACvE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,80 @@
1
+ import type { MemberType, Type } from "@typespec/compiler";
2
+ import type { Typekit } from "@typespec/compiler/typekit";
3
+ import type { MutationNodeForType } from "../mutation-node/factory.js";
4
+ import { MutationSubgraph } from "../mutation-node/mutation-subgraph.js";
5
+ import { InterfaceMutation } from "./interface.js";
6
+ import { IntrinsicMutation } from "./intrinsic.js";
7
+ import { LiteralMutation } from "./literal.js";
8
+ import { ModelPropertyMutation } from "./model-property.js";
9
+ import { ModelMutation } from "./model.js";
10
+ import { Mutation } from "./mutation.js";
11
+ import { OperationMutation } from "./operation.js";
12
+ import { ScalarMutation } from "./scalar.js";
13
+ import { UnionVariantMutation } from "./union-variant.js";
14
+ import { UnionMutation } from "./union.js";
15
+ export type MutationRegistry = Record<Type["kind"], Mutation<Type, any, any>>;
16
+ export interface DefaultMutationClasses<TCustomMutations extends CustomMutationClasses> extends MutationRegistry {
17
+ Operation: OperationMutation<MutationOptions, TCustomMutations>;
18
+ Interface: InterfaceMutation<MutationOptions, TCustomMutations>;
19
+ Model: ModelMutation<MutationOptions, TCustomMutations>;
20
+ Scalar: ScalarMutation<MutationOptions, TCustomMutations>;
21
+ ModelProperty: ModelPropertyMutation<MutationOptions, TCustomMutations>;
22
+ Union: UnionMutation<MutationOptions, TCustomMutations>;
23
+ UnionVariant: UnionVariantMutation<MutationOptions, TCustomMutations>;
24
+ String: LiteralMutation<MutationOptions, TCustomMutations>;
25
+ Number: LiteralMutation<MutationOptions, TCustomMutations>;
26
+ Boolean: LiteralMutation<MutationOptions, TCustomMutations>;
27
+ Intrinsic: IntrinsicMutation<MutationOptions, TCustomMutations>;
28
+ }
29
+ export type CustomMutationClasses = Partial<MutationRegistry>;
30
+ export type WithDefaultMutations<TCustomMutationClasses extends CustomMutationClasses> = TCustomMutationClasses & DefaultMutationClasses<TCustomMutationClasses>;
31
+ export type MutationFor<TCustomMutations extends CustomMutationClasses, TKind extends Type["kind"] = Type["kind"]> = WithDefaultMutations<TCustomMutations>[TKind];
32
+ export type Constructor<T = object> = new (...args: any[]) => T;
33
+ export type ConstructorsFor<T> = {
34
+ [K in keyof T]: Constructor<T[K]>;
35
+ };
36
+ export type InstancesFor<T extends Record<string, new (...args: any[]) => any>> = {
37
+ [K in keyof T]: InstanceType<T[K]>;
38
+ };
39
+ export declare class MutationEngine<TCustomMutations extends CustomMutationClasses> {
40
+ #private;
41
+ $: Typekit;
42
+ constructor($: Typekit, mutatorClasses: ConstructorsFor<TCustomMutations>);
43
+ protected registerSubgraph(name: string): void;
44
+ protected getMutationSubgraph(options: MutationOptions, name?: string): MutationSubgraph;
45
+ getDefaultMutationSubgraph(options?: MutationOptions): MutationSubgraph;
46
+ /**
47
+ * Retrieve the mutated type from the default mutation subgraph for the given options.
48
+ */
49
+ getMutatedType<T extends Type>(options: MutationOptions, sourceType: T): T;
50
+ /**
51
+ * Retrieve the mutated type from a specific mutation subgraph.
52
+ */
53
+ getMutatedType<T extends Type>(subgraph: MutationSubgraph, sourceType: T): T;
54
+ /**
55
+ * Retrieve the mutated type from either the default subgraph with the given
56
+ * options or a specific subgraph.
57
+ */
58
+ getMutatedType<T extends Type>(subgraphOrOptions: MutationOptions | MutationSubgraph, sourceType: T): T;
59
+ /**
60
+ * Get (and potentially create) the mutation node for the provided type in the default subgraph.
61
+ */
62
+ getMutationNode<T extends Type>(options: MutationOptions, type: T): MutationNodeForType<T>;
63
+ /**
64
+ * Get (and potentially create) the mutation node for the provided type in a specific subgraph.
65
+ */
66
+ getMutationNode<T extends Type>(subgraph: MutationSubgraph, type: T): MutationNodeForType<T>;
67
+ /**
68
+ * Get (and potentially create) the mutation node for the provided type in
69
+ * either the default subgraph with the given options or a specific subgraph.
70
+ */
71
+ getMutationNode<T extends Type>(subgraphOrOptions: MutationOptions | MutationSubgraph, type: T): MutationNodeForType<T>;
72
+ mutateType<T extends Type>(subgraphOrOptions: MutationOptions | MutationSubgraph, type: T, initializeMutation: (type: T) => void): void;
73
+ mutate<TType extends Type>(type: TType, options?: MutationOptions): MutationFor<TCustomMutations, TType["kind"]>;
74
+ mutateReference<TType extends MemberType>(memberType: TType, referencedMutationNode: Type, options: MutationOptions): MutationFor<TCustomMutations>;
75
+ mutateReference<TType extends MemberType>(memberType: TType, options: MutationOptions): MutationFor<TCustomMutations>;
76
+ }
77
+ export declare class MutationOptions {
78
+ cacheKey(): string;
79
+ }
80
+ //# sourceMappingURL=mutation-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation-engine.d.ts","sourceRoot":"","sources":["../../../src/mutation/mutation-engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCA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,CAAC,KAAK,SAAS,UAAU,EACtC,UAAU,EAAE,KAAK,EACjB,sBAAsB,EAAE,IAAI,EAC5B,OAAO,EAAE,eAAe,GACvB,WAAW,CAAC,gBAAgB,CAAC;IAChC,eAAe,CAAC,KAAK,SAAS,UAAU,EACtC,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,eAAe,GACvB,WAAW,CAAC,gBAAgB,CAAC;CA+DjC;AAED,qBAAa,eAAe;IAC1B,QAAQ,IAAI,MAAM;CAGnB"}
@@ -0,0 +1,165 @@
1
+ import { MutationSubgraph } from "../mutation-node/mutation-subgraph.js";
2
+ import { InterfaceMutation } from "./interface.js";
3
+ import { IntrinsicMutation } from "./intrinsic.js";
4
+ import { LiteralMutation } from "./literal.js";
5
+ import { ModelPropertyMutation } from "./model-property.js";
6
+ import { ModelMutation } from "./model.js";
7
+ import { Mutation } from "./mutation.js";
8
+ import { OperationMutation } from "./operation.js";
9
+ import { ScalarMutation } from "./scalar.js";
10
+ import { UnionVariantMutation } from "./union-variant.js";
11
+ import { UnionMutation } from "./union.js";
12
+ export class MutationEngine {
13
+ $;
14
+ // Map of Type -> (Map of options.cacheKey() -> Mutation)
15
+ #mutationCache = new Map();
16
+ // Map of MemberType -> (Map of options.cacheKey() -> Mutation)
17
+ #referenceMutationCache = new Map();
18
+ #subgraphNames = new Set();
19
+ // Map of subgraph names -> (Map of options.cacheKey() -> MutationSubgraph)
20
+ #subgraphs = new Map();
21
+ #mutatorClasses;
22
+ constructor($, mutatorClasses) {
23
+ this.$ = $;
24
+ this.#mutatorClasses = {
25
+ Operation: mutatorClasses.Operation ?? OperationMutation,
26
+ Interface: mutatorClasses.Interface ?? InterfaceMutation,
27
+ Model: mutatorClasses.Model ?? ModelMutation,
28
+ Scalar: mutatorClasses.Scalar ?? ScalarMutation,
29
+ ModelProperty: mutatorClasses.ModelProperty ?? ModelPropertyMutation,
30
+ Union: mutatorClasses.Union ?? UnionMutation,
31
+ UnionVariant: mutatorClasses.UnionVariant ?? UnionVariantMutation,
32
+ String: mutatorClasses.String ?? LiteralMutation,
33
+ Number: mutatorClasses.Number ?? LiteralMutation,
34
+ Boolean: mutatorClasses.Boolean ?? LiteralMutation,
35
+ Intrinsic: mutatorClasses.Intrinsic ?? IntrinsicMutation,
36
+ };
37
+ }
38
+ registerSubgraph(name) {
39
+ this.#subgraphNames.add(name);
40
+ }
41
+ getMutationSubgraph(options, name) {
42
+ const optionsKey = options?.cacheKey() ?? "default";
43
+ if (!this.#subgraphs.has(optionsKey)) {
44
+ this.#subgraphs.set(optionsKey, new Map());
45
+ }
46
+ const subgraphsForOptions = this.#subgraphs.get(optionsKey);
47
+ name = name ?? "default";
48
+ if (!subgraphsForOptions.has(name)) {
49
+ subgraphsForOptions.set(name, new MutationSubgraph(this));
50
+ }
51
+ return subgraphsForOptions.get(name);
52
+ }
53
+ getDefaultMutationSubgraph(options) {
54
+ throw new Error("This mutation engine does not provide a default mutation subgraph.");
55
+ }
56
+ getMutatedType(subgraphOrOptions, sourceType) {
57
+ if (subgraphOrOptions instanceof MutationOptions) {
58
+ return this.getMutationNode(subgraphOrOptions, sourceType).mutatedType;
59
+ }
60
+ return this.getMutationNode(subgraphOrOptions, sourceType).mutatedType;
61
+ }
62
+ getMutationNode(subgraphOrOptions, type) {
63
+ let subgraph;
64
+ if (subgraphOrOptions instanceof MutationOptions) {
65
+ subgraph = this.getDefaultMutationSubgraph(subgraphOrOptions);
66
+ }
67
+ else {
68
+ subgraph = subgraphOrOptions;
69
+ }
70
+ return subgraph.getNode(type);
71
+ }
72
+ mutateType(subgraphOrOptions, type, initializeMutation) {
73
+ const subgraph = this.#getSubgraphFromOptions(subgraphOrOptions);
74
+ this.getMutationNode(subgraph, type).mutate(initializeMutation);
75
+ }
76
+ #getSubgraphFromOptions(subgraphOrOptions) {
77
+ if (subgraphOrOptions instanceof MutationOptions) {
78
+ return this.getDefaultMutationSubgraph(subgraphOrOptions);
79
+ }
80
+ else {
81
+ return subgraphOrOptions;
82
+ }
83
+ }
84
+ mutate(type, options = new MutationOptions()) {
85
+ if (!this.#mutationCache.has(type)) {
86
+ this.#mutationCache.set(type, new Map());
87
+ }
88
+ const byType = this.#mutationCache.get(type);
89
+ const key = options.cacheKey();
90
+ if (byType.has(key)) {
91
+ const existing = byType.get(key);
92
+ if (!existing.isMutated) {
93
+ existing.isMutated = true;
94
+ existing.mutate();
95
+ }
96
+ return existing;
97
+ }
98
+ this.#initializeSubgraphs(type, options);
99
+ const mutatorClass = this.#mutatorClasses[type.kind];
100
+ if (!mutatorClass) {
101
+ throw new Error("No mutator registered for type kind: " + type.kind);
102
+ }
103
+ // TS doesn't like this abstract class here, but it will be a derivative
104
+ // class in practice.
105
+ const mutation = new mutatorClass(this, type, [], options);
106
+ byType.set(key, mutation);
107
+ mutation.isMutated = true;
108
+ mutation.mutate();
109
+ return mutation;
110
+ }
111
+ mutateReference(memberType, referencedMutationNodeOrOptions, options) {
112
+ let referencedMutationNode;
113
+ let finalOptions;
114
+ if (referencedMutationNodeOrOptions instanceof MutationOptions) {
115
+ finalOptions = referencedMutationNodeOrOptions;
116
+ referencedMutationNode = undefined;
117
+ }
118
+ else {
119
+ referencedMutationNode = referencedMutationNodeOrOptions;
120
+ finalOptions = options;
121
+ }
122
+ if (!this.#referenceMutationCache.has(memberType)) {
123
+ this.#referenceMutationCache.set(memberType, new Map());
124
+ }
125
+ const byType = this.#referenceMutationCache.get(memberType);
126
+ const key = finalOptions.cacheKey();
127
+ if (byType.has(key)) {
128
+ const existing = byType.get(key);
129
+ if (!existing.isMutated) {
130
+ existing.isMutated = true;
131
+ existing.mutate();
132
+ }
133
+ return existing;
134
+ }
135
+ this.#initializeSubgraphs(memberType, finalOptions);
136
+ const sources = [];
137
+ let referencedType = memberType;
138
+ while (referencedType.kind === "ModelProperty" || referencedType.kind === "UnionVariant") {
139
+ sources.push(referencedType);
140
+ referencedType = referencedType.type;
141
+ }
142
+ const typeToMutate = referencedMutationNode ?? referencedType;
143
+ const mutatorClass = this.#mutatorClasses[typeToMutate.kind];
144
+ if (!mutatorClass) {
145
+ throw new Error("No mutator registered for type kind: " + typeToMutate.kind);
146
+ }
147
+ const mutation = new mutatorClass(this, typeToMutate, sources, finalOptions);
148
+ byType.set(key, mutation);
149
+ mutation.isMutated = true;
150
+ mutation.mutate();
151
+ return mutation;
152
+ }
153
+ #initializeSubgraphs(root, options) {
154
+ for (const name of this.#subgraphNames) {
155
+ const subgraph = this.getMutationSubgraph(options, name);
156
+ subgraph.getNode(root);
157
+ }
158
+ }
159
+ }
160
+ export class MutationOptions {
161
+ cacheKey() {
162
+ return "";
163
+ }
164
+ }
165
+ //# sourceMappingURL=mutation-engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation-engine.js","sourceRoot":"","sources":["../../../src/mutation/mutation-engine.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAmC3C,MAAM,OAAO,cAAc;IACzB,CAAC,CAAU;IAEX,yDAAyD;IACzD,cAAc,GAAG,IAAI,GAAG,EAAoD,CAAC;IAE7E,+DAA+D;IAC/D,uBAAuB,GAAG,IAAI,GAAG,EA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","sourceRoot":"","sources":["../../../src/mutation/mutation-engine.test.ts"],"names":[],"mappings":""}