@kici-dev/sdk 0.0.0 → 0.1.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.
Files changed (112) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +1 -6
  3. package/dist/api-types.d.ts +47 -0
  4. package/dist/api-types.js +15 -0
  5. package/dist/chunk-gOLHoazu.js +4 -0
  6. package/dist/context.d.ts +185 -0
  7. package/dist/context.js +2 -0
  8. package/dist/dynamic-group.d.ts +29 -0
  9. package/dist/dynamic-group.js +34 -0
  10. package/dist/errors.d.ts +9 -0
  11. package/dist/errors.js +17 -0
  12. package/dist/events/define-event.d.ts +32 -0
  13. package/dist/events/define-event.js +29 -0
  14. package/dist/events/event-payloads.d.ts +396 -0
  15. package/dist/events/event-payloads.js +21 -0
  16. package/dist/events/index.d.ts +6 -0
  17. package/dist/events/index.js +4 -0
  18. package/dist/events/types.d.ts +13 -0
  19. package/dist/events/types.js +2 -0
  20. package/dist/fixture.d.ts +50 -0
  21. package/dist/fixture.js +35 -0
  22. package/dist/hooks/index.d.ts +33 -0
  23. package/dist/hooks/index.js +94 -0
  24. package/dist/hooks/types.d.ts +35 -0
  25. package/dist/hooks/types.js +2 -0
  26. package/dist/idempotent.d.ts +71 -0
  27. package/dist/idempotent.js +77 -0
  28. package/dist/index.d.ts +40 -0
  29. package/dist/index.js +50 -0
  30. package/dist/job.d.ts +31 -0
  31. package/dist/job.js +46 -0
  32. package/dist/matrix/expand.d.ts +32 -0
  33. package/dist/matrix/expand.js +77 -0
  34. package/dist/matrix/index.d.ts +4 -0
  35. package/dist/matrix/index.js +4 -0
  36. package/dist/matrix/types.d.ts +60 -0
  37. package/dist/matrix/types.js +18 -0
  38. package/dist/outputs.d.ts +86 -0
  39. package/dist/outputs.js +180 -0
  40. package/dist/rules/evaluator.d.ts +24 -0
  41. package/dist/rules/evaluator.js +52 -0
  42. package/dist/rules/index.d.ts +6 -0
  43. package/dist/rules/index.js +5 -0
  44. package/dist/rules/rule.d.ts +34 -0
  45. package/dist/rules/rule.js +37 -0
  46. package/dist/rules/types.d.ts +42 -0
  47. package/dist/rules/types.js +2 -0
  48. package/dist/secrets.d.ts +192 -0
  49. package/dist/secrets.js +132 -0
  50. package/dist/step.d.ts +50 -0
  51. package/dist/step.js +78 -0
  52. package/dist/triggers/comment.d.ts +20 -0
  53. package/dist/triggers/comment.js +47 -0
  54. package/dist/triggers/create.d.ts +20 -0
  55. package/dist/triggers/create.js +32 -0
  56. package/dist/triggers/delete.d.ts +20 -0
  57. package/dist/triggers/delete.js +29 -0
  58. package/dist/triggers/dispatch.d.ts +17 -0
  59. package/dist/triggers/dispatch.js +27 -0
  60. package/dist/triggers/fork.d.ts +17 -0
  61. package/dist/triggers/fork.js +26 -0
  62. package/dist/triggers/generic-webhook.d.ts +32 -0
  63. package/dist/triggers/generic-webhook.js +45 -0
  64. package/dist/triggers/index.d.ts +28 -0
  65. package/dist/triggers/index.js +25 -0
  66. package/dist/triggers/job-complete.d.ts +23 -0
  67. package/dist/triggers/job-complete.js +33 -0
  68. package/dist/triggers/kici-event.d.ts +23 -0
  69. package/dist/triggers/kici-event.js +34 -0
  70. package/dist/triggers/lifecycle.d.ts +20 -0
  71. package/dist/triggers/lifecycle.js +29 -0
  72. package/dist/triggers/pr.d.ts +27 -0
  73. package/dist/triggers/pr.js +48 -0
  74. package/dist/triggers/push.d.ts +29 -0
  75. package/dist/triggers/push.js +48 -0
  76. package/dist/triggers/release.d.ts +17 -0
  77. package/dist/triggers/release.js +27 -0
  78. package/dist/triggers/review-comment.d.ts +17 -0
  79. package/dist/triggers/review-comment.js +27 -0
  80. package/dist/triggers/review.d.ts +17 -0
  81. package/dist/triggers/review.js +28 -0
  82. package/dist/triggers/schedule.d.ts +20 -0
  83. package/dist/triggers/schedule.js +29 -0
  84. package/dist/triggers/star.d.ts +17 -0
  85. package/dist/triggers/star.js +27 -0
  86. package/dist/triggers/status.d.ts +17 -0
  87. package/dist/triggers/status.js +28 -0
  88. package/dist/triggers/tag.d.ts +20 -0
  89. package/dist/triggers/tag.js +31 -0
  90. package/dist/triggers/types.d.ts +529 -0
  91. package/dist/triggers/types.js +36 -0
  92. package/dist/triggers/watch.d.ts +17 -0
  93. package/dist/triggers/watch.js +27 -0
  94. package/dist/triggers/webhook.d.ts +19 -0
  95. package/dist/triggers/webhook.js +29 -0
  96. package/dist/triggers/workflow-complete.d.ts +23 -0
  97. package/dist/triggers/workflow-complete.js +32 -0
  98. package/dist/triggers/workflow-run.d.ts +17 -0
  99. package/dist/triggers/workflow-run.js +29 -0
  100. package/dist/types.d.ts +483 -0
  101. package/dist/types.js +35 -0
  102. package/dist/validation/dag.d.ts +42 -0
  103. package/dist/validation/dag.js +70 -0
  104. package/dist/validation/index.d.ts +3 -0
  105. package/dist/validation/index.js +3 -0
  106. package/dist/wait-for.d.ts +109 -0
  107. package/dist/wait-for.js +144 -0
  108. package/dist/workflow.d.ts +3 -0
  109. package/dist/workflow.js +83 -0
  110. package/package.json +42 -5
  111. package/sbom.spdx.json +9150 -0
  112. package/index.js +0 -3
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Job complete trigger helper - creates triggers for job completion events.
3
+ * Returns a frozen JobCompleteTriggerConfig directly.
4
+ */
5
+ import type { JobCompleteConfigInput, JobCompleteTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a job completion trigger configuration.
8
+ *
9
+ * @example
10
+ * // Match any job completion
11
+ * jobComplete()
12
+ *
13
+ * // Match specific workflow + job
14
+ * jobComplete({ workflow: 'CI', job: 'build' })
15
+ *
16
+ * // Match successful completions only
17
+ * jobComplete({ workflow: 'CI', job: 'build', status: ['success'] })
18
+ *
19
+ * // Cross-repo source filter
20
+ * jobComplete({ workflow: 'CI', job: 'build', source: 'org/repo' })
21
+ */
22
+ export declare function jobComplete(config?: JobCompleteConfigInput): JobCompleteTriggerConfig;
23
+ //# sourceMappingURL=job-complete.d.ts.map
@@ -0,0 +1,33 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ //#region src/triggers/job-complete.ts
3
+ /**
4
+ * Create a job completion trigger configuration.
5
+ *
6
+ * @example
7
+ * // Match any job completion
8
+ * jobComplete()
9
+ *
10
+ * // Match specific workflow + job
11
+ * jobComplete({ workflow: 'CI', job: 'build' })
12
+ *
13
+ * // Match successful completions only
14
+ * jobComplete({ workflow: 'CI', job: 'build', status: ['success'] })
15
+ *
16
+ * // Cross-repo source filter
17
+ * jobComplete({ workflow: 'CI', job: 'build', source: 'org/repo' })
18
+ */
19
+ function jobComplete(config) {
20
+ const result = {
21
+ _tag: "JobCompleteTrigger",
22
+ ...config?.workflow !== void 0 && { workflow: config.workflow },
23
+ ...config?.job !== void 0 && { job: config.job },
24
+ ...config?.status !== void 0 && { status: Object.freeze([...config.status]) },
25
+ ...config?.source !== void 0 && { source: config.source },
26
+ ...config?.description !== void 0 && { description: config.description }
27
+ };
28
+ return Object.freeze(result);
29
+ }
30
+ //#endregion
31
+ export { jobComplete };
32
+
33
+ //# sourceMappingURL=job-complete.js.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * KiCI event trigger helper - creates triggers for custom named events.
3
+ * Returns a frozen KiciEventTriggerConfig directly.
4
+ */
5
+ import type { KiciEventConfigInput, KiciEventTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a KiCI custom event trigger configuration.
8
+ *
9
+ * @example
10
+ * // Match a specific event by name
11
+ * kiciEvent({ name: 'deploy-complete' })
12
+ *
13
+ * // With JSONPath payload matching
14
+ * kiciEvent({ name: 'deploy-complete', match: { '$.env': 'prod' } })
15
+ *
16
+ * // With negative filter
17
+ * kiciEvent({ name: 'deploy-complete', not: { '$.env': 'staging' } })
18
+ *
19
+ * // Cross-repo source filter
20
+ * kiciEvent({ name: 'deploy-complete', source: 'org/infra-repo' })
21
+ */
22
+ export declare function kiciEvent(config: KiciEventConfigInput): KiciEventTriggerConfig;
23
+ //# sourceMappingURL=kici-event.d.ts.map
@@ -0,0 +1,34 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ //#region src/triggers/kici-event.ts
3
+ /**
4
+ * Create a KiCI custom event trigger configuration.
5
+ *
6
+ * @example
7
+ * // Match a specific event by name
8
+ * kiciEvent({ name: 'deploy-complete' })
9
+ *
10
+ * // With JSONPath payload matching
11
+ * kiciEvent({ name: 'deploy-complete', match: { '$.env': 'prod' } })
12
+ *
13
+ * // With negative filter
14
+ * kiciEvent({ name: 'deploy-complete', not: { '$.env': 'staging' } })
15
+ *
16
+ * // Cross-repo source filter
17
+ * kiciEvent({ name: 'deploy-complete', source: 'org/infra-repo' })
18
+ */
19
+ function kiciEvent(config) {
20
+ if (!config.name || config.name.trim() === "") throw new Error("kiciEvent() requires a non-empty name");
21
+ const result = {
22
+ _tag: "KiciEventTrigger",
23
+ name: config.name,
24
+ ...config.match !== void 0 && { match: Object.freeze({ ...config.match }) },
25
+ ...config.source !== void 0 && { source: config.source },
26
+ ...config.not !== void 0 && { not: Object.freeze({ ...config.not }) },
27
+ ...config.description !== void 0 && { description: config.description }
28
+ };
29
+ return Object.freeze(result);
30
+ }
31
+ //#endregion
32
+ export { kiciEvent };
33
+
34
+ //# sourceMappingURL=kici-event.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Lifecycle trigger helper - creates triggers for cross-workflow lifecycle events.
3
+ * Returns a frozen LifecycleTriggerConfig directly.
4
+ */
5
+ import type { LifecycleConfigInput, LifecycleTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a lifecycle trigger configuration.
8
+ *
9
+ * @example
10
+ * // Trigger on any workflow completion
11
+ * lifecycle({ events: ['workflow_complete'] })
12
+ *
13
+ * // Trigger on job failures from a specific source
14
+ * lifecycle({ events: ['job_failed'], sources: ['org/deploy-repo'] })
15
+ *
16
+ * // Trigger when workflow registrations are updated
17
+ * lifecycle({ events: ['registration_updated'] })
18
+ */
19
+ export declare function lifecycle(config: LifecycleConfigInput): LifecycleTriggerConfig;
20
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1,29 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ //#region src/triggers/lifecycle.ts
3
+ /**
4
+ * Create a lifecycle trigger configuration.
5
+ *
6
+ * @example
7
+ * // Trigger on any workflow completion
8
+ * lifecycle({ events: ['workflow_complete'] })
9
+ *
10
+ * // Trigger on job failures from a specific source
11
+ * lifecycle({ events: ['job_failed'], sources: ['org/deploy-repo'] })
12
+ *
13
+ * // Trigger when workflow registrations are updated
14
+ * lifecycle({ events: ['registration_updated'] })
15
+ */
16
+ function lifecycle(config) {
17
+ if (!config.events || config.events.length === 0) throw new Error("lifecycle() requires a non-empty events array");
18
+ const result = {
19
+ _tag: "LifecycleTrigger",
20
+ events: Object.freeze([...config.events]),
21
+ ...config.sources !== void 0 && { sources: Object.freeze([...config.sources]) },
22
+ ...config.description !== void 0 && { description: config.description }
23
+ };
24
+ return Object.freeze(result);
25
+ }
26
+ //#endregion
27
+ export { lifecycle };
28
+
29
+ //# sourceMappingURL=lifecycle.js.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * PR trigger helper - creates triggers for pull request events.
3
+ * Returns a frozen PrTriggerConfig directly (no builder pattern).
4
+ */
5
+ import { type PrConfigInput, type PrTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a PR trigger configuration.
8
+ * Returns a frozen (immutable) PrTriggerConfig object directly.
9
+ *
10
+ * @example
11
+ * // No-arg: default events, no branch/path filters
12
+ * pr()
13
+ *
14
+ * // Config style
15
+ * pr({ target: 'main', paths: ['src/**'] })
16
+ *
17
+ * // Full config
18
+ * pr({
19
+ * events: ['opened', 'synchronize'],
20
+ * target: ['main', /^release-\d+$/],
21
+ * source: 'feature/*',
22
+ * paths: ['src/**', '!**\/*.test.ts'],
23
+ * description: 'PRs targeting main with source changes',
24
+ * })
25
+ */
26
+ export declare function pr(config?: PrConfigInput): PrTriggerConfig;
27
+ //# sourceMappingURL=pr.d.ts.map
@@ -0,0 +1,48 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import { DEFAULT_PR_EVENTS, asArray, toBranchPattern } from "./types.js";
3
+ //#region src/triggers/pr.ts
4
+ /**
5
+ * PR trigger helper - creates triggers for pull request events.
6
+ * Returns a frozen PrTriggerConfig directly (no builder pattern).
7
+ */
8
+ /**
9
+ * Create a PR trigger configuration.
10
+ * Returns a frozen (immutable) PrTriggerConfig object directly.
11
+ *
12
+ * @example
13
+ * // No-arg: default events, no branch/path filters
14
+ * pr()
15
+ *
16
+ * // Config style
17
+ * pr({ target: 'main', paths: ['src/**'] })
18
+ *
19
+ * // Full config
20
+ * pr({
21
+ * events: ['opened', 'synchronize'],
22
+ * target: ['main', /^release-\d+$/],
23
+ * source: 'feature/*',
24
+ * paths: ['src/**', '!**\/*.test.ts'],
25
+ * description: 'PRs targeting main with source changes',
26
+ * })
27
+ */
28
+ function pr(config) {
29
+ const events = config?.events ?? [...DEFAULT_PR_EVENTS];
30
+ const targetBranches = config?.target ? asArray(config.target).map(toBranchPattern) : [];
31
+ const sourceBranches = config?.source ? asArray(config.source).map(toBranchPattern) : [];
32
+ const paths = config?.paths ?? [];
33
+ const repos = config?.repos ? asArray(config.repos).map(toBranchPattern) : [];
34
+ const result = {
35
+ _tag: "PrTrigger",
36
+ events: Object.freeze([...events]),
37
+ targetBranches: Object.freeze([...targetBranches]),
38
+ sourceBranches: Object.freeze([...sourceBranches]),
39
+ paths: Object.freeze([...paths]),
40
+ repos: Object.freeze([...repos]),
41
+ ...config?.description !== void 0 && { description: config.description }
42
+ };
43
+ return Object.freeze(result);
44
+ }
45
+ //#endregion
46
+ export { pr };
47
+
48
+ //# sourceMappingURL=pr.js.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Push trigger helper - creates triggers for push events.
3
+ * Returns a frozen PushTriggerConfig directly (no builder pattern).
4
+ */
5
+ import { type PushConfigInput, type PushTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a push trigger configuration.
8
+ * Returns a frozen (immutable) PushTriggerConfig object directly.
9
+ *
10
+ * @example
11
+ * // No-arg: matches any push
12
+ * push()
13
+ *
14
+ * // Config style
15
+ * push({ branches: ['main', 'develop'], paths: ['src/**'] })
16
+ *
17
+ * // With tags
18
+ * push({ tags: ['v*'] })
19
+ *
20
+ * // Full config
21
+ * push({
22
+ * branches: 'main',
23
+ * tags: ['v*', /^release-\d+$/],
24
+ * paths: ['src/**', '!**\/*.test.ts'],
25
+ * description: 'Pushes to main or version tags',
26
+ * })
27
+ */
28
+ export declare function push(config?: PushConfigInput): PushTriggerConfig;
29
+ //# sourceMappingURL=push.d.ts.map
@@ -0,0 +1,48 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import { asArray, toBranchPattern } from "./types.js";
3
+ //#region src/triggers/push.ts
4
+ /**
5
+ * Push trigger helper - creates triggers for push events.
6
+ * Returns a frozen PushTriggerConfig directly (no builder pattern).
7
+ */
8
+ /**
9
+ * Create a push trigger configuration.
10
+ * Returns a frozen (immutable) PushTriggerConfig object directly.
11
+ *
12
+ * @example
13
+ * // No-arg: matches any push
14
+ * push()
15
+ *
16
+ * // Config style
17
+ * push({ branches: ['main', 'develop'], paths: ['src/**'] })
18
+ *
19
+ * // With tags
20
+ * push({ tags: ['v*'] })
21
+ *
22
+ * // Full config
23
+ * push({
24
+ * branches: 'main',
25
+ * tags: ['v*', /^release-\d+$/],
26
+ * paths: ['src/**', '!**\/*.test.ts'],
27
+ * description: 'Pushes to main or version tags',
28
+ * })
29
+ */
30
+ function push(config) {
31
+ const branches = config?.branches ? asArray(config.branches).map(toBranchPattern) : [];
32
+ const tags = config?.tags ? asArray(config.tags).map(toBranchPattern) : [];
33
+ const paths = config?.paths ?? [];
34
+ const repos = config?.repos ? asArray(config.repos).map(toBranchPattern) : [];
35
+ const result = {
36
+ _tag: "PushTrigger",
37
+ branches: Object.freeze([...branches]),
38
+ tags: Object.freeze([...tags]),
39
+ paths: Object.freeze([...paths]),
40
+ repos: Object.freeze([...repos]),
41
+ ...config?.description !== void 0 && { description: config.description }
42
+ };
43
+ return Object.freeze(result);
44
+ }
45
+ //#endregion
46
+ export { push };
47
+
48
+ //# sourceMappingURL=push.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Release trigger helper - creates triggers for release events.
3
+ * Returns a frozen ReleaseTriggerConfig directly.
4
+ */
5
+ import type { ReleaseConfigInput, ReleaseTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a release trigger configuration.
8
+ *
9
+ * @example
10
+ * // Match any release event
11
+ * release()
12
+ *
13
+ * // Match specific actions
14
+ * release({ actions: ['published'] })
15
+ */
16
+ export declare function release(config?: ReleaseConfigInput): ReleaseTriggerConfig;
17
+ //# sourceMappingURL=release.d.ts.map
@@ -0,0 +1,27 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import { asArray, toBranchPattern } from "./types.js";
3
+ //#region src/triggers/release.ts
4
+ /**
5
+ * Create a release trigger configuration.
6
+ *
7
+ * @example
8
+ * // Match any release event
9
+ * release()
10
+ *
11
+ * // Match specific actions
12
+ * release({ actions: ['published'] })
13
+ */
14
+ function release(config) {
15
+ const repos = config?.repos ? asArray(config.repos).map(toBranchPattern) : [];
16
+ const result = {
17
+ _tag: "ReleaseTrigger",
18
+ actions: Object.freeze(config?.actions ? [...config.actions] : []),
19
+ repos: Object.freeze([...repos]),
20
+ ...config?.description !== void 0 && { description: config.description }
21
+ };
22
+ return Object.freeze(result);
23
+ }
24
+ //#endregion
25
+ export { release };
26
+
27
+ //# sourceMappingURL=release.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Review comment trigger helper - creates triggers for PR review comment events.
3
+ * Returns a frozen ReviewCommentTriggerConfig directly.
4
+ */
5
+ import type { ReviewCommentConfigInput, ReviewCommentTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a pull request review comment trigger configuration.
8
+ *
9
+ * @example
10
+ * // Match any review comment event
11
+ * reviewComment()
12
+ *
13
+ * // Match specific actions
14
+ * reviewComment({ actions: ['created', 'edited'] })
15
+ */
16
+ export declare function reviewComment(config?: ReviewCommentConfigInput): ReviewCommentTriggerConfig;
17
+ //# sourceMappingURL=review-comment.d.ts.map
@@ -0,0 +1,27 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import { asArray, toBranchPattern } from "./types.js";
3
+ //#region src/triggers/review-comment.ts
4
+ /**
5
+ * Create a pull request review comment trigger configuration.
6
+ *
7
+ * @example
8
+ * // Match any review comment event
9
+ * reviewComment()
10
+ *
11
+ * // Match specific actions
12
+ * reviewComment({ actions: ['created', 'edited'] })
13
+ */
14
+ function reviewComment(config) {
15
+ const repos = config?.repos ? asArray(config.repos).map(toBranchPattern) : [];
16
+ const result = {
17
+ _tag: "ReviewCommentTrigger",
18
+ actions: Object.freeze(config?.actions ? [...config.actions] : []),
19
+ repos: Object.freeze([...repos]),
20
+ ...config?.description !== void 0 && { description: config.description }
21
+ };
22
+ return Object.freeze(result);
23
+ }
24
+ //#endregion
25
+ export { reviewComment };
26
+
27
+ //# sourceMappingURL=review-comment.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Review trigger helper - creates triggers for pull request review events.
3
+ * Returns a frozen ReviewTriggerConfig directly.
4
+ */
5
+ import type { ReviewConfigInput, ReviewTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a pull request review trigger configuration.
8
+ *
9
+ * @example
10
+ * // Match any review event
11
+ * review()
12
+ *
13
+ * // Match specific actions and states
14
+ * review({ actions: ['submitted'], states: ['approved'] })
15
+ */
16
+ export declare function review(config?: ReviewConfigInput): ReviewTriggerConfig;
17
+ //# sourceMappingURL=review.d.ts.map
@@ -0,0 +1,28 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import { asArray, toBranchPattern } from "./types.js";
3
+ //#region src/triggers/review.ts
4
+ /**
5
+ * Create a pull request review trigger configuration.
6
+ *
7
+ * @example
8
+ * // Match any review event
9
+ * review()
10
+ *
11
+ * // Match specific actions and states
12
+ * review({ actions: ['submitted'], states: ['approved'] })
13
+ */
14
+ function review(config) {
15
+ const repos = config?.repos ? asArray(config.repos).map(toBranchPattern) : [];
16
+ const result = {
17
+ _tag: "ReviewTrigger",
18
+ actions: Object.freeze(config?.actions ? [...config.actions] : []),
19
+ states: Object.freeze(config?.states ? [...config.states] : []),
20
+ repos: Object.freeze([...repos]),
21
+ ...config?.description !== void 0 && { description: config.description }
22
+ };
23
+ return Object.freeze(result);
24
+ }
25
+ //#endregion
26
+ export { review };
27
+
28
+ //# sourceMappingURL=review.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Schedule trigger helper - creates triggers for cron-based workflow execution.
3
+ * Returns a frozen ScheduleTriggerConfig directly.
4
+ */
5
+ import type { ScheduleConfigInput, ScheduleTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a schedule trigger configuration.
8
+ *
9
+ * @example
10
+ * // Run every hour
11
+ * schedule({ cron: '0 * * * *' })
12
+ *
13
+ * // Run daily at midnight UTC
14
+ * schedule({ cron: '0 0 * * *' })
15
+ *
16
+ * // Run weekly on Monday at 9am in a specific timezone
17
+ * schedule({ cron: '0 9 * * 1', timezone: 'America/New_York' })
18
+ */
19
+ export declare function schedule(config: ScheduleConfigInput): ScheduleTriggerConfig;
20
+ //# sourceMappingURL=schedule.d.ts.map
@@ -0,0 +1,29 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ //#region src/triggers/schedule.ts
3
+ /**
4
+ * Create a schedule trigger configuration.
5
+ *
6
+ * @example
7
+ * // Run every hour
8
+ * schedule({ cron: '0 * * * *' })
9
+ *
10
+ * // Run daily at midnight UTC
11
+ * schedule({ cron: '0 0 * * *' })
12
+ *
13
+ * // Run weekly on Monday at 9am in a specific timezone
14
+ * schedule({ cron: '0 9 * * 1', timezone: 'America/New_York' })
15
+ */
16
+ function schedule(config) {
17
+ if (!config.cron || config.cron.trim() === "") throw new Error("schedule() requires a non-empty cron expression");
18
+ const result = {
19
+ _tag: "ScheduleTrigger",
20
+ cron: config.cron,
21
+ timezone: config.timezone ?? "UTC",
22
+ ...config.description !== void 0 && { description: config.description }
23
+ };
24
+ return Object.freeze(result);
25
+ }
26
+ //#endregion
27
+ export { schedule };
28
+
29
+ //# sourceMappingURL=schedule.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Star trigger helper - creates triggers for star events.
3
+ * Returns a frozen StarTriggerConfig directly.
4
+ */
5
+ import type { StarConfigInput, StarTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a star trigger configuration.
8
+ *
9
+ * @example
10
+ * // Match any star event
11
+ * star()
12
+ *
13
+ * // Match specific actions
14
+ * star({ actions: ['created'] })
15
+ */
16
+ export declare function star(config?: StarConfigInput): StarTriggerConfig;
17
+ //# sourceMappingURL=star.d.ts.map
@@ -0,0 +1,27 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import { asArray, toBranchPattern } from "./types.js";
3
+ //#region src/triggers/star.ts
4
+ /**
5
+ * Create a star trigger configuration.
6
+ *
7
+ * @example
8
+ * // Match any star event
9
+ * star()
10
+ *
11
+ * // Match specific actions
12
+ * star({ actions: ['created'] })
13
+ */
14
+ function star(config) {
15
+ const repos = config?.repos ? asArray(config.repos).map(toBranchPattern) : [];
16
+ const result = {
17
+ _tag: "StarTrigger",
18
+ actions: Object.freeze(config?.actions ? [...config.actions] : []),
19
+ repos: Object.freeze([...repos]),
20
+ ...config?.description !== void 0 && { description: config.description }
21
+ };
22
+ return Object.freeze(result);
23
+ }
24
+ //#endregion
25
+ export { star };
26
+
27
+ //# sourceMappingURL=star.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Status trigger helper - creates triggers for commit status events.
3
+ * Returns a frozen StatusTriggerConfig directly.
4
+ */
5
+ import type { StatusConfigInput, StatusTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a commit status trigger configuration.
8
+ *
9
+ * @example
10
+ * // Match any status event
11
+ * status()
12
+ *
13
+ * // Match specific contexts and states
14
+ * status({ contexts: ['ci/*'], states: ['success'] })
15
+ */
16
+ export declare function status(config?: StatusConfigInput): StatusTriggerConfig;
17
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1,28 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import { asArray, toBranchPattern } from "./types.js";
3
+ //#region src/triggers/status.ts
4
+ /**
5
+ * Create a commit status trigger configuration.
6
+ *
7
+ * @example
8
+ * // Match any status event
9
+ * status()
10
+ *
11
+ * // Match specific contexts and states
12
+ * status({ contexts: ['ci/*'], states: ['success'] })
13
+ */
14
+ function status(config) {
15
+ const repos = config?.repos ? asArray(config.repos).map(toBranchPattern) : [];
16
+ const result = {
17
+ _tag: "StatusTrigger",
18
+ contexts: Object.freeze(config?.contexts ? [...config.contexts] : []),
19
+ states: Object.freeze(config?.states ? [...config.states] : []),
20
+ repos: Object.freeze([...repos]),
21
+ ...config?.description !== void 0 && { description: config.description }
22
+ };
23
+ return Object.freeze(result);
24
+ }
25
+ //#endregion
26
+ export { status };
27
+
28
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Tag trigger helper - creates triggers for tag push events.
3
+ * Returns a frozen TagTriggerConfig directly.
4
+ */
5
+ import type { TagConfigInput, TagTriggerConfig } from './types.js';
6
+ /**
7
+ * Create a tag trigger configuration.
8
+ *
9
+ * @example
10
+ * // Match any tag
11
+ * tag()
12
+ *
13
+ * // Match specific patterns
14
+ * tag({ patterns: ['v*'] })
15
+ *
16
+ * // With regex
17
+ * tag({ patterns: [/^v\d+\.\d+\.\d+$/] })
18
+ */
19
+ export declare function tag(config?: TagConfigInput): TagTriggerConfig;
20
+ //# sourceMappingURL=tag.d.ts.map
@@ -0,0 +1,31 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import { asArray, toBranchPattern } from "./types.js";
3
+ //#region src/triggers/tag.ts
4
+ /**
5
+ * Create a tag trigger configuration.
6
+ *
7
+ * @example
8
+ * // Match any tag
9
+ * tag()
10
+ *
11
+ * // Match specific patterns
12
+ * tag({ patterns: ['v*'] })
13
+ *
14
+ * // With regex
15
+ * tag({ patterns: [/^v\d+\.\d+\.\d+$/] })
16
+ */
17
+ function tag(config) {
18
+ const patterns = config?.patterns ? asArray(config.patterns).map(toBranchPattern) : [];
19
+ const repos = config?.repos ? asArray(config.repos).map(toBranchPattern) : [];
20
+ const result = {
21
+ _tag: "TagTrigger",
22
+ patterns: Object.freeze([...patterns]),
23
+ repos: Object.freeze([...repos]),
24
+ ...config?.description !== void 0 && { description: config.description }
25
+ };
26
+ return Object.freeze(result);
27
+ }
28
+ //#endregion
29
+ export { tag };
30
+
31
+ //# sourceMappingURL=tag.js.map