@hasna/recordings 0.1.36 → 0.2.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/README.md +43 -0
- package/dist/cli/index.js +707 -5708
- package/dist/db/feedback.d.ts +13 -0
- package/dist/db/feedback.d.ts.map +1 -0
- package/dist/http/client.d.ts +77 -0
- package/dist/http/client.d.ts.map +1 -0
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +633 -5356
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +528 -5470
- package/dist/sdk/index.d.ts +16 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +140 -0
- package/dist/sdk/v1.generated.d.ts +150 -0
- package/dist/sdk/v1.generated.d.ts.map +1 -0
- package/dist/server/cloud.d.ts +49 -0
- package/dist/server/cloud.d.ts.map +1 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +6931 -0
- package/dist/server/openapi.d.ts +614 -0
- package/dist/server/openapi.d.ts.map +1 -0
- package/dist/server/repo.d.ts +44 -0
- package/dist/server/repo.d.ts.map +1 -0
- package/dist/server/serve.d.ts +11 -0
- package/dist/server/serve.d.ts.map +1 -0
- package/dist/server/v1.d.ts +6 -0
- package/dist/server/v1.d.ts.map +1 -0
- package/dist/storage.d.ts +4 -6
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +706 -5286
- package/dist/store.d.ts +40 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +13 -4
- package/scripts/generate-sdk.ts +31 -0
- package/scripts/migrate.ts +37 -0
- package/dist/cli/storage.d.ts +0 -3
- package/dist/cli/storage.d.ts.map +0 -1
- package/dist/db/pg-migrate.d.ts +0 -8
- package/dist/db/pg-migrate.d.ts.map +0 -1
- package/dist/db/storage-config.d.ts +0 -28
- package/dist/db/storage-config.d.ts.map +0 -1
- package/dist/db/storage-sync.d.ts +0 -36
- package/dist/db/storage-sync.d.ts.map +0 -1
- package/dist/mcp/storage-tools.d.ts +0 -3
- package/dist/mcp/storage-tools.d.ts.map +0 -1
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Recording, CreateRecordingInput, RecordingFilter, Agent, Project } from "./types/index.js";
|
|
2
|
+
import { type FeedbackInput } from "./db/feedback.js";
|
|
3
|
+
export declare const APP = "recordings";
|
|
4
|
+
export type { FeedbackInput } from "./db/feedback.js";
|
|
5
|
+
export interface RecordingStats {
|
|
6
|
+
total: number;
|
|
7
|
+
raw: number;
|
|
8
|
+
enhanced: number;
|
|
9
|
+
total_duration_ms: number;
|
|
10
|
+
by_model: Record<string, number>;
|
|
11
|
+
}
|
|
12
|
+
export interface Store {
|
|
13
|
+
readonly mode: "local" | "cloud-http";
|
|
14
|
+
readonly baseUrl: string | null;
|
|
15
|
+
createRecording(input: CreateRecordingInput): Promise<Recording>;
|
|
16
|
+
getRecording(id: string): Promise<Recording | null>;
|
|
17
|
+
listRecordings(filter?: RecordingFilter): Promise<Recording[]>;
|
|
18
|
+
searchRecordings(query: string, filter?: RecordingFilter): Promise<Recording[]>;
|
|
19
|
+
deleteRecording(id: string): Promise<boolean>;
|
|
20
|
+
getRecordingStats(): Promise<RecordingStats>;
|
|
21
|
+
registerAgent(name: string, description?: string, role?: string): Promise<Agent>;
|
|
22
|
+
getAgent(idOrName: string): Promise<Agent | null>;
|
|
23
|
+
listAgents(): Promise<Agent[]>;
|
|
24
|
+
heartbeatAgent(idOrName: string): Promise<Agent | null>;
|
|
25
|
+
setAgentFocus(idOrName: string, projectId: string | null): Promise<Agent | null>;
|
|
26
|
+
registerProject(name: string, path: string, description?: string): Promise<Project>;
|
|
27
|
+
getProject(idOrPath: string): Promise<Project | null>;
|
|
28
|
+
listProjects(): Promise<Project[]>;
|
|
29
|
+
saveFeedback(input: FeedbackInput): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolve the active Store from the environment. Cached per-process after first
|
|
33
|
+
* resolution against `process.env`; pass an explicit `env` (e.g. in tests) to
|
|
34
|
+
* bypass the cache. Throws if the cloud transport is requested but misconfigured
|
|
35
|
+
* (URL/key mismatch) so callers never silently read the wrong dataset.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getStore(env?: NodeJS.ProcessEnv | Record<string, string | undefined>): Store;
|
|
38
|
+
/** Test helper: clear the cached Store. */
|
|
39
|
+
export declare function __resetStore(): void;
|
|
40
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,KAAK,EACL,OAAO,EACR,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGzF,eAAO,MAAM,GAAG,eAAe,CAAC;AAEhC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAGhC,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACjE,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,I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C,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,KAAK,CAMzG;AAED,2CAA2C;AAC3C,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.2.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/recordings",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Speech-to-text recording tool with MCP and CLI — records, transcribes, and optionally enhances text using AI",
|
|
6
6
|
"repository": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
12
12
|
"bin": {
|
|
13
13
|
"recordings": "dist/cli/index.js",
|
|
14
|
-
"recordings-mcp": "dist/mcp/index.js"
|
|
14
|
+
"recordings-mcp": "dist/mcp/index.js",
|
|
15
|
+
"recordings-serve": "dist/server/index.js"
|
|
15
16
|
},
|
|
16
17
|
"exports": {
|
|
17
18
|
".": {
|
|
@@ -21,14 +22,21 @@
|
|
|
21
22
|
"./storage": {
|
|
22
23
|
"import": "./dist/storage.js",
|
|
23
24
|
"types": "./dist/storage.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./sdk": {
|
|
27
|
+
"import": "./dist/sdk/index.js",
|
|
28
|
+
"types": "./dist/sdk/index.d.ts"
|
|
24
29
|
}
|
|
25
30
|
},
|
|
26
31
|
"scripts": {
|
|
27
32
|
"clean": "rm -rf dist",
|
|
28
|
-
"build": "bun run clean && bun run build:cli && bun run build:mcp && bun run build:lib && tsc --emitDeclarationOnly --outDir dist",
|
|
33
|
+
"build": "bun run clean && bun run build:cli && bun run build:mcp && bun run build:serve && bun run build:lib && tsc --emitDeclarationOnly --outDir dist",
|
|
29
34
|
"build:cli": "bun build src/cli/index.ts --target=bun --outfile=dist/cli/index.js --external=commander --external=chalk --external=openai",
|
|
30
35
|
"build:mcp": "bun build src/mcp/index.ts --target=bun --outfile=dist/mcp/index.js --external=@modelcontextprotocol/sdk --external=openai",
|
|
31
|
-
"build:
|
|
36
|
+
"build:serve": "bun build src/server/index.ts --target=bun --outfile=dist/server/index.js --external=@modelcontextprotocol/sdk --external=@hasna/contracts --external=openai --external=pg",
|
|
37
|
+
"build:lib": "bun build src/index.ts src/storage.ts src/sdk/index.ts --target=bun --outdir=dist --external=openai",
|
|
38
|
+
"generate:sdk": "bun run scripts/generate-sdk.ts",
|
|
39
|
+
"migrate": "bun run scripts/migrate.ts",
|
|
32
40
|
"typecheck": "tsc --noEmit",
|
|
33
41
|
"test": "bun test",
|
|
34
42
|
"test:coverage": "bun test --coverage",
|
|
@@ -52,6 +60,7 @@
|
|
|
52
60
|
"LICENSE"
|
|
53
61
|
],
|
|
54
62
|
"dependencies": {
|
|
63
|
+
"@hasna/contracts": "^0.4.2",
|
|
55
64
|
"@hasna/events": "^0.1.11",
|
|
56
65
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
57
66
|
"chalk": "^5.4.1",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* Generate the typed `/v1` SDK client from the serve OpenAPI document.
|
|
4
|
+
*
|
|
5
|
+
* Source of truth: src/server/openapi.ts (also served at GET /openapi.json).
|
|
6
|
+
* Output: src/sdk/v1.generated.ts — a dependency-free typed fetch client.
|
|
7
|
+
*
|
|
8
|
+
* Usage: bun run scripts/generate-sdk.ts
|
|
9
|
+
*/
|
|
10
|
+
import { writeFileSync } from "node:fs";
|
|
11
|
+
import { join, dirname } from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
import { generateSdkFromOpenApi } from "@hasna/contracts/sdk";
|
|
14
|
+
import { buildV1OpenApiDocument } from "../src/server/openapi.js";
|
|
15
|
+
|
|
16
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
17
|
+
const spec = buildV1OpenApiDocument();
|
|
18
|
+
const { code, operations, warnings } = generateSdkFromOpenApi(spec as never, {
|
|
19
|
+
className: "RecordingsV1Client",
|
|
20
|
+
apiKeyHeader: "x-api-key",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const header =
|
|
24
|
+
"// AUTO-GENERATED by scripts/generate-sdk.ts from src/server/openapi.ts — DO NOT EDIT BY HAND.\n" +
|
|
25
|
+
"// Regenerate: bun run scripts/generate-sdk.ts\n\n";
|
|
26
|
+
const outPath = join(root, "src/sdk/v1.generated.ts");
|
|
27
|
+
writeFileSync(outPath, header + code);
|
|
28
|
+
|
|
29
|
+
console.log(`Wrote ${outPath}`);
|
|
30
|
+
console.log(`Operations: ${operations.map((o) => o.functionName).join(", ")}`);
|
|
31
|
+
if (warnings.length) console.log(`Warnings:\n ${warnings.join("\n ")}`);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* Migration runner for the recordings cloud (A1 pure-remote) database.
|
|
4
|
+
*
|
|
5
|
+
* Applies the relational recordings schema and the contracts API-key store,
|
|
6
|
+
* idempotently (CREATE ... IF NOT EXISTS). NEVER drops or rewrites existing
|
|
7
|
+
* tables — safe to run against a populated DB. Shares the exact code path used
|
|
8
|
+
* by the serve process (`ensureCloudSchema`).
|
|
9
|
+
*
|
|
10
|
+
* The canonical DDL is committed under migrations/*.sql for transparency.
|
|
11
|
+
*
|
|
12
|
+
* Env: HASNA_RECORDINGS_DATABASE_URL (or RECORDINGS_DATABASE_URL / DATABASE_URL).
|
|
13
|
+
* Usage: bun run scripts/migrate.ts
|
|
14
|
+
*/
|
|
15
|
+
import { ensureCloudSchema, pingCloud, resolveCloudDatabaseUrl, closeCloud } from "../src/server/cloud.js";
|
|
16
|
+
|
|
17
|
+
async function main() {
|
|
18
|
+
const url = resolveCloudDatabaseUrl();
|
|
19
|
+
if (!url) {
|
|
20
|
+
console.error(
|
|
21
|
+
"migrate: no database URL (HASNA_RECORDINGS_DATABASE_URL / RECORDINGS_DATABASE_URL / DATABASE_URL)",
|
|
22
|
+
);
|
|
23
|
+
process.exit(2);
|
|
24
|
+
}
|
|
25
|
+
console.log("migrate: connecting…");
|
|
26
|
+
await pingCloud();
|
|
27
|
+
console.log("migrate: applying schema (recordings tables + api_keys)…");
|
|
28
|
+
await ensureCloudSchema();
|
|
29
|
+
console.log("migrate: done");
|
|
30
|
+
await closeCloud();
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
main().catch((e) => {
|
|
35
|
+
console.error("migrate: failed:", (e as Error).message);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
});
|
package/dist/cli/storage.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/cli/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8BzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkI9D"}
|
package/dist/db/pg-migrate.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,CAyC5F"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type StorageMode = "local" | "hybrid" | "remote";
|
|
2
|
-
export interface StorageConfig {
|
|
3
|
-
mode: StorageMode;
|
|
4
|
-
postgres: {
|
|
5
|
-
host: string;
|
|
6
|
-
port: number;
|
|
7
|
-
username: string;
|
|
8
|
-
password_env: string;
|
|
9
|
-
ssl: boolean;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export interface StorageEnv {
|
|
13
|
-
name: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const RECORDINGS_STORAGE_ENV = "HASNA_RECORDINGS_DATABASE_URL";
|
|
16
|
-
export declare const RECORDINGS_STORAGE_FALLBACK_ENV = "RECORDINGS_DATABASE_URL";
|
|
17
|
-
export declare const RECORDINGS_STORAGE_MODE_ENV = "HASNA_RECORDINGS_STORAGE_MODE";
|
|
18
|
-
export declare const RECORDINGS_STORAGE_MODE_FALLBACK_ENV = "RECORDINGS_STORAGE_MODE";
|
|
19
|
-
export declare const RECORDINGS_STORAGE_CONFIG_ENV = "HASNA_RECORDINGS_STORAGE_CONFIG";
|
|
20
|
-
export declare const STORAGE_DATABASE_ENV: readonly ["HASNA_RECORDINGS_DATABASE_URL", "RECORDINGS_DATABASE_URL"];
|
|
21
|
-
export declare const STORAGE_MODE_ENV: readonly ["HASNA_RECORDINGS_STORAGE_MODE", "RECORDINGS_STORAGE_MODE"];
|
|
22
|
-
export declare function getStorageDatabaseEnvName(): (typeof STORAGE_DATABASE_ENV)[number] | null;
|
|
23
|
-
export declare function getStorageDatabaseEnv(): StorageEnv | null;
|
|
24
|
-
export declare function getStorageDatabaseUrl(): string | undefined;
|
|
25
|
-
export declare function getStorageConfig(): StorageConfig;
|
|
26
|
-
export declare function getStorageConnectionString(dbName?: string): string;
|
|
27
|
-
export declare const getConnectionString: typeof getStorageConnectionString;
|
|
28
|
-
//# sourceMappingURL=storage-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-config.d.ts","sourceRoot":"","sources":["../../src/db/storage-config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE;QACR,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;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAGD,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AACtE,eAAO,MAAM,+BAA+B,4BAA4B,CAAC;AACzE,eAAO,MAAM,2BAA2B,kCAAkC,CAAC;AAC3E,eAAO,MAAM,oCAAoC,4BAA4B,CAAC;AAC9E,eAAO,MAAM,6BAA6B,oCAAoC,CAAC;AAC/E,eAAO,MAAM,oBAAoB,uEAAqE,CAAC;AACvG,eAAO,MAAM,gBAAgB,uEAA+E,CAAC;AAa7G,wBAAgB,yBAAyB,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAKxF;AAED,wBAAgB,qBAAqB,IAAI,UAAU,GAAG,IAAI,CAGzD;AAED,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,SAAS,CAG1D;AAQD,wBAAgB,gBAAgB,IAAI,aAAa,CAoChD;AAED,wBAAgB,0BAA0B,CAAC,MAAM,SAAe,GAAG,MAAM,CAiBxE;AAED,eAAO,MAAM,mBAAmB,mCAA6B,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type Database } from "bun:sqlite";
|
|
2
|
-
import { STORAGE_DATABASE_ENV, type StorageMode } from "./storage-config.js";
|
|
3
|
-
import { PgAdapterAsync } from "./remote-storage.js";
|
|
4
|
-
export interface SyncResult {
|
|
5
|
-
table: string;
|
|
6
|
-
direction: "push" | "pull";
|
|
7
|
-
rows_read: number;
|
|
8
|
-
rows_written: number;
|
|
9
|
-
errors: string[];
|
|
10
|
-
}
|
|
11
|
-
export interface StorageStatus {
|
|
12
|
-
configured: boolean;
|
|
13
|
-
mode: StorageMode;
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
env: typeof STORAGE_DATABASE_ENV;
|
|
16
|
-
activeEnv: string | null;
|
|
17
|
-
service: "recordings";
|
|
18
|
-
db_path: string;
|
|
19
|
-
tables: Array<{
|
|
20
|
-
table: string;
|
|
21
|
-
rows: number;
|
|
22
|
-
}>;
|
|
23
|
-
}
|
|
24
|
-
export declare const STORAGE_TABLES: readonly ["projects", "agents", "recordings", "recording_tags", "feedback"];
|
|
25
|
-
export declare const RECORDINGS_STORAGE_TABLES: readonly ["projects", "agents", "recordings", "recording_tags", "feedback"];
|
|
26
|
-
export declare function getStoragePg(): Promise<PgAdapterAsync>;
|
|
27
|
-
export declare function runStorageMigrations(remote: PgAdapterAsync): Promise<void>;
|
|
28
|
-
export declare function getStorageStatus(db?: Database): StorageStatus;
|
|
29
|
-
export declare function pushStorageChanges(tables?: string[]): Promise<SyncResult[]>;
|
|
30
|
-
export declare function pullStorageChanges(tables?: string[]): Promise<SyncResult[]>;
|
|
31
|
-
export declare function syncStorageChanges(tables?: string[]): Promise<{
|
|
32
|
-
push: SyncResult[];
|
|
33
|
-
pull: SyncResult[];
|
|
34
|
-
}>;
|
|
35
|
-
export declare function parseStorageTables(raw?: string): string[];
|
|
36
|
-
//# sourceMappingURL=storage-sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-sync.d.ts","sourceRoot":"","sources":["../../src/db/storage-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EACL,oBAAoB,EAIpB,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,OAAO,oBAAoB,CAAC;IACjC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,YAAY,CAAC;IACtB,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,cAAc,6EAMjB,CAAC;AAEX,eAAO,MAAM,yBAAyB,6EAAiB,CAAC;AA6ExD,wBAAsB,YAAY,IAAI,OAAO,CAAC,cAAc,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