@lafken/schedule 0.11.8 → 0.11.10

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.
@@ -1,4 +1,4 @@
1
- import type { LambdaMetadata, ResourceOutputType } from '@lafken/common';
1
+ import type { LambdaMetadata, ResourceOutputType, ScheduleReferenceNames } from '@lafken/common';
2
2
  type ScheduleExpressions = number | '*' | '?' | (string & {});
3
3
  /**
4
4
  * Attributes that can be exported from an EventBridge schedule rule resource.
@@ -64,6 +64,15 @@ export interface EventCronProps {
64
64
  * }
65
65
  */
66
66
  outputs?: ResourceOutputType<ScheduleOutputAttributes>;
67
+ /**
68
+ * Registers this Eventbridge schedule as a named global reference, allowing other resources
69
+ * to access its attributes (e.g. execution ARN) by reference name.
70
+ *
71
+ * @example
72
+ * // Register the API under a reference name
73
+ * ref: 'my-state-machine'
74
+ */
75
+ ref?: ScheduleReferenceNames;
67
76
  }
68
77
  export interface EventCronMetadata extends LambdaMetadata, EventCronProps {
69
78
  }
@@ -2,8 +2,8 @@ import { CloudwatchEventRule } from '@cdktn/provider-aws/lib/cloudwatch-event-ru
2
2
  import { type AppModule } from '@lafken/resolver';
3
3
  import type { CronProps } from './cron.types';
4
4
  declare const Cron_base: (new (...args: any[]) => {
5
- isGlobal(module: import("@lafken/common").ModuleGlobalReferenceNames | (string & {}), id: string): void;
6
- isDependent(resolveDependency: () => void): void;
5
+ register(namespaces: import("@lafken/common").RegisterNamespaces | (string & {}), id: string): void;
6
+ onResolve(callback: () => void): void;
7
7
  readonly node: import("constructs").Node;
8
8
  with(...mixins: import("constructs").IMixin[]): import("constructs").IConstruct;
9
9
  toString(): string;
@@ -13,7 +13,9 @@ class Cron extends resolver_1.lafkenResource.make(cloudwatch_event_rule_1.Cloudw
13
13
  scheduleExpression: Cron.buildScheduleExpression(handler.schedule),
14
14
  });
15
15
  this.props = props;
16
- this.isGlobal(scope.id, id);
16
+ if (props.handler.ref) {
17
+ this.register('schedule', props.handler.ref);
18
+ }
17
19
  this.addEventTarget(id);
18
20
  new resolver_1.ResourceOutput(this, handler.outputs);
19
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lafken/schedule",
3
- "version": "0.11.8",
3
+ "version": "0.11.10",
4
4
  "private": false,
5
5
  "description": "Define EventBridge scheduled rules and cron jobs using TypeScript decorators with Lafken",
6
6
  "keywords": [
@@ -50,20 +50,20 @@
50
50
  ],
51
51
  "dependencies": {
52
52
  "reflect-metadata": "^0.2.2",
53
- "@lafken/resolver": "0.11.8"
53
+ "@lafken/resolver": "0.11.10"
54
54
  },
55
55
  "devDependencies": {
56
- "@cdktn/provider-aws": "^23.5.0",
57
- "@swc/core": "^1.15.21",
58
- "@swc/helpers": "^0.5.20",
59
- "@vitest/runner": "^4.1.2",
56
+ "@cdktn/provider-aws": "^23.9.0",
57
+ "@swc/core": "^1.15.30",
58
+ "@swc/helpers": "^0.5.21",
59
+ "@vitest/runner": "^4.1.5",
60
60
  "cdktn": "^0.22.1",
61
61
  "cdktn-vitest": "^1.0.0",
62
62
  "constructs": "^10.6.0",
63
- "typescript": "6.0.2",
63
+ "typescript": "6.0.3",
64
64
  "unplugin-swc": "^1.5.9",
65
- "vitest": "^4.1.2",
66
- "@lafken/common": "0.11.8"
65
+ "vitest": "^4.1.5",
66
+ "@lafken/common": "0.11.10"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@cdktn/provider-aws": ">=23.0.0",