koatty_schedule 3.3.0 → 3.3.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.3.1](https://github.com/thinkkoa/koatty_schedule/compare/v3.3.0...v3.3.1) (2025-06-22)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * unify component type constant to 'COMPONENT' string literal in IOCContainer registration ([7098c7e](https://github.com/thinkkoa/koatty_schedule/commit/7098c7e2c326a6461b6b8b5c84d07a3ced75de5f))
11
+
5
12
  ## [3.3.0](https://github.com/thinkkoa/koatty_schedule/compare/v3.2.0...v3.3.0) (2025-06-22)
6
13
 
7
14
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2025-06-22 23:27:47
3
+ * @Date: 2025-06-22 23:42:00
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2025-06-22 23:27:42
3
+ * @Date: 2025-06-22 23:41:54
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -211,7 +211,7 @@ function RedLock(lockName, options) {
211
211
  validateRedLockMethodOptions(options);
212
212
  }
213
213
  // 保存类到IOC容器
214
- koatty_container.IOCContainer.saveClass(componentType, targetClass, targetClass.name);
214
+ koatty_container.IOCContainer.saveClass("COMPONENT", targetClass, targetClass.name);
215
215
  // 保存RedLock元数据到 IOC 容器(lockName已确定)
216
216
  koatty_container.IOCContainer.attachClassMetadata(COMPONENT_REDLOCK, DecoratorType.REDLOCK, {
217
217
  method: methodName,
@@ -281,7 +281,7 @@ function Scheduled(cron, timezone) {
281
281
  throw Error("@Scheduled decorator can only be applied to methods");
282
282
  }
283
283
  // 保存类到IOC容器
284
- koatty_container.IOCContainer.saveClass(componentType, targetClass, targetClass.name);
284
+ koatty_container.IOCContainer.saveClass("COMPONENT", targetClass, targetClass.name);
285
285
  // 保存调度元数据到 IOC 容器
286
286
  koatty_container.IOCContainer.attachClassMetadata(COMPONENT_SCHEDULED, DecoratorType.SCHEDULED, {
287
287
  method: methodName,
@@ -719,7 +719,7 @@ async function initRedLock(options, app) {
719
719
  async function injectRedLock(_options, _app) {
720
720
  try {
721
721
  koatty_logger.DefaultLogger.Debug('Starting batch RedLock injection...');
722
- const componentList = koatty_container.IOCContainer.listClass(COMPONENT_REDLOCK);
722
+ const componentList = koatty_container.IOCContainer.listClass("COMPONENT");
723
723
  for (const component of componentList) {
724
724
  const classMetadata = koatty_container.IOCContainer.getClassMetadata(COMPONENT_REDLOCK, DecoratorType.REDLOCK, component.target);
725
725
  if (!classMetadata) {
@@ -905,7 +905,7 @@ function redLockerDescriptor(descriptor, name, method, methodOptions) {
905
905
  async function injectSchedule(_options, _app) {
906
906
  try {
907
907
  koatty_logger.DefaultLogger.Debug('Starting batch schedule injection...');
908
- const componentList = koatty_container.IOCContainer.listClass(COMPONENT_SCHEDULED);
908
+ const componentList = koatty_container.IOCContainer.listClass("COMPONENT");
909
909
  for (const component of componentList) {
910
910
  const classMetadata = koatty_container.IOCContainer.getClassMetadata(COMPONENT_SCHEDULED, DecoratorType.SCHEDULED, component.target);
911
911
  if (!classMetadata) {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @Author: richen
3
- * @Date: 2025-06-22 23:27:42
3
+ * @Date: 2025-06-22 23:41:54
4
4
  * @License: BSD (3-Clause)
5
5
  * @Copyright (c) - <richenlin(at)gmail.com>
6
6
  * @HomePage: https://koatty.org/
@@ -209,7 +209,7 @@ function RedLock(lockName, options) {
209
209
  validateRedLockMethodOptions(options);
210
210
  }
211
211
  // 保存类到IOC容器
212
- IOCContainer.saveClass(componentType, targetClass, targetClass.name);
212
+ IOCContainer.saveClass("COMPONENT", targetClass, targetClass.name);
213
213
  // 保存RedLock元数据到 IOC 容器(lockName已确定)
214
214
  IOCContainer.attachClassMetadata(COMPONENT_REDLOCK, DecoratorType.REDLOCK, {
215
215
  method: methodName,
@@ -279,7 +279,7 @@ function Scheduled(cron, timezone) {
279
279
  throw Error("@Scheduled decorator can only be applied to methods");
280
280
  }
281
281
  // 保存类到IOC容器
282
- IOCContainer.saveClass(componentType, targetClass, targetClass.name);
282
+ IOCContainer.saveClass("COMPONENT", targetClass, targetClass.name);
283
283
  // 保存调度元数据到 IOC 容器
284
284
  IOCContainer.attachClassMetadata(COMPONENT_SCHEDULED, DecoratorType.SCHEDULED, {
285
285
  method: methodName,
@@ -717,7 +717,7 @@ async function initRedLock(options, app) {
717
717
  async function injectRedLock(_options, _app) {
718
718
  try {
719
719
  DefaultLogger.Debug('Starting batch RedLock injection...');
720
- const componentList = IOCContainer.listClass(COMPONENT_REDLOCK);
720
+ const componentList = IOCContainer.listClass("COMPONENT");
721
721
  for (const component of componentList) {
722
722
  const classMetadata = IOCContainer.getClassMetadata(COMPONENT_REDLOCK, DecoratorType.REDLOCK, component.target);
723
723
  if (!classMetadata) {
@@ -903,7 +903,7 @@ function redLockerDescriptor(descriptor, name, method, methodOptions) {
903
903
  async function injectSchedule(_options, _app) {
904
904
  try {
905
905
  DefaultLogger.Debug('Starting batch schedule injection...');
906
- const componentList = IOCContainer.listClass(COMPONENT_SCHEDULED);
906
+ const componentList = IOCContainer.listClass("COMPONENT");
907
907
  for (const component of componentList) {
908
908
  const classMetadata = IOCContainer.getClassMetadata(COMPONENT_SCHEDULED, DecoratorType.SCHEDULED, component.target);
909
909
  if (!classMetadata) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty_schedule",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Schedule for koatty.",
5
5
  "scripts": {
6
6
  "build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koatty_schedule",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Schedule for koatty.",
5
5
  "scripts": {
6
6
  "build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",