@dereekb/nestjs 13.11.14 → 13.11.16

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