@tmlmobilidade/env-sync 20260411.1248.31 → 20260418.947.47
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/package.json +3 -3
- package/dist/artifacts/upload.service.d.ts +0 -17
- package/dist/cli/commands.d.ts +0 -13
- package/dist/config/config-loader.d.ts +0 -37
- package/dist/index.d.ts +0 -2
- package/dist/mongodb/dump.service.d.ts +0 -8
- package/dist/mongodb/restore.service.d.ts +0 -6
- package/dist/mongodb/sync.service.d.ts +0 -7
- package/dist/storage/rclone.service.d.ts +0 -2
- package/dist/storage/sync.service.d.ts +0 -2
- package/dist/utils/exec.d.ts +0 -12
- package/dist/utils/logger.d.ts +0 -11
- package/dist/utils/metadata.d.ts +0 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmlmobilidade/env-sync",
|
|
3
3
|
"description": "CLI tool to sync production and staging environments (MongoDB and Storage)",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "20260418.947.47",
|
|
5
5
|
"author": {
|
|
6
6
|
"email": "iso@tmlmobilidade.pt",
|
|
7
7
|
"name": "TML-ISO"
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"@tmlmobilidade/types": "*",
|
|
34
34
|
"archiver": "7.0.1",
|
|
35
35
|
"chalk": "5.6.2",
|
|
36
|
-
"dotenv": "17.4.
|
|
36
|
+
"dotenv": "17.4.2",
|
|
37
37
|
"mongodb": "7.1.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@tmlmobilidade/tsconfig": "*",
|
|
41
41
|
"@types/archiver": "7.0.0",
|
|
42
|
-
"@types/node": "25.
|
|
42
|
+
"@types/node": "25.6.0",
|
|
43
43
|
"resolve-tspaths": "0.8.23",
|
|
44
44
|
"tsx": "4.21.0"
|
|
45
45
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { StorageConfig } from '../config/config-loader.js';
|
|
2
|
-
export interface UploadArtifactsOptions {
|
|
3
|
-
/** OCI bucket name to upload to */
|
|
4
|
-
bucket: string;
|
|
5
|
-
/** Local directory containing artifacts to upload */
|
|
6
|
-
localPath: string;
|
|
7
|
-
/** Optional prefix/folder within the bucket */
|
|
8
|
-
prefix?: string;
|
|
9
|
-
/** Storage config with OCI credentials */
|
|
10
|
-
storageConfig: StorageConfig;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Upload artifacts (backups) to OCI Object Storage bucket.
|
|
14
|
-
* This replaces the GitHub artifacts upload for security in public repos.
|
|
15
|
-
* The backup folder is zipped before uploading to reduce size and upload time.
|
|
16
|
-
*/
|
|
17
|
-
export declare function uploadArtifacts(options: UploadArtifactsOptions): Promise<void>;
|
package/dist/cli/commands.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface CliOptions {
|
|
2
|
-
backupOnly?: boolean;
|
|
3
|
-
dbOnly?: boolean;
|
|
4
|
-
envFile?: string;
|
|
5
|
-
help?: boolean;
|
|
6
|
-
noCleanup?: boolean;
|
|
7
|
-
replicaSet?: boolean;
|
|
8
|
-
storageOnly?: boolean;
|
|
9
|
-
uploadArtifacts?: boolean;
|
|
10
|
-
verbose?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function parseArgs(args: string[]): CliOptions;
|
|
13
|
-
export declare function showHelp(): void;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export interface MongoConfig {
|
|
2
|
-
authDatabase: string;
|
|
3
|
-
database: string;
|
|
4
|
-
host: string;
|
|
5
|
-
password: string;
|
|
6
|
-
username: string;
|
|
7
|
-
}
|
|
8
|
-
export interface StorageConfig {
|
|
9
|
-
compartment: string;
|
|
10
|
-
dest: string;
|
|
11
|
-
fingerprint: string;
|
|
12
|
-
keyFile: string;
|
|
13
|
-
namespace: string;
|
|
14
|
-
region: string;
|
|
15
|
-
remoteName: string;
|
|
16
|
-
source: string;
|
|
17
|
-
tenancy: string;
|
|
18
|
-
type: string;
|
|
19
|
-
user: string;
|
|
20
|
-
}
|
|
21
|
-
export interface ArtifactsConfig {
|
|
22
|
-
/** OCI bucket name for storing artifacts */
|
|
23
|
-
bucket: string;
|
|
24
|
-
/** Optional prefix/folder within the bucket */
|
|
25
|
-
prefix: string;
|
|
26
|
-
}
|
|
27
|
-
export interface SyncConfig {
|
|
28
|
-
artifacts: ArtifactsConfig;
|
|
29
|
-
backupDir: string;
|
|
30
|
-
backupRetentionDays: number;
|
|
31
|
-
databaseProduction: MongoConfig;
|
|
32
|
-
databaseStaging: MongoConfig;
|
|
33
|
-
excludeCollections: string[];
|
|
34
|
-
scriptDir: string;
|
|
35
|
-
storage: StorageConfig;
|
|
36
|
-
}
|
|
37
|
-
export declare function loadConfig(envFilePath?: string): SyncConfig;
|
package/dist/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MongoConfig } from '../config/config-loader.js';
|
|
2
|
-
export interface DumpOptions {
|
|
3
|
-
config: MongoConfig;
|
|
4
|
-
excludeCollections?: string[];
|
|
5
|
-
outputPath: string;
|
|
6
|
-
useReplicaSet?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare function dumpMongoDB(options: DumpOptions): Promise<void>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SyncConfig } from '../config/config-loader.js';
|
|
2
|
-
export interface MongoSyncOptions {
|
|
3
|
-
backupOnly?: boolean;
|
|
4
|
-
skipCleanup?: boolean;
|
|
5
|
-
useReplicaSet?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function syncMongoDB(config: SyncConfig, options?: MongoSyncOptions): Promise<void>;
|
package/dist/utils/exec.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface ExecOptions {
|
|
2
|
-
cwd?: string;
|
|
3
|
-
env?: NodeJS.ProcessEnv;
|
|
4
|
-
timeout?: number;
|
|
5
|
-
}
|
|
6
|
-
export interface ExecResult {
|
|
7
|
-
stderr: string;
|
|
8
|
-
stdout: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function execCommand(command: string, options?: ExecOptions): Promise<ExecResult>;
|
|
11
|
-
export declare function execCommandStream(command: string, options?: ExecOptions): Promise<void>;
|
|
12
|
-
export declare function checkCommandAvailable(command: string): Promise<boolean>;
|
package/dist/utils/logger.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const logger: {
|
|
2
|
-
clearPreviousLine(): void;
|
|
3
|
-
error(...args: unknown[]): void;
|
|
4
|
-
info(...args: unknown[]): void;
|
|
5
|
-
isVerbose(): boolean;
|
|
6
|
-
log(...args: unknown[]): void;
|
|
7
|
-
setVerbose(enabled: boolean): void;
|
|
8
|
-
success(...args: unknown[]): void;
|
|
9
|
-
verbose(...args: unknown[]): void;
|
|
10
|
-
warn(...args: unknown[]): void;
|
|
11
|
-
};
|
package/dist/utils/metadata.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface BackupMetadata {
|
|
2
|
-
timestamp: string;
|
|
3
|
-
}
|
|
4
|
-
export declare function getMetadataFilePath(backupDir: string): string;
|
|
5
|
-
export declare function saveBackupMetadata(backupDir: string, backupType: string, timestamp: string): void;
|
|
6
|
-
export declare function loadBackupMetadata(backupDir: string, backupType: string): BackupMetadata | null;
|