@generacy-ai/generacy-plugin-github-actions 0.0.0-preview-20260304013206

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 (86) hide show
  1. package/LICENSE +191 -0
  2. package/dist/client.d.ts +46 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +109 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/events/emitter.d.ts +40 -0
  7. package/dist/events/emitter.d.ts.map +1 -0
  8. package/dist/events/emitter.js +104 -0
  9. package/dist/events/emitter.js.map +1 -0
  10. package/dist/events/types.d.ts +61 -0
  11. package/dist/events/types.d.ts.map +1 -0
  12. package/dist/events/types.js +48 -0
  13. package/dist/events/types.js.map +1 -0
  14. package/dist/index.d.ts +15 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +27 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/operations/artifacts.d.ts +46 -0
  19. package/dist/operations/artifacts.d.ts.map +1 -0
  20. package/dist/operations/artifacts.js +166 -0
  21. package/dist/operations/artifacts.js.map +1 -0
  22. package/dist/operations/check-runs.d.ts +58 -0
  23. package/dist/operations/check-runs.d.ts.map +1 -0
  24. package/dist/operations/check-runs.js +188 -0
  25. package/dist/operations/check-runs.js.map +1 -0
  26. package/dist/operations/jobs.d.ts +35 -0
  27. package/dist/operations/jobs.d.ts.map +1 -0
  28. package/dist/operations/jobs.js +134 -0
  29. package/dist/operations/jobs.js.map +1 -0
  30. package/dist/operations/runs.d.ts +49 -0
  31. package/dist/operations/runs.d.ts.map +1 -0
  32. package/dist/operations/runs.js +164 -0
  33. package/dist/operations/runs.js.map +1 -0
  34. package/dist/operations/workflows.d.ts +32 -0
  35. package/dist/operations/workflows.d.ts.map +1 -0
  36. package/dist/operations/workflows.js +138 -0
  37. package/dist/operations/workflows.js.map +1 -0
  38. package/dist/plugin.d.ts +254 -0
  39. package/dist/plugin.d.ts.map +1 -0
  40. package/dist/plugin.js +471 -0
  41. package/dist/plugin.js.map +1 -0
  42. package/dist/polling/status-poller.d.ts +58 -0
  43. package/dist/polling/status-poller.d.ts.map +1 -0
  44. package/dist/polling/status-poller.js +167 -0
  45. package/dist/polling/status-poller.js.map +1 -0
  46. package/dist/polling/types.d.ts +54 -0
  47. package/dist/polling/types.d.ts.map +1 -0
  48. package/dist/polling/types.js +21 -0
  49. package/dist/polling/types.js.map +1 -0
  50. package/dist/types/artifacts.d.ts +49 -0
  51. package/dist/types/artifacts.d.ts.map +1 -0
  52. package/dist/types/artifacts.js +22 -0
  53. package/dist/types/artifacts.js.map +1 -0
  54. package/dist/types/check-runs.d.ts +123 -0
  55. package/dist/types/check-runs.d.ts.map +1 -0
  56. package/dist/types/check-runs.js +13 -0
  57. package/dist/types/check-runs.js.map +1 -0
  58. package/dist/types/config.d.ts +131 -0
  59. package/dist/types/config.d.ts.map +1 -0
  60. package/dist/types/config.js +40 -0
  61. package/dist/types/config.js.map +1 -0
  62. package/dist/types/events.d.ts +69 -0
  63. package/dist/types/events.d.ts.map +1 -0
  64. package/dist/types/events.js +19 -0
  65. package/dist/types/events.js.map +1 -0
  66. package/dist/types/index.d.ts +7 -0
  67. package/dist/types/index.d.ts.map +1 -0
  68. package/dist/types/index.js +13 -0
  69. package/dist/types/index.js.map +1 -0
  70. package/dist/types/jobs.d.ts +71 -0
  71. package/dist/types/jobs.d.ts.map +1 -0
  72. package/dist/types/jobs.js +19 -0
  73. package/dist/types/jobs.js.map +1 -0
  74. package/dist/types/workflows.d.ts +101 -0
  75. package/dist/types/workflows.d.ts.map +1 -0
  76. package/dist/types/workflows.js +19 -0
  77. package/dist/types/workflows.js.map +1 -0
  78. package/dist/utils/errors.d.ts +77 -0
  79. package/dist/utils/errors.d.ts.map +1 -0
  80. package/dist/utils/errors.js +122 -0
  81. package/dist/utils/errors.js.map +1 -0
  82. package/dist/utils/validation.d.ts +74 -0
  83. package/dist/utils/validation.d.ts.map +1 -0
  84. package/dist/utils/validation.js +86 -0
  85. package/dist/utils/validation.js.map +1 -0
  86. package/package.json +62 -0
@@ -0,0 +1,69 @@
1
+ import type { WorkflowConclusion } from './workflows.js';
2
+ import type { CheckConclusion } from './check-runs.js';
3
+ /**
4
+ * Event emitted when a workflow run completes successfully
5
+ */
6
+ export interface WorkflowCompletedEvent {
7
+ type: 'workflow.completed';
8
+ /** Workflow run ID */
9
+ runId: number;
10
+ /** Workflow filename */
11
+ workflow: string;
12
+ /** Run conclusion */
13
+ conclusion: WorkflowConclusion;
14
+ /** Duration in milliseconds */
15
+ duration: number;
16
+ /** Workflow run URL */
17
+ url: string;
18
+ }
19
+ /**
20
+ * Event emitted when a workflow run fails
21
+ */
22
+ export interface WorkflowFailedEvent {
23
+ type: 'workflow.failed';
24
+ /** Workflow run ID */
25
+ runId: number;
26
+ /** Workflow filename */
27
+ workflow: string;
28
+ /** Error message or description */
29
+ error: string;
30
+ /** Names of failed jobs */
31
+ failedJobs: string[];
32
+ /** Workflow run URL */
33
+ url: string;
34
+ }
35
+ /**
36
+ * Event emitted when a check run completes
37
+ */
38
+ export interface CheckRunCompletedEvent {
39
+ type: 'check_run.completed';
40
+ /** Check run ID */
41
+ checkRunId: number;
42
+ /** Check name */
43
+ name: string;
44
+ /** Check conclusion */
45
+ conclusion: CheckConclusion;
46
+ /** HEAD SHA the check was run against */
47
+ headSha: string;
48
+ }
49
+ /**
50
+ * Union of all plugin events
51
+ */
52
+ export type PluginEvent = WorkflowCompletedEvent | WorkflowFailedEvent | CheckRunCompletedEvent;
53
+ /**
54
+ * Event type discriminator
55
+ */
56
+ export type PluginEventType = PluginEvent['type'];
57
+ /**
58
+ * Type guard for workflow completed event
59
+ */
60
+ export declare function isWorkflowCompletedEvent(event: PluginEvent): event is WorkflowCompletedEvent;
61
+ /**
62
+ * Type guard for workflow failed event
63
+ */
64
+ export declare function isWorkflowFailedEvent(event: PluginEvent): event is WorkflowFailedEvent;
65
+ /**
66
+ * Type guard for check run completed event
67
+ */
68
+ export declare function isCheckRunCompletedEvent(event: PluginEvent): event is CheckRunCompletedEvent;
69
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,mBAAmB;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,UAAU,EAAE,eAAe,CAAC;IAC5B,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,sBAAsB,GACtB,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAElD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,WAAW,GACjB,KAAK,IAAI,sBAAsB,CAEjC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,WAAW,GACjB,KAAK,IAAI,mBAAmB,CAE9B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,WAAW,GACjB,KAAK,IAAI,sBAAsB,CAEjC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Type guard for workflow completed event
3
+ */
4
+ export function isWorkflowCompletedEvent(event) {
5
+ return event.type === 'workflow.completed';
6
+ }
7
+ /**
8
+ * Type guard for workflow failed event
9
+ */
10
+ export function isWorkflowFailedEvent(event) {
11
+ return event.type === 'workflow.failed';
12
+ }
13
+ /**
14
+ * Type guard for check run completed event
15
+ */
16
+ export function isCheckRunCompletedEvent(event) {
17
+ return event.type === 'check_run.completed';
18
+ }
19
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAiEA;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAkB;IAElB,OAAO,KAAK,CAAC,IAAI,KAAK,oBAAoB,CAAC;AAC7C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAkB;IAElB,OAAO,KAAK,CAAC,IAAI,KAAK,iBAAiB,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAkB;IAElB,OAAO,KAAK,CAAC,IAAI,KAAK,qBAAqB,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { type GitHubActionsConfig, type PollingOptions, type WorkflowsConfig, gitHubActionsConfigSchema, pollingOptionsSchema, workflowsConfigSchema, parseConfig, DEFAULT_POLLING_CONFIG, } from './config.js';
2
+ export { type User, type WorkflowStatus, type WorkflowConclusion, type WorkflowRun, type TriggerWorkflowParams, isTerminalStatus, isSuccessful, isFailed, } from './workflows.js';
3
+ export { type JobStatus, type JobConclusion, type StepStatus, type StepConclusion, type Step, type Job, isJobComplete, isJobSuccessful, getFailedSteps, } from './jobs.js';
4
+ export { type Artifact, type ArtifactListResponse, isArtifactAvailable, formatArtifactSize, } from './artifacts.js';
5
+ export { type CheckStatus, type CheckConclusion, type AnnotationLevel, type CheckAnnotation, type CheckOutput, type CheckRun, type CreateCheckRunParams, type UpdateCheckRunParams, isCheckComplete, isCheckSuccessful, } from './check-runs.js';
6
+ export { type WorkflowCompletedEvent, type WorkflowFailedEvent, type CheckRunCompletedEvent, type PluginEvent, type PluginEventType, isWorkflowCompletedEvent, isWorkflowFailedEvent, isCheckRunCompletedEvent, } from './events.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,gBAAgB,EAChB,YAAY,EACZ,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,IAAI,EACT,KAAK,GAAG,EACR,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,eAAe,EACf,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,13 @@
1
+ // Configuration types
2
+ export { gitHubActionsConfigSchema, pollingOptionsSchema, workflowsConfigSchema, parseConfig, DEFAULT_POLLING_CONFIG, } from './config.js';
3
+ // Workflow types
4
+ export { isTerminalStatus, isSuccessful, isFailed, } from './workflows.js';
5
+ // Job types
6
+ export { isJobComplete, isJobSuccessful, getFailedSteps, } from './jobs.js';
7
+ // Artifact types
8
+ export { isArtifactAvailable, formatArtifactSize, } from './artifacts.js';
9
+ // Check run types
10
+ export { isCheckComplete, isCheckSuccessful, } from './check-runs.js';
11
+ // Event types
12
+ export { isWorkflowCompletedEvent, isWorkflowFailedEvent, isCheckRunCompletedEvent, } from './events.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAIL,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,iBAAiB;AACjB,OAAO,EAML,gBAAgB,EAChB,YAAY,EACZ,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAExB,YAAY;AACZ,OAAO,EAOL,aAAa,EACb,eAAe,EACf,cAAc,GACf,MAAM,WAAW,CAAC;AAEnB,iBAAiB;AACjB,OAAO,EAGL,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,kBAAkB;AAClB,OAAO,EASL,eAAe,EACf,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,cAAc;AACd,OAAO,EAML,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Job status
3
+ */
4
+ export type JobStatus = 'queued' | 'in_progress' | 'completed';
5
+ /**
6
+ * Job conclusion (final outcome)
7
+ */
8
+ export type JobConclusion = 'success' | 'failure' | 'cancelled' | 'skipped' | null;
9
+ /**
10
+ * Step status
11
+ */
12
+ export type StepStatus = 'queued' | 'in_progress' | 'completed';
13
+ /**
14
+ * Step conclusion (final outcome)
15
+ */
16
+ export type StepConclusion = 'success' | 'failure' | 'cancelled' | 'skipped' | null;
17
+ /**
18
+ * Represents a step within a job
19
+ */
20
+ export interface Step {
21
+ /** Step name */
22
+ name: string;
23
+ /** Step status */
24
+ status: StepStatus;
25
+ /** Step conclusion */
26
+ conclusion: StepConclusion;
27
+ /** Step number (1-indexed) */
28
+ number: number;
29
+ /** Started timestamp */
30
+ started_at: string | null;
31
+ /** Completed timestamp */
32
+ completed_at: string | null;
33
+ }
34
+ /**
35
+ * Represents a job within a workflow run
36
+ */
37
+ export interface Job {
38
+ /** Unique job ID */
39
+ id: number;
40
+ /** Parent run ID */
41
+ run_id: number;
42
+ /** Job name */
43
+ name: string;
44
+ /** Current status */
45
+ status: JobStatus;
46
+ /** Final conclusion (when completed) */
47
+ conclusion: JobConclusion;
48
+ /** Steps within the job */
49
+ steps: Step[];
50
+ /** Started timestamp */
51
+ started_at: string | null;
52
+ /** Completed timestamp */
53
+ completed_at: string | null;
54
+ /** Runner ID */
55
+ runner_id: number | null;
56
+ /** Runner name */
57
+ runner_name: string | null;
58
+ }
59
+ /**
60
+ * Check if a job is in a terminal state
61
+ */
62
+ export declare function isJobComplete(job: Job): boolean;
63
+ /**
64
+ * Check if a job was successful
65
+ */
66
+ export declare function isJobSuccessful(job: Job): boolean;
67
+ /**
68
+ * Get failed steps from a job
69
+ */
70
+ export declare function getFailedSteps(job: Job): Step[];
71
+ //# sourceMappingURL=jobs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.d.ts","sourceRoot":"","sources":["../../src/types/jobs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;AAEnF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,sBAAsB;IACtB,UAAU,EAAE,cAAc,CAAC;IAC3B,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0BAA0B;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe;IACf,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,wCAAwC;IACxC,UAAU,EAAE,aAAa,CAAC;IAC1B,2BAA2B;IAC3B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,wBAAwB;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0BAA0B;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gBAAgB;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kBAAkB;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAEjD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,EAAE,CAE/C"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Check if a job is in a terminal state
3
+ */
4
+ export function isJobComplete(job) {
5
+ return job.status === 'completed';
6
+ }
7
+ /**
8
+ * Check if a job was successful
9
+ */
10
+ export function isJobSuccessful(job) {
11
+ return job.status === 'completed' && job.conclusion === 'success';
12
+ }
13
+ /**
14
+ * Get failed steps from a job
15
+ */
16
+ export function getFailedSteps(job) {
17
+ return job.steps.filter((step) => step.conclusion === 'failure');
18
+ }
19
+ //# sourceMappingURL=jobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/types/jobs.ts"],"names":[],"mappings":"AAgEA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,GAAQ;IACpC,OAAO,GAAG,CAAC,MAAM,KAAK,WAAW,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,GAAQ;IACtC,OAAO,GAAG,CAAC,MAAM,KAAK,WAAW,IAAI,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,GAAQ;IACrC,OAAO,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC;AACnE,CAAC"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * GitHub user information
3
+ */
4
+ export interface User {
5
+ /** User ID */
6
+ id: number;
7
+ /** Username */
8
+ login: string;
9
+ /** Avatar URL */
10
+ avatar_url: string;
11
+ /** User type */
12
+ type: 'User' | 'Bot';
13
+ }
14
+ /**
15
+ * Workflow run status
16
+ */
17
+ export type WorkflowStatus = 'queued' | 'in_progress' | 'completed';
18
+ /**
19
+ * Workflow run conclusion (final outcome)
20
+ */
21
+ export type WorkflowConclusion = 'success' | 'failure' | 'neutral' | 'cancelled' | 'skipped' | 'timed_out' | 'action_required' | null;
22
+ /**
23
+ * Represents a GitHub Actions workflow definition
24
+ */
25
+ export interface Workflow {
26
+ /** Unique workflow ID */
27
+ id: number;
28
+ /** Workflow name */
29
+ name: string;
30
+ /** Workflow filename path */
31
+ path: string;
32
+ /** Workflow state */
33
+ state: 'active' | 'deleted' | 'disabled_fork' | 'disabled_inactivity' | 'disabled_manually';
34
+ /** Created timestamp */
35
+ created_at: string;
36
+ /** Updated timestamp */
37
+ updated_at: string;
38
+ /** Workflow URL */
39
+ html_url: string;
40
+ /** Badge URL */
41
+ badge_url: string;
42
+ }
43
+ /**
44
+ * Represents a GitHub Actions workflow run
45
+ */
46
+ export interface WorkflowRun {
47
+ /** Unique run ID */
48
+ id: number;
49
+ /** Workflow ID */
50
+ workflow_id?: number;
51
+ /** Workflow name */
52
+ name: string;
53
+ /** Workflow filename */
54
+ path: string;
55
+ /** Git reference (branch/tag) */
56
+ head_branch: string;
57
+ /** Commit SHA */
58
+ head_sha: string;
59
+ /** Current status */
60
+ status: WorkflowStatus;
61
+ /** Final conclusion (when completed) */
62
+ conclusion: WorkflowConclusion;
63
+ /** Workflow URL */
64
+ html_url: string;
65
+ /** Created timestamp */
66
+ created_at: string;
67
+ /** Updated timestamp */
68
+ updated_at: string;
69
+ /** Run started timestamp */
70
+ run_started_at: string | null;
71
+ /** Actor who triggered the run */
72
+ actor: User;
73
+ /** Triggering event */
74
+ event: string;
75
+ /** Run attempt number */
76
+ run_attempt: number;
77
+ }
78
+ /**
79
+ * Parameters for triggering a workflow
80
+ */
81
+ export interface TriggerWorkflowParams {
82
+ /** Workflow filename or ID */
83
+ workflow: string;
84
+ /** Git ref (branch/tag), defaults to default branch */
85
+ ref?: string;
86
+ /** Workflow inputs */
87
+ inputs?: Record<string, string>;
88
+ }
89
+ /**
90
+ * Check if a workflow run is in a terminal state
91
+ */
92
+ export declare function isTerminalStatus(status: WorkflowStatus): boolean;
93
+ /**
94
+ * Check if a workflow run was successful
95
+ */
96
+ export declare function isSuccessful(run: WorkflowRun): boolean;
97
+ /**
98
+ * Check if a workflow run failed
99
+ */
100
+ export declare function isFailed(run: WorkflowRun): boolean;
101
+ //# sourceMappingURL=workflows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/types/workflows.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,cAAc;IACd,EAAE,EAAE,MAAM,CAAC;IACX,eAAe;IACf,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,aAAa,GAAG,WAAW,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,GACX,iBAAiB,GACjB,IAAI,CAAC;AAET;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,yBAAyB;IACzB,EAAE,EAAE,MA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AE,MAAM,CAAC;IACb,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEhE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAElD"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Check if a workflow run is in a terminal state
3
+ */
4
+ export function isTerminalStatus(status) {
5
+ return status === 'completed';
6
+ }
7
+ /**
8
+ * Check if a workflow run was successful
9
+ */
10
+ export function isSuccessful(run) {
11
+ return run.status === 'completed' && run.conclusion === 'success';
12
+ }
13
+ /**
14
+ * Check if a workflow run failed
15
+ */
16
+ export function isFailed(run) {
17
+ return run.status === 'completed' && run.conclusion === 'failure';
18
+ }
19
+ //# sourceMappingURL=workflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/types/workflows.ts"],"names":[],"mappings":"AAsGA;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,OAAO,MAAM,KAAK,WAAW,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,GAAgB;IAC3C,OAAO,GAAG,CAAC,MAAM,KAAK,WAAW,IAAI,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAgB;IACvC,OAAO,GAAG,CAAC,MAAM,KAAK,WAAW,IAAI,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC;AACpE,CAAC"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Base error class for GitHub Actions plugin errors
3
+ */
4
+ export declare class GitHubActionsError extends Error {
5
+ readonly code: string;
6
+ readonly cause?: Error | undefined;
7
+ constructor(message: string, code: string, cause?: Error | undefined);
8
+ }
9
+ /**
10
+ * Error thrown when GitHub API rate limit is exceeded
11
+ */
12
+ export declare class RateLimitError extends GitHubActionsError {
13
+ readonly resetAt: Date;
14
+ constructor(resetAt: Date, cause?: Error);
15
+ /**
16
+ * Get milliseconds until rate limit resets
17
+ */
18
+ getTimeUntilReset(): number;
19
+ }
20
+ /**
21
+ * Error thrown when a workflow is not found
22
+ */
23
+ export declare class WorkflowNotFoundError extends GitHubActionsError {
24
+ readonly workflow: string;
25
+ constructor(workflow: string, cause?: Error);
26
+ }
27
+ /**
28
+ * Error thrown when a workflow run is not found
29
+ */
30
+ export declare class RunNotFoundError extends GitHubActionsError {
31
+ readonly runId: number;
32
+ constructor(runId: number, cause?: Error);
33
+ }
34
+ /**
35
+ * Error thrown when a job is not found
36
+ */
37
+ export declare class JobNotFoundError extends GitHubActionsError {
38
+ readonly jobId: number;
39
+ constructor(jobId: number, cause?: Error);
40
+ }
41
+ /**
42
+ * Error thrown when an artifact is not found
43
+ */
44
+ export declare class ArtifactNotFoundError extends GitHubActionsError {
45
+ readonly artifactId: number;
46
+ constructor(artifactId: number, cause?: Error);
47
+ }
48
+ /**
49
+ * Error thrown when a check run is not found
50
+ */
51
+ export declare class CheckRunNotFoundError extends GitHubActionsError {
52
+ readonly checkRunId: number;
53
+ constructor(checkRunId: number, cause?: Error);
54
+ }
55
+ /**
56
+ * Error thrown when polling times out
57
+ */
58
+ export declare class PollingTimeoutError extends GitHubActionsError {
59
+ readonly runId: number;
60
+ readonly maxAttempts: number;
61
+ constructor(runId: number, maxAttempts: number, cause?: Error);
62
+ }
63
+ /**
64
+ * Error thrown for invalid configuration
65
+ */
66
+ export declare class ConfigurationError extends GitHubActionsError {
67
+ constructor(message: string, cause?: Error);
68
+ }
69
+ /**
70
+ * Check if an error is a GitHub API rate limit error
71
+ */
72
+ export declare function isRateLimitError(error: unknown): error is RateLimitError;
73
+ /**
74
+ * Check if an error is a GitHub Actions plugin error
75
+ */
76
+ export declare function isGitHubActionsError(error: unknown): error is GitHubActionsError;
77
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;aAGzB,IAAI,EAAE,MAAM;aACZ,KAAK,CAAC,EAAE,KAAK;gBAF7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,KAAK,YAAA;CAMhC;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;aAElC,OAAO,EAAE,IAAI;gBAAb,OAAO,EAAE,IAAI,EAC7B,KAAK,CAAC,EAAE,KAAK;IAWf;;OAEG;IACH,iBAAiB,IAAI,MAAM;CAG5B;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,kBAAkB;aAEzC,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,EAAE,MAAM,EAChC,KAAK,CAAC,EAAE,KAAK;CAKhB;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,kBAAkB;aAEpC,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM,EAC7B,KAAK,CAAC,EAAE,KAAK;CAKhB;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,kBAAkB;aAEpC,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM,EAC7B,KAAK,CAAC,EAAE,KAAK;CAKhB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,kBAAkB;aAEzC,UAAU,EAAE,MAAM;gBAAlB,UAAU,EAAE,MAAM,EAClC,KAAK,CAAC,EAAE,KAAK;CAKhB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,kBAAkB;aAEzC,UAAU,EAAE,MAAM;gBAAlB,UAAU,EAAE,MAAM,EAClC,KAAK,CAAC,EAAE,KAAK;CAKhB;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,kBAAkB;aAEvC,KAAK,EAAE,MAAM;aACb,WAAW,EAAE,MAAM;gBADnB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnC,KAAK,CAAC,EAAE,KAAK;CAShB;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,kBAAkB;gBAC5C,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAI3C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,kBAAkB,CAE7B"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Base error class for GitHub Actions plugin errors
3
+ */
4
+ export class GitHubActionsError extends Error {
5
+ code;
6
+ cause;
7
+ constructor(message, code, cause) {
8
+ super(message);
9
+ this.code = code;
10
+ this.cause = cause;
11
+ this.name = 'GitHubActionsError';
12
+ Error.captureStackTrace?.(this, this.constructor);
13
+ }
14
+ }
15
+ /**
16
+ * Error thrown when GitHub API rate limit is exceeded
17
+ */
18
+ export class RateLimitError extends GitHubActionsError {
19
+ resetAt;
20
+ constructor(resetAt, cause) {
21
+ const resetTime = resetAt.toISOString();
22
+ super(`GitHub API rate limit exceeded. Resets at ${resetTime}`, 'RATE_LIMIT_EXCEEDED', cause);
23
+ this.resetAt = resetAt;
24
+ this.name = 'RateLimitError';
25
+ }
26
+ /**
27
+ * Get milliseconds until rate limit resets
28
+ */
29
+ getTimeUntilReset() {
30
+ return Math.max(0, this.resetAt.getTime() - Date.now());
31
+ }
32
+ }
33
+ /**
34
+ * Error thrown when a workflow is not found
35
+ */
36
+ export class WorkflowNotFoundError extends GitHubActionsError {
37
+ workflow;
38
+ constructor(workflow, cause) {
39
+ super(`Workflow not found: ${workflow}`, 'WORKFLOW_NOT_FOUND', cause);
40
+ this.workflow = workflow;
41
+ this.name = 'WorkflowNotFoundError';
42
+ }
43
+ }
44
+ /**
45
+ * Error thrown when a workflow run is not found
46
+ */
47
+ export class RunNotFoundError extends GitHubActionsError {
48
+ runId;
49
+ constructor(runId, cause) {
50
+ super(`Workflow run not found: ${runId}`, 'RUN_NOT_FOUND', cause);
51
+ this.runId = runId;
52
+ this.name = 'RunNotFoundError';
53
+ }
54
+ }
55
+ /**
56
+ * Error thrown when a job is not found
57
+ */
58
+ export class JobNotFoundError extends GitHubActionsError {
59
+ jobId;
60
+ constructor(jobId, cause) {
61
+ super(`Job not found: ${jobId}`, 'JOB_NOT_FOUND', cause);
62
+ this.jobId = jobId;
63
+ this.name = 'JobNotFoundError';
64
+ }
65
+ }
66
+ /**
67
+ * Error thrown when an artifact is not found
68
+ */
69
+ export class ArtifactNotFoundError extends GitHubActionsError {
70
+ artifactId;
71
+ constructor(artifactId, cause) {
72
+ super(`Artifact not found: ${artifactId}`, 'ARTIFACT_NOT_FOUND', cause);
73
+ this.artifactId = artifactId;
74
+ this.name = 'ArtifactNotFoundError';
75
+ }
76
+ }
77
+ /**
78
+ * Error thrown when a check run is not found
79
+ */
80
+ export class CheckRunNotFoundError extends GitHubActionsError {
81
+ checkRunId;
82
+ constructor(checkRunId, cause) {
83
+ super(`Check run not found: ${checkRunId}`, 'CHECK_RUN_NOT_FOUND', cause);
84
+ this.checkRunId = checkRunId;
85
+ this.name = 'CheckRunNotFoundError';
86
+ }
87
+ }
88
+ /**
89
+ * Error thrown when polling times out
90
+ */
91
+ export class PollingTimeoutError extends GitHubActionsError {
92
+ runId;
93
+ maxAttempts;
94
+ constructor(runId, maxAttempts, cause) {
95
+ super(`Polling timed out for run ${runId} after ${maxAttempts} attempts`, 'POLLING_TIMEOUT', cause);
96
+ this.runId = runId;
97
+ this.maxAttempts = maxAttempts;
98
+ this.name = 'PollingTimeoutError';
99
+ }
100
+ }
101
+ /**
102
+ * Error thrown for invalid configuration
103
+ */
104
+ export class ConfigurationError extends GitHubActionsError {
105
+ constructor(message, cause) {
106
+ super(message, 'CONFIGURATION_ERROR', cause);
107
+ this.name = 'ConfigurationError';
108
+ }
109
+ }
110
+ /**
111
+ * Check if an error is a GitHub API rate limit error
112
+ */
113
+ export function isRateLimitError(error) {
114
+ return error instanceof RateLimitError;
115
+ }
116
+ /**
117
+ * Check if an error is a GitHub Actions plugin error
118
+ */
119
+ export function isGitHubActionsError(error) {
120
+ return error instanceof GitHubActionsError;
121
+ }
122
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAGzB;IACA;IAHlB,YACE,OAAe,EACC,IAAY,EACZ,KAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAQ;QAG7B,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,KAAK,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,kBAAkB;IAElC;IADlB,YACkB,OAAa,EAC7B,KAAa;QAEb,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;QACxC,KAAK,CACH,6CAA6C,SAAS,EAAE,EACxD,qBAAqB,EACrB,KAAK,CACN,CAAC;QARc,YAAO,GAAP,OAAO,CAAM;QAS7B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,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,CAAC,CAAC;QAH1D,eAAU,GAAV,UAAU,CAAQ;QAIlC,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IAEvC;IACA;IAFlB,YACkB,KAAa,EACb,WAAmB,EACnC,KAAa;QAEb,KAAK,CACH,6BAA6B,KAAK,UAAU,WAAW,WAAW,EAClE,iBAAiB,EACjB,KAAK,CACN,CAAC;QARc,UAAK,GAAL,KAAK,CAAQ;QACb,gBAAW,GAAX,WAAW,CAAQ;QAQnC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IACxD,YAAY,OAAe,EAAE,KAAa;QACxC,KAAK,CAAC,OAAO,EAAE,qBAAqB,EAAE,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,KAAK,YAAY,cAAc,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAc;IAEd,OAAO,KAAK,YAAY,kBAAkB,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Validate a GitHub SHA (40-character hex string)
4
+ */
5
+ export declare const shaSchema: z.ZodString;
6
+ /**
7
+ * Validate a workflow identifier (filename or numeric ID)
8
+ */
9
+ export declare const workflowIdSchema: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
10
+ /**
11
+ * Validate a run ID
12
+ */
13
+ export declare const runIdSchema: z.ZodNumber;
14
+ /**
15
+ * Validate a job ID
16
+ */
17
+ export declare const jobIdSchema: z.ZodNumber;
18
+ /**
19
+ * Validate an artifact ID
20
+ */
21
+ export declare const artifactIdSchema: z.ZodNumber;
22
+ /**
23
+ * Validate a check run ID
24
+ */
25
+ export declare const checkRunIdSchema: z.ZodNumber;
26
+ /**
27
+ * Validate workflow inputs (key-value pairs of strings)
28
+ */
29
+ export declare const workflowInputsSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
30
+ /**
31
+ * Validate a Git ref (branch or tag name)
32
+ */
33
+ export declare const gitRefSchema: z.ZodOptional<z.ZodString>;
34
+ /**
35
+ * Check if a value is a valid SHA
36
+ */
37
+ export declare function isValidSha(value: string): boolean;
38
+ /**
39
+ * Check if a value is a valid workflow identifier
40
+ */
41
+ export declare function isValidWorkflowId(value: string | number): boolean;
42
+ /**
43
+ * Check if a value is a positive integer
44
+ */
45
+ export declare function isPositiveInteger(value: number): boolean;
46
+ /**
47
+ * Assert that a value is defined (not null or undefined)
48
+ */
49
+ export declare function assertDefined<T>(value: T | null | undefined, message: string): asserts value is T;
50
+ /**
51
+ * Parse and validate trigger workflow parameters
52
+ */
53
+ export declare const triggerWorkflowParamsSchema: z.ZodObject<{
54
+ workflow: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
55
+ ref: z.ZodOptional<z.ZodString>;
56
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ workflow: string | number;
59
+ ref?: string | undefined;
60
+ inputs?: Record<string, string> | undefined;
61
+ }, {
62
+ workflow: string | number;
63
+ ref?: string | undefined;
64
+ inputs?: Record<string, string> | undefined;
65
+ }>;
66
+ /**
67
+ * Validate trigger workflow parameters
68
+ */
69
+ export declare function validateTriggerParams(params: unknown): {
70
+ workflow: string | number;
71
+ ref?: string;
72
+ inputs?: Record<string, string>;
73
+ };
74
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;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