@hasna/contacts 0.6.36 → 0.7.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 +53 -69
- package/dist/cli/commands/advanced.d.ts.map +1 -1
- package/dist/cli/commands/core.d.ts +1 -1
- package/dist/cli/commands/core.d.ts.map +1 -1
- package/dist/cli/commands/crm.d.ts.map +1 -1
- package/dist/cli/index.js +9158 -39958
- package/dist/cli/legacy.d.ts +18 -0
- package/dist/cli/legacy.d.ts.map +1 -0
- package/dist/cli/status-domain.preload.d.ts +2 -0
- package/dist/cli/status-domain.preload.d.ts.map +1 -0
- package/dist/cli/storage.d.ts.map +1 -1
- package/dist/cloud/client-config.d.ts +6 -0
- package/dist/cloud/client-config.d.ts.map +1 -0
- package/dist/cloud/http-storage.d.ts +40 -69
- package/dist/cloud/http-storage.d.ts.map +1 -1
- package/dist/db/paths.d.ts +13 -7
- package/dist/db/paths.d.ts.map +1 -1
- package/dist/generated/storage-kit/index.d.ts +0 -1
- package/dist/generated/storage-kit/index.d.ts.map +1 -1
- package/dist/generated/storage-kit/pool.d.ts +13 -3
- package/dist/generated/storage-kit/pool.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +373 -5713
- package/dist/lib/images.d.ts.map +1 -1
- package/dist/mcp/handlers/advanced.d.ts.map +1 -1
- package/dist/mcp/handlers/core.d.ts +1 -1
- package/dist/mcp/index.js +461 -5901
- package/dist/mcp/storage-tools.d.ts.map +1 -1
- package/dist/sdk/index.d.ts +15 -13
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +44 -1
- package/dist/server/cloud.d.ts +6 -7
- package/dist/server/cloud.d.ts.map +1 -1
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +3744 -35305
- package/dist/server/security.d.ts +1 -1
- package/dist/server/security.d.ts.map +1 -1
- package/dist/server/serve.d.ts.map +1 -1
- package/dist/store/index.d.ts +66 -93
- package/dist/store/index.d.ts.map +1 -1
- package/dist/types/store-dto.d.ts +273 -0
- package/dist/types/store-dto.d.ts.map +1 -0
- package/hasna.contract.json +63 -10
- package/package.json +23 -14
- package/dashboard/dist/assets/index-0l6aQb1t.css +0 -1
- package/dashboard/dist/assets/index-opnZdkVD.js +0 -229
- package/dashboard/dist/index.html +0 -13
- package/dist/generated/storage-kit/mode.d.ts +0 -48
- package/dist/generated/storage-kit/mode.d.ts.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
interface LegacyCandidate {
|
|
3
|
+
path: string;
|
|
4
|
+
exists: boolean;
|
|
5
|
+
size: number | null;
|
|
6
|
+
modified_at: string | null;
|
|
7
|
+
wal_present: boolean;
|
|
8
|
+
source: "xdg" | "legacy-hasna" | "ancient";
|
|
9
|
+
}
|
|
10
|
+
export declare function legacyDatabaseCandidates(env?: NodeJS.ProcessEnv): LegacyCandidate[];
|
|
11
|
+
export declare function preserveLegacyDatabase(sourceArg: string | undefined, outputArg: string): {
|
|
12
|
+
source: string;
|
|
13
|
+
output: string;
|
|
14
|
+
bytes: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function registerLegacyCommands(program: Command): void;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=legacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../../src/cli/legacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,KAAK,GAAG,cAAc,GAAG,SAAS,CAAC;CAC5C;AAMD,wBAAgB,wBAAwB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,eAAe,EAAE,CAmBhG;AAqCD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAqF1I;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqC7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-domain.preload.d.ts","sourceRoot":"","sources":["../../src/cli/status-domain.preload.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,aAAa,cAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/cli/storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/cli/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmB9D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type Env = Record<string, string | undefined>;
|
|
2
|
+
/** A private change detector spanning every source the shared resolver may consult. */
|
|
3
|
+
export declare function clientConfigurationStamp(env: Env): string;
|
|
4
|
+
export declare function assertConfigurationUnchanged(env: Env, expected: string): void;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=client-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-config.d.ts","sourceRoot":"","sources":["../../src/cloud/client-config.ts"],"names":[],"mappings":"AAKA,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAwC9C,uFAAuF;AACvF,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CA2BzD;AAED,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAE7E"}
|
|
@@ -1,88 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical contacts client transport.
|
|
3
|
+
*
|
|
4
|
+
* Public clients have exactly one data path: an authenticated HTTPS `/v1`
|
|
5
|
+
* authority. The server URL is always explicit; this module never composes or
|
|
6
|
+
* guesses a hosted URL. API-key resolution and per-request rotation are owned
|
|
7
|
+
* by `@hasna/contracts/client`, so key material is never exposed by status
|
|
8
|
+
* objects or cached in this package.
|
|
9
|
+
*
|
|
10
|
+
* SQLite, PostgreSQL DSNs, and storage/deployment modes are not client
|
|
11
|
+
* transports. A stale selector is a configuration error, not a reason to read
|
|
12
|
+
* a different data set.
|
|
13
|
+
*/
|
|
14
|
+
import { type ClientTransportResolution as SharedClientTransportResolution, type HasnaHttpTransport, type HasnaRequestOptions, type QueryParams } from "@hasna/contracts/client";
|
|
1
15
|
export type Env = Record<string, string | undefined>;
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
export
|
|
16
|
+
export type { QueryParams };
|
|
17
|
+
export declare const RETIRED_CLIENT_SELECTOR_KEYS: readonly ["HASNA_CONTACTS_STORAGE_MODE", "CONTACTS_STORAGE_MODE", "HASNA_CONTACTS_MODE", "CONTACTS_MODE", "HASNA_CONTACTS_DB_PATH", "CONTACTS_DB_PATH", "HASNA_CONTACTS_DATABASE_URL", "CONTACTS_DATABASE_URL"];
|
|
18
|
+
export declare class ContactsClientConfigurationError extends Error {
|
|
19
|
+
readonly code: string;
|
|
20
|
+
constructor(code: string, message: string);
|
|
21
|
+
}
|
|
5
22
|
export interface ClientTransportResolution {
|
|
6
|
-
transport:
|
|
7
|
-
mode: "local" | "cloud";
|
|
8
|
-
modeSource: string;
|
|
23
|
+
transport: "https" | "unconfigured";
|
|
9
24
|
baseUrl: string | null;
|
|
25
|
+
apiUrlSource: string | null;
|
|
10
26
|
apiKeyPresent: boolean;
|
|
11
27
|
apiKeySource: string | null;
|
|
28
|
+
apiKeyTier: SharedClientTransportResolution["apiKeyTier"];
|
|
29
|
+
configured: boolean;
|
|
12
30
|
misconfigured: boolean;
|
|
31
|
+
issue: string | null;
|
|
13
32
|
warning: string | null;
|
|
14
33
|
}
|
|
15
34
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* If cloud is requested but the key is missing/invalid, returns local with
|
|
19
|
-
* `misconfigured: true` so callers can hard-fail instead of drifting.
|
|
35
|
+
* Resolve value-free connection diagnostics. This function does not invent a
|
|
36
|
+
* default authority and never reports a local transport as usable.
|
|
20
37
|
*/
|
|
21
|
-
export declare function
|
|
22
|
-
/** Thrown when a cloud HTTP request returns a non-2xx status. */
|
|
23
|
-
export declare class HasnaHttpError extends Error {
|
|
24
|
-
readonly status: number;
|
|
25
|
-
readonly method: string;
|
|
26
|
-
readonly path: string;
|
|
27
|
-
readonly body: unknown;
|
|
28
|
-
constructor(method: string, path: string, status: number, body: unknown);
|
|
29
|
-
}
|
|
30
|
-
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
31
|
-
export type QueryParams = Record<string, string | number | boolean | null | undefined>;
|
|
32
|
-
export interface RequestOptions {
|
|
33
|
-
query?: QueryParams;
|
|
34
|
-
idempotencyKey?: string;
|
|
35
|
-
timeoutMs?: number;
|
|
36
|
-
headers?: Record<string, string>;
|
|
37
|
-
signal?: AbortSignal;
|
|
38
|
-
retries?: number;
|
|
39
|
-
}
|
|
40
|
-
export interface HttpTransport {
|
|
41
|
-
readonly baseUrl: string;
|
|
42
|
-
request<T = unknown>(method: string, path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
43
|
-
get<T = unknown>(path: string, opts?: RequestOptions): Promise<T>;
|
|
44
|
-
post<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
45
|
-
put<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
46
|
-
patch<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
47
|
-
del<T = unknown>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
48
|
-
}
|
|
49
|
-
interface TransportOptions {
|
|
50
|
-
name: string;
|
|
51
|
-
baseUrl: string;
|
|
52
|
-
apiKey: string;
|
|
53
|
-
fetchImpl?: FetchLike;
|
|
54
|
-
timeoutMs?: number;
|
|
55
|
-
retries?: number;
|
|
56
|
-
}
|
|
57
|
-
export declare function createHttpTransport(options: TransportOptions): HttpTransport;
|
|
38
|
+
export declare function resolveContactsClientTransport(name: string, env?: Env): ClientTransportResolution;
|
|
58
39
|
export interface StorageClient {
|
|
59
40
|
readonly name: string;
|
|
60
41
|
readonly baseUrl: string;
|
|
61
|
-
readonly transport:
|
|
62
|
-
list<T = unknown>(resource: string, opts?:
|
|
63
|
-
get<T = unknown>(resource: string, id: string, opts?:
|
|
64
|
-
create<T = unknown>(resource: string, body: unknown, opts?:
|
|
65
|
-
update<T = unknown>(resource: string, id: string, patch: unknown, opts?:
|
|
42
|
+
readonly transport: HasnaHttpTransport;
|
|
43
|
+
list<T = unknown>(resource: string, opts?: HasnaRequestOptions): Promise<T>;
|
|
44
|
+
get<T = unknown>(resource: string, id: string, opts?: HasnaRequestOptions): Promise<T | null>;
|
|
45
|
+
create<T = unknown>(resource: string, body: unknown, opts?: HasnaRequestOptions): Promise<T>;
|
|
46
|
+
update<T = unknown>(resource: string, id: string, patch: unknown, opts?: HasnaRequestOptions & {
|
|
66
47
|
method?: "PATCH" | "PUT";
|
|
67
48
|
}): Promise<T>;
|
|
68
|
-
delete<T = unknown>(resource: string, id: string, opts?:
|
|
49
|
+
delete<T = unknown>(resource: string, id: string, opts?: HasnaRequestOptions): Promise<T | undefined>;
|
|
69
50
|
}
|
|
70
|
-
export declare function createStorageClient(name: string, transport:
|
|
71
|
-
export
|
|
72
|
-
transport: "
|
|
73
|
-
client: null;
|
|
74
|
-
resolution: ClientTransportResolution;
|
|
75
|
-
} | {
|
|
76
|
-
transport: "cloud-http";
|
|
51
|
+
export declare function createStorageClient(name: string, transport: HasnaHttpTransport): StorageClient;
|
|
52
|
+
export interface ResolveStorageClientResult {
|
|
53
|
+
transport: "https";
|
|
77
54
|
client: StorageClient;
|
|
78
55
|
resolution: ClientTransportResolution;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
* `name`; returns a ready cloud client when self_hosted + API key are set, else
|
|
83
|
-
* `{ transport: 'local', client: null }`. Throws if cloud was requested but is
|
|
84
|
-
* misconfigured (so callers never silently read the wrong dataset).
|
|
85
|
-
*/
|
|
86
|
-
export declare function resolveStorageClient(name: string, env?: Env): ResolveStorageClientResult;
|
|
87
|
-
export {};
|
|
56
|
+
}
|
|
57
|
+
/** Build the sole contacts client. Any incomplete configuration is terminal. */
|
|
58
|
+
export declare function resolveContactsStorageClient(name: string, env?: Env): ResolveStorageClientResult;
|
|
88
59
|
//# sourceMappingURL=http-storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-storage.d.ts","sourceRoot":"","sources":["../../src/cloud/http-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-storage.d.ts","sourceRoot":"","sources":["../../src/cloud/http-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAIL,KAAK,yBAAyB,IAAI,+BAA+B,EACjE,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,eAAO,MAAM,4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AAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7F,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG;QAAE,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACzI,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;CACvG;AAqBD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,GAAG,aAAa,CAgC9F;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,yBAAyB,CAAC;CACvC;AAED,gFAAgF;AAChF,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,GAAiB,GAAG,0BAA0B,CA6C7G"}
|
package/dist/db/paths.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
export type PathKind = "config" | "data" | "state" | "cache";
|
|
2
|
+
export interface PathsResolverOptions {
|
|
3
|
+
app: string;
|
|
4
|
+
internal?: boolean;
|
|
5
|
+
platform?: string;
|
|
6
|
+
home?: string;
|
|
7
|
+
env?: Record<string, string | undefined>;
|
|
8
|
+
}
|
|
9
|
+
export declare function dataDir(options: PathsResolverOptions): string;
|
|
10
|
+
export declare function stateDir(options: PathsResolverOptions): string;
|
|
1
11
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
4
|
-
* `~/.hasna/contacts` (and the older `~/.contacts`) store into it once.
|
|
12
|
+
* The @hasna/paths data root for retained server/legacy utilities. It creates
|
|
13
|
+
* only the requested target directory and never scans or adopts older homes.
|
|
5
14
|
*/
|
|
6
15
|
export declare function getDataDir(): string;
|
|
7
16
|
/**
|
|
8
|
-
* The
|
|
9
|
-
* $HASNA_STATE_HOME/contacts) — the home of the vault session state file.
|
|
10
|
-
* Adopts a legacy `~/.hasna/contacts/.vault-session` once, gated on the state
|
|
11
|
-
* target holding no session yet.
|
|
17
|
+
* The @hasna/paths state root for retained server/legacy utilities.
|
|
12
18
|
*/
|
|
13
19
|
export declare function getStateDir(): string;
|
|
14
20
|
export declare function getDbPath(): string;
|
package/dist/db/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/db/paths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/db/paths.ts"],"names":[],"mappings":"AAwBA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAS7D,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AA0DD,wBAAgB,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAE7D;AACD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAE9D;AAWD;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAKnC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAKpC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAIlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/index.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { Pool } from "pg";
|
|
2
2
|
import { type TlsResolveOptions } from "./tls.js";
|
|
3
3
|
import { type PoolQueryClient } from "./query.js";
|
|
4
|
+
type KitEnv = Record<string, string | undefined>;
|
|
5
|
+
/** Throw when a retired storage-mode variable is set for an app. Safe to call
|
|
6
|
+
* from any server backend resolver: a no-op when no legacy key is set. */
|
|
7
|
+
export declare function assertNoRetiredStorageMode(appName: string, env?: KitEnv): void;
|
|
8
|
+
/** Resolve the Postgres DSN from the standard env aliases, never logging it. */
|
|
9
|
+
export declare function resolveDatabaseUrl(appName: string, env?: KitEnv): {
|
|
10
|
+
value: string | null;
|
|
11
|
+
source: string | null;
|
|
12
|
+
};
|
|
4
13
|
export interface CreatePgPoolOptions extends TlsResolveOptions {
|
|
5
14
|
connectionString: string;
|
|
6
15
|
/** Max clients in the pool. Defaults to pg's default (10). */
|
|
@@ -25,10 +34,11 @@ export interface CloudPoolFromEnv {
|
|
|
25
34
|
connectionSource: string;
|
|
26
35
|
}
|
|
27
36
|
/**
|
|
28
|
-
* Resolve
|
|
37
|
+
* Resolve the database URL from the environment and build a cloud pool.
|
|
29
38
|
*
|
|
30
|
-
* Throws when
|
|
31
|
-
*
|
|
39
|
+
* Throws when a retired storage-mode variable is set (deployment modes no
|
|
40
|
+
* longer exist) or when the database URL is missing. Never logs the URL.
|
|
32
41
|
*/
|
|
33
42
|
export declare function createCloudPoolFromEnv(appName: string, options?: CreateCloudPoolFromEnvOptions): CloudPoolFromEnv;
|
|
43
|
+
export {};
|
|
34
44
|
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/pool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/pool.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,IAAI,CAAC;AAC3C,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AASjD;0EAC0E;AAC1E,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,GAAE,MAAoB,GAAG,IAAI,CAY3F;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,GAAE,MAAoB,GAAG;IAC9E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAOA;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IACzB,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,0DAA0D;AAC1D,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAe/D;AAED,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,eAAe,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAkC,GAC1C,gBAAgB,CA0BlB"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,kCAAkC,EAClC,yCAAyC,EACzC,qCAAqC,EACrC,sCAAsC,EACtC,gCAAgC,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qCAAqC,EAAE,MAAM,gCAAgC,CAAC;AAGvF,YAAY,EAEV,SAAS,EACT,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,UAAU,EACV,uBAAuB,EACvB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,SAAS,EAET,KAAK,EACL,KAAK,EACL,OAAO,EACP,aAAa,EAEb,GAAG,EACH,OAAO,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