@struktoai/mirage-node 0.0.1-alpha.1
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 +230 -0
- package/dist/box-4P7DCJH7.js +8 -0
- package/dist/box-4P7DCJH7.js.map +1 -0
- package/dist/chunk-35PVZRWU.js +24 -0
- package/dist/chunk-35PVZRWU.js.map +1 -0
- package/dist/chunk-3PBSL7BS.js +93 -0
- package/dist/chunk-3PBSL7BS.js.map +1 -0
- package/dist/chunk-3Y625AUP.js +24 -0
- package/dist/chunk-3Y625AUP.js.map +1 -0
- package/dist/chunk-5E6BULAK.js +92 -0
- package/dist/chunk-5E6BULAK.js.map +1 -0
- package/dist/chunk-5ITBZN55.js +24 -0
- package/dist/chunk-5ITBZN55.js.map +1 -0
- package/dist/chunk-6M2NL363.js +94 -0
- package/dist/chunk-6M2NL363.js.map +1 -0
- package/dist/chunk-6M3QVVOH.js +32 -0
- package/dist/chunk-6M3QVVOH.js.map +1 -0
- package/dist/chunk-6VKNSO6U.js +56 -0
- package/dist/chunk-6VKNSO6U.js.map +1 -0
- package/dist/chunk-6Y6GWMFF.js +24 -0
- package/dist/chunk-6Y6GWMFF.js.map +1 -0
- package/dist/chunk-7QXJ4KWQ.js +132 -0
- package/dist/chunk-7QXJ4KWQ.js.map +1 -0
- package/dist/chunk-ALAMUIGJ.js +57 -0
- package/dist/chunk-ALAMUIGJ.js.map +1 -0
- package/dist/chunk-DCJQ2PIX.js +100 -0
- package/dist/chunk-DCJQ2PIX.js.map +1 -0
- package/dist/chunk-EKPH4MMD.js +27 -0
- package/dist/chunk-EKPH4MMD.js.map +1 -0
- package/dist/chunk-FZ2GJ4BJ.js +29 -0
- package/dist/chunk-FZ2GJ4BJ.js.map +1 -0
- package/dist/chunk-G7O6DAWU.js +178 -0
- package/dist/chunk-G7O6DAWU.js.map +1 -0
- package/dist/chunk-GCB4JUF7.js +94 -0
- package/dist/chunk-GCB4JUF7.js.map +1 -0
- package/dist/chunk-GKQNMLQU.js +7757 -0
- package/dist/chunk-GKQNMLQU.js.map +1 -0
- package/dist/chunk-GO67AOYK.js +24 -0
- package/dist/chunk-GO67AOYK.js.map +1 -0
- package/dist/chunk-GPF66TH2.js +24 -0
- package/dist/chunk-GPF66TH2.js.map +1 -0
- package/dist/chunk-H3JR7MN3.js +45 -0
- package/dist/chunk-H3JR7MN3.js.map +1 -0
- package/dist/chunk-H74QYTN7.js +50 -0
- package/dist/chunk-H74QYTN7.js.map +1 -0
- package/dist/chunk-HEQL3LPK.js +66 -0
- package/dist/chunk-HEQL3LPK.js.map +1 -0
- package/dist/chunk-HXWGG4K7.js +66 -0
- package/dist/chunk-HXWGG4K7.js.map +1 -0
- package/dist/chunk-I4RRGZGB.js +24 -0
- package/dist/chunk-I4RRGZGB.js.map +1 -0
- package/dist/chunk-ICSS5ETT.js +67 -0
- package/dist/chunk-ICSS5ETT.js.map +1 -0
- package/dist/chunk-KINMBZHC.js +18 -0
- package/dist/chunk-KINMBZHC.js.map +1 -0
- package/dist/chunk-LBBM3LKK.js +99 -0
- package/dist/chunk-LBBM3LKK.js.map +1 -0
- package/dist/chunk-LPMPTQYP.js +36 -0
- package/dist/chunk-LPMPTQYP.js.map +1 -0
- package/dist/chunk-M42JTWPR.js +2794 -0
- package/dist/chunk-M42JTWPR.js.map +1 -0
- package/dist/chunk-MVE5VVMQ.js +91 -0
- package/dist/chunk-MVE5VVMQ.js.map +1 -0
- package/dist/chunk-MY3NUJJD.js +67 -0
- package/dist/chunk-MY3NUJJD.js.map +1 -0
- package/dist/chunk-NOZZFJEB.js +93 -0
- package/dist/chunk-NOZZFJEB.js.map +1 -0
- package/dist/chunk-OYJXYJTE.js +2358 -0
- package/dist/chunk-OYJXYJTE.js.map +1 -0
- package/dist/chunk-PEZYBKZH.js +124 -0
- package/dist/chunk-PEZYBKZH.js.map +1 -0
- package/dist/chunk-QWWOBAYU.js +26 -0
- package/dist/chunk-QWWOBAYU.js.map +1 -0
- package/dist/chunk-RQYYYBQG.js +24 -0
- package/dist/chunk-RQYYYBQG.js.map +1 -0
- package/dist/chunk-T2WWAEKH.js +7591 -0
- package/dist/chunk-T2WWAEKH.js.map +1 -0
- package/dist/chunk-U6QSXTUS.js +7 -0
- package/dist/chunk-U6QSXTUS.js.map +1 -0
- package/dist/chunk-UWMOTOXA.js +93 -0
- package/dist/chunk-UWMOTOXA.js.map +1 -0
- package/dist/chunk-UZZD4MRJ.js +95 -0
- package/dist/chunk-UZZD4MRJ.js.map +1 -0
- package/dist/chunk-V5OLWE7F.js +88 -0
- package/dist/chunk-V5OLWE7F.js.map +1 -0
- package/dist/chunk-VCLMTMSO.js +23 -0
- package/dist/chunk-VCLMTMSO.js.map +1 -0
- package/dist/chunk-WSDQ2MRG.js +102 -0
- package/dist/chunk-WSDQ2MRG.js.map +1 -0
- package/dist/chunk-XDEEOTVK.js +93 -0
- package/dist/chunk-XDEEOTVK.js.map +1 -0
- package/dist/chunk-XQUQSNCA.js +117 -0
- package/dist/chunk-XQUQSNCA.js.map +1 -0
- package/dist/chunk-XVYZO2FG.js +14 -0
- package/dist/chunk-XVYZO2FG.js.map +1 -0
- package/dist/chunk-ZC4KNEOQ.js +50 -0
- package/dist/chunk-ZC4KNEOQ.js.map +1 -0
- package/dist/config-5ZPGISS6.js +13 -0
- package/dist/config-5ZPGISS6.js.map +1 -0
- package/dist/config-6HWSKHEU.js +9 -0
- package/dist/config-6HWSKHEU.js.map +1 -0
- package/dist/config-6TNFPYZF.js +9 -0
- package/dist/config-6TNFPYZF.js.map +1 -0
- package/dist/config-BHLXQ3OL.js +9 -0
- package/dist/config-BHLXQ3OL.js.map +1 -0
- package/dist/config-E7UOEWEP.js +9 -0
- package/dist/config-E7UOEWEP.js.map +1 -0
- package/dist/config-FNR6LJ5H.js +11 -0
- package/dist/config-FNR6LJ5H.js.map +1 -0
- package/dist/config-HIZHA5VD.js +13 -0
- package/dist/config-HIZHA5VD.js.map +1 -0
- package/dist/config-HNSDNQZH.js +9 -0
- package/dist/config-HNSDNQZH.js.map +1 -0
- package/dist/config-IXLFUSMQ.js +9 -0
- package/dist/config-IXLFUSMQ.js.map +1 -0
- package/dist/config-J3TM7NIS.js +9 -0
- package/dist/config-J3TM7NIS.js.map +1 -0
- package/dist/config-JXLZ4XEW.js +9 -0
- package/dist/config-JXLZ4XEW.js.map +1 -0
- package/dist/config-KQCEMLNZ.js +9 -0
- package/dist/config-KQCEMLNZ.js.map +1 -0
- package/dist/config-MOLWOSRG.js +9 -0
- package/dist/config-MOLWOSRG.js.map +1 -0
- package/dist/config-R3XJ5OW4.js +9 -0
- package/dist/config-R3XJ5OW4.js.map +1 -0
- package/dist/config-S47UDVRZ.js +13 -0
- package/dist/config-S47UDVRZ.js.map +1 -0
- package/dist/config-UKZ72IDO.js +13 -0
- package/dist/config-UKZ72IDO.js.map +1 -0
- package/dist/config-V7XI5UTG.js +9 -0
- package/dist/config-V7XI5UTG.js.map +1 -0
- package/dist/config-YLIX3ZBT.js +9 -0
- package/dist/config-YLIX3ZBT.js.map +1 -0
- package/dist/config-Z5JGDOKE.js +9 -0
- package/dist/config-Z5JGDOKE.js.map +1 -0
- package/dist/config-ZCZZAH5W.js +9 -0
- package/dist/config-ZCZZAH5W.js.map +1 -0
- package/dist/config-ZZGIWDUC.js +9 -0
- package/dist/config-ZZGIWDUC.js.map +1 -0
- package/dist/discord-2PWP2MGX.js +8 -0
- package/dist/discord-2PWP2MGX.js.map +1 -0
- package/dist/disk-C7TJNU2B.js +8 -0
- package/dist/disk-C7TJNU2B.js.map +1 -0
- package/dist/dropbox-L5DPYGKR.js +8 -0
- package/dist/dropbox-L5DPYGKR.js.map +1 -0
- package/dist/email-HASRFBKC.js +8 -0
- package/dist/email-HASRFBKC.js.map +1 -0
- package/dist/gcs-P5QMKTPR.js +10 -0
- package/dist/gcs-P5QMKTPR.js.map +1 -0
- package/dist/gdocs-IF2I35HZ.js +8 -0
- package/dist/gdocs-IF2I35HZ.js.map +1 -0
- package/dist/gdrive-TAETVCKP.js +8 -0
- package/dist/gdrive-TAETVCKP.js.map +1 -0
- package/dist/github-5E6GSCNZ.js +8 -0
- package/dist/github-5E6GSCNZ.js.map +1 -0
- package/dist/github_ci-2DSZI3Y7.js +8 -0
- package/dist/github_ci-2DSZI3Y7.js.map +1 -0
- package/dist/gmail-F5VYGKOT.js +8 -0
- package/dist/gmail-F5VYGKOT.js.map +1 -0
- package/dist/gsheets-BAO54CQ7.js +8 -0
- package/dist/gsheets-BAO54CQ7.js.map +1 -0
- package/dist/gslides-A62CEEMR.js +8 -0
- package/dist/gslides-A62CEEMR.js.map +1 -0
- package/dist/index.d.ts +1671 -0
- package/dist/index.js +3564 -0
- package/dist/index.js.map +1 -0
- package/dist/langfuse-YKBYRQLU.js +8 -0
- package/dist/langfuse-YKBYRQLU.js.map +1 -0
- package/dist/linear-WJDQ6JDE.js +8 -0
- package/dist/linear-WJDQ6JDE.js.map +1 -0
- package/dist/mongodb-MK4DVSIK.js +7 -0
- package/dist/mongodb-MK4DVSIK.js.map +1 -0
- package/dist/oci-KZ7XFZ2X.js +10 -0
- package/dist/oci-KZ7XFZ2X.js.map +1 -0
- package/dist/postgres-M2N2APFZ.js +7 -0
- package/dist/postgres-M2N2APFZ.js.map +1 -0
- package/dist/r2-X4DDNSAZ.js +10 -0
- package/dist/r2-X4DDNSAZ.js.map +1 -0
- package/dist/redis-NVCXUUIO.js +7 -0
- package/dist/redis-NVCXUUIO.js.map +1 -0
- package/dist/s3-HVAL7ZX3.js +8 -0
- package/dist/s3-HVAL7ZX3.js.map +1 -0
- package/dist/slack-GUQMDGLP.js +8 -0
- package/dist/slack-GUQMDGLP.js.map +1 -0
- package/dist/ssh-LY6WYVVD.js +9 -0
- package/dist/ssh-LY6WYVVD.js.map +1 -0
- package/dist/supabase-H3ZP4Y3W.js +10 -0
- package/dist/supabase-H3ZP4Y3W.js.map +1 -0
- package/dist/trello-WR6TEDYD.js +8 -0
- package/dist/trello-WR6TEDYD.js.map +1 -0
- package/package.json +118 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// src/resource/postgres/postgres.ts
|
|
2
|
+
import {
|
|
3
|
+
PathSpec,
|
|
4
|
+
POSTGRES_COMMANDS,
|
|
5
|
+
POSTGRES_OPS,
|
|
6
|
+
POSTGRES_PROMPT,
|
|
7
|
+
PostgresAccessor,
|
|
8
|
+
postgresRead,
|
|
9
|
+
postgresReaddir,
|
|
10
|
+
postgresStat,
|
|
11
|
+
RAMIndexCacheStore,
|
|
12
|
+
ResourceName,
|
|
13
|
+
resolvePostgresConfig,
|
|
14
|
+
resolvePostgresGlob
|
|
15
|
+
} from "@struktoai/mirage-core";
|
|
16
|
+
|
|
17
|
+
// src/resource/postgres/store.ts
|
|
18
|
+
import { loadOptionalPeer } from "@struktoai/mirage-core";
|
|
19
|
+
var PostgresStore = class {
|
|
20
|
+
config;
|
|
21
|
+
poolPromise = null;
|
|
22
|
+
constructor(config) {
|
|
23
|
+
this.config = config;
|
|
24
|
+
}
|
|
25
|
+
async query(sql, params) {
|
|
26
|
+
const pool = await this._pool();
|
|
27
|
+
const result = await pool.query(sql, params);
|
|
28
|
+
return { rows: result.rows, rowCount: result.rowCount ?? 0 };
|
|
29
|
+
}
|
|
30
|
+
async databaseName() {
|
|
31
|
+
const result = await this.query("SELECT current_database() AS db");
|
|
32
|
+
return result.rows[0]?.db ?? "";
|
|
33
|
+
}
|
|
34
|
+
async close() {
|
|
35
|
+
if (this.poolPromise === null) return;
|
|
36
|
+
const pool = await this.poolPromise;
|
|
37
|
+
this.poolPromise = null;
|
|
38
|
+
await pool.end();
|
|
39
|
+
}
|
|
40
|
+
async _pool() {
|
|
41
|
+
this.poolPromise ??= this._connect();
|
|
42
|
+
return this.poolPromise;
|
|
43
|
+
}
|
|
44
|
+
async _connect() {
|
|
45
|
+
const mod = await loadOptionalPeer(
|
|
46
|
+
() => import("pg"),
|
|
47
|
+
{ feature: "PostgresResource", packageName: "pg" }
|
|
48
|
+
);
|
|
49
|
+
const Pool = mod.default?.Pool ?? mod.Pool;
|
|
50
|
+
if (Pool === void 0) {
|
|
51
|
+
throw new Error("postgres: pg package missing Pool export");
|
|
52
|
+
}
|
|
53
|
+
return new Pool({
|
|
54
|
+
connectionString: this.config.dsn,
|
|
55
|
+
options: "-c default_transaction_read_only=on"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// src/resource/postgres/postgres.ts
|
|
61
|
+
var PostgresResource = class {
|
|
62
|
+
kind = ResourceName.POSTGRES;
|
|
63
|
+
isRemote = true;
|
|
64
|
+
indexTtl = 0;
|
|
65
|
+
prompt;
|
|
66
|
+
config;
|
|
67
|
+
store;
|
|
68
|
+
accessor;
|
|
69
|
+
index;
|
|
70
|
+
constructor(options) {
|
|
71
|
+
const { config, prefix } = "config" in options ? options : { config: options, prefix: void 0 };
|
|
72
|
+
this.config = resolvePostgresConfig(config);
|
|
73
|
+
this.store = new PostgresStore(this.config);
|
|
74
|
+
this.accessor = new PostgresAccessor(this.store, this.config);
|
|
75
|
+
this.index = new RAMIndexCacheStore({ ttl: this.indexTtl });
|
|
76
|
+
this.prompt = POSTGRES_PROMPT.replace("{prefix}", prefix ?? "");
|
|
77
|
+
}
|
|
78
|
+
open() {
|
|
79
|
+
return Promise.resolve();
|
|
80
|
+
}
|
|
81
|
+
async close() {
|
|
82
|
+
await this.store.close();
|
|
83
|
+
}
|
|
84
|
+
ops() {
|
|
85
|
+
return POSTGRES_OPS;
|
|
86
|
+
}
|
|
87
|
+
commands() {
|
|
88
|
+
return POSTGRES_COMMANDS;
|
|
89
|
+
}
|
|
90
|
+
readFile(p) {
|
|
91
|
+
return postgresRead(this.accessor, p, this.index);
|
|
92
|
+
}
|
|
93
|
+
readdir(p) {
|
|
94
|
+
return postgresReaddir(this.accessor, p, this.index);
|
|
95
|
+
}
|
|
96
|
+
stat(p) {
|
|
97
|
+
return postgresStat(this.accessor, p, this.index);
|
|
98
|
+
}
|
|
99
|
+
glob(paths, prefix = "") {
|
|
100
|
+
const effective = prefix !== "" ? paths.map(
|
|
101
|
+
(p) => p.prefix !== "" ? p : new PathSpec({
|
|
102
|
+
original: p.original,
|
|
103
|
+
directory: p.directory,
|
|
104
|
+
...p.pattern !== null ? { pattern: p.pattern } : {},
|
|
105
|
+
resolved: p.resolved,
|
|
106
|
+
prefix
|
|
107
|
+
})
|
|
108
|
+
) : paths;
|
|
109
|
+
return resolvePostgresGlob(this.accessor, effective, this.index);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export {
|
|
114
|
+
PostgresStore,
|
|
115
|
+
PostgresResource
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=chunk-XQUQSNCA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/postgres/postgres.ts","../src/resource/postgres/store.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n type FileStat,\n type IndexCacheStore,\n PathSpec,\n POSTGRES_COMMANDS,\n POSTGRES_OPS,\n POSTGRES_PROMPT,\n PostgresAccessor,\n type PostgresConfig,\n type PostgresConfigResolved,\n postgresRead,\n postgresReaddir,\n postgresStat,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolvePostgresConfig,\n resolvePostgresGlob,\n} from '@struktoai/mirage-core'\nimport { PostgresStore } from './store.ts'\n\nexport interface PostgresResourceOptions {\n config: PostgresConfig\n prefix?: string\n}\n\nexport class PostgresResource implements Resource {\n readonly kind: string = ResourceName.POSTGRES\n readonly isRemote: boolean = true\n readonly indexTtl: number = 0\n readonly prompt: string\n readonly config: PostgresConfigResolved\n readonly store: PostgresStore\n readonly accessor: PostgresAccessor\n readonly index: IndexCacheStore\n\n constructor(options: PostgresResourceOptions | PostgresConfig) {\n const { config, prefix } =\n 'config' in options ? options : { config: options, prefix: undefined }\n this.config = resolvePostgresConfig(config)\n this.store = new PostgresStore(this.config)\n this.accessor = new PostgresAccessor(this.store, this.config)\n this.index = new RAMIndexCacheStore({ ttl: this.indexTtl })\n this.prompt = POSTGRES_PROMPT.replace('{prefix}', prefix ?? '')\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n async close(): Promise<void> {\n await this.store.close()\n }\n\n ops(): readonly RegisteredOp[] {\n return POSTGRES_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return POSTGRES_COMMANDS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return postgresRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return postgresReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return postgresStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolvePostgresGlob(this.accessor, effective, this.index)\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { loadOptionalPeer, type PgDriver, type PgQueryResult } from '@struktoai/mirage-core'\nimport type { PostgresConfigResolved } from '@struktoai/mirage-core'\n\ninterface PgPoolLike {\n query: (\n sql: string,\n params?: readonly unknown[],\n ) => Promise<{ rows: unknown[]; rowCount: number | null }>\n end: () => Promise<void>\n}\n\ninterface PgModule {\n Pool: new (options: Record<string, unknown>) => PgPoolLike\n}\n\nexport class PostgresStore implements PgDriver {\n readonly config: PostgresConfigResolved\n private poolPromise: Promise<PgPoolLike> | null = null\n\n constructor(config: PostgresConfigResolved) {\n this.config = config\n }\n\n async query<R = Record<string, unknown>>(\n sql: string,\n params?: readonly unknown[],\n ): Promise<PgQueryResult<R>> {\n const pool = await this._pool()\n const result = await pool.query(sql, params)\n return { rows: result.rows as R[], rowCount: result.rowCount ?? 0 }\n }\n\n async databaseName(): Promise<string> {\n const result = await this.query<{ db: string }>('SELECT current_database() AS db')\n return result.rows[0]?.db ?? ''\n }\n\n async close(): Promise<void> {\n if (this.poolPromise === null) return\n const pool = await this.poolPromise\n this.poolPromise = null\n await pool.end()\n }\n\n private async _pool(): Promise<PgPoolLike> {\n this.poolPromise ??= this._connect()\n return this.poolPromise\n }\n\n protected async _connect(): Promise<PgPoolLike> {\n const mod = await loadOptionalPeer(\n () => import('pg') as unknown as Promise<{ default?: PgModule } & Partial<PgModule>>,\n { feature: 'PostgresResource', packageName: 'pg' },\n )\n const Pool = mod.default?.Pool ?? mod.Pool\n if (Pool === undefined) {\n throw new Error('postgres: pg package missing Pool export')\n }\n return new Pool({\n connectionString: this.config.dsn,\n options: '-c default_transaction_read_only=on',\n })\n }\n}\n"],"mappings":";AAcA;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EAC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,KAAK;AAAA,EACjE;AACF;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/resource/discord/config.ts
|
|
2
|
+
import { normalizeFields } from "@struktoai/mirage-core";
|
|
3
|
+
function redactDiscordConfig(_config) {
|
|
4
|
+
return { token: "<REDACTED>" };
|
|
5
|
+
}
|
|
6
|
+
function normalizeDiscordConfig(input) {
|
|
7
|
+
return normalizeFields(input, {});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
redactDiscordConfig,
|
|
12
|
+
normalizeDiscordConfig
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=chunk-XVYZO2FG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/discord/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields } from '@struktoai/mirage-core'\n\nexport interface DiscordConfig {\n token: string\n}\n\nexport interface DiscordConfigRedacted {\n token: '<REDACTED>'\n}\n\nexport function redactDiscordConfig(_config: DiscordConfig): DiscordConfigRedacted {\n return { token: '<REDACTED>' }\n}\n\nexport function normalizeDiscordConfig(input: Record<string, unknown>): DiscordConfig {\n return normalizeFields(input, {}) as unknown as DiscordConfig\n}\n"],"mappings":";AAcA,SAAS,uBAAuB;AAUzB,SAAS,oBAAoB,SAA+C;AACjF,SAAO,EAAE,OAAO,aAAa;AAC/B;AAEO,SAAS,uBAAuB,OAA+C;AACpF,SAAO,gBAAgB,OAAO,CAAC,CAAC;AAClC;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/resource/oci/config.ts
|
|
2
|
+
import { normalizeFields } from "@struktoai/mirage-core";
|
|
3
|
+
function resolvedOciEndpoint(config) {
|
|
4
|
+
if (config.endpoint !== void 0 && config.endpoint !== "") return config.endpoint;
|
|
5
|
+
return `https://${config.namespace}.compat.objectstorage.${config.region}.oci.customer-oci.com`;
|
|
6
|
+
}
|
|
7
|
+
function ociToS3Config(config) {
|
|
8
|
+
return {
|
|
9
|
+
bucket: config.bucket,
|
|
10
|
+
region: config.region,
|
|
11
|
+
endpoint: resolvedOciEndpoint(config),
|
|
12
|
+
accessKeyId: config.accessKeyId,
|
|
13
|
+
secretAccessKey: config.secretAccessKey,
|
|
14
|
+
forcePathStyle: true,
|
|
15
|
+
...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function redactOciConfig(config) {
|
|
19
|
+
return {
|
|
20
|
+
bucket: config.bucket,
|
|
21
|
+
namespace: config.namespace,
|
|
22
|
+
region: config.region,
|
|
23
|
+
accessKeyId: "<REDACTED>",
|
|
24
|
+
secretAccessKey: "<REDACTED>",
|
|
25
|
+
endpoint: resolvedOciEndpoint(config),
|
|
26
|
+
...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function normalizeOciConfig(input) {
|
|
30
|
+
return normalizeFields(input, {
|
|
31
|
+
rename: {
|
|
32
|
+
access_key_id: "accessKeyId",
|
|
33
|
+
secret_access_key: "secretAccessKey",
|
|
34
|
+
endpoint_url: "endpoint",
|
|
35
|
+
timeout: "timeoutMs"
|
|
36
|
+
},
|
|
37
|
+
transform: {
|
|
38
|
+
timeout: (v) => typeof v === "number" ? v * 1e3 : v
|
|
39
|
+
},
|
|
40
|
+
drop: ["proxy"]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
resolvedOciEndpoint,
|
|
46
|
+
ociToS3Config,
|
|
47
|
+
redactOciConfig,
|
|
48
|
+
normalizeOciConfig
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-ZC4KNEOQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resource/oci/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields } from '@struktoai/mirage-core'\nimport type { S3Config } from '../s3/config.ts'\n\nexport interface OCIConfig {\n bucket: string\n namespace: string\n region: string\n accessKeyId: string\n secretAccessKey: string\n endpoint?: string\n timeoutMs?: number\n}\n\nexport interface OCIConfigRedacted {\n bucket: string\n namespace: string\n region: string\n accessKeyId: string\n secretAccessKey: string\n endpoint: string\n timeoutMs?: number\n}\n\nexport function resolvedOciEndpoint(config: OCIConfig): string {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n return `https://${config.namespace}.compat.objectstorage.${config.region}.oci.customer-oci.com`\n}\n\nexport function ociToS3Config(config: OCIConfig): S3Config {\n return {\n bucket: config.bucket,\n region: config.region,\n endpoint: resolvedOciEndpoint(config),\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n forcePathStyle: true,\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function redactOciConfig(config: OCIConfig): OCIConfigRedacted {\n return {\n bucket: config.bucket,\n namespace: config.namespace,\n region: config.region,\n accessKeyId: '<REDACTED>',\n secretAccessKey: '<REDACTED>',\n endpoint: resolvedOciEndpoint(config),\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function normalizeOciConfig(input: Record<string, unknown>): OCIConfig {\n return normalizeFields(input, {\n rename: {\n access_key_id: 'accessKeyId',\n secret_access_key: 'secretAccessKey',\n endpoint_url: 'endpoint',\n timeout: 'timeoutMs',\n },\n transform: {\n timeout: (v: unknown) => (typeof v === 'number' ? v * 1000 : v),\n },\n drop: ['proxy'],\n }) as unknown as OCIConfig\n}\n"],"mappings":";AAcA,SAAS,uBAAuB;AAuBzB,SAAS,oBAAoB,QAA2B;AAC7D,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,SAAO,WAAW,OAAO,SAAS,yBAAyB,OAAO,MAAM;AAC1E;AAEO,SAAS,cAAc,QAA6B;AACzD,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,IACf,UAAU,oBAAoB,MAAM;AAAA,IACpC,aAAa,OAAO;AAAA,IACpB,iBAAiB,OAAO;AAAA,IACxB,gBAAgB;AAAA,IAChB,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,gBAAgB,QAAsC;AACpE,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,WAAW,OAAO;AAAA,IAClB,QAAQ,OAAO;AAAA,IACf,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,UAAU,oBAAoB,MAAM;AAAA,IACpC,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,mBAAmB,OAA2C;AAC5E,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,SAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,SAAS,CAAC,MAAgB,OAAO,MAAM,WAAW,IAAI,MAAO;AAAA,IAC/D;AAAA,IACA,MAAM,CAAC,OAAO;AAAA,EAChB,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeSupabaseConfig,
|
|
3
|
+
redactSupabaseConfig,
|
|
4
|
+
resolvedSupabaseEndpoint,
|
|
5
|
+
supabaseToS3Config
|
|
6
|
+
} from "./chunk-ALAMUIGJ.js";
|
|
7
|
+
export {
|
|
8
|
+
normalizeSupabaseConfig,
|
|
9
|
+
redactSupabaseConfig,
|
|
10
|
+
resolvedSupabaseEndpoint,
|
|
11
|
+
supabaseToS3Config
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=config-5ZPGISS6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeR2Config,
|
|
3
|
+
r2ToS3Config,
|
|
4
|
+
redactR2Config,
|
|
5
|
+
resolvedR2Endpoint
|
|
6
|
+
} from "./chunk-6VKNSO6U.js";
|
|
7
|
+
export {
|
|
8
|
+
normalizeR2Config,
|
|
9
|
+
r2ToS3Config,
|
|
10
|
+
redactR2Config,
|
|
11
|
+
resolvedR2Endpoint
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=config-S47UDVRZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeOciConfig,
|
|
3
|
+
ociToS3Config,
|
|
4
|
+
redactOciConfig,
|
|
5
|
+
resolvedOciEndpoint
|
|
6
|
+
} from "./chunk-ZC4KNEOQ.js";
|
|
7
|
+
export {
|
|
8
|
+
normalizeOciConfig,
|
|
9
|
+
ociToS3Config,
|
|
10
|
+
redactOciConfig,
|
|
11
|
+
resolvedOciEndpoint
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=config-UKZ72IDO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|