@hasna/search 0.0.6 → 0.0.8
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/README.md +7 -4
- package/dist/cli/cloud.d.ts +3 -0
- package/dist/cli/cloud.d.ts.map +1 -0
- package/dist/cli/index.js +5341 -8780
- package/dist/db/cloud-config.d.ts +14 -0
- package/dist/db/cloud-config.d.ts.map +1 -0
- package/dist/db/cloud-sync.d.ts +30 -0
- package/dist/db/cloud-sync.d.ts.map +1 -0
- package/dist/db/database.d.ts +1 -0
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/pg-migrate.d.ts +8 -0
- package/dist/db/pg-migrate.d.ts.map +1 -0
- package/dist/db/remote-storage.d.ts +12 -0
- package/dist/db/remote-storage.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1699 -5294
- package/dist/mcp/cloud-tools.d.ts +3 -0
- package/dist/mcp/cloud-tools.d.ts.map +1 -0
- package/dist/mcp/index.js +5217 -8756
- package/dist/server/index.js +36 -8948
- package/package.json +3 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CloudMode = "local" | "hybrid" | "cloud";
|
|
2
|
+
export interface CloudConfig {
|
|
3
|
+
mode: CloudMode;
|
|
4
|
+
rds: {
|
|
5
|
+
host: string;
|
|
6
|
+
port: number;
|
|
7
|
+
username: string;
|
|
8
|
+
password_env: string;
|
|
9
|
+
ssl: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare function getCloudConfig(): CloudConfig;
|
|
13
|
+
export declare function getConnectionString(dbName?: string): string;
|
|
14
|
+
//# sourceMappingURL=cloud-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-config.d.ts","sourceRoot":"","sources":["../../src/db/cloud-config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,GAAG,EAAE,OAAO,CAAC;KACd,CAAC;CACH;AAgBD,wBAAgB,cAAc,IAAI,WAAW,CAiC5C;AAED,wBAAgB,mBAAmB,CAAC,MAAM,SAAW,GAAG,MAAM,CAiB7D"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Database } from "bun:sqlite";
|
|
2
|
+
import { PgAdapterAsync } from "./remote-storage.js";
|
|
3
|
+
export interface SyncResult {
|
|
4
|
+
table: string;
|
|
5
|
+
direction: "push" | "pull";
|
|
6
|
+
rowsRead: number;
|
|
7
|
+
rowsWritten: number;
|
|
8
|
+
errors: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface CloudStatus {
|
|
11
|
+
mode: string;
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
db_path: string;
|
|
14
|
+
tables: Array<{
|
|
15
|
+
table: string;
|
|
16
|
+
rows: number;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
export declare const CLOUD_TABLES: readonly ["searches", "search_results", "saved_searches", "providers", "search_profiles", "feedback"];
|
|
20
|
+
export declare function getCloudPg(): Promise<PgAdapterAsync>;
|
|
21
|
+
export declare function runCloudMigrations(remote: PgAdapterAsync): Promise<void>;
|
|
22
|
+
export declare function getCloudStatus(db?: Database): CloudStatus;
|
|
23
|
+
export declare function pushCloudChanges(tables?: string[]): Promise<SyncResult[]>;
|
|
24
|
+
export declare function pullCloudChanges(tables?: string[]): Promise<SyncResult[]>;
|
|
25
|
+
export declare function syncCloudChanges(tables?: string[]): Promise<{
|
|
26
|
+
push: SyncResult[];
|
|
27
|
+
pull: SyncResult[];
|
|
28
|
+
}>;
|
|
29
|
+
export declare function parseCloudTables(raw?: string): string[];
|
|
30
|
+
//# sourceMappingURL=cloud-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-sync.d.ts","sourceRoot":"","sources":["../../src/db/cloud-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,YAAY,uGAOf,CAAC;AA0GX,wBAAsB,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC,CAE1D;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAI9E;AAED,wBAAgB,cAAc,CAAC,EAAE,GAAE,QAAkB,GAAG,WAAW,CAelE;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,MAAM,EAAsB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAuBlG;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,MAAM,EAAsB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAuBlG;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,MAAM,EAAsB,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC,CAKhI;AAED,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAIvD"}
|
package/dist/db/database.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAkCtC,wBAAgB,SAAS,IAAI,MAAM,CAUlC;AAED,wBAAgB,KAAK,IAAI,QAAQ,CAchC;AAED,wBAAgB,OAAO,IAAI,IAAI,CAK9B;AAED,wBAAgB,eAAe,IAAI,QAAQ,CAQ1C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface PgMigrationResult {
|
|
2
|
+
applied: number[];
|
|
3
|
+
alreadyApplied: number[];
|
|
4
|
+
errors: string[];
|
|
5
|
+
totalMigrations: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function applyPgMigrations(connectionString: string): Promise<PgMigrationResult>;
|
|
8
|
+
//# sourceMappingURL=pg-migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg-migrate.d.ts","sourceRoot":"","sources":["../../src/db/pg-migrate.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,iBAAiB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA0C5F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class PgAdapterAsync {
|
|
2
|
+
private readonly pool;
|
|
3
|
+
constructor(connectionString: string);
|
|
4
|
+
run(sql: string, ...params: unknown[]): Promise<{
|
|
5
|
+
changes: number;
|
|
6
|
+
}>;
|
|
7
|
+
get(sql: string, ...params: unknown[]): Promise<unknown>;
|
|
8
|
+
all(sql: string, ...params: unknown[]): Promise<unknown[]>;
|
|
9
|
+
exec(sql: string): Promise<void>;
|
|
10
|
+
close(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=remote-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-storage.d.ts","sourceRoot":"","sources":["../../src/db/remote-storage.ts"],"names":[],"mappings":"AAmBA,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAO;gBAEhB,gBAAgB,EAAE,MAAM;IAI9B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAKpE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAK1D,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export * from "./types/index.js";
|
|
2
2
|
export { getDb, closeDb, getDbForTesting } from "./db/database.js";
|
|
3
|
+
export { getCloudConfig, getConnectionString } from "./db/cloud-config.js";
|
|
4
|
+
export { PgAdapterAsync } from "./db/remote-storage.js";
|
|
5
|
+
export { applyPgMigrations } from "./db/pg-migrate.js";
|
|
6
|
+
export { CLOUD_TABLES, getCloudPg, getCloudStatus, parseCloudTables, pullCloudChanges, pushCloudChanges, runCloudMigrations, syncCloudChanges, } from "./db/cloud-sync.js";
|
|
7
|
+
export type { CloudStatus, SyncResult } from "./db/cloud-sync.js";
|
|
3
8
|
export { createSearch, getSearch, listSearches, deleteSearch, updateSearchResults, getSearchStats } from "./db/searches.js";
|
|
4
9
|
export { createResult, createResults, getResult, listResults, searchResultsFts } from "./db/results.js";
|
|
5
10
|
export { createSavedSearch, getSavedSearch, listSavedSearches, deleteSavedSearch, updateSavedSearchLastRun } from "./db/saved-searches.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC5H,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC3I,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9J,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EA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