@schemashift/core 0.9.0 → 0.11.0
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/dist/index.cjs +1796 -95
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +456 -2
- package/dist/index.d.ts +456 -2
- package/dist/index.js +1773 -103
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Project, CallExpression, Node, SourceFile } from 'ts-morph';
|
|
2
2
|
|
|
3
|
-
type SchemaLibrary = 'zod' | 'zod-v3' | 'yup' | 'joi' | 'io-ts' | 'valibot' | 'v4' | 'unknown';
|
|
3
|
+
type SchemaLibrary = 'zod' | 'zod-v3' | 'yup' | 'joi' | 'io-ts' | 'valibot' | 'arktype' | 'superstruct' | 'effect' | 'v4' | 'unknown';
|
|
4
4
|
interface SchemaInfo {
|
|
5
5
|
name: string;
|
|
6
6
|
filePath: string;
|
|
@@ -46,6 +46,71 @@ declare class SchemaAnalyzer {
|
|
|
46
46
|
getProject(): Project;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Approval Workflow for SchemaShift
|
|
51
|
+
*
|
|
52
|
+
* Provides review gates before executing migrations on shared codebases.
|
|
53
|
+
* Pending migrations are stored in `.schemashift/pending/`.
|
|
54
|
+
*/
|
|
55
|
+
type ApprovalStatus = 'pending' | 'approved' | 'rejected';
|
|
56
|
+
interface MigrationRequest {
|
|
57
|
+
id: string;
|
|
58
|
+
from: string;
|
|
59
|
+
to: string;
|
|
60
|
+
files: string[];
|
|
61
|
+
requestedBy: string;
|
|
62
|
+
requestedAt: string;
|
|
63
|
+
status: ApprovalStatus;
|
|
64
|
+
reviewedBy?: string;
|
|
65
|
+
reviewedAt?: string;
|
|
66
|
+
reason?: string;
|
|
67
|
+
metadata?: Record<string, unknown>;
|
|
68
|
+
}
|
|
69
|
+
interface ApprovalDecision {
|
|
70
|
+
requestId: string;
|
|
71
|
+
status: 'approved' | 'rejected';
|
|
72
|
+
reviewedBy: string;
|
|
73
|
+
reason?: string;
|
|
74
|
+
}
|
|
75
|
+
interface ApprovalSummary {
|
|
76
|
+
pending: number;
|
|
77
|
+
approved: number;
|
|
78
|
+
rejected: number;
|
|
79
|
+
total: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Manages migration approval workflows with file-based persistence.
|
|
83
|
+
*/
|
|
84
|
+
declare class ApprovalManager {
|
|
85
|
+
private pendingDir;
|
|
86
|
+
constructor(projectPath: string);
|
|
87
|
+
/**
|
|
88
|
+
* Create a new migration request for review.
|
|
89
|
+
*/
|
|
90
|
+
createRequest(from: string, to: string, files: string[], requestedBy: string, metadata?: Record<string, unknown>): MigrationRequest;
|
|
91
|
+
/**
|
|
92
|
+
* Review (approve or reject) a pending migration request.
|
|
93
|
+
*/
|
|
94
|
+
review(decision: ApprovalDecision): MigrationRequest;
|
|
95
|
+
/**
|
|
96
|
+
* Get a specific migration request by ID.
|
|
97
|
+
*/
|
|
98
|
+
getRequest(id: string): MigrationRequest | null;
|
|
99
|
+
/**
|
|
100
|
+
* List all migration requests, optionally filtered by status.
|
|
101
|
+
*/
|
|
102
|
+
listRequests(status?: ApprovalStatus): MigrationRequest[];
|
|
103
|
+
/**
|
|
104
|
+
* Get summary counts of all requests.
|
|
105
|
+
*/
|
|
106
|
+
getSummary(): ApprovalSummary;
|
|
107
|
+
/**
|
|
108
|
+
* Check if a migration has been approved.
|
|
109
|
+
*/
|
|
110
|
+
isApproved(requestId: string): boolean;
|
|
111
|
+
private ensureDir;
|
|
112
|
+
}
|
|
113
|
+
|
|
49
114
|
/**
|
|
50
115
|
* Represents a single method call in a chain.
|
|
51
116
|
* e.g., `.email()` or `.min(5, 'Too short')`
|
|
@@ -143,6 +208,15 @@ declare function transformMethodChain(chain: CallChainInfo, newBase: string, fac
|
|
|
143
208
|
args: string[];
|
|
144
209
|
}[] | null | undefined): string;
|
|
145
210
|
|
|
211
|
+
interface AuditEntryMetadata {
|
|
212
|
+
gitCommit?: string;
|
|
213
|
+
gitBranch?: string;
|
|
214
|
+
ciJobId?: string;
|
|
215
|
+
ciProvider?: string;
|
|
216
|
+
hostname?: string;
|
|
217
|
+
nodeVersion?: string;
|
|
218
|
+
schemashiftVersion?: string;
|
|
219
|
+
}
|
|
146
220
|
interface AuditEntry {
|
|
147
221
|
timestamp: string;
|
|
148
222
|
migrationId: string;
|
|
@@ -158,6 +232,7 @@ interface AuditEntry {
|
|
|
158
232
|
riskScore?: number;
|
|
159
233
|
user?: string;
|
|
160
234
|
duration?: number;
|
|
235
|
+
metadata?: AuditEntryMetadata;
|
|
161
236
|
}
|
|
162
237
|
interface AuditLog {
|
|
163
238
|
version: number;
|
|
@@ -186,6 +261,7 @@ declare class MigrationAuditLog {
|
|
|
186
261
|
errorCount: number;
|
|
187
262
|
riskScore?: number;
|
|
188
263
|
duration?: number;
|
|
264
|
+
metadata?: AuditEntryMetadata;
|
|
189
265
|
}): AuditEntry;
|
|
190
266
|
/**
|
|
191
267
|
* Read the current audit log.
|
|
@@ -205,10 +281,23 @@ declare class MigrationAuditLog {
|
|
|
205
281
|
failureCount: number;
|
|
206
282
|
migrationPaths: string[];
|
|
207
283
|
};
|
|
284
|
+
/**
|
|
285
|
+
* Export audit log as JSON string.
|
|
286
|
+
*/
|
|
287
|
+
exportJson(): string;
|
|
288
|
+
/**
|
|
289
|
+
* Export audit log as CSV string.
|
|
290
|
+
*/
|
|
291
|
+
exportCsv(): string;
|
|
292
|
+
/**
|
|
293
|
+
* Get entries filtered by date range.
|
|
294
|
+
*/
|
|
295
|
+
getByDateRange(start: Date, end: Date): AuditEntry[];
|
|
208
296
|
/**
|
|
209
297
|
* Clear the audit log.
|
|
210
298
|
*/
|
|
211
299
|
clear(): void;
|
|
300
|
+
private collectMetadata;
|
|
212
301
|
private write;
|
|
213
302
|
private hashContent;
|
|
214
303
|
private getCurrentUser;
|
|
@@ -430,6 +519,46 @@ declare function validateConfig(config: SchemaShiftConfig): {
|
|
|
430
519
|
declare function shouldSuppressWarning(warning: string, filePath: string, rules: WarningSuppressionRule[]): boolean;
|
|
431
520
|
declare function loadConfig(configPath?: string): Promise<SchemaShiftConfig>;
|
|
432
521
|
|
|
522
|
+
/**
|
|
523
|
+
* Cross-Field Validation Pattern Helpers
|
|
524
|
+
*
|
|
525
|
+
* Provides reusable patterns for common cross-field validation scenarios.
|
|
526
|
+
* Generates `.superRefine()` code snippets for use during migration.
|
|
527
|
+
*/
|
|
528
|
+
interface CrossFieldPattern {
|
|
529
|
+
name: string;
|
|
530
|
+
description: string;
|
|
531
|
+
zodCode: string;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Generate a `.superRefine()` snippet for conditional required fields.
|
|
535
|
+
* When `conditionField` has a truthy value, `requiredField` becomes required.
|
|
536
|
+
*/
|
|
537
|
+
declare function requireIf(conditionField: string, requiredField: string): CrossFieldPattern;
|
|
538
|
+
/**
|
|
539
|
+
* Generate a `.superRefine()` snippet requiring at least one of the given fields.
|
|
540
|
+
*/
|
|
541
|
+
declare function requireOneOf(fields: string[]): CrossFieldPattern;
|
|
542
|
+
/**
|
|
543
|
+
* Generate a `.superRefine()` snippet for mutually exclusive fields.
|
|
544
|
+
* Only one of the given fields can have a value at a time.
|
|
545
|
+
*/
|
|
546
|
+
declare function mutuallyExclusive(fields: string[]): CrossFieldPattern;
|
|
547
|
+
/**
|
|
548
|
+
* Generate a `.superRefine()` snippet for dependent fields.
|
|
549
|
+
* When `primaryField` is set, all `dependentFields` become required.
|
|
550
|
+
*/
|
|
551
|
+
declare function dependentFields(primaryField: string, dependents: string[]): CrossFieldPattern;
|
|
552
|
+
/**
|
|
553
|
+
* Generate a `.superRefine()` snippet for conditional validation.
|
|
554
|
+
* When `conditionField` equals `conditionValue`, apply validation on `targetField`.
|
|
555
|
+
*/
|
|
556
|
+
declare function conditionalValidation(conditionField: string, conditionValue: string, targetField: string, validationMessage: string): CrossFieldPattern;
|
|
557
|
+
/**
|
|
558
|
+
* Detect common cross-field patterns in Yup `.when()` calls and suggest Zod equivalents.
|
|
559
|
+
*/
|
|
560
|
+
declare function suggestCrossFieldPattern(whenCode: string): CrossFieldPattern | null;
|
|
561
|
+
|
|
433
562
|
interface DependencyGraphResult {
|
|
434
563
|
/** Files sorted in dependency order (dependencies first) */
|
|
435
564
|
sortedFiles: string[];
|
|
@@ -558,6 +687,67 @@ interface FormLibraryDetection {
|
|
|
558
687
|
}
|
|
559
688
|
declare function detectFormLibraries(sourceFile: SourceFile): FormLibraryDetection[];
|
|
560
689
|
|
|
690
|
+
interface SchemaSnapshot {
|
|
691
|
+
version: number;
|
|
692
|
+
timestamp: string;
|
|
693
|
+
projectPath: string;
|
|
694
|
+
schemas: SchemaFileSnapshot[];
|
|
695
|
+
}
|
|
696
|
+
interface SchemaFileSnapshot {
|
|
697
|
+
filePath: string;
|
|
698
|
+
library: string;
|
|
699
|
+
contentHash: string;
|
|
700
|
+
schemaCount: number;
|
|
701
|
+
schemaNames: string[];
|
|
702
|
+
}
|
|
703
|
+
interface DriftResult {
|
|
704
|
+
hasDrift: boolean;
|
|
705
|
+
added: SchemaFileSnapshot[];
|
|
706
|
+
removed: SchemaFileSnapshot[];
|
|
707
|
+
modified: DriftModification[];
|
|
708
|
+
unchanged: number;
|
|
709
|
+
totalFiles: number;
|
|
710
|
+
snapshotTimestamp: string;
|
|
711
|
+
}
|
|
712
|
+
interface DriftModification {
|
|
713
|
+
filePath: string;
|
|
714
|
+
library: string;
|
|
715
|
+
previousHash: string;
|
|
716
|
+
currentHash: string;
|
|
717
|
+
previousSchemaCount: number;
|
|
718
|
+
currentSchemaCount: number;
|
|
719
|
+
addedSchemas: string[];
|
|
720
|
+
removedSchemas: string[];
|
|
721
|
+
}
|
|
722
|
+
declare class DriftDetector {
|
|
723
|
+
private snapshotDir;
|
|
724
|
+
private snapshotPath;
|
|
725
|
+
constructor(projectPath: string);
|
|
726
|
+
/**
|
|
727
|
+
* Take a snapshot of the current schema state
|
|
728
|
+
*/
|
|
729
|
+
snapshot(files: string[], projectPath: string): SchemaSnapshot;
|
|
730
|
+
/**
|
|
731
|
+
* Save a snapshot to disk
|
|
732
|
+
*/
|
|
733
|
+
saveSnapshot(snapshot: SchemaSnapshot): void;
|
|
734
|
+
/**
|
|
735
|
+
* Load saved snapshot from disk
|
|
736
|
+
*/
|
|
737
|
+
loadSnapshot(): SchemaSnapshot | null;
|
|
738
|
+
/**
|
|
739
|
+
* Compare current state against saved snapshot
|
|
740
|
+
*/
|
|
741
|
+
detect(currentFiles: string[], projectPath: string): DriftResult;
|
|
742
|
+
/**
|
|
743
|
+
* Compare two snapshots and return drift results
|
|
744
|
+
*/
|
|
745
|
+
compareSnapshots(baseline: SchemaSnapshot, current: SchemaSnapshot): DriftResult;
|
|
746
|
+
private extractSchemaNames;
|
|
747
|
+
private detectLibraryFromContent;
|
|
748
|
+
private hashContent;
|
|
749
|
+
}
|
|
750
|
+
|
|
561
751
|
interface FormResolverResult {
|
|
562
752
|
success: boolean;
|
|
563
753
|
transformedCode: string;
|
|
@@ -606,6 +796,121 @@ declare class GovernanceEngine {
|
|
|
606
796
|
private isSchemaExpression;
|
|
607
797
|
}
|
|
608
798
|
|
|
799
|
+
interface FixResult {
|
|
800
|
+
success: boolean;
|
|
801
|
+
fixedCode?: string;
|
|
802
|
+
explanation: string;
|
|
803
|
+
rule: string;
|
|
804
|
+
lineNumber: number;
|
|
805
|
+
}
|
|
806
|
+
interface FixSummary {
|
|
807
|
+
totalViolations: number;
|
|
808
|
+
fixed: number;
|
|
809
|
+
skipped: number;
|
|
810
|
+
results: FixResult[];
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* GovernanceFixer applies auto-fixes for governance violations.
|
|
814
|
+
* Supports fixing: no-any-schemas, require-descriptions, require-max-length, naming-convention.
|
|
815
|
+
*/
|
|
816
|
+
declare class GovernanceFixer {
|
|
817
|
+
private defaultMaxLength;
|
|
818
|
+
/**
|
|
819
|
+
* Set the default max length appended by the require-max-length fix.
|
|
820
|
+
*/
|
|
821
|
+
setDefaultMaxLength(length: number): void;
|
|
822
|
+
/**
|
|
823
|
+
* Check if a violation is auto-fixable.
|
|
824
|
+
*/
|
|
825
|
+
canFix(violation: GovernanceViolation): boolean;
|
|
826
|
+
/**
|
|
827
|
+
* Fix a single violation in a source file.
|
|
828
|
+
* Returns the fixed code for the entire file.
|
|
829
|
+
*/
|
|
830
|
+
fix(violation: GovernanceViolation, sourceCode: string): FixResult;
|
|
831
|
+
/**
|
|
832
|
+
* Fix all fixable violations in a source file.
|
|
833
|
+
* Applies fixes from bottom to top to preserve line numbers.
|
|
834
|
+
*/
|
|
835
|
+
fixAll(violations: GovernanceViolation[], sourceCode: string): FixSummary;
|
|
836
|
+
private fixNoAny;
|
|
837
|
+
private fixRequireDescription;
|
|
838
|
+
private fixRequireMaxLength;
|
|
839
|
+
private fixNamingConvention;
|
|
840
|
+
private fixRequireSafeParse;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Governance Rule Templates
|
|
845
|
+
*
|
|
846
|
+
* Pre-built governance rules for common enterprise policies.
|
|
847
|
+
* These can be registered into the GovernanceEngine for quick setup.
|
|
848
|
+
*
|
|
849
|
+
* Template categories:
|
|
850
|
+
* - Security: Prevent unsafe patterns (XSS, injection, DoS)
|
|
851
|
+
* - Quality: Enforce code quality standards
|
|
852
|
+
* - Compliance: Support SOX, HIPAA, GDPR requirements
|
|
853
|
+
* - Performance: Prevent known performance pitfalls
|
|
854
|
+
*/
|
|
855
|
+
interface GovernanceTemplate {
|
|
856
|
+
name: string;
|
|
857
|
+
description: string;
|
|
858
|
+
category: 'security' | 'quality' | 'compliance' | 'performance';
|
|
859
|
+
rule: GovernanceRuleFunction;
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* All available governance rule templates
|
|
863
|
+
*/
|
|
864
|
+
declare const GOVERNANCE_TEMPLATES: GovernanceTemplate[];
|
|
865
|
+
/**
|
|
866
|
+
* Get a governance template by name
|
|
867
|
+
*/
|
|
868
|
+
declare function getGovernanceTemplate(name: string): GovernanceTemplate | undefined;
|
|
869
|
+
/**
|
|
870
|
+
* Get all templates for a category
|
|
871
|
+
*/
|
|
872
|
+
declare function getGovernanceTemplatesByCategory(category: GovernanceTemplate['category']): GovernanceTemplate[];
|
|
873
|
+
/**
|
|
874
|
+
* Get all available template names
|
|
875
|
+
*/
|
|
876
|
+
declare function getGovernanceTemplateNames(): string[];
|
|
877
|
+
|
|
878
|
+
interface GraphNode {
|
|
879
|
+
filePath: string;
|
|
880
|
+
shortPath: string;
|
|
881
|
+
schemaLibrary?: string;
|
|
882
|
+
schemaCount: number;
|
|
883
|
+
}
|
|
884
|
+
interface GraphExportOptions {
|
|
885
|
+
/** Color-code nodes by schema library */
|
|
886
|
+
colorByLibrary?: boolean;
|
|
887
|
+
/** Highlight circular dependencies in red */
|
|
888
|
+
highlightCircular?: boolean;
|
|
889
|
+
/** Only show files using a specific library */
|
|
890
|
+
filterLibrary?: string;
|
|
891
|
+
/** File metadata for enriched graph display */
|
|
892
|
+
nodeMetadata?: Map<string, {
|
|
893
|
+
library?: string;
|
|
894
|
+
schemaCount?: number;
|
|
895
|
+
}>;
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* Exports dependency graphs in DOT (Graphviz) and Mermaid formats.
|
|
899
|
+
*/
|
|
900
|
+
declare class GraphExporter {
|
|
901
|
+
/**
|
|
902
|
+
* Export dependency graph as DOT format for Graphviz.
|
|
903
|
+
*/
|
|
904
|
+
exportDot(graph: DependencyGraphResult, options?: GraphExportOptions): string;
|
|
905
|
+
/**
|
|
906
|
+
* Export dependency graph as Mermaid diagram syntax.
|
|
907
|
+
*/
|
|
908
|
+
exportMermaid(graph: DependencyGraphResult, options?: GraphExportOptions): string;
|
|
909
|
+
private shortenPath;
|
|
910
|
+
private toNodeId;
|
|
911
|
+
private toMermaidId;
|
|
912
|
+
}
|
|
913
|
+
|
|
609
914
|
interface IncrementalState {
|
|
610
915
|
migrationId: string;
|
|
611
916
|
from: SchemaLibrary;
|
|
@@ -636,6 +941,123 @@ declare class IncrementalTracker {
|
|
|
636
941
|
private saveState;
|
|
637
942
|
}
|
|
638
943
|
|
|
944
|
+
interface MigrationTemplateStep {
|
|
945
|
+
from: string;
|
|
946
|
+
to: string;
|
|
947
|
+
description: string;
|
|
948
|
+
}
|
|
949
|
+
interface MigrationPreCheck {
|
|
950
|
+
description: string;
|
|
951
|
+
command?: string;
|
|
952
|
+
}
|
|
953
|
+
interface MigrationPostStep {
|
|
954
|
+
description: string;
|
|
955
|
+
command?: string;
|
|
956
|
+
}
|
|
957
|
+
interface PackageChange {
|
|
958
|
+
action: 'install' | 'remove' | 'upgrade';
|
|
959
|
+
package: string;
|
|
960
|
+
version?: string;
|
|
961
|
+
}
|
|
962
|
+
interface MigrationTemplate {
|
|
963
|
+
name: string;
|
|
964
|
+
description: string;
|
|
965
|
+
category: 'form-migration' | 'framework-upgrade' | 'library-switch' | 'monorepo';
|
|
966
|
+
migrationSteps: MigrationTemplateStep[];
|
|
967
|
+
preChecks: MigrationPreCheck[];
|
|
968
|
+
postSteps: MigrationPostStep[];
|
|
969
|
+
packageChanges: PackageChange[];
|
|
970
|
+
recommendedFlags: string[];
|
|
971
|
+
estimatedEffort: 'trivial' | 'low' | 'moderate' | 'high';
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Get a migration template by name.
|
|
975
|
+
*/
|
|
976
|
+
declare function getMigrationTemplate(name: string): MigrationTemplate | undefined;
|
|
977
|
+
/**
|
|
978
|
+
* Get all available migration template names.
|
|
979
|
+
*/
|
|
980
|
+
declare function getMigrationTemplateNames(): string[];
|
|
981
|
+
/**
|
|
982
|
+
* Get all templates for a specific category.
|
|
983
|
+
*/
|
|
984
|
+
declare function getMigrationTemplatesByCategory(category: MigrationTemplate['category']): MigrationTemplate[];
|
|
985
|
+
/**
|
|
986
|
+
* Get all built-in migration templates.
|
|
987
|
+
*/
|
|
988
|
+
declare function getAllMigrationTemplates(): MigrationTemplate[];
|
|
989
|
+
/**
|
|
990
|
+
* Validate a custom migration template.
|
|
991
|
+
*/
|
|
992
|
+
declare function validateMigrationTemplate(template: MigrationTemplate): {
|
|
993
|
+
valid: boolean;
|
|
994
|
+
errors: string[];
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Webhook Notification System for SchemaShift
|
|
999
|
+
*
|
|
1000
|
+
* Sends migration event notifications to external services
|
|
1001
|
+
* (Slack, Teams, Zapier, custom webhooks, etc.)
|
|
1002
|
+
*/
|
|
1003
|
+
type MigrationEventType = 'migration_started' | 'migration_completed' | 'migration_failed' | 'governance_violation' | 'drift_detected';
|
|
1004
|
+
interface MigrationEvent {
|
|
1005
|
+
type: MigrationEventType;
|
|
1006
|
+
timestamp: string;
|
|
1007
|
+
project?: string;
|
|
1008
|
+
details: Record<string, unknown>;
|
|
1009
|
+
}
|
|
1010
|
+
interface NotificationResult {
|
|
1011
|
+
success: boolean;
|
|
1012
|
+
statusCode?: number;
|
|
1013
|
+
error?: string;
|
|
1014
|
+
}
|
|
1015
|
+
interface WebhookConfig {
|
|
1016
|
+
url: string;
|
|
1017
|
+
events?: MigrationEventType[];
|
|
1018
|
+
headers?: Record<string, string>;
|
|
1019
|
+
secret?: string;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Send migration event notifications via webhooks.
|
|
1023
|
+
*/
|
|
1024
|
+
declare class WebhookNotifier {
|
|
1025
|
+
private webhooks;
|
|
1026
|
+
constructor(webhooks: WebhookConfig[]);
|
|
1027
|
+
/**
|
|
1028
|
+
* Create a migration event with current timestamp.
|
|
1029
|
+
*/
|
|
1030
|
+
createEvent(type: MigrationEventType, details: Record<string, unknown>, project?: string): MigrationEvent;
|
|
1031
|
+
/**
|
|
1032
|
+
* Send an event to all matching webhooks.
|
|
1033
|
+
*/
|
|
1034
|
+
send(event: MigrationEvent): Promise<NotificationResult[]>;
|
|
1035
|
+
/**
|
|
1036
|
+
* Send event to a single webhook endpoint.
|
|
1037
|
+
*/
|
|
1038
|
+
private sendToWebhook;
|
|
1039
|
+
/**
|
|
1040
|
+
* Convenience: send a migration_started event.
|
|
1041
|
+
*/
|
|
1042
|
+
notifyMigrationStarted(from: string, to: string, fileCount: number, project?: string): Promise<NotificationResult[]>;
|
|
1043
|
+
/**
|
|
1044
|
+
* Convenience: send a migration_completed event.
|
|
1045
|
+
*/
|
|
1046
|
+
notifyMigrationCompleted(from: string, to: string, fileCount: number, warningCount: number, project?: string): Promise<NotificationResult[]>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Convenience: send a migration_failed event.
|
|
1049
|
+
*/
|
|
1050
|
+
notifyMigrationFailed(from: string, to: string, error: string, project?: string): Promise<NotificationResult[]>;
|
|
1051
|
+
/**
|
|
1052
|
+
* Convenience: send a governance_violation event.
|
|
1053
|
+
*/
|
|
1054
|
+
notifyGovernanceViolation(violationCount: number, rules: string[], project?: string): Promise<NotificationResult[]>;
|
|
1055
|
+
/**
|
|
1056
|
+
* Convenience: send a drift_detected event.
|
|
1057
|
+
*/
|
|
1058
|
+
notifyDriftDetected(modifiedFiles: number, addedFiles: number, removedFiles: number, project?: string): Promise<NotificationResult[]>;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
639
1061
|
interface PackageUpdatePlan {
|
|
640
1062
|
add: Record<string, string>;
|
|
641
1063
|
remove: string[];
|
|
@@ -714,6 +1136,38 @@ interface StandardSchemaInfo {
|
|
|
714
1136
|
}
|
|
715
1137
|
declare function detectStandardSchema(projectPath: string): StandardSchemaInfo;
|
|
716
1138
|
|
|
1139
|
+
interface StandardSchemaAdvisory {
|
|
1140
|
+
shouldConsiderAdapter: boolean;
|
|
1141
|
+
reason: string;
|
|
1142
|
+
adapterExample?: string;
|
|
1143
|
+
migrationAdvantages: string[];
|
|
1144
|
+
adapterAdvantages: string[];
|
|
1145
|
+
recommendation: 'migrate' | 'adapter' | 'either';
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Advises whether to do a full migration or use Standard Schema adapters.
|
|
1149
|
+
*
|
|
1150
|
+
* When both source and target libraries support Standard Schema 1.0,
|
|
1151
|
+
* users may not need a full migration — they can use adapters instead.
|
|
1152
|
+
*/
|
|
1153
|
+
declare class StandardSchemaAdvisor {
|
|
1154
|
+
/**
|
|
1155
|
+
* Check if a schema library supports Standard Schema.
|
|
1156
|
+
*/
|
|
1157
|
+
supportsStandardSchema(library: SchemaLibrary | string): boolean;
|
|
1158
|
+
/**
|
|
1159
|
+
* Generate advisory for a given migration path.
|
|
1160
|
+
*/
|
|
1161
|
+
advise(from: SchemaLibrary | string, to: SchemaLibrary | string): StandardSchemaAdvisory;
|
|
1162
|
+
/**
|
|
1163
|
+
* Analyze a project and provide advisory based on detected libraries.
|
|
1164
|
+
*/
|
|
1165
|
+
adviseFromProject(projectPath: string, from: SchemaLibrary | string, to: SchemaLibrary | string): StandardSchemaAdvisory & {
|
|
1166
|
+
projectInfo: StandardSchemaInfo;
|
|
1167
|
+
};
|
|
1168
|
+
private generateAdapterExample;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
717
1171
|
interface ScaffoldedTest {
|
|
718
1172
|
filePath: string;
|
|
719
1173
|
testCode: string;
|
|
@@ -774,4 +1228,4 @@ declare class TypeDedupDetector {
|
|
|
774
1228
|
private namesRelated;
|
|
775
1229
|
}
|
|
776
1230
|
|
|
777
|
-
export { type AnalysisResult, type AuditEntry, type AuditLog, type BehavioralAnalysisResult, type BehavioralCategory, type BehavioralWarning, BehavioralWarningAnalyzer, BundleEstimator, type BundleSizeEstimate, type CallChainInfo, type ChainResult, type ChainStep, type ChainStepResult, type ChainValidation, CompatibilityAnalyzer, type CompatibilityResult, type ComplexityEstimate, ComplexityEstimator, type ComplexityWarning, type CustomRule, type DependencyGraphResult, type DetailedAnalysisResult, DetailedAnalyzer, type DuplicateTypeCandidate, EcosystemAnalyzer, type EcosystemIssue, type EcosystemReport, type EffortLevel, type FileComplexity, type FormLibraryDetection, FormResolverMigrator, type FormResolverResult, GovernanceEngine, type GovernanceResult, type GovernanceRuleConfig, type GovernanceRuleFunction, type GovernanceViolation, type IncrementalState, IncrementalTracker, type LibraryBundleInfo, type LibraryVersionInfo, type MethodCallInfo, MigrationAuditLog, MigrationChain, type MigrationReadiness, type MonorepoInfo, type MonorepoPackage, MonorepoResolver, type PackageUpdatePlan, PackageUpdater, type ParallelBatch, type PerformanceAnalysisResult, PerformanceAnalyzer, type PerformanceCategory, type PerformanceWarning, type PluginLoadResult, PluginLoader, type ScaffoldedTest, SchemaAnalyzer, type SchemaComplexity, SchemaDependencyResolver, type SchemaInfo, type SchemaLibrary, type SchemaShiftConfig, type SchemaShiftPlugin, type StandardSchemaInfo, type TestScaffoldResult, TestScaffolder, TransformEngine, type TransformError, type TransformHandler, type TransformOptions, type TransformResult, TypeDedupDetector, type TypeDedupResult, type VersionIssue, type WarningSuppressionRule, type WorkspaceManager, buildCallChain, computeParallelBatches, detectFormLibraries, detectSchemaLibrary, detectStandardSchema, isInsideComment, isInsideStringLiteral, loadConfig, parseCallChain, shouldSuppressWarning, startsWithBase, transformMethodChain, validateConfig };
|
|
1231
|
+
export { type AnalysisResult, type ApprovalDecision, ApprovalManager, type ApprovalStatus, type ApprovalSummary, type AuditEntry, type AuditEntryMetadata, type AuditLog, type BehavioralAnalysisResult, type BehavioralCategory, type BehavioralWarning, BehavioralWarningAnalyzer, BundleEstimator, type BundleSizeEstimate, type CallChainInfo, type ChainResult, type ChainStep, type ChainStepResult, type ChainValidation, CompatibilityAnalyzer, type CompatibilityResult, type ComplexityEstimate, ComplexityEstimator, type ComplexityWarning, type CrossFieldPattern, type CustomRule, type DependencyGraphResult, type DetailedAnalysisResult, DetailedAnalyzer, DriftDetector, type DriftModification, type DriftResult, type DuplicateTypeCandidate, EcosystemAnalyzer, type EcosystemIssue, type EcosystemReport, type EffortLevel, type FileComplexity, type FixResult, type FixSummary, type FormLibraryDetection, FormResolverMigrator, type FormResolverResult, GOVERNANCE_TEMPLATES, GovernanceEngine, GovernanceFixer, type GovernanceResult, type GovernanceRuleConfig, type GovernanceRuleFunction, type GovernanceTemplate, type GovernanceViolation, type GraphExportOptions, GraphExporter, type GraphNode, type IncrementalState, IncrementalTracker, type LibraryBundleInfo, type LibraryVersionInfo, type MethodCallInfo, MigrationAuditLog, MigrationChain, type MigrationEvent, type MigrationEventType, type MigrationReadiness, type MigrationRequest, type MigrationTemplate, type MigrationTemplateStep, type MonorepoInfo, type MonorepoPackage, MonorepoResolver, type NotificationResult, type PackageChange, type PackageUpdatePlan, PackageUpdater, type ParallelBatch, type PerformanceAnalysisResult, PerformanceAnalyzer, type PerformanceCategory, type PerformanceWarning, type PluginLoadResult, PluginLoader, type ScaffoldedTest, SchemaAnalyzer, type SchemaComplexity, SchemaDependencyResolver, type SchemaFileSnapshot, type SchemaInfo, type SchemaLibrary, type SchemaShiftConfig, type SchemaShiftPlugin, type SchemaSnapshot, StandardSchemaAdvisor, type StandardSchemaAdvisory, type StandardSchemaInfo, type TestScaffoldResult, TestScaffolder, TransformEngine, type TransformError, type TransformHandler, type TransformOptions, type TransformResult, TypeDedupDetector, type TypeDedupResult, type VersionIssue, type WarningSuppressionRule, type WebhookConfig, WebhookNotifier, type WorkspaceManager, buildCallChain, computeParallelBatches, conditionalValidation, dependentFields, detectFormLibraries, detectSchemaLibrary, detectStandardSchema, getAllMigrationTemplates, getGovernanceTemplate, getGovernanceTemplateNames, getGovernanceTemplatesByCategory, getMigrationTemplate, getMigrationTemplateNames, getMigrationTemplatesByCategory, isInsideComment, isInsideStringLiteral, loadConfig, mutuallyExclusive, parseCallChain, requireIf, requireOneOf, shouldSuppressWarning, startsWithBase, suggestCrossFieldPattern, transformMethodChain, validateConfig, validateMigrationTemplate };
|