@strapi/data-transfer 5.60.0 → 5.61.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/engine/validation/schemas/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAqChD,QAAA,MAAM,UAAU;iBAED,IAAI,EAAE;kBAOL,IAAI,EAAE;CAGrB,CAAC;AAEF,QAAA,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,UAAU,MAAM,OAAO,UAAU,WAG1E,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/engine/validation/schemas/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAiDhD,QAAA,MAAM,UAAU;iBAED,IAAI,EAAE;kBAOL,IAAI,EAAE;CAGrB,CAAC;AAEF,QAAA,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,UAAU,MAAM,OAAO,UAAU,WAG1E,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -37,7 +37,14 @@ const isOptionalAdminType = (diff)=>{
37
37
  }
38
38
  return false;
39
39
  };
40
- const isIgnorableStrict = (diff)=>isAttributeIgnorable(diff) || isOptionalAdminType(diff);
40
+ /**
41
+ * Position of a document in the custom order of its collection type (Content Manager). The
42
+ * attribute only exists while the `unstableCustomOrder` future flag is on, and the position
43
+ * is not content: a transfer between an instance with the flag and one without goes on
44
+ * without it, the destination orders the entries again when it needs to.
45
+ */ const CUSTOM_ORDER_ATTRIBUTE = 'strapi_position';
46
+ const isCustomOrderAttribute = (diff)=>diff.path[0] === 'attributes' && diff.path[1] === CUSTOM_ORDER_ATTRIBUTE;
47
+ const isIgnorableStrict = (diff)=>isAttributeIgnorable(diff) || isCustomOrderAttribute(diff) || isOptionalAdminType(diff);
41
48
  const strategies = {
42
49
  // No diffs
43
50
  exact (diffs) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/engine/validation/schemas/index.ts"],"sourcesContent":["import type { Struct } from '@strapi/types';\nimport { isObject, reject } from 'lodash';\nimport type { Diff } from '../../../utils/json';\nimport * as utils from '../../../utils';\n\nconst OPTIONAL_CONTENT_TYPES = ['audit-log'] as const;\n\nconst isAttributeIgnorable = (diff: Diff) => {\n return (\n diff.path.length === 3 &&\n // Root property must be attributes\n diff.path[0] === 'attributes' &&\n // Need a valid string attribute name\n typeof diff.path[1] === 'string' &&\n // The diff must be on ignorable attribute properties\n ['private', 'required', 'configurable', 'default'].includes(diff.path[2])\n );\n};\n\n// TODO: clean up the type checking, which will require cleaning up the typings in utils/json.ts\n// exclude admin tables that are not transferable and are optionally available (such as audit logs which are only available in EE)\nconst isOptionalAdminType = (diff: Diff) => {\n // added/deleted\n if ('value' in diff && isObject(diff.value)) {\n const name = (diff?.value as Struct.ContentTypeSchema)?.info?.singularName;\n return (OPTIONAL_CONTENT_TYPES as ReadonlyArray<string | undefined>).includes(name);\n }\n\n // modified\n if ('values' in diff && Array.isArray(diff.values) && isObject(diff.values[0])) {\n const name = (diff?.values[0] as Struct.ContentTypeSchema)?.info?.singularName;\n return (OPTIONAL_CONTENT_TYPES as ReadonlyArray<string | undefined>).includes(name);\n }\n\n return false;\n};\n\nconst isIgnorableStrict = (diff: Diff) => isAttributeIgnorable(diff) || isOptionalAdminType(diff);\n\nconst strategies = {\n // No diffs\n exact(diffs: Diff[]) {\n return diffs;\n },\n\n // Strict: all content types must match except:\n // - the property within a content type is an ignorable one\n // - those that are (not transferrable and optionally available), for example EE features such as audit logs\n strict(diffs: Diff[]) {\n return reject(diffs, isIgnorableStrict);\n },\n};\n\nconst compareSchemas = <T, P>(a: T, b: P, strategy: keyof typeof strategies) => {\n const diffs = utils.json.diff(a, b);\n return strategies[strategy](diffs);\n};\n\nexport { compareSchemas };\n"],"names":["OPTIONAL_CONTENT_TYPES","isAttributeIgnorable","diff","path","length","includes","isOptionalAdminType","isObject","value","name","info","singularName","Array","isArray","values","isIgnorableStrict","strategies","exact","diffs","strict","reject","compareSchemas","a","b","strategy","utils"],"mappings":";;;;;;;;;;AAKA,MAAMA,sBAAAA,GAAyB;AAAC,IAAA;AAAY,CAAA;AAE5C,MAAMC,uBAAuB,CAACC,IAAAA,GAAAA;AAC5B,IAAA,OACEA,KAAKC,IAAI,CAACC,MAAM,KAAK;AAErBF,IAAAA,IAAAA,CAAKC,IAAI,CAAC,CAAA,CAAE,KAAK;AAEjB,IAAA,OAAOD,KAAKC,IAAI,CAAC,CAAA,CAAE,KAAK;AAExB,IAAA;AAAC,QAAA,SAAA;AAAW,QAAA,UAAA;AAAY,QAAA,cAAA;AAAgB,QAAA;AAAU,KAAA,CAACE,QAAQ,CAACH,IAAAA,CAAKC,IAAI,CAAC,CAAA,CAAE,CAAA;AAE5E,CAAA;AAEA;AACA;AACA,MAAMG,sBAAsB,CAACJ,IAAAA,GAAAA;;AAE3B,IAAA,IAAI,OAAA,IAAWA,IAAAA,IAAQK,UAAAA,CAASL,IAAAA,CAAKM,KAAK,CAAA,EAAG;QAC3C,MAAMC,IAAAA,GAAQP,IAAAA,EAAMM,KAAAA,EAAoCE,IAAAA,EAAMC,YAAAA;QAC9D,OAAQX,sBAAAA,CAA6DK,QAAQ,CAACI,IAAAA,CAAAA;AAChF,IAAA;;AAGA,IAAA,IAAI,QAAA,IAAYP,IAAAA,IAAQU,KAAAA,CAAMC,OAAO,CAACX,IAAAA,CAAKY,MAAM,CAAA,IAAKP,UAAAA,CAASL,IAAAA,CAAKY,MAAM,CAAC,EAAE,CAAA,EAAG;AAC9E,QAAA,MAAML,OAAQP,IAAAA,EAAMY,MAAM,CAAC,CAAA,CAAE,EAA+BJ,IAAAA,EAAMC,YAAAA;QAClE,OAAQX,sBAAAA,CAA6DK,QAAQ,CAACI,IAAAA,CAAAA;AAChF,IAAA;IAEA,OAAO,KAAA;AACT,CAAA;AAEA,MAAMM,iBAAAA,GAAoB,CAACb,IAAAA,GAAeD,oBAAAA,CAAqBC,SAASI,mBAAAA,CAAoBJ,IAAAA,CAAAA;AAE5F,MAAMc,UAAAA,GAAa;;AAEjBC,IAAAA,KAAAA,CAAAA,CAAMC,KAAa,EAAA;QACjB,OAAOA,KAAAA;AACT,IAAA,CAAA;;;;AAKAC,IAAAA,MAAAA,CAAAA,CAAOD,KAAa,EAAA;AAClB,QAAA,OAAOE,SAAOF,KAAAA,EAAOH,iBAAAA,CAAAA;AACvB,IAAA;AACF,CAAA;AAEA,MAAMM,cAAAA,GAAiB,CAAOC,CAAAA,EAAMC,CAAAA,EAAMC,QAAAA,GAAAA;AACxC,IAAA,MAAMN,QAAQO,SAAe,CAACH,CAAAA,EAAGC,CAAAA,CAAAA;IACjC,OAAOP,UAAU,CAACQ,QAAAA,CAAS,CAACN,KAAAA,CAAAA;AAC9B;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/engine/validation/schemas/index.ts"],"sourcesContent":["import type { Struct } from '@strapi/types';\nimport { isObject, reject } from 'lodash';\nimport type { Diff } from '../../../utils/json';\nimport * as utils from '../../../utils';\n\nconst OPTIONAL_CONTENT_TYPES = ['audit-log'] as const;\n\nconst isAttributeIgnorable = (diff: Diff) => {\n return (\n diff.path.length === 3 &&\n // Root property must be attributes\n diff.path[0] === 'attributes' &&\n // Need a valid string attribute name\n typeof diff.path[1] === 'string' &&\n // The diff must be on ignorable attribute properties\n ['private', 'required', 'configurable', 'default'].includes(diff.path[2])\n );\n};\n\n// TODO: clean up the type checking, which will require cleaning up the typings in utils/json.ts\n// exclude admin tables that are not transferable and are optionally available (such as audit logs which are only available in EE)\nconst isOptionalAdminType = (diff: Diff) => {\n // added/deleted\n if ('value' in diff && isObject(diff.value)) {\n const name = (diff?.value as Struct.ContentTypeSchema)?.info?.singularName;\n return (OPTIONAL_CONTENT_TYPES as ReadonlyArray<string | undefined>).includes(name);\n }\n\n // modified\n if ('values' in diff && Array.isArray(diff.values) && isObject(diff.values[0])) {\n const name = (diff?.values[0] as Struct.ContentTypeSchema)?.info?.singularName;\n return (OPTIONAL_CONTENT_TYPES as ReadonlyArray<string | undefined>).includes(name);\n }\n\n return false;\n};\n\n/**\n * Position of a document in the custom order of its collection type (Content Manager). The\n * attribute only exists while the `unstableCustomOrder` future flag is on, and the position\n * is not content: a transfer between an instance with the flag and one without goes on\n * without it, the destination orders the entries again when it needs to.\n */\nconst CUSTOM_ORDER_ATTRIBUTE = 'strapi_position';\n\nconst isCustomOrderAttribute = (diff: Diff) =>\n diff.path[0] === 'attributes' && diff.path[1] === CUSTOM_ORDER_ATTRIBUTE;\n\nconst isIgnorableStrict = (diff: Diff) =>\n isAttributeIgnorable(diff) || isCustomOrderAttribute(diff) || isOptionalAdminType(diff);\n\nconst strategies = {\n // No diffs\n exact(diffs: Diff[]) {\n return diffs;\n },\n\n // Strict: all content types must match except:\n // - the property within a content type is an ignorable one\n // - those that are (not transferrable and optionally available), for example EE features such as audit logs\n strict(diffs: Diff[]) {\n return reject(diffs, isIgnorableStrict);\n },\n};\n\nconst compareSchemas = <T, P>(a: T, b: P, strategy: keyof typeof strategies) => {\n const diffs = utils.json.diff(a, b);\n return strategies[strategy](diffs);\n};\n\nexport { compareSchemas };\n"],"names":["OPTIONAL_CONTENT_TYPES","isAttributeIgnorable","diff","path","length","includes","isOptionalAdminType","isObject","value","name","info","singularName","Array","isArray","values","CUSTOM_ORDER_ATTRIBUTE","isCustomOrderAttribute","isIgnorableStrict","strategies","exact","diffs","strict","reject","compareSchemas","a","b","strategy","utils"],"mappings":";;;;;;;;;;AAKA,MAAMA,sBAAAA,GAAyB;AAAC,IAAA;AAAY,CAAA;AAE5C,MAAMC,uBAAuB,CA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AME,oBAAoB,CAACf,IAAAA,GACzBD,qBAAqBC,IAAAA,CAAAA,IAASc,sBAAAA,CAAuBd,SAASI,mBAAAA,CAAoBJ,IAAAA,CAAAA;AAEpF,MAAMgB,UAAAA,GAAa;;AAEjBC,IAAAA,KAAAA,CAAAA,CAAMC,KAAa,EAAA;QACjB,OAAOA,KAAAA;AACT,IAAA,CAAA;;;;AAKAC,IAAAA,MAAAA,CAAAA,CAAOD,KAAa,EAAA;AAClB,QAAA,OAAOE,SAAOF,KAAAA,EAAOH,iBAAAA,CAAAA;AACvB,IAAA;AACF,CAAA;AAEA,MAAMM,cAAAA,GAAiB,CAAOC,CAAAA,EAAMC,CAAAA,EAAMC,QAAAA,GAAAA;AACxC,IAAA,MAAMN,QAAQO,SAAe,CAACH,CAAAA,EAAGC,CAAAA,CAAAA;IACjC,OAAOP,UAAU,CAACQ,QAAAA,CAAS,CAACN,KAAAA,CAAAA;AAC9B;;;;"}
@@ -35,7 +35,14 @@ const isOptionalAdminType = (diff)=>{
35
35
  }
36
36
  return false;
37
37
  };
38
- const isIgnorableStrict = (diff)=>isAttributeIgnorable(diff) || isOptionalAdminType(diff);
38
+ /**
39
+ * Position of a document in the custom order of its collection type (Content Manager). The
40
+ * attribute only exists while the `unstableCustomOrder` future flag is on, and the position
41
+ * is not content: a transfer between an instance with the flag and one without goes on
42
+ * without it, the destination orders the entries again when it needs to.
43
+ */ const CUSTOM_ORDER_ATTRIBUTE = 'strapi_position';
44
+ const isCustomOrderAttribute = (diff)=>diff.path[0] === 'attributes' && diff.path[1] === CUSTOM_ORDER_ATTRIBUTE;
45
+ const isIgnorableStrict = (diff)=>isAttributeIgnorable(diff) || isCustomOrderAttribute(diff) || isOptionalAdminType(diff);
39
46
  const strategies = {
40
47
  // No diffs
41
48
  exact (diffs) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../src/engine/validation/schemas/index.ts"],"sourcesContent":["import type { Struct } from '@strapi/types';\nimport { isObject, reject } from 'lodash';\nimport type { Diff } from '../../../utils/json';\nimport * as utils from '../../../utils';\n\nconst OPTIONAL_CONTENT_TYPES = ['audit-log'] as const;\n\nconst isAttributeIgnorable = (diff: Diff) => {\n return (\n diff.path.length === 3 &&\n // Root property must be attributes\n diff.path[0] === 'attributes' &&\n // Need a valid string attribute name\n typeof diff.path[1] === 'string' &&\n // The diff must be on ignorable attribute properties\n ['private', 'required', 'configurable', 'default'].includes(diff.path[2])\n );\n};\n\n// TODO: clean up the type checking, which will require cleaning up the typings in utils/json.ts\n// exclude admin tables that are not transferable and are optionally available (such as audit logs which are only available in EE)\nconst isOptionalAdminType = (diff: Diff) => {\n // added/deleted\n if ('value' in diff && isObject(diff.value)) {\n const name = (diff?.value as Struct.ContentTypeSchema)?.info?.singularName;\n return (OPTIONAL_CONTENT_TYPES as ReadonlyArray<string | undefined>).includes(name);\n }\n\n // modified\n if ('values' in diff && Array.isArray(diff.values) && isObject(diff.values[0])) {\n const name = (diff?.values[0] as Struct.ContentTypeSchema)?.info?.singularName;\n return (OPTIONAL_CONTENT_TYPES as ReadonlyArray<string | undefined>).includes(name);\n }\n\n return false;\n};\n\nconst isIgnorableStrict = (diff: Diff) => isAttributeIgnorable(diff) || isOptionalAdminType(diff);\n\nconst strategies = {\n // No diffs\n exact(diffs: Diff[]) {\n return diffs;\n },\n\n // Strict: all content types must match except:\n // - the property within a content type is an ignorable one\n // - those that are (not transferrable and optionally available), for example EE features such as audit logs\n strict(diffs: Diff[]) {\n return reject(diffs, isIgnorableStrict);\n },\n};\n\nconst compareSchemas = <T, P>(a: T, b: P, strategy: keyof typeof strategies) => {\n const diffs = utils.json.diff(a, b);\n return strategies[strategy](diffs);\n};\n\nexport { compareSchemas };\n"],"names":["OPTIONAL_CONTENT_TYPES","isAttributeIgnorable","diff","path","length","includes","isOptionalAdminType","isObject","value","name","info","singularName","Array","isArray","values","isIgnorableStrict","strategies","exact","diffs","strict","reject","compareSchemas","a","b","strategy","utils"],"mappings":";;;;;;;;AAKA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A,KAAAA,CAAAA,CAAMC,KAAa,EAAA;QACjB,OAAOA,KAAAA;AACT,IAAA,CAAA;;;;AAKAC,IAAAA,MAAAA,CAAAA,CAAOD,KAAa,EAAA;AAClB,QAAA,OAAOE,OAAOF,KAAAA,EAAOH,iBAAAA,CAAAA;AACvB,IAAA;AACF,CAAA;AAEA,MAAMM,cAAAA,GAAiB,CAAOC,CAAAA,EAAMC,CAAAA,EAAMC,QAAAA,GAAAA;AACxC,IAAA,MAAMN,QAAQO,IAAe,CAACH,CAAAA,EAAGC,CAAAA,CAAAA;IACjC,OAAOP,UAAU,CAACQ,QAAAA,CAAS,CAACN,KAAAA,CAAAA;AAC9B;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../src/engine/validation/schemas/index.ts"],"sourcesContent":["import type { Struct } from '@strapi/types';\nimport { isObject, reject } from 'lodash';\nimport type { Diff } from '../../../utils/json';\nimport * as utils from '../../../utils';\n\nconst OPTIONAL_CONTENT_TYPES = ['audit-log'] as const;\n\nconst isAttributeIgnorable = (diff: Diff) => {\n return (\n diff.path.length === 3 &&\n // Root property must be attributes\n diff.path[0] === 'attributes' &&\n // Need a valid string attribute name\n typeof diff.path[1] === 'string' &&\n // The diff must be on ignorable attribute properties\n ['private', 'required', 'configurable', 'default'].includes(diff.path[2])\n );\n};\n\n// TODO: clean up the type checking, which will require cleaning up the typings in utils/json.ts\n// exclude admin tables that are not transferable and are optionally available (such as audit logs which are only available in EE)\nconst isOptionalAdminType = (diff: Diff) => {\n // added/deleted\n if ('value' in diff && isObject(diff.value)) {\n const name = (diff?.value as Struct.ContentTypeSchema)?.info?.singularName;\n return (OPTIONAL_CONTENT_TYPES as ReadonlyArray<string | undefined>).includes(name);\n }\n\n // modified\n if ('values' in diff && Array.isArray(diff.values) && isObject(diff.values[0])) {\n const name = (diff?.values[0] as Struct.ContentTypeSchema)?.info?.singularName;\n return (OPTIONAL_CONTENT_TYPES as ReadonlyArray<string | undefined>).includes(name);\n }\n\n return false;\n};\n\n/**\n * Position of a document in the custom order of its collection type (Content Manager). The\n * attribute only exists while the `unstableCustomOrder` future flag is on, and the position\n * is not content: a transfer between an instance with the flag and one without goes on\n * without it, the destination orders the entries again when it needs to.\n */\nconst CUSTOM_ORDER_ATTRIBUTE = 'strapi_position';\n\nconst isCustomOrderAttribute = (diff: Diff) =>\n diff.path[0] === 'attributes' && diff.path[1] === CUSTOM_ORDER_ATTRIBUTE;\n\nconst isIgnorableStrict = (diff: Diff) =>\n isAttributeIgnorable(diff) || isCustomOrderAttribute(diff) || isOptionalAdminType(diff);\n\nconst strategies = {\n // No diffs\n exact(diffs: Diff[]) {\n return diffs;\n },\n\n // Strict: all content types must match except:\n // - the property within a content type is an ignorable one\n // - those that are (not transferrable and optionally available), for example EE features such as audit logs\n strict(diffs: Diff[]) {\n return reject(diffs, isIgnorableStrict);\n },\n};\n\nconst compareSchemas = <T, P>(a: T, b: P, strategy: keyof typeof strategies) => {\n const diffs = utils.json.diff(a, b);\n return strategies[strategy](diffs);\n};\n\nexport { compareSchemas };\n"],"names":["OPTIONAL_CONTENT_TYPES","isAttributeIgnorable","diff","path","length","includes","isOptionalAdminType","isObject","value","name","info","singularName","Array","isArray","values","CUSTOM_ORDER_ATTRIBUTE","isCustomOrderAttribute","isIgnorableStrict","strategies","exact","diffs","strict","reject","compareSchemas","a","b","strategy","utils"],"mappings":";;;;;;;;AAKA,MAAMA,sBAAAA,GAAyB;AAAC,IAAA;AAAY,CAAA;AAE5C,MAAMC,uBAAuB,CAACC,IAAAA,GAAAA;AAC5B,IAAA,OACEA,KAAKC,IAAI,CAACC,MAAM,KAAK;AAErBF,IAAAA,IAAAA,CAAKC,IAAI,CAAC,CAAA,CAAE,KAAK;AAEjB,IAAA,OAAOD,KAAKC,IAAI,CAAC,CAAA,CAAE,KAAK;AAExB,IAAA;AAAC,QAAA,SAAA;AAAW,QAAA,UAAA;AAAY,QAAA,cAAA;AAAgB,QAAA;AAAU,KAAA,CAACE,QAAQ,CAACH,IAA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AAOE,OAAOF,KAAAA,EAAOH,iBAAAA,CAAAA;AACvB,IAAA;AACF,CAAA;AAEA,MAAMM,cAAAA,GAAiB,CAAOC,CAAAA,EAAMC,CAAAA,EAAMC,QAAAA,GAAAA;AACxC,IAAA,MAAMN,QAAQO,IAAe,CAACH,CAAAA,EAAGC,CAAAA,CAAAA;IACjC,OAAOP,UAAU,CAACQ,QAAAA,CAAS,CAACN,KAAAA,CAAAA;AAC9B;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/data-transfer",
3
- "version": "5.60.0",
3
+ "version": "5.61.0",
4
4
  "description": "Data transfer capabilities for Strapi",
5
5
  "keywords": [
6
6
  "strapi",
@@ -54,9 +54,9 @@
54
54
  "watch": "run -T rollup -c -w"
55
55
  },
56
56
  "dependencies": {
57
- "@strapi/logger": "5.60.0",
58
- "@strapi/types": "5.60.0",
59
- "@strapi/utils": "5.60.0",
57
+ "@strapi/logger": "5.61.0",
58
+ "@strapi/types": "5.61.0",
59
+ "@strapi/utils": "5.61.0",
60
60
  "chalk": "4.1.2",
61
61
  "cli-table3": "0.6.5",
62
62
  "commander": "8.3.0",
@@ -74,13 +74,13 @@
74
74
  "ws": "8.21.2"
75
75
  },
76
76
  "devDependencies": {
77
- "@strapi/database": "5.60.0",
77
+ "@strapi/database": "5.61.0",
78
78
  "@types/fs-extra": "11.0.4",
79
79
  "@types/jest": "29.5.2",
80
80
  "@types/koa": "2.15.2",
81
81
  "@types/lodash": "^4.14.191",
82
82
  "@types/mime-types": "2.1.1",
83
- "@types/node": "20.19.41",
83
+ "@types/node": "22.20.0",
84
84
  "@types/semver": "7.5.0",
85
85
  "@types/stream-chain": "2.0.1",
86
86
  "@types/stream-json": "1.7.8",
@@ -92,10 +92,10 @@
92
92
  "rimraf": "6.1.3",
93
93
  "typescript": "5.9.3",
94
94
  "vitest": "catalog:",
95
- "vitest-config": "5.60.0"
95
+ "vitest-config": "5.61.0"
96
96
  },
97
97
  "engines": {
98
- "node": ">=20.0.0 <=26.x.x",
98
+ "node": ">=22.0.0 <=26.x.x",
99
99
  "npm": ">=6.0.0"
100
100
  }
101
101
  }