@hasna/cloud 0.1.16 → 0.1.17
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/adapter.d.ts.map +1 -1
- package/dist/cli/index.js +16 -7
- package/dist/config.d.ts +4 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/mcp/index.js +10 -5
- package/dist/scheduled-sync.js +7 -3
- package/package.json +1 -1
package/dist/adapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,IAAI,CAAC;AAOpB,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;IACjC,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IAC3B,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC7B,QAAQ,IAAI,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;IAC9C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IACxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC1C,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAA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AG,CAAC;IAOhD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAOlD,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAe3E,IAAI,GAAG,IAAI,EAAE,CAAC,IAAI,CAEjB;CACF"}
|
package/dist/cli/index.js
CHANGED
|
@@ -11039,7 +11039,8 @@ class PgAdapter {
|
|
|
11039
11039
|
_client = null;
|
|
11040
11040
|
constructor(arg) {
|
|
11041
11041
|
if (typeof arg === "string") {
|
|
11042
|
-
|
|
11042
|
+
const sslConfig = arg.includes("sslmode=require") || arg.includes("ssl=true") ? { rejectUnauthorized: false } : undefined;
|
|
11043
|
+
this.pool = new esm_default.Pool({ connectionString: arg, ssl: sslConfig });
|
|
11043
11044
|
} else {
|
|
11044
11045
|
this.pool = arg;
|
|
11045
11046
|
}
|
|
@@ -11166,7 +11167,8 @@ class PgAdapterAsync {
|
|
|
11166
11167
|
pool;
|
|
11167
11168
|
constructor(arg) {
|
|
11168
11169
|
if (typeof arg === "string") {
|
|
11169
|
-
|
|
11170
|
+
const sslConfig = arg.includes("sslmode=require") || arg.includes("ssl=true") ? { rejectUnauthorized: false } : undefined;
|
|
11171
|
+
this.pool = new esm_default.Pool({ connectionString: arg, ssl: sslConfig });
|
|
11170
11172
|
} else {
|
|
11171
11173
|
this.pool = arg;
|
|
11172
11174
|
}
|
|
@@ -11290,7 +11292,10 @@ function getConnectionString2(dbName) {
|
|
|
11290
11292
|
if (!host || !username) {
|
|
11291
11293
|
throw new Error("Cloud RDS not configured. Run `cloud setup` to configure.");
|
|
11292
11294
|
}
|
|
11293
|
-
const password = process.env[password_env]
|
|
11295
|
+
const password = process.env[password_env];
|
|
11296
|
+
if (password === undefined || password === "") {
|
|
11297
|
+
throw new Error(`RDS password not set. Export ${password_env} in your shell or add it to ~/.secrets/hasna/rds/live.env`);
|
|
11298
|
+
}
|
|
11294
11299
|
const sslParam = ssl ? "?sslmode=require" : "";
|
|
11295
11300
|
return `postgres://${username}:${encodeURIComponent(password)}@${host}:${port}/${dbName}${sslParam}`;
|
|
11296
11301
|
}
|
|
@@ -11317,7 +11322,7 @@ var init_config = __esm(() => {
|
|
|
11317
11322
|
password_env: exports_external.string().default("HASNA_RDS_PASSWORD"),
|
|
11318
11323
|
ssl: exports_external.boolean().default(true)
|
|
11319
11324
|
}).default({}),
|
|
11320
|
-
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("
|
|
11325
|
+
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("hybrid"),
|
|
11321
11326
|
auto_sync_interval_minutes: exports_external.number().default(0),
|
|
11322
11327
|
feedback_endpoint: exports_external.string().default("https://feedback.hasna.com/api/v1/feedback"),
|
|
11323
11328
|
sync: exports_external.object({
|
|
@@ -11468,7 +11473,7 @@ var CloudConfigSchema = exports_external.object({
|
|
|
11468
11473
|
password_env: exports_external.string().default("HASNA_RDS_PASSWORD"),
|
|
11469
11474
|
ssl: exports_external.boolean().default(true)
|
|
11470
11475
|
}).default({}),
|
|
11471
|
-
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("
|
|
11476
|
+
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("hybrid"),
|
|
11472
11477
|
auto_sync_interval_minutes: exports_external.number().default(0),
|
|
11473
11478
|
feedback_endpoint: exports_external.string().default("https://feedback.hasna.com/api/v1/feedback"),
|
|
11474
11479
|
sync: exports_external.object({
|
|
@@ -11499,7 +11504,10 @@ function getConnectionString(dbName) {
|
|
|
11499
11504
|
if (!host || !username) {
|
|
11500
11505
|
throw new Error("Cloud RDS not configured. Run `cloud setup` to configure.");
|
|
11501
11506
|
}
|
|
11502
|
-
const password = process.env[password_env]
|
|
11507
|
+
const password = process.env[password_env];
|
|
11508
|
+
if (password === undefined || password === "") {
|
|
11509
|
+
throw new Error(`RDS password not set. Export ${password_env} in your shell or add it to ~/.secrets/hasna/rds/live.env`);
|
|
11510
|
+
}
|
|
11503
11511
|
const sslParam = ssl ? "?sslmode=require" : "";
|
|
11504
11512
|
return `postgres://${username}:${encodeURIComponent(password)}@${host}:${port}/${dbName}${sslParam}`;
|
|
11505
11513
|
}
|
|
@@ -12067,7 +12075,8 @@ class PgAdapterAsync2 {
|
|
|
12067
12075
|
pool;
|
|
12068
12076
|
constructor(arg) {
|
|
12069
12077
|
if (typeof arg === "string") {
|
|
12070
|
-
|
|
12078
|
+
const sslConfig = arg.includes("sslmode=require") || arg.includes("ssl=true") ? { rejectUnauthorized: false } : undefined;
|
|
12079
|
+
this.pool = new esm_default.Pool({ connectionString: arg, ssl: sslConfig });
|
|
12071
12080
|
} else {
|
|
12072
12081
|
this.pool = arg;
|
|
12073
12082
|
}
|
package/dist/config.d.ts
CHANGED
|
@@ -7,17 +7,17 @@ export declare const CloudConfigSchema: z.ZodObject<{
|
|
|
7
7
|
password_env: z.ZodDefault<z.ZodString>;
|
|
8
8
|
ssl: z.ZodDefault<z.ZodBoolean>;
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
ssl: boolean;
|
|
10
11
|
host: string;
|
|
11
12
|
port: number;
|
|
12
13
|
username: string;
|
|
13
14
|
password_env: string;
|
|
14
|
-
ssl: boolean;
|
|
15
15
|
}, {
|
|
16
|
+
ssl?: boolean | undefined;
|
|
16
17
|
host?: string | undefined;
|
|
17
18
|
port?: number | undefined;
|
|
18
19
|
username?: string | undefined;
|
|
19
20
|
password_env?: string | undefined;
|
|
20
|
-
ssl?: boolean | undefined;
|
|
21
21
|
}>>;
|
|
22
22
|
mode: z.ZodDefault<z.ZodEnum<["local", "cloud", "hybrid"]>>;
|
|
23
23
|
auto_sync_interval_minutes: z.ZodDefault<z.ZodNumber>;
|
|
@@ -31,11 +31,11 @@ export declare const CloudConfigSchema: z.ZodObject<{
|
|
|
31
31
|
}>>;
|
|
32
32
|
}, "strip", z.ZodTypeAny, {
|
|
33
33
|
rds: {
|
|
34
|
+
ssl: boolean;
|
|
34
35
|
host: string;
|
|
35
36
|
port: number;
|
|
36
37
|
username: string;
|
|
37
38
|
password_env: string;
|
|
38
|
-
ssl: boolean;
|
|
39
39
|
};
|
|
40
40
|
mode: "local" | "cloud" | "hybrid";
|
|
41
41
|
auto_sync_interval_minutes: number;
|
|
@@ -45,11 +45,11 @@ export declare const CloudConfigSchema: z.ZodObject<{
|
|
|
45
45
|
};
|
|
46
46
|
}, {
|
|
47
47
|
rds?: {
|
|
48
|
+
ssl?: boolean | undefined;
|
|
48
49
|
host?: string | undefined;
|
|
49
50
|
port?: number | undefined;
|
|
50
51
|
username?: string | undefined;
|
|
51
52
|
password_env?: string | undefined;
|
|
52
|
-
ssl?: boolean | undefined;
|
|
53
53
|
} | undefined;
|
|
54
54
|
mode?: "local" | "cloud" | "hybrid" | undefined;
|
|
55
55
|
auto_sync_interval_minutes?: number | undefined;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoB5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAS5D,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAMD,wBAAgB,cAAc,IAAI,WAAW,CAU5C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAGzD;AAMD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoB5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAS5D,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAMD,wBAAgB,cAAc,IAAI,WAAW,CAU5C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAGzD;AAMD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAoB1D;AAMD,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IACpC,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,SAAS,CAaxE"}
|
package/dist/index.js
CHANGED
|
@@ -5048,7 +5048,8 @@ class PgAdapter {
|
|
|
5048
5048
|
_client = null;
|
|
5049
5049
|
constructor(arg) {
|
|
5050
5050
|
if (typeof arg === "string") {
|
|
5051
|
-
|
|
5051
|
+
const sslConfig = arg.includes("sslmode=require") || arg.includes("ssl=true") ? { rejectUnauthorized: false } : undefined;
|
|
5052
|
+
this.pool = new esm_default.Pool({ connectionString: arg, ssl: sslConfig });
|
|
5052
5053
|
} else {
|
|
5053
5054
|
this.pool = arg;
|
|
5054
5055
|
}
|
|
@@ -5175,7 +5176,8 @@ class PgAdapterAsync {
|
|
|
5175
5176
|
pool;
|
|
5176
5177
|
constructor(arg) {
|
|
5177
5178
|
if (typeof arg === "string") {
|
|
5178
|
-
|
|
5179
|
+
const sslConfig = arg.includes("sslmode=require") || arg.includes("ssl=true") ? { rejectUnauthorized: false } : undefined;
|
|
5180
|
+
this.pool = new esm_default.Pool({ connectionString: arg, ssl: sslConfig });
|
|
5179
5181
|
} else {
|
|
5180
5182
|
this.pool = arg;
|
|
5181
5183
|
}
|
|
@@ -9294,7 +9296,10 @@ function getConnectionString(dbName) {
|
|
|
9294
9296
|
if (!host || !username) {
|
|
9295
9297
|
throw new Error("Cloud RDS not configured. Run `cloud setup` to configure.");
|
|
9296
9298
|
}
|
|
9297
|
-
const password = process.env[password_env]
|
|
9299
|
+
const password = process.env[password_env];
|
|
9300
|
+
if (password === undefined || password === "") {
|
|
9301
|
+
throw new Error(`RDS password not set. Export ${password_env} in your shell or add it to ~/.secrets/hasna/rds/live.env`);
|
|
9302
|
+
}
|
|
9298
9303
|
const sslParam = ssl ? "?sslmode=require" : "";
|
|
9299
9304
|
return `postgres://${username}:${encodeURIComponent(password)}@${host}:${port}/${dbName}${sslParam}`;
|
|
9300
9305
|
}
|
|
@@ -9321,7 +9326,7 @@ var init_config = __esm(() => {
|
|
|
9321
9326
|
password_env: exports_external.string().default("HASNA_RDS_PASSWORD"),
|
|
9322
9327
|
ssl: exports_external.boolean().default(true)
|
|
9323
9328
|
}).default({}),
|
|
9324
|
-
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("
|
|
9329
|
+
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("hybrid"),
|
|
9325
9330
|
auto_sync_interval_minutes: exports_external.number().default(0),
|
|
9326
9331
|
feedback_endpoint: exports_external.string().default("https://feedback.hasna.com/api/v1/feedback"),
|
|
9327
9332
|
sync: exports_external.object({
|
package/dist/mcp/index.js
CHANGED
|
@@ -24468,7 +24468,8 @@ class PgAdapter {
|
|
|
24468
24468
|
_client = null;
|
|
24469
24469
|
constructor(arg) {
|
|
24470
24470
|
if (typeof arg === "string") {
|
|
24471
|
-
|
|
24471
|
+
const sslConfig = arg.includes("sslmode=require") || arg.includes("ssl=true") ? { rejectUnauthorized: false } : undefined;
|
|
24472
|
+
this.pool = new esm_default.Pool({ connectionString: arg, ssl: sslConfig });
|
|
24472
24473
|
} else {
|
|
24473
24474
|
this.pool = arg;
|
|
24474
24475
|
}
|
|
@@ -24620,7 +24621,7 @@ var CloudConfigSchema = exports_external.object({
|
|
|
24620
24621
|
password_env: exports_external.string().default("HASNA_RDS_PASSWORD"),
|
|
24621
24622
|
ssl: exports_external.boolean().default(true)
|
|
24622
24623
|
}).default({}),
|
|
24623
|
-
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("
|
|
24624
|
+
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("hybrid"),
|
|
24624
24625
|
auto_sync_interval_minutes: exports_external.number().default(0),
|
|
24625
24626
|
feedback_endpoint: exports_external.string().default("https://feedback.hasna.com/api/v1/feedback"),
|
|
24626
24627
|
sync: exports_external.object({
|
|
@@ -24646,7 +24647,10 @@ function getConnectionString(dbName) {
|
|
|
24646
24647
|
if (!host || !username) {
|
|
24647
24648
|
throw new Error("Cloud RDS not configured. Run `cloud setup` to configure.");
|
|
24648
24649
|
}
|
|
24649
|
-
const password = process.env[password_env]
|
|
24650
|
+
const password = process.env[password_env];
|
|
24651
|
+
if (password === undefined || password === "") {
|
|
24652
|
+
throw new Error(`RDS password not set. Export ${password_env} in your shell or add it to ~/.secrets/hasna/rds/live.env`);
|
|
24653
|
+
}
|
|
24650
24654
|
const sslParam = ssl ? "?sslmode=require" : "";
|
|
24651
24655
|
return `postgres://${username}:${encodeURIComponent(password)}@${host}:${port}/${dbName}${sslParam}`;
|
|
24652
24656
|
}
|
|
@@ -25051,7 +25055,7 @@ var CloudConfigSchema2 = exports_external.object({
|
|
|
25051
25055
|
password_env: exports_external.string().default("HASNA_RDS_PASSWORD"),
|
|
25052
25056
|
ssl: exports_external.boolean().default(true)
|
|
25053
25057
|
}).default({}),
|
|
25054
|
-
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("
|
|
25058
|
+
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("hybrid"),
|
|
25055
25059
|
auto_sync_interval_minutes: exports_external.number().default(0),
|
|
25056
25060
|
feedback_endpoint: exports_external.string().default("https://feedback.hasna.com/api/v1/feedback"),
|
|
25057
25061
|
sync: exports_external.object({
|
|
@@ -25220,7 +25224,8 @@ class PgAdapterAsync {
|
|
|
25220
25224
|
pool;
|
|
25221
25225
|
constructor(arg) {
|
|
25222
25226
|
if (typeof arg === "string") {
|
|
25223
|
-
|
|
25227
|
+
const sslConfig = arg.includes("sslmode=require") || arg.includes("ssl=true") ? { rejectUnauthorized: false } : undefined;
|
|
25228
|
+
this.pool = new esm_default.Pool({ connectionString: arg, ssl: sslConfig });
|
|
25224
25229
|
} else {
|
|
25225
25230
|
this.pool = arg;
|
|
25226
25231
|
}
|
package/dist/scheduled-sync.js
CHANGED
|
@@ -9014,7 +9014,8 @@ class PgAdapterAsync {
|
|
|
9014
9014
|
pool;
|
|
9015
9015
|
constructor(arg) {
|
|
9016
9016
|
if (typeof arg === "string") {
|
|
9017
|
-
|
|
9017
|
+
const sslConfig = arg.includes("sslmode=require") || arg.includes("ssl=true") ? { rejectUnauthorized: false } : undefined;
|
|
9018
|
+
this.pool = new esm_default.Pool({ connectionString: arg, ssl: sslConfig });
|
|
9018
9019
|
} else {
|
|
9019
9020
|
this.pool = arg;
|
|
9020
9021
|
}
|
|
@@ -9095,7 +9096,7 @@ var CloudConfigSchema = exports_external.object({
|
|
|
9095
9096
|
password_env: exports_external.string().default("HASNA_RDS_PASSWORD"),
|
|
9096
9097
|
ssl: exports_external.boolean().default(true)
|
|
9097
9098
|
}).default({}),
|
|
9098
|
-
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("
|
|
9099
|
+
mode: exports_external.enum(["local", "cloud", "hybrid"]).default("hybrid"),
|
|
9099
9100
|
auto_sync_interval_minutes: exports_external.number().default(0),
|
|
9100
9101
|
feedback_endpoint: exports_external.string().default("https://feedback.hasna.com/api/v1/feedback"),
|
|
9101
9102
|
sync: exports_external.object({
|
|
@@ -9121,7 +9122,10 @@ function getConnectionString(dbName) {
|
|
|
9121
9122
|
if (!host || !username) {
|
|
9122
9123
|
throw new Error("Cloud RDS not configured. Run `cloud setup` to configure.");
|
|
9123
9124
|
}
|
|
9124
|
-
const password = process.env[password_env]
|
|
9125
|
+
const password = process.env[password_env];
|
|
9126
|
+
if (password === undefined || password === "") {
|
|
9127
|
+
throw new Error(`RDS password not set. Export ${password_env} in your shell or add it to ~/.secrets/hasna/rds/live.env`);
|
|
9128
|
+
}
|
|
9125
9129
|
const sslParam = ssl ? "?sslmode=require" : "";
|
|
9126
9130
|
return `postgres://${username}:${encodeURIComponent(password)}@${host}:${port}/${dbName}${sslParam}`;
|
|
9127
9131
|
}
|
package/package.json
CHANGED