@agentforge/tools 0.16.71 → 0.16.72
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 +192 -170
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -33
- package/dist/index.d.ts +11 -33
- package/dist/index.js +192 -170
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -5609,20 +5609,13 @@ declare function mapSchemaTypes(vendor: DatabaseVendor, columns: Array<{
|
|
|
5609
5609
|
declare function getVendorTypeMap(vendor: DatabaseVendor): Readonly<Record<string, string>>;
|
|
5610
5610
|
|
|
5611
5611
|
/**
|
|
5612
|
-
*
|
|
5613
|
-
*
|
|
5614
|
-
* Compare two {@link DatabaseSchema} instances and produce a structured
|
|
5615
|
-
* diff report. Also provide JSON export / import for snapshot testing
|
|
5616
|
-
* and cross-environment schema comparison.
|
|
5617
|
-
*
|
|
5618
|
-
* @module schema/schema-diff
|
|
5612
|
+
* Shared public diff-report types for relational schema comparison.
|
|
5619
5613
|
*/
|
|
5620
|
-
|
|
5621
5614
|
/** Describes a difference for a single column. */
|
|
5622
5615
|
interface ColumnDiff {
|
|
5623
5616
|
column: string;
|
|
5624
5617
|
type: 'added' | 'removed' | 'changed';
|
|
5625
|
-
/** Present when type is `changed
|
|
5618
|
+
/** Present when type is `changed`. */
|
|
5626
5619
|
changes?: Array<{
|
|
5627
5620
|
property: string;
|
|
5628
5621
|
before: unknown;
|
|
@@ -5633,9 +5626,9 @@ interface ColumnDiff {
|
|
|
5633
5626
|
interface TableDiff {
|
|
5634
5627
|
table: string;
|
|
5635
5628
|
type: 'added' | 'removed' | 'changed';
|
|
5636
|
-
/** Present when type is `changed`
|
|
5629
|
+
/** Present when type is `changed` with per-column changes. */
|
|
5637
5630
|
columns?: ColumnDiff[];
|
|
5638
|
-
/** Present when type is `changed`
|
|
5631
|
+
/** Present when type is `changed` with primary-key changes. */
|
|
5639
5632
|
primaryKeyChanged?: {
|
|
5640
5633
|
before: string[];
|
|
5641
5634
|
after: string[];
|
|
@@ -5643,11 +5636,11 @@ interface TableDiff {
|
|
|
5643
5636
|
}
|
|
5644
5637
|
/** Full diff report between two schemas. */
|
|
5645
5638
|
interface SchemaDiffResult {
|
|
5646
|
-
/** Whether the schemas are identical */
|
|
5639
|
+
/** Whether the schemas are identical. */
|
|
5647
5640
|
identical: boolean;
|
|
5648
|
-
/** Per-table differences */
|
|
5641
|
+
/** Per-table differences. */
|
|
5649
5642
|
tables: TableDiff[];
|
|
5650
|
-
/** Summary counts */
|
|
5643
|
+
/** Summary counts. */
|
|
5651
5644
|
summary: {
|
|
5652
5645
|
tablesAdded: number;
|
|
5653
5646
|
tablesRemoved: number;
|
|
@@ -5657,36 +5650,21 @@ interface SchemaDiffResult {
|
|
|
5657
5650
|
columnsChanged: number;
|
|
5658
5651
|
};
|
|
5659
5652
|
}
|
|
5653
|
+
|
|
5660
5654
|
/**
|
|
5661
5655
|
* Compare two database schemas and return a structured diff report.
|
|
5662
5656
|
*
|
|
5663
5657
|
* The comparison is name-based and case-insensitive. Schema-qualified
|
|
5664
5658
|
* names are supported (e.g. `public.users`).
|
|
5665
|
-
*
|
|
5666
|
-
* @param before - The baseline schema
|
|
5667
|
-
* @param after - The schema to compare against the baseline
|
|
5668
|
-
* @returns A structured diff report
|
|
5669
5659
|
*/
|
|
5670
5660
|
declare function diffSchemas(before: DatabaseSchema, after: DatabaseSchema): SchemaDiffResult;
|
|
5661
|
+
|
|
5671
5662
|
/**
|
|
5672
|
-
* Export a
|
|
5673
|
-
*
|
|
5674
|
-
* The output is deterministic (keys sorted, 2-space indent) so that it
|
|
5675
|
-
* can be used for snapshot testing.
|
|
5676
|
-
*
|
|
5677
|
-
* @param schema - The schema to serialise
|
|
5678
|
-
* @returns Pretty-printed JSON string
|
|
5663
|
+
* Export a database schema to deterministic JSON for snapshots and fixtures.
|
|
5679
5664
|
*/
|
|
5680
5665
|
declare function exportSchemaToJson(schema: DatabaseSchema): string;
|
|
5681
5666
|
/**
|
|
5682
|
-
* Import a
|
|
5683
|
-
*
|
|
5684
|
-
* Performs basic structural validation to ensure the parsed object has the
|
|
5685
|
-
* required shape.
|
|
5686
|
-
*
|
|
5687
|
-
* @param json - JSON string produced by {@link exportSchemaToJson}
|
|
5688
|
-
* @returns Parsed database schema
|
|
5689
|
-
* @throws Error when the JSON is not a valid DatabaseSchema
|
|
5667
|
+
* Import a database schema from JSON with basic structural validation.
|
|
5690
5668
|
*/
|
|
5691
5669
|
declare function importSchemaFromJson(json: string): DatabaseSchema;
|
|
5692
5670
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5609,20 +5609,13 @@ declare function mapSchemaTypes(vendor: DatabaseVendor, columns: Array<{
|
|
|
5609
5609
|
declare function getVendorTypeMap(vendor: DatabaseVendor): Readonly<Record<string, string>>;
|
|
5610
5610
|
|
|
5611
5611
|
/**
|
|
5612
|
-
*
|
|
5613
|
-
*
|
|
5614
|
-
* Compare two {@link DatabaseSchema} instances and produce a structured
|
|
5615
|
-
* diff report. Also provide JSON export / import for snapshot testing
|
|
5616
|
-
* and cross-environment schema comparison.
|
|
5617
|
-
*
|
|
5618
|
-
* @module schema/schema-diff
|
|
5612
|
+
* Shared public diff-report types for relational schema comparison.
|
|
5619
5613
|
*/
|
|
5620
|
-
|
|
5621
5614
|
/** Describes a difference for a single column. */
|
|
5622
5615
|
interface ColumnDiff {
|
|
5623
5616
|
column: string;
|
|
5624
5617
|
type: 'added' | 'removed' | 'changed';
|
|
5625
|
-
/** Present when type is `changed
|
|
5618
|
+
/** Present when type is `changed`. */
|
|
5626
5619
|
changes?: Array<{
|
|
5627
5620
|
property: string;
|
|
5628
5621
|
before: unknown;
|
|
@@ -5633,9 +5626,9 @@ interface ColumnDiff {
|
|
|
5633
5626
|
interface TableDiff {
|
|
5634
5627
|
table: string;
|
|
5635
5628
|
type: 'added' | 'removed' | 'changed';
|
|
5636
|
-
/** Present when type is `changed`
|
|
5629
|
+
/** Present when type is `changed` with per-column changes. */
|
|
5637
5630
|
columns?: ColumnDiff[];
|
|
5638
|
-
/** Present when type is `changed`
|
|
5631
|
+
/** Present when type is `changed` with primary-key changes. */
|
|
5639
5632
|
primaryKeyChanged?: {
|
|
5640
5633
|
before: string[];
|
|
5641
5634
|
after: string[];
|
|
@@ -5643,11 +5636,11 @@ interface TableDiff {
|
|
|
5643
5636
|
}
|
|
5644
5637
|
/** Full diff report between two schemas. */
|
|
5645
5638
|
interface SchemaDiffResult {
|
|
5646
|
-
/** Whether the schemas are identical */
|
|
5639
|
+
/** Whether the schemas are identical. */
|
|
5647
5640
|
identical: boolean;
|
|
5648
|
-
/** Per-table differences */
|
|
5641
|
+
/** Per-table differences. */
|
|
5649
5642
|
tables: TableDiff[];
|
|
5650
|
-
/** Summary counts */
|
|
5643
|
+
/** Summary counts. */
|
|
5651
5644
|
summary: {
|
|
5652
5645
|
tablesAdded: number;
|
|
5653
5646
|
tablesRemoved: number;
|
|
@@ -5657,36 +5650,21 @@ interface SchemaDiffResult {
|
|
|
5657
5650
|
columnsChanged: number;
|
|
5658
5651
|
};
|
|
5659
5652
|
}
|
|
5653
|
+
|
|
5660
5654
|
/**
|
|
5661
5655
|
* Compare two database schemas and return a structured diff report.
|
|
5662
5656
|
*
|
|
5663
5657
|
* The comparison is name-based and case-insensitive. Schema-qualified
|
|
5664
5658
|
* names are supported (e.g. `public.users`).
|
|
5665
|
-
*
|
|
5666
|
-
* @param before - The baseline schema
|
|
5667
|
-
* @param after - The schema to compare against the baseline
|
|
5668
|
-
* @returns A structured diff report
|
|
5669
5659
|
*/
|
|
5670
5660
|
declare function diffSchemas(before: DatabaseSchema, after: DatabaseSchema): SchemaDiffResult;
|
|
5661
|
+
|
|
5671
5662
|
/**
|
|
5672
|
-
* Export a
|
|
5673
|
-
*
|
|
5674
|
-
* The output is deterministic (keys sorted, 2-space indent) so that it
|
|
5675
|
-
* can be used for snapshot testing.
|
|
5676
|
-
*
|
|
5677
|
-
* @param schema - The schema to serialise
|
|
5678
|
-
* @returns Pretty-printed JSON string
|
|
5663
|
+
* Export a database schema to deterministic JSON for snapshots and fixtures.
|
|
5679
5664
|
*/
|
|
5680
5665
|
declare function exportSchemaToJson(schema: DatabaseSchema): string;
|
|
5681
5666
|
/**
|
|
5682
|
-
* Import a
|
|
5683
|
-
*
|
|
5684
|
-
* Performs basic structural validation to ensure the parsed object has the
|
|
5685
|
-
* required shape.
|
|
5686
|
-
*
|
|
5687
|
-
* @param json - JSON string produced by {@link exportSchemaToJson}
|
|
5688
|
-
* @returns Parsed database schema
|
|
5689
|
-
* @throws Error when the JSON is not a valid DatabaseSchema
|
|
5667
|
+
* Import a database schema from JSON with basic structural validation.
|
|
5690
5668
|
*/
|
|
5691
5669
|
declare function importSchemaFromJson(json: string): DatabaseSchema;
|
|
5692
5670
|
|