@major-tech/resource-client 0.2.10 → 0.2.11
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/bin/generate-clients.mjs +4 -3
- package/dist/clients/mssql.cjs +64 -0
- package/dist/clients/mssql.cjs.map +7 -0
- package/dist/clients/mssql.d.ts +29 -0
- package/dist/clients/mssql.d.ts.map +1 -0
- package/dist/clients/mssql.js +37 -0
- package/dist/clients/mssql.js.map +1 -0
- package/dist/clients/postgres.cjs +23 -0
- package/dist/clients/postgres.cjs.map +2 -2
- package/dist/clients/postgres.d.ts +24 -1
- package/dist/clients/postgres.d.ts.map +1 -1
- package/dist/clients/postgres.js +23 -0
- package/dist/clients/postgres.js.map +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.cjs +1 -0
- package/dist/schemas/index.cjs.map +2 -2
- package/dist/schemas/index.d.ts +3 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/mssql.cjs +17 -0
- package/dist/schemas/mssql.cjs.map +7 -0
- package/dist/schemas/mssql.d.ts +18 -0
- package/dist/schemas/mssql.d.ts.map +1 -0
- package/dist/schemas/mssql.js +2 -0
- package/dist/schemas/mssql.js.map +1 -0
- package/dist/schemas/postgres.d.ts +3 -3
- package/dist/schemas/postgres.d.ts.map +1 -1
- package/dist/schemas/response.d.ts +2 -2
- package/dist/schemas/response.d.ts.map +1 -1
- package/package.json +1 -1
package/bin/generate-clients.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* npx @major-tech/resource-client remove <name>
|
|
9
9
|
* npx @major-tech/resource-client list
|
|
10
10
|
*
|
|
11
|
-
* Types: database-postgresql | database-dynamodb | database-cosmosdb | database-snowflake | api-hubspot | api-googlesheets | api-custom | storage-s3
|
|
11
|
+
* Types: database-postgresql | database-mssql | database-dynamodb | database-cosmosdb | database-snowflake | api-hubspot | api-googlesheets | api-custom | storage-s3
|
|
12
12
|
*
|
|
13
13
|
* Examples:
|
|
14
14
|
* npx @major-tech/resource-client add "abc-123" "orders-db" "database-postgresql" "Orders database" "app-123"
|
|
@@ -141,6 +141,7 @@ function toCamelCase(str) {
|
|
|
141
141
|
function getClientClass(type) {
|
|
142
142
|
const typeMap = {
|
|
143
143
|
'database-postgresql': 'PostgresResourceClient',
|
|
144
|
+
'database-mssql': 'MssqlResourceClient',
|
|
144
145
|
'database-dynamodb': 'DynamoDBResourceClient',
|
|
145
146
|
'database-cosmosdb': 'CosmosDBResourceClient',
|
|
146
147
|
'database-snowflake': 'SnowflakeResourceClient',
|
|
@@ -181,7 +182,7 @@ function generateIndexFile(resources) {
|
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
function addResource(resourceId, name, type, description, applicationId, framework) {
|
|
184
|
-
const validTypes = ['database-postgresql', 'database-dynamodb', 'database-cosmosdb', 'database-snowflake', 'api-hubspot', 'api-googlesheets', 'api-custom', 'storage-s3'];
|
|
185
|
+
const validTypes = ['database-postgresql', 'database-mssql', 'database-dynamodb', 'database-cosmosdb', 'database-snowflake', 'api-hubspot', 'api-googlesheets', 'api-custom', 'storage-s3'];
|
|
185
186
|
if (!validTypes.includes(type)) {
|
|
186
187
|
console.error(`❌ Invalid type: ${type}`);
|
|
187
188
|
console.error(` Valid types: ${validTypes.join(', ')}`);
|
|
@@ -318,7 +319,7 @@ function main() {
|
|
|
318
319
|
console.log(' npx @major-tech/resource-client add <resource_id> <name> <type> <description> <application_id> [--framework <nextjs|vite>]');
|
|
319
320
|
console.log(' npx @major-tech/resource-client remove <name> [--framework <nextjs|vite>]');
|
|
320
321
|
console.log(' npx @major-tech/resource-client list');
|
|
321
|
-
console.log('\nTypes: database-postgresql | database-dynamodb | database-cosmosdb | database-snowflake | api-hubspot | api-googlesheets | api-custom | storage-s3');
|
|
322
|
+
console.log('\nTypes: database-postgresql | database-mssql | database-dynamodb | database-cosmosdb | database-snowflake | api-hubspot | api-googlesheets | api-custom | storage-s3');
|
|
322
323
|
return;
|
|
323
324
|
}
|
|
324
325
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var mssql_exports = {};
|
|
21
|
+
__export(mssql_exports, {
|
|
22
|
+
MssqlResourceClient: () => MssqlResourceClient
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(mssql_exports);
|
|
25
|
+
var import_base = require("../base");
|
|
26
|
+
class MssqlResourceClient extends import_base.BaseResourceClient {
|
|
27
|
+
static {
|
|
28
|
+
__name(this, "MssqlResourceClient");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Execute a SQL query against MSSQL
|
|
32
|
+
* @param sql The SQL query to execute
|
|
33
|
+
* @param params Optional named parameters (e.g., { id: 123 } for @id in the query)
|
|
34
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
35
|
+
* @param timeoutMs Optional timeout in milliseconds
|
|
36
|
+
* @returns Typed response with rows of type T
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* interface User { id: number; name: string; email: string }
|
|
41
|
+
*
|
|
42
|
+
* const response = await client.invoke<User>(
|
|
43
|
+
* "SELECT id, name, email FROM users WHERE id = @id",
|
|
44
|
+
* { id: 123 },
|
|
45
|
+
* "get-user-123"
|
|
46
|
+
* );
|
|
47
|
+
*
|
|
48
|
+
* if (response.ok) {
|
|
49
|
+
* const users: User[] = response.result.rows;
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
async invoke(sql, params, invocationKey, timeoutMs) {
|
|
54
|
+
const payload = {
|
|
55
|
+
type: "database",
|
|
56
|
+
subtype: "mssql",
|
|
57
|
+
sql,
|
|
58
|
+
params,
|
|
59
|
+
timeoutMs
|
|
60
|
+
};
|
|
61
|
+
return this.invokeRaw(payload, invocationKey);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=mssql.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/clients/mssql.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n DbMssqlParamValue,\n DbMssqlPayload,\n DatabaseInvokeResponse,\n} from \"../schemas\";\nimport { BaseResourceClient } from \"../base\";\n\nexport class MssqlResourceClient extends BaseResourceClient {\n /**\n * Execute a SQL query against MSSQL\n * @param sql The SQL query to execute\n * @param params Optional named parameters (e.g., { id: 123 } for @id in the query)\n * @param invocationKey Unique key for tracking this invocation\n * @param timeoutMs Optional timeout in milliseconds\n * @returns Typed response with rows of type T\n *\n * @example\n * ```ts\n * interface User { id: number; name: string; email: string }\n *\n * const response = await client.invoke<User>(\n * \"SELECT id, name, email FROM users WHERE id = @id\",\n * { id: 123 },\n * \"get-user-123\"\n * );\n *\n * if (response.ok) {\n * const users: User[] = response.result.rows;\n * }\n * ```\n */\n async invoke<T = Record<string, unknown>>(\n sql: string,\n params: Record<string, DbMssqlParamValue> | undefined,\n invocationKey: string,\n timeoutMs?: number\n ): Promise<DatabaseInvokeResponse<T>> {\n const payload: DbMssqlPayload = {\n type: \"database\",\n subtype: \"mssql\",\n sql,\n params,\n timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<DatabaseInvokeResponse<T>>;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAKA;;;;;AAAA,kBAAmC;AAE7B,MAAO,4BAA4B,+BAAkB;EAF3D,OAE2D;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBzD,MAAM,OACJ,KACA,QACA,eACA,WAAkB;AAElB,UAAM,UAA0B;MAC9B,MAAM;MACN,SAAS;MACT;MACA;MACA;;AAGF,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DbMssqlParamValue, DatabaseInvokeResponse } from "../schemas";
|
|
2
|
+
import { BaseResourceClient } from "../base";
|
|
3
|
+
export declare class MssqlResourceClient extends BaseResourceClient {
|
|
4
|
+
/**
|
|
5
|
+
* Execute a SQL query against MSSQL
|
|
6
|
+
* @param sql The SQL query to execute
|
|
7
|
+
* @param params Optional named parameters (e.g., { id: 123 } for @id in the query)
|
|
8
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
9
|
+
* @param timeoutMs Optional timeout in milliseconds
|
|
10
|
+
* @returns Typed response with rows of type T
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* interface User { id: number; name: string; email: string }
|
|
15
|
+
*
|
|
16
|
+
* const response = await client.invoke<User>(
|
|
17
|
+
* "SELECT id, name, email FROM users WHERE id = @id",
|
|
18
|
+
* { id: 123 },
|
|
19
|
+
* "get-user-123"
|
|
20
|
+
* );
|
|
21
|
+
*
|
|
22
|
+
* if (response.ok) {
|
|
23
|
+
* const users: User[] = response.result.rows;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
invoke<T = Record<string, unknown>>(sql: string, params: Record<string, DbMssqlParamValue> | undefined, invocationKey: string, timeoutMs?: number): Promise<DatabaseInvokeResponse<T>>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=mssql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mssql.d.ts","sourceRoot":"","sources":["../../src/clients/mssql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAAS,EACrD,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;CAWtC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseResourceClient } from "../base";
|
|
2
|
+
export class MssqlResourceClient extends BaseResourceClient {
|
|
3
|
+
/**
|
|
4
|
+
* Execute a SQL query against MSSQL
|
|
5
|
+
* @param sql The SQL query to execute
|
|
6
|
+
* @param params Optional named parameters (e.g., { id: 123 } for @id in the query)
|
|
7
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
8
|
+
* @param timeoutMs Optional timeout in milliseconds
|
|
9
|
+
* @returns Typed response with rows of type T
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* interface User { id: number; name: string; email: string }
|
|
14
|
+
*
|
|
15
|
+
* const response = await client.invoke<User>(
|
|
16
|
+
* "SELECT id, name, email FROM users WHERE id = @id",
|
|
17
|
+
* { id: 123 },
|
|
18
|
+
* "get-user-123"
|
|
19
|
+
* );
|
|
20
|
+
*
|
|
21
|
+
* if (response.ok) {
|
|
22
|
+
* const users: User[] = response.result.rows;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
async invoke(sql, params, invocationKey, timeoutMs) {
|
|
27
|
+
const payload = {
|
|
28
|
+
type: "database",
|
|
29
|
+
subtype: "mssql",
|
|
30
|
+
sql,
|
|
31
|
+
params,
|
|
32
|
+
timeoutMs,
|
|
33
|
+
};
|
|
34
|
+
return this.invokeRaw(payload, invocationKey);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=mssql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mssql.js","sourceRoot":"","sources":["../../src/clients/mssql.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IACzD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,MAAM,CACV,GAAW,EACX,MAAqD,EACrD,aAAqB,EACrB,SAAkB;QAElB,MAAM,OAAO,GAAmB;YAC9B,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,OAAO;YAChB,GAAG;YACH,MAAM;YACN,SAAS;SACV,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAuC,CAAC;IACtF,CAAC;CACF"}
|
|
@@ -27,6 +27,29 @@ class PostgresResourceClient extends import_base.BaseResourceClient {
|
|
|
27
27
|
static {
|
|
28
28
|
__name(this, "PostgresResourceClient");
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Execute a SQL query against PostgreSQL
|
|
32
|
+
* @param sql The SQL query to execute
|
|
33
|
+
* @param params Optional positional parameters ($1, $2, etc.)
|
|
34
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
35
|
+
* @param timeoutMs Optional timeout in milliseconds
|
|
36
|
+
* @returns Typed response with rows of type T
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* interface User { id: number; name: string; email: string }
|
|
41
|
+
*
|
|
42
|
+
* const response = await client.invoke<User>(
|
|
43
|
+
* "SELECT id, name, email FROM users WHERE id = $1",
|
|
44
|
+
* [123],
|
|
45
|
+
* "get-user-123"
|
|
46
|
+
* );
|
|
47
|
+
*
|
|
48
|
+
* if (response.ok) {
|
|
49
|
+
* const users: User[] = response.result.rows;
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
30
53
|
async invoke(sql, params, invocationKey, timeoutMs) {
|
|
31
54
|
const payload = {
|
|
32
55
|
type: "database",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/clients/postgres.ts"],
|
|
4
|
-
"sourcesContent": ["import type {\n DbParamPrimitive,\n DbPostgresPayload,\n DatabaseInvokeResponse,\n} from \"../schemas\";\nimport { BaseResourceClient } from \"../base\";\n\nexport class PostgresResourceClient extends BaseResourceClient {\n async invoke(\n sql: string,\n params: DbParamPrimitive[] | undefined,\n invocationKey: string,\n timeoutMs?: number\n ): Promise<DatabaseInvokeResponse
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAKA;;;;;AAAA,kBAAmC;AAE7B,MAAO,+BAA+B,+BAAkB;EAF9D,OAE8D
|
|
4
|
+
"sourcesContent": ["import type {\n DbParamPrimitive,\n DbPostgresPayload,\n DatabaseInvokeResponse,\n} from \"../schemas\";\nimport { BaseResourceClient } from \"../base\";\n\nexport class PostgresResourceClient extends BaseResourceClient {\n /**\n * Execute a SQL query against PostgreSQL\n * @param sql The SQL query to execute\n * @param params Optional positional parameters ($1, $2, etc.)\n * @param invocationKey Unique key for tracking this invocation\n * @param timeoutMs Optional timeout in milliseconds\n * @returns Typed response with rows of type T\n *\n * @example\n * ```ts\n * interface User { id: number; name: string; email: string }\n *\n * const response = await client.invoke<User>(\n * \"SELECT id, name, email FROM users WHERE id = $1\",\n * [123],\n * \"get-user-123\"\n * );\n *\n * if (response.ok) {\n * const users: User[] = response.result.rows;\n * }\n * ```\n */\n async invoke<T = Record<string, unknown>>(\n sql: string,\n params: DbParamPrimitive[] | undefined,\n invocationKey: string,\n timeoutMs?: number\n ): Promise<DatabaseInvokeResponse<T>> {\n const payload: DbPostgresPayload = {\n type: \"database\",\n subtype: \"postgresql\",\n sql,\n params,\n timeoutMs,\n };\n\n return this.invokeRaw(payload, invocationKey) as Promise<DatabaseInvokeResponse<T>>;\n }\n}\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAKA;;;;;AAAA,kBAAmC;AAE7B,MAAO,+BAA+B,+BAAkB;EAF9D,OAE8D;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB5D,MAAM,OACJ,KACA,QACA,eACA,WAAkB;AAElB,UAAM,UAA6B;MACjC,MAAM;MACN,SAAS;MACT;MACA;MACA;;AAGF,WAAO,KAAK,UAAU,SAAS,aAAa;EAC9C;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import type { DbParamPrimitive, DatabaseInvokeResponse } from "../schemas";
|
|
2
2
|
import { BaseResourceClient } from "../base";
|
|
3
3
|
export declare class PostgresResourceClient extends BaseResourceClient {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Execute a SQL query against PostgreSQL
|
|
6
|
+
* @param sql The SQL query to execute
|
|
7
|
+
* @param params Optional positional parameters ($1, $2, etc.)
|
|
8
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
9
|
+
* @param timeoutMs Optional timeout in milliseconds
|
|
10
|
+
* @returns Typed response with rows of type T
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* interface User { id: number; name: string; email: string }
|
|
15
|
+
*
|
|
16
|
+
* const response = await client.invoke<User>(
|
|
17
|
+
* "SELECT id, name, email FROM users WHERE id = $1",
|
|
18
|
+
* [123],
|
|
19
|
+
* "get-user-123"
|
|
20
|
+
* );
|
|
21
|
+
*
|
|
22
|
+
* if (response.ok) {
|
|
23
|
+
* const users: User[] = response.result.rows;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
invoke<T = Record<string, unknown>>(sql: string, params: DbParamPrimitive[] | undefined, invocationKey: string, timeoutMs?: number): Promise<DatabaseInvokeResponse<T>>;
|
|
5
28
|
}
|
|
6
29
|
//# sourceMappingURL=postgres.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/clients/postgres.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,sBAAuB,SAAQ,kBAAkB;
|
|
1
|
+
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/clients/postgres.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,gBAAgB,EAAE,GAAG,SAAS,EACtC,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;CAWtC"}
|
package/dist/clients/postgres.js
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import { BaseResourceClient } from "../base";
|
|
2
2
|
export class PostgresResourceClient extends BaseResourceClient {
|
|
3
|
+
/**
|
|
4
|
+
* Execute a SQL query against PostgreSQL
|
|
5
|
+
* @param sql The SQL query to execute
|
|
6
|
+
* @param params Optional positional parameters ($1, $2, etc.)
|
|
7
|
+
* @param invocationKey Unique key for tracking this invocation
|
|
8
|
+
* @param timeoutMs Optional timeout in milliseconds
|
|
9
|
+
* @returns Typed response with rows of type T
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* interface User { id: number; name: string; email: string }
|
|
14
|
+
*
|
|
15
|
+
* const response = await client.invoke<User>(
|
|
16
|
+
* "SELECT id, name, email FROM users WHERE id = $1",
|
|
17
|
+
* [123],
|
|
18
|
+
* "get-user-123"
|
|
19
|
+
* );
|
|
20
|
+
*
|
|
21
|
+
* if (response.ok) {
|
|
22
|
+
* const users: User[] = response.result.rows;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
3
26
|
async invoke(sql, params, invocationKey, timeoutMs) {
|
|
4
27
|
const payload = {
|
|
5
28
|
type: "database",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.js","sourceRoot":"","sources":["../../src/clients/postgres.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D,KAAK,CAAC,MAAM,CACV,GAAW,EACX,MAAsC,EACtC,aAAqB,EACrB,SAAkB;QAElB,MAAM,OAAO,GAAsB;YACjC,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,YAAY;YACrB,GAAG;YACH,MAAM;YACN,SAAS;SACV,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"postgres.js","sourceRoot":"","sources":["../../src/clients/postgres.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,MAAM,CACV,GAAW,EACX,MAAsC,EACtC,aAAqB,EACrB,SAAkB;QAElB,MAAM,OAAO,GAAsB;YACjC,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,YAAY;YACrB,GAAG;YACH,MAAM;YACN,SAAS;SACV,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAuC,CAAC;IACtF,CAAC;CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
DynamoDBResourceClient: () => import_dynamodb.DynamoDBResourceClient,
|
|
26
26
|
GoogleSheetsResourceClient: () => import_googlesheets.GoogleSheetsResourceClient,
|
|
27
27
|
HubSpotResourceClient: () => import_hubspot.HubSpotResourceClient,
|
|
28
|
+
MssqlResourceClient: () => import_mssql.MssqlResourceClient,
|
|
28
29
|
PostgresResourceClient: () => import_postgres.PostgresResourceClient,
|
|
29
30
|
ResourceInvokeError: () => import_errors.ResourceInvokeError,
|
|
30
31
|
S3ResourceClient: () => import_s3.S3ResourceClient,
|
|
@@ -35,6 +36,7 @@ __reExport(index_exports, require("./schemas"), module.exports);
|
|
|
35
36
|
var import_base = require("./base");
|
|
36
37
|
var import_errors = require("./errors");
|
|
37
38
|
var import_postgres = require("./clients/postgres");
|
|
39
|
+
var import_mssql = require("./clients/mssql");
|
|
38
40
|
var import_dynamodb = require("./clients/dynamodb");
|
|
39
41
|
var import_cosmosdb = require("./clients/cosmosdb");
|
|
40
42
|
var import_snowflake = require("./clients/snowflake");
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["// Export all schemas and types\nexport * from \"./schemas\";\n\n// Export base client and config\nexport { BaseResourceClient, type BaseClientConfig } from \"./base\";\n\n// Export errors\nexport { ResourceInvokeError } from \"./errors\";\n\n// Export individual clients\nexport { PostgresResourceClient } from \"./clients/postgres\";\nexport { DynamoDBResourceClient } from \"./clients/dynamodb\";\nexport { CosmosDBResourceClient } from \"./clients/cosmosdb\";\nexport { SnowflakeResourceClient } from \"./clients/snowflake\";\nexport { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { GoogleSheetsResourceClient } from \"./clients/googlesheets\";\nexport { S3ResourceClient } from \"./clients/s3\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n CosmosDBInvokeResponse,\n SnowflakeInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\n BaseInvokeSuccess,\n} from \"./schemas/response\";\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA
|
|
4
|
+
"sourcesContent": ["// Export all schemas and types\nexport * from \"./schemas\";\n\n// Export base client and config\nexport { BaseResourceClient, type BaseClientConfig } from \"./base\";\n\n// Export errors\nexport { ResourceInvokeError } from \"./errors\";\n\n// Export individual clients\nexport { PostgresResourceClient } from \"./clients/postgres\";\nexport { MssqlResourceClient } from \"./clients/mssql\";\nexport { DynamoDBResourceClient } from \"./clients/dynamodb\";\nexport { CosmosDBResourceClient } from \"./clients/cosmosdb\";\nexport { SnowflakeResourceClient } from \"./clients/snowflake\";\nexport { CustomApiResourceClient } from \"./clients/api-custom\";\nexport { HubSpotResourceClient } from \"./clients/hubspot\";\nexport { GoogleSheetsResourceClient } from \"./clients/googlesheets\";\nexport { S3ResourceClient } from \"./clients/s3\";\n\n// Re-export common response types for convenience\nexport type {\n DatabaseInvokeResponse,\n DynamoDBInvokeResponse,\n CosmosDBInvokeResponse,\n SnowflakeInvokeResponse,\n ApiInvokeResponse,\n StorageInvokeResponse,\n BaseInvokeSuccess,\n} from \"./schemas/response\";\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AACA,0BAAc,sBADd;AAIA,kBAA0D;AAG1D,oBAAoC;AAGpC,sBAAuC;AACvC,mBAAoC;AACpC,sBAAuC;AACvC,sBAAuC;AACvC,uBAAwC;AACxC,wBAAwC;AACxC,qBAAsC;AACtC,0BAA2C;AAC3C,gBAAiC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./schemas";
|
|
|
2
2
|
export { BaseResourceClient, type BaseClientConfig } from "./base";
|
|
3
3
|
export { ResourceInvokeError } from "./errors";
|
|
4
4
|
export { PostgresResourceClient } from "./clients/postgres";
|
|
5
|
+
export { MssqlResourceClient } from "./clients/mssql";
|
|
5
6
|
export { DynamoDBResourceClient } from "./clients/dynamodb";
|
|
6
7
|
export { CosmosDBResourceClient } from "./clients/cosmosdb";
|
|
7
8
|
export { SnowflakeResourceClient } from "./clients/snowflake";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,WAAW,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAGnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAA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AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { BaseResourceClient } from "./base";
|
|
|
6
6
|
export { ResourceInvokeError } from "./errors";
|
|
7
7
|
// Export individual clients
|
|
8
8
|
export { PostgresResourceClient } from "./clients/postgres";
|
|
9
|
+
export { MssqlResourceClient } from "./clients/mssql";
|
|
9
10
|
export { DynamoDBResourceClient } from "./clients/dynamodb";
|
|
10
11
|
export { CosmosDBResourceClient } from "./clients/cosmosdb";
|
|
11
12
|
export { SnowflakeResourceClient } from "./clients/snowflake";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,cAAc,WAAW,CAAC;AAE1B,gCAAgC;AAChC,OAAO,EAAE,kBAAkB,EAAyB,MAAM,QAAQ,CAAC;AAEnE,gBAAgB;AAChB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,4BAA4B;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,cAAc,WAAW,CAAC;AAE1B,gCAAgC;AAChC,OAAO,EAAE,kBAAkB,EAAyB,MAAM,QAAQ,CAAC;AAEnE,gBAAgB;AAChB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,4BAA4B;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/schemas/index.cjs
CHANGED
|
@@ -17,6 +17,7 @@ var index_exports = {};
|
|
|
17
17
|
module.exports = __toCommonJS(index_exports);
|
|
18
18
|
__reExport(index_exports, require("./common"), module.exports);
|
|
19
19
|
__reExport(index_exports, require("./postgres"), module.exports);
|
|
20
|
+
__reExport(index_exports, require("./mssql"), module.exports);
|
|
20
21
|
__reExport(index_exports, require("./dynamodb"), module.exports);
|
|
21
22
|
__reExport(index_exports, require("./cosmosdb"), module.exports);
|
|
22
23
|
__reExport(index_exports, require("./snowflake"), module.exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/schemas/index.ts"],
|
|
4
|
-
"sourcesContent": ["// Re-export all types\nexport * from \"./common\";\nexport * from \"./postgres\";\nexport * from \"./dynamodb\";\nexport * from \"./cosmosdb\";\nexport * from \"./snowflake\";\nexport * from \"./s3\";\nexport * from \"./api-custom\";\nexport * from \"./api-hubspot\";\nexport * from \"./api-googlesheets\";\nexport * from \"./request\";\nexport * from \"./response\";\n\n// Import for discriminated union\nimport type { ApiCustomPayload } from \"./api-custom\";\nimport type { ApiHubSpotPayload } from \"./api-hubspot\";\nimport type { ApiGoogleSheetsPayload } from \"./api-googlesheets\";\nimport type { DbPostgresPayload } from \"./postgres\";\nimport type { DbDynamoDBPayload } from \"./dynamodb\";\nimport type { DbCosmosDBPayload } from \"./cosmosdb\";\nimport type { DbSnowflakePayload } from \"./snowflake\";\nimport type { StorageS3Payload } from \"./s3\";\n\n/**\n * Discriminated union of all resource payload types\n * Use the 'subtype' field to narrow the type\n */\nexport type ResourceInvokePayload =\n | ApiCustomPayload\n | DbPostgresPayload\n | DbDynamoDBPayload\n | DbCosmosDBPayload\n | DbSnowflakePayload\n | ApiHubSpotPayload\n | ApiGoogleSheetsPayload\n | StorageS3Payload;\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;;AACA,0BAAc,qBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,
|
|
4
|
+
"sourcesContent": ["// Re-export all types\nexport * from \"./common\";\nexport * from \"./postgres\";\nexport * from \"./mssql\";\nexport * from \"./dynamodb\";\nexport * from \"./cosmosdb\";\nexport * from \"./snowflake\";\nexport * from \"./s3\";\nexport * from \"./api-custom\";\nexport * from \"./api-hubspot\";\nexport * from \"./api-googlesheets\";\nexport * from \"./request\";\nexport * from \"./response\";\n\n// Import for discriminated union\nimport type { ApiCustomPayload } from \"./api-custom\";\nimport type { ApiHubSpotPayload } from \"./api-hubspot\";\nimport type { ApiGoogleSheetsPayload } from \"./api-googlesheets\";\nimport type { DbPostgresPayload } from \"./postgres\";\nimport type { DbMssqlPayload } from \"./mssql\";\nimport type { DbDynamoDBPayload } from \"./dynamodb\";\nimport type { DbCosmosDBPayload } from \"./cosmosdb\";\nimport type { DbSnowflakePayload } from \"./snowflake\";\nimport type { StorageS3Payload } from \"./s3\";\n\n/**\n * Discriminated union of all resource payload types\n * Use the 'subtype' field to narrow the type\n */\nexport type ResourceInvokePayload =\n | ApiCustomPayload\n | DbPostgresPayload\n | DbMssqlPayload\n | DbDynamoDBPayload\n | DbCosmosDBPayload\n | DbSnowflakePayload\n | ApiHubSpotPayload\n | ApiGoogleSheetsPayload\n | StorageS3Payload;\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;AACA,0BAAc,qBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,oBAHd;AAIA,0BAAc,uBAJd;AAKA,0BAAc,uBALd;AAMA,0BAAc,wBANd;AAOA,0BAAc,iBAPd;AAQA,0BAAc,yBARd;AASA,0BAAc,0BATd;AAUA,0BAAc,+BAVd;AAWA,0BAAc,sBAXd;AAYA,0BAAc,uBAZd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./common";
|
|
2
2
|
export * from "./postgres";
|
|
3
|
+
export * from "./mssql";
|
|
3
4
|
export * from "./dynamodb";
|
|
4
5
|
export * from "./cosmosdb";
|
|
5
6
|
export * from "./snowflake";
|
|
@@ -13,6 +14,7 @@ import type { ApiCustomPayload } from "./api-custom";
|
|
|
13
14
|
import type { ApiHubSpotPayload } from "./api-hubspot";
|
|
14
15
|
import type { ApiGoogleSheetsPayload } from "./api-googlesheets";
|
|
15
16
|
import type { DbPostgresPayload } from "./postgres";
|
|
17
|
+
import type { DbMssqlPayload } from "./mssql";
|
|
16
18
|
import type { DbDynamoDBPayload } from "./dynamodb";
|
|
17
19
|
import type { DbCosmosDBPayload } from "./cosmosdb";
|
|
18
20
|
import type { DbSnowflakePayload } from "./snowflake";
|
|
@@ -21,5 +23,5 @@ import type { StorageS3Payload } from "./s3";
|
|
|
21
23
|
* Discriminated union of all resource payload types
|
|
22
24
|
* Use the 'subtype' field to narrow the type
|
|
23
25
|
*/
|
|
24
|
-
export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | DbDynamoDBPayload | DbCosmosDBPayload | DbSnowflakePayload | ApiHubSpotPayload | ApiGoogleSheetsPayload | StorageS3Payload;
|
|
26
|
+
export type ResourceInvokePayload = ApiCustomPayload | DbPostgresPayload | DbMssqlPayload | DbDynamoDBPayload | DbCosmosDBPayload | DbSnowflakePayload | ApiHubSpotPayload | ApiGoogleSheetsPayload | StorageS3Payload;
|
|
25
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAG3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,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GACjB,sBAAsB,GACtB,gBAAgB,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var mssql_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(mssql_exports);
|
|
17
|
+
//# sourceMappingURL=mssql.cjs.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allowed types for MSSQL query parameters (named parameters)
|
|
3
|
+
*/
|
|
4
|
+
export type DbMssqlParamValue = string | number | boolean | null;
|
|
5
|
+
/**
|
|
6
|
+
* Payload for invoking a Microsoft SQL Server database resource
|
|
7
|
+
*/
|
|
8
|
+
export interface DbMssqlPayload {
|
|
9
|
+
type: "database";
|
|
10
|
+
subtype: "mssql";
|
|
11
|
+
/** SQL query to execute */
|
|
12
|
+
sql: string;
|
|
13
|
+
/** Optional named parameters for the query (e.g., { id: 123 } for @id) */
|
|
14
|
+
params?: Record<string, DbMssqlParamValue>;
|
|
15
|
+
/** Optional timeout in milliseconds */
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=mssql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mssql.d.ts","sourceRoot":"","sources":["../../src/schemas/mssql.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC3C,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mssql.js","sourceRoot":"","sources":["../../src/schemas/mssql.ts"],"names":[],"mappings":""}
|
|
@@ -16,12 +16,12 @@ export interface DbPostgresPayload {
|
|
|
16
16
|
timeoutMs?: number;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Result from a database query execution
|
|
19
|
+
* Result from a database query execution with typed rows
|
|
20
20
|
*/
|
|
21
|
-
export interface DbResult {
|
|
21
|
+
export interface DbResult<T = Record<string, unknown>> {
|
|
22
22
|
kind: "database";
|
|
23
23
|
/** Array of row objects returned by the query */
|
|
24
|
-
rows:
|
|
24
|
+
rows: T[];
|
|
25
25
|
/** Number of rows affected by the query (for INSERT, UPDATE, DELETE) */
|
|
26
26
|
rowsAffected?: number;
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/schemas/postgres.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,YAAY,CAAC;IACtB,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;
|
|
1
|
+
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/schemas/postgres.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,YAAY,CAAC;IACtB,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnD,IAAI,EAAE,UAAU,CAAC;IACjB,iDAAiD;IACjD,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -40,9 +40,9 @@ export interface InvokeFailure {
|
|
|
40
40
|
*/
|
|
41
41
|
export type InvokeResponse = InvokeSuccess | InvokeFailure;
|
|
42
42
|
/**
|
|
43
|
-
* Response from database resource invocation
|
|
43
|
+
* Response from database resource invocation (generic for typed rows)
|
|
44
44
|
*/
|
|
45
|
-
export type DatabaseInvokeResponse = BaseInvokeSuccess<DbResult
|
|
45
|
+
export type DatabaseInvokeResponse<T = Record<string, unknown>> = BaseInvokeSuccess<DbResult<T>> | InvokeFailure;
|
|
46
46
|
/**
|
|
47
47
|
* Response from API resource invocation (custom or HubSpot)
|
|
48
48
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/schemas/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB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