@hasna/shortlinks 0.1.17 → 0.1.19
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/LICENSE +191 -152
- package/README.md +18 -21
- package/cloudflare/shortlinks.js +10 -26
- package/cloudflare/wrangler.example.toml +1 -3
- package/dist/cli/index.js +566 -6261
- package/dist/cloudflare.d.ts +0 -1
- package/dist/cloudflare.js +10 -28
- package/dist/config.d.ts +0 -8
- package/dist/index.d.ts +1 -8
- package/dist/index.js +202 -5889
- package/dist/pg-store.d.ts +1 -3
- package/dist/server.d.ts +1 -18
- package/dist/server.js +22 -183
- package/dist/store.d.ts +0 -1
- package/dist/types.d.ts +0 -3
- package/infra/aws-ec2-user-data.sh +16 -65
- package/package.json +6 -11
- package/dist/api-client.d.ts +0 -30
- package/dist/pg-migrate.d.ts +0 -7
- package/dist/remote-storage.d.ts +0 -11
- package/dist/storage-config.d.ts +0 -37
- package/dist/storage-sync.d.ts +0 -36
- package/dist/storage.d.ts +0 -6
- package/dist/storage.js +0 -5561
package/dist/storage-sync.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { STORAGE_DATABASE_ENV, type CanonicalShortlinksRdsConfig, type StorageMode } from "./storage-config.js";
|
|
2
|
-
import { PgAdapterAsync } from "./remote-storage.js";
|
|
3
|
-
export interface StorageSyncResult {
|
|
4
|
-
table: string;
|
|
5
|
-
direction: "push" | "pull";
|
|
6
|
-
rowsRead: number;
|
|
7
|
-
rowsWritten: number;
|
|
8
|
-
errors: string[];
|
|
9
|
-
}
|
|
10
|
-
export type SyncResult = StorageSyncResult;
|
|
11
|
-
export interface StorageStatus {
|
|
12
|
-
configured: boolean;
|
|
13
|
-
mode: StorageMode;
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
env: typeof STORAGE_DATABASE_ENV;
|
|
16
|
-
activeEnv: string | null;
|
|
17
|
-
canonical: CanonicalShortlinksRdsConfig;
|
|
18
|
-
service: "shortlinks";
|
|
19
|
-
db_path: string;
|
|
20
|
-
tables: Array<{
|
|
21
|
-
table: string;
|
|
22
|
-
rows: number;
|
|
23
|
-
}>;
|
|
24
|
-
}
|
|
25
|
-
export declare const STORAGE_TABLES: readonly ["domains", "links", "clicks"];
|
|
26
|
-
export declare const SHORTLINKS_STORAGE_TABLES: readonly ["domains", "links", "clicks"];
|
|
27
|
-
export declare function getStoragePg(): Promise<PgAdapterAsync>;
|
|
28
|
-
export declare function runStorageMigrations(remote: PgAdapterAsync): Promise<void>;
|
|
29
|
-
export declare function getStorageStatus(dbPath?: string): StorageStatus;
|
|
30
|
-
export declare function pushStorageChanges(dbPath?: string, tables?: string[]): Promise<StorageSyncResult[]>;
|
|
31
|
-
export declare function pullStorageChanges(dbPath?: string, tables?: string[]): Promise<StorageSyncResult[]>;
|
|
32
|
-
export declare function syncStorageChanges(dbPath?: string, tables?: string[]): Promise<{
|
|
33
|
-
push: StorageSyncResult[];
|
|
34
|
-
pull: StorageSyncResult[];
|
|
35
|
-
}>;
|
|
36
|
-
export declare function parseStorageTables(raw?: string): string[];
|
package/dist/storage.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { CANONICAL_SHORTLINKS_RDS_CLUSTER, CANONICAL_SHORTLINKS_RDS_DATABASE, CANONICAL_SHORTLINKS_RDS_SECRET_PATH, SHORTLINKS_STORAGE_ENV, SHORTLINKS_STORAGE_FALLBACK_ENV, SHORTLINKS_STORAGE_MODE_ENV, SHORTLINKS_STORAGE_MODE_FALLBACK_ENV, STORAGE_DATABASE_ENV, STORAGE_MODE_ENV, getConnectionString, getCanonicalShortlinksRdsConfig, getStorageConfig, getStorageConnectionString, getStorageDatabaseEnv, getStorageDatabaseEnvName, getStorageDatabaseUrl, } from "./storage-config.js";
|
|
2
|
-
export type { CanonicalShortlinksRdsConfig, StorageConfig, StorageEnv, StorageMode } from "./storage-config.js";
|
|
3
|
-
export { SHORTLINKS_STORAGE_TABLES, STORAGE_TABLES, getStoragePg, getStorageStatus, parseStorageTables, pullStorageChanges, pushStorageChanges, runStorageMigrations, syncStorageChanges, } from "./storage-sync.js";
|
|
4
|
-
export type { StorageStatus, StorageSyncResult, SyncResult } from "./storage-sync.js";
|
|
5
|
-
export { PgAdapterAsync } from "./remote-storage.js";
|
|
6
|
-
export { PG_MIGRATIONS } from "./pg-migrations.js";
|