@azure-tools/typespec-azure-core 0.72.0-dev.0 → 0.72.0-dev.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.
package/README.md CHANGED
@@ -35,6 +35,7 @@ Available ruleSets:
35
35
  | [`@azure-tools/typespec-azure-core/byos`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/byos) | Use the BYOS pattern recommended for Azure Services. |
36
36
  | [`@azure-tools/typespec-azure-core/casing-style`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/casing-style) | Ensure proper casing style. |
37
37
  | [`@azure-tools/typespec-azure-core/composition-over-inheritance`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/composition-over-inheritance) | Check that if a model is used in an operation and has derived models that it has a discriminator or recommend to use composition via spread or `is`. |
38
+ | [`@azure-tools/typespec-azure-core/no-boolean`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-boolean) | Boolean properties should use descriptive extensible enums when semantic values matter. |
38
39
  | [`@azure-tools/typespec-azure-core/known-encoding`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/known-encoding) | Check for supported encodings. |
39
40
  | [`@azure-tools/typespec-azure-core/long-running-polling-operation-required`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/long-running-polling-operation-required) | Long-running operations should have a linked polling operation. |
40
41
  | [`@azure-tools/typespec-azure-core/no-case-mismatch`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-case-mismatch) | Validate that no two types have the same name with different casing. |
@@ -0,0 +1,40 @@
1
+ import type { DecoratorContext, DecoratorValidatorCallbacks, Enum, Model, ModelProperty, Scalar, Union } from "@typespec/compiler";
2
+ /**
3
+ * Changes the type of a model property to a new type.
4
+ *
5
+ * This can be used in situations where an existing model property type needs to be changed because it cannot be redefined.
6
+ *
7
+ * WARNING: This decorator mutates the model property in place and should be used with EXTREME caution.
8
+ *
9
+ * @param target The model property to change.
10
+ * @param newType The new type to assign to the model property.
11
+ */
12
+ export type ChangePropertyTypeDecorator = (context: DecoratorContext, target: ModelProperty, newType: Model | Union | Scalar | Enum) => DecoratorValidatorCallbacks | void;
13
+ /**
14
+ * Copies the properties of `source` that do not already exist on `target` into `target`.
15
+ *
16
+ * This can be used to add a group of properties to an existing model in cases where the model cannot be redefined.
17
+ *
18
+ * WARNING: This decorator mutates the target model in place and should be used with EXTREME caution.
19
+ *
20
+ * @param target The model to copy properties to.
21
+ * @param sourceModel The model to copy properties from.
22
+ */
23
+ export type CopyPropertiesDecorator = (context: DecoratorContext, target: Model, sourceModel: Model) => DecoratorValidatorCallbacks | void;
24
+ /**
25
+ * Copies the variants of `sourceUnion` that do not already exist on `target` into `target`.
26
+ *
27
+ * This can be used to add a group of variants to an existing union in cases where the union cannot be redefined.
28
+ *
29
+ * WARNING: This decorator mutates the target union in place and should be used with EXTREME caution.
30
+ *
31
+ * @param target The union to copy variants to.
32
+ * @param sourceUnion The union to copy variants from.
33
+ */
34
+ export type CopyVariantsDecorator = (context: DecoratorContext, target: Union, sourceUnion: Union) => DecoratorValidatorCallbacks | void;
35
+ export type AzureCoreExperimentalDecorators = {
36
+ changePropertyType: ChangePropertyTypeDecorator;
37
+ copyProperties: CopyPropertiesDecorator;
38
+ copyVariants: CopyVariantsDecorator;
39
+ };
40
+ //# sourceMappingURL=Azure.Core.Experimental.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Azure.Core.Experimental.d.ts","sourceRoot":"","sources":["../../../generated-defs/experimental/Azure.Core.Experimental.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,2BAA2B,EAC3B,IAAI,EACJ,KAAK,EACL,aAAa,EACb,MAAM,EACN,KAAK,EACN,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;GASG;AACH,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,KACnC,2BAA2B,GAAG,IAAI,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACpC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,EACb,WAAW,EAAE,KAAK,KACf,2BAA2B,GAAG,IAAI,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,EACb,WAAW,EAAE,KAAK,KACf,2BAA2B,GAAG,IAAI,CAAC;AAExC,MAAM,MAAM,+BAA+B,GAAG;IAC5C,kBAAkB,EAAE,2BAA2B,CAAC;IAChD,cAAc,EAAE,uBAAuB,CAAC;IACxC,YAAY,EAAE,qBAAqB,CAAC;CACrC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Azure.Core.Experimental.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Azure.Core.Experimental.js","sourceRoot":"","sources":["../../../generated-defs/experimental/Azure.Core.Experimental.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Azure.Core.Experimental.ts-test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Azure.Core.Experimental.ts-test.d.ts","sourceRoot":"","sources":["../../../generated-defs/experimental/Azure.Core.Experimental.ts-test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ // An error in the imports would mean that the decorator is not exported or
2
+ // doesn't have the right name.
3
+ import { $decorators } from "@azure-tools/typespec-azure-core/experimental";
4
+ /**
5
+ * An error here would mean that the exported decorator is not using the same signature. Make sure to have export const $decName: DecNameDecorator = (...) => ...
6
+ */
7
+ const _decs = $decorators["Azure.Core.Experimental"];
8
+ //# sourceMappingURL=Azure.Core.Experimental.ts-test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Azure.Core.Experimental.ts-test.js","sourceRoot":"","sources":["../../../generated-defs/experimental/Azure.Core.Experimental.ts-test.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+BAA+B;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG5E;;GAEG;AACH,MAAM,KAAK,GAAoC,WAAW,CAAC,yBAAyB,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
- import type { DecoratorContext, Enum, Model, ModelProperty, Scalar, Union } from "@typespec/compiler";
2
- export declare function $changePropertyType(ctx: DecoratorContext, target: ModelProperty, newType: Model | Union | Scalar | Enum): void;
3
- export declare function $copyProperties(ctx: DecoratorContext, target: Model, baseModel: Model): void;
4
- export declare function $copyVariants(ctx: DecoratorContext, target: Union, sourceUnion: Union): void;
1
+ import type { ChangePropertyTypeDecorator, CopyPropertiesDecorator, CopyVariantsDecorator } from "../../generated-defs/experimental/Azure.Core.Experimental.js";
2
+ export declare const $changePropertyType: ChangePropertyTypeDecorator;
3
+ export declare const $copyProperties: CopyPropertiesDecorator;
4
+ export declare const $copyVariants: CopyVariantsDecorator;
5
5
  //# sourceMappingURL=decorators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/experimental/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,IAAI,EACJ,KAAK,EACL,aAAa,EACb,MAAM,EACN,KAAK,EACN,MAAM,oBAAoB,CAAC;AAG5B,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,QAWvC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,QAgBrF;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,QAgBrF"}
1
+ {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/experimental/decorators.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,2BAA2B,EAC3B,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,8DAA8D,CAAC;AAGtE,eAAO,MAAM,mBAAmB,EAAE,2BAcjC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,uBAoB7B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,qBAoB3B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { reportDiagnostic } from "../lib.js";
2
- export function $changePropertyType(ctx, target, newType) {
2
+ export const $changePropertyType = (ctx, target, newType) => {
3
3
  reportDiagnostic(ctx.program, {
4
4
  code: "experimental-feature",
5
5
  messageId: "dangerous",
@@ -9,8 +9,8 @@ export function $changePropertyType(ctx, target, newType) {
9
9
  target: ctx.decoratorTarget,
10
10
  });
11
11
  target.type = newType;
12
- }
13
- export function $copyProperties(ctx, target, baseModel) {
12
+ };
13
+ export const $copyProperties = (ctx, target, baseModel) => {
14
14
  reportDiagnostic(ctx.program, {
15
15
  code: "experimental-feature",
16
16
  messageId: "dangerous",
@@ -25,8 +25,8 @@ export function $copyProperties(ctx, target, baseModel) {
25
25
  }
26
26
  target.properties.set(propName, prop);
27
27
  }
28
- }
29
- export function $copyVariants(ctx, target, sourceUnion) {
28
+ };
29
+ export const $copyVariants = (ctx, target, sourceUnion) => {
30
30
  reportDiagnostic(ctx.program, {
31
31
  code: "experimental-feature",
32
32
  messageId: "dangerous",
@@ -41,5 +41,5 @@ export function $copyVariants(ctx, target, sourceUnion) {
41
41
  }
42
42
  target.variants.set(variantName, variantType);
43
43
  }
44
- }
44
+ };
45
45
  //# sourceMappingURL=decorators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/experimental/decorators.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MA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AC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA0B,CAClD,GAAqB,EACrB,MAAa,EACb,WAAkB,EAClB,EAAE;IACF,gBAAgB,CAAC,GAAG,CAAC,OAAO,EAAE;QAC5B,IAAI,EAAE,sBAAsB;QAC5B,SAAS,EAAE,WAAW;QACtB,MAAM,EAAE;YACN,OAAO,EAAE,eAAe;SACzB;QACD,MAAM,EAAE,GAAG,CAAC,eAAe;KAC5B,CAAC,CAAC;IAEH,KAAK,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC9D,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACrC,SAAS;QACX,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAC"}
@@ -1,9 +1,8 @@
1
- import { $changePropertyType, $copyProperties, $copyVariants } from "./decorators.js";
2
1
  export declare const $decorators: {
3
2
  "Azure.Core.Experimental": {
4
- changePropertyType: typeof $changePropertyType;
5
- copyProperties: typeof $copyProperties;
6
- copyVariants: typeof $copyVariants;
3
+ changePropertyType: import("../../generated-defs/experimental/Azure.Core.Experimental.js").ChangePropertyTypeDecorator;
4
+ copyProperties: import("../../generated-defs/experimental/Azure.Core.Experimental.js").CopyPropertiesDecorator;
5
+ copyVariants: import("../../generated-defs/experimental/Azure.Core.Experimental.js").CopyVariantsDecorator;
7
6
  };
8
7
  };
9
8
  //# sourceMappingURL=tsp-index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsp-index.d.ts","sourceRoot":"","sources":["../../../src/experimental/tsp-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEtF,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC"}
1
+ {"version":3,"file":"tsp-index.d.ts","sourceRoot":"","sources":["../../../src/experimental/tsp-index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAyFA,eAAO,MAAM,OAAO,+CASlB,CAAC"}
1
+ {"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AA2FA,eAAO,MAAM,OAAO,+CASlB,CAAC"}
@@ -7,6 +7,7 @@ import { compositionOverInheritanceRule } from "./rules/composition-over-inherit
7
7
  import { friendlyNameRule } from "./rules/friendly-name.js";
8
8
  import { knownEncodingRule } from "./rules/known-encoding.js";
9
9
  import { longRunningOperationsRequirePollingOperation } from "./rules/lro-polling-operation.js";
10
+ import { noBooleanRule } from "./rules/no-boolean.js";
10
11
  import { noCaseMismatchRule } from "./rules/no-case-mismatch.js";
11
12
  import { noClosedLiteralUnionRule } from "./rules/no-closed-literal-union.js";
12
13
  import { noEnumRule } from "./rules/no-enum.js";
@@ -48,6 +49,7 @@ const rules = [
48
49
  byosRule,
49
50
  casingRule,
50
51
  compositionOverInheritanceRule,
52
+ noBooleanRule,
51
53
  knownEncodingRule,
52
54
  longRunningOperationsRequirePollingOperation,
53
55
  noCaseMismatchRule,
@@ -1 +1 @@
1
- {"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,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AACpE,OAAO,EAAE,iCAAiC,EAAE,MAAM,8CAA8C,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,KAAK,GAAG;IACZ,cAAc;IACd,gBAAgB;IAChB,aAAa;IACb,QAAQ;IACR,UAAU;IACV,8BAA8B;IAC9B,aAAa;IACb,iBAAiB;IACjB,4CAA4C;IAC5C,kBAAkB;IAClB,wBAAwB;IACxB,UAAU;IACV,sBAAsB;IACtB,2BAA2B;IAC3B,yBAAyB;IACzB,oBAAoB;IACpB,cAAc;IACd,oBAAoB;IACpB,kBAAkB;IAClB,mBAAmB;IACnB,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,2BAA2B;IAC3B,4BAA4B;IAC5B,kBAAkB;IAClB,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,iCAAiC;IACjC,2BAA2B;IAC3B,4BAA4B;IAC5B,gBAAgB;IAChB,qBAAqB;IACrB,yBAAyB;IACzB,oBAAoB;IACpB,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,kBAAkB;IAClB,gCAAgC;IAChC,6BAA6B;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAClC,KAAK;IACL,QAAQ,EAAE;QACR,sBAAsB,EAAE;YACtB,MAAM,EAAE;gBACN,CAAC,oCAAoC,yBAAyB,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;aAC7E;SACF;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const noBooleanRule: import("@typespec/compiler").LinterRuleDefinition<"no-boolean", {
2
+ readonly default: "Consider using an extensible enum instead of a boolean property so the API shape is more descriptive.";
3
+ }, Record<string, never>>;
4
+ //# sourceMappingURL=no-boolean.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-boolean.d.ts","sourceRoot":"","sources":["../../../src/rules/no-boolean.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;yBAiCxB,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { createRule, fileRef } from "@typespec/compiler";
2
+ import { $ } from "@typespec/compiler/typekit";
3
+ export const noBooleanRule = createRule({
4
+ name: "no-boolean",
5
+ docs: fileRef.fromPackageRoot("src/rules/no-boolean.md"),
6
+ description: "Boolean properties should use descriptive extensible enums when semantic values matter.",
7
+ severity: "warning",
8
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/no-boolean",
9
+ messages: {
10
+ default: "Consider using an extensible enum instead of a boolean property so the API shape is more descriptive.",
11
+ },
12
+ create(context) {
13
+ const tk = $(context.program);
14
+ return {
15
+ modelProperty: (property) => {
16
+ if (!tk.scalar.isBoolean(property.type)) {
17
+ return;
18
+ }
19
+ context.reportDiagnostic({
20
+ target: property,
21
+ });
22
+ },
23
+ operation: (operation) => {
24
+ if (tk.scalar.isBoolean(operation.returnType)) {
25
+ context.reportDiagnostic({
26
+ target: operation,
27
+ });
28
+ }
29
+ },
30
+ };
31
+ },
32
+ });
33
+ //# sourceMappingURL=no-boolean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-boolean.js","sourceRoot":"","sources":["../../../src/rules/no-boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,4BAA4B,CAAC;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,yBAAyB,CAAC;IACxD,WAAW,EACT,yFAAyF;IAC3F,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,mFAAmF;IACxF,QAAQ,EAAE;QACR,OAAO,EACL,uGAAuG;KAC1G;IACD,MAAM,CAAC,OAAO;QACZ,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE9B,OAAO;YACL,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE;gBAC1B,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;oBACxC,OAAO;gBACT,CAAC;gBAED,OAAO,CAAC,gBAAgB,CAAC;oBACvB,MAAM,EAAE,QAAQ;iBACjB,CAAC,CAAC;YACL,CAAC;YACD,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC9C,OAAO,CAAC,gBAAgB,CAAC;wBACvB,MAAM,EAAE,SAAS;qBAClB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-core",
3
- "version": "0.72.0-dev.0",
3
+ "version": "0.72.0-dev.1",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Core library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",
@@ -47,9 +47,9 @@
47
47
  "!dist/test/**"
48
48
  ],
49
49
  "peerDependencies": {
50
- "@typespec/compiler": "^1.15.0",
51
50
  "@typespec/http": "^1.15.0",
52
- "@typespec/rest": "^0.85.0"
51
+ "@typespec/rest": "^0.85.0",
52
+ "@typespec/compiler": "^1.15.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/node": "^26.0.0",