aws-sdk-vitest-mock 0.6.0 → 0.7.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.
- package/README.md +3 -1
- package/index.cjs +5 -5
- package/index.js +210 -195
- package/lib/mock-client.d.ts +7 -4
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
<a href="https://www.npmjs.com/package/aws-sdk-vitest-mock">
|
|
13
13
|
<img src="https://img.shields.io/npm/v/aws-sdk-vitest-mock?color=cb3837&logo=npm" alt="npm version" />
|
|
14
14
|
</a>
|
|
15
|
+
<img alt="NPM Downloads" src="https://img.shields.io/npm/dm/aws-sdk-vitest-mock">
|
|
16
|
+
<img alt="GitHub Issues or Pull Requests" src="https://img.shields.io/github/issues/sudokar/aws-sdk-vitest-mock">
|
|
15
17
|
<a href="https://github.com/sudokar/aws-sdk-vitest-mock/actions">
|
|
16
18
|
<img src="https://github.com/sudokar/aws-sdk-vitest-mock/actions/workflows/ci.yml/badge.svg" alt="CI Status" />
|
|
17
19
|
</a>
|
|
18
|
-
<img src="https://img.shields.io/badge/ESM%20Support-yes-4B32C3?logo=
|
|
20
|
+
<img src="https://img.shields.io/badge/ESM%20Support-yes-4B32C3?logo=typescript" alt="ESM Support" />
|
|
19
21
|
<img src="https://img.shields.io/badge/Zero%20Dependencies-yes-brightgreen" alt="Zero Dependencies" />
|
|
20
22
|
<a href="https://eslint.org/">
|
|
21
23
|
<img src="https://img.shields.io/badge/code%20style-eslint-4B32C3?logo=eslint" alt="ESLint" />
|
package/index.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("vitest")
|
|
2
|
-
${
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("vitest"),$=require("./matchers-CNhdB_9q.cjs"),W=require("node:fs"),C=require("node:path"),I=require("node:stream");class d extends Error{constructor(t,o,s,n){super(t),this.name=o,this.code=o,this.statusCode=s,this.retryable=n}}const T=e=>new d(e?`The specified key does not exist. Key: ${e}`:"The specified key does not exist.","NoSuchKey",404,!1),M=e=>new d(e?`The specified bucket does not exist. Bucket: ${e}`:"The specified bucket does not exist.","NoSuchBucket",404,!1),K=e=>new d(e?`Access Denied for resource: ${e}`:"Access Denied","AccessDenied",403,!1),A=e=>new d(e?`Requested resource not found: ${e}`:"Requested resource not found","ResourceNotFoundException",400,!1),B=()=>new d("The conditional request failed","ConditionalCheckFailedException",400,!1),J=()=>new d("Rate exceeded","Throttling",400,!0),q=()=>new d("We encountered an internal error. Please try again.","InternalServerError",500,!0),_=e=>{try{return JSON.stringify(e,void 0,2)}catch{return typeof e=="object"&&e!==null?"[Complex Object]":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):"[Non-serializable value]"}},k=(e,t)=>{const o=$.colors.magenta("aws-sdk-vitest-mock(debug):");if(t===void 0)console.log(`${o} ${e}`);else{const s=_(t);console.log(`${o} ${e}
|
|
2
|
+
${s}`)}},w=(e=!1)=>({enabled:e,explicitlySet:!1,log(t,o){this.enabled&&k(t,o)},logDirect(t,o){k(t,o)}}),z=e=>{e.enabled=!0,e.explicitlySet=!0},V=e=>{e.enabled=!1,e.explicitlySet=!0},G=e=>{const t=C.resolve(e);try{const o=W.readFileSync(t,"utf8");if(e.endsWith(".json"))try{return JSON.parse(o)}catch(s){const n=s instanceof Error?s.message:String(s);throw new Error(`Failed to parse JSON fixture at ${t}: ${n}`)}return o}catch(o){const s=o instanceof Error?o.message:String(o);throw new Error(`Failed to load fixture at ${t}: ${s}`)}},U=(e,t={})=>{const{pageSize:o=10,tokenKey:s="NextToken",itemsKey:n="Items"}=t;if(e.length===0)return[{[n]:[]}];const c=[];for(let r=0;r<e.length;r+=o){const i=e.slice(r,r+o),l=r+o<e.length,u={[n]:i};if(l){const a=u,f=i[i.length-1];a[s]=f}c.push(u)}return c},H=()=>typeof process<"u"&&process.versions?.node?"node":typeof process<"u"&&process.versions?.bun?"bun":"browser",Q=e=>{const t=typeof e=="string"?Buffer.from(e,"utf8"):Buffer.from(e);let o=!1;return new I.Readable({read(){o||(this.push(t),this.push(null),o=!0)}})},X=e=>{let t;return typeof e=="string"?t=new TextEncoder().encode(e):e instanceof Buffer?t=new Uint8Array(e):t=e,new ReadableStream({start(o){o.enqueue(t),o.close()}})},S=e=>{const t=H();return t==="node"||t==="bun"?Q(e):X(e)};let D=!1;function Y(e){D=e}function b(e){return e.explicitlySet?e.enabled:D}function E(e,t){return Object.keys(t).every(o=>{const s=t[o],n=e[o];return s&&typeof s=="object"&&!Array.isArray(s)?typeof n!="object"||n===null?!1:E(n,s):n===s})}function N(e,t){if(e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return e===t;const o=Object.keys(e),s=Object.keys(t);return o.length!==s.length?!1:s.every(n=>{if(!Object.prototype.hasOwnProperty.call(e,n))return!1;const c=e,r=t,i=c[n],l=r[n];return typeof i=="object"&&i!==null&&typeof l=="object"&&l!==null?N(i,l):i===l})}function Z(e,t,o){const s=t.map((c,r)=>{const i=c.matcher?JSON.stringify(c.matcher,void 0,2):"any input",l=c.strict?" (strict mode)":"";return` Mock #${r+1}: ${i}${l}`}).join(`
|
|
3
3
|
`),n=JSON.stringify(o,void 0,2);return new Error(`No matching mock found for ${e}.
|
|
4
4
|
|
|
5
5
|
Found ${t.length} mock(s) but none matched the input.
|
|
6
6
|
|
|
7
7
|
Configured mocks:
|
|
8
|
-
${
|
|
8
|
+
${s}
|
|
9
9
|
|
|
10
10
|
Received input:
|
|
11
11
|
${n}
|
|
12
12
|
|
|
13
|
-
Tip: Enable debug mode with enableDebug() for detailed matching information.`)}function
|
|
13
|
+
Tip: Enable debug mode with enableDebug() for detailed matching information.`)}function ee(e,t){const o=JSON.stringify(t,void 0,2);return new Error(`No mock configured for command: ${e}.
|
|
14
14
|
|
|
15
15
|
Received input:
|
|
16
16
|
${o}
|
|
17
17
|
|
|
18
|
-
Did you forget to call mockClient.on(${e})?`)}function
|
|
18
|
+
Did you forget to call mockClient.on(${e})?`)}function te(e,t){return e.findIndex(o=>o.strict?o.matcher&&N(t,o.matcher):!o.matcher||E(t,o.matcher))}function x(e){return async function(t){const o=()=>this,s=b(e.debugLogger),n=t.constructor.name;s&&e.debugLogger.logDirect(`Received command: ${n}`,t.input);const c=e.map.get(t.constructor);if(!c)throw s&&e.debugLogger.logDirect(`No mocks configured for ${n}`),ee(n,t.input);s&&e.debugLogger.logDirect(`Found ${c.length} mock(s) for ${n}`);const r=te(c,t.input);if(r===-1)throw s&&e.debugLogger.logDirect(`No matching mock found for ${n}`,t.input),Z(n,c,t.input);const i=c[r];if(!i)throw new Error(`Mock at index ${r} not found`);return s&&e.debugLogger.logDirect(`Using mock at index ${r} for ${n}`),i.once&&(c.splice(r,1),s&&e.debugLogger.logDirect(`Removed one-time mock for ${n}`)),i.handler(t.input,o())}}const L=(e,t,o)=>({reset(){b(e.debugLogger)&&e.debugLogger.logDirect(o.reset),t.mockClear()},restore(){b(e.debugLogger)&&e.debugLogger.logDirect(o.restore),t.mockRestore(),e.map=new WeakMap},calls(){return t.mock.calls.map(s=>s[0])},__rawCalls(){return t.mock.calls},enableDebug(){z(e.debugLogger)},disableDebug(){V(e.debugLogger)}});function R(e,t,o,s={}){const n=(r,i,l)=>{const u={matcher:o,handler:r,once:i,strict:!!s.strict},a=e.map.get(t)??[],f=b(e.debugLogger);if(i){const g=a.findIndex(h=>!h.once);g===-1?a.push(u):a.splice(g,0,u),e.map.set(t,a),f&&e.debugLogger.logDirect(`Configured ${l}Once for ${t.name}`,o?{matcher:o,strict:!!s.strict}:void 0)}else{const g=a.filter(h=>h.once||JSON.stringify(h.matcher)!==JSON.stringify(o));g.push(u),e.map.set(t,g),f&&e.debugLogger.logDirect(`Configured ${l} for ${t.name}`,o?{matcher:o,strict:!!s.strict}:void 0)}},c={resolves(r){return n(()=>Promise.resolve(r),!1,"resolves"),c},rejects(r){return n(()=>{const i=typeof r=="string"?new Error(r):r;return Promise.reject(i)},!1,"rejects"),c},callsFake(r){return n(r,!1,"callsFake"),c},resolvesOnce(r){return n(()=>Promise.resolve(r),!0,"resolves"),c},rejectsOnce(r){return n(()=>{const i=typeof r=="string"?new Error(r):r;return Promise.reject(i)},!0,"rejects"),c},callsFakeOnce(r){return n(r,!0,"callsFake"),c},resolvesStream(r){return n(()=>Promise.resolve({Body:S(r)}),!1,"resolvesStream"),c},resolvesStreamOnce(r){return n(()=>Promise.resolve({Body:S(r)}),!0,"resolvesStream"),c},resolvesWithDelay(r,i){const l=u=>{setTimeout(()=>u(r),i)};return n(()=>new Promise(l),!1,"resolvesWithDelay"),c},rejectsWithDelay(r,i){const l=typeof r=="string"?new Error(r):r,u=(a,f)=>{setTimeout(()=>f(l),i)};return n(()=>new Promise(u),!1,"rejectsWithDelay"),c},rejectsWithNoSuchKey(r){return n(()=>Promise.reject(T(r)),!1,"rejectsWithNoSuchKey"),c},rejectsWithNoSuchBucket(r){return n(()=>Promise.reject(M(r)),!1,"rejectsWithNoSuchBucket"),c},rejectsWithAccessDenied(r){return n(()=>Promise.reject(K(r)),!1,"rejectsWithAccessDenied"),c},rejectsWithResourceNotFound(r){return n(()=>Promise.reject(A(r)),!1,"rejectsWithResourceNotFound"),c},rejectsWithConditionalCheckFailed(){return n(()=>Promise.reject(B()),!1,"rejectsWithConditionalCheckFailed"),c},rejectsWithThrottling(){return n(()=>Promise.reject(J()),!1,"rejectsWithThrottling"),c},rejectsWithInternalServerError(){return n(()=>Promise.reject(q()),!1,"rejectsWithInternalServerError"),c},resolvesPaginated(r,i={}){const l=U(r,i);let u=0;return e.debugLogger.log(`Configured resolvesPaginated for ${t.name}`,{pageSize:i.pageSize,itemsCount:r.length}),n(a=>{const f=i.tokenKey||"NextToken",g=i.inputTokenKey||f,m=a[g];if(m!=null){const F=i.itemsKey||"Items";let v=0;for(const O of l){const p=O[F];if(p&&p.length>0){const P=p[p.length-1];if(JSON.stringify(P)===JSON.stringify(m)){u=v+1;break}}v++}}else u=0;const y=l[u]||l[l.length-1]||l[0];if(!y)throw new Error("No paginated responses available");return u=Math.min(u+1,l.length-1),Promise.resolve(y)},!1,"resolvesPaginated"),c},resolvesFromFile(r){return e.debugLogger.log(`Configured resolvesFromFile for ${t.name}`,{filePath:r}),n(()=>{const i=G(r);return Promise.resolve(i)},!1,"resolvesFromFile"),c}};return c}const re=e=>{const t={map:new WeakMap,debugLogger:w()},o=e.prototype,s=j.vi.spyOn(o,"send").mockImplementation(x(t)),n=L(t,s,{reset:"Clearing call history (mocks preserved)",restore:"Restoring original client behavior and clearing all mocks"});return{client:void 0,on:(r,i,l)=>R(t,r,i,l),...n}},oe=e=>{const t={map:new WeakMap,debugLogger:w()},o=j.vi.spyOn(e,"send").mockImplementation(x(t)),s=L(t,o,{reset:"Clearing call history (mocks preserved) for client instance",restore:"Restoring original client behavior and clearing all mocks for client instance"});return{client:e,on:(c,r,i)=>R(t,c,r,i),...s}};exports.matchers=$.matchers;exports.mockClient=re;exports.mockClientInstance=oe;exports.setGlobalDebug=Y;
|
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { vi as j } from "vitest";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as O } from "./matchers-DmTtFk31.js";
|
|
3
3
|
import { m as ge } from "./matchers-DmTtFk31.js";
|
|
4
|
-
import { readFileSync as
|
|
5
|
-
import
|
|
6
|
-
import { Readable as
|
|
4
|
+
import { readFileSync as P } from "node:fs";
|
|
5
|
+
import C from "node:path";
|
|
6
|
+
import { Readable as I } from "node:stream";
|
|
7
7
|
class d extends Error {
|
|
8
|
-
constructor(t, o,
|
|
9
|
-
super(t), this.name =
|
|
8
|
+
constructor(t, o, s, n) {
|
|
9
|
+
super(t), this.name = o, this.code = o, this.statusCode = s, this.retryable = n;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
const T = (e) => new d(
|
|
@@ -14,27 +14,27 @@ const T = (e) => new d(
|
|
|
14
14
|
"NoSuchKey",
|
|
15
15
|
404,
|
|
16
16
|
!1
|
|
17
|
-
),
|
|
17
|
+
), M = (e) => new d(
|
|
18
18
|
e ? `The specified bucket does not exist. Bucket: ${e}` : "The specified bucket does not exist.",
|
|
19
19
|
"NoSuchBucket",
|
|
20
20
|
404,
|
|
21
21
|
!1
|
|
22
|
-
),
|
|
22
|
+
), K = (e) => new d(
|
|
23
23
|
e ? `Access Denied for resource: ${e}` : "Access Denied",
|
|
24
24
|
"AccessDenied",
|
|
25
25
|
403,
|
|
26
26
|
!1
|
|
27
|
-
),
|
|
27
|
+
), A = (e) => new d(
|
|
28
28
|
e ? `Requested resource not found: ${e}` : "Requested resource not found",
|
|
29
29
|
"ResourceNotFoundException",
|
|
30
30
|
400,
|
|
31
31
|
!1
|
|
32
|
-
),
|
|
32
|
+
), B = () => new d(
|
|
33
33
|
"The conditional request failed",
|
|
34
34
|
"ConditionalCheckFailedException",
|
|
35
35
|
400,
|
|
36
36
|
!1
|
|
37
|
-
),
|
|
37
|
+
), J = () => new d("Rate exceeded", "Throttling", 400, !0), q = () => new d(
|
|
38
38
|
"We encountered an internal error. Please try again.",
|
|
39
39
|
"InternalServerError",
|
|
40
40
|
500,
|
|
@@ -45,54 +45,69 @@ const T = (e) => new d(
|
|
|
45
45
|
} catch {
|
|
46
46
|
return typeof e == "object" && e !== null ? "[Complex Object]" : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : "[Non-serializable value]";
|
|
47
47
|
}
|
|
48
|
-
},
|
|
49
|
-
const o =
|
|
48
|
+
}, k = (e, t) => {
|
|
49
|
+
const o = O.magenta("aws-sdk-vitest-mock(debug):");
|
|
50
50
|
if (t === void 0)
|
|
51
51
|
console.log(`${o} ${e}`);
|
|
52
52
|
else {
|
|
53
|
-
const
|
|
53
|
+
const s = z(t);
|
|
54
54
|
console.log(`${o} ${e}
|
|
55
|
-
${
|
|
55
|
+
${s}`);
|
|
56
56
|
}
|
|
57
|
-
},
|
|
57
|
+
}, $ = (e = !1) => ({
|
|
58
58
|
enabled: e,
|
|
59
59
|
explicitlySet: !1,
|
|
60
60
|
log(t, o) {
|
|
61
|
-
this.enabled &&
|
|
61
|
+
this.enabled && k(t, o);
|
|
62
62
|
},
|
|
63
63
|
logDirect(t, o) {
|
|
64
|
-
|
|
64
|
+
k(t, o);
|
|
65
65
|
}
|
|
66
|
-
}),
|
|
66
|
+
}), V = (e) => {
|
|
67
67
|
e.enabled = !0, e.explicitlySet = !0;
|
|
68
|
-
},
|
|
68
|
+
}, _ = (e) => {
|
|
69
69
|
e.enabled = !1, e.explicitlySet = !0;
|
|
70
|
-
},
|
|
71
|
-
const t =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
}, U = (e) => {
|
|
71
|
+
const t = C.resolve(e);
|
|
72
|
+
try {
|
|
73
|
+
const o = P(t, "utf8");
|
|
74
|
+
if (e.endsWith(".json"))
|
|
75
|
+
try {
|
|
76
|
+
return JSON.parse(o);
|
|
77
|
+
} catch (s) {
|
|
78
|
+
const n = s instanceof Error ? s.message : String(s);
|
|
79
|
+
throw new Error(
|
|
80
|
+
`Failed to parse JSON fixture at ${t}: ${n}`
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return o;
|
|
84
|
+
} catch (o) {
|
|
85
|
+
const s = o instanceof Error ? o.message : String(o);
|
|
86
|
+
throw new Error(`Failed to load fixture at ${t}: ${s}`);
|
|
87
|
+
}
|
|
88
|
+
}, G = (e, t = {}) => {
|
|
89
|
+
const { pageSize: o = 10, tokenKey: s = "NextToken", itemsKey: n = "Items" } = t;
|
|
75
90
|
if (e.length === 0)
|
|
76
91
|
return [{ [n]: [] }];
|
|
77
|
-
const
|
|
92
|
+
const c = [];
|
|
78
93
|
for (let r = 0; r < e.length; r += o) {
|
|
79
|
-
const
|
|
94
|
+
const i = e.slice(r, r + o), l = r + o < e.length, u = { [n]: i };
|
|
80
95
|
if (l) {
|
|
81
|
-
const a = u,
|
|
82
|
-
a[
|
|
96
|
+
const a = u, f = i[i.length - 1];
|
|
97
|
+
a[s] = f;
|
|
83
98
|
}
|
|
84
|
-
|
|
99
|
+
c.push(u);
|
|
85
100
|
}
|
|
86
|
-
return
|
|
87
|
-
},
|
|
101
|
+
return c;
|
|
102
|
+
}, H = () => typeof process < "u" && process.versions?.node ? "node" : typeof process < "u" && process.versions?.bun ? "bun" : "browser", Q = (e) => {
|
|
88
103
|
const t = typeof e == "string" ? Buffer.from(e, "utf8") : Buffer.from(e);
|
|
89
104
|
let o = !1;
|
|
90
|
-
return new
|
|
105
|
+
return new I({
|
|
91
106
|
read() {
|
|
92
107
|
o || (this.push(t), this.push(null), o = !0);
|
|
93
108
|
}
|
|
94
109
|
});
|
|
95
|
-
},
|
|
110
|
+
}, X = (e) => {
|
|
96
111
|
let t;
|
|
97
112
|
return typeof e == "string" ? t = new TextEncoder().encode(e) : e instanceof Buffer ? t = new Uint8Array(e) : t = e, new ReadableStream({
|
|
98
113
|
start(o) {
|
|
@@ -100,40 +115,40 @@ ${i}`);
|
|
|
100
115
|
}
|
|
101
116
|
});
|
|
102
117
|
}, S = (e) => {
|
|
103
|
-
const t =
|
|
104
|
-
return t === "node" || t === "bun" ?
|
|
118
|
+
const t = H();
|
|
119
|
+
return t === "node" || t === "bun" ? Q(e) : X(e);
|
|
105
120
|
};
|
|
106
|
-
let
|
|
107
|
-
function
|
|
108
|
-
|
|
121
|
+
let w = !1;
|
|
122
|
+
function ie(e) {
|
|
123
|
+
w = e;
|
|
109
124
|
}
|
|
110
|
-
function
|
|
111
|
-
return e.explicitlySet ? e.enabled :
|
|
125
|
+
function m(e) {
|
|
126
|
+
return e.explicitlySet ? e.enabled : w;
|
|
112
127
|
}
|
|
113
|
-
function
|
|
128
|
+
function E(e, t) {
|
|
114
129
|
return Object.keys(t).every((o) => {
|
|
115
|
-
const
|
|
116
|
-
return
|
|
130
|
+
const s = t[o], n = e[o];
|
|
131
|
+
return s && typeof s == "object" && !Array.isArray(s) ? typeof n != "object" || n === null ? !1 : E(
|
|
117
132
|
n,
|
|
118
|
-
|
|
119
|
-
) : n ===
|
|
133
|
+
s
|
|
134
|
+
) : n === s;
|
|
120
135
|
});
|
|
121
136
|
}
|
|
122
|
-
function
|
|
137
|
+
function N(e, t) {
|
|
123
138
|
if (e === t) return !0;
|
|
124
139
|
if (typeof e != "object" || e === null || typeof t != "object" || t === null)
|
|
125
140
|
return e === t;
|
|
126
|
-
const o = Object.keys(e),
|
|
127
|
-
return o.length !==
|
|
141
|
+
const o = Object.keys(e), s = Object.keys(t);
|
|
142
|
+
return o.length !== s.length ? !1 : s.every((n) => {
|
|
128
143
|
if (!Object.prototype.hasOwnProperty.call(e, n)) return !1;
|
|
129
|
-
const
|
|
130
|
-
return typeof
|
|
144
|
+
const c = e, r = t, i = c[n], l = r[n];
|
|
145
|
+
return typeof i == "object" && i !== null && typeof l == "object" && l !== null ? N(i, l) : i === l;
|
|
131
146
|
});
|
|
132
147
|
}
|
|
133
|
-
function
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
return ` Mock #${r + 1}: ${
|
|
148
|
+
function Y(e, t, o) {
|
|
149
|
+
const s = t.map((c, r) => {
|
|
150
|
+
const i = c.matcher ? JSON.stringify(c.matcher, void 0, 2) : "any input", l = c.strict ? " (strict mode)" : "";
|
|
151
|
+
return ` Mock #${r + 1}: ${i}${l}`;
|
|
137
152
|
}).join(`
|
|
138
153
|
`), n = JSON.stringify(o, void 0, 2);
|
|
139
154
|
return new Error(
|
|
@@ -142,7 +157,7 @@ function X(e, t, o) {
|
|
|
142
157
|
Found ${t.length} mock(s) but none matched the input.
|
|
143
158
|
|
|
144
159
|
Configured mocks:
|
|
145
|
-
${
|
|
160
|
+
${s}
|
|
146
161
|
|
|
147
162
|
Received input:
|
|
148
163
|
${n}
|
|
@@ -150,7 +165,7 @@ ${n}
|
|
|
150
165
|
Tip: Enable debug mode with enableDebug() for detailed matching information.`
|
|
151
166
|
);
|
|
152
167
|
}
|
|
153
|
-
function
|
|
168
|
+
function Z(e, t) {
|
|
154
169
|
const o = JSON.stringify(t, void 0, 2);
|
|
155
170
|
return new Error(
|
|
156
171
|
`No mock configured for command: ${e}.
|
|
@@ -161,201 +176,229 @@ ${o}
|
|
|
161
176
|
Did you forget to call mockClient.on(${e})?`
|
|
162
177
|
);
|
|
163
178
|
}
|
|
164
|
-
function
|
|
165
|
-
return e.findIndex((o) => o.strict ? o.matcher &&
|
|
179
|
+
function ee(e, t) {
|
|
180
|
+
return e.findIndex((o) => o.strict ? o.matcher && N(t, o.matcher) : !o.matcher || E(t, o.matcher));
|
|
166
181
|
}
|
|
167
|
-
function
|
|
182
|
+
function x(e) {
|
|
168
183
|
return async function(t) {
|
|
169
|
-
const o = () => this,
|
|
170
|
-
|
|
184
|
+
const o = () => this, s = m(e.debugLogger), n = t.constructor.name;
|
|
185
|
+
s && e.debugLogger.logDirect(
|
|
171
186
|
`Received command: ${n}`,
|
|
172
187
|
t.input
|
|
173
188
|
);
|
|
174
|
-
const
|
|
189
|
+
const c = e.map.get(
|
|
175
190
|
t.constructor
|
|
176
191
|
);
|
|
177
|
-
if (!
|
|
178
|
-
throw
|
|
192
|
+
if (!c)
|
|
193
|
+
throw s && e.debugLogger.logDirect(
|
|
179
194
|
`No mocks configured for ${n}`
|
|
180
|
-
),
|
|
181
|
-
|
|
182
|
-
`Found ${
|
|
195
|
+
), Z(n, t.input);
|
|
196
|
+
s && e.debugLogger.logDirect(
|
|
197
|
+
`Found ${c.length} mock(s) for ${n}`
|
|
183
198
|
);
|
|
184
|
-
const r =
|
|
199
|
+
const r = ee(c, t.input);
|
|
185
200
|
if (r === -1)
|
|
186
|
-
throw
|
|
201
|
+
throw s && e.debugLogger.logDirect(
|
|
187
202
|
`No matching mock found for ${n}`,
|
|
188
203
|
t.input
|
|
189
|
-
),
|
|
190
|
-
const
|
|
191
|
-
if (!
|
|
204
|
+
), Y(n, c, t.input);
|
|
205
|
+
const i = c[r];
|
|
206
|
+
if (!i)
|
|
192
207
|
throw new Error(`Mock at index ${r} not found`);
|
|
193
|
-
return
|
|
208
|
+
return s && e.debugLogger.logDirect(
|
|
194
209
|
`Using mock at index ${r} for ${n}`
|
|
195
|
-
),
|
|
210
|
+
), i.once && (c.splice(r, 1), s && e.debugLogger.logDirect(
|
|
196
211
|
`Removed one-time mock for ${n}`
|
|
197
|
-
)),
|
|
212
|
+
)), i.handler(t.input, o());
|
|
198
213
|
};
|
|
199
214
|
}
|
|
200
|
-
|
|
201
|
-
|
|
215
|
+
const D = (e, t, o) => ({
|
|
216
|
+
reset() {
|
|
217
|
+
m(e.debugLogger) && e.debugLogger.logDirect(o.reset), t.mockClear();
|
|
218
|
+
},
|
|
219
|
+
restore() {
|
|
220
|
+
m(e.debugLogger) && e.debugLogger.logDirect(o.restore), t.mockRestore(), e.map = /* @__PURE__ */ new WeakMap();
|
|
221
|
+
},
|
|
222
|
+
calls() {
|
|
223
|
+
return t.mock.calls.map((s) => s[0]);
|
|
224
|
+
},
|
|
225
|
+
__rawCalls() {
|
|
226
|
+
return t.mock.calls;
|
|
227
|
+
},
|
|
228
|
+
enableDebug() {
|
|
229
|
+
V(e.debugLogger);
|
|
230
|
+
},
|
|
231
|
+
disableDebug() {
|
|
232
|
+
_(e.debugLogger);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
function L(e, t, o, s = {}) {
|
|
236
|
+
const n = (r, i, l) => {
|
|
202
237
|
const u = {
|
|
203
238
|
matcher: o,
|
|
204
239
|
handler: r,
|
|
205
|
-
once:
|
|
206
|
-
strict: !!
|
|
207
|
-
}, a = e.map.get(t) ?? [],
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
|
|
240
|
+
once: i,
|
|
241
|
+
strict: !!s.strict
|
|
242
|
+
}, a = e.map.get(t) ?? [], f = m(e.debugLogger);
|
|
243
|
+
if (i) {
|
|
244
|
+
const g = a.findIndex((h) => !h.once);
|
|
245
|
+
g === -1 ? a.push(u) : a.splice(g, 0, u), e.map.set(
|
|
211
246
|
t,
|
|
212
247
|
a
|
|
213
|
-
),
|
|
248
|
+
), f && e.debugLogger.logDirect(
|
|
214
249
|
`Configured ${l}Once for ${t.name}`,
|
|
215
|
-
o ? { matcher: o, strict: !!
|
|
250
|
+
o ? { matcher: o, strict: !!s.strict } : void 0
|
|
216
251
|
);
|
|
217
252
|
} else {
|
|
218
|
-
const
|
|
253
|
+
const g = a.filter(
|
|
219
254
|
(h) => h.once || JSON.stringify(h.matcher) !== JSON.stringify(o)
|
|
220
255
|
);
|
|
221
|
-
|
|
256
|
+
g.push(u), e.map.set(
|
|
222
257
|
t,
|
|
223
|
-
|
|
224
|
-
),
|
|
258
|
+
g
|
|
259
|
+
), f && e.debugLogger.logDirect(
|
|
225
260
|
`Configured ${l} for ${t.name}`,
|
|
226
|
-
o ? { matcher: o, strict: !!
|
|
261
|
+
o ? { matcher: o, strict: !!s.strict } : void 0
|
|
227
262
|
);
|
|
228
263
|
}
|
|
229
|
-
},
|
|
264
|
+
}, c = {
|
|
230
265
|
resolves(r) {
|
|
231
|
-
return n(() => Promise.resolve(r), !1, "resolves"),
|
|
266
|
+
return n(() => Promise.resolve(r), !1, "resolves"), c;
|
|
232
267
|
},
|
|
233
268
|
rejects(r) {
|
|
234
269
|
return n(
|
|
235
270
|
() => {
|
|
236
|
-
const
|
|
237
|
-
return Promise.reject(
|
|
271
|
+
const i = typeof r == "string" ? new Error(r) : r;
|
|
272
|
+
return Promise.reject(i);
|
|
238
273
|
},
|
|
239
274
|
!1,
|
|
240
275
|
"rejects"
|
|
241
|
-
),
|
|
276
|
+
), c;
|
|
242
277
|
},
|
|
243
278
|
callsFake(r) {
|
|
244
|
-
return n(r, !1, "callsFake"),
|
|
279
|
+
return n(r, !1, "callsFake"), c;
|
|
245
280
|
},
|
|
246
281
|
resolvesOnce(r) {
|
|
247
|
-
return n(() => Promise.resolve(r), !0, "resolves"),
|
|
282
|
+
return n(() => Promise.resolve(r), !0, "resolves"), c;
|
|
248
283
|
},
|
|
249
284
|
rejectsOnce(r) {
|
|
250
285
|
return n(
|
|
251
286
|
() => {
|
|
252
|
-
const
|
|
253
|
-
return Promise.reject(
|
|
287
|
+
const i = typeof r == "string" ? new Error(r) : r;
|
|
288
|
+
return Promise.reject(i);
|
|
254
289
|
},
|
|
255
290
|
!0,
|
|
256
291
|
"rejects"
|
|
257
|
-
),
|
|
292
|
+
), c;
|
|
258
293
|
},
|
|
259
294
|
callsFakeOnce(r) {
|
|
260
|
-
return n(r, !0, "callsFake"),
|
|
295
|
+
return n(r, !0, "callsFake"), c;
|
|
261
296
|
},
|
|
262
297
|
resolvesStream(r) {
|
|
263
298
|
return n(
|
|
264
|
-
() => Promise.resolve({
|
|
299
|
+
() => Promise.resolve({
|
|
300
|
+
Body: S(r)
|
|
301
|
+
}),
|
|
265
302
|
!1,
|
|
266
303
|
"resolvesStream"
|
|
267
|
-
),
|
|
304
|
+
), c;
|
|
268
305
|
},
|
|
269
306
|
resolvesStreamOnce(r) {
|
|
270
307
|
return n(
|
|
271
|
-
() => Promise.resolve({
|
|
308
|
+
() => Promise.resolve({
|
|
309
|
+
Body: S(r)
|
|
310
|
+
}),
|
|
272
311
|
!0,
|
|
273
312
|
"resolvesStream"
|
|
274
|
-
),
|
|
313
|
+
), c;
|
|
275
314
|
},
|
|
276
|
-
resolvesWithDelay(r,
|
|
315
|
+
resolvesWithDelay(r, i) {
|
|
277
316
|
const l = (u) => {
|
|
278
|
-
setTimeout(() => u(r),
|
|
317
|
+
setTimeout(() => u(r), i);
|
|
279
318
|
};
|
|
280
|
-
return n(
|
|
319
|
+
return n(
|
|
320
|
+
() => new Promise(l),
|
|
321
|
+
!1,
|
|
322
|
+
"resolvesWithDelay"
|
|
323
|
+
), c;
|
|
281
324
|
},
|
|
282
|
-
rejectsWithDelay(r,
|
|
283
|
-
const l = typeof r == "string" ? new Error(r) : r, u = (a,
|
|
284
|
-
setTimeout(() =>
|
|
325
|
+
rejectsWithDelay(r, i) {
|
|
326
|
+
const l = typeof r == "string" ? new Error(r) : r, u = (a, f) => {
|
|
327
|
+
setTimeout(() => f(l), i);
|
|
285
328
|
};
|
|
286
|
-
return n(() => new Promise(u), !1, "rejectsWithDelay"),
|
|
329
|
+
return n(() => new Promise(u), !1, "rejectsWithDelay"), c;
|
|
287
330
|
},
|
|
288
331
|
rejectsWithNoSuchKey(r) {
|
|
289
332
|
return n(
|
|
290
333
|
() => Promise.reject(T(r)),
|
|
291
334
|
!1,
|
|
292
335
|
"rejectsWithNoSuchKey"
|
|
293
|
-
),
|
|
336
|
+
), c;
|
|
294
337
|
},
|
|
295
338
|
rejectsWithNoSuchBucket(r) {
|
|
296
339
|
return n(
|
|
297
|
-
() => Promise.reject(
|
|
340
|
+
() => Promise.reject(M(r)),
|
|
298
341
|
!1,
|
|
299
342
|
"rejectsWithNoSuchBucket"
|
|
300
|
-
),
|
|
343
|
+
), c;
|
|
301
344
|
},
|
|
302
345
|
rejectsWithAccessDenied(r) {
|
|
303
346
|
return n(
|
|
304
|
-
() => Promise.reject(
|
|
347
|
+
() => Promise.reject(K(r)),
|
|
305
348
|
!1,
|
|
306
349
|
"rejectsWithAccessDenied"
|
|
307
|
-
),
|
|
350
|
+
), c;
|
|
308
351
|
},
|
|
309
352
|
rejectsWithResourceNotFound(r) {
|
|
310
353
|
return n(
|
|
311
|
-
() => Promise.reject(
|
|
354
|
+
() => Promise.reject(A(r)),
|
|
312
355
|
!1,
|
|
313
356
|
"rejectsWithResourceNotFound"
|
|
314
|
-
),
|
|
357
|
+
), c;
|
|
315
358
|
},
|
|
316
359
|
rejectsWithConditionalCheckFailed() {
|
|
317
360
|
return n(
|
|
318
|
-
() => Promise.reject(
|
|
361
|
+
() => Promise.reject(B()),
|
|
319
362
|
!1,
|
|
320
363
|
"rejectsWithConditionalCheckFailed"
|
|
321
|
-
),
|
|
364
|
+
), c;
|
|
322
365
|
},
|
|
323
366
|
rejectsWithThrottling() {
|
|
324
367
|
return n(
|
|
325
|
-
() => Promise.reject(
|
|
368
|
+
() => Promise.reject(J()),
|
|
326
369
|
!1,
|
|
327
370
|
"rejectsWithThrottling"
|
|
328
|
-
),
|
|
371
|
+
), c;
|
|
329
372
|
},
|
|
330
373
|
rejectsWithInternalServerError() {
|
|
331
374
|
return n(
|
|
332
375
|
() => Promise.reject(q()),
|
|
333
376
|
!1,
|
|
334
377
|
"rejectsWithInternalServerError"
|
|
335
|
-
),
|
|
378
|
+
), c;
|
|
336
379
|
},
|
|
337
|
-
resolvesPaginated(r,
|
|
338
|
-
const l =
|
|
380
|
+
resolvesPaginated(r, i = {}) {
|
|
381
|
+
const l = G(r, i);
|
|
339
382
|
let u = 0;
|
|
340
383
|
return e.debugLogger.log(
|
|
341
384
|
`Configured resolvesPaginated for ${t.name}`,
|
|
342
|
-
{ pageSize:
|
|
385
|
+
{ pageSize: i.pageSize, itemsCount: r.length }
|
|
343
386
|
), n(
|
|
344
387
|
(a) => {
|
|
345
|
-
const
|
|
388
|
+
const f = i.tokenKey || "NextToken", g = i.inputTokenKey || f, b = a[g];
|
|
346
389
|
if (b != null) {
|
|
347
|
-
const R =
|
|
348
|
-
let
|
|
349
|
-
for (const
|
|
350
|
-
const
|
|
351
|
-
if (
|
|
352
|
-
const
|
|
353
|
-
if (JSON.stringify(
|
|
354
|
-
u =
|
|
390
|
+
const R = i.itemsKey || "Items";
|
|
391
|
+
let v = 0;
|
|
392
|
+
for (const F of l) {
|
|
393
|
+
const p = F[R];
|
|
394
|
+
if (p && p.length > 0) {
|
|
395
|
+
const W = p[p.length - 1];
|
|
396
|
+
if (JSON.stringify(W) === JSON.stringify(b)) {
|
|
397
|
+
u = v + 1;
|
|
355
398
|
break;
|
|
356
399
|
}
|
|
357
400
|
}
|
|
358
|
-
|
|
401
|
+
v++;
|
|
359
402
|
}
|
|
360
403
|
} else
|
|
361
404
|
u = 0;
|
|
@@ -370,7 +413,7 @@ function C(e, t, o, i = {}) {
|
|
|
370
413
|
},
|
|
371
414
|
!1,
|
|
372
415
|
"resolvesPaginated"
|
|
373
|
-
),
|
|
416
|
+
), c;
|
|
374
417
|
},
|
|
375
418
|
resolvesFromFile(r) {
|
|
376
419
|
return e.debugLogger.log(
|
|
@@ -378,84 +421,56 @@ function C(e, t, o, i = {}) {
|
|
|
378
421
|
{ filePath: r }
|
|
379
422
|
), n(
|
|
380
423
|
() => {
|
|
381
|
-
const
|
|
382
|
-
return Promise.resolve(
|
|
424
|
+
const i = U(r);
|
|
425
|
+
return Promise.resolve(i);
|
|
383
426
|
},
|
|
384
427
|
!1,
|
|
385
428
|
"resolvesFromFile"
|
|
386
|
-
),
|
|
429
|
+
), c;
|
|
387
430
|
}
|
|
388
431
|
};
|
|
389
|
-
return
|
|
432
|
+
return c;
|
|
390
433
|
}
|
|
391
|
-
const
|
|
434
|
+
const le = (e) => {
|
|
392
435
|
const t = {
|
|
393
436
|
map: /* @__PURE__ */ new WeakMap(),
|
|
394
|
-
debugLogger:
|
|
395
|
-
}, o = e.prototype,
|
|
437
|
+
debugLogger: $()
|
|
438
|
+
}, o = e.prototype, s = j.spyOn(o, "send").mockImplementation(x(t)), n = D(t, s, {
|
|
439
|
+
reset: "Clearing call history (mocks preserved)",
|
|
440
|
+
restore: "Restoring original client behavior and clearing all mocks"
|
|
441
|
+
});
|
|
396
442
|
return {
|
|
397
443
|
client: void 0,
|
|
398
|
-
on: (
|
|
444
|
+
on: (r, i, l) => L(
|
|
399
445
|
t,
|
|
400
|
-
s,
|
|
401
446
|
r,
|
|
402
|
-
|
|
447
|
+
i,
|
|
448
|
+
l
|
|
403
449
|
),
|
|
404
|
-
|
|
405
|
-
p(t.debugLogger) && t.debugLogger.logDirect(
|
|
406
|
-
"Clearing call history (mocks preserved)"
|
|
407
|
-
), i.mockClear();
|
|
408
|
-
},
|
|
409
|
-
restore: () => {
|
|
410
|
-
p(t.debugLogger) && t.debugLogger.logDirect(
|
|
411
|
-
"Restoring original client behavior and clearing all mocks"
|
|
412
|
-
), i.mockRestore(), t.map = /* @__PURE__ */ new WeakMap();
|
|
413
|
-
},
|
|
414
|
-
calls: () => i.mock.calls.map((s) => s[0]),
|
|
415
|
-
__rawCalls: () => i.mock.calls,
|
|
416
|
-
enableDebug: () => {
|
|
417
|
-
w(t.debugLogger);
|
|
418
|
-
},
|
|
419
|
-
disableDebug: () => {
|
|
420
|
-
D(t.debugLogger);
|
|
421
|
-
}
|
|
450
|
+
...n
|
|
422
451
|
};
|
|
423
|
-
},
|
|
452
|
+
}, ue = (e) => {
|
|
424
453
|
const t = {
|
|
425
454
|
map: /* @__PURE__ */ new WeakMap(),
|
|
426
|
-
debugLogger:
|
|
427
|
-
}, o = j.spyOn(e, "send").mockImplementation(
|
|
455
|
+
debugLogger: $()
|
|
456
|
+
}, o = j.spyOn(e, "send").mockImplementation(x(t)), s = D(t, o, {
|
|
457
|
+
reset: "Clearing call history (mocks preserved) for client instance",
|
|
458
|
+
restore: "Restoring original client behavior and clearing all mocks for client instance"
|
|
459
|
+
});
|
|
428
460
|
return {
|
|
429
461
|
client: e,
|
|
430
|
-
on: (
|
|
462
|
+
on: (c, r, i) => L(
|
|
431
463
|
t,
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
464
|
+
c,
|
|
465
|
+
r,
|
|
466
|
+
i
|
|
435
467
|
),
|
|
436
|
-
|
|
437
|
-
p(t.debugLogger) && t.debugLogger.logDirect(
|
|
438
|
-
"Clearing call history (mocks preserved) for client instance"
|
|
439
|
-
), o.mockClear();
|
|
440
|
-
},
|
|
441
|
-
restore: () => {
|
|
442
|
-
p(t.debugLogger) && t.debugLogger.logDirect(
|
|
443
|
-
"Restoring original client behavior and clearing all mocks for client instance"
|
|
444
|
-
), o.mockRestore(), t.map = /* @__PURE__ */ new WeakMap();
|
|
445
|
-
},
|
|
446
|
-
calls: () => o.mock.calls.map((n) => n[0]),
|
|
447
|
-
__rawCalls: () => o.mock.calls,
|
|
448
|
-
enableDebug: () => {
|
|
449
|
-
w(t.debugLogger);
|
|
450
|
-
},
|
|
451
|
-
disableDebug: () => {
|
|
452
|
-
D(t.debugLogger);
|
|
453
|
-
}
|
|
468
|
+
...s
|
|
454
469
|
};
|
|
455
470
|
};
|
|
456
471
|
export {
|
|
457
472
|
ge as matchers,
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
473
|
+
le as mockClient,
|
|
474
|
+
ue as mockClientInstance,
|
|
475
|
+
ie as setGlobalDebug
|
|
461
476
|
};
|
package/lib/mock-client.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { HttpHandlerOptions, MetadataBearer } from '@smithy/types';
|
|
|
3
3
|
import { Mock } from 'vitest';
|
|
4
4
|
import { PaginatorOptions } from './utils/paginator-helpers.js';
|
|
5
5
|
import { StreamInput } from './utils/stream-helpers.js';
|
|
6
|
+
type DeepPartial<T> = T extends (...args: unknown[]) => unknown ? T : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends object ? {
|
|
7
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
8
|
+
} : T;
|
|
6
9
|
/**
|
|
7
10
|
* Set global debug mode for all mocks.
|
|
8
11
|
* When enabled, all mocks will log debug information unless explicitly disabled at the mock level.
|
|
@@ -40,7 +43,7 @@ export type AwsSdkCommand = StructuralCommand<object, MetadataBearer>;
|
|
|
40
43
|
export type ClientConstructor<TClient extends AnyClient> = (abstract new (...args: unknown[]) => TClient) | {
|
|
41
44
|
prototype: TClient;
|
|
42
45
|
};
|
|
43
|
-
type CommandHandler<TInput extends object = object, TOutput extends MetadataBearer = MetadataBearer, TClient extends AnyClient = AnyClient> = (input: TInput, clientInstance: TClient | undefined) => Promise<
|
|
46
|
+
type CommandHandler<TInput extends object = object, TOutput extends MetadataBearer = MetadataBearer, TClient extends AnyClient = AnyClient> = (input: TInput, clientInstance: TClient | undefined) => Promise<DeepPartial<TOutput>>;
|
|
44
47
|
interface MockOptions {
|
|
45
48
|
strict?: boolean;
|
|
46
49
|
}
|
|
@@ -198,7 +201,7 @@ export interface AwsCommandStub<TInput extends object, TOutput extends MetadataB
|
|
|
198
201
|
* s3Mock.on(GetObjectCommand).resolves({ Body: 'file contents' });
|
|
199
202
|
* ```
|
|
200
203
|
*/
|
|
201
|
-
resolves: (output:
|
|
204
|
+
resolves: (output: DeepPartial<TOutput>) => AwsCommandStub<TInput, TOutput, TClient>;
|
|
202
205
|
/**
|
|
203
206
|
* Set a permanent mock rejection that will be used after all one-time handlers are consumed.
|
|
204
207
|
*
|
|
@@ -238,7 +241,7 @@ export interface AwsCommandStub<TInput extends object, TOutput extends MetadataB
|
|
|
238
241
|
* .resolvesOnce({ Body: 'second call' });
|
|
239
242
|
* ```
|
|
240
243
|
*/
|
|
241
|
-
resolvesOnce: (output:
|
|
244
|
+
resolvesOnce: (output: DeepPartial<TOutput>) => AwsCommandStub<TInput, TOutput, TClient>;
|
|
242
245
|
/**
|
|
243
246
|
* Add a one-time mock rejection that will be consumed in order.
|
|
244
247
|
*
|
|
@@ -305,7 +308,7 @@ export interface AwsCommandStub<TInput extends object, TOutput extends MetadataB
|
|
|
305
308
|
* s3Mock.on(GetObjectCommand).resolvesWithDelay({ Body: 'data' }, 1000);
|
|
306
309
|
* ```
|
|
307
310
|
*/
|
|
308
|
-
resolvesWithDelay: (output:
|
|
311
|
+
resolvesWithDelay: (output: DeepPartial<TOutput>, delayMs: number) => AwsCommandStub<TInput, TOutput, TClient>;
|
|
309
312
|
/**
|
|
310
313
|
* Set a permanent mock rejection with a delay in milliseconds.
|
|
311
314
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aws-sdk-vitest-mock",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"@swc-node/register": "1.11.1",
|
|
56
56
|
"@swc/core": "1.15.3",
|
|
57
57
|
"@swc/helpers": "0.5.17",
|
|
58
|
+
"@types/eslint-plugin-security": "3.0.0",
|
|
58
59
|
"@types/node": "24.10.3",
|
|
59
60
|
"@typescript-eslint/parser": "8.49.0",
|
|
60
61
|
"@vitest/coverage-v8": "4.0.15",
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
"eslint-plugin-sonarjs": "3.0.5",
|
|
67
68
|
"eslint-plugin-unicorn": "62.0.0",
|
|
68
69
|
"husky": "9.1.7",
|
|
70
|
+
"jiti": "2.6.1",
|
|
69
71
|
"lint-staged": "16.2.7",
|
|
70
72
|
"nx": "22.2.2",
|
|
71
73
|
"prettier": "3.7.4",
|