@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.
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 +142 -145
  13. package/eslint/index.esm.js +141 -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 +1 -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
@@ -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
- return expression.callee.name;
65
- }
66
- if (expression.callee.type === 'MemberExpression' && expression.callee.property.type === 'Identifier') {
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
- if (expression.type === 'Identifier') {
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
- return firstArg.name;
85
+ tokenName = firstArg.name;
86
86
  }
87
87
  }
88
- return null;
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
- return inner.name;
100
- }
101
- if (inner.type === 'AssignmentPattern' && inner.left.type === 'Identifier') {
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
- if (param.type === 'Identifier') {
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
- return typeAnnotation.typeName.name;
125
+ tokenName = typeAnnotation.typeName.name;
127
126
  }
128
- return null;
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 nestjsRequireInjectRule = {
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
- if (!decorators || decorators.length === 0) {
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
- if (!matchedClassDecorator) {
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
- if (!(constructor === null || constructor === void 0 ? void 0 : constructor.value.params) || constructor.value.params.length === 0) {
259
- return;
260
- }
261
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
262
- try {
263
- var _loop = function() {
264
- var param = _step.value;
265
- var paramDecoratorsOnNode = param.decorators;
266
- var hasValidDecorator = paramDecoratorsOnNode && paramDecoratorsOnNode.length > 0 && paramDecoratorsOnNode.some(function(d) {
267
- return paramDecorators.has(getDecoratorName(d));
268
- });
269
- if (hasValidDecorator) {
270
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
271
- try {
272
- var _loop = function() {
273
- var decorator = _step1.value;
274
- var tokenName = getInjectTokenFromDecorator(decorator);
275
- if (tokenName) {
276
- var typeImportInfo = typeOnlyImports.get(tokenName);
277
- if (typeImportInfo) {
278
- context.report({
279
- node: decorator,
280
- messageId: 'typeOnlyInjectToken',
281
- data: {
282
- token: tokenName
283
- },
284
- fix: function fix(fixer) {
285
- if (typeImportInfo.isDeclarationLevel) {
286
- // `import type { X } from '...'` → `import { X } from '...'`
287
- // Remove 'type ' after 'import '
288
- var importKeywordEnd = typeImportInfo.declaration.range[0] + 'import '.length;
289
- return fixer.removeRange([
290
- importKeywordEnd,
291
- importKeywordEnd + 'type '.length
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
- // `import { type X }` → `import { X }`
295
- // The specifier range includes 'type X', so remove 'type ' prefix
296
- var specRange = typeImportInfo.specifier.range;
297
- var importedRange = typeImportInfo.specifier.imported.range;
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
- // Has @Inject() check if the injection token is a type-only import
310
- for(var _iterator = paramDecoratorsOnNode[Symbol.iterator](), _step1; !(_iteratorNormalCompletion = (_step1 = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
311
- } catch (err) {
312
- _didIteratorError = true;
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
- if (_didIteratorError) {
321
- throw _iteratorError;
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
- } else {
326
- // Missing @Inject() entirely
327
- var tokenName = getInjectTokenName(param);
328
- context.report({
329
- node: param,
330
- messageId: 'missingInject',
331
- data: {
332
- name: getParamName(param),
333
- classDecorator: classDecoratorName
334
- },
335
- fix: tokenName ? function(fixer) {
336
- var fixes = [];
337
- fixes.push(fixer.insertTextBefore(param, "@Inject(".concat(tokenName, ") ")));
338
- if (!nestjsImports.has('Inject') && nestjsImportNode) {
339
- var lastSpecifier = nestjsImportNode.specifiers[nestjsImportNode.specifiers.length - 1];
340
- if (lastSpecifier) {
341
- fixes.push(fixer.insertTextAfter(lastSpecifier, ', Inject'));
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
- nestjsImports.add('Inject');
344
- }
345
- return fixes;
346
- } : undefined
347
- });
348
- }
349
- };
350
- for(var _iterator = constructor.value.params[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
351
- } catch (err) {
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
- if (_didIteratorError) {
361
- throw _iteratorError;
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 nestjsEslintPlugin = {
372
+ */ var NESTJS_ESLINT_PLUGIN = {
376
373
  rules: {
377
- 'require-nest-inject': nestjsRequireInjectRule
374
+ 'require-nest-inject': NESTJS_REQUIRE_INJECT_RULE
378
375
  }
379
376
  };
380
377
 
381
- exports.nestjsEslintPlugin = nestjsEslintPlugin;
382
- exports.nestjsRequireInjectRule = nestjsRequireInjectRule;
378
+ exports.NESTJS_ESLINT_PLUGIN = NESTJS_ESLINT_PLUGIN;
379
+ exports.NESTJS_REQUIRE_INJECT_RULE = NESTJS_REQUIRE_INJECT_RULE;