@dereekb/nestjs 13.11.13 → 13.11.15
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/discord/index.cjs.js +37 -34
- package/discord/index.esm.js +36 -33
- package/discord/package.json +4 -4
- package/discord/src/lib/discord.api.d.ts +6 -6
- package/discord/src/lib/discord.api.page.d.ts +4 -4
- package/discord/src/lib/discord.config.d.ts +2 -2
- package/discord/src/lib/discord.module.d.ts +2 -2
- package/discord/src/lib/discord.util.d.ts +3 -3
- package/discord/src/lib/webhook/webhook.discord.d.ts +2 -2
- package/discord/src/lib/webhook/webhook.discord.module.d.ts +2 -2
- package/discord/src/lib/webhook/webhook.discord.verify.d.ts +2 -2
- package/eslint/index.cjs.js +142 -145
- package/eslint/index.esm.js +141 -144
- package/eslint/package.json +4 -4
- package/eslint/src/lib/index.d.ts +2 -2
- package/eslint/src/lib/plugin.d.ts +1 -1
- package/eslint/src/lib/require-inject.rule.d.ts +1 -1
- package/index.cjs.js +98 -112
- package/index.esm.js +98 -112
- package/mailgun/index.cjs.js +17 -13
- package/mailgun/index.esm.js +17 -13
- package/mailgun/package.json +6 -6
- package/mailgun/src/lib/mailgun.d.ts +7 -5
- package/mailgun/src/lib/mailgun.service.module.d.ts +4 -3
- package/mailgun/src/lib/mailgun.util.d.ts +6 -5
- package/openai/index.cjs.js +9 -9
- package/openai/index.esm.js +9 -9
- package/openai/package.json +6 -6
- package/openai/src/lib/openai.module.d.ts +2 -2
- package/openai/src/lib/openai.util.d.ts +3 -3
- package/openai/src/lib/webhook/webhook.openai.module.d.ts +2 -2
- package/openai/src/lib/webhook/webhook.openai.verify.d.ts +2 -2
- package/package.json +5 -5
- package/src/lib/asset/asset.loader.node.d.ts +3 -3
- package/src/lib/asset/asset.nest.d.ts +6 -5
- package/src/lib/decorators/local.decorator.d.ts +2 -2
- package/src/lib/decorators/rawbody.d.ts +7 -7
- package/src/lib/module/client/client.config.d.ts +2 -2
- package/src/lib/module/client/client.module.d.ts +3 -2
- package/src/lib/module/env/env.d.ts +1 -1
- package/src/lib/module/env/env.nest.d.ts +2 -2
- package/src/lib/module/module.d.ts +5 -5
- package/src/lib/util/encryption/json.encrypt.d.ts +18 -16
- package/src/lib/util/file/file.json.d.ts +2 -2
- package/src/lib/util/pdf/pdf.encryption.d.ts +3 -3
- package/stripe/index.cjs.js +13 -13
- package/stripe/index.esm.js +13 -13
- package/stripe/package.json +6 -6
- package/stripe/src/lib/stripe.api.d.ts +4 -4
- package/stripe/src/lib/stripe.module.d.ts +3 -3
- package/stripe/src/lib/webhook/webhook.stripe.d.ts +4 -4
- package/typeform/index.cjs.js +12 -12
- package/typeform/index.esm.js +12 -12
- package/typeform/package.json +6 -6
- package/typeform/src/lib/typeform.module.d.ts +2 -2
- package/typeform/src/lib/typeform.util.d.ts +2 -2
- package/typeform/src/lib/webhook/webhook.typeform.form.d.ts +4 -4
- package/typeform/src/lib/webhook/webhook.typeform.module.d.ts +2 -2
- package/typeform/src/lib/webhook/webhook.typeform.verify.d.ts +2 -2
- package/vapiai/index.cjs.js +6 -6
- package/vapiai/index.esm.js +6 -6
- package/vapiai/package.json +6 -6
- package/vapiai/src/lib/vapiai.module.d.ts +2 -2
- package/vapiai/src/lib/webhook/webhook.vapiai.module.d.ts +2 -2
- package/vapiai/src/lib/webhook/webhook.vapiai.verify.d.ts +2 -2
package/eslint/index.cjs.js
CHANGED
|
@@ -48,67 +48,65 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
48
48
|
/**
|
|
49
49
|
* Extracts the decorator name from a decorator node.
|
|
50
50
|
*
|
|
51
|
+
* @param decorator - The decorator AST node.
|
|
52
|
+
* @returns The decorator name, or empty string if unrecognized.
|
|
53
|
+
*
|
|
51
54
|
* @example
|
|
52
55
|
* ```
|
|
53
56
|
* // Returns 'Injectable' for both:
|
|
54
57
|
* // @Injectable()
|
|
55
58
|
* // @Injectable
|
|
56
59
|
* ```
|
|
57
|
-
*
|
|
58
|
-
* @param decorator - The decorator AST node
|
|
59
|
-
* @returns The decorator name, or empty string if unrecognized
|
|
60
60
|
*/ function getDecoratorName(decorator) {
|
|
61
61
|
var expression = decorator.expression;
|
|
62
|
+
var name = '';
|
|
62
63
|
if (expression.type === 'CallExpression') {
|
|
63
64
|
if (expression.callee.type === 'Identifier') {
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return expression.callee.property.name;
|
|
65
|
+
name = expression.callee.name;
|
|
66
|
+
} else if (expression.callee.type === 'MemberExpression' && expression.callee.property.type === 'Identifier') {
|
|
67
|
+
name = expression.callee.property.name;
|
|
68
68
|
}
|
|
69
|
+
} else if (expression.type === 'Identifier') {
|
|
70
|
+
name = expression.name;
|
|
69
71
|
}
|
|
70
|
-
|
|
71
|
-
return expression.name;
|
|
72
|
-
}
|
|
73
|
-
return '';
|
|
72
|
+
return name;
|
|
74
73
|
}
|
|
75
74
|
/**
|
|
76
75
|
* Extracts the injection token name from a decorator like @Inject(TokenName).
|
|
77
76
|
*
|
|
78
|
-
* @param decorator - The decorator AST node
|
|
79
|
-
* @returns The token identifier name, or null if not a simple identifier
|
|
77
|
+
* @param decorator - The decorator AST node.
|
|
78
|
+
* @returns The token identifier name, or null if not a simple identifier.
|
|
80
79
|
*/ function getInjectTokenFromDecorator(decorator) {
|
|
81
80
|
var expression = decorator.expression;
|
|
81
|
+
var tokenName = null;
|
|
82
82
|
if (expression.type === 'CallExpression' && expression.callee.type === 'Identifier' && expression.callee.name === 'Inject') {
|
|
83
83
|
var firstArg = expression.arguments[0];
|
|
84
84
|
if ((firstArg === null || firstArg === void 0 ? void 0 : firstArg.type) === 'Identifier') {
|
|
85
|
-
|
|
85
|
+
tokenName = firstArg.name;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
return
|
|
88
|
+
return tokenName;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Extracts the parameter name from a constructor parameter node.
|
|
92
92
|
*
|
|
93
|
-
* @param param - The parameter AST node
|
|
94
|
-
* @returns The parameter name for error reporting
|
|
93
|
+
* @param param - The parameter AST node.
|
|
94
|
+
* @returns The parameter name for error reporting.
|
|
95
95
|
*/ function getParamName(param) {
|
|
96
|
+
var name = '(unknown)';
|
|
96
97
|
if (param.type === 'TSParameterProperty') {
|
|
97
98
|
var inner = param.parameter;
|
|
98
99
|
if (inner.type === 'Identifier') {
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return inner.left.name;
|
|
100
|
+
name = inner.name;
|
|
101
|
+
} else if (inner.type === 'AssignmentPattern' && inner.left.type === 'Identifier') {
|
|
102
|
+
name = inner.left.name;
|
|
103
103
|
}
|
|
104
|
+
} else if (param.type === 'Identifier') {
|
|
105
|
+
name = param.name;
|
|
106
|
+
} else if (param.type === 'AssignmentPattern' && param.left.type === 'Identifier') {
|
|
107
|
+
name = param.left.name;
|
|
104
108
|
}
|
|
105
|
-
|
|
106
|
-
return param.name;
|
|
107
|
-
}
|
|
108
|
-
if (param.type === 'AssignmentPattern' && param.left.type === 'Identifier') {
|
|
109
|
-
return param.left.name;
|
|
110
|
-
}
|
|
111
|
-
return '(unknown)';
|
|
109
|
+
return name;
|
|
112
110
|
}
|
|
113
111
|
/**
|
|
114
112
|
* Gets the class-typed injection token name from a parameter's type annotation, if available.
|
|
@@ -116,16 +114,17 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
116
114
|
* Returns the type name only for simple TSTypeReference identifiers (i.e. class names like `FooApi`).
|
|
117
115
|
* Returns null for primitives, union types, generics, or any non-simple type reference.
|
|
118
116
|
*
|
|
119
|
-
* @param param - The parameter AST node
|
|
120
|
-
* @returns The type name to use as injection token, or null if not auto-fixable
|
|
117
|
+
* @param param - The parameter AST node.
|
|
118
|
+
* @returns The type name to use as injection token, or null if not auto-fixable.
|
|
121
119
|
*/ function getInjectTokenName(param) {
|
|
122
120
|
var _target_typeAnnotation, _typeAnnotation_typeName;
|
|
123
121
|
var target = param.type === 'TSParameterProperty' ? param.parameter : param;
|
|
124
122
|
var typeAnnotation = (_target_typeAnnotation = target.typeAnnotation) === null || _target_typeAnnotation === void 0 ? void 0 : _target_typeAnnotation.typeAnnotation;
|
|
123
|
+
var tokenName = null;
|
|
125
124
|
if ((typeAnnotation === null || typeAnnotation === void 0 ? void 0 : typeAnnotation.type) === 'TSTypeReference' && ((_typeAnnotation_typeName = typeAnnotation.typeName) === null || _typeAnnotation_typeName === void 0 ? void 0 : _typeAnnotation_typeName.type) === 'Identifier' && !typeAnnotation.typeArguments) {
|
|
126
|
-
|
|
125
|
+
tokenName = typeAnnotation.typeName.name;
|
|
127
126
|
}
|
|
128
|
-
return
|
|
127
|
+
return tokenName;
|
|
129
128
|
}
|
|
130
129
|
/**
|
|
131
130
|
* ESLint rule requiring @Inject() on all constructor parameters in NestJS injectable classes.
|
|
@@ -145,7 +144,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
145
144
|
*
|
|
146
145
|
* Register as a plugin in your flat ESLint config, then enable individual rules
|
|
147
146
|
* under the chosen plugin prefix (e.g. 'dereekb-nestjs/require-nest-inject').
|
|
148
|
-
*/ var
|
|
147
|
+
*/ var NESTJS_REQUIRE_INJECT_RULE = {
|
|
149
148
|
meta: {
|
|
150
149
|
type: 'problem',
|
|
151
150
|
fixable: 'code',
|
|
@@ -241,124 +240,122 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
241
240
|
},
|
|
242
241
|
ClassDeclaration: function ClassDeclaration(classNode) {
|
|
243
242
|
var decorators = classNode.decorators;
|
|
244
|
-
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
var matchedClassDecorator = decorators.find(function(d) {
|
|
243
|
+
var matchedClassDecorator = decorators && decorators.length > 0 ? decorators.find(function(d) {
|
|
248
244
|
var name = getDecoratorName(d);
|
|
249
245
|
return classDecorators.has(name) && nestjsImports.has(name);
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
var classDecoratorName = getDecoratorName(matchedClassDecorator);
|
|
255
|
-
var constructor = classNode.body.body.find(function(member) {
|
|
246
|
+
}) : undefined;
|
|
247
|
+
var constructor = matchedClassDecorator ? classNode.body.body.find(function(member) {
|
|
256
248
|
return member.type === 'MethodDefinition' && member.kind === 'constructor';
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
var
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
importKeywordEnd
|
|
291
|
-
|
|
292
|
-
|
|
249
|
+
}) : undefined;
|
|
250
|
+
var params = constructor === null || constructor === void 0 ? void 0 : constructor.value.params;
|
|
251
|
+
var shouldCheckParams = Boolean(matchedClassDecorator && params && params.length > 0);
|
|
252
|
+
if (shouldCheckParams) {
|
|
253
|
+
var classDecoratorName = getDecoratorName(matchedClassDecorator);
|
|
254
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
255
|
+
try {
|
|
256
|
+
var _loop = function() {
|
|
257
|
+
var param = _step.value;
|
|
258
|
+
var paramDecoratorsOnNode = param.decorators;
|
|
259
|
+
var hasValidDecorator = paramDecoratorsOnNode && paramDecoratorsOnNode.length > 0 && paramDecoratorsOnNode.some(function(d) {
|
|
260
|
+
return paramDecorators.has(getDecoratorName(d));
|
|
261
|
+
});
|
|
262
|
+
if (hasValidDecorator) {
|
|
263
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
264
|
+
try {
|
|
265
|
+
var _loop = function() {
|
|
266
|
+
var decorator = _step1.value;
|
|
267
|
+
var tokenName = getInjectTokenFromDecorator(decorator);
|
|
268
|
+
if (tokenName) {
|
|
269
|
+
var typeImportInfo = typeOnlyImports.get(tokenName);
|
|
270
|
+
if (typeImportInfo) {
|
|
271
|
+
context.report({
|
|
272
|
+
node: decorator,
|
|
273
|
+
messageId: 'typeOnlyInjectToken',
|
|
274
|
+
data: {
|
|
275
|
+
token: tokenName
|
|
276
|
+
},
|
|
277
|
+
fix: function fix(fixer) {
|
|
278
|
+
var fixResult;
|
|
279
|
+
if (typeImportInfo.isDeclarationLevel) {
|
|
280
|
+
// `import type { X } from '...'` → `import { X } from '...'`
|
|
281
|
+
// Remove 'type ' after 'import '
|
|
282
|
+
var importKeywordEnd = typeImportInfo.declaration.range[0] + 'import '.length;
|
|
283
|
+
fixResult = fixer.removeRange([
|
|
284
|
+
importKeywordEnd,
|
|
285
|
+
importKeywordEnd + 'type '.length
|
|
286
|
+
]);
|
|
287
|
+
} else {
|
|
288
|
+
// `import { type X }` → `import { X }`
|
|
289
|
+
// The specifier range includes 'type X', so remove 'type ' prefix
|
|
290
|
+
var specRange = typeImportInfo.specifier.range;
|
|
291
|
+
var importedRange = typeImportInfo.specifier.imported.range;
|
|
292
|
+
fixResult = fixer.removeRange([
|
|
293
|
+
specRange[0],
|
|
294
|
+
importedRange[0]
|
|
295
|
+
]);
|
|
296
|
+
}
|
|
297
|
+
return fixResult;
|
|
293
298
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
return fixer.removeRange([
|
|
299
|
-
specRange[0],
|
|
300
|
-
importedRange[0]
|
|
301
|
-
]);
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
// Remove from tracking so we don't report the same import twice
|
|
305
|
-
typeOnlyImports.delete(tokenName);
|
|
299
|
+
});
|
|
300
|
+
// Remove from tracking so we don't report the same import twice
|
|
301
|
+
typeOnlyImports.delete(tokenName);
|
|
302
|
+
}
|
|
306
303
|
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
_iteratorError = err;
|
|
314
|
-
} finally{
|
|
315
|
-
try {
|
|
316
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
317
|
-
_iterator.return();
|
|
318
|
-
}
|
|
304
|
+
};
|
|
305
|
+
// Has @Inject() — check if the injection token is a type-only import
|
|
306
|
+
for(var _iterator = paramDecoratorsOnNode[Symbol.iterator](), _step1; !(_iteratorNormalCompletion = (_step1 = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
307
|
+
} catch (err) {
|
|
308
|
+
_didIteratorError = true;
|
|
309
|
+
_iteratorError = err;
|
|
319
310
|
} finally{
|
|
320
|
-
|
|
321
|
-
|
|
311
|
+
try {
|
|
312
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
313
|
+
_iterator.return();
|
|
314
|
+
}
|
|
315
|
+
} finally{
|
|
316
|
+
if (_didIteratorError) {
|
|
317
|
+
throw _iteratorError;
|
|
318
|
+
}
|
|
322
319
|
}
|
|
323
320
|
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
321
|
+
} else {
|
|
322
|
+
// Missing @Inject() entirely
|
|
323
|
+
var tokenName = getInjectTokenName(param);
|
|
324
|
+
context.report({
|
|
325
|
+
node: param,
|
|
326
|
+
messageId: 'missingInject',
|
|
327
|
+
data: {
|
|
328
|
+
name: getParamName(param),
|
|
329
|
+
classDecorator: classDecoratorName
|
|
330
|
+
},
|
|
331
|
+
fix: tokenName ? function(fixer) {
|
|
332
|
+
var fixes = [];
|
|
333
|
+
fixes.push(fixer.insertTextBefore(param, "@Inject(".concat(tokenName, ") ")));
|
|
334
|
+
if (!nestjsImports.has('Inject') && nestjsImportNode) {
|
|
335
|
+
var lastSpecifier = nestjsImportNode.specifiers[nestjsImportNode.specifiers.length - 1];
|
|
336
|
+
if (lastSpecifier) {
|
|
337
|
+
fixes.push(fixer.insertTextAfter(lastSpecifier, ', Inject'));
|
|
338
|
+
}
|
|
339
|
+
nestjsImports.add('Inject');
|
|
342
340
|
}
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
_didIteratorError = true;
|
|
353
|
-
_iteratorError = err;
|
|
354
|
-
} finally{
|
|
355
|
-
try {
|
|
356
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
357
|
-
_iterator.return();
|
|
358
|
-
}
|
|
341
|
+
return fixes;
|
|
342
|
+
} : undefined
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
for(var _iterator = params[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
347
|
+
} catch (err) {
|
|
348
|
+
_didIteratorError = true;
|
|
349
|
+
_iteratorError = err;
|
|
359
350
|
} finally{
|
|
360
|
-
|
|
361
|
-
|
|
351
|
+
try {
|
|
352
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
353
|
+
_iterator.return();
|
|
354
|
+
}
|
|
355
|
+
} finally{
|
|
356
|
+
if (_didIteratorError) {
|
|
357
|
+
throw _iteratorError;
|
|
358
|
+
}
|
|
362
359
|
}
|
|
363
360
|
}
|
|
364
361
|
}
|
|
@@ -372,11 +369,11 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
372
369
|
*
|
|
373
370
|
* Register as a plugin in your flat ESLint config, then enable individual rules
|
|
374
371
|
* under the chosen plugin prefix (e.g. 'dereekb-nestjs/require-nest-inject').
|
|
375
|
-
*/ var
|
|
372
|
+
*/ var NESTJS_ESLINT_PLUGIN = {
|
|
376
373
|
rules: {
|
|
377
|
-
'require-nest-inject':
|
|
374
|
+
'require-nest-inject': NESTJS_REQUIRE_INJECT_RULE
|
|
378
375
|
}
|
|
379
376
|
};
|
|
380
377
|
|
|
381
|
-
exports.
|
|
382
|
-
exports.
|
|
378
|
+
exports.NESTJS_ESLINT_PLUGIN = NESTJS_ESLINT_PLUGIN;
|
|
379
|
+
exports.NESTJS_REQUIRE_INJECT_RULE = NESTJS_REQUIRE_INJECT_RULE;
|